/* NF API - Design system v2 */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
    --bg: #06080f;
    --bg-2: #0b0f18;
    --panel: #101522;
    --panel-2: #151c2c;
    --border: rgba(148, 163, 184, 0.14);
    --border-soft: rgba(148, 163, 184, 0.07);
    --text: #f0f3fb;
    --muted: #8b95ad;
    --accent: #7c6cff;
    --accent-2: #38bdf8;
    --accent-soft: rgba(124, 108, 255, 0.14);
    --success: #34d399;
    --danger: #f87171;
    --warn: #fbbf24;
    --info: #60a5fa;
    --radius: 14px;
    --radius-sm: 9px;
    --radius-xs: 6px;
    --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.28);
    --gradient-brand: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    --gradient-surface: linear-gradient(165deg, rgba(124, 108, 255, 0.08) 0%, transparent 55%);
    --focus-ring: 0 0 0 3px var(--accent-soft);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f3f5fb;
    --bg-2: #e8ecf6;
    --panel: #ffffff;
    --panel-2: #f7f9fd;
    --border: rgba(15, 23, 42, 0.1);
    --border-soft: rgba(15, 23, 42, 0.06);
    --text: #0f1420;
    --muted: #5c6578;
    --accent: #5b4de0;
    --accent-2: #0284c7;
    --accent-soft: rgba(91, 77, 224, 0.12);
    --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
    --gradient-surface: linear-gradient(165deg, rgba(91, 77, 224, 0.06) 0%, transparent 55%);
}

html[data-theme="black"] {
    color-scheme: dark;
    --bg: #020306;
    --bg-2: #06080d;
    --panel: #0a0c12;
    --panel-2: #0e1118;
    --border: rgba(148, 163, 184, 0.1);
    --border-soft: rgba(148, 163, 184, 0.05);
    --text: #eceef6;
    --muted: #7a8499;
    --accent: #8b7dff;
    --accent-2: #4dd4ff;
    --accent-soft: rgba(139, 125, 255, 0.16);
    --shadow: 0 20px 56px rgba(0, 0, 0, 0.75);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.app {
    background:
        radial-gradient(900px 480px at 0% -10%, rgba(124, 108, 255, 0.12), transparent 55%),
        radial-gradient(700px 400px at 100% 0%, rgba(56, 189, 248, 0.08), transparent 50%),
        var(--bg);
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { margin: 0 0 0.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.85rem; font-weight: 800; }
h2 { font-size: 1.12rem; }
h3 { font-size: 0.98rem; }

p { margin: 0 0 0.75rem; }
small { font-size: 0.82rem; }

code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--bg-2);
    padding: 0.1em 0.42em;
    border-radius: var(--radius-xs);
    color: var(--accent-2);
    border: 1px solid var(--border-soft);
}

pre {
    background: var(--bg-2);
    padding: 1rem 1.1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 0.5rem 0 1rem;
    box-shadow: var(--shadow-sm);
}
pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 0.8rem; line-height: 1.6; }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.ok-text { color: var(--success); }
.err-text { color: var(--danger); }
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.grad {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@keyframes nf-pulse { 50% { opacity: 0.45; } }
@keyframes nf-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ——— APP SHELL ——— */
.app { display: flex; min-height: 100vh; }
.app-guest { display: block; }

.sidebar {
    width: 268px;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--bg-2) 88%, transparent);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    padding: 1.35rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem 0.5rem;
}
.brand strong { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}
.brand-big { display: flex; flex-direction: column; gap: 0.2rem; font-size: 1.5rem; margin-bottom: 1rem; }

