/* TheOldAPI design system. Token and component anatomy follow shadcn/ui; shared by every shell. */
:root{
  color-scheme:dark;
  --bg:#0a0a0a;--bg-1:#0c0c0f;--bg-2:#111115;--bg-3:#17171c;--bg-4:#1f1f26;
  --line:rgba(255,255,255,.075);--line-2:rgba(255,255,255,.13);--line-3:rgba(255,255,255,.22);
  --fg:#fafafa;--fg-2:#c4c4cc;--fg-3:#8e8e99;--fg-4:#80808b;
  --brand:#9a9dff;--brand-2:#c28dff;--ember:#ff9d6c;
  --grad:linear-gradient(100deg,#a9abff 0%,#c79bff 42%,#ff9d8a 78%,#ffc27a 100%);
  --ok:#3dd68c;--warn:#f5b84a;--bad:#ff6b6b;--info:#6fb7ff;
  --r5:#7fdcc4;--r10:#8cc7ff;--r25:#b3b3ff;--r50:#d9a3f5;--r100:#ffab8f;--r0:#a7adb8;
  --radius:10px;--radius-lg:16px;--radius-xl:22px;
  --font:'Geist','Inter',ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --mono:'Geist Mono','SF Mono',ui-monospace,'Cascadia Code',Menlo,Consolas,monospace;
  --shadow:0 1px 2px rgba(0,0,0,.5),0 12px 32px -12px rgba(0,0,0,.6);
  --ease:cubic-bezier(.2,.7,.2,1);
  --gutter:clamp(16px,4vw,40px);
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;background:var(--bg);scrollbar-gutter:stable}
body{margin:0;min-height:100dvh;background:var(--bg);color:var(--fg);font:400 15px/1.55 var(--font);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-feature-settings:'cv11','ss01'}
h1,h2,h3,h4,p,dl,dd,ul,ol,figure,pre{margin:0}
ul,ol{padding:0;list-style:none}
h1,h2,h3,h4{font-weight:500;letter-spacing:-.02em;line-height:1.15;color:var(--fg);text-wrap:balance}
p{text-wrap:pretty}
a{color:inherit;text-decoration:none}
img,svg{display:block;max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
button:disabled{cursor:not-allowed}
code,kbd,pre,.mono{font-family:var(--mono);font-feature-settings:'liga' 0}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:6px}
::selection{background:rgba(154,157,255,.32)}
/* Mouse only: styled scrollbars take up layout width on touch devices. */
@media (hover:hover) and (pointer:fine){
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:10px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.2);border:2px solid transparent;background-clip:content-box}
}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip-link{position:fixed;left:12px;top:-60px;z-index:200;transition:top .15s}.skip-link:focus{top:12px}
.muted{color:var(--fg-3)}.small{font-size:13px}.num{text-align:right;font-variant-numeric:tabular-nums}.tnum{font-variant-numeric:tabular-nums}
.flex{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.row-between{display:flex;justify-content:space-between;align-items:center;gap:14px}
.icon{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;flex:none}
.icon-lg{width:22px;height:22px}

@media (max-width:960px){html{scrollbar-gutter:auto}}

/* Button */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 15px;border-radius:9px;border:1px solid var(--line-2);background:rgba(255,255,255,.03);color:var(--fg);font-size:14px;font-weight:500;letter-spacing:-.005em;white-space:nowrap;transition:background .15s,border-color .15s,transform .12s,color .15s,opacity .15s;user-select:none}
.btn:hover{background:rgba(255,255,255,.08);border-color:var(--line-3)}
.btn:active{transform:translateY(1px)}
.btn:disabled,.btn[aria-disabled=true]{opacity:.45;pointer-events:none}
.btn-primary{background:#fafafa;color:#0a0a0c;border-color:#fafafa}
.btn-primary:hover{background:#fff;border-color:#fff;box-shadow:0 0 0 4px rgba(255,255,255,.1)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--fg-2)}
.btn-ghost:hover{background:rgba(255,255,255,.06);border-color:transparent;color:var(--fg)}
.btn-lg{height:46px;padding:0 20px;font-size:15px;border-radius:11px}
.btn-sm{height:30px;padding:0 10px;font-size:13px;border-radius:7px}
.btn-block{width:100%}
.btn-icon{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:8px;color:var(--fg-3);transition:background .15s,color .15s}
.btn-icon:hover{background:rgba(255,255,255,.08);color:var(--fg)}
.btn-spinner{width:15px;height:15px;border-radius:50%;border:2px solid rgba(0,0,0,.2);border-top-color:#0a0a0c;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Inputs */
input[type=text],input[type=email],input[type=password],input[type=search],input:not([type]),select,textarea{width:100%;height:38px;padding:0 12px;background:var(--bg-2);border:1px solid var(--line-2);border-radius:9px;color:var(--fg);font-size:14px;outline:0;transition:border-color .15s,box-shadow .15s,background .15s}
textarea{height:auto;padding:11px 12px;line-height:1.55;resize:vertical}
select{appearance:none;padding-right:32px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238e8e99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
select option{background:#16161b}
input:focus,select:focus,textarea:focus{border-color:rgba(154,157,255,.7);box-shadow:0 0 0 3px rgba(154,157,255,.18)}
input::placeholder,textarea::placeholder{color:var(--fg-4)}
input[type=search]::-webkit-search-cancel-button{appearance:none}
input[type=checkbox]{width:15px;height:15px;accent-color:var(--brand);flex:none}
input[type=range]{width:100%;height:20px;background:none;appearance:none;margin:0;cursor:pointer;--pct:50%}
input[type=range]::-webkit-slider-runnable-track{height:5px;border-radius:9px;background:linear-gradient(90deg,var(--brand) var(--pct),rgba(255,255,255,.12) var(--pct))}
input[type=range]::-moz-range-track{height:5px;border-radius:9px;background:rgba(255,255,255,.12)}
input[type=range]::-moz-range-progress{height:5px;border-radius:9px;background:var(--brand)}
input[type=range]::-webkit-slider-thumb{appearance:none;width:18px;height:18px;margin-top:-6.5px;border-radius:50%;background:#fff;border:0;box-shadow:0 0 0 4px rgba(154,157,255,.25)}
input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#fff;border:0}
.search-wrap{position:relative}.search-wrap .icon{position:absolute;left:12px;top:50%;margin-top:-8px;color:var(--fg-4);pointer-events:none}.search-wrap input{padding-left:36px}
label.field{display:grid;gap:7px;font-size:13px;color:var(--fg-2);font-weight:500}

/* Touch: 16px stops iOS zooming on focus; 44px is a reliable tap target. */
@media (max-width:900px){input[type=text],input[type=email],input[type=password],input[type=search],input:not([type]),input[type=range],select,textarea{font-size:16px;min-height:44px}textarea{height:auto}}

/* Card, badge, segmented */
.card{background:var(--bg-1);border:1px solid var(--line);border-radius:var(--radius-lg)}
.badge{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 8px;border-radius:6px;font-size:12px;font-weight:500;background:rgba(255,255,255,.06);color:var(--fg-2);white-space:nowrap}
.segmented{display:inline-flex;gap:2px;padding:3px;background:rgba(255,255,255,.05);border-radius:9px}
.segmented button{height:28px;padding:0 11px;border-radius:7px;font-size:13px;font-weight:500;color:var(--fg-3);transition:background .15s,color .15s;white-space:nowrap}
.segmented button:hover{color:var(--fg)}
.segmented button.active,.segmented button[aria-pressed=true],.segmented button[aria-selected=true]{background:rgba(255,255,255,.11);color:var(--fg)}

/* Rate: colour always ships with its number, never alone. */
.rate{display:inline-flex;align-items:center;gap:6px;font:500 13px/1 var(--mono);color:var(--rate,var(--fg-2));white-space:nowrap;font-variant-numeric:tabular-nums}
.rate::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}
.rate-0{--rate:var(--r0)}.rate-5{--rate:var(--r5)}.rate-10{--rate:var(--r10)}.rate-25{--rate:var(--r25)}.rate-50{--rate:var(--r50)}.rate-100{--rate:var(--r100)}

/* Lab logos */
.lab-logo{width:18px;height:18px;object-fit:contain;filter:brightness(0) invert(1);opacity:.92;flex:none}
.lab-mark{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:rgba(255,255,255,.055);border:1px solid var(--line);flex:none;font:500 13px var(--font);color:var(--fg-2)}

/* Code block */
.code{position:relative;background:#0a0a0d;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;padding:6px 6px 6px 12px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.02)}
.code-title{font:500 12px var(--mono);color:var(--fg-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.code pre{padding:15px 16px;overflow:auto;font-size:13px;line-height:1.7;color:#d7d7de;tab-size:2}
.code pre code{font-family:inherit}
.t-k{color:#c9a4ff}.t-s{color:#9ee2b3}.t-n{color:#ffc27a}.t-c{color:#62626d;font-style:italic}.t-f{color:#8fb8ff}
code.inline,p code,li code,td code{font-size:.88em;padding:2px 6px;border-radius:5px;background:rgba(255,255,255,.07);color:#e6e6ec}

/* Tables */
.table-scroll{overflow:auto;-webkit-overflow-scrolling:touch}
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th{padding:10px 14px;text-align:left;font-size:12px;font-weight:500;color:var(--fg-3);border-bottom:1px solid var(--line);white-space:nowrap}
.table th.num{text-align:right}
.table td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table tbody tr:hover td{background:rgba(255,255,255,.018)}

/* Dialog / drawer */
.scrim{position:fixed;inset:0;background:rgba(3,3,5,.68);backdrop-filter:blur(4px);z-index:90;animation:fade .18s}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(520px,100vw);background:var(--bg-1);border-left:1px solid var(--line-2);z-index:91;display:flex;flex-direction:column;animation:slide .24s var(--ease);overflow:hidden}
@keyframes fade{from{opacity:0}}@keyframes slide{from{transform:translateX(26px);opacity:0}}
.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 20px 16px;border-bottom:1px solid var(--line)}
.drawer-body{padding:20px;overflow:auto;display:flex;flex-direction:column;gap:20px;flex:1;min-height:0}
.drawer-body>*{flex:none}
.spec-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.spec-grid>div{background:var(--bg-1);padding:13px 14px;min-width:0}
.spec-grid dt{font-size:12px;color:var(--fg-3);margin-bottom:5px}
.spec-grid dd code{overflow-wrap:anywhere;font-size:13px}
.spec-grid dd{font-size:17px;font-weight:500;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.chips{display:flex;flex-wrap:wrap;gap:6px}

/* Toast */
.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:120;background:#fafafa;color:#0a0a0c;padding:9px 14px;border-radius:9px;font-size:13px;font-weight:500;box-shadow:var(--shadow);animation:rise .2s var(--ease);max-width:calc(100vw - 32px)}
@keyframes rise{from{transform:translate(-50%,8px);opacity:0}}

/* Explorer: one model browser for the public site and the dashboard. */
.explorer{display:grid;grid-template-columns:232px minmax(0,1fr);gap:28px;align-items:start}
.ex-rail{position:sticky;top:calc(var(--sticky-top,84px));display:grid;gap:22px;max-height:calc(100dvh - var(--sticky-top,84px) - 16px);overflow:auto;padding-right:6px;scrollbar-width:thin}
.ex-group h2{font-size:12px;letter-spacing:0;line-height:1.3;font-weight:500;color:var(--fg-3);letter-spacing:0;margin-bottom:8px}
.ex-opt{display:flex;align-items:center;gap:9px;width:100%;min-height:32px;padding:4px 8px;border-radius:7px;font-size:13.5px;color:var(--fg-2);text-align:left;transition:background .12s,color .12s}
.ex-opt:hover{background:rgba(255,255,255,.05);color:var(--fg)}
.ex-opt.active{background:rgba(255,255,255,.09);color:var(--fg)}
.ex-opt .lab-logo{width:15px;height:15px}
.ex-opt small{margin-left:auto;font:400 12px var(--mono);color:var(--fg-4)}
.ex-more{font-size:12.5px;color:var(--fg-3);padding:6px 8px}.ex-more:hover{color:var(--fg)}
.ex-toolbar{display:flex;gap:10px;align-items:center;margin-bottom:12px}
.ex-toolbar .search-wrap{flex:1;min-width:0}
.ex-toolbar select{width:auto;min-width:154px}
.ex-rail{min-height:calc(100dvh - var(--sticky-top,84px) - 16px)}
.ex-count{font-size:13px;color:var(--fg-3);margin:0 0 10px;display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}
.ex-filter-btn{display:none}
.ex-apply{display:none}
.explorer>div:last-child{min-height:70vh}
.ex-head,.ex-row{display:grid;grid-template-columns:minmax(0,1fr) 84px 96px 74px 32px;gap:14px;align-items:center}
.ex-head{padding:8px 16px;font-size:12px;color:var(--fg-3)}
.ex-head>*:nth-child(n+2){text-align:right}
.ex-list{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--bg-1)}
.ex-row{width:100%;padding:9px 16px;border-bottom:1px solid var(--line);text-align:left;transition:background .12s;position:relative}
.ex-row:last-child{border-bottom:0}
.ex-row:hover{background:rgba(255,255,255,.028)}
.ex-main{display:flex;gap:12px;align-items:center;min-width:0}
.ex-name{display:block;font:450 14px var(--mono);color:var(--fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}
.ex-sub{display:block;font-size:12.5px;color:var(--fg-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}
.ex-cell{text-align:right;font-size:13.5px;color:var(--fg-2);font-variant-numeric:tabular-nums;white-space:nowrap}
.ex-cell .ex-cap{display:none}
.ex-open{position:absolute;inset:0;width:100%;z-index:1;border-radius:0}
.ex-open:focus-visible{outline-offset:-2px;border-radius:12px}
.ex-copy{position:relative;z-index:2;justify-self:end;opacity:.55;transition:opacity .12s,background .12s,color .12s}
.ex-row:hover .ex-copy,.ex-copy:focus-visible{opacity:1}
.ex-empty{padding:44px 20px;text-align:center;color:var(--fg-3)}
.ex-empty h3{font-size:15px;color:var(--fg);margin-bottom:6px}
.ex-more-row{padding:12px;display:flex;justify-content:center;border-top:1px solid var(--line)}
.ex-note{margin-top:12px;font-size:12.5px;color:var(--fg-3)}
.ex-sheet-head,.ex-unit,.ex-scrim{display:none}
.ex-filter-count{min-width:18px;height:18px;padding:0 5px;display:inline-grid;place-items:center;border-radius:9px;background:var(--fg);color:#0a0a0a;font-size:11px;font-weight:600}
.ex-filter-count[hidden]{display:none}
@media (max-width:960px){
  .explorer{grid-template-columns:minmax(0,1fr);gap:0}
  .ex-filter-btn{display:inline-flex;flex:none;height:44px}
  /* Filters open as a bottom sheet of tappable chips, reachable by thumb. */
  .ex-rail{position:fixed;inset:auto 0 0 0;z-index:92;max-height:84dvh;min-height:0;display:none;gap:18px;padding:0 16px calc(16px + env(safe-area-inset-bottom));background:#141417;border:1px solid var(--line-2);border-bottom:0;border-radius:18px 18px 0 0;overflow:auto;overscroll-behavior:contain;box-shadow:0 -20px 60px rgba(0,0,0,.6)}
  .ex-rail.open{display:grid;animation:sheetUp .22s var(--ease)}
  @keyframes sheetUp{from{transform:translateY(24px);opacity:0}}
  .ex-scrim.open{display:block;position:fixed;inset:0;z-index:91;background:rgba(3,3,5,.62)}
  .ex-sheet-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:1;margin:0 -16px;padding:10px 8px 8px 16px;background:#141417;border-bottom:1px solid var(--line)}
  .ex-sheet-head strong{font-size:16px;font-weight:600}
  .ex-sheet-head .btn-icon{width:44px;height:44px}
  .ex-group{display:flex;flex-wrap:wrap;gap:6px}
  .ex-group h2{width:100%;font-size:13px;color:var(--fg-2);margin-bottom:2px}
  .ex-opt{width:auto;min-height:40px;padding:0 12px;border:1px solid var(--line-2);border-radius:20px;font-size:14px}
  .ex-opt.active{background:var(--fg);border-color:var(--fg);color:#0a0a0a}
  .ex-opt.active .lab-logo{filter:none}
  .ex-opt small{display:none}
  .ex-apply{display:flex;position:sticky;bottom:0;width:100%;height:46px}
}
@media (max-width:640px){
  .ex-toolbar{flex-wrap:wrap}
  .ex-toolbar .search-wrap{flex:1 1 100%}
  .ex-toolbar select{flex:1;min-width:0}
  .ex-head{display:none}
  /* Rows read at a glance: the name on one line, its numbers on the next. */
  .ex-row{display:flex;flex-wrap:wrap;gap:3px 12px;padding:11px 44px 11px 12px}
  .ex-main{width:100%;gap:8px}
  .ex-row .lab-mark{width:20px;height:20px;background:none;border:0}
  .ex-row .lab-mark .lab-logo{width:16px;height:16px}
  .ex-sub,.ex-cell .ex-cap{display:none}
  .ex-cell{font-size:13px;color:var(--fg-3)}
  .ex-unit{display:inline}
  .ex-copy{position:absolute;right:2px;top:50%;margin-top:-22px;width:44px;height:44px;opacity:.7}
  .ex-main{padding-right:0}
}

/* Docs: three-pane reference shared by the public site and the dashboard. */
.docs-shell{display:grid;grid-template-columns:210px minmax(0,1fr);gap:48px;align-items:start}
.docs-nav{position:sticky;top:var(--sticky-top,84px);display:grid;gap:18px;max-height:calc(100dvh - var(--sticky-top,84px) - 16px);overflow:auto;scrollbar-width:thin}
.docs-nav-title{font-size:12px;font-weight:500;color:var(--fg-4);margin-bottom:6px;padding-left:10px}
.docs-nav-link{display:block;padding:5px 10px;border-radius:7px;font-size:13.5px;color:var(--fg-3);transition:color .12s,background .12s}
.docs-nav-link:hover{color:var(--fg)}
.docs-nav-link.active{color:var(--fg);background:rgba(255,255,255,.07)}
.docs-body{min-width:0;max-width:820px;display:grid;gap:52px}
.docs-section{scroll-margin-top:calc(var(--sticky-top,84px) + 8px);display:grid;gap:14px}
.docs-section h2{font-size:26px}
.docs-section h3{font-size:16px;margin-top:8px;letter-spacing:-.012em}
.docs-section p,.docs-section li{color:var(--fg-2);line-height:1.68}
.docs-section ul{display:grid;gap:7px}
.docs-section ul li{padding-left:16px;position:relative}
.docs-section ul li::before{content:'';position:absolute;left:2px;top:.72em;width:4px;height:4px;border-radius:50%;background:var(--fg-4)}
.docs-section a:not(.btn){color:var(--fg);text-decoration:underline;text-decoration-color:var(--line-3);text-underline-offset:3px}
.docs-section a:not(.btn):hover{text-decoration-color:var(--fg)}
.endpoint-row{display:grid;grid-template-columns:minmax(0,370px) minmax(0,1fr);gap:18px;padding:13px 0;border-top:1px solid var(--line);align-items:baseline}
.endpoint-row:first-of-type{border-top:0}
.endpoint-row code{font-size:13px;background:none;padding:0;color:var(--fg);overflow-wrap:anywhere}
.docs-body td code{white-space:nowrap}
.code-one{display:flex;align-items:center;gap:4px;padding-right:6px}
.code-one pre{flex:1;min-width:0;padding-block:12px}
.endpoint-row code b{color:var(--ok);font-weight:500;margin-right:7px}
.endpoint-row code b.m-post{color:var(--brand)}
.endpoint-row p{font-size:14px;color:var(--fg-3)}
.callout{padding:13px 15px;border-radius:11px;border:1px solid var(--line-2);background:rgba(154,157,255,.06);font-size:14px;color:var(--fg-2)}
.docs-jump-wrap{display:none}
@media (max-width:960px){
  .docs-shell{grid-template-columns:minmax(0,1fr);gap:16px}
  .docs-nav{display:none}
  /* One jump menu replaces the sideways tab strip. */
  .docs-jump-wrap{display:block;position:sticky;top:64px;z-index:5;padding:8px 0;background:var(--bg)}
  .docs-body{gap:36px}
  .docs-section h2{font-size:22px}
  .docs-body pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12.5px;padding:12px 13px}
  .docs-body td code{white-space:normal;overflow-wrap:anywhere}
  .endpoint-row{grid-template-columns:minmax(0,1fr);gap:4px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
