/* ============================================================
   SRM Help — shared design system
   Same visual language established across all 11 guide artifacts:
   dark navy rail, teal accent, IBM Plex Sans/Mono + Inter.
   ============================================================ */

:root{
  --bg:#F1F5F9;
  --card:#FFFFFF;
  --card-2:#F8FAFC;
  --ink:#1E293B;
  --ink-soft:#64748B;
  --ink-faint:#94A3B8;
  --rule:#E2E8F0;
  --rule-soft:#EDF1F5;
  --accent:#0D9488;
  --accent-light:#14B8A6;
  --accent-ink:#FFFFFF;
  --accent-soft:#CCFBF1;
  --admin:#D97706;
  --admin-soft:#FEF3C7;
  --danger:#DC2626;
  --danger-soft:#FEE2E2;
  --shadow: 0 1px 2px rgba(15,23,42,0.05), 0 18px 36px -18px rgba(15,23,42,0.28);

  /* sidebar stays constant dark navy in both themes, explicitly declared */
  --side-bg:#0F172A;
  --side-bg-2:#0B1322;
  --side-ink:#E2E8F0;
  --side-ink-soft:#8CA0B3;
  --side-ink-faint:#5B6B80;
  --side-rule:#22304433;
  --side-active-bg:rgba(45,212,191,0.14);
  --side-active-ink:#5EEAD4;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0B1420;
    --card:#111C2B;
    --card-2:#0E1826;
    --ink:#E7ECF3;
    --ink-soft:#93A4B8;
    --ink-faint:#5C6E82;
    --rule:#20304A;
    --rule-soft:#182739;
    --accent:#2DD4BF;
    --accent-light:#5EEAD4;
    --accent-ink:#04211D;
    --accent-soft:#0F3B36;
    --admin:#FBBF24;
    --admin-soft:#3F2D0A;
    --danger:#F87171;
    --danger-soft:#3B0A0A;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 20px 40px -20px rgba(0,0,0,0.65);
  }
}
:root[data-theme="dark"]{
  --bg:#0B1420;
  --card:#111C2B;
  --card-2:#0E1826;
  --ink:#E7ECF3;
  --ink-soft:#93A4B8;
  --ink-faint:#5C6E82;
  --rule:#20304A;
  --rule-soft:#182739;
  --accent:#2DD4BF;
  --accent-light:#5EEAD4;
  --accent-ink:#04211D;
  --accent-soft:#0F3B36;
  --admin:#FBBF24;
  --admin-soft:#3F2D0A;
  --danger:#F87171;
  --danger-soft:#3B0A0A;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 20px 40px -20px rgba(0,0,0,0.65);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter', ui-sans-serif, system-ui, sans-serif;
  margin:0;
  -webkit-font-smoothing:antialiased;
}
::selection{ background:var(--accent-soft); color:var(--ink); }
a{ color:var(--accent); }
img{ max-width:100%; }

