/* ============================================================
   QuestLaw docs. Tokens come from tokens.css; fonts from fonts.css.
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
  line-height: var(--leading-normal);
}
a { color: var(--oxblood); text-decoration: none; }
a:hover { color: var(--oxblood-hover); }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
.mono { font-family: var(--font-mono); }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 58px; padding: 0 24px;
  background: color-mix(in oklch, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--ink); }
.brand .tag { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-left: 11px; margin-left: 2px; border-left: 1px solid var(--rule-strong); }
.top .r { display: flex; align-items: center; gap: 22px; }
.top .r a { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.top .r a:hover { color: var(--ink); }

/* shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); max-width: 1200px; margin: 0 auto; }
.side { position: sticky; top: 58px; align-self: start; height: calc(100vh - 58px); overflow-y: auto; border-right: 1px solid var(--rule); padding: 24px 20px 40px; }
.search { width: 100%; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 11px; margin: 0 0 22px; }
.search::placeholder { color: var(--faint); }
.search:focus { outline: none; border-color: var(--oxblood); box-shadow: var(--ring-shadow); }
.grp { margin: 0 0 22px; }
.grp .gl { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--faint); margin: 0 0 8px; padding: 0 8px; }
.nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.nav a { display: block; font-size: 13.5px; color: var(--ink-2); padding: 6px 8px; border-radius: 6px; line-height: 1.35; }
.nav a:hover { background: var(--paper-sunk); color: var(--ink); }
.nav a.on { color: var(--oxblood); font-weight: 600; background: var(--paper-sunk); }

/* content */
.main { padding: 40px 56px 80px; min-width: 0; }
.crumb { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 0 0 18px; }
.crumb .sep { margin: 0 7px; color: var(--faint); }
.art { display: none; max-width: 720px; }
.art.on { display: block; }
.art h1 { font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -.03em; line-height: 1.08; }
.art .sub { font-size: 1.05rem; color: var(--ink-2); margin: 12px 0 0; text-wrap: pretty; }
.art h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; margin: 40px 0 0; color: var(--ink); }
.art h2 + p { margin-top: 12px; }
.art p { font-size: 15px; line-height: 1.68; color: var(--ink-soft); margin: 16px 0 0; text-wrap: pretty; }
.art ul, .art ol { margin: 16px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.art li { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.art li::marker { color: var(--faint); }
.art code { font-family: var(--font-mono); font-size: 13px; color: var(--ink); background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 6px; }
.kbd { font-family: var(--font-mono); font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 5px; padding: 2px 7px; }
.note { margin: 22px 0 0; background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: 10px; padding: 15px 17px; }
.note .nl { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--oxblood); margin: 0 0 6px; }
.note p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.steps { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: s; display: flex; flex-direction: column; gap: 0; }
.steps li { position: relative; counter-increment: s; padding: 16px 0 16px 44px; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 15px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--on-oxblood); background: var(--oxblood); border-radius: 50%; }
.steps li b { color: var(--ink); font-weight: 600; }
.pin-icon { display: inline-flex; width: 18px; height: 18px; margin: 0 7px 0 -1px; color: var(--oxblood); vertical-align: -4px; }
.pin-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-definitions { margin: 18px 0 0; border-top: 1px solid var(--rule-strong); }
.doc-definitions > div { display: grid; grid-template-columns: minmax(100px, .28fr) 1fr; gap: 24px; padding: 17px 0; border-bottom: 1px solid var(--rule); }
.doc-definitions dt { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.doc-definitions dd { font-size: 14.5px; line-height: 1.58; color: var(--ink-soft); }
.beta-label { display: inline-block; margin-left: 7px; padding: 2px 7px; border: 1px solid var(--oxblood-line); border-radius: var(--shape-pill); color: var(--oxblood); font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .01em; vertical-align: 3px; }
/* A browser QuestLaw does not support yet: readable, clearly not actionable. */
.soon h2, .soon p { color: var(--muted); }
.soon-label { display: inline-block; margin-right: 8px; padding: 2px 8px; border: 1px solid var(--rule-strong); border-radius: var(--shape-pill); color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 600; }
.art .fine { font-size: 13px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 52px 0 0; padding: 22px 0 0; border-top: 1px solid var(--rule); }
.pager a { flex: 1; max-width: 48%; }
.pager a.next { text-align: right; }
.pager .pl { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: block; }
.pager .pt { font-size: 15px; font-weight: 600; color: var(--ink); display: block; margin-top: 3px; }
.pager a:hover .pt { color: var(--oxblood); }

.menub { display: none; }
@media (max-width: 840px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); display: none; }
  .side.open { display: block; }
  .main { padding: 28px 22px 64px; }
  .menub { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
}
@media (max-width: 520px) {
  .top { padding: 0 16px; }
  .top .r { display: none; }
  .doc-definitions > div { grid-template-columns: 1fr; gap: 5px; }
}