.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav a {
    color: var(--muted);
    padding: 0.58rem 0.8rem;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 0.65rem;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.sidebar nav a span { width: 20px; text-align: center; opacity: 0.9; }
.sidebar nav a:hover {
    background: var(--panel);
    color: var(--text);
    border-color: var(--border-soft);
}
.sidebar nav a.active {
    background: var(--accent-soft);
    color: var(--text);
    border-color: rgba(124, 108, 255, 0.25);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-section {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    margin: 1.1rem 0.75rem 0.35rem;
    font-weight: 700;
}

.sidebar-foot { margin-top: auto; padding-top: 0.85rem; border-top: 1px solid var(--border-soft); }
.sidebar-foot-actions { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.65rem; }
.sidebar-foot-actions .sidebar-theme-open { width: 100%; justify-content: center; }
.sidebar-foot-actions .logout { display: block; text-align: center; }

.user-mini {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem 0.6rem;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.user-info { min-width: 0; flex: 1; }
.user-info strong { display: block; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: var(--muted); display: block; font-size: 0.72rem; }
.avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-brand);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: #fff;
}
.logout {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.logout:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

.main {
    flex: 1;
    padding: 1.75rem 2.25rem 4.5rem;
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
}

.app-footer {
    margin-top: 3rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--border-soft);
    max-width: 1200px;
}
.app-footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.35rem; margin-bottom: 0.65rem; }
.app-footer-nav a { color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.app-footer-nav a:hover { color: var(--accent); }
.app-footer-sep { color: var(--muted); opacity: 0.4; user-select: none; padding: 0 0.15rem; }
.app-footer-note { margin: 0; font-size: 0.78rem; line-height: 1.5; color: var(--muted); }

/* ——— LEGAL ——— */
.legal-doc { max-width: 820px; margin: 0 auto; }
.legal-doc-head { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-soft); }
.legal-doc-head h1 { font-size: 1.7rem; }
.legal-doc-section { margin-bottom: 1.35rem; }
.legal-doc-section h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.legal-doc-section p, .legal-doc-section li { font-size: 0.9rem; line-height: 1.65; color: var(--muted); }
.legal-doc-section ul { margin: 0 0 0.5rem; padding-left: 1.25rem; }
.legal-doc-section li { margin-bottom: 0.35rem; }
.legal-doc-section a { font-weight: 600; color: var(--accent); }

/* ——— PAGE HEADER & HERO ——— */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.page-header .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.hero { margin: 2rem 0; text-align: center; }
.hero h1 { font-size: 2.5rem; font-weight: 800; }
.hero-eyebrow {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.35rem 0.9rem;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(124, 108, 255, 0.25);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero-eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
    animation: nf-pulse 2s infinite;
}

