/* ==========================================================================
   WeboStats — Modern dark design system
   ========================================================================== */

:root {
    --bg: #060a13;
    --bg-2: #0a1120;
    --card: rgba(148, 163, 184, 0.05);
    --card-solid: #0d1526;
    --card-border: rgba(148, 163, 184, 0.12);
    --card-border-hover: rgba(148, 163, 184, 0.25);
    --text: #e8ecf4;
    --text-2: #a6b0c3;
    --muted: #6b7a93;
    --accent: #6366f1;
    --accent-2: #22d3ee;
    --accent-3: #a855f7;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --orange: #fb923c;
    --radius: 16px;
    --radius-sm: 10px;
    --nav-h: 68px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.35);
    --grad: linear-gradient(120deg, var(--accent), var(--accent-3), var(--accent-2));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: rgba(99, 102, 241, 0.4); }

/* ---- Background decoration ---- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
.bg-glow-1 {
    width: 640px; height: 640px;
    top: -220px; left: -140px;
    background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 65%);
}
.bg-glow-2 {
    width: 560px; height: 560px;
    bottom: -200px; right: -120px;
    background: radial-gradient(circle, rgba(34,211,238,0.22), transparent 65%);
}
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(148,163,184,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,184,0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 40%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.container { width: min(1160px, 92%); margin-inline: auto; }

.main { position: relative; z-index: 1; min-height: 70vh; padding-bottom: 80px; }

/* ---- Nav ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    background: rgba(6, 10, 19, 0.72);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: var(--nav-h); }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--grad);
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}
.logo-text { font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -0.02em; }
.logo-text span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
    padding: 8px 14px;
    border-radius: 9px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: all 0.18s ease;
}
.nav-link:hover { color: var(--text); background: rgba(148,163,184,0.08); }
.nav-link.active { color: var(--text); background: rgba(99,102,241,0.14); }

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

.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff; font-weight: 700; font-size: 14px;
}
.user-name { font-size: 14px; font-weight: 600; color: var(--text-2); }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.25s; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 11px;
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.2;
}
.btn-sm { padding: 8px 15px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { padding: 14px 28px; font-size: 15.5px; border-radius: 13px; }
.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5); }
.btn-ghost { background: rgba(148, 163, 184, 0.06); border-color: var(--card-border); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--card-border-hover); background: rgba(148,163,184,0.1); }
.btn-danger { background: rgba(248, 113, 113, 0.1); border-color: rgba(248,113,113,0.3); color: var(--red); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.18); }
.btn-sm-icon { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

/* ---- Hero ---- */
.hero { padding: 76px 0 40px; text-align: center; position: relative; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7c9ff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 26px;
}
.hero-badge .live-dot { width: 8px; height: 8px; }

