:root {
    color-scheme: dark;
    --ink: #f4f5f7;
    --paper: #111827;
    --accent: #6d5ef7;
    --accent-ink: #ffffff;
    --tagline: #c5cee8;
    --card: #1b2436;
    --line: #2c3548;
    --mute: #9aa3b5;
    --link: #d9defa;
    --field: #0f1626;
    --good: #86efac;
    --warn: #fbbf24;
    --danger: #fca5a5;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

html[data-theme="light"] {
    color-scheme: light;
    --ink: #161b27;
    --paper: #f4f6fb;
    --accent: #5b4de6;
    --accent-ink: #ffffff;
    --tagline: #3f4a78;
    --card: #ffffff;
    --line: #e2e6f0;
    --mute: #5c6578;
    --link: #3d3a8f;
    --field: #ffffff;
    --good: #1f7a4d;
    --warn: #8a5a12;
    --danger: #9a3412;
    --shadow: 0 16px 40px rgba(22, 27, 39, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--link); }

button, input, textarea, select { font: inherit; color: inherit; }

.topbar, .sidebar {
    background: #0c1220;
    color: var(--ink);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: transparent;
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-weight: 650;
    font-size: 22px;
    letter-spacing: -0.03em;
    text-decoration: none;
    color: #fff;
}

.logo { height: 42px; width: auto; display: block; }

.brand small, .sidebar .brand small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    letter-spacing: 0.01em;
    font-weight: 500;
    color: var(--tagline);
}

.shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.sidebar nav { display: grid; gap: 4px; }

.sidebar a {
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e7e9f2;
}

.sidebar a.active, .sidebar a:hover { background: rgba(109, 94, 247, 0.28); }

html[data-theme="light"] .sidebar {
    background: #ffffff;
    color: var(--ink);
    border-right: 1px solid var(--line);
}

html[data-theme="light"] .sidebar a { color: var(--ink); }

html[data-theme="light"] .sidebar a.active,
html[data-theme="light"] .sidebar a:hover {
    background: rgba(91, 77, 230, 0.12);
    color: var(--link);
}

html[data-theme="light"] .notice {
    background: #efeaff;
    color: #2a2460;
}

html[data-theme="light"] .bubble { background: #eef1f8; color: var(--ink); }

.sidebar form { margin-top: auto; }

.main { padding: 28px 32px 64px; }

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 22px;
}

h1, h2, h3 { font-weight: 650; letter-spacing: -0.03em; margin: 0; }

h1 { font-size: 40px; line-height: 1.05; }

h2 { font-size: 28px; }

.lede { max-width: 62ch; color: var(--mute); margin: 8px 0 0; }

.grid { display: grid; gap: 16px; }

.stats { grid-template-columns: repeat(4, 1fr); }

.cards { grid-template-columns: repeat(2, 1fr); }

.card, .table-wrap, .notice {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.card { padding: 18px 18px 16px; }

.stat strong { display: block; font-size: 34px; line-height: 1; font-weight: 650; }

.stat span, .meta { color: var(--mute); font-size: 13px; }

.notice {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #241f45;
    color: #e8e6ff;
}

.table-wrap { overflow: auto; }

table { width: 100%; border-collapse: collapse; }

th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }

th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); font-weight: 600; }

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    background: #2a3348;
    color: var(--ink);
}

