/* =============================================================================
   WORTHWRITE — base.css  (modern · light · responsive)
   Single centralized stylesheet. No inline styles anywhere in the app.
   Aesthetic: refined editorial, lightened. Crisp paper-white surfaces, warm
   ink, one confident terracotta accent + gold for value. Serif display
   (Fraunces) + serif reading (Newsreader) + mono (IBM Plex Mono) for data.
   Responsive shell: fixed sidebar on desktop -> top bar + slide-in drawer on mobile.
   ============================================================================= */

:root {
    /* surfaces — lighter & cleaner than before */
    --bg:           #f4f1ea;   /* app backdrop */
    --paper:        #fbf9f5;   /* page panels */
    --paper-raised: #ffffff;   /* cards */
    --ink:          #1b1916;
    --ink-soft:     #514c43;
    --ink-faint:    #8d8678;
    --rule:         #e8e2d5;
    --rule-soft:    #f0ebe0;

    --accent:       #a23a2c;   /* terracotta */
    --accent-soft:  #c25542;
    --accent-wash:  rgba(162,58,44,.08);
    --gold:         #b3852b;
    --gold-wash:    rgba(179,133,43,.12);
    --good:         #3c6b4b;
    --good-wash:    rgba(60,107,75,.10);

    --display: "Fraunces", Georgia, serif;
    --read:    "Newsreader", Georgia, serif;
    --mono:    "IBM Plex Mono", ui-monospace, monospace;

    /* rhythm */
    --s1: 6px; --s2: 12px; --s3: 18px; --s4: 28px; --s5: 44px;
    --r:    12px;
    --r-lg: 18px;
    --r-pill: 999px;

    /* depth — soft, layered, light */
    --shadow-sm: 0 1px 2px rgba(27,25,22,.04);
    --shadow:    0 2px 4px rgba(27,25,22,.04), 0 8px 24px rgba(27,25,22,.06);
    --shadow-lg: 0 6px 16px rgba(27,25,22,.07), 0 24px 48px rgba(27,25,22,.09);

    --ease: cubic-bezier(.2, .7, .2, 1);
    --sidebar-w: 256px;
    --topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--read);
    font-size: 17px;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, .brand-word {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.14;
    margin: 0 0 .4em;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; }

a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-soft); }
.link-muted { color: var(--ink-faint); }
.link-muted:hover { color: var(--ink); }
.muted { color: var(--ink-faint); }
.center { text-align: center; }
.mt { margin-top: var(--s3); }

/* ============================ ENTRANCE MOTION ============================ */
@keyframes ww-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head, .card, .reading { animation: ww-rise .5s var(--ease) both; }
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ============================ APP SHELL ============================ */

body.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* mobile top bar (hidden on desktop) */
.topbar {
    display: none;
    align-items: center;
    gap: var(--s2);
    height: var(--topbar-h);
    padding: 0 var(--s3);
    background: var(--paper-raised);
    border-bottom: 1px solid var(--rule);
    position: sticky; top: 0; z-index: 40;
}
.nav-toggle {
    border: 1px solid var(--rule); background: var(--paper);
    width: 40px; height: 40px; border-radius: var(--r);
    font-size: 1.1rem; cursor: pointer; color: var(--ink);
    display: grid; place-items: center;
}
.topbar-brand { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ink); }

.scrim {
    display: none; position: fixed; inset: 0; z-index: 45;
    background: rgba(27,25,22,.32); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .25s var(--ease);
}

.sidebar {
    border-right: 1px solid var(--rule);
    background: linear-gradient(180deg, var(--paper-raised), var(--paper));
    padding: var(--s4) var(--s3);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    z-index: 50;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); margin-bottom: var(--s4); }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--accent); color: #fff;
    font-family: var(--display); font-weight: 700; font-size: 1.15rem;
    box-shadow: 0 2px 8px var(--accent-wash);
}
.brand-word { font-size: 1.3rem; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r);
    color: var(--ink-soft); font-size: .98rem;
    transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.nav-item:hover { background: var(--accent-wash); color: var(--ink); }
