/* ============================================================
   XDEV · Payment Encryption API
   "Aurora Glass" design system
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
    --bg: #05060a;
    --bg-2: #0a0c13;
    --surface: rgba(18, 21, 32, 0.66);
    --surface-2: rgba(20, 24, 37, 0.85);
    --surface-solid: #0e111a;
    --bar: rgba(9, 11, 18, 0.94);
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);

    --text: #eef1f8;
    --text-2: #a9b2c7;
    --text-3: #6d768e;

    --cyan: #22d3ee;
    --indigo: #818cf8;
    --violet: #a855f7;
    --pink: #f472b6;
    --emerald: #34d399;
    --amber: #fbbf24;
    --red: #fb7185;

    --grad: linear-gradient(120deg, #22d3ee 0%, #818cf8 45%, #f472b6 100%);
    --grad-soft: linear-gradient(120deg, rgba(34, 211, 238, .16), rgba(168, 85, 247, .14), rgba(244, 114, 182, .12));

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, .75);
    --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .85);
    --glow-cyan: 0 0 0 1px rgba(34, 211, 238, .25), 0 12px 40px -12px rgba(34, 211, 238, .45);

    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --ease: cubic-bezier(.22, 1, .36, 1);
    --t-fast: 140ms var(--ease);
    --t: 260ms var(--ease);
}

/* Light theme */
html[data-theme="light"] {
    --bg: #f5f6fb;
    --bg-2: #eceef6;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-2: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --bar: rgba(255, 255, 255, 0.94);
    --line: rgba(15, 23, 42, 0.10);
    --line-2: rgba(15, 23, 42, 0.18);
    --text: #0f172a;
    --text-2: #475069;
    --text-3: #7b849b;
    --shadow: 0 18px 50px -24px rgba(30, 41, 90, .35);
    --shadow-lg: 0 40px 90px -34px rgba(30, 41, 90, .4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
code, pre, kbd { font-family: var(--font-mono); }

::selection { background: rgba(34, 211, 238, .3); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: padding-box; }

/* ---------- Ambient background ---------- */
/* Static, filter-free gradients — no animated blur, so nothing behind the
   glass surfaces repaints continuously. This keeps scrolling at 60fps. */
.aurora { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: var(--bg); }

.aurora__blob { position: absolute; border-radius: 50%; opacity: .5; }
.aurora__blob--cyan {
    width: 70vw; height: 70vw; min-width: 520px; min-height: 520px; top: -30vw; left: -18vw;
    background: radial-gradient(circle at center, rgba(34, 211, 238, .42), rgba(34, 211, 238, .12) 40%, transparent 68%);
}
.aurora__blob--violet {
    width: 78vw; height: 78vw; min-width: 560px; min-height: 560px; top: -36vw; right: -22vw;
    background: radial-gradient(circle at center, rgba(168, 85, 247, .38), rgba(168, 85, 247, .1) 40%, transparent 68%);
}
.aurora__blob--pink {
    width: 62vw; height: 62vw; min-width: 420px; min-height: 420px; bottom: -34vw; left: 30vw; opacity: .3;
    background: radial-gradient(circle at center, rgba(244, 114, 182, .34), rgba(244, 114, 182, .08) 42%, transparent 70%);
}

html[data-theme="light"] .aurora__blob { opacity: .26; }

.aurora__grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
}
html[data-theme="light"] .aurora__grid { background-image: linear-gradient(rgba(15,23,42,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.05) 1px, transparent 1px); }

.aurora__grain { display: none; }

.cursor-glow {
    position: fixed; top: 0; left: 0; width: 440px; height: 440px; margin: -220px 0 0 -220px;
    background: radial-gradient(circle, rgba(129, 140, 248, .1), transparent 62%);
    pointer-events: none; z-index: -2; opacity: 0; transition: opacity .4s; will-change: transform;
}
body.has-cursor .cursor-glow { opacity: 1; }

/* ---------- Utilities ---------- */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--surface-solid); padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); transition: top var(--t); }
.skip-link:focus { top: 16px; }

.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--text-3); font-size: .82rem; }
.hide-sm { display: inline-flex; }
kbd { background: rgba(255,255,255,.07); border: 1px solid var(--line); border-bottom-color: var(--line-2); border-radius: 6px; padding: 1px 6px; font-size: .72rem; color: var(--text-2); }
html[data-theme="light"] kbd { background: rgba(15,23,42,.05); }

