/* ==========================================================================
   SCOPE — the console
   Not a document. A reference tool you keep open in a tab while working.
   Sidebar, live search, filter chips, copy buttons. No cover, no page breaks.
   ========================================================================== */

body.app{
  background:var(--sheet-2);
  height:100vh;
  overflow:hidden;               /* the pane scrolls, not the page */
  display:flex; flex-direction:column;
}

/* ---------------------------------------------------------------- topbar */

.topbar{
  flex:0 0 auto;
  display:flex; align-items:center; gap:16px;
  height:50px; padding:0 20px;
  background:var(--ink);
  border-bottom:1px solid var(--ink);
}
.topbar-mark{
  font-family:var(--mono); font-weight:700; font-size:13px;
  letter-spacing:0.18em; color:oklch(0.985 0.002 250);
}
.topbar-sub{
  font-size:11px; letter-spacing:0.14em; text-transform:uppercase;
  color:oklch(0.978 0.002 250 / 0.45);
  padding-left:16px; border-left:1px solid oklch(0.978 0.002 250 / 0.18);
  margin-right:auto;
}
.topbar-link{
  font-size:13px; color:oklch(0.978 0.002 250 / 0.7); text-decoration:none;
  transition:color 160ms var(--ease);
}
.topbar-link:hover{ color:oklch(0.74 0.14 258); }

/* ---------------------------------------------------------------- layout */

.console{
  flex:1 1 auto;
  display:grid; grid-template-columns:216px minmax(0,1fr);
  min-height:0;
}

.side{
  border-right:1px solid var(--rule-firm);
  background:var(--sheet-2);
  padding:20px 14px;
  display:flex; flex-direction:column; gap:22px;
  overflow-y:auto;
}
.side-nav{ display:flex; flex-direction:column; gap:2px; }
.side-a{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 11px; border-radius:2px;
  font-size:13.5px; font-weight:500; color:var(--ink-soft);
  text-decoration:none;
  transition:background 160ms var(--ease), color 160ms var(--ease);
}
.side-a .mono{ font-size:11px; color:var(--ink-mute); }
.side-a:hover{ background:oklch(0.235 0.014 258 / 0.05); color:var(--ink); }
.side-a.is-on{ background:var(--blue-wash); color:var(--blue-deep); }
.side-a.is-on .mono{ color:var(--blue); }

.side-tip{
  margin-top:auto;
  border-top:1px solid var(--rule); padding-top:16px;
}
.side-tip-k{
  font-size:10px; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--ink-mute); margin:0 0 7px !important;
}
.side-tip p{ font-size:12.5px; color:var(--ink-mute); line-height:1.55; margin:0; }
kbd{
  font-family:var(--mono); font-size:11px;
  background:var(--sheet); border:1px solid var(--rule-firm);
  border-radius:2px; padding:1px 5px; color:var(--ink);
}

.pane{
  overflow-y:auto;
  background:var(--sheet);
  padding:0 0 60px;
  scroll-behavior:smooth;
}

.pane-head{ padding:34px 34px 20px; }
.pane-head h1{ font-size:30px; margin-bottom:6px; }
.pane-sub{ font-size:15px; color:var(--ink-mute); margin:0; }

/* ---------------------------------------------------------------- tools */

.tools{
  position:sticky; top:0; z-index:5;
  background:oklch(0.978 0.002 250 / 0.96);
  backdrop-filter:blur(8px);
  border-block:1px solid var(--rule);
  padding:14px 34px;
  display:flex; flex-wrap:wrap; align-items:center; gap:12px 14px;
}

.search{
  flex:1 1 300px;
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--rule-firm); border-radius:2px;
  padding:0 12px; height:38px;
  background:var(--sheet);
  transition:border-color 160ms var(--ease);
}
.search:focus-within{ border-color:var(--blue); }
.search-i{ font-size:12px; color:var(--ink-mute); }
.search input{
  flex:1; border:0; outline:0; background:transparent;
  font-family:var(--sans); font-size:14.5px; color:var(--ink);
  height:100%;
}
.search input::placeholder{ color:var(--ink-mute); }

.chips{ display:flex; flex-wrap:wrap; gap:6px; }
.chip{
  font-family:var(--sans); font-size:12.5px; font-weight:500;
  color:var(--ink-soft);
  background:transparent; border:1px solid var(--rule-firm);
  border-radius:2px; padding:7px 12px; cursor:pointer;
  transition:border-color 160ms var(--ease), color 160ms var(--ease), background 160ms var(--ease);
}
.chip:hover{ border-color:var(--ink-mute); color:var(--ink); }
.chip.is-on{ background:var(--blue); border-color:var(--blue); color:oklch(0.99 0.002 250); }

.count{
  font-size:11.5px; letter-spacing:0.1em; text-transform:uppercase;
  color:var(--ink-mute); margin:0; white-space:nowrap;
}

/* ---------------------------------------------------------------- cards */

.list{ display:flex; flex-direction:column; }

.card{
  padding:24px 34px;
  border-bottom:1px solid var(--rule);
}
.card[hidden]{ display:none; }