.nav-item.active { background: var(--accent-wash); color: var(--accent); font-weight: 500; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { width: 22px; text-align: center; opacity: .7; font-size: .95rem; }

.sidebar-foot {
    border-top: 1px solid var(--rule); padding-top: var(--s3); margin-top: var(--s3);
    display: flex; align-items: center; justify-content: space-between;
}
.who { display: flex; flex-direction: column; }
.who-name { font-weight: 500; }
.who-role {
    font-size: .72rem; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: .1em;
}

.main {
    padding: var(--s5) clamp(var(--s4), 5vw, 64px);
    max-width: 1120px; width: 100%;
}

/* ============================ HEADINGS / SECTIONS ============================ */
.page-head { margin-bottom: var(--s4); }
.page-head.sub-head { margin-top: var(--s5); margin-bottom: var(--s3); }
.page-head .eyebrow {
    font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.page-head h1 + .btn, .page-head h1 + .btn-ghost { margin-top: var(--s2); }

/* ============================ GRID / CARDS ============================ */
.grid { display: grid; gap: var(--s4); }
/* Stacked sibling cards always have breathing room; grids use their own gap. */
.card + .card { margin-top: var(--s4); }
.grid > .card + .card { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--s4);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s var(--ease), transform .15s var(--ease), border-color .2s var(--ease);
}
.card h3 { margin-bottom: 6px; }

.stat { display: flex; flex-direction: column; gap: 5px; }
.stat-value { font-family: var(--display); font-size: 2.3rem; font-weight: 600; line-height: 1; }
.stat-label { color: var(--ink-faint); font-size: .85rem; }
.stat-value.accent { color: var(--accent); }
.stat-value.gold   { color: var(--gold); }

.tier-pill {
    display: inline-flex; align-items: center; gap: 8px; width: fit-content;
    font-family: var(--mono); font-size: .76rem;
    background: var(--gold-wash); color: var(--gold);
    padding: 5px 12px; border-radius: var(--r-pill);
}

/* ============================ BUTTONS ============================ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--read); font-size: .98rem; cursor: pointer;
    padding: 11px 20px; border-radius: var(--r); border: 1px solid transparent;
    background: var(--accent); color: #fff;
    transition: background .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { background: var(--accent-soft); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px var(--accent-wash); }
.btn:active { transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; justify-content: center; }

/* ============================ AUTH / PUBLIC ============================ */
body.public-shell {
    display: grid; place-items: center; min-height: 100vh; padding: var(--s4);
    background:
        radial-gradient(70% 55% at 50% -5%, var(--accent-wash), transparent 70%),
        radial-gradient(50% 40% at 90% 100%, var(--gold-wash), transparent 70%),
        var(--bg);
}
.auth-card {
    width: min(440px, 94vw);
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--s5) clamp(var(--s4), 6vw, 40px);
    box-shadow: var(--shadow-lg);
}
.auth-card .brand { justify-content: center; margin-bottom: var(--s4); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--s3); }
.field label { font-size: .85rem; color: var(--ink-soft); }
.field input, .field textarea {
    font-family: var(--read); font-size: 1rem;
    padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--paper); color: var(--ink);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field textarea:focus {
    outline: none; border-color: var(--accent-soft);
    box-shadow: 0 0 0 3px var(--accent-wash);
}
.alert {
    background: var(--accent-wash); color: var(--accent);
    border: 1px solid rgba(162,58,44,.22); border-radius: var(--r);
    padding: 11px 14px; font-size: .92rem; margin-bottom: var(--s3);
}
.card + .alert { margin-top: var(--s4); }   /* alert between stacked cards */

/* ============================ EDITOR ============================ */
.editor-wrap { display: grid; grid-template-columns: 1fr 286px; gap: var(--s3); }
.editor-wrap textarea {
    min-height: 60vh; font-family: var(--mono); font-size: .92rem; line-height: 1.75;
    padding: var(--s3); border-radius: var(--r-lg);
}
.guide {
    background: var(--paper); border: 1px solid var(--rule);
    border-radius: var(--r-lg); padding: var(--s3) var(--s4); font-size: .88rem;
    align-self: start; position: sticky; top: var(--s4);
}
.guide code { font-family: var(--mono); background: var(--accent-wash); padding: 1px 6px; border-radius: 5px; }
.guide .guide-row { padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.guide .guide-row:last-child { border-bottom: 0; }

/* ============================ READING ============================ */
.reading { max-width: 720px; margin: 0 auto; }
.reading-head { margin-bottom: var(--s4); border-bottom: 1px solid var(--rule); padding-bottom: var(--s3); }
.reading-head h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 2.8rem); }
.byline { color: var(--ink-faint); font-family: var(--mono); font-size: .82rem; }