.link { color: var(--cyan); }
.link:hover { text-decoration: underline; }

.reveal { opacity: 0; transform: translateY(16px); animation: reveal .7s var(--ease) forwards; }
.reveal:nth-child(2) { animation-delay: .06s; }
.reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .18s; }
.reveal:nth-child(5) { animation-delay: .24s; }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 12px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .9rem; white-space: nowrap;
    border: 1px solid transparent; cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t), background var(--t), border-color var(--t), opacity var(--t);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--sm { padding: 9px 15px; font-size: .84rem; }

.btn--primary { background: var(--grad); color: #06070c; box-shadow: 0 10px 30px -12px rgba(129,140,248,.7); }
.btn--primary:hover { box-shadow: 0 16px 40px -12px rgba(129,140,248,.85); transform: translateY(-1px); }
.btn--ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--line-2); transform: translateY(-1px); }
.btn--full { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.loading i { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--surface-2); color: var(--text-2);
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 60; padding: 12px 20px 0; }
.topbar__inner {
    max-width: 1220px; margin: 0 auto; display: flex; align-items: center; gap: 18px;
    padding: 10px 14px 10px 18px; border-radius: var(--radius-lg);
    background: var(--bar); border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: box-shadow var(--t);
}
.topbar.scrolled .topbar__inner { box-shadow: var(--shadow-lg); border-color: var(--line-2); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
    background: var(--grad); color: #06070c; font-size: 1.05rem;
    box-shadow: 0 8px 24px -8px rgba(129,140,248,.8);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; font-size: 1.02rem; }
.brand__sub { font-size: .68rem; color: var(--text-3); letter-spacing: .14em; text-transform: uppercase; }

.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-size: .88rem; font-weight: 500; transition: color var(--t-fast), background var(--t-fast); }
.topnav a:hover { color: var(--text); background: rgba(255,255,255,.05); }

.topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.hamburger { display: none; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.hamburger span { width: 16px; height: 2px; border-radius: 2px; background: var(--text); transition: transform var(--t), opacity var(--t); }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(2, 3, 7, .7); opacity: 0; transition: opacity var(--t); }
.drawer__panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(82vw, 320px);
    background: var(--surface-solid); border-left: 1px solid var(--line);
    padding: 90px 22px 22px; display: flex; flex-direction: column; gap: 6px;
    transform: translateX(100%); transition: transform var(--t); box-shadow: var(--shadow-lg);
}
.drawer__panel a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.drawer__panel a:hover { background: rgba(255,255,255,.05); color: var(--text); }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer__backdrop { opacity: 1; }
.drawer.open .drawer__panel { transform: none; }

/* ---------- Page ---------- */
.page { max-width: 1220px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__badge {
    display: inline-flex; align-items: center; gap: 9px; padding: 7px 15px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; color: var(--text-2);
}
.ping { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); }
.ping::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--emerald); animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .65; } 70%, 100% { transform: scale(3); opacity: 0; } }

.hero__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 6.2vw, 4.6rem); line-height: 1.04; letter-spacing: -.025em; margin: 26px 0 20px; }
.hero__title .grad { display: block; }
.hero__lead { max-width: 640px; color: var(--text-2); font-size: clamp(1rem, 2vw, 1.16rem); }

.hero__cta { display: flex; gap: 12px; margin: 34px 0 10px; flex-wrap: wrap; justify-content: center; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 760px; margin-top: 44px; }
.stat {
    padding: 20px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
    transition: transform var(--t), border-color var(--t);
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.stat__value { display: block; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { font-size: .78rem; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Command bar ---------- */
.commandbar { position: sticky; top: 78px; z-index: 40; display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--radius-lg); background: var(--bar); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 28px; }

.search { position: relative; display: flex; align-items: center; }
.search__icon { position: absolute; left: 16px; color: var(--text-3); font-size: .95rem; pointer-events: none; }
.search input {
    width: 100%; padding: 15px 54px 15px 46px; border-radius: var(--radius-sm);
    background: rgba(0,0,0,.28); border: 1px solid var(--line); color: var(--text); outline: none;
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
html[data-theme="light"] .search input { background: rgba(255,255,255,.7); }
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: rgba(34,211,238,.5); box-shadow: 0 0 0 4px rgba(34,211,238,.12); }
.search__kbd { position: absolute; right: 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px;
    background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text-2);
    font-size: .83rem; font-weight: 500; transition: all var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { background: var(--grad-soft); border-color: rgba(129,140,248,.4); color: var(--text); box-shadow: inset 0 0 0 1px rgba(129,140,248,.15); }
.chip i { font-size: .8rem; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }

.card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line);
    transition: transform var(--t), border-color var(--t), box-shadow var(--t);
    animation: cardIn .5s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-3px); border-color: rgba(129, 140, 248, .45); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .85); }
