:root {
  --bg:#09090b; --bg-secondary:#0f0f12;
  --foreground:#fafafa;
  --foreground-70:rgba(250,250,250,0.7);
  --foreground-60:rgba(250,250,250,0.6);
  --foreground-40:rgba(250,250,250,0.5);
  --foreground-10:rgba(250,250,250,0.1);
  --foreground-04:rgba(250,250,250,0.04);
  --border-40:rgba(250,250,250,0.08);
  --card-bg:rgba(250,250,250,0.03);
  --emerald:#34d399; --emerald-bg:rgba(52,211,153,0.15);
  --red:#f87171; --red-bg:rgba(248,113,113,0.15);
  --amber:#fbbf24; --amber-bg:rgba(251,191,36,0.15);
  --blue:#60a5fa;
}
[data-theme="light"] {
  --bg:#f1f2f5; --bg-secondary:#ffffff;
  --foreground:#09090b;
  --foreground-70:rgba(9,9,11,0.7);
  --foreground-60:rgba(9,9,11,0.6);
  --foreground-40:rgba(9,9,11,0.56);
  --foreground-10:rgba(9,9,11,0.1);
  --foreground-04:rgba(9,9,11,0.04);
  --border-40:rgba(9,9,11,0.1);
  --card-bg:rgba(255,255,255,0.7);
  --emerald:#059669; --emerald-bg:rgba(5,150,105,0.1);
  --red:#dc2626; --red-bg:rgba(220,38,38,0.1);
  --amber:#d97706; --amber-bg:rgba(217,119,6,0.1);
  --blue:#2563eb;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{font-family:'Inter',-apple-system,sans-serif; background:var(--bg); color:var(--foreground); min-height:100vh; line-height:1.6;}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; gap:12px;
  padding:12px 20px;
  background:rgba(9,9,11,0.72);
  border-bottom:1px solid var(--border-40);
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
}
[data-theme="light"] .topbar{background:rgba(250,250,250,0.78);}
.topbar .brand{display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--foreground); margin-right:auto;}
.topbar .brand img{width:28px; height:28px; border-radius:7px;}
.topbar .brand span{font-weight:700; font-size:1.02em; letter-spacing:-0.01em;}
.topbar .brand span em{font-style:normal; opacity:0.5;}
.topbar .back{font-size:0.82em; color:var(--foreground-60); text-decoration:none; padding:7px 12px; border-radius:8px; border:1px solid var(--border-40); transition:all 0.15s;}
.topbar .back:hover{color:var(--foreground); border-color:var(--foreground-40); background:var(--foreground-04);}
.nav-toggle{
  display:none;
  width:36px; height:36px; padding:0; flex-shrink:0;
  align-items:center; justify-content:center;
  background:transparent; border:1px solid var(--border-40); border-radius:8px;
  color:var(--foreground-60); cursor:pointer; transition:all 0.15s;
}
.nav-toggle:hover{color:var(--foreground); border-color:var(--foreground-40);}
.nav-toggle svg{width:18px; height:18px;}

.theme-toggle{width:36px; height:36px; padding:0; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center;
  background:transparent; border:1px solid var(--border-40); border-radius:8px; color:var(--foreground-60); cursor:pointer; transition:all 0.15s;}
.theme-toggle:hover{color:var(--foreground); border-color:var(--foreground-40);}
.theme-toggle svg{width:16px; height:16px;}

.page{display:flex; align-items:flex-start; min-height:calc(100vh - 60px);}
.sidebar{
  position:sticky; top:60px;
  flex-shrink:0; width:240px;
  max-height:calc(100vh - 60px);
  padding:24px 18px 24px 24px;
  border-right:1px solid var(--border-40);
  overflow-y:auto;
}
.sidebar::-webkit-scrollbar{width:4px;}
.sidebar::-webkit-scrollbar-thumb{background:var(--foreground-10); border-radius:2px;}
.side-section-title{
  font-size:0.7em; font-weight:600;
  text-transform:uppercase; letter-spacing:0.16em;
  color:var(--foreground-60); margin-bottom:14px;
}
.side-nav{display:flex; flex-direction:column; gap:2px;}
.side-link{
  display:block; padding:8px 12px; border-radius:8px;
  font-size:0.85em; font-weight:500; color:var(--foreground-60);
  text-decoration:none; line-height:1.35;
  border-left:2px solid transparent;
  transition:all 0.15s;
}
.side-link:hover{color:var(--foreground); background:var(--foreground-04);}
.side-link.active{
  color:var(--foreground);
  background:var(--foreground-04);
  border-left-color:var(--foreground);
  border-radius:0 8px 8px 0;
  font-weight:600;
}
.sidebar-backdrop{
  display:none;
  position:fixed; inset:0; z-index:80;
  background:rgba(0,0,0,0.55);
  backdrop-filter:blur(2px);
}