/* ——— CARDS ——— */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 108, 255, 0.35), rgba(56, 189, 248, 0.25), transparent);
    opacity: 0.8;
}
.card.highlight {
    border-color: rgba(124, 108, 255, 0.35);
    background: linear-gradient(165deg, rgba(124, 108, 255, 0.1), var(--panel) 50%);
}
.card.warn { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.28); }
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ——— MOBILE NAV ——— */
.hamb-btn, .side-overlay { display: none; }
@media (max-width: 900px) {
    .app { display: block; }
    .hamb-btn {
        display: flex;
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 1001;
        width: 46px;
        height: 46px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        padding: 0;
        box-shadow: var(--shadow);
    }
    .hamb-line {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text);
        border-radius: 1px;
        transition: transform 0.25s var(--ease), opacity 0.2s;
    }
    .hamb-btn.is-open .hamb-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hamb-btn.is-open .hamb-line:nth-child(2) { opacity: 0; }
    .hamb-btn.is-open .hamb-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .side-overlay {
        position: fixed;
        inset: 0;
        background: rgba(2, 4, 10, 0.72);
        backdrop-filter: blur(8px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s var(--ease);
    }
    .side-overlay.is-open { display: block; opacity: 1; pointer-events: auto; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        width: min(300px, 88vw);
        transform: translateX(-100%);
        transition: transform 0.28s var(--ease);
        box-shadow: var(--shadow);
    }
    .sidebar.is-open { transform: translateX(0); }
    .main { padding: 4.5rem 1rem 3rem; }
    .table { display: block; }
    .table thead { display: none; }
    .table tbody, .table tr { display: block; }
    .table tr {
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 0.55rem;
        padding: 0.7rem 0.9rem;
    }
    .table tbody tr:hover { background: var(--panel); transform: none; }
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.28rem 0;
        border: none;
        gap: 1rem;
        text-align: right;
    }
    .table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 700;
    }
    .table td:first-child {
        font-weight: 700;
        border-bottom: 1px solid var(--border-soft);
        padding-bottom: 0.5rem;
        margin-bottom: 0.35rem;
    }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header h1 { font-size: 1.45rem; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs a { white-space: nowrap; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .stat-card { padding: 0.85rem; }
    .card { padding: 1rem; }
}

/* ——— STATS ——— */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.stat-card:hover { border-color: rgba(124, 108, 255, 0.3); transform: translateY(-2px); }
.stat-card.accent {
    border-color: rgba(124, 108, 255, 0.35);
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.12), var(--panel));
}
.stat-label { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.stat-value { font-size: 1.9rem; font-weight: 800; margin-top: 0.2rem; letter-spacing: -0.03em; }
.stat-sub { color: var(--muted); font-size: 0.78rem; margin-top: 0.2rem; }

/* ——— FORMS ——— */
.form { display: flex; flex-direction: column; gap: 0.8rem; }
.form.mini { gap: 0.5rem; }
.form label, .field > span {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}
.form label.checkbox, label.checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.55rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
}
.form input, .form select, .form textarea,
input[type="search"], .field input, .field select, .field textarea {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.62rem 0.85rem;
    border-radius: var(--radius-sm);
    font: inherit;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus,
input[type="search"]:focus, .field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}
.form textarea { resize: vertical; min-height: 72px; }
.form.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; }
.form.grid2 label.full, .form.grid2 .full { grid-column: 1 / -1; }
.form-row { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.form-row input { flex: 1; min-width: 200px; }

/* ——— BUTTONS ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.58rem 1.05rem;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 0.15s var(--ease), box-shadow 0.15s, border-color 0.15s, background 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { border-color: rgba(124, 108, 255, 0.4); background: var(--panel); }
.btn.primary {
    background: var(--gradient-brand);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(124, 108, 255, 0.35);
}
.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(124, 108, 255, 0.45);
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.btn.small, .btn.sm { padding: 0.38rem 0.72rem; font-size: 0.78rem; }
.btn.lg { padding: 0.88rem 1.35rem; font-size: 0.95rem; }
.btn.block { display: flex; width: 100%; }

/* ——— ALERTS ——— */
.alert, .flash {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid;
}
.alert.error, .flash-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); color: #fecaca; }
.flash-success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); color: #a7f3d0; }
.flash-info { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.3); color: #bfdbfe; }
html[data-theme="light"] .alert.error, html[data-theme="light"] .flash-error { color: #b91c1c; }
html[data-theme="light"] .flash-success { color: #047857; }

/* ——— TABLES ——— */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td {
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.table th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--panel-2); }
.table tr.row-muted { opacity: 0.5; }
.row-actions { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.inline-edit input { background: transparent; border: 1px solid transparent; padding: 0.35rem 0.5rem; }
.inline-edit input:hover { border-color: var(--border); }
.inline-edit input:focus { background: var(--bg-2); border-color: var(--accent); }

/* ——— PILLS ——— */
.pill {
    display: inline-block;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
}
.pill.ok { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.28); }
.pill.err { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border-color: rgba(248, 113, 113, 0.28); }
.pill.warn { background: rgba(251, 191, 36, 0.12); color: #fde68a; border-color: rgba(251, 191, 36, 0.28); }
.pill.muted { background: var(--bg-2); color: var(--muted); border-color: var(--border); }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(124, 108, 255, 0.3); }

/* ——— TABS & MISC ——— */
.tabs { display: flex; gap: 0.15rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.tabs a {
    padding: 0.7rem 1rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: color 0.15s, border-color 0.15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-color: var(--accent); }

.search { display: flex; gap: 0.35rem; }
.search input { width: auto; min-width: 180px; }

.dropdown summary { list-style: none; cursor: pointer; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown[open] { position: relative; }
.dropdown[open] .form {
    position: absolute;
    right: 0;
    top: 110%;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    z-index: 20;
    min-width: 260px;
    box-shadow: var(--shadow);
}

.empty { text-align: center; padding: 2.75rem 1rem; color: var(--muted); }
.empty-ico { font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.7; }
.docs-list { padding-left: 1.25rem; }
.docs-list li { margin-bottom: 0.4rem; }
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.rank-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}
.quicklinks { display: grid; gap: 0.4rem; }
.quicklinks a {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.58rem 0.8rem;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
}
.quicklinks a:hover { border-color: rgba(124, 108, 255, 0.35); color: var(--accent); }

.endpoint-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.endpoint {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    transition: border-color 0.15s;
}
.endpoint:hover { border-color: rgba(124, 108, 255, 0.35); }
.endpoint-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.endpoint-slug { font-size: 0.88rem; }

.key-reveal {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--bg);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}
.key-reveal code { flex: 1; word-break: break-all; background: none; border: none; color: var(--accent-2); font-size: 0.88rem; }
.ok-line { color: var(--success); }
.error-line { color: var(--danger); }
footer, .footer { color: var(--muted); font-size: 0.82rem; text-align: center; padding: 2rem; }

.cat-toolbar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.cat-toolbar input { flex: 1; }
.cat-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 520px;
    overflow-y: auto;
}
.cat-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, background 0.15s;
}
.cat-item:hover { border-color: rgba(124, 108, 255, 0.35); background: var(--panel-2); }
.cat-info { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cat-arrow { color: var(--muted); font-size: 0.8rem; }
.cat-item.depth-0 .cat-arrow { display: none; }
.cat-path { background: none; color: var(--text); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item.depth-1 { padding-left: 2rem; }
.cat-item.depth-2 { padding-left: 3.25rem; }
.cat-item.depth-3 { padding-left: 4.5rem; }
.cat-copy.ok-flash, .btn.ok-flash { color: var(--success); border-color: var(--success); }

.docs-tag-filter-wrap { margin: 0.75rem 0 1rem; max-width: 320px; }
.docs-tag-storage-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1.25rem 0 0.65rem;
    font-weight: 800;
}
.docs-tag-storage-title:first-of-type { margin-top: 0.5rem; }
.docs-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.docs-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.docs-tag-pill:hover { border-color: rgba(124, 108, 255, 0.4); background: var(--accent-soft); }
.docs-tag-pill code { background: none; border: none; padding: 0; font-size: 0.78rem; color: inherit; }
.docs-tag-pill.ok-flash { border-color: var(--success); color: var(--success); }

/* ——— PLAYGROUND ——— */
.play-controls {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.15rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.play-field { display: flex; flex-direction: column; gap: 0.45rem; }
.play-field-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.play-field-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.85;
}
.play-field-note { margin: 0; line-height: 1.45; }
.play-segment {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: fit-content;
    max-width: 100%;
}
.play-segment-opt { position: relative; cursor: pointer; }
.play-segment-opt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.play-segment-opt span {
    display: block;
    padding: 0.48rem 1rem;
    border-radius: var(--radius-xs);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--muted);
    transition: background 0.15s var(--ease), color 0.15s, box-shadow 0.15s;
}
.play-segment-opt:hover span { color: var(--text); }
.play-segment-opt input:checked + span {
    background: var(--panel-2);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(124, 108, 255, 0.25);
}
.play-segment-opt input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.play-segment-locked { padding: 0.48rem 0.65rem; }
.play-tags-input-wrap {
    display: flex;
    align-items: stretch;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.play-tags-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}
