/* ============================================================
   Supernova Handover — supplemental LAYOUT styles.
   Visual brand (colour, type, radius, shadow, dark mode) comes
   from the Aurora AppKit vibe package: assets/aurora-styles.css.
   This file only adds geometry/structure the doc needs, and pulls
   every colour/radius/font from genuine Aurora design tokens.
   Register: product — a precise engineering reference. The spec
   tables are the hero; chrome stays out of the way.
   ============================================================ */

:root { --hv-max: 1060px; --hv-crumb-h: 45px; }

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; }

a { color: var(--color-blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.doc-wrap { max-width: var(--hv-max); margin: 0 auto; padding: 0 24px 96px; }

/* ---- breadcrumb (solid, crisp — not glass) ---- */
.crumbs { position: sticky; top: 0; z-index: 30; background: var(--color-neutral-0);
  border-bottom: 1px solid var(--color-neutral-200); }
.crumbs .in { max-width: var(--hv-max); margin: 0 auto; padding: 11px 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumbs .sep { color: var(--color-neutral-200); }
.crumbs a:hover { text-decoration: none; color: var(--color-blue-600); }

/* ---- masthead: compact accent header, identity kept, weight reduced ---- */
.hv-header { position: relative; overflow: hidden; border-radius: var(--borderRadius-lg);
  padding: 28px 32px; margin: 24px 0 14px; }
.hv-header::after { content: ""; position: absolute; right: -120px; top: -120px; width: 320px; height: 320px;
  border-radius: 9999px; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 68%); pointer-events: none; }
.hv-header .eyebrow { margin: 0 0 7px; color: #fff; }
.hv-header h1 { letter-spacing: -0.02em; }
.hv-header .lede { max-width: 70ch; margin: 11px 0 0; color: #fff; position: relative; }
.hv-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; }

/* "Open in Figma" masthead link — white pill on the accent header */
.figma-btn { display: inline-flex; align-items: center; gap: 8px; position: relative; z-index: 1; margin-top: 18px;
  padding: 8px 15px; border-radius: 9999px; background: var(--color-neutral-0); color: var(--color-blue-600);
  font-family: var(--font-body); font-weight: 600; font-size: 13px; line-height: 1; text-decoration: none;
  box-shadow: 0 1px 2px rgba(9,30,66,.14); transition: background-color .12s ease, transform .12s ease, box-shadow .12s ease; }
.figma-btn:hover { text-decoration: none; background: var(--color-blue-100); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(9,30,66,.18); }
.figma-btn:focus-visible { outline: 2px solid var(--color-neutral-0); outline-offset: 2px; }
.figma-mark { display: block; flex: none; }
.figma-btn .ext { opacity: .5; font-weight: 400; }

/* ---- at-a-glance fact strip (scannable header for engineers) ---- */
.ataglance { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--color-neutral-200); border-radius: var(--borderRadius-md);
  background: var(--color-neutral-0); margin: 14px 0; overflow: hidden; }
.ataglance > div { padding: 12px 16px; border-left: 1px solid var(--color-neutral-200); }
.ataglance > div:first-child { border-left: none; }
.ataglance dt { color: var(--color-neutral-600); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 3px; }
.ataglance dd { margin: 0; color: var(--color-neutral-900); }

/* ---- lozenges ---- */
.loz { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 9999px; white-space: nowrap; }
.loz .d { width: 7px; height: 7px; border-radius: 9999px; background: currentColor; }
.loz-onhdr { background: rgba(255,255,255,.18); color: #fff; }

/* ---- layout with sticky TOC ---- */
/* minmax(0,1fr) so a wide child (e.g. a non-wrapping <pre>) can't force the
   track — and the whole page — wider than the viewport. */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; margin-top: 24px; }
.layout > main { min-width: 0; }
.toc { position: sticky; top: calc(var(--hv-crumb-h) + 16px); align-self: start; max-height: calc(100vh - 80px); overflow: auto; }
.toc .lbl { letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.toc a { display: block; padding: 5px 11px; border-radius: 7px;
  color: var(--color-neutral-600); transition: color .15s ease, background-color .15s ease; }
.toc a:hover { text-decoration: none; color: var(--color-blue-600); background: var(--color-blue-100); }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .toc { position: static; max-height: none; } }

/* ---- sections: reference-style heading + numeral, no decorative bubble ---- */
.sec { scroll-margin-top: calc(var(--hv-crumb-h) + 16px); margin-bottom: 6px; }
.sec > h2 { margin: 38px 0 8px; padding-bottom: 10px; border-bottom: 1px solid var(--color-neutral-200); }
/* Section headings navigate by name (see the TOC); decorative section numbers removed. */
.sec-num { display: none; }
.sec h3 { margin: 22px 0 8px; }
.sec p { margin: 10px 0; }
.sec > ul, .sec > ol, .sec h3 + ul, .sec h3 + ol, .sec p + ul, .sec p + ol { margin: 10px 0; padding-left: 20px; }
.sec li { margin: 5px 0; }
/* Tailwind preflight strips list bullets — restore for prose lists only. */
.sec ul:not(.anatomy):not(.timeline):not(.check):not(.plats) { list-style: disc; padding-left: 20px; }
.sec ol { list-style: decimal; padding-left: 22px; }
.dodont ul { list-style: disc; }
.timeline ul { list-style: disc; }

/* ---- surface card (mirrors CardContainer) ---- */
.surface { border-radius: var(--borderRadius-lg); padding: 20px 22px; box-shadow: 0 2px 8px #0000000a; margin: 14px 0; }

/* ---- panels: full hairline border + tint + icon (no side-stripe) ---- */
.panel { position: relative; border-radius: var(--borderRadius-md); padding: 14px 16px 14px 46px; margin: 14px 0;
  border-style: solid; border-width: 1px; }
.panel .ic { position: absolute; left: 15px; top: 14px; font-size: 15px; line-height: 1; }

/* ---- tables: the hero ---- */
.tbl-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--color-neutral-200); border-radius: var(--borderRadius-md); }
table.hv { border-collapse: collapse; width: 100%; }
table.hv thead th { text-align: left; padding: 10px 14px; background: var(--color-neutral-100);
  border-bottom: 1px solid var(--color-neutral-200); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .045em; }
table.hv tbody td { padding: 11px 14px; border-top: 1px solid var(--color-neutral-200); vertical-align: top; }
table.hv tbody tr:first-child td { border-top: none; }
table.hv tbody tr { transition: background-color .12s ease; }
table.hv tbody tr:hover { background: var(--color-neutral-100); }
table.hv tbody td:first-child { font-weight: var(--fontWeight-medium); color: var(--color-neutral-900); }
table.hv td code, table.hv th code { white-space: nowrap; }

/* ---- code + tokens ---- */
code { font-family: var(--font-mono); font-size: .85em; padding: 1px 6px; border-radius: 5px;
  background: var(--color-neutral-150); border: 1px solid var(--color-neutral-200); color: var(--color-neutral-900); }
.token { font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border-radius: 5px;
  background: var(--color-blue-100); color: var(--color-blue-600); white-space: nowrap; }
.swatch { display: inline-block; width: 13px; height: 13px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); vertical-align: -2px; margin-right: 6px; }