.content{
  flex:1; min-width:0;
  max-width:960px; margin:0;
  padding:40px 48px 80px;
}

@media (max-width:900px){
  .nav-toggle{display:inline-flex;}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0;
    z-index:90;
    width:260px; max-height:none;
    padding-top:24px;
    background:var(--bg-secondary);
    border-right:1px solid var(--border-40);
    transform:translateX(-100%);
    transition:transform 0.22s ease;
  }
  body.nav-open .sidebar{transform:translateX(0); box-shadow:0 0 40px rgba(0,0,0,0.45);}
  body.nav-open .sidebar-backdrop{display:block;}
  .content{padding:28px 18px 60px;}
}

h1{font-size:2em; font-weight:700; letter-spacing:-0.025em; margin-bottom:8px;}
.lead{font-size:1em; color:var(--foreground-60); margin-bottom:32px;}
h2{font-size:1.25em; font-weight:700; letter-spacing:-0.015em; margin:36px 0 10px; scroll-margin-top:80px;}
h2::before{content:""; display:inline-block; width:3px; height:14px; background:var(--foreground); border-radius:2px; vertical-align:-1px; margin-right:9px;}
h3{font-size:0.95em; font-weight:600; margin:22px 0 8px; color:var(--foreground);}
p{color:var(--foreground-70); margin-bottom:12px;}
code, .mono{font-family:'SF Mono','Fira Code','Consolas',monospace; font-size:0.88em;}
p code, li code, td code{background:var(--foreground-04); padding:1px 6px; border-radius:4px; color:var(--foreground);}
ul{padding-left:22px; margin-bottom:14px; color:var(--foreground-70);}
ul li{margin-bottom:4px;}
pre{background:var(--bg-secondary); border:1px solid var(--border-40); border-radius:10px; padding:16px 18px; overflow-x:auto; margin:8px 0 20px; font-size:0.84em; line-height:1.55; color:var(--foreground-70);}
pre.code{font-family:'SF Mono','Fira Code','Consolas',monospace;}
pre .k{color:var(--blue);} pre .s{color:var(--emerald);} pre .c{color:var(--foreground-40); font-style:italic;}
pre .n{color:var(--amber);} pre .b{color:#c084fc;}
.endpoint{display:flex; align-items:center; gap:10px; font-size:0.92em; margin:18px 0 4px; padding:10px 14px; background:var(--card-bg); border:1px solid var(--border-40); border-radius:10px;}
.endpoint .verb{padding:3px 9px; border-radius:6px; font-size:0.8em; font-weight:700; font-family:'SF Mono',monospace;}
.endpoint .verb.post{background:var(--emerald-bg); color:var(--emerald);}
.endpoint .verb.get{background:rgba(96,165,250,0.15); color:var(--blue);}
.endpoint .path{font-family:'SF Mono',monospace; font-size:0.94em; color:var(--foreground);}
table{width:100%; border-collapse:collapse; font-size:0.82em; margin:8px 0 22px;}
th, td{padding:8px 12px; text-align:left; border-bottom:1px solid var(--border-40); color:var(--foreground-70);}
th{font-size:0.84em; font-weight:600; text-transform:uppercase; letter-spacing:0.08em; color:var(--foreground-60); background:var(--card-bg);}
.code-col{font-family:'SF Mono',monospace; color:var(--foreground); font-weight:600;}
.perm-yes{color:var(--amber); font-weight:600; font-size:0.85em;}
.perm-no{color:var(--foreground-40); font-size:0.85em;}
footer{margin-top:60px; padding-top:24px; border-top:1px solid var(--border-40); font-size:0.78em; color:var(--foreground-40); text-align:center;}
footer a{color:var(--foreground-70); text-decoration:none; font-weight:600;}

@media (max-width: 760px) { .content table { display: block; max-width: 100%; overflow-x: auto; } }
.pv { margin: 10px 0 6px; padding: 14px 16px; border: 1px solid var(--border-40); border-radius: 12px; background: var(--card-bg); display: flex; flex-direction: column; gap: 9px; max-width: 560px; contain: layout paint; }
.pv-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-stack { display: grid; }
.pv-stack > .pv-f { grid-area: 1 / 1; opacity: 0; animation: pv-show 10s step-end infinite; }
.pv-stack > .pv-f:nth-child(2) { animation-delay: 2s; }
.pv-stack > .pv-f:nth-child(3) { animation-delay: 4s; }
.pv-stack > .pv-f:nth-child(4) { animation-delay: 6s; }
.pv-stack > .pv-f:nth-child(5) { animation-delay: 8s; }
@keyframes pv-show { 0% { opacity: 1; } 20% { opacity: 0; } }
.pv-chips { flex: none; }
.pv-chip { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: .72em; font-weight: 700; white-space: nowrap; }
.pv-run { color: var(--blue); background: color-mix(in srgb, var(--blue) 15%, transparent); }
.pv-ok { color: var(--emerald); background: var(--emerald-bg); }
.pv-title { font-size: .86em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-bar { position: relative; height: 10px; border-radius: 999px; background: var(--foreground-04); border: 1px solid var(--border-40); overflow: hidden; }
.pv-fill { position: absolute; inset: 0; border-radius: 999px; background: var(--blue); transform-origin: left; transform: scaleX(.05); animation: pv-grow 10s ease-in-out infinite; }
.pv-fill-ok { background: var(--emerald); opacity: 0; transform: none; animation: pv-ok 10s step-end infinite; }
@keyframes pv-grow { 0%, 16% { transform: scaleX(.05); } 22%, 36% { transform: scaleX(.42); } 42%, 56% { transform: scaleX(.78); } 62%, 76% { transform: scaleX(.99); } 80%, 100% { transform: scaleX(1); } }
@keyframes pv-ok { 0% { opacity: 0; } 80% { opacity: 1; } }
.pv-meta { font-size: .8em; color: var(--foreground-60); font-variant-numeric: tabular-nums; }
.pv-foot { display: flex; align-items: center; justify-content: space-between; font-size: .74em; color: var(--foreground-40); }
.pv-btn { padding: 4px 12px; border-radius: 8px; background: var(--foreground); color: var(--bg); font-weight: 600; opacity: 0; animation: pv-ok 10s step-end infinite; }
.pv-cap { font-size: .8em; color: var(--foreground-60); }
@media (prefers-reduced-motion: reduce) {
  .pv-stack > .pv-f, .pv-fill, .pv-fill-ok, .pv-btn { animation: none; }
  .pv-stack > .pv-f:nth-child(2) { opacity: 1; }
  .pv-fill { transform: scaleX(.42); }
}

.side-section-title + .side-nav { margin-bottom: 22px; }
.sv { display: inline-block; min-width: 40px; margin-right: 6px; font: 700 .82em/1 'SF Mono', monospace; letter-spacing: .02em; }
.sv.post { color: var(--emerald); }
.sv.get { color: var(--blue); }
h1 { scroll-margin-top: 80px; }
h3[id] { scroll-margin-top: 80px; }
h4 { font-size: .86em; font-weight: 600; margin: 18px 0 8px; color: var(--foreground-70); }
.content a { color: var(--blue); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content a code { color: var(--blue); }
ol.steps { margin: 0 0 18px 20px; color: var(--foreground-70); }
ol.steps li { margin-bottom: 6px; padding-left: 4px; }
table.fields td:first-child, table.methods td:first-child { white-space: nowrap; }
table.fields td:nth-child(2) { color: var(--foreground-60); white-space: nowrap; font-size: .95em; }
td { vertical-align: top; line-height: 1.55; }
.req { font-weight: 600; color: var(--foreground); }

.msg { display: flex; align-items: flex-start; gap: 16px; padding: 18px 22px; margin: 14px 0 22px; border-radius: 6px;
  font-size: .95em; line-height: 1.65; color: #3c3c3c; }
.msg strong { color: #2b2b2b; font-weight: 700; }
.msg code { background: rgba(0,0,0,.06); color: #2b2b2b; }
.msg a { color: #2b2b2b; text-decoration: underline; }
.msg-ico { flex: none; width: 24px; height: 24px; margin-top: 2px; }
.msg-ico path, .msg-ico circle { stroke-linecap: round; stroke-linejoin: round; }
.msg-ico > :first-child { stroke: none; }
.msg-ico > :not(:first-child) { stroke: #fff; stroke-width: 2.4; fill: none; }
.msg.is-warning { background: #fde9cf; }
.msg.is-warning .msg-ico > :first-child { fill: #f7941d; stroke: #f7941d; stroke-width: 2; stroke-linejoin: round; }
.msg.is-danger { background: #fde1df; }
.msg.is-danger .msg-ico > :first-child { fill: #f0625d; }
.msg.is-info { background: #dff2fa; }
.msg.is-info .msg-ico > :first-child { fill: #5bbde9; }
:root:not([data-theme="light"]) .msg { color: var(--foreground-70); }
:root:not([data-theme="light"]) .msg strong, :root:not([data-theme="light"]) .msg a { color: var(--foreground); }
:root:not([data-theme="light"]) .msg code { background: rgba(255,255,255,.08); color: var(--foreground); }
:root:not([data-theme="light"]) .msg.is-warning { background: rgba(247,148,29,.13); }
:root:not([data-theme="light"]) .msg.is-danger { background: rgba(240,98,93,.13); }
:root:not([data-theme="light"]) .msg.is-info { background: rgba(91,189,233,.12); }

.ai-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; margin: 4px 0 30px;
  border: 1px solid var(--border-40); border-radius: 12px; background: var(--card-bg); }
.ai-text { display: flex; flex-direction: column; gap: 3px; min-width: 220px; flex: 1 1 260px; }
.ai-text strong { font-size: .92em; }
.ai-text span { font-size: .8em; color: var(--foreground-60); }
.ai-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  font: 600 .82em 'Inter', sans-serif; color: var(--foreground); background: var(--bg-secondary); border: 1px solid var(--border-40);
  transition: border-color .15s, background .15s; }
.ai-btn:hover { border-color: var(--foreground-40); background: var(--foreground-04); }
.ai-btn:focus-visible, .ct-tab:focus-visible, .ct-copy:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ai-btn svg { width: 20px; height: 20px; flex: none; }
.ai-btn.done, .ai-btn.done:hover { color: var(--emerald); background: var(--emerald-bg); border-color: color-mix(in srgb, var(--emerald) 40%, transparent); }

.codetabs, .codeblock { position: relative; margin: 8px 0 20px; border: 1px solid var(--border-40); border-radius: 10px; background: var(--bg-secondary); overflow: hidden; }
.codetabs pre, .codeblock pre { margin: 0; border: 0; border-radius: 0; }
.ct-bar { display: flex; align-items: center; gap: 2px; padding: 0 6px 0 8px; border-bottom: 1px solid var(--border-40); background: var(--card-bg); min-height: 40px; }
.ct-tab { position: relative; padding: 10px 12px; border: 0; background: none; cursor: pointer; font: 600 .78em 'Inter', sans-serif; color: var(--foreground-60); }
.ct-tab:hover { color: var(--foreground); }
.ct-tab[aria-selected="true"] { color: var(--foreground); }
.ct-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }
.ct-label { font-size: .76em; font-weight: 600; color: var(--foreground-60); padding: 10px 4px; }
.ct-label code { background: none; padding: 0; }
.ct-copy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px; border: 1px solid transparent;
  background: none; cursor: pointer; font: 600 .74em 'Inter', sans-serif; color: var(--foreground-60); }
.ct-copy:hover { color: var(--foreground); border-color: var(--border-40); }
.ct-copy svg { width: 14px; height: 14px; }
.codeblock .ct-copy { position: absolute; top: 8px; right: 8px; background: var(--bg-secondary); }
pre.plain { color: var(--foreground); }
pre .t-k { color: #c084fc; } pre .t-s { color: var(--emerald); } pre .t-n { color: var(--amber); }
pre .t-c { color: var(--foreground-40); font-style: italic; } pre .t-p { color: var(--blue); } pre .t-v { color: #f472b6; }
[data-theme="light"] pre .t-k { color: #7c3aed; } [data-theme="light"] pre .t-v { color: #be185d; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 10px; background: var(--foreground); color: var(--bg); font-size: .84em; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media (max-width: 600px) { .ai-btns { width: 100%; } .ai-btn { flex: 1 1 auto; justify-content: center; } .msg { padding: 14px 16px; gap: 12px; } }
.ct-copy.copied, .ct-copy.copied:hover { color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 40%, transparent); background: var(--emerald-bg); }
table.fields tr.grp td { padding: 30px 12px 10px; font-size: 1.12em; font-weight: 700; letter-spacing: -.01em; color: var(--foreground); background: none; border-bottom: 1px solid var(--foreground-10); }
table.fields tr.grp:first-child td { padding-top: 14px; }
.msg-code { margin: 10px 0 0; padding: 8px 12px; border: 0; border-radius: 6px; background: rgba(0,0,0,.06); color: inherit; font: .86em/1.5 'SF Mono', 'Fira Code', Consolas, monospace; overflow-x: auto; }
:root:not([data-theme="light"]) .msg-code { background: rgba(255,255,255,.06); }
.msg > div { min-width: 0; flex: 1; }
.req-tag { display: block; margin-top: 5px; font-size: .86em; font-weight: 600; letter-spacing: .01em; color: #b45309; }
:root:not([data-theme="light"]) .req-tag { color: #fbbf24; }
h2.sub { font-size: .95em; font-weight: 600; letter-spacing: 0; margin: 22px 0 8px; }
h2.sub::before { display: none; }
@media (max-width: 760px) {
  .content table.fields { display: block; overflow: visible; }
  table.fields thead { display: none; }
  table.fields tbody, table.fields tr, table.fields td { display: block; }
  table.fields tr { padding: 12px 0; border-bottom: 1px solid var(--border-40); }
  table.fields td { padding: 0; border: 0; }
  table.fields td:first-child { display: inline; }
  table.fields td:first-child .req-tag { display: inline; margin: 0 0 0 8px; }
  table.fields td:nth-child(2):not(:last-child) { display: inline; margin-left: 8px; }
  table.fields td:last-child:not(:first-child) { display: block; margin-top: 6px; white-space: normal; font-size: 1em; color: var(--foreground-70); }
  table.fields tr.grp { padding: 28px 0 8px; border-bottom: 1px solid var(--foreground-10); }
  table.fields tr.grp td { padding: 0; border: 0; font-size: 1.12em; }
}

/* ---- videodl.app copy: header CTA + cookie consent (shared main.js) ---- */
.topbar .docs-cta{background:var(--foreground);color:var(--bg);border-color:var(--foreground);font-weight:600}
.topbar .docs-cta:hover{opacity:.9}
.consent{position:fixed;left:20px;bottom:20px;z-index:300;width:min(420px,calc(100vw - 40px));padding:18px 18px 16px;border:1px solid var(--border-40);border-radius:14px;background:var(--bg-secondary);color:var(--foreground);box-shadow:0 18px 48px -20px rgba(0,0,0,.5)}
.consent[hidden]{display:none}
.consent__text{margin:0 0 14px;font-size:.88rem;line-height:1.55;color:var(--foreground-70)}
.consent__text a{color:var(--foreground);text-decoration:underline;text-underline-offset:3px}
.consent__actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.consent__btn{min-height:42px;padding:0 14px;border-radius:999px;border:1px solid var(--border-40);background:transparent;color:var(--foreground);font:inherit;font-size:.9rem;font-weight:600;cursor:pointer}
.consent__btn--accept{background:var(--foreground);border-color:var(--foreground);color:var(--bg)}
.consent__btn:focus-visible{outline:2px solid var(--foreground);outline-offset:2px}
@media (max-width:640px){.consent{left:12px;right:12px;bottom:12px;width:auto}}
/* Two-column field tables (e.g. HTTP status codes): the 2nd column is the description, so let it wrap */
table.fields td:nth-child(2):last-child { white-space: normal; }
@media (max-width: 520px) { .topbar .md-link { display: none; } .topbar .docs-cta { padding: 7px 10px; } }
.topbar .docs-cta, .topbar .brand span { white-space: nowrap; }
@media (max-width: 400px) { .topbar .brand span { display: none; } }

/* End-of-docs call to action */
.docs-end{margin:56px 0 24px;padding:28px;border:1px solid var(--border-40);border-radius:14px;background:var(--bg-secondary)}
.docs-end h2{margin:0 0 8px;border:0;padding:0}
.docs-end h2::before,.docs-end h2::after{content:none!important;display:none!important}
.docs-end p{margin:0 0 20px;color:var(--foreground-60);max-width:60ch}
.docs-end__actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.docs-end__btn{display:inline-flex;align-items:center;min-height:44px;padding:0 20px;border-radius:999px;background:var(--foreground);color:var(--bg);font-weight:600;text-decoration:none}
.docs-end__btn:hover{opacity:.9}
main .docs-end a.docs-end__btn,main .docs-end a.docs-end__btn:hover{color:var(--bg);text-decoration:none}
.docs-end__link{color:var(--foreground);font-weight:500;text-underline-offset:3px}
@media (max-width:520px){.docs-end{padding:20px}.docs-end__btn{width:100%;justify-content:center}}
