/* LAB-QUEST-20261129 — отдельные стили локального прототипа.
   Тёплый коричневый фон, электрически-синие органические нити, без маркерных шариков. */
:root {
  --bg-1: #3b2a1d;
  --bg-2: #24170f;
  --bg-3: #120c08;
  --cream: #f5e9d6;
  --cream-dim: #d7c4aa;
  --gold: #e7c98f;
  --blue: #3fb6f2;
  --cyan: #8fe1f5;
  --line: rgba(143, 225, 245, 0.35);
  --panel-bg: rgba(24, 16, 10, 0.975);
  --panel-border: rgba(231, 201, 143, 0.28);
  --focus: #ffe2a8;
  --radius: 16px;
  --zoom-duration: 800ms;
  --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(1200px 680px at 50% 18%, rgba(0, 140, 255, 0.10), rgba(0, 140, 255, 0) 58%),
    radial-gradient(900px 600px at 50% 96%, rgba(140, 106, 62, 0.26), rgba(140, 106, 62, 0) 60%),
    linear-gradient(180deg, #32200f 0%, #24170f 45%, #170d07 100%);
  background-color: #24170f;
  background-attachment: fixed;
  overflow-x: hidden;
}
body.reduced { --zoom-duration: 1ms; }
body.reduced *, body.reduced *::before, body.reduced *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
body.overlay-open { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--cream); color: var(--bg-3); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.topbar {
  min-height: 60px; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid rgba(231, 201, 143, 0.14);
  background: rgba(18, 12, 8, 0.55);
}
.brand { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.brand-line { color: var(--gold); font-size: 12px; letter-spacing: 0.12em; }
.proto-badge {
  font-size: 11px; color: var(--cream-dim);
  border: 1px solid rgba(231, 201, 143, 0.3); border-radius: 999px; padding: 3px 10px;
}
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost-btn, .primary-btn, .back-btn, .icon-btn {
  border-radius: 10px; border: 1px solid rgba(231, 201, 143, 0.35);
  background: rgba(20, 13, 9, 0.65); padding: 9px 14px; min-height: 42px;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.ghost-btn:hover, .back-btn:hover, .icon-btn:hover { background: rgba(63, 182, 242, 0.14); border-color: var(--blue); }
.primary-btn {
  background: linear-gradient(135deg, #d8b26e, #f0d7a4); color: #29190d; font-weight: 700; border-color: transparent;
}
.primary-btn:hover { transform: translateY(-1px); }
.icon-btn { min-width: 42px; padding: 8px 10px; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}

.app-main { display: flex; align-items: stretch; min-height: calc(100vh - 61px); }
.stage-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.stage {
  position: relative; width: 100%; height: calc(100vh - 61px); min-height: 560px;
  overflow: hidden; isolation: isolate;
  background:
    radial-gradient(1200px 680px at 50% 18%, rgba(0, 140, 255, 0.10), rgba(0, 140, 255, 0) 58%),
    radial-gradient(900px 600px at 50% 96%, rgba(140, 106, 62, 0.26), rgba(140, 106, 62, 0) 60%),
    linear-gradient(180deg, #32200f 0%, #24170f 45%, #170d07 100%);
  background-color: #24170f;
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(231,201,143,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(231,201,143,.035) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 25%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 25%, transparent 100%);
}
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  box-shadow: inset 0 0 180px rgba(0,0,0,0.55);
}
#lab-threads { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.world {
  position: absolute; inset: 0; z-index: 1;
  transform: none !important;
  pointer-events: none;
}
.node {
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none;
  transform: translate(-50%, -50%); pointer-events: auto;
}
.node span {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.node.core { width: 56px; height: 56px; }
.node:focus-visible { outline: 2px solid #ffe2a8; outline-offset: 3px; border-radius: 50%; }
.node.is-focused, .node.is-related, .node.is-visited { border: 0; box-shadow: none; background: transparent; }

.satellites { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.satellite-caption {
  position: absolute; margin: 0; transform: translate(-50%, -140%);
  color: var(--cream); font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); pointer-events: none; white-space: nowrap;
}
.satellite-grid { position: absolute; inset: 0; }
.satellite {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 138px; min-height: 58px; padding: 8px 8px; pointer-events: auto;
  border-radius: 14px; border: 1px solid rgba(143, 225, 245, 0.5);
  background: linear-gradient(145deg, rgba(21, 47, 66, 0.78), rgba(12, 22, 34, 0.78));
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 14px rgba(63, 182, 242, 0.14);
  font-size: 13px; font-weight: 600; line-height: 1.2;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
  animation: pop-in 420ms var(--ease) both;
}
.satellite small { display: block; font-size: 11px; font-weight: 400; color: var(--cream-dim); margin-top: 4px; }
.satellite:hover { border-color: #fff; background: linear-gradient(145deg, rgba(30, 74, 100, 0.96), rgba(16, 34, 50, 0.96)); }
.satellite.is-active { border-color: var(--gold); }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -35%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.stage-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%);
  margin: 0; padding: 8px 16px; max-width: min(90%, 620px); text-align: center;
  color: var(--cream-dim); font-size: 13px; border-radius: 999px;
  background: rgba(18, 12, 8, 0.6); border: 1px solid rgba(231, 201, 143, 0.16);
}
.back-btn { position: absolute; z-index: 4; left: 20px; top: 18px; color: var(--cream); }
.welcome {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92%, 540px); padding: 26px 28px; border-radius: 22px;
  background: rgba(20, 13, 9, 0.93); border: 1px solid var(--panel-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); text-align: center;
}
.welcome-kicker, .panel-kicker { margin: 0 0 8px; color: var(--gold); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.welcome h1 { margin: 0 0 12px; font-size: clamp(26px, 4vw, 38px); font-weight: 700; }
.welcome-text { margin: 0 0 18px; color: var(--cream-dim); line-height: 1.55; font-size: 15px; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.welcome-note { margin: 16px 0 0; font-size: 12px; color: rgba(215, 196, 170, 0.75); }

.panel {
  flex: 0 0 390px; width: 390px; z-index: 8;
  background: var(--panel-bg); border-left: 1px solid var(--panel-border);
  display: flex; flex-direction: column; min-height: 0;
  animation: slide-in 300ms var(--ease) both;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 20px 20px 14px; border-bottom: 1px solid rgba(231, 201, 143, 0.16);
}
.panel-head h2 { margin: 0; font-size: 21px; line-height: 1.25; }
.panel-body { padding: 18px 20px 26px; overflow-y: auto; flex: 1 1 auto; }
.panel-foot {
  padding: 14px 20px 20px; border-top: 1px solid rgba(231, 201, 143, 0.16);
  display: flex; flex-wrap: wrap; gap: 8px;
  flex: 0 0 auto; max-height: 46%; overflow-y: auto;
}
.panel p { line-height: 1.6; }
.lead { color: var(--cream-dim); font-size: 15px; margin-top: 0; }
.block { margin: 0 0 18px; padding: 14px 16px; border-left: 2px solid rgba(63, 182, 242, 0.55); border-radius: 0 12px 12px 0; background: rgba(63, 182, 242, 0.06); }
.block.warm { border-left-color: var(--gold); background: rgba(231, 201, 143, 0.06); }
.block h3 { margin: 0 0 8px; font-size: 15px; }
.block p { margin: 0 0 8px; font-size: 14px; }
.block p:last-child { margin-bottom: 0; }
.muted { color: var(--cream-dim); font-size: 13px; }
.insight-box { border: 1px dashed rgba(231, 201, 143, 0.55); border-radius: 14px; padding: 16px; background: rgba(231, 201, 143, 0.07); }
.question-list { margin: 0; padding-left: 20px; }
.question-list li { margin: 0 0 8px; line-height: 1.5; }
.opt-list { display: grid; gap: 8px; margin: 12px 0 0; }
.opt {
  text-align: left; width: 100%; padding: 11px 13px; min-height: 44px;
  border-radius: 10px; border: 1px solid rgba(143, 225, 245, 0.35);
  background: rgba(10, 24, 36, 0.55); font-size: 14px;
}
.opt:hover { border-color: var(--cyan); }
.opt[aria-pressed="true"] { border-color: var(--gold); background: rgba(231, 201, 143, 0.16); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.article-card, .history-item, .experiment-card, .insight-card {
  border-radius: 12px; border: 1px solid rgba(231, 201, 143, 0.2);
  background: rgba(255, 255, 255, 0.03); padding: 12px 14px; margin-bottom: 10px;
}
.article-card h4, .history-item h4, .experiment-card h4, .insight-card h4 { margin: 0 0 6px; font-size: 15px; }
.article-card p { margin: 0 0 8px; font-size: 13px; color: var(--cream-dim); line-height: 1.5; }
.link-btn {
  border: 0; background: none; padding: 4px 0; color: var(--cyan); text-decoration: underline;
  font-size: 14px; min-height: 32px;
}
.link-btn:hover { color: #fff; }
.status-line { margin-top: 12px; font-size: 13px; color: var(--gold); }

.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(8, 5, 3, 0.7); }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; }
.modal-card {
  width: min(94%, 520px); max-height: 88vh; overflow-y: auto; padding: 24px;
  border-radius: 20px; background: #1b120c; border: 1px solid var(--panel-border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-card h2 { margin: 0 0 12px; font-size: 22px; }
.modal-card p { line-height: 1.6; color: var(--cream-dim); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.dashboard { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; }
.dashboard-card {
  width: min(96%, 1080px); height: min(90vh, 820px); display: flex; flex-direction: column;
  border-radius: 22px; background: #1a110b; border: 1px solid var(--panel-border); overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}
.dashboard-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid rgba(231, 201, 143, 0.16); }
.dashboard-head h2 { margin: 0; font-size: 24px; }
.dashboard-layout { display: flex; flex: 1 1 auto; min-height: 0; }
.dash-tabs {
  flex: 0 0 190px; overflow-y: auto; padding: 14px 10px;
  border-right: 1px solid rgba(231, 201, 143, 0.16); display: flex; flex-direction: column; gap: 4px;
}
.dash-tab {
  text-align: left; padding: 10px 12px; min-height: 42px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--cream-dim);
}
.dash-tab:hover { background: rgba(63, 182, 242, 0.1); color: var(--cream); }
.dash-tab[aria-selected="true"] { background: rgba(231, 201, 143, 0.14); color: var(--cream); border-color: var(--panel-border); }
.dash-content { flex: 1 1 auto; overflow-y: auto; padding: 20px 24px 30px; }
.dash-content:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.dash-content h3 { margin: 0 0 12px; font-size: 20px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.map-node {
  min-height: 64px; padding: 10px; border-radius: 12px; text-align: left;
  border: 1px solid rgba(143, 225, 245, 0.2); background: rgba(63, 182, 242, 0.05); font-size: 13px;
}
.map-node.visited { border-color: var(--gold); background: rgba(231, 201, 143, 0.12); }
.map-node .map-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: rgba(215, 196, 170, 0.35); margin-right: 6px; }
.map-node.visited .map-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.map-node small { display: block; color: var(--cream-dim); margin-top: 4px; }
.empty { color: var(--cream-dim); font-size: 14px; line-height: 1.6; }
.metric-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.metric { border: 1px solid rgba(143, 225, 245, 0.24); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.metric b { font-size: 18px; color: var(--cyan); display: block; }
.demo-note { border-left: 2px solid var(--gold); padding-left: 12px; color: var(--cream-dim); font-size: 13px; line-height: 1.6; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 999px; background: #2a1d12; border: 1px solid var(--panel-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 14px; max-width: 92%; text-align: center;
}

@media (max-width: 900px) {
  .app-main { display: block; }
  .stage { height: calc(100svh - 108px); min-height: 520px; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; flex: none;
    height: min(78vh, 620px); border-left: 0; border-top: 1px solid var(--panel-border);
    border-radius: 18px 18px 0 0; animation: sheet-in 320ms var(--ease) both;
  }
  .panel-body { min-height: 170px; }
  .panel-foot { max-height: 42%; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .dashboard { padding: 0; }
  .dashboard-card { width: 100%; height: 100%; border-radius: 0; }
  .dash-tabs { flex-basis: 140px; }
  .topbar { padding: 8px 12px; }
  .brand-line { font-size: 10px; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .brand { flex: 1 1 100%; }
  .top-actions { width: 100%; }
  .top-actions .ghost-btn {
    flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 11px;
    line-height: 1.1; min-height: 40px; overflow-wrap: anywhere;
  }
  .stage { height: calc(100svh - 132px); min-height: 500px; }
  .node { width: 44px; height: 44px; }
  .node.core { width: 56px; height: 56px; }
  .satellite { width: min(142px, 43vw); min-height: 54px; font-size: 12px; }
  .satellite small { font-size: 10px; }
  .satellite-caption { font-size: 12px; white-space: normal; width: 80%; text-align: center; }
  .welcome { padding: 20px 17px; width: 94%; }
  .welcome h1 { font-size: 26px; }
  .welcome-text { font-size: 14px; }
  .back-btn { left: 12px; top: 10px; min-height: 40px; font-size: 13px; }
  .stage-hint { bottom: 12px; font-size: 12px; padding: 7px 12px; }
  .panel-head { padding: 16px 16px 12px; }
  .panel-body { padding: 14px 16px 22px; }
  .panel-foot { padding: 12px 16px 16px; }
  .panel-head h2 { font-size: 19px; }
  .dashboard-layout { flex-direction: column; }
  .dash-tabs { flex: none; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(231, 201, 143, 0.16); padding: 8px; }
  .dash-tab { flex: 0 0 auto; white-space: nowrap; font-size: 13px; }
  .dash-content { padding: 16px; }
  .modal-card { padding: 20px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

.resume-chip {
  position: absolute; z-index: 4; left: 50%; bottom: 58px; transform: translateX(-50%);
  border: 1px solid rgba(217,183,139,.55); border-radius: 999px; padding: 8px 16px;
  background: rgba(24,16,10,.82); color: #f0d7a4; font-size: 13px; min-height: 38px;
}
.resume-chip:hover { background: rgba(48,35,25,.92); }