/* ---- anatomy ---- */
.anatomy { list-style: none; margin: 14px 0; padding: 0; }
.anatomy li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--color-neutral-150); }
.anatomy li:last-child { border-bottom: none; }
.pin { flex: none; width: 24px; height: 24px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  background: var(--color-blue-600); color: #fff; }

/* ---- changelog timeline ---- */
.timeline { list-style: none; margin: 16px 0; padding: 0 0 0 24px; border-left: 1px solid var(--color-neutral-200); }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline li::before { content: ""; position: absolute; left: -31px; top: 3px; width: 12px; height: 12px; border-radius: 9999px;
  background: var(--color-neutral-0); border: 3px solid var(--color-neutral-200); }
.timeline li.cur::before { background: var(--color-blue-600); border-color: var(--color-blue-600); }
.timeline .ver { margin-right: 8px; }
.timeline ul { margin: 8px 0 0; }

/* ---- do / don't ---- */
.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
@media (max-width: 680px) { .dodont { grid-template-columns: 1fr; } }
.dodont .col { border-radius: var(--borderRadius-md); padding: 16px 18px; }
.dodont .col.bg-success-subtle { border: 1px solid var(--color-green-200, #aee9cd); }
.dodont .col.bg-critical-subtle { border: 1px solid var(--color-red-200, #ffc7c2); }
.dodont h4 { margin: 0 0 8px; }
.dodont ul { margin: 0; padding-left: 18px; }

/* ---- platform pills ---- */
.plats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.plat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9999px; border: 1px solid var(--color-neutral-200); }
.plat.no { color: var(--color-neutral-600); text-decoration: line-through; }

/* ---- checklist ---- */
.check { list-style: none; padding: 0; margin: 12px 0; }
.check li { position: relative; padding: 7px 0 7px 30px; border-bottom: 1px solid var(--color-neutral-150); }
.check li:last-child { border-bottom: none; }
.check li::before { content: "\2610"; position: absolute; left: 0; top: 5px; color: var(--color-blue-600); font-size: 18px; }

/* ---- index tiles ---- */
.grid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(266px, 1fr)); gap: 16px; margin: 18px 0; }
.tile { display: block; border-radius: var(--borderRadius-lg); padding: 18px 20px; border: 1px solid var(--color-neutral-200);
  transition: transform .15s cubic-bezier(.22,1,.36,1), box-shadow .15s ease, border-color .15s ease; }
.tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--color-blue-600); box-shadow: 0 6px 14px #0000000f; }
.tile .tname { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
.tile .trow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

/* ---- Jira ticket template block ---- */
.jira { border: 1px solid var(--color-neutral-200); border-radius: var(--borderRadius-md); overflow: hidden; margin: 12px 0 4px; }
.jira-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 14px; background: var(--color-neutral-100); border-bottom: 1px solid var(--color-neutral-200); }
.jira-head .lbl { text-transform: uppercase; letter-spacing: .07em; }
.copy-btn { font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--color-neutral-200);
  background: var(--color-neutral-0); color: var(--color-blue-600); padding: 4px 14px; border-radius: 9999px;
  transition: background-color .12s ease, border-color .12s ease; }
