/* docs.aimixmedia.site — readable, semantic, same palette as the main site */
:root { --bg: #07070a; --surface: #0d0d12; --surface-2: #131319; --surface-3: #1a1a21; --border: #25252e; --text: #ececf1; --dim: #a1a1b0; --violet: #8b5cf6; --blue: #3b82f6; --mint: #10d99a; --orange: #ff9500; --pink: #ff375f;
  --rainbow: linear-gradient(90deg, #ffd60a, #ff9500, #ff375f, #d946ef, #8b5cf6, #3b82f6, #06b6d4, #10d99a); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: #b69cff; text-decoration: none; } a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 12px 22px; background: rgba(7,7,10,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; font-size: 1.05em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 1px; }
.brand .muted { color: var(--dim); font-weight: 600; font-size: .85em; margin-left: 4px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(#ffd60a, #ff9500, #ff375f, #d946ef, #8b5cf6, #3b82f6, #06b6d4, #10d99a, #ffd60a); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.top > nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.top > nav a { color: var(--dim); font-weight: 600; font-size: .92em; padding: 7px 12px; border-radius: 9px; }
.top > nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.top > nav a.cta { color: #fff; background: linear-gradient(120deg, var(--violet), var(--blue)); }
.mnav { display: none; }
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1280px; margin: 0 auto; }
.side { position: sticky; top: 57px; align-self: start; height: calc(100vh - 57px); overflow-y: auto; padding: 22px 14px 40px 22px; border-right: 1px solid var(--border); font-size: .92em; }
.side h2, .mnav h2 { font-size: .72em; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin: 18px 0 6px 10px; }
.side section:first-child h2 { margin-top: 0; }
.side ul, .mnav ul { list-style: none; margin: 0; padding: 0; }
.side a, .mnav a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text); opacity: .85; overflow-wrap: anywhere; }
.side a:hover, .mnav a:hover { background: var(--surface-2); text-decoration: none; opacity: 1; }
.side a[aria-current="page"], .mnav a[aria-current="page"] { background: var(--surface-3); opacity: 1; box-shadow: inset 3px 0 0 var(--violet); font-weight: 600; }
.m { display: inline-block; min-width: 38px; font: 700 .72em/1.6 ui-monospace, monospace; padding: 0 5px; border-radius: 5px; text-align: center; margin-right: 4px; vertical-align: 1px; }
.m-get { background: rgba(16,217,154,.14); color: var(--mint); } .m-post { background: rgba(59,130,246,.18); color: #8db8ff; }
main { padding: 26px 40px 60px; min-width: 0; }
article { max-width: 860px; }
.page-tools { max-width: 860px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 4px; }
.tool { font-family: inherit; font-size: .85em; font-weight: 600; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; cursor: pointer; }
.tool:hover { border-color: var(--violet); text-decoration: none; }
.tool.ok { border-color: var(--mint); color: var(--mint); }
article h1 { font-size: clamp(1.6em, 4.5vw, 2.25em); line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.01em; overflow-wrap: anywhere; }
article h2 { font-size: 1.45em; margin: 38px 0 12px; padding-top: 6px; border-top: 1px solid var(--border); scroll-margin-top: 70px; }
article h3 { font-size: 1.15em; margin: 26px 0 10px; scroll-margin-top: 70px; }
.anchor { color: var(--dim); opacity: 0; margin-left: -.9em; padding-right: .25em; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: .7; text-decoration: none; }
article > blockquote:first-of-type { margin: 0 0 22px; padding: 0; border: 0; background: none; color: var(--dim); font-size: 1.1em; }
blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--orange); background: rgba(255,149,0,.06); border-radius: 0 10px 10px 0; }
blockquote p { margin: 0; }
p, ul, ol { margin: 0 0 14px; } li { margin-bottom: 5px; }
:not(pre) > code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .86em; overflow-wrap: anywhere; }
pre { position: relative; background: #0a0a0f; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: .84em; line-height: 1.55; margin: 0 0 18px; color: #dcdbe6; }
pre code { background: none; border: 0; padding: 0; }
.copy { position: absolute; top: 8px; right: 8px; font-family: inherit; font-size: .78em; font-weight: 600; line-height: 1; padding: 6px 9px; border-radius: 8px; background: var(--surface-3); color: var(--dim); border: 1px solid var(--border); cursor: pointer; opacity: .85; }
.copy:hover { color: var(--text); border-color: var(--violet); }
.tbl { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .9em; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--dim); font-weight: 700; font-size: .85em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
strong { color: #fff; }
.pager { max-width: 860px; display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager a { padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .92em; }
.pager a:hover { border-color: var(--violet); text-decoration: none; }
footer { max-width: 860px; margin-top: 30px; color: var(--dim); font-size: .85em; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  main { padding: 16px 16px 50px; }
  .top { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .top > nav > a:not(.cta) { display: none; }
  .mnav { display: block; order: 3; width: 100%; }
  .mnav summary { cursor: pointer; list-style: none; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: .92em; }
  .mnav summary::-webkit-details-marker { display: none; }
  .mnav summary::before { content: '☰  '; }
  .mnav nav { max-height: 65vh; overflow-y: auto; padding: 8px 0; }
  .page-tools { justify-content: stretch; } .tool { flex: 1; text-align: center; }
  td:first-child { white-space: normal; }
  pre { font-size: .8em; }
}
/* v3: lang switch, TOC, try-it */
.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; font-size: .8em; font-weight: 700; margin: 0 4px; }
.lang a, .lang span { padding: 6px 9px !important; border-radius: 0 !important; line-height: 1.2; }
.lang span { background: var(--surface-3); color: var(--text); }
.lang a { color: var(--dim) !important; }
.lang a:hover { color: var(--text) !important; background: var(--surface-2); text-decoration: none; }
.layout.has-toc { grid-template-columns: 270px minmax(0, 1fr) 220px; max-width: 1440px; }
.toc-col { position: sticky; top: 57px; align-self: start; max-height: calc(100vh - 57px); overflow-y: auto; padding: 28px 18px 40px 6px; font-size: .84em; }
.toc h2 { font-size: .78em; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: 4px 10px; color: var(--dim); margin-left: -1px; border-left: 2px solid transparent; overflow-wrap: anywhere; }
.toc .toc-3 a { padding-left: 22px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--text); border-left-color: var(--violet); }
.tryit { margin: 0 0 26px; padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); display: grid; gap: 8px; }
.try-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.try-head b { font-size: 1.05em; margin-right: 6px; }
.tryit label { font-size: .85em; font-weight: 600; color: var(--dim); margin-top: 4px; }
.tryit input[type=text], .tryit input[type=password], .tryit textarea { width: 100%; font: .88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: #0a0a0f; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; }
.tryit textarea { resize: vertical; min-height: 150px; }
.tryit input:focus, .tryit textarea:focus { outline: none; border-color: var(--violet); }
.tryit input[type=file] { font-size: .88em; color: var(--dim); }
.try-q { display: flex; align-items: center; gap: 6px; } .try-q span { color: var(--dim); font-family: ui-monospace, monospace; }
.try-note { margin: 0; font-size: .8em; color: var(--dim); } .try-note.warn { color: var(--orange); }
.tool.primary { justify-self: start; color: #fff; border: 0; background: linear-gradient(120deg, var(--violet), var(--blue)); padding: 10px 16px; margin-top: 6px; }
.tool.primary:disabled { opacity: .6; cursor: wait; }
.try-out pre { margin: 6px 0 0; max-height: 420px; }
.try-status { font: 600 .85em/1.4 ui-monospace, monospace; color: var(--dim); }
.try-status.ok { color: var(--mint); } .try-status.err { color: var(--pink); }
@media (max-width: 1200px) { .layout.has-toc { grid-template-columns: 270px minmax(0, 1fr); } .toc-col { display: none; } }
@media (max-width: 900px) { .layout.has-toc { grid-template-columns: minmax(0, 1fr); } .top > nav .lang { display: inline-flex; } .tool.primary { flex: none; } }
/* v4: code tabs, mode tabs */
.ctabs { margin: 0 0 18px; border: 1px solid var(--border); border-radius: 12px; background: #0a0a0f; overflow: hidden; }
.ctabs-bar { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; }
.ctabs-bar button { font: 600 .82em/1 inherit; font-family: inherit; color: var(--dim); background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px 10px; cursor: pointer; white-space: nowrap; }
.ctabs-bar button:hover { color: var(--text); }
.ctabs-bar button.on { color: var(--text); border-bottom-color: var(--violet); }
.ctabs pre { margin: 0; border: 0; border-radius: 0; }
.ctabs-pane[data-off] { display: none; }
.mode-tabs { display: flex; gap: 4px; padding: 4px; margin: 28px 0 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); width: max-content; max-width: 100%; overflow-x: auto; position: sticky; top: 64px; z-index: 5; }
.mode-tabs a { padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: .92em; color: var(--dim); white-space: nowrap; }
.mode-tabs a:hover { color: var(--text); text-decoration: none; }
.mode-tabs a.on { color: #fff; background: linear-gradient(120deg, var(--violet), var(--blue)); }
.mode-pane > h2:first-child { border-top: 0; margin-top: 14px; }
@media (max-width: 900px) { .mode-tabs { width: 100%; top: 110px; } .mode-tabs a { flex: 1; text-align: center; } }