.play-tags-ico {
    flex-shrink: 0;
    padding: 0 0.85rem;
    font-size: 1rem;
    opacity: 0.75;
    user-select: none;
    border-right: 1px solid var(--border-soft);
    background: var(--bg-2);
    display: flex;
    align-items: center;
}
.play-tags-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 0.72rem 0.9rem;
    font: inherit;
    font-size: 0.95rem;
}
.play-tags-input-wrap input:focus { outline: none; }
.play-tags-input-wrap input::placeholder { color: var(--muted); opacity: 0.75; }
.play-draw-btn { width: 100%; justify-content: center; }
.play-error { margin-bottom: 1rem; }
.play-result { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.play-media {
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-media img { max-width: 100%; max-height: 440px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.play-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.play-copy-list { display: flex; flex-direction: column; gap: 0.65rem; }
.copy-row { display: flex; flex-direction: column; gap: 0.25rem; }
.copy-row label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.copy-input { display: flex; gap: 0.35rem; }
.copy-input input {
    flex: 1;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.52rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    min-width: 0;
}

/* ——— 404 ——— */
.error-page { text-align: center; padding: 3.5rem 1rem; max-width: 520px; margin: 0 auto; }
.error-glitch { position: relative; display: inline-block; line-height: 1; margin-bottom: 1rem; }
.error-code {
    display: block;
    font-size: 6.5rem;
    font-weight: 900;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.06em;
}
.error-noise {
    position: absolute;
    inset: 0;
    font-size: 6.5rem;
    font-weight: 900;
    color: rgba(124, 108, 255, 0.15);
    letter-spacing: -0.06em;
    transform: translate(3px, -2px);
    pointer-events: none;
    filter: blur(1px);
    z-index: -1;
}
.error-tries { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 1.5rem 0; color: var(--muted); font-size: 0.85rem; }
.error-tries code { background: var(--bg-2); color: var(--accent); padding: 0.25rem 0.65rem; border-radius: 999px; border: 1px solid var(--border); }
.error-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* ——— BILLING ——— */
.pay-method {
    display: inline-flex;
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    gap: 4px;
}
.pm {
    background: transparent;
    border: none;
    padding: 0.55rem 1rem;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-weight: 700;
    font-size: 0.85rem;
}
.pm.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .plan-grid { grid-template-columns: 1fr; } }
.plan {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-align: center;
    position: relative;
    transition: border-color 0.18s, transform 0.18s;
    box-shadow: var(--shadow-sm);
}
.plan:hover { border-color: rgba(124, 108, 255, 0.4); transform: translateY(-2px); }
.plan.popular {
    border-color: rgba(124, 108, 255, 0.45);
    background: linear-gradient(180deg, rgba(124, 108, 255, 0.1), var(--panel) 55%);
}
.plan-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-brand);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.plan-name { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
.plan-credits { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.plan-credits-sub { color: var(--muted); font-size: 0.82rem; }
.plan-save {
    align-self: center;
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.28);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.plan-save-empty { background: transparent; color: var(--muted); border: 1px dashed var(--border); font-weight: 500; }
.plan-price { font-size: 1.5rem; font-weight: 800; margin-top: 0.35rem; }
.plan-rate { color: var(--muted); font-size: 0.75rem; margin-bottom: 0.85rem; }
.plan-cta { margin-top: auto; width: 100%; }

/* ——— LANDING ——— */
body.landing { background: var(--bg); color: var(--text); overflow-x: hidden; }
body.landing main { display: block; }
.land-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 2rem;
    max-width: 1180px;
    margin: 0 auto;
}
.land-brand { display: flex; align-items: center; gap: 0.55rem; font-size: 1.05rem; color: var(--text); font-weight: 800; }
.land-nav-links { display: flex; gap: 1.25rem; align-items: center; }
.land-nav-links a { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.land-nav-links a:hover { color: var(--text); }
.land-nav-login { color: var(--text) !important; }
.land-hero {
    text-align: center;
    padding: 4.5rem 2rem 5rem;
    max-width: 880px;
    margin: 0 auto;
    position: relative;
}
.land-hero::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(124, 108, 255, 0.2) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
    filter: blur(24px);
}
.land-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.38rem 1rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(124, 108, 255, 0.28);
}
.land-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); animation: nf-pulse 2s infinite; }
.land-hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 1.25rem; }
.land-lead { font-size: 1.12rem; color: var(--muted); max-width: 620px; margin: 0 auto 2rem; line-height: 1.6; }
.land-cta-row { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.land-btn-lg { padding: 0.9rem 1.6rem !important; font-size: 1rem !important; }
.land-features, .land-example, .land-pricing, .land-faq, .land-final-cta {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}
.land-features h2, .land-example h2, .land-pricing h2, .land-faq h2, .land-final-cta h2 {
    font-size: 2.1rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.land-feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.land-feat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
    box-shadow: var(--shadow-sm);
}
.land-feat:hover { border-color: rgba(124, 108, 255, 0.4); transform: translateY(-3px); }
.land-feat-ico { font-size: 1.85rem; margin-bottom: 0.75rem; }
.land-feat h3 { font-size: 1.05rem; }
.land-feat p { color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.55; }
.land-code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .land-code-grid { grid-template-columns: 1fr; } }
.land-code-block { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.land-code-label {
    padding: 0.65rem 1rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.land-code-block pre { margin: 0; border: none; border-radius: 0; background: var(--panel); }
.land-faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 700px) { .land-faq-grid { grid-template-columns: 1fr; } }
.land-faq article { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.land-faq h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.land-faq p { color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.55; }
.land-final-cta {
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(124, 108, 255, 0.1));
    border-radius: var(--radius);
    margin-bottom: 3rem;
}
.land-footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    max-width: 1180px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.land-footer nav { display: flex; flex-wrap: wrap; gap: 0.65rem 1.25rem; }
.land-footer a { color: var(--muted); }
.land-footer a:hover { color: var(--accent); }
@media (max-width: 700px) {
    .land-nav { padding: 1rem; flex-wrap: wrap; }
    .land-hero { padding: 2.5rem 1rem 3rem; }
    .land-features, .land-example, .land-pricing, .land-faq, .land-final-cta { padding: 3rem 1rem; }
}

/* ——— DASHBOARD ——— */
.dashboard-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.25rem;
    align-items: end;
    margin-bottom: 1.75rem;
    padding: 1.5rem 1.6rem;
    background: var(--gradient-surface), var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.dashboard-hero-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.35rem; }