.reading-body { font-size: 1.18rem; line-height: 1.8; color: var(--ink); }
.reading-body p { margin: 0 0 1.15em; }
.reading-body h1, .reading-body h2, .reading-body h3 { margin: 1.6em 0 .5em; }
.reading-body blockquote {
    margin: 1.4em 0; padding: .3em 0 .3em 1.1em;
    border-left: 3px solid var(--accent); color: var(--ink-soft); font-style: italic;
}
.reading-body pre {
    background: #26221d; color: #f3ede1; border-radius: var(--r);
    padding: var(--s3); overflow-x: auto; font-family: var(--mono); font-size: .9rem;
}
.reading-body :not(pre) > code {
    font-family: var(--mono); font-size: .88em;
    background: var(--accent-wash); padding: 1px 6px; border-radius: 5px;
}
.reading-body ul, .reading-body ol { padding-left: 1.3em; margin: 0 0 1.15em; }
.reading-body li { margin: .3em 0; }

.reading-foot {
    margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule);
    display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
}
.clap-btn {
    display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
    font-family: var(--read); font-size: 1rem;
    padding: 11px 22px; border-radius: var(--r-pill);
    border: 1px solid var(--accent); background: transparent; color: var(--accent);
    transition: all .15s var(--ease);
}
.clap-btn:hover:not(:disabled) { background: var(--accent); color: #fff; transform: translateY(-1px); }
.clap-btn:disabled { cursor: default; }
.clap-btn.clapped { background: var(--accent-wash); border-color: transparent; color: var(--accent); }
.clap-glyph { font-size: 1.1rem; }
.clap-note { font-size: .85rem; }

/* ============================ FEED / LISTS ============================ */
.feed-card { color: var(--ink); display: block; }
.feed-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--rule-soft); }
.feed-card h3 { margin-bottom: 6px; }

.article-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.article-row-actions { display: flex; gap: var(--s3); }

/* ============================ LIBRARY / IMPACT ============================ */
.impact { background: linear-gradient(135deg, var(--paper-raised), var(--paper)); }
.impact-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s3); }
.impact-total { font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--accent); }
.impact-bars { display: flex; flex-direction: column; gap: var(--s2); }
.impact-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: var(--s3); }
.impact-name { font-weight: 500; }
.impact-track { height: 10px; background: var(--rule-soft); border-radius: var(--r-pill); overflow: hidden; }
.impact-fill {
    display: block; height: 100%; width: var(--w, 0);
    background: linear-gradient(90deg, var(--gold), var(--accent));
    border-radius: var(--r-pill); transition: width .8s var(--ease);
}
.impact-amt { font-family: var(--mono); font-size: .85rem; color: var(--ink-soft); }

.history-list { display: flex; flex-direction: column; gap: var(--s2); }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); color: var(--ink); }
.history-row:hover { color: var(--ink); transform: translateX(2px); box-shadow: var(--shadow); }
.history-main { display: flex; flex-direction: column; gap: 2px; }
.history-title { font-weight: 500; }
.history-meta { display: flex; align-items: center; gap: var(--s3); }
.history-date { font-family: var(--mono); font-size: .8rem; }

.badge {
    font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
    padding: 4px 9px; border-radius: var(--r-pill);
    background: var(--rule-soft); color: var(--ink-soft);
}
.badge-done { background: var(--good-wash); color: var(--good); }

/* ============================ ADMIN: APPLICATIONS ============================ */
.application-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.application-pitch { color: var(--ink-soft); font-style: italic; }
.application-sample { margin: var(--s2) 0; }
.application-sample summary { cursor: pointer; color: var(--accent); font-family: var(--mono); font-size: .85rem; }
.application-sample .reading-body { font-size: 1rem; margin-top: var(--s2); }
.application-actions { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s3); }
.application-actions form { display: flex; gap: 8px; align-items: center; }
.application-actions input[type=text] {
    font-family: var(--read); padding: 9px 12px; border: 1px solid var(--rule);
    border-radius: var(--r); background: var(--paper); min-width: 200px;
}