.card.hidden { display: none; }

.card__head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 16px; }
.card__glyph { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; font-size: 1.1rem; background: var(--grad-soft); border: 1px solid var(--line); color: var(--text); }
.card__glyph[data-tone="cyan"] { background: linear-gradient(135deg, rgba(34,211,238,.22), rgba(34,211,238,.05)); color: var(--cyan); }
.card__glyph[data-tone="violet"] { background: linear-gradient(135deg, rgba(168,85,247,.22), rgba(168,85,247,.05)); color: var(--violet); }
.card__glyph[data-tone="pink"] { background: linear-gradient(135deg, rgba(244,114,182,.22), rgba(244,114,182,.05)); color: var(--pink); }
.card__glyph[data-tone="emerald"] { background: linear-gradient(135deg, rgba(52,211,153,.22), rgba(52,211,153,.05)); color: var(--emerald); }
.card__glyph[data-tone="amber"] { background: linear-gradient(135deg, rgba(251,191,36,.22), rgba(251,191,36,.05)); color: var(--amber); }
.card__glyph[data-tone="indigo"] { background: linear-gradient(135deg, rgba(129,140,248,.22), rgba(129,140,248,.05)); color: var(--indigo); }

.card__meta { min-width: 0; }
.card__title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
.card__path { font-family: var(--font-mono); font-size: .76rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__desc { padding: 0 20px 16px; color: var(--text-2); font-size: .89rem; }

.card__tags { display: flex; gap: 7px; padding: 0 20px 18px; flex-wrap: wrap; }
.tag { font-size: .71rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; letter-spacing: .02em; border: 1px solid var(--line); color: var(--text-2); }
.tag--emerald { color: var(--emerald); border-color: rgba(52,211,153,.32); background: rgba(52,211,153,.08); }
.tag--amber { color: var(--amber); border-color: rgba(251,191,36,.32); background: rgba(251,191,36,.08); }
.tag--red { color: var(--red); border-color: rgba(251,113,133,.32); background: rgba(251,113,133,.08); }
.tag--cyan { color: var(--cyan); border-color: rgba(34,211,238,.32); background: rgba(34,211,238,.08); }
.tag--violet { color: var(--violet); border-color: rgba(168,85,247,.32); background: rgba(168,85,247,.08); }

.card__body { border-top: 1px solid var(--line); }
.card__drawer { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
.card.open .card__drawer { max-height: 1600px; }

.tabs { display: flex; gap: 4px; padding: 12px 14px 0; }
.tab { padding: 8px 14px; border-radius: 10px 10px 0 0; font-size: .82rem; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; transition: color var(--t-fast), border-color var(--t-fast); }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); border-bottom-color: var(--cyan); }