.dashboard-hero-email { margin: 0; font-size: 0.88rem; color: var(--muted); word-break: break-all; }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-bottom: 1.25rem; }
@media (max-width: 1024px) { .dashboard-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .dashboard-kpis { grid-template-columns: 1fr; } }
.dash-kpi {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.05rem 1.1rem;
    transition: border-color 0.18s;
}
.dash-kpi:hover { border-color: rgba(124, 108, 255, 0.3); }
.dash-kpi.is-primary {
    border-color: rgba(124, 108, 255, 0.4);
    background: linear-gradient(155deg, rgba(124, 108, 255, 0.12), var(--panel) 55%);
}
.dash-kpi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.dash-kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.dash-kpi-sub { margin-top: 0.25rem; font-size: 0.8rem; color: var(--muted); }
.dash-section-title { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; }
.dash-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media (max-width: 520px) { .dash-quick-grid { grid-template-columns: 1fr; } }
.dash-quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.68rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
    transition: border-color 0.15s, background 0.15s;
}
.dash-quick-link:hover { border-color: rgba(124, 108, 255, 0.35); background: var(--panel); color: var(--accent); }
.claim-card.claim-ready {
    background: linear-gradient(135deg, rgba(124, 108, 255, 0.12), var(--panel));
    border-color: rgba(124, 108, 255, 0.35);
}
.ref-code-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    flex-wrap: wrap;
}
.ref-code { flex: 1; background: transparent; color: var(--accent); font-size: 1.15rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; }
.ref-link-box { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.ref-link-box input { flex: 1; font-family: var(--font-mono); font-size: 0.78rem; }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.ref-stat { background: var(--bg-2); border-radius: var(--radius-sm); padding: 0.7rem; text-align: center; border: 1px solid var(--border-soft); }
.ref-stat strong { display: block; font-size: 1.3rem; font-weight: 800; }

/* ——— ADMIN METRICS & MEDIA ——— */
.metric-card .metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 0.65rem; }
.metric-card .metric-row > div { background: var(--bg-2); border-radius: var(--radius-sm); padding: 0.7rem; text-align: center; border: 1px solid var(--border-soft); }
.metric-card .metric-row strong { display: block; font-size: 1.35rem; font-weight: 800; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 0.5rem 0; }
.bar-fill { width: 100%; background: var(--gradient-brand); border-radius: 3px 3px 0 0; min-height: 4px; }
.media-crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; background: var(--bg-2); padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid var(--border-soft); }
.crumb { color: var(--accent); font-weight: 600; }
.crumb.current { color: var(--text); }
.media-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 0.75rem; margin-bottom: 1.5rem; padding: 1rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 800px) { .media-actions { grid-template-columns: 1fr; } }
.media-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.65rem; }
.media-folder { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; transition: border-color 0.15s, transform 0.15s; }
.media-folder:hover { border-color: rgba(124, 108, 255, 0.4); transform: translateY(-1px); }
.media-folder-link { flex: 1; display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; color: var(--text); min-width: 0; }
.media-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.media-file { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; overflow: visible; }
.media-file:hover { border-color: rgba(124, 108, 255, 0.4); }
.media-thumb { display: block; width: 100%; aspect-ratio: 1; background: var(--bg); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-file-info { padding: 0.5rem 0.65rem; border-top: 1px solid var(--border-soft); }
.media-search-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.media-search-bar input[type="search"] { flex: 1; min-width: 200px; }
.media-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.media-tag-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 30; max-height: 220px; overflow-y: auto; list-style: none; margin: 0; padding: 0.35rem 0; }
.media-tag-suggest-item { padding: 0.45rem 0.8rem; cursor: pointer; }
.media-tag-suggest-item:hover { background: var(--accent-soft); }
.media-tags-field-wrap { position: relative; }
.js-tags-input.tags-saved { outline: 2px solid rgba(52, 211, 153, 0.5); border-radius: var(--radius-xs); }
.js-tags-input.tags-error { outline: 2px solid rgba(248, 113, 113, 0.5); }