.pill.good { background: #14352a; color: var(--good); }
.pill.warn { background: #3a2e14; color: var(--warn); }
.pill.danger { background: #3a1d1d; color: var(--danger); }

html.admin .pill { background: #e8ebf4; color: #3f4a78; }
html.admin .pill.good { background: #e5f6ec; color: #1f7a4d; }
html.admin .pill.warn { background: #fff4df; color: #8a5a12; }
html.admin .pill.danger { background: #fde8e4; color: #9a3412; }
html.admin .snippet { background: #f4f6fb; color: #161b27; border: 1px solid var(--line); }
html.admin input[type="color"] { background: #ffffff; }

.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    cursor: pointer;
}

.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.quiet { background: transparent; color: var(--danger); padding-inline: 0; }

label { display: grid; gap: 6px; font-size: 14px; }

input[type="color"] {
    width: 72px;
    height: 42px;
    padding: 4px;
    background: #0f1626;
    cursor: pointer;
}

.theme-fields { display: flex; gap: 18px; flex-wrap: wrap; }
.theme-fields label { width: auto; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--field);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
}

textarea { min-height: 120px; resize: vertical; }

.form { display: grid; gap: 14px; max-width: 720px; }

html.admin .form { align-content: start; }

html.admin .form > .btn { width: auto; justify-self: start; }

.check { display: flex; gap: 8px; align-items: center; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.snippet {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    background: #0c1220;
    color: #e8eaf6;
    padding: 14px 16px;
    border-radius: 12px;
    overflow: auto;
}

.error { color: var(--danger); font-size: 13px; }

.thread { display: grid; gap: 10px; }

.bubble {
    max-width: 70ch;
    padding: 12px 14px;
    border-radius: 14px;
    background: #243049;
    border: 1px solid var(--line);
}

.bubble.visitor { background: var(--accent); color: #fff; }

.login-wrap, .home-wrap { max-width: 1080px; margin: 0 auto; padding: 28px; }

.login-card { max-width: 420px; margin: 18vh auto; }

.preview-page { min-height: 100vh; padding: 88px 8vw 120px; }

.preview-kicker { letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; color: var(--tagline); }

.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: start; }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0d1425;
    border-bottom: 1px solid #2c3548;
}

.header-end {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f4f5f7;
    cursor: pointer;
}

.theme-toggle svg,
.nav-toggle svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-toggle {
    display: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f4f5f7;
    cursor: pointer;
}

.nav-toggle .icon-close { display: none; }

.site-header.is-open .nav-toggle .icon-menu { display: none; }

.site-header.is-open .nav-toggle .icon-close { display: block; }

.site-header .nav-signin { display: none; }

.theme-toggle .icon-sun { display: none; }

html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

html[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.theme-toggle:hover { color: #fff; }

.site-nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: #d5dbe8; font-size: 15px; }
.site-nav a.active, .site-nav a:hover { color: #fff; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }

.proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--tagline);
    background: var(--card);
    font-size: 13px;
}

.steps, .plans, .price-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.price-board { align-items: stretch; margin-top: 8px; }

.price-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px 22px 22px;
    display: flex;
    flex-direction: column;
}

.price-featured { border: 2px solid var(--accent); }

.price-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    background: #161b27;
    color: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.price-card h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }

.price-card .audience { margin: 10px 0 0; color: var(--mute); min-height: 4.6em; }

.price-figure {
    margin: 18px 0 0;
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.price-note { margin: 8px 0 18px; color: var(--mute); font-size: 14px; }

.price-card .btn { width: 100%; border-radius: 12px; }

.price-includes { margin: 22px 0 0; font-size: 14px; }

.price-group { margin-top: 16px; }

.price-group h3 { margin: 0 0 8px; font-size: 15px; }

.price-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.price-group li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }

.price-group li::before { content: "✓"; color: var(--accent); font-weight: 700; }

.price-compare { margin-top: 56px; }

.price-compare h2 { margin: 0 0 16px; font-size: 32px; letter-spacing: -0.03em; }
.step-no { margin: 0 0 8px; color: var(--accent); font-weight: 700; }
.plan-featured { border-color: var(--accent); }

.page-hero { max-width: 1080px; margin: 0 auto; padding: 48px 28px 8px; }
.page-hero h1 { font-size: clamp(40px, 6vw, 64px); max-width: 16ch; }

.site-footer { border-top: 1px solid #2c3548; margin-top: 48px; background: #0d1425; color: #f4f5f7; }
.site-footer .meta { color: #9aa3b5; }
.site-footer .inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand-hero {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 24px 64px;
    background:
        radial-gradient(ellipse at 50% 38%, rgba(109, 94, 247, 0.28), transparent 46%),
        #0d1425;
    color: #f7f7f8;
}

html[data-theme="light"] .brand-hero {
    background:
        radial-gradient(ellipse at 50% 38%, rgba(91, 77, 230, 0.16), transparent 46%),
        var(--paper);
    color: var(--ink);
}

.brand-mark {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    background: var(--accent);
    display: grid;
    place-items: center;
    box-shadow: 0 18px 48px rgba(109, 94, 247, 0.38);
}

.brand-mark svg { width: 58px; height: 58px; }

.brand-hero h1,
.hero-title {
    margin: 0;
    font-size: 100px;
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    color: #f7f7f8;
}

.hero-title span { color: var(--accent); }

html[data-theme="light"] .brand-hero h1,
html[data-theme="light"] .hero-title { color: var(--ink); }

.brand-hero .btn.secondary { color: #f4f5f7; border-color: #3a445c; }

html[data-theme="light"] .brand-hero .btn.secondary {
    color: var(--ink);
    border-color: var(--line);
}

.brand-tagline {
    margin: 14px 0 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 500;
    color: #c5cee8;
}

html[data-theme="light"] .brand-tagline { color: var(--tagline); }

.brand-support {
    margin: 16px 0 0;
    font-size: 18px;
    color: #b7bdc8;
}

html[data-theme="light"] .brand-support { color: var(--mute); }

.brand-meta {
    margin: 22px 0 0;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b93a7;
}

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .stats, .cards, .split, .steps, .plans, .price-board { grid-template-columns: 1fr; }
    .price-card .audience { min-height: 0; }
    .sidebar { position: static; }
    h1, .page-hero h1 { font-size: 34px; }
    .brand-hero { min-height: auto; padding: 48px 16px 56px; }
    .brand-hero h1,
    .hero-title { font-size: clamp(40px, 12vw, 64px); }
    .brand-tagline { font-size: 24px; }
    .brand-support { font-size: 16px; }
    .home-wrap, .page-hero, .site-footer .inner { padding-left: 16px; padding-right: 16px; }
    .site-header {
        flex-wrap: nowrap;
        padding: 12px 16px;
    }
    .nav-toggle { display: grid; }
    .site-header .header-end > .btn { display: none; }
    .site-header .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 12px 16px;
        background: #0d1425;
        border-bottom: 1px solid #2c3548;
    }
    .site-header.is-open .site-nav { display: flex; }
    .site-header .site-nav a {
        padding: 12px 12px;
        border-radius: 10px;
        font-size: 17px;
    }
    .site-header .nav-signin { display: block; }
    .site-footer .inner { flex-direction: column; align-items: flex-start; }
    .site-footer .site-nav { gap: 14px 18px; }
    .price-figure { font-size: 36px; }
    .price-compare h2 { font-size: 26px; }
    .price-compare table { min-width: 640px; }
    .hero-actions .btn { min-height: 44px; }
}

@media (max-width: 480px) {
    .hero-title, .brand-hero h1 { font-size: 36px; }
    .brand-hero .hero-actions { align-self: stretch; width: 100%; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
}
