:root {
    color-scheme: dark;
    --night: #07182f;
    --deep: #123c70;
    --electric: #087fe8;
    --cyan: #35d7f4;
    --silver: #c4cedb;
    --panel: #142840;
    --border: #38506b;
    font-family: Inter, "Segoe UI", sans-serif;
    background: var(--night);
    color: var(--silver);
}
body { margin: 0; }
header { background: var(--deep); border-bottom: 1px solid var(--border); }
.layout { box-sizing: border-box; width: min(100%, 68rem); margin: auto; padding: 1rem clamp(1rem, 4vw, 2.5rem); }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
nav .brand { margin-right: auto; color: #f0f4fa; text-decoration: none; font-weight: 700; }
.brand img { width: 3rem; border-radius: .35rem; vertical-align: middle; }
header a { color: #e0edff; }
h1, h2, h3 { color: #f0f4fa; }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin: .5rem 0; }
.debate-title { font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.2; }
a { color: #76bdff; text-underline-offset: .2em; }
button, .button {
    display: inline-block;
    border: 1px solid var(--electric);
    border-radius: .4rem;
    background: var(--electric);
    color: #041225;
    padding: .6rem .9rem;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.hero { display: grid; grid-template-columns: 1fr minmax(12rem, 23rem); gap: 1.5rem; align-items: center; }
.hero img { width: 100%; height: auto; border-radius: .6rem; }
article { background: var(--panel); border: 1px solid var(--border); border-radius: .6rem; padding: 1rem; margin: 1rem 0; overflow-wrap: anywhere; }
.status { color: var(--cyan); }
.moderation-spinner {
    display: inline-block;
    box-sizing: border-box;
    width: .9em;
    height: .9em;
    margin-inline-end: .35em;
    vertical-align: -.08em;
    border: 2px solid var(--border);
    border-top-color: currentColor;
    border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
    .moderation-spinner { animation: moderation-spin .85s linear infinite; }
}
@keyframes moderation-spin { to { transform: rotate(360deg); } }
.contribution-controls { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.summary-panel {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-left: .25rem solid var(--cyan);
    border-radius: .6rem;
    background: var(--panel);
}
.summary-panel h2 { margin-top: 0; }
.summary-panel li + li { margin-top: .75rem; }
.summary-sources { display: block; }
label { display: block; margin-bottom: .3rem; }
input:not([type=hidden]), textarea, select {
    box-sizing: border-box;
    width: min(100%, 38rem);
    padding: .6rem;
    border: 1px solid var(--border);
    border-radius: .35rem;
    background: var(--panel);
    color: inherit;
    font: inherit;
}
input[type=radio] { width: auto; }
input[type=checkbox] { width: auto; }
.rich-editor { max-width: 38rem; }
.rich-editor-tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.rich-editor-tools button { background: var(--panel); color: var(--silver); border-color: var(--border); padding: .3rem .55rem; }
.rich-editor-content { min-height: 9rem; padding: .6rem; border: 1px solid var(--border); border-radius: .35rem; background: var(--panel); overflow-wrap: anywhere; }
.reformulation { margin: .8rem 0; }
.reformulation p:empty { display: none; }
.reformulation-versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .6rem; }
.reformulation-versions section { padding: .6rem; border: 1px solid var(--border); border-radius: .35rem; overflow-wrap: anywhere; }
.reformulation-versions p { white-space: pre-wrap; }
.reformulation-comparison button { margin: .25rem .25rem .25rem 0; }
[hidden] { display: none !important; }
@media (max-width: 40rem) {
    .hero { grid-template-columns: 1fr; }
    .hero img { width: min(100%, 18rem); }
}
.home-hero { padding: 1.5rem 0 2.5rem; gap: 2rem; }
.home-hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.12; font-weight: 650; letter-spacing: -.025em; }
.hero-intro { max-width: 29rem; line-height: 1.7; margin: 1.25rem 0 1.5rem; }
.home-hero img { max-width: 22rem; justify-self: end; }
.home-themes { padding: 1rem 0 2rem; border-top: 1px solid var(--border); }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.theme-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
    background: var(--panel);
    text-decoration: none;
    color: #f0f4fa;
}
.theme-card:hover { background: #1b3553; border-color: #76bdff; }
.theme-card.selected { border-color: var(--cyan); background: #183653; }
.theme-name { font-weight: 600; line-height: 1.4; }
.theme-count, .debate-meta, .list-order { color: var(--silver); font-size: .9rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
.section-heading h2 { margin-bottom: .25rem; }
.debate-card { padding: 1.3rem 1.5rem; }
.debate-card h3 { margin: .75rem 0; font-size: 1.3rem; }
.debate-card h3 a { color: #e0edff; text-decoration: none; }
.debate-card h3 a:hover { text-decoration: underline; }
.debate-card p { line-height: 1.6; }
.empty-debates { padding: 1rem 0 2rem; }
.pagination { justify-content: center; margin: 1.5rem 0; }
@media (max-width: 52rem) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .home-hero img { justify-self: center; width: min(100%, 14rem); } }
@media (max-width: 26rem) { .theme-grid { grid-template-columns: 1fr; } }