.upload-modal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.upload-modal[hidden] { display: none !important; }
.upload-modal-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 10, 0.75); backdrop-filter: blur(8px); }
.upload-modal-panel {
    position: relative;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.upload-dropzone {
    margin: 1rem;
    padding: 2rem 1.25rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.upload-dropzone:hover, .upload-dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-progress-fill { height: 100%; background: var(--gradient-brand); border-radius: 999px; transition: width 0.08s linear; }
.upload-progress-bar { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }

/* ——— AUTH (shared) ——— */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
    position: fixed; left: 12px; top: 12px; z-index: 10050;
    padding: 0.65rem 1rem; background: var(--panel); border: 1px solid var(--accent);
    border-radius: var(--radius-sm); font-weight: 700;
}

body.app-guest .main:has(.auth-page) { padding: clamp(1.25rem, 4vh, 2.5rem) 1.25rem; }
body.app-guest.guest-landing .main { display: flex; flex-direction: column; min-height: 100vh; padding: 0; max-width: none; }
body.app-guest .main:has(.auth-landing-v2) { padding: 0; max-width: none; }

.auth-landing-v2 {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: min(100vh, 1080px);
    padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 3rem) 2rem;
    overflow: hidden;
}
.auth-landing-v2-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.auth-landing-v2-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.auth-landing-v2-orb--1 {
    width: min(70vw, 520px);
    height: min(70vw, 520px);
    top: -10%;
    right: -8%;
    background: radial-gradient(circle, rgba(124, 108, 255, 0.55), transparent 70%);
}
.auth-landing-v2-orb--2 {
    width: min(50vw, 380px);
    height: min(50vw, 380px);
    bottom: 5%;
    left: -8%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4), transparent 70%);
}
.auth-landing-v2-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}
.auth-landing-v2-logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 800; }
.auth-landing-v2-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.auth-landing-v2-shell { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 6vh, 4rem) 0; }
.auth-landing-v2-hero { width: 100%; max-width: 640px; margin: 0 auto; text-align: center; }
.auth-landing-v2-kicker { margin-bottom: 1rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.auth-landing-v2-title { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.08; margin-bottom: 1.15rem; }
.auth-landing-v2-title-accent { display: block; margin-top: 0.15rem; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-landing-v2-lead { font-size: clamp(1rem, 2.4vw, 1.12rem); color: var(--muted); margin: 0 auto 1.75rem; max-width: 46ch; line-height: 1.65; }
.auth-landing-v2-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 2rem; }
.auth-landing-v2-points { list-style: none; padding: 0; margin: 0 auto; max-width: 480px; display: grid; gap: 0.85rem; text-align: left; }
.auth-landing-v2-points li {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--muted);
    box-shadow: var(--shadow-sm);
}
.auth-landing-v2-point-ico { font-size: 1.15rem; }
.auth-landing-v2-points strong { color: var(--text); }
.auth-landing-v2-mini { position: relative; z-index: 2; text-align: center; margin-top: auto; padding-top: 1.5rem; }
body.guest-landing .app-footer { border-top: 1px solid var(--border-soft); margin-top: 0; }