/* ============================ ADMIN: PAYOUTS / CASES ============================ */
.period-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3); }
.period-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.data-table { width: 100%; border-collapse: collapse; margin-top: var(--s2); font-size: .95rem; }
.data-table th, .data-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--rule); }
.data-table th { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.data-table tbody tr { transition: background .12s var(--ease); }
.data-table tbody tr:hover { background: var(--accent-wash); }

.case { border-left: 4px solid var(--rule); }
.case-ring { border-left-color: var(--accent); }
.case-same_ip { border-left-color: var(--gold); }
.case-head { display: flex; align-items: center; justify-content: space-between; }
.sev { font-family: var(--mono); font-size: .7rem; padding: 3px 10px; border-radius: var(--r-pill); background: var(--rule-soft); color: var(--ink-soft); }
.sev-4, .sev-5 { background: var(--accent-wash); color: var(--accent); }

/* ============================ BILLING / REFERRALS ============================ */
.ref-note { background: var(--good-wash); color: var(--good); border-color: rgba(60,107,75,.25); }
.referral-link { display: flex; gap: 10px; margin-top: 10px; }
.referral-link input {
    flex: 1; font-family: var(--mono); font-size: .9rem;
    padding: 11px 13px; border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--paper); color: var(--ink-soft);
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 960px) {
    body.app-shell { grid-template-columns: 1fr; }
    .topbar { display: flex; }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: min(280px, 82vw);
        transform: translateX(-100%); transition: transform .28s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .scrim { display: block; opacity: 1; }

    .main { padding: var(--s4) clamp(var(--s3), 5vw, var(--s4)); }
    .grid-2, .grid-3, .editor-wrap { grid-template-columns: 1fr; }
    .guide { position: static; }
    .impact-row { grid-template-columns: 1fr auto; }
    .impact-track { display: none; }
    .application-actions { flex-direction: column; gap: var(--s2); align-items: stretch; }
    .application-actions input[type=text] { min-width: 0; flex: 1; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* =============================================================================
   MARKETING / LANDING PAGE  (body.marketing)
   ============================================================================= */
body.marketing { display: block; }
.lp-wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(var(--s3), 5vw, var(--s5)); }

/* nav */
.lp-nav {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1080px; margin: 0 auto; padding: var(--s3) clamp(var(--s3), 5vw, var(--s5));
    position: sticky; top: 0; z-index: 30;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(8px);
}
.lp-nav-links { display: flex; align-items: center; gap: var(--s4); }
.lp-signin { color: var(--ink-soft); }
.lp-signin:hover { color: var(--ink); }

/* hero */
.lp-hero { position: relative; overflow: hidden; padding: clamp(var(--s5), 9vw, 110px) 0 clamp(var(--s5), 8vw, 96px); }
.lp-hero-inner { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; padding: 0 clamp(var(--s3), 5vw, var(--s5)); text-align: center; }
.lp-hero-glow {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        radial-gradient(48% 42% at 50% 8%, var(--accent-wash), transparent 70%),
        radial-gradient(40% 38% at 82% 64%, var(--gold-wash), transparent 70%),
        radial-gradient(36% 34% at 16% 70%, rgba(60,107,75,.08), transparent 70%);
}
.lp-eyebrow {
    font-family: var(--mono); font-size: .74rem; letter-spacing: .2em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s3);
}
.lp-eyebrow.center { text-align: center; }
.lp-title { font-size: clamp(2.6rem, 1.8rem + 5vw, 5rem); line-height: 1.02; margin: 0 0 var(--s4); }
.lp-accent { color: var(--accent); }
.lp-lede { font-size: clamp(1.1rem, 1rem + .6vw, 1.4rem); color: var(--ink-soft); max-width: 620px; margin: 0 auto var(--s4); line-height: 1.6; }
.lp-cta { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; border-radius: 14px; }
.lp-fineprint { font-family: var(--mono); font-size: .76rem; color: var(--ink-faint); margin-top: var(--s3); letter-spacing: .03em; }

/* sections */
.lp-section { padding: clamp(var(--s5), 7vw, 88px) 0; }
.lp-section h2 { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); max-width: 22ch; }
.lp-section h2.center { margin-left: auto; margin-right: auto; text-align: center; }
.lp-muted-lg { font-size: 1.15rem; color: var(--ink-soft); max-width: 64ch; line-height: 1.7; margin: var(--s3) 0; }
.center { text-align: center; }

