/* ===========================================================================
   Hackerman: the chat's reference pages (data.html, method.html), 26 Nov 2026.
   Ported from the designer's prototype (assets/css/docs.css, 20-23 Nov) on the
   shared tokens (/assets/v2/css/hk-tokens.css). Warm page, white cards, no lines,
   tonal table rows, orange squares as the motif. Replaces report-theme.css +
   trust.css on these two pages.
   =========================================================================== */
body.doc { margin: 0; background: var(--paper); color: var(--ink); font: var(--w-regular) var(--fs-body)/1.55 var(--font); }
.doc__frame, .doc__main { width: min(100% - 2 * var(--pad), 920px); margin: 0 auto; }

/* ---- shared pieces (from the prototype's hk-components.css) ---------------- */
.hk-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: var(--w-regular) var(--fs-meta)/1.2 var(--font); color: var(--fg-2); }
.eyebrow::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--orange); }
.btn { --h: clamp(40px, 2.5vw, 48px); display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: var(--h);
       padding: 0 clamp(16px, 1.25vw, 24px); border: 0; border-radius: var(--r-s); cursor: pointer; text-decoration: none; white-space: nowrap;
       font: var(--w-regular) clamp(15px, .95vw, 18px)/1 var(--font);
       transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1), transform var(--dur-1); -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn--secondary { background: var(--sunk); color: var(--ink); }
.btn--secondary:hover { background: var(--sunk-hover); }
.btn--secondary .hk-i { color: var(--orange); }

/* ---- bar: logo · page switch (centred) -------------------------------------- */
/* No "Back to Hackerman": these pages always open in a new tab, beside the chat (user, 27 Nov 2026). */
.doc__bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.doc__frame { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: clamp(60px, 4.4vw, 76px); }
.doc__brand { justify-self: start; }
.doc__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: var(--w-head) var(--fs-h4)/1 var(--font); letter-spacing: -.01em; }
.doc__brand .spark { width: 22px; height: 22px; fill: var(--orange); }
.doc__tabs { display: flex; gap: 2px; padding: 4px; border-radius: var(--r-s); background: var(--sunk); }
.doc__tabs a { height: 32px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: var(--fs-label); white-space: nowrap; transition: background-color var(--dur-2), color var(--dur-1); }
.doc__tabs a:hover { color: var(--ink); }
.doc__tabs a[aria-current="page"] { background: var(--raised); color: var(--ink); }
@media (max-width: 860px) {
  .doc__frame { display: flex; flex-wrap: wrap; height: auto; padding: 12px 0; }
  .doc__tabs { order: 3; width: 100%; overflow-x: auto; }
  .doc__tabs a { flex: 1; justify-content: center; }
}

/* ---- page ------------------------------------------------------------------- */
.doc__main { padding: clamp(40px, 6vw, 96px) 0 clamp(56px, 6vw, 112px); display: grid; gap: clamp(48px, 5vw, 80px); }
.doc__head { display: grid; gap: 18px; justify-items: start; }
.doc h1 { margin: 0; font: var(--w-head) var(--fs-h2)/var(--lh-h2) var(--font); letter-spacing: var(--tr-h2); text-wrap: balance; }
.doc__lede { margin: 0; max-width: 62ch; font-size: var(--fs-lede); line-height: 1.5; color: var(--ink-2); }
.doc__sec { display: grid; gap: 18px; }
.doc h2 { margin: 0; font: var(--w-head) var(--fs-h3)/1.2 var(--font); letter-spacing: var(--tr-h3); text-wrap: balance; }
.doc h2::before { content: ""; display: inline-block; width: .32em; height: .32em; margin-right: .4em; vertical-align: .14em; background: var(--orange); }
.doc h3 { margin: 0; font: var(--w-head) var(--fs-h4)/1.25 var(--font); }
.doc__sec > p { margin: 0; max-width: 68ch; color: #2A2926; }
.doc__sec p strong { font-weight: var(--w-medium); color: var(--ink); }
.doc__note { margin: 0; max-width: 68ch; font-size: var(--fs-meta); color: var(--ink-3); }

/* ---- cards and the table (tonal rows, no rules) ------------------------------ */
.doc__card { padding: var(--card-pad); border-radius: var(--r-l); background: var(--raised); }
.doc__scroll { overflow-x: auto; padding: 8px; }
.doc__table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0 4px; font-size: var(--fs-meta); line-height: 1.5; }
.doc__table th { padding: 10px 14px 4px; text-align: left; font-weight: var(--w-regular); color: var(--ink-3); }
.doc__table td { padding: 13px 14px; vertical-align: top; background: var(--paper); color: #2A2926; }
.doc__table td:first-child { width: 30%; border-radius: var(--r-s) 0 0 var(--r-s); font-weight: var(--w-medium); color: var(--ink); }
.doc__table td:last-child { border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--ink-2); }
.doc__table td.num { width: 22%; font-variant-numeric: tabular-nums; }
.doc__list { list-style: none; margin: 0; padding: 10px var(--card-pad); display: grid; border-radius: var(--r-l); background: var(--raised); }
.doc__list li { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; }
.doc__list li::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--orange); transform: translateY(-1px); }