.auth-page { max-width: 420px; margin: 0 auto 2rem; }
.auth-page--gate { max-width: 440px; min-height: min(70vh, 560px); display: flex; flex-direction: column; justify-content: center; }
.auth-page-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.35rem;
    box-shadow: var(--shadow);
}
.auth-page-h1 { font-size: 1.4rem; font-weight: 800; }
.auth-badge-adult {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.22rem 0.55rem;
    border-radius: var(--radius-xs);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .field label { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.auth-form .field input {
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 0.78rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    width: 100%;
}
.input-wrap { position: relative; }
.input-wrap input { padding-right: 5.25rem !important; }
.pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-xs);
}
.pwd-toggle:hover { color: var(--accent); border-color: var(--border); background: var(--panel); }
.pwd-meter { display: flex; gap: 4px; margin-top: 0.45rem; }
.pwd-meter-bar { flex: 1; height: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-soft); }
.pwd-meter-bar.on { background: var(--gradient-brand); border-color: transparent; }
.auth-honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.auth-modal, .theme-global-modal {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow);
    max-width: 440px;
    width: calc(100% - 2rem);
}
.auth-modal::backdrop, .theme-global-modal::backdrop {
    background: rgba(2, 4, 10, 0.78);
    backdrop-filter: blur(10px);
}
.auth-modal-inner, .theme-global-inner { padding: 1.35rem 1.25rem; position: relative; }
.auth-modal-close, .theme-global-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    color: var(--muted);
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-modal-seg, .auth-page-seg {
    display: flex;
    padding: 4px;
    gap: 4px;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}