.lp-problem { background: linear-gradient(180deg, transparent, var(--paper) 50%, transparent); }

/* pillars */
.lp-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s5); }
.lp-pillar { padding: var(--s4); }
.lp-pillar-icon {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    background: var(--accent-wash); color: var(--accent); font-size: 1.4rem; margin-bottom: var(--s3);
}
.lp-pillar h3 { font-size: 1.25rem; margin-bottom: 10px; }
.lp-tiers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s3); }

/* money / transparency */
.lp-money { background: var(--paper); border-block: 1px solid var(--rule); }
.lp-money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: center; }
.lp-impact-demo { box-shadow: var(--shadow-lg); }
.lp-demo-note { font-size: .8rem; margin-top: var(--s3); }

/* writers */
.lp-writer-cta { margin-top: var(--s5); }

/* closing band */
.lp-cta-band {
    padding: clamp(var(--s5), 8vw, 96px) 0; text-align: center;
    background:
        radial-gradient(60% 80% at 50% 0%, var(--accent-wash), transparent 70%),
        var(--paper);
    border-top: 1px solid var(--rule);
}
.lp-cta-band h2 { margin: 0 auto var(--s4); }
.lp-cta-band .lp-cta { margin-top: var(--s3); }

/* footer */
.lp-footer { padding: var(--s4) 0; border-top: 1px solid var(--rule); }
.lp-footer-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

@media (max-width: 860px) {
    .lp-nav { padding: var(--s2) var(--s3); }
    .lp-nav-links { gap: var(--s3); }
    /* drop the in-page anchors on mobile; keep Sign in + Get started */
    .lp-nav-links a[href="#how"], .lp-nav-links a[href="#writers"] { display: none; }
    .lp-pillars { grid-template-columns: 1fr; }
    .lp-money-grid { grid-template-columns: 1fr; gap: var(--s4); }
}

/* small phones: scale the header so logo + CTA never squash */
@media (max-width: 520px) {
    .lp-nav { gap: var(--s2); }
    .lp-nav-links { gap: var(--s2); }
    .brand-word { font-size: 1.1rem; }
    .brand-mark { width: 32px; height: 32px; font-size: 1rem; }
    .lp-nav .btn { padding: 9px 15px; font-size: .9rem; }
    .lp-title { font-size: clamp(2.2rem, 1.6rem + 6vw, 3rem); }
}

/* very narrow: keep just the brand + primary CTA */
@media (max-width: 380px) {
    .lp-signin { display: none; }
    .brand-word { font-size: 1rem; }
}

/* problem section: two-column split + comparison card */
.lp-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: center; }
.lp-compare { box-shadow: var(--shadow-lg); padding: 0; overflow: hidden; }
.lp-compare-col { padding: var(--s4); }
.lp-compare-old { background: var(--paper); }
.lp-compare-new { background: linear-gradient(180deg, var(--good-wash), transparent); }
.lp-compare-divider { height: 1px; background: var(--rule); margin: 0 var(--s4); }
.lp-compare-label {
    font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--ink-faint); display: block; margin-bottom: var(--s2);
}
.lp-compare-new .lp-compare-label { color: var(--good); }
.lp-compare-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lp-compare-list li { position: relative; padding-left: 28px; color: var(--ink-soft); }
.lp-compare-old li { color: var(--ink-faint); }
.lp-compare-old li::before {
    content: "\00d7"; position: absolute; left: 0; top: -1px;
    color: var(--accent); font-weight: 700; font-size: 1.05rem;
}
.lp-compare-new li { color: var(--ink); }
.lp-compare-new li::before {
    content: "\2713"; position: absolute; left: 0; top: -1px;
    color: var(--good); font-weight: 700;
}

@media (max-width: 860px) {
    .lp-split { grid-template-columns: 1fr; gap: var(--s4); }
}

/* brand wordmark — emphasise "Worth" */
.brand-word, .topbar-brand { font-weight: 400; }
.brand-word b, .topbar-brand b { font-weight: 800; }