.mono{ font-family:'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
.display{ font-family:'IBM Plex Sans', 'Inter', sans-serif; font-weight:700; letter-spacing:-0.01em; text-wrap:balance; }

/* ---------- App shell ---------- */
.app{
  display:grid;
  grid-template-columns: 340px 1fr;
  min-height:100vh;
}
@media (max-width: 900px){
  .app{ grid-template-columns: 1fr; }
  .rail{ position:static; height:auto; max-height:340px; }
}

/* ---------- Rail (persistent sidebar) ---------- */
.rail{
  background:var(--side-bg);
  color:var(--side-ink);
  padding:22px 0 28px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
  border-right:1px solid var(--side-rule);
}
.rail-head{ padding:0 22px 18px; border-bottom:1px solid var(--side-rule); margin-bottom:6px; }
.rail-brand{ display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.rail-logo{ height:26px; flex:none; display:block; }
.rail-icon{ height:26px; width:26px; flex:none; display:block; border-radius:6px; }
.hero-logo{ height:34px; display:block; margin-bottom:18px; }
.rail-mark{
  width:30px; height:30px; border-radius:8px;
  background:var(--accent); color:var(--accent-ink);
  display:flex; align-items:center; justify-content:center;
  font-family:'IBM Plex Sans', sans-serif; font-weight:700; font-size:12.5px;
  flex:none;
}
.rail-title{ font-family:'IBM Plex Sans', sans-serif; font-weight:700; font-size:16px; color:#FFFFFF; }
.rail-sub{ font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:0.06em; color:var(--side-ink-faint); }
.rail-desc{ font-size:12.5px; color:var(--side-ink-soft); line-height:1.5; margin-top:10px; }

.rail-tabs{ display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; padding:14px 16px 4px; }
.rail-tab{
  min-width:0; text-align:center; font-family:'Inter',sans-serif; font-weight:600; font-size:11px;
  padding:8px 3px; border-radius:8px; cursor:pointer; border:1px solid var(--side-rule);
  background:transparent; color:var(--side-ink-soft);
  white-space:normal; line-height:1.25; overflow-wrap:break-word;
}
.rail-tab.active{ background:var(--side-active-bg); color:var(--side-active-ink); border-color:transparent; }

.rail-search{ padding:14px 22px 6px; }
.rail-search input{
  width:100%; padding:9px 12px; border-radius:8px; border:1px solid var(--side-rule);
  background:var(--side-bg-2); color:var(--side-ink); font-family:'Inter',sans-serif; font-size:13px;
}
.rail-search input::placeholder{ color:var(--side-ink-faint); }
.rail-search input:focus{ outline:2px solid var(--accent-light); outline-offset:1px; }

.rail-search-results{ padding:0 12px 10px; }
.rail-result{
  display:block; width:100%; text-align:left; padding:8px 10px; border-radius:8px;
  border:none; background:transparent; color:var(--side-ink); cursor:pointer; font-family:'Inter',sans-serif;
}
.rail-result:hover{ background:rgba(255,255,255,0.05); }
.rail-result .rr-title{ font-size:13px; font-weight:500; }
.rail-result .rr-meta{ font-size:11px; color:var(--side-ink-faint); margin-top:2px; }

.module-nav{ margin-top:6px; }
.module-group-title{
  padding:14px 22px 6px;
  font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--side-ink-faint);
}
.module-link{
  display:flex; align-items:center; gap:10px;
  width:100%; text-align:left;
  padding:8px 22px;
  border:none; background:transparent; cursor:pointer;
  font-family:'Inter', sans-serif; font-size:13.5px; color:var(--side-ink);
  border-left:2px solid transparent;
  text-decoration:none;
}
.module-link:hover{ background:rgba(255,255,255,0.04); }
.module-link.active{ background:var(--side-active-bg); border-left-color:var(--accent-light); color:#FFFFFF; font-weight:500; }
.module-link .mi{ width:16px; text-align:center; flex:none; opacity:0.85; }

.phase{ margin-top:16px; }
.phase-title{
  padding:0 22px 8px;
  font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--side-ink-faint);
}

.step-item{
  display:flex; align-items:center; gap:11px;
  width:100%; text-align:left;
  padding:8px 22px;
  border:none; background:transparent; cursor:pointer;
  font-family:'Inter', sans-serif; color:var(--side-ink);
  border-left:2px solid transparent;
}
.step-item:hover{ background:rgba(255,255,255,0.04); }
.step-item.active{ background:var(--side-active-bg); border-left-color:var(--accent-light); }
.step-item:focus-visible{ outline:2px solid var(--accent-light); outline-offset:-2px; }

.step-num{
  flex:none; width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:'IBM Plex Mono', monospace; font-size:10px; font-weight:600;
  border:1.5px solid var(--side-ink-faint);
  color:var(--side-ink-faint);
}
.step-item.done .step-num{ background:transparent; border-color:var(--accent-light); color:var(--accent-light); }
.step-item.active .step-num{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }

.step-title{ font-size:13px; line-height:1.3; color:var(--side-ink-soft); }
.step-item.active .step-title{ color:#FFFFFF; font-weight:500; }
.step-item.done .step-title{ color:var(--side-ink); }

/* ---------- Main ---------- */
.main{ padding:30px 40px 56px; display:flex; flex-direction:column; align-items:center; }
.wrap{ width:100%; max-width:1080px; }

.topline{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin-bottom:18px; flex-wrap:wrap;
}
.crumb{ font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--ink-faint); }
.crumb b{ color:var(--ink-soft); font-weight:500; }
.crumb a{ color:var(--ink-faint); text-decoration:none; }
.crumb a:hover{ color:var(--accent); }
.frac{ font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--ink-soft); }

.guide-title{ font-size:clamp(24px, 3vw, 30px); margin:0 0 14px; color:var(--ink); }

.progress-track{ height:6px; border-radius:4px; background:var(--rule); overflow:hidden; margin-bottom:22px; }
.progress-fill{ height:100%; background:linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius:4px; transition:width .3s ease; }
@media (prefers-reduced-motion: reduce){ .progress-fill{ transition:none; } }

.shot-card{
  position:relative;
  background:var(--card-2);
  border:1px solid var(--rule);
  border-radius:14px;
  box-shadow:var(--shadow);
  overflow:hidden;
  padding:18px;
}
.shot-inner{
  position:relative; width:100%; aspect-ratio: 1920 / 1080;
  background:var(--card); border-radius:8px; overflow:hidden; border:1px solid var(--rule-soft);
}
.shot-inner img{ position:absolute; inset:0; width:100%; height:100%; display:block; user-select:none; -webkit-user-drag:none; }

.gv-fs-btn{
  position:absolute; top:30px; right:30px; z-index:6;
  display:flex; align-items:center; gap:6px;
  font-family:'Inter', sans-serif; font-weight:600; font-size:12px;
  padding:7px 12px; border-radius:8px; cursor:pointer;
  border:1px solid var(--rule); background:var(--card); color:var(--ink-soft);
  box-shadow:var(--shadow);
}
.gv-fs-btn:hover{ color:var(--ink); border-color:var(--ink-faint); }
.gv-fs-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- Fullscreen guide mode ----------
   Structural flex-column layout, not absolute positioning, so the caption
   can never overlap the screenshot at any viewport size. */
.gv-root.is-fullscreen{
  position:fixed; inset:0; z-index:2000;
  background:var(--bg);
  display:flex; flex-direction:column;
  padding:22px clamp(16px, 4vw, 48px) 20px;
}
.gv-root.is-fullscreen .topline,
.gv-root.is-fullscreen .guide-title,
.gv-root.is-fullscreen .progress-track,
.gv-root.is-fullscreen .hint,
.gv-root.is-fullscreen .doc-cta,
.gv-root.is-fullscreen .footer-credit{ display:none; }

.gv-root.is-fullscreen .shot-card{
  flex:1; min-height:0; margin:0;
  display:flex; align-items:center; justify-content:center;
}
.gv-root.is-fullscreen .shot-inner{
  /* width/height set inline in px by JS (fitFullscreenImage), sized to fit
     available space while preserving the 1920:1080 ratio the hotspot
     percentage math assumes. aspect-ratio alone can't resolve this: the box
     has no intrinsic content size (its img is position:absolute). */
  flex:none;
}
.gv-root.is-fullscreen .instr-card{ margin-top:16px; flex:none; max-height:26vh; overflow-y:auto; }
.gv-root.is-fullscreen .nav-row{ flex:none; margin-top:14px; }
.gv-root.is-fullscreen .gv-fs-btn{ top:30px; right:30px; }

.hl-rect{ position:absolute; border-radius:6px; pointer-events:none; }
.hl-rect.accent{ background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.hl-rect.danger{ background: color-mix(in srgb, var(--danger) 12%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }

.hl-pulse{
  position:absolute; transform:translate(-50%,-50%); border-radius:50%;
  pointer-events:auto; cursor:pointer; border:none; padding:0; background:none;
  -webkit-appearance:none; appearance:none;
}
.hl-pulse .ring{
  position:absolute; inset:0; border-radius:50%; border:2.5px solid var(--accent);
  opacity:0.6; animation: ringPulse 1.8s ease-out infinite;
}
@media (prefers-reduced-motion: reduce){ .hl-pulse .ring{ animation:none; } }
@keyframes ringPulse{ 0% { transform:scale(0.75); opacity:0.6; } 100% { transform:scale(2.4); opacity:0; } }
.hl-pulse:focus-visible{ outline:2px solid var(--ink); outline-offset:3px; }

.observe-chip{
  position:absolute; top:14px; left:14px;
  background:var(--card); border:1px solid var(--rule);
  border-radius:20px; padding:6px 13px 6px 11px;
  display:flex; align-items:center; gap:7px;
  font-family:'Inter',sans-serif; font-size:12px; color:var(--ink-soft);
  box-shadow:var(--shadow);
}
.observe-chip .dot{ width:7px; height:7px; border-radius:50%; background:var(--accent); flex:none; }
.observe-chip.danger .dot{ background:var(--danger); }

.instr-card{
  background:var(--card); border:1px solid var(--rule); border-radius:14px; box-shadow:var(--shadow);
  padding:22px 26px; margin-top:18px; display:flex; gap:16px; align-items:flex-start;
}
.instr-num{
  flex:none; width:36px; height:36px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--accent); color:var(--accent-ink);
  font-family:'IBM Plex Mono', monospace; font-weight:600; font-size:14px;
}
.instr-num.danger{ background:var(--danger); }
.instr-body{ flex:1; min-width:0; }
.instr-title{ font-family:'IBM Plex Sans', sans-serif; font-weight:700; font-size:17px; margin-bottom:6px; color:var(--ink); }
.instr-desc{ font-size:14.5px; line-height:1.6; color:var(--ink-soft); max-width:68ch; }

.nav-row{ display:flex; align-items:center; justify-content:space-between; margin-top:20px; gap:16px; }
.nav-btn{
  font-family:'Inter', sans-serif; font-weight:600; font-size:13.5px;
  padding:10px 18px; border-radius:8px; cursor:pointer;
  border:1px solid var(--rule); background:var(--card); color:var(--ink);
  display:flex; align-items:center; gap:6px;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
  text-decoration:none;
}
.nav-btn:hover{ border-color:var(--ink-faint); }
.nav-btn:disabled{ opacity:0.4; cursor:default; pointer-events:none; }
.nav-btn.primary{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.nav-btn.primary:hover{ filter:brightness(1.05); }
.nav-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.dots{ display:flex; align-items:center; gap:6px; }
.dots .d{ width:6px; height:6px; border-radius:3px; background:var(--rule); transition:width .2s ease, background .2s ease; }
.dots .d.active{ width:18px; background:var(--accent); }
.dots .d.done{ background:var(--accent-light); opacity:0.55; }

.hint{ text-align:center; margin-top:14px; font-size:12px; color:var(--ink-faint); }
kbd{
  font-family:'IBM Plex Mono', monospace; font-size:10.5px;
  border:1px solid var(--rule); border-bottom-width:2px;
  border-radius:4px; padding:1px 5px; color:var(--ink-soft); background:var(--card);
}
.footer-credit{ margin-top:30px; text-align:center; font-size:12px; color:var(--ink-faint); }

/* ---------- Tab switcher (top of main, doc/guide pages) ---------- */
.tabbar{ display:flex; gap:8px; margin-bottom:22px; }
.tabbtn{
  font-family:'Inter',sans-serif; font-weight:600; font-size:13.5px;
  padding:9px 16px; border-radius:9px; cursor:pointer;
  border:1px solid var(--rule); background:var(--card); color:var(--ink-soft);
}
.tabbtn.active{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }

/* ---------- Documentation page ---------- */
.doc-hero{ margin-bottom:26px; }
.doc-kicker{ font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:0.1em; text-transform:uppercase; color:var(--accent); margin-bottom:8px; }
.doc-title{ font-size:clamp(26px, 3.2vw, 34px); margin:0 0 10px; }
.doc-lede{ font-size:15.5px; line-height:1.65; color:var(--ink-soft); max-width:72ch; }

.doc-section{
  background:var(--card); border:1px solid var(--rule); border-radius:14px;
  box-shadow:var(--shadow); padding:26px 28px; margin-bottom:20px;
}
.doc-section h2{ font-family:'IBM Plex Sans',sans-serif; font-size:19px; margin:0 0 12px; }
.doc-section p{ font-size:14.5px; line-height:1.7; color:var(--ink-soft); max-width:74ch; }
.doc-section p + p{ margin-top:12px; }
.doc-section ul{ font-size:14.5px; line-height:1.7; color:var(--ink-soft); padding-left:22px; }
.doc-section li{ margin-bottom:6px; }
.doc-section img{ border-radius:10px; border:1px solid var(--rule); box-shadow:var(--shadow); margin-top:14px; }
.doc-section img + .doc-caption{ margin-top:8px; }
.doc-caption{ font-size:12.5px; color:var(--ink-faint); }

.doc-cta{
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  background:var(--accent-soft); border:1px solid var(--accent); border-radius:14px;
  padding:18px 24px; margin-top:8px;
}
:root[data-theme="dark"] .doc-cta, @media (prefers-color-scheme:dark){ .doc-cta{ color:var(--ink); } }
.doc-cta-text{ font-size:14px; color:var(--ink); }
.doc-cta-text b{ display:block; font-size:15.5px; margin-bottom:2px; }

/* ---------- Guide index / landing ---------- */
.hero{ padding:8px 0 30px; }
.hero-title{ font-size:clamp(28px, 3.6vw, 40px); margin:0 0 12px; }
.hero-lede{ font-size:16px; line-height:1.65; color:var(--ink-soft); max-width:68ch; }

.module-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr)); gap:16px; margin-top:22px; }
.module-card{
  background:var(--card); border:1px solid var(--rule); border-radius:14px; box-shadow:var(--shadow);
  padding:20px; text-decoration:none; color:var(--ink); display:flex; flex-direction:column; gap:8px;
  transition:transform .12s ease, border-color .12s ease;
}
.module-card:hover{ transform:translateY(-2px); border-color:var(--accent); }
.module-card .mc-icon{ font-size:20px; }
.module-card .mc-title{ font-family:'IBM Plex Sans',sans-serif; font-weight:700; font-size:15.5px; }
.module-card .mc-desc{ font-size:13px; color:var(--ink-soft); line-height:1.5; }
.module-card .mc-meta{ font-size:11.5px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; margin-top:auto; padding-top:6px; }

/* ---------- Utility ---------- */
.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; }