.auth-modal-seg-btn, .auth-page-seg-item {
    flex: 1;
    border: none;
    border-radius: var(--radius-xs);
    padding: 0.55rem 0.65rem;
    font-size: 0.86rem;
    font-weight: 700;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.auth-modal-seg-btn.is-active, .auth-page-seg-item.is-active {
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.auth-modal-pane.is-hidden { display: none !important; }
.auth-oauth-row { display: flex; gap: 0.5rem; margin-bottom: 0.65rem; }
.auth-oauth-divider { text-align: center; margin: 0 0 0.85rem; color: var(--muted); font-size: 0.82rem; }
.auth-oauth-divider span { display: inline-block; padding: 0 0.5rem; background: var(--panel); position: relative; z-index: 1; }
.auth-oauth-divider::before { content: ""; display: block; height: 1px; background: var(--border); margin: -0.65rem 0 0; }
.oauth-btn { flex: 1; justify-content: center; font-weight: 700; }
.oauth-btn--google { background: #fff; color: #1a1a1a; border: 1px solid #e2e8f0; }
.oauth-btn--discord { background: #5865f2; color: #fff; border-color: transparent; }
.oauth-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.oauth-link-card { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.auth-forgot-wrap { text-align: right; margin: 0.25rem 0 0.5rem; }
.auth-modal-trust, .auth-page-trust { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--border-soft); text-align: center; font-size: 0.78rem; color: var(--muted); }

.theme-global-h { font-size: 1.15rem; margin: 0 0 0.5rem; }
.theme-global-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; }
.theme-global-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.7rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.theme-global-opt.is-active { border-color: var(--accent); background: var(--accent-soft); }

/* Legacy auth marketing blocks */
.auth-shell { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 4rem; position: relative; }
.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(124, 108, 255, 0.12), transparent 60%),
        radial-gradient(700px 500px at 85% 20%, rgba(56, 189, 248, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.auth-shell > * { position: relative; z-index: 1; }
.auth-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4rem; align-items: start; }
@media (max-width: 960px) { .auth-split { grid-template-columns: 1fr; gap: 2rem; } }
.auth-headline { font-size: 3rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.auth-headline .grad { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.auth-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 1.5rem; }
.auth-tab { flex: 1; padding: 0.6rem; text-align: center; color: var(--muted); border-radius: var(--radius-xs); font-weight: 700; }
.auth-tab.active { background: var(--panel); color: var(--text); }
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .reviews-grid { grid-template-columns: 1fr; } }
.review { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.faq-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.faq-item summary { cursor: pointer; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }

.ui-icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.ui-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; }

/* Landing code tabs & use cases */
.land-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.land-tab {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.land-tab:hover { color: var(--text); border-color: rgba(124, 108, 255, 0.35); }
.land-tab.active {
    background: var(--accent-soft);
    color: var(--text);
    border-color: rgba(124, 108, 255, 0.45);
}
.land-snippet { display: none; }
.land-snippet.active { display: block; }
.land-docs-link { text-align: center; margin-top: 1.25rem; }
.land-usecases { max-width: 1100px; margin: 0 auto; padding: 4rem 2rem; }
.land-uc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.land-uc {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
}
.land-uc-ico { font-size: 1.6rem; margin-bottom: 0.65rem; }
.land-subnote { text-align: center; margin: 0; }

/* Dashboard claim & empty states */
.claim-countdown {
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    margin-top: 0.5rem;
}
.claim-countdown-label {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.claim-countdown-value {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.dash-empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.dash-empty-graphic {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin media extras */
.media-section { margin-top: 1rem; }
.media-section-h {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.65rem;
    font-weight: 700;
}
.media-action-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.media-action-form input[type="text"] {
    flex: 1;
    min-width: 150px;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font: inherit;
}
.media-file-del { border-top: 1px solid var(--border-soft); padding: 0.35rem; text-align: right; }
.media-file-path { display: block; font-size: 0.72rem; word-break: break-all; line-height: 1.35; opacity: 0.9; }
.media-upload-form input[type="file"] { display: none; }
.media-files-info { color: var(--muted); font-size: 0.82rem; flex: 1; }

/* Bar chart */
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.35rem; min-width: 0; }
.bar small { color: var(--muted); font-size: 0.68rem; font-variant-numeric: tabular-nums; }
.bar:hover .bar-fill { opacity: 0.85; }

/* Auth page header */
.auth-page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.auth-page-logo { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 800; }
.auth-page-links a { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.auth-page-links a:hover { color: var(--accent); }
.auth-page-tagline { text-align: center; font-size: 0.78rem; color: var(--muted); margin-bottom: 1.35rem; }
.auth-page-footnote { margin-top: 1.5rem; text-align: center; line-height: 1.6; }
.auth-page-card--narrow { max-width: 420px; margin: 2rem auto; }

/* Upload modal details */
.upload-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border-soft);
}
.upload-modal-head h3 { margin: 0; font-size: 1.1rem; }
.upload-modal-foot { padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--border-soft); text-align: right; }
.upload-progress-wrap { margin: 0 1rem 1rem; }
.upload-progress-meta { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }
.upload-dropzone-inner p { margin: 0.35rem 0; }
.upload-dropzone-ico { font-size: 2rem; display: block; margin-bottom: 0.5rem; }

@media (max-width: 720px) {
    .dashboard-hero { grid-template-columns: 1fr; }
    .dashboard-hero-actions { justify-content: stretch; }
    .dashboard-hero-actions .btn { flex: 1; justify-content: center; }
}
@media (max-width: 600px) {
    .metric-card .metric-row { grid-template-columns: 1fr 1fr; }
    .ref-stats { grid-template-columns: 1fr 1fr 1fr; }
    .media-file-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .media-folder-grid { grid-template-columns: 1fr; }
    .bar-chart { height: 100px; }
    .bar small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