.tabpanel { padding: 16px 20px 20px; display: none; }
.tabpanel.active { display: block; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kv { display: grid; gap: 8px; }
.kv__row { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.kv__name { font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); min-width: 116px; }
.kv__desc { font-size: .82rem; color: var(--text-2); }
.kv__req { color: var(--red); font-weight: 700; }

.card__foot { display: flex; gap: 9px; padding: 0 20px 20px; flex-wrap: wrap; }

/* ---------- Code blocks ---------- */
.code { position: relative; border-radius: var(--radius-sm); background: rgba(0,0,0,.4); border: 1px solid var(--line); overflow: hidden; }
html[data-theme="light"] .code { background: #0d1018; }
.code pre { padding: 16px 46px 16px 16px; overflow-x: auto; font-size: .79rem; line-height: 1.7; color: #d7dbe6; }
.code code { color: #d7dbe6; white-space: pre; }
.code__copy { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--text-2); transition: all var(--t-fast); }
.code__copy:hover { color: var(--text); background: rgba(255,255,255,.13); }
.code__copy.done { color: var(--emerald); border-color: rgba(52,211,153,.4); }

/* syntax-ish coloring for JSON keys */
.code pre .j-key { color: var(--cyan); }
.code pre .j-str { color: #a5e6b8; }
.code pre .j-num { color: #f0b46b; }

/* ---------- Docs sections ---------- */
.docs { margin-top: 84px; scroll-margin-top: 100px; }
.section-head { max-width: 640px; margin-bottom: 30px; }
.section-head__eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 12px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -.02em; }
.section-head p { color: var(--text-2); margin-top: 10px; }
.section-head code { background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 6px; font-size: .85em; color: var(--text); }

.docs__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.docs__grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.panel { padding: 22px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line); transition: transform var(--t), border-color var(--t); }
.panel:hover { border-color: var(--line-2); }
.panel__head { display: flex; gap: 14px; margin-bottom: 16px; }
.panel__head h3 { font-family: var(--font-display); font-size: 1.02rem; }
.panel__head p { color: var(--text-2); font-size: .85rem; margin-top: 3px; }
.panel__head code { background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px; font-size: .85em; }
.panel__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 1rem; }
.panel__icon--cyan { background: rgba(34,211,238,.14); color: var(--cyan); }
.panel__icon--violet { background: rgba(168,85,247,.14); color: var(--violet); }
.panel__icon--emerald { background: rgba(52,211,153,.14); color: var(--emerald); }
.panel__icon--red { background: rgba(251,113,133,.14); color: var(--red); }

.callout { display: flex; gap: 14px; align-items: flex-start; margin-top: 20px; padding: 18px 20px; border-radius: var(--radius); background: var(--grad-soft); border: 1px solid rgba(129,140,248,.28); }
.callout i { color: var(--amber); font-size: 1.1rem; margin-top: 2px; }
.callout p { font-size: .9rem; color: var(--text-2); }
.callout kbd { margin: 0 1px; }

/* ---------- Table ---------- */
.table-wrap { margin-top: 18px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.param-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.param-table th { text-align: left; padding: 13px 18px; background: rgba(255,255,255,.03); color: var(--text-3); font-weight: 600; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.param-table td { padding: 13px 18px; border-top: 1px solid var(--line); color: var(--text-2); }
.param-table td:first-child { color: var(--text); }

/* ---------- Footer ---------- */
.footer { margin-top: 90px; padding: 34px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 24px; }
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand strong { font-family: var(--font-display); display: block; }
.footer__brand span { color: var(--text-3); font-size: .82rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer__links a { font-size: .82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); transition: all var(--t-fast); }
.footer__links a:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.04); }
.footer__note { font-size: .8rem; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- Empty ---------- */
.empty { display: none; flex-direction: column; align-items: center; gap: 10px; padding: 70px 20px; text-align: center; color: var(--text-3); }
.empty.visible { display: flex; }
.empty i { font-size: 2rem; opacity: .5; }
.empty h3 { color: var(--text-2); font-family: var(--font-display); }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 100; display: none; }
.cmdk.open { display: block; }
.cmdk__backdrop { position: absolute; inset: 0; background: rgba(2,3,7,.72); animation: fade .2s var(--ease); }
.cmdk__panel { position: relative; max-width: 560px; margin: 12vh auto 0; border-radius: var(--radius-lg); background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk__input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.cmdk__input input { flex: 1; background: none; border: 0; outline: none; font-size: 1rem; color: var(--text); }
.cmdk__list { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmdk__item { display: flex; align-items: center; gap: 13px; padding: 12px 13px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--t-fast); }
.cmdk__item:hover, .cmdk__item.active { background: var(--grad-soft); }
.cmdk__item .card__glyph { width: 36px; height: 36px; font-size: .9rem; border-radius: 10px; }
.cmdk__item b { font-weight: 600; font-size: .9rem; }
.cmdk__item small { display: block; color: var(--text-3); font-family: var(--font-mono); font-size: .73rem; }
.cmdk__item .arrow { margin-left: auto; color: var(--text-3); font-size: .8rem; }

/* ---------- Explorer ---------- */
.explorer { position: fixed; inset: 0; z-index: 100; display: none; }
.explorer.open { display: block; }
.explorer__backdrop { position: absolute; inset: 0; background: rgba(2,3,7,.72); animation: fade .2s var(--ease); }
.explorer__panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(94vw, 640px);
    display: flex; flex-direction: column; background: var(--surface-solid);
    border-left: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .38s var(--ease);
}
.explorer.open .explorer__panel { transform: none; }
.explorer__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.explorer__title { display: flex; align-items: center; gap: 13px; }
.explorer__title h3 { font-family: var(--font-display); font-size: 1.1rem; }
.explorer__body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.explorer__bar { display: flex; gap: 9px; }
.select, .input, .textarea {
    background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; color: var(--text); outline: none; transition: border-color var(--t), box-shadow var(--t);
}
html[data-theme="light"] .select, html[data-theme="light"] .input, html[data-theme="light"] .textarea { background: rgba(255,255,255,.8); }
.select:focus, .input:focus, .textarea:focus { border-color: rgba(34,211,238,.5); box-shadow: 0 0 0 4px rgba(34,211,238,.1); }
.select { flex: none; font-weight: 600; }
.select option { background: var(--surface-solid); color: var(--text); }
.input { flex: 1; font-family: var(--font-mono); font-size: .84rem; min-width: 0; }
.explorer__field { display: flex; flex-direction: column; gap: 9px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-head label { font-size: .84rem; font-weight: 600; }
.textarea { width: 100%; min-height: 240px; resize: vertical; font-family: var(--font-mono); font-size: .82rem; line-height: 1.7; }
.code--response { border-color: var(--line-2); }
.code--response.error { border-color: rgba(251,113,133,.5); }
.code--response.success { border-color: rgba(52,211,153,.4); }
.code--response pre { max-height: 340px; overflow: auto; }

/* Tools row */
.explorer__tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.explorer__hint { margin-left: auto; }

/* Inline body validation error */
.field-error { font-size: .8rem; color: var(--red); background: rgba(251,113,133,.08); border: 1px solid rgba(251,113,133,.28); padding: 9px 12px; border-radius: 10px; }

/* Response status pill */
.resp-meta { display: flex; align-items: center; gap: 9px; }
.pill { font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text-2); }
.pill--ok { color: var(--emerald); border-color: rgba(52,211,153,.36); background: rgba(52,211,153,.1); }
.pill--bad { color: var(--red); border-color: rgba(251,113,133,.36); background: rgba(251,113,133,.1); }

/* Base URL chip */
.base-url { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 9px 10px 9px 15px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.base-url__label { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.base-url__label i { color: var(--cyan); }
.base-url code { font-size: .82rem; color: var(--text); background: rgba(0,0,0,.28); padding: 4px 10px; border-radius: 8px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="light"] .base-url code { background: rgba(15,23,42,.06); }
.base-url__copy { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2); transition: all var(--t-fast); }
.base-url__copy:hover { color: var(--text); background: rgba(255,255,255,.08); }
.base-url__copy.done { color: var(--emerald); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; right: 22px; bottom: 22px; z-index: 120;
    display: flex; align-items: center; gap: 13px; padding: 15px 18px; min-width: 280px; max-width: 400px;
    border-radius: var(--radius); background: var(--bar); border: 1px solid var(--line-2);
    box-shadow: var(--shadow-lg);
    transform: translateY(140%); opacity: 0; transition: transform .4s var(--ease), opacity .4s;
}
.toast.show { transform: none; opacity: 1; }
.toast__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; }
.toast.success .toast__icon { background: rgba(52,211,153,.16); color: var(--emerald); }
.toast.error .toast__icon { background: rgba(251,113,133,.16); color: var(--red); }
.toast.info .toast__icon { background: rgba(34,211,238,.16); color: var(--cyan); }
.toast__title { display: block; font-size: .86rem; }
.toast__msg { font-size: .8rem; color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .topnav { display: none; }
    .hamburger { display: flex; }
    .hide-sm { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .commandbar { top: 74px; }
}

@media (max-width: 620px) {
    .page { padding: 0 15px 60px; }
    .topbar { padding: 10px 12px 0; }
    .topbar__inner { padding: 8px 10px 8px 14px; }
    .hero { padding: 56px 0 40px; }
    .grid { grid-template-columns: 1fr; }
    .explorer__bar { flex-wrap: wrap; }
    .explorer__bar .select { width: 100%; }
    .explorer__bar .btn { width: 100%; justify-content: center; }
    .kv__row { flex-direction: column; gap: 4px; }
    .kv__name { min-width: 0; }
    .toast { left: 15px; right: 15px; }
}