.card-h{ display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.card-n{ font-size:12.5px; color:var(--blue); font-weight:500; }
.card-h h2{ font-size:17.5px; margin:0; margin-right:auto; }

.copy{
  font-family:var(--mono); font-size:11px; letter-spacing:0.06em;
  color:var(--ink-soft);
  background:transparent; border:1px solid var(--rule-firm);
  border-radius:2px; padding:6px 12px; cursor:pointer;
  transition:border-color 160ms var(--ease), color 160ms var(--ease), background 160ms var(--ease);
}
.copy:hover{ border-color:var(--blue); color:var(--blue-deep); background:var(--blue-wash); }
.copy.done{ background:var(--blue); border-color:var(--blue); color:oklch(0.99 0.002 250); }

.them, .you{
  font-size:15.5px; line-height:1.58; color:var(--ink);
  padding:12px 15px; border-radius:2px; margin:0 0 11px;
  max-width:74ch;
}
.them{ background:var(--sheet-2); border:1px solid var(--rule); }
.you{ background:var(--blue-wash); border:1px solid var(--blue); font-weight:500; }
.w{
  display:inline-block; font-size:9.5px; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--ink-mute); margin-right:10px;
}
.n{ font-size:14px; color:var(--ink-soft); max-width:74ch; margin:0 0 10px; line-height:1.6; }
.n:last-child{ margin-bottom:0; }

.empty{
  padding:44px 34px; font-size:15px; color:var(--ink-mute);
}

/* ---------------------------------------------------------------- templates */

.card-tpl .tpl-why{ margin-bottom:16px; }
.tpl-parts{ list-style:none; margin:0 0 14px; padding:0; border-top:1px solid var(--rule); }
.tpl-parts li{
  display:grid; grid-template-columns:34px minmax(0,1fr);
  gap:12px; align-items:baseline;
  padding:10px 0; border-bottom:1px solid var(--rule);
  font-size:14.5px; color:var(--ink);
}
.tpl-parts .mono{ font-size:11px; color:var(--blue); }
.tpl-parts em{ display:block; font-size:13px; color:var(--ink-mute); font-weight:400; margin-top:2px; }

/* ---------------------------------------------------------------- floor */

.eq{
  background:var(--ink); border-radius:2px;
  padding:18px 20px; margin:0 0 14px;
}
.eq p{ font-size:13px; color:oklch(0.978 0.002 250 / 0.75); margin:0 0 9px; line-height:1.5; }
.eq p:last-child{ margin:0; }
.eq-k{ display:inline-block; min-width:126px; color:oklch(0.978 0.002 250 / 0.5); }
.eq-hl{ padding-top:9px; border-top:1px solid oklch(0.978 0.002 250 / 0.16); color:oklch(0.74 0.14 258) !important; font-weight:500; }
.eq-hl .eq-k{ color:oklch(0.74 0.14 258 / 0.7); }

.steps{ margin:0; padding-left:20px; }
.steps li{ font-size:14.5px; color:var(--ink); margin-bottom:9px; }
.steps li:last-child{ margin-bottom:0; }

/* ---------------------------------------------------------------- misc */

.pane-foot{ padding:34px; border-top:1px solid var(--rule); }
.pane-foot p{ font-size:12.5px; color:var(--ink-mute); max-width:66ch; margin:0 0 7px; }
.pane-foot .mono{ font-size:11px; letter-spacing:0.16em; color:var(--ink); }
.pane-foot a{ color:var(--ink); }

#templates, #floor{ border-top:1px solid var(--rule-firm); }

.toast{
  position:fixed; bottom:22px; left:50%;
  transform:translate(-50%, 14px);
  background:var(--ink); color:oklch(0.985 0.002 250);
  font-family:var(--mono); font-size:12px; letter-spacing:0.06em;
  padding:10px 20px; border-radius:2px;
  opacity:0; pointer-events:none;
  transition:opacity 180ms var(--ease), transform 180ms var(--ease);
  z-index:50;
}
.toast.show{ opacity:1; transform:translate(-50%, 0); }

/* ---------------------------------------------------------------- responsive */

@media (max-width:820px){
  body.app{ height:auto; overflow:visible; }
  .console{ grid-template-columns:1fr; }
  .side{
    border-right:0; border-bottom:1px solid var(--rule-firm);
    flex-direction:row; align-items:center; gap:14px;
    padding:12px 20px; overflow-x:auto;
  }
  .side-nav{ flex-direction:row; gap:6px; }
  .side-a{ white-space:nowrap; }
  .side-tip{ display:none; }
  .pane{ overflow:visible; }
  .pane-head{ padding:26px 20px 16px; }
  .tools{ padding:12px 20px; }
  .card{ padding:20px; }
  .empty, .pane-foot{ padding:28px 20px; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ transition-duration:0.001ms !important; }
  .pane{ scroll-behavior:auto; }
}

@media print{
  body.app{ height:auto; overflow:visible; }
  .topbar, .side, .tools, .copy, .toast{ display:none; }
  .console{ grid-template-columns:1fr; }
  .pane{ overflow:visible; }
  .card{ break-inside:avoid; page-break-inside:avoid; }
}