.hero h1 {
    font-size: clamp(34px, 5.4vw, 60px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin-bottom: 20px;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p {
    max-width: 620px;
    margin: 0 auto 34px;
    color: var(--text-2);
    font-size: 17px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 46px; }
.stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: left;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { border-color: var(--card-border-hover); transform: translateY(-3px); }
.stat-card .stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.stat-card .stat-label { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.stat-card.grad-border::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--grad);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

/* ---- Section headers ---- */
.section { margin-top: 60px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.section-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---- Category chips ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { color: var(--text); border-color: var(--card-border-hover); }
.chip.active { background: rgba(99,102,241,0.16); border-color: rgba(99,102,241,0.5); color: #c7c9ff; }
.chip .cnt { color: var(--muted); font-size: 12px; }

/* ---- Rating table ---- */
.rating-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.table-scroll { overflow-x: auto; }
.rating-table { width: 100%; border-collapse: collapse; }
.rating-table th {
    text-align: left;
    padding: 14px 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom: 1px solid var(--card-border);
    background: rgba(148, 163, 184, 0.03);
}
.rating-table td { padding: 13px 18px; border-bottom: 1px solid rgba(148,163,184,0.06); font-size: 14.5px; vertical-align: middle; }
.rating-table tr { transition: background 0.15s ease; }
.rating-table tbody tr:hover { background: rgba(148, 163, 184, 0.045); }
.rating-table tbody tr:last-child td { border-bottom: none; }

.rank-cell { font-weight: 800; font-size: 17px; width: 60px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rank-1 { color: #ffd54a; text-shadow: 0 0 18px rgba(255, 213, 74, 0.5); }
.rank-2 { color: #c0c9d9; text-shadow: 0 0 18px rgba(192, 201, 217, 0.4); }
.rank-3 { color: #d89a6a; text-shadow: 0 0 18px rgba(216, 154, 106, 0.4); }

.site-cell { display: flex; flex-direction: column; gap: 1px; }
.site-name { font-weight: 600; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.site-name:hover { color: #c7c9ff; }
.site-url { font-size: 12.5px; color: var(--muted); font-family: var(--mono); text-decoration: none; transition: color .18s ease; }
.site-url:hover { color: var(--text-2); }

.cat-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(34, 211, 238, 0.1);
    color: #7dd3fc;
    border: 1px solid rgba(34, 211, 238, 0.22);
}
.cat-tag.purple { background: rgba(168, 85, 247, 0.1); color: #d8b4fe; border-color: rgba(168,85,247,0.25); }
.cat-tag.green { background: rgba(52, 211, 153, 0.1); color: #6ee7b7; border-color: rgba(52,211,153,0.22); }
.cat-tag.orange { background: rgba(251, 146, 60, 0.1); color: #fdba74; border-color: rgba(251,146,60,0.22); }

.num-cell { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.num-cell.muted { color: var(--text-2); font-weight: 500; }

.live-cell { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: pulse 1.8s ease-in-out infinite;
}
.live-dot.off { background: #475569; animation: none; }
.live-dot.red { background: var(--red); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.search-row { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.search-input {
    flex: 1;
    min-width: 240px;
    padding: 12px 18px;
    border-radius: 11px;
    border: 1px solid var(--card-border);
    background: rgba(148, 163, 184, 0.06);
    color: var(--text);
    font-family: var(--font);
    font-size: 14.5px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.search-input::placeholder { color: var(--muted); }

/* ---- CTA band ---- */
.cta-band {
    margin-top: 60px;
    padding: 46px;
    border-radius: 22px;
    text-align: center;
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(34,211,238,0.08));
    border: 1px solid rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.25), transparent 60%);
}
.cta-band h2 { position: relative; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.cta-band p { position: relative; color: var(--text-2); margin-bottom: 26px; }

/* ---- Docs ---- */
.docs-hero { padding: 64px 0 30px; text-align: center; }
.docs-hero h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; letter-spacing: -0.03em; }
.docs-hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.docs-hero p { color: var(--text-2); max-width: 640px; margin: 14px auto 0; font-size: 16px; }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 36px; }
.spec {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    text-align: left;
}
.spec .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.spec .v { font-weight: 700; font-size: 15px; margin-top: 3px; font-family: var(--mono); }
.spec .v.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: var(--font); }

.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-top: 50px; align-items: start; }
.docs-toc { position: sticky; top: calc(var(--nav-h) + 24px); }
.docs-toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; }
.docs-toc a {
    display: block;
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.16s ease;
    border-left: 2px solid transparent;
}
.docs-toc a:hover { color: var(--text); background: rgba(148,163,184,0.06); }
.docs-toc a.active { color: #c7c9ff; border-left-color: var(--accent); background: rgba(99,102,241,0.1); }

.doc-group { margin-bottom: 46px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.doc-group-title { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 800; margin-bottom: 18px; }
.doc-group-title .g-icon { font-size: 24px; }

.endpoint {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease;
}
.endpoint:hover { border-color: var(--card-border-hover); }
.endpoint-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.method-badge {
    padding: 4px 12px;
    border-radius: 7px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.3);
}
.endpoint-path { font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--text); }
.endpoint-desc { color: var(--text-2); font-size: 14.5px; margin-bottom: 18px; }

.ep-block { margin-bottom: 16px; }
.ep-block .ep-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.params-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.params-table th { text-align: left; padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--card-border); }
.params-table td { padding: 8px 12px; border-bottom: 1px solid rgba(148,163,184,0.06); vertical-align: top; }
.params-table tr:last-child td { border-bottom: none; }
.param-name { font-family: var(--mono); color: #7dd3fc; }
.req { color: var(--red); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.opt { color: var(--muted); font-size: 11px; font-weight: 600; }

.code-block { position: relative; }
.code-block pre {
    background: #0a101f;
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: var(--radius-sm);
    padding: 18px 44px 18px 18px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    color: #d6e0f0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.code-block .copy-btn {
    position: absolute;
    top: 10px; right: 10px;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid var(--card-border);
    background: rgba(148,163,184,0.08);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: var(--font);
}
.code-block .copy-btn:hover { color: var(--text); border-color: var(--card-border-hover); }
.code-block .copy-btn.copied { color: var(--green); border-color: rgba(52,211,153,0.4); }

/* ---- Forms ---- */
.auth-wrap { display: grid; place-items: center; padding: 70px 0 40px; }
.auth-card {
    width: min(440px, 100%);
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 38px;
    backdrop-filter: blur(12px);
    position: relative;
}
.auth-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--grad);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    pointer-events: none;
}
.auth-card h1 { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 11px;
    border: 1px solid var(--card-border);
    background: rgba(148, 163, 184, 0.06);
    color: var(--text);
    font-family: var(--font);
    font-size: 14.5px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.form-control::placeholder { color: var(--muted); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a93' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea.form-control { resize: vertical; min-height: 80px; }

.field-error { color: var(--red); font-size: 12.5px; margin-top: 5px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-alt a { color: #c7c9ff; text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ---- Dashboard ---- */
.dash-grid { display: grid; grid-template-columns: 280px 1fr; gap: 26px; align-items: start; margin-top: 40px; }
.dash-side { position: sticky; top: calc(var(--nav-h) + 24px); }
.dash-panel {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px;
    backdrop-filter: blur(8px);
}
.dash-panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.site-switch { display: flex; flex-direction: column; gap: 6px; }
.site-switch a {
    padding: 10px 13px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-2);
    font-size: 14px;
    transition: all 0.16s ease;
    border: 1px solid transparent;
}
.site-switch a:hover { background: rgba(148,163,184,0.06); color: var(--text); }
.site-switch a.active { background: rgba(99,102,241,0.14); border-color: rgba(99,102,241,0.35); color: #e2e4ff; }
.site-switch .sw-name { font-weight: 600; display: block; }
.site-switch .sw-id { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.dash-main { display: flex; flex-direction: column; gap: 26px; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.mini-stat { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 16px 18px; }
.mini-stat .mv { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.mini-stat .ml { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 12px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--grad); opacity: 0.85; transition: all 0.3s ease; min-height: 3px; position: relative; }
.chart-col:hover .chart-bar { opacity: 1; }
.chart-bar:hover { transform: scaleY(1.03); transform-origin: bottom; }
.chart-label { font-size: 10px; color: var(--muted); font-family: var(--mono); }
.chart-value { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--text-2); background: var(--card-solid); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--card-border); opacity: 0; transition: opacity 0.2s; white-space: nowrap; font-family: var(--mono); }
.chart-col:hover .chart-value { opacity: 1; }

.sites-list { display: flex; flex-direction: column; gap: 12px; }
.site-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 15px 18px;
    transition: all 0.2s ease;
}
.site-row:hover { border-color: var(--card-border-hover); }
.site-row .sr-info { flex: 1; min-width: 0; }
.site-row .sr-name { font-weight: 600; }
.site-row .sr-url { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.site-row .sr-actions { display: flex; gap: 8px; flex-shrink: 0; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge.green { background: rgba(52,211,153,0.12); color: var(--green); }
.badge.red { background: rgba(248,113,113,0.12); color: var(--red); }
.badge.blue { background: rgba(34,211,238,0.12); color: #7dd3fc; }
.badge.purple { background: rgba(168,85,247,0.12); color: #d8b4fe; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(3, 6, 12, 0.8);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    width: min(680px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 28px;
    position: relative;
    animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-section { margin-bottom: 18px; }
.modal-section .ms-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 8px; }

/* ---- Flash ---- */
.flash {
    position: fixed;
    top: calc(var(--nav-h) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: flashIn 0.3s ease;
    max-width: min(560px, 90%);
}
.flash-success { background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(52, 211, 153, 0.35); color: #6ee7b7; }
.flash-error { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(248, 113, 113, 0.35); color: #fca5a5; }
@keyframes flashIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.flash.hide { animation: flashOut 0.3s ease forwards; }
@keyframes flashOut { to { opacity: 0; transform: translate(-50%, -12px); } }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .e-icon { font-size: 44px; margin-bottom: 14px; }
.empty p { max-width: 420px; margin: 0 auto; }

/* ---- Footer ---- */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(6, 10, 19, 0.6);
    padding: 48px 0 24px;
    margin-top: 40px;
}
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; margin-top: 12px; max-width: 300px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 0; transition: color 0.16s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(148,163,184,0.08);
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-live { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--card-border); margin-bottom: 24px; flex-wrap: wrap; }
.tab {
    padding: 10px 18px;
    border-radius: 10px 10px 0 0;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.16s ease;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: #c7c9ff; border-bottom-color: var(--accent); background: rgba(99,102,241,0.08); }

.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text-2);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.16s ease;
}
.pagination a:hover { color: var(--text); border-color: var(--card-border-hover); }
.pagination .active span, .pagination span[aria-current="page"] { background: rgba(99,102,241,0.16); border-color: rgba(99,102,241,0.5); color: #c7c9ff; }
.pagination .disabled span { opacity: 0.4; cursor: not-allowed; }

/* ---- Reveal on mobile / responsive ---- */
@media (max-width: 900px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(6, 10, 19, 0.98);
        border-bottom: 1px solid var(--card-border);
        padding: 12px 16px 18px;
        gap: 2px;
    }
    .nav-links.open { display: flex; }
    .nav-burger { display: flex; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
    .docs-toc h4 { width: 100%; }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-side { position: static; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .user-name { display: none; }
}

@media (max-width: 560px) {
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .hero { padding-top: 48px; }
    .cta-band { padding: 32px 22px; }
}
/* ==========================================================================
   Public stat page
   ========================================================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13.5px;
    text-decoration: none;
    font-weight: 500;
    transition: color .18s ease;
}
.back-link:hover { color: var(--text); }

.stat-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 30px;
    flex-wrap: wrap;
}
.stat-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.stat-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 15px;
}
.stat-hero-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.stat-hero-host {
    display: inline-block;
    margin-top: 2px;
    color: var(--accent-2);
    font-size: 15px;
    text-decoration: none;
    font-weight: 600;
}
.stat-hero-host:hover { text-decoration: underline; }
.stat-hero-desc { margin-top: 12px; color: var(--text-2); font-size: 14.5px; max-width: 560px; }
.stat-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-trend { margin-top: 10px; font-size: 12.5px; font-weight: 700; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend.neutral { color: var(--muted); font-weight: 500; }
.stat-trend span { font-weight: 500; color: var(--muted); }

.stat-period-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-period-table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    padding: 8px 6px;
    border-bottom: 1px solid var(--card-border);
}
.stat-period-table td { padding: 10px 6px; border-bottom: 1px solid rgba(148,163,184,.07); color: var(--text-2); }
.stat-period-table tr:last-child td { border-bottom: 0; }
.stat-period-table tr:last-child td { color: var(--text); font-weight: 600; }

/* --- bar charts --- */
.hbar-wrap {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 190px;
    padding-top: 22px;
    position: relative;
}
.hbar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    position: relative;
}
.hbar-bar {
    width: 100%;
    max-width: 22px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-3));
    opacity: .85;
    transition: opacity .2s ease, transform .2s ease;
}
.hbar:hover .hbar-bar { opacity: 1; transform: scaleY(1.04); transform-origin: bottom; }
.hbar-val {
    position: absolute;
    bottom: calc(100% + 6px);
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    pointer-events: none;
}
.hbar-lbl { font-size: 10px; color: var(--muted); margin-top: 2px; }
.hbar-wrap-daily { height: 150px; }
.hbar-wrap-daily .hbar-bar { max-width: 14px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }

/* --- breakdown rows --- */
.stat-row { margin-bottom: 14px; }
.stat-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-2);
    margin-bottom: 6px;
}
.mono-path { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.progress {
    height: 7px;
    border-radius: 999px;
    background: rgba(148,163,184,.1);
    overflow: hidden;
}
.progress i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--grad);
    opacity: .9;
    transition: width .5s ease;
}

/* ==========================================================================
   Widget showcase
   ========================================================================== */
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--sw);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.swatch:hover { transform: scale(1.12); }
.swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.4), 0 4px 14px rgba(0,0,0,.4);
}
.swatch-custom { position: relative; overflow: hidden; }
.swatch-custom input[type="color"] {
    position: absolute;
    inset: -6px;
    width: 46px;
    height: 46px;
    border: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.style-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: rgba(148,163,184,.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.style-opt:hover { border-color: var(--card-border-hover); background: rgba(99,102,241,.08); transform: translateY(-2px); }
.style-opt.active { border-color: var(--accent); background: rgba(99,102,241,.12); }
.style-opt img { max-width: 100%; height: 24px; }
.size-opt.active { border-color: var(--accent); color: var(--text); background: rgba(99,102,241,.14); }

.widget-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 26px;
    background: var(--card);
    border: 1px dashed var(--card-border);
    border-radius: 14px;
    overflow-x: auto;
}
.widget-preview img { max-width: 100%; }

.steps { display: grid; gap: 4px; margin-top: 6px; }
.step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(148,163,184,.07);
}
.step:last-child { border-bottom: 0; }
.step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(99,102,241,.15);
    color: var(--accent-2);
    font-weight: 800;
    font-size: 13px;
}
.step-icon { flex-shrink: 0; font-size: 20px; }
.step strong { font-size: 14.5px; }
.step p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
