/* Ticket Lab Docs — GitBook-style shell on BuildableOS bits (os.css, scoped to body.ws). */
@font-face { font-family: 'Kola'; src: url('/fonts/Kola-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body.ws { background: var(--bg-base); color: var(--fg-primary); font: var(--fw) var(--fs-2)/var(--lh-2) var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ── sidebar ──────────────────────────────────────────────────────────── */
.sidebar { overflow-y: auto; z-index: 20; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 6px; text-decoration: none; color: var(--fg-primary); }
.sidebar .brand img { width: 24px; height: 24px; border-radius: 6px; }
.sidebar .brand .wm { font: 400 17px/1 'Kola', var(--font); letter-spacing: .01em; padding-top: 2px; }
.sidebar .brand .tag { margin-left: 2px; }
.sidebar .sb-top { position: relative; }
.sidebar .sb-item { text-decoration: none; color: var(--fg-secondary); cursor: pointer; }
.sidebar .sb-item .badge.special { color: var(--fg-special); background: oklch(58.99% .2523 294.88 / .2); }
.sidebar .sb-foot .sb-item svg { color: var(--fg-tertiary); }
.sidebar .sb-foot .sb-item:hover svg { color: var(--fg-primary); }

/* search results */
.sres { position: absolute; top: 100%; left: 4px; right: 0; margin-top: 6px; z-index: 50; padding: 6px; max-height: 380px; overflow-y: auto;
  background: var(--bg-secondary); border-radius: 12px; box-shadow: var(--shadow-floating-md); --surface-base: var(--bg-primary);
  animation: enter var(--t-fast) var(--ease-out) both; --enter-opacity: 0; --enter-y: -4px; }
.sres a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; }
.sres a:hover, .sres a.sel { background: var(--glow-neutral-pressed); }
.sres a .p { font-size: 11px; line-height: 14px; color: var(--fg-tertiary); }
.sres a .h { font-size: 13px; line-height: 18px; color: var(--fg-primary); }
.sres a .s { font-size: 12px; line-height: 16px; color: var(--fg-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sres a .s mark, .sres a .h mark { background: var(--accent-tr); color: var(--fg-accent); border-radius: 3px; padding: 0 1px; }
.sres .none { padding: 10px; font-size: 13px; color: var(--fg-tertiary); }
.field .kbd { margin-left: auto; }

/* ── main floating panel ───────────────────────────────────────────────── */
main.surface { position: fixed; top: 8px; right: 8px; bottom: 8px; left: calc(var(--sidebar-w) + 8px); border-radius: 16px;
  background: var(--bg-primary); box-shadow: var(--shadow-surface-xs); --surface-base: var(--bg-base); overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.mobilebar { display: none; position: sticky; top: 0; z-index: 5; height: 48px; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg-primary); box-shadow: 0 .5px 0 var(--row-divider); }
.mobilebar .t { font-weight: 500; }
.doc { display: grid; grid-template-columns: minmax(0, 760px) 200px; gap: 48px; padding: 40px 40px 96px 56px; align-items: start; }

/* on-page TOC */
.toc { position: sticky; top: 40px; font-size: 13px; line-height: 20px; }
.toc .h { color: var(--fg-tertiary); font-size: 12px; margin: 0 0 8px; padding-left: 12px; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--fg-tertiary); text-decoration: none; border-left: .5px solid var(--row-divider); transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.toc a:hover { color: var(--fg-secondary); }
.toc a.on { color: var(--fg-primary); border-left-color: var(--fg-primary); }
.toc:empty { display: none; }

/* ── pages ─────────────────────────────────────────────────────────────── */
.page-view { display: none; }
.page-view.active { display: block; animation: enter .2s var(--ease-out) both; --enter-opacity: 0; --enter-y: 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--fg-tertiary); font-size: 13px; margin-bottom: 14px; }
.crumbs svg { width: 12px; height: 12px; }

.prose h1 { font: var(--fw-medium) 28px/36px var(--font); letter-spacing: -.01em; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.prose .lede { color: var(--fg-tertiary); font-size: 16px; line-height: 24px; margin: 0 0 28px; }
.prose h2 { font: var(--fw-medium) var(--fs-1)/var(--lh-1) var(--font); margin: 40px 0 12px; padding-top: 20px; border-top: .5px solid var(--row-divider); scroll-margin-top: 24px; display: flex; align-items: center; gap: 8px; }
.prose .lede + h2, .prose .cards + h2 { border-top: 0; padding-top: 0; margin-top: 8px; }
.prose h2 .tag { margin-left: 2px; }
.prose h2 a.anchor { display: inline-flex; color: var(--fg-quaternary); text-decoration: none; opacity: 0; transition: opacity var(--t-fast), color var(--t-fast); }
.prose h2 a.anchor svg { width: 14px; height: 14px; }
.prose h2 a.anchor:hover { color: var(--fg-secondary); }
.prose h2:hover a.anchor { opacity: 1; }
.prose h3 { font: var(--fw-medium) var(--fs-2)/var(--lh-2) var(--font); margin: 20px 0 6px; }
.prose p, .prose li { color: var(--fg-secondary); font-size: 14px; line-height: 22px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose b, .prose strong { color: var(--fg-primary); font-weight: 500; }
.prose a { color: var(--fg-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-tr); }
.prose a:hover { text-decoration-color: var(--fg-accent); }
.prose code, .tbl code { font: 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border-radius: 5px; background: var(--bg-depth); color: var(--fg-secondary); box-shadow: inset 0 0 0 .5px var(--row-divider); white-space: nowrap; }
.prose pre { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg-depth); box-shadow: inset 0 0 0 .5px var(--row-divider); overflow-x: auto; font: 12.5px/20px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg-secondary); }
.prose pre code { padding: 0; background: none; box-shadow: none; white-space: pre; }
.prose .kbd { vertical-align: 1px; }
.prose .tag { vertical-align: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0 0 20px; counter-reset: s; }
.steps > li { position: relative; padding: 0 0 20px 40px; counter-increment: s; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-tr); color: var(--fg-accent); font: 500 12px/1 var(--font); box-shadow: inset 0 0 0 .5px var(--accent-ring); }
.steps > li::after { content: ""; position: absolute; left: 12.75px; top: 30px; bottom: 4px; width: .5px; background: var(--row-divider); }
.steps > li:last-child::after { display: none; }
.steps > li > b { display: block; color: var(--fg-primary); font-weight: 500; margin-bottom: 2px; }
.steps p:last-child { margin-bottom: 0; }

/* callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; background: var(--bg-secondary); box-shadow: var(--shadow-surface-xxs); --surface-base: var(--bg-primary); }
.callout .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-tr); color: var(--fg-accent); }
.callout .ic svg { width: 16px; height: 16px; }
.callout p { margin: 0; color: var(--fg-secondary); }
.callout p b { display: block; color: var(--fg-primary); font-weight: 500; }
.callout.pro .ic { background: oklch(58.99% .2523 294.88 / .2); color: var(--fg-special); }
.callout.warn .ic { background: oklch(58.01% .1819 40.04 / .2); color: var(--fg-attention); }
.callout.ok .ic { background: oklch(54.42% .1689 138.23 / .2); color: var(--fg-positive); }

/* feature cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.cards a.fc { display: block; padding: 14px 16px; border-radius: 12px; background: var(--bg-secondary); box-shadow: var(--shadow-surface-xxs); --surface-base: var(--bg-primary); text-decoration: none; color: inherit; transition: background var(--t-fast) var(--ease-out); }
.cards a.fc:hover { background: var(--bg-tertiary); }
.fc .t { display: flex; align-items: center; gap: 8px; color: var(--fg-primary); font-weight: 500; margin-bottom: 4px; }
.fc .t svg { width: 16px; height: 16px; color: var(--fg-tertiary); flex: none; }
.fc .d { color: var(--fg-tertiary); font-size: 13px; line-height: 19px; }

/* tables */
.tblwrap { overflow-x: auto; margin: 0 0 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 20px; }
.tbl th { text-align: left; color: var(--fg-tertiary); font-weight: 400; font-size: 12px; padding: 0 12px 8px 0; border-bottom: .5px solid var(--row-divider); white-space: nowrap; }
.tbl td { padding: 9px 12px 9px 0; border-bottom: .5px solid var(--row-divider); color: var(--fg-secondary); vertical-align: top; }
.tbl td:first-child { color: var(--fg-primary); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .tag { vertical-align: 1px; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.plan { padding: 16px 18px; border-radius: 12px; background: var(--bg-secondary); box-shadow: var(--shadow-surface-xxs); --surface-base: var(--bg-primary); }
.plan .n { display: flex; align-items: center; gap: 8px; color: var(--fg-primary); font-weight: 500; }
.plan .pr { margin: 8px 0 2px; font: 500 24px/30px var(--font); color: var(--fg-primary); }
.plan .pr small { font: 400 13px/1 var(--font); color: var(--fg-tertiary); }
.plan .yr { color: var(--fg-tertiary); font-size: 13px; margin-bottom: 8px; }
.plan ul { margin: 0; padding-left: 18px; }
.plan li { font-size: 13px; line-height: 20px; }

/* figures + annotations */
figure.shot { margin: 8px 0 22px; }
.shot .frame { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-depth); box-shadow: var(--shadow-surface-sm); --surface-base: var(--bg-primary); }
.shot img { display: block; width: 100%; height: auto; }
.shot svg.anno { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.shot .pin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  background: var(--accent); color: #fff; font: 500 11px/1 var(--font); box-shadow: 0 0 0 2px oklch(20% 0 0 / .55), 0 2px 8px rgba(0, 0, 0, .55); }
.shot.live .pin { animation: pin-in .45s var(--ease-overshoot) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes pin-in { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.shot .box { position: absolute; border-radius: 8px; box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px var(--accent-tr); z-index: 1; }
.shot .box.soft { box-shadow: 0 0 0 1.5px oklch(100% 0 0 / .7), 0 0 0 5px oklch(100% 0 0 / .12); }
.shot figcaption { margin-top: 10px; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 20px; }
.legend li { position: relative; padding-left: 28px; color: var(--fg-tertiary); font-size: 13px; line-height: 20px; margin: 0; }
.legend li b { color: var(--fg-secondary); font-weight: 500; }
.legend li i { position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font: 500 10px/18px var(--font); text-align: center; font-style: normal; }
.shot .cap { color: var(--fg-tertiary); font-size: 13px; line-height: 19px; margin-top: 8px; }

/* prev / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: .5px solid var(--row-divider); }
.pn a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--bg-secondary); box-shadow: var(--shadow-surface-xxs); --surface-base: var(--bg-primary); text-decoration: none; color: inherit; transition: background var(--t-fast) var(--ease-out); }
.pn a:hover { background: var(--bg-tertiary); }
.pn a.next { text-align: right; align-items: flex-end; grid-column: 2; }
.pn a small { color: var(--fg-tertiary); font-size: 12px; }
.pn a span { color: var(--fg-primary); font-weight: 500; }
.pn:empty { display: none; }

/* footer */
.foot { margin-top: 32px; color: var(--fg-quaternary); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.foot a { color: var(--fg-tertiary); text-decoration: none; }
.foot a:hover { color: var(--fg-secondary); }

/* ── mobile ────────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 15; background: var(--bg-scrim); opacity: 0; pointer-events: none; transition: opacity var(--t-fast); }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--t-layout) var(--ease-layout); background: var(--bg-base); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  main.surface { left: 8px; }
  .mobilebar { display: flex; }
  .doc { grid-template-columns: minmax(0, 1fr); padding: 20px 18px 80px; gap: 0; }
  .toc { display: none; }
  .cards, .plans { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr; }
  .prose h1 { font-size: 24px; line-height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .shot.live .pin, .page-view.active, .sres { animation: none !important; } main.surface { scroll-behavior: auto; } }