/* Docs home — one tile per section of the sidebar, each with its own drawing. */
.home-grid { display: grid; gap: 16px; margin: 30px 0 0; }
@media (min-width: 720px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-card {
  display: block; overflow: hidden; background: var(--paper-sunk);
  border: 1px solid var(--rule); border-radius: 12px;
  transition: border-color .15s ease, transform .15s ease;
}
.home-card:hover { border-color: var(--rule-strong); transform: translateY(-2px); }
.home-art { display: block; background: var(--paper); border-bottom: 1px solid var(--rule); }
/* One default — a thin ink-grey outline — then four one-letter modifiers. */
.home-art svg { display: block; width: 100%; height: auto; fill: none; stroke: var(--rule-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-art .fp { fill: var(--paper); }
.home-art .fs { fill: var(--paper-sunk); }
.home-art .fi { fill: var(--ink); }
.home-art .fa { fill: var(--oxblood); }
.home-art .a  { stroke: var(--oxblood); }
.home-art .o  { stroke: var(--on-oxblood); stroke-width: 1.8; }
.home-art .o.fi, .home-art circle.o { fill: var(--on-oxblood); }
.home-art .n  { stroke: none; }
.home-art .d  { stroke-dasharray: 3 5; }
.home-card-t {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 17px; color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1rem; letter-spacing: -.02em;
}
.home-card:hover .home-card-t { color: var(--oxblood); }
.home-card-t svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--faint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.home-card:hover .home-card-t svg { stroke: var(--oxblood); }
.home-help { margin: 34px 0 0; padding: 20px 0 0; border-top: 1px solid var(--rule); }
.home-help b { font-size: 14.5px; color: var(--ink); }
.art .home-help p { margin: 5px 0 0; font-size: 14px; color: var(--ink-2); }
/* The dashed paths are the thing moving in each drawing, so hover sets them moving. */
.home-card:hover .home-art .d { animation: home-flow .9s linear infinite; }
@keyframes home-flow { to { stroke-dashoffset: -8; } }
@media (prefers-reduced-motion: reduce) {
  .home-card { transition: none; }
  .home-card:hover { transform: none; }
  .home-card:hover .home-art .d { animation: none; }
}

/* Subsection nav — the open article's headings, highlighted as you scroll past them. */
.subnav { list-style: none; margin: 2px 0 6px; padding: 0 0 0 10px; border-left: 1px solid var(--rule); }
.subnav a { display: block; font-size: 12.5px; color: var(--muted); padding: 4px 8px; border-radius: 6px; line-height: 1.35; }
.subnav a:hover { color: var(--ink); background: var(--paper-sunk); }
.subnav a.on { color: var(--oxblood); font-weight: 600; }
/* Clears the sticky top bar when a subsection link jumps to a heading. */
.art h2 { scroll-margin-top: 76px; }

/* The Word sign-in handshake, laid out as the four surfaces it actually crosses. */
.syncflow { display: grid; gap: 12px; margin: 18px 0 0; }
@media (min-width: 900px) { .syncflow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.syncstep { padding: 16px 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-sunk); }
/* Direct child only — bold inside a step's prose must stay inline. */
.syncstep > b { display: block; margin: 8px 0 0; font-size: 14px; letter-spacing: -.01em; }
.syncstep p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.syncnum {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px;
  background: var(--oxblood); color: var(--on-oxblood);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.syncstep > .syncscreen {
  display: block; margin: 10px 0 0; padding: 9px 11px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--ink-soft);
}

/* ============================================================
   Figures — small CSS mockups of the extension in place. These replace the
   old "screenshot suggestion" comments: no image assets to keep in sync with
   the product, and they read correctly at any width.
   ============================================================ */
.fig { margin: 24px 0 0; }
.fig-chrome {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  background: var(--paper-sunk);
  border: 1px solid var(--rule); border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.fig-dots { display: flex; gap: 6px; }
.fig-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-strong); }
.fig-omni {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 11px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
}
.fig-ext { display: flex; align-items: center; gap: 4px; }
.fig-ext-btn {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 6px; color: var(--faint);
}
.fig-ext-btn svg { width: 15px; height: 15px; fill: currentColor; }
.fig-ext-btn.is-questlaw {
  background: var(--paper); border: 1px solid var(--oxblood-line);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--oxblood) 14%, transparent);
}
.fig-ext-btn.is-questlaw svg { width: 16px; height: 16px; fill: none; }

.fig-page {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 132px; padding: 20px 22px 24px;
  background: var(--paper); border: 1px solid var(--rule);
}
.fig-page-tall { min-height: 210px; border-radius: 10px 10px 0 0; }
.fig-line { display: block; height: 9px; border-radius: 3px; background: var(--rule); }
.fig-line-sel { background: color-mix(in oklch, var(--caution-tint) 80%, var(--rule)); }
.fig-save {
  position: absolute; right: 18px; bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 17px; border-radius: 8px;
  background: var(--oxblood); color: var(--on-oxblood);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 4px 14px color-mix(in oklch, var(--oxblood) 28%, transparent);
}
.fig-save svg { width: 15px; height: 15px; fill: currentColor; }
.fig-menu {
  position: absolute; left: 26%; top: 68px;
  display: flex; flex-direction: column; min-width: 216px;
  padding: 5px; border: 1px solid var(--rule-strong); border-radius: 9px;
  background: var(--surface); box-shadow: 0 10px 28px color-mix(in oklch, var(--ink) 16%, transparent);
}
.fig-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 5px;
  font-size: 12.5px; color: var(--ink-2);
}
.fig-menu-item.is-questlaw { background: var(--paper-sunk); color: var(--ink); font-weight: 600; }
.fig-menu-item.is-questlaw svg { width: 14px; height: 14px; fill: none; stroke: var(--oxblood); }
.fig-menu-sep { height: 1px; margin: 4px 6px; background: var(--rule); }

.fig figcaption {
  display: flex; flex-direction: column; gap: 7px;
  padding: 13px 16px;
  background: var(--paper-sunk); border: 1px solid var(--rule); border-top: 0;
  border-radius: 0 0 10px 10px;
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.fig-num {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px;
  border-radius: 50%; background: var(--oxblood); color: var(--on-oxblood);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; vertical-align: 1px;
}
@media (max-width: 520px) {
  .fig-menu { left: 12px; right: 12px; min-width: 0; }
}
