:root {
    --bg: #f3f1eb;
    --bg-elevated: rgba(255, 255, 255, 0.78);
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text: #18201b;
    --muted: #657269;
    --line: rgba(24, 32, 27, 0.1);
    --line-strong: rgba(24, 32, 27, 0.16);
    --accent: #1f5c46;
    --accent-strong: #164735;
    --accent-soft: rgba(31, 92, 70, 0.12);
    --alert: #9a3f3f;
    --alert-soft: rgba(154, 63, 63, 0.12);
    --shadow: 0 24px 72px rgba(29, 43, 36, 0.08);
    --shadow-soft: 0 10px 32px rgba(29, 43, 36, 0.05);
    --radius-panel: 28px;
    --radius-card: 22px;
    --radius-pill: 999px;
    --font-sans: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111714;
        --bg-elevated: rgba(23, 31, 27, 0.82);
        --surface: rgba(20, 27, 24, 0.92);
        --surface-strong: #171f1b;
        --text: #eef4ef;
        --muted: #a6b3aa;
        --line: rgba(238, 244, 239, 0.09);
        --line-strong: rgba(238, 244, 239, 0.15);
        --accent: #79c7a4;
        --accent-strong: #5fb18d;
        --accent-soft: rgba(121, 199, 164, 0.12);
        --alert: #f19e9e;
        --alert-soft: rgba(241, 158, 158, 0.12);
        --shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
        --shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.2);
    }
}

html[data-theme="light"] {
    --bg: #f3f1eb;
    --bg-elevated: rgba(255, 255, 255, 0.78);
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text: #18201b;
    --muted: #657269;
    --line: rgba(24, 32, 27, 0.1);
    --line-strong: rgba(24, 32, 27, 0.16);
    --accent: #1f5c46;
    --accent-strong: #164735;
    --accent-soft: rgba(31, 92, 70, 0.12);
    --alert: #9a3f3f;
    --alert-soft: rgba(154, 63, 63, 0.12);
    --shadow: 0 24px 72px rgba(29, 43, 36, 0.08);
    --shadow-soft: 0 10px 32px rgba(29, 43, 36, 0.05);
}

html[data-theme="dark"] {
    --bg: #111714;
    --bg-elevated: rgba(23, 31, 27, 0.82);
    --surface: rgba(20, 27, 24, 0.92);
    --surface-strong: #171f1b;
    --text: #eef4ef;
    --muted: #a6b3aa;
    --line: rgba(238, 244, 239, 0.09);
    --line-strong: rgba(238, 244, 239, 0.15);
    --accent: #79c7a4;
    --accent-strong: #5fb18d;
    --accent-soft: rgba(121, 199, 164, 0.12);
    --alert: #f19e9e;
    --alert-soft: rgba(241, 158, 158, 0.12);
    --shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(130, 176, 153, 0.18), transparent 24%),
        radial-gradient(circle at right top, rgba(116, 143, 170, 0.12), transparent 24%),
        linear-gradient(180deg, color-mix(in srgb, var(--bg) 72%, white 28%) 0%, var(--bg) 100%);
}

a {
    color: inherit;
}

code {
    font-family: Consolas, Monaco, monospace;
}

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

.shell {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.shell-wide {
    width: min(1180px, calc(100% - 32px));
}

.topbar,
.toolbar,
.button-row,
.section-head,
.review-head,
.hero-row {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.topbar {
    margin-bottom: 20px;
}

.topbar-secondary {
    margin-top: -4px;
}

.brand-block h1,
.brand-block h2,
.hero-panel h2,
.panel h2,
.review-head h3 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.lede {
    margin: 14px 0 0;
    max-width: 60ch;
    color: var(--muted);
    line-height: 1.65;
}

.toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}

.theme-picker span {
    color: var(--muted);
    font-size: 14px;
}

.theme-picker select {
    border: 0;
    background: transparent;
    color: var(--text);
    min-width: 92px;
}

.panel,
.hero-panel,
.review-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow);
    padding: 28px;
}

.hero-panel {
    margin-bottom: 20px;
}

.hero-panel-compact {
    padding: 24px 28px;
}

.panel-callout {
    margin-top: 24px;
    padding: 18px;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    background: var(--accent-soft);
}

.callout-title {
    margin: 0 0 10px;
    font-weight: 600;
}

.command {
    display: block;
    overflow-x: auto;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.auth-layout,
.panel-grid,
.grid {
    display: grid;
    gap: 18px;
}

.auth-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.auth-layout-single {
    grid-template-columns: 1fr;
}

.auth-layout-narrow {
    max-width: 440px;
    margin: 40px auto 0;
}

.panel-grid,
.panel-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-panel-centered {
    margin: 0 auto;
    width: min(100%, 440px);
}

.feature-item span,
.note,
.empty-state,
.subreddit-link,
.review-head span,
.panel p,
label span,
fieldset legend,
.checkbox small,
.plain-list,
.status-meta {
    color: var(--muted);
}

.auth-panel {
    align-self: start;
}

.auth-form {
    margin-top: 20px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent 80%);
    margin: 12px 0 0;
}

.status-chip-alert {
    background: var(--alert-soft);
    color: var(--alert);
    border-color: color-mix(in srgb, var(--alert) 24%, transparent 76%);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
}

.flash-success {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 18%, transparent 82%);
}

.flash-error {
    background: var(--alert-soft);
    border-color: color-mix(in srgb, var(--alert) 18%, transparent 82%);
}

.module-card {
    height: 100%;
}

.inline-form {
    display: inline-flex;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover,
button.button:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.button:disabled,
button.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.button-muted {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.button-muted:hover {
    background: color-mix(in srgb, var(--surface) 78%, transparent 22%);
}

.button-wide {
    width: 100%;
}

.button-row {
    margin-top: 6px;
}

.button-row-start {
    justify-content: flex-start;
}

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

label,
fieldset {
    display: grid;
    gap: 8px;
}

fieldset {
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
}

legend {
    padding: 0 8px;
}

input[type="password"],
input[type="text"],
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--surface-strong);
    color: var(--text);
    outline: none;
}

input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line) 58%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent 88%);
}

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

.checkbox-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card-checkbox {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent 18%);
}

.table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

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

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

th {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.subreddit-name {
    font-weight: 700;
}

.review-card {
    margin-top: 6px;
    border-radius: var(--radius-card);
}

.plain-list {
    margin: 16px 0 0;
    padding-left: 18px;
    line-height: 1.7;
}

@media (max-width: 920px) {
    .auth-layout,
    .panel-grid,
    .panel-grid-wide,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .hero-row,
    .topbar,
    .section-head,
    .button-row,
    .review-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .shell,
    .shell-wide {
        width: min(100%, calc(100% - 20px));
        padding-top: 18px;
        padding-bottom: 34px;
    }

    .panel,
    .hero-panel,
    .review-card {
        padding: 22px;
        border-radius: 22px;
    }

    .theme-picker {
        width: 100%;
        justify-content: space-between;
    }

    .button,
    button.button,
    .inline-form {
        width: 100%;
    }

    .inline-form .button {
        width: 100%;
    }
}