/* ============================ ADMIN: FORMS / USERS / SETTINGS ============================ */
.admin-form { margin-bottom: 0; }
.admin-form h3 { margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2) var(--s3); margin-top: var(--s3); }
.form-grid .field { margin-bottom: 0; }
.field-check { justify-content: flex-end; }
/* Global select styling — applies to every dropdown, not just form fields. */
select {
    font-family: var(--read); font-size: 1rem;
    padding: 12px 42px 12px 14px;          /* room for the chevron */
    border: 1px solid var(--rule); border-radius: var(--r);
    background-color: var(--paper); color: var(--ink);
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238d8678' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    cursor: pointer; line-height: 1.2;
}
select:hover { border-color: var(--ink-faint); }
select:focus { outline: none; border-color: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-wash); }
.field select { width: 100%; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }

.btn-danger { background: var(--accent); }
.danger-zone { border-color: rgba(162,58,44,.3); }
.danger-zone h3 { color: var(--accent); }

.users-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.users-search { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.users-search input {
    flex: 1; font-family: var(--read); padding: 10px 13px;
    border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink);
}
.cell-email { color: var(--ink-soft); font-size: .9rem; }
.cell-actions { text-align: right; }
.badge-admin  { background: var(--accent-wash); color: var(--accent); }
.badge-writer { background: var(--gold-wash); color: var(--gold); }

.settings-table input[type=number] {
    width: 120px; font-family: var(--mono); font-size: .9rem; padding: 8px 10px;
    border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink);
}
.settings-table input:focus { outline: none; border-color: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-wash); }

.pager { display: flex; gap: 6px; margin-top: var(--s3); flex-wrap: wrap; }
.pager-link {
    min-width: 36px; text-align: center; padding: 7px 10px; border-radius: var(--r);
    border: 1px solid var(--rule); color: var(--ink-soft); font-family: var(--mono); font-size: .85rem;
}
.pager-link:hover { background: var(--accent-wash); color: var(--accent); }
.pager-link.active { background: var(--accent); color: #fff; border-color: transparent; }

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .field-check { justify-content: flex-start; }
    .users-toolbar { flex-direction: column; align-items: stretch; }
    .cell-email { display: none; }            /* keep the users table tidy on phones */
    .settings-table input[type=number] { width: 90px; }
}

/* ============================ ADMIN: CONTENT MODERATION ============================ */
.mod-toolbar { display: flex; gap: 8px; margin-bottom: var(--s4); flex-wrap: wrap; }
.mod-toolbar input[type=text] {
    flex: 1; min-width: 200px; font-family: var(--read); padding: 10px 13px;
    border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink);
}
.mod-toolbar select { min-width: 150px; }

.mod-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3);
    padding: var(--s3) 0; border-bottom: 1px solid var(--rule);
}
.mod-row:last-child { border-bottom: 0; }
.mod-main { flex: 1; min-width: 0; }
.mod-titleline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.mod-meta { display: block; margin-top: 3px; font-size: .85rem; }
.mod-preview { margin-top: 10px; }
.mod-preview summary { cursor: pointer; color: var(--accent); font-family: var(--mono); font-size: .8rem; }
.mod-preview .reading-body { font-size: 1rem; margin-top: var(--s2); max-width: 640px; }

.mod-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.modbtn {
    font-family: var(--read); font-size: .88rem; white-space: nowrap;
    padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--rule);
    color: var(--ink-soft); background: var(--paper); transition: all .15s var(--ease);
}
.modbtn:hover { background: var(--paper-raised); color: var(--ink); box-shadow: var(--shadow-sm); }
.modbtn-danger { color: var(--accent); border-color: rgba(162,58,44,.3); }
.modbtn-danger:hover { background: var(--accent); color: #fff; border-color: transparent; }

.badge-removed  { background: var(--accent-wash); color: var(--accent); }
.badge-unlisted { background: var(--gold-wash); color: var(--gold); }

@media (max-width: 600px) {
    .mod-row { flex-direction: column; }
    .mod-actions { width: 100%; }
}

/* ============================ EARNINGS / LEDGER ============================ */
.data-table th.num, .data-table td.num { text-align: right; }
.amount { font-family: var(--mono); font-weight: 500; }
.amount-pos { color: var(--good); }
.amount-neg { color: var(--accent); }
.cell-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payout-note { background: var(--gold-wash); border-color: rgba(179,133,43,.25); }

@media (max-width: 600px) {
    .cell-detail { max-width: 140px; }
}