.copy-btn:hover { background: var(--color-blue-100); border-color: var(--color-blue-600); }
/* Raw source — shown only as the no-JS fallback (wraps so it can't overflow);
   handover.js hides it and renders .jira-render in its place. */
.jira-body { margin: 0; padding: 16px 18px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; tab-size: 2;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.62; color: var(--color-neutral-900); background: var(--color-neutral-0); }

/* Rendered ticket */
.jira-render { padding: 6px 18px 18px; background: var(--color-neutral-0); }
.jira-render .t-h2 { font-size: 15px; font-weight: 700; margin: 12px 0 12px; color: var(--color-neutral-900); }
.jira-render .t-h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  color: var(--color-neutral-600); margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--color-neutral-200); }
.jira-render p { margin: 5px 0; font-size: 13.5px; line-height: 1.55; color: var(--color-neutral-900); }
.jira-render ul, .jira-render ol { margin: 6px 0; padding-left: 22px; }
.jira-render ul { list-style: disc; }
.jira-render ol { list-style: decimal; }
.jira-render li { margin: 4px 0; font-size: 13.5px; line-height: 1.55; }
.jira-render strong { font-weight: 600; color: var(--color-neutral-900); }
.jira-render .t-field { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 3px 0; font-size: 13.5px; line-height: 1.5; }
.jira-render .t-key { color: var(--color-neutral-600); font-weight: 600; }
.jira-render .t-val { color: var(--color-neutral-900); }
@media (max-width: 520px) { .jira-render .t-field { grid-template-columns: 1fr; gap: 0; } }

.foot { margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--color-neutral-200); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  body { background: #fff; }
  .crumbs, .toc { display: none; }
  .layout { grid-template-columns: 1fr; }
  .tile, .surface { box-shadow: none; }
}