/* ---- method: worked example, strength levels --------------------------------- */
.doc__example { display: grid; gap: 14px; }
.doc__example p { margin: 0; color: #2A2926; }
.doc__vs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.doc__vs div { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--r-m); background: var(--paper); }
.doc__vs b { font: var(--w-head) var(--fs-h3)/1 var(--font); letter-spacing: -.02em; }
.doc__vs div:first-child b { color: var(--orange); }
.doc__vs span { font-size: var(--fs-label); color: var(--ink-3); }
.doc__terms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 760px) { .doc__terms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.doc__terms .doc__card { display: grid; gap: 10px; align-content: start; }
.doc__terms p { margin: 0; font-size: var(--fs-meta); color: var(--ink-2); }
.doc__lvl { display: flex; gap: 3px; }
.doc__lvl i { width: 8px; height: 8px; background: var(--line-strong); }
.doc__lvl[data-l="3"] i, .doc__lvl[data-l="2"] i:nth-child(-n+2), .doc__lvl[data-l="1"] i:first-child { background: var(--orange); }

.doc__aff { margin: 0; padding-top: 8px; font-size: var(--fs-label); color: var(--ink-3); }

/* ---- in the chat's side panel (data.html?pane, method.html?pane), 26 Nov ------
   The chat opens these pages in its drawer (js/chat/drawer.js openDoc). The drawer
   header carries the title, so the page drops its logo, back button, eyebrow and h1;
   the panel is white, so the white cards become warm-paper cards. The iframe's width
   is the viewport here, so plain media queries follow the panel's width. */
.is-pane { --pane-pad: 24px; }
@media (max-width: 480px) { .is-pane { --pane-pad: 16px; } }
.is-pane body.doc { background: var(--raised); }
.is-pane .doc__bar { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.is-pane .doc__frame, .is-pane .doc__main { width: auto; margin: 0; padding-inline: var(--pane-pad); }
.is-pane .doc__frame { display: flex; justify-content: flex-start; height: auto; padding-block: 4px 0; }
.is-pane .doc__brand, .is-pane .doc__head > .eyebrow, .is-pane .doc h1,
.is-pane .doc__head:not(:has(.doc__lede)) { display: none; }
.is-pane .doc__tabs { order: 0; width: auto; max-width: 100%; }
.is-pane .doc__main { padding-block: 28px var(--pane-pad); gap: 36px; }
.is-pane .doc__lede { font-size: var(--fs-body); line-height: 1.55; }
.is-pane .doc h2 { font: var(--w-head) var(--fs-h4)/1.3 var(--font); letter-spacing: -.01em; }
.is-pane .doc__sec { gap: 14px; }
.is-pane .doc__sec > p, .is-pane .doc__note { max-width: none; }
.is-pane .doc__card, .is-pane .doc__list { background: var(--paper); }
.is-pane .doc__vs div { background: var(--raised); }
.is-pane .doc__terms { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .is-pane .doc__terms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* The fields table reads as a list of field cards in the panel: name and count on one
   line, the note under them (the designer's .doc__field). Still a real table. */
.is-pane .doc__scroll { padding: 0; overflow: visible; background: none; }
.is-pane .doc__table, .is-pane .doc__table tbody { display: grid; gap: 4px; min-width: 0; }
.is-pane .doc__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.is-pane .doc__table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 13px 16px; border-radius: var(--r-s); background: var(--paper); line-height: 1.45; }
.is-pane .doc__table td { width: auto; padding: 0; border-radius: 0; background: none; }
.is-pane .doc__table td.num { max-width: 22ch; text-align: right; color: var(--ink-2); }
.is-pane .doc__table td:last-child { grid-column: 1 / -1; color: var(--ink-3); }
.is-pane .doc__table td:empty { display: none; }
@media (max-width: 460px) {
  .is-pane .doc__table tr { grid-template-columns: minmax(0, 1fr); }
  .is-pane .doc__table td.num { max-width: none; text-align: left; }
}
