:root {
    --navy: #1b2a3a;
    --navy-dark: #101c28;
    --gold: #c9a24b;
    --gold-light: #e6cf8f;
    --paper: #f7f4ee;
    --ink: #23262b;
    --ink-soft: #4a5058;
    --muted: #6d7580;
    --border: #e1ddd2;
    --danger: #b3452b;
    --radius: 10px;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --link: var(--navy);
    --heading: var(--navy);
    --alert-bg: #fbf3e0;
    --alert-border: var(--gold-light);
    --alert-error-bg: #fbe9e4;
    --badge-user-bg: #e6e6e6;
    --shadow: rgba(27, 42, 58, 0.05);
    /* Neutral option identity colors - deliberately not red/green so no option reads
       as "the good one" or "the bad one". */
    --opt-a: #4f7ea3;
    --opt-b: #a3824f;
    --opt-c: #7d6a9e;
    --opt-d: #5a9178;
    --opt-e: #a35a6e;
}

[data-theme="dark"] {
    --opt-a: #7fb0d9;
    --opt-b: #d9b076;
    --opt-c: #b09bd6;
    --opt-d: #7fc4a0;
    --opt-e: #d68a9d;
    --gold: #d9b667;
    --gold-light: #ecd8a3;
    --paper: #10161d;
    --ink: #e7e4db;
    --ink-soft: #c9c5b9;
    --muted: #97a1ab;
    --border: #2c3641;
    --danger: #e08067;
    --card-bg: #1a222b;
    --input-bg: #202a34;
    --link: var(--gold-light);
    --heading: #f1ead7;
    --alert-bg: rgba(201, 162, 75, 0.12);
    --alert-border: rgba(201, 162, 75, 0.4);
    --alert-error-bg: rgba(224, 128, 103, 0.15);
    --badge-user-bg: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Georgia', 'Iowan Old Style', serif;
    line-height: 1.5;
    transition: background-color 0.2s ease, color 0.2s ease;
}

input, textarea, select {
    background: var(--input-bg);
    color: var(--ink);
}

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

.logo {
    font-family: 'Iowan Old Style', Georgia, serif;
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--link);
    text-decoration: none;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.logo .dot { color: var(--gold); }
.logo-text { font-size: 1.6rem; letter-spacing: 0.08em; }
.logo-mark { flex-shrink: 0; display: block; width: 80px; height: 80px; transition: transform 0.2s ease; }
.logo:hover .logo-mark { transform: rotate(12deg); }

.site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.25rem 3.5rem 1.25rem 2rem;
    background: var(--navy);
    border-bottom: 3px solid var(--gold);
}
.site-header .logo {
    grid-column: 2;
    justify-self: center;
    color: #fff;
}
.site-header nav {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}
.site-header nav a { color: var(--gold-light); text-decoration: none; font-family: sans-serif; font-size: 0.92rem; }
.site-header nav a:hover { text-decoration: underline; }
.site-header .muted { color: #cfd6dd; font-family: sans-serif; font-size: 0.92rem; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.page-title { color: var(--heading); font-size: 1.6rem; margin: 0 0 1.25rem; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 28, 40, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 1000;
}
.modal-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 2.25rem 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(16, 28, 40, 0.35);
    animation: modal-pop 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
@keyframes modal-pop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-icon { margin: 0 auto 1rem; width: 56px; height: 56px; color: var(--heading); }
.modal-icon .logo-mark { width: 56px; height: 56px; }
.modal-card h2 { margin: 0 0 0.6rem; color: var(--heading); font-size: 1.45rem; }
.modal-card p { margin: 0 0 1.5rem; }
.modal-card .btn { width: 100%; }
.confirm-actions { display: flex; gap: 0.75rem; }
.confirm-actions .btn { width: auto; flex: 1; }
#confirm-modal-cancel { background: var(--paper); color: var(--ink); border: 1.5px solid var(--border); }

.theme-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 900;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px var(--shadow);
    transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.06); border-color: var(--gold); }

@media (max-width: 640px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
}

.eyebrow {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: var(--gold);
    font-family: sans-serif;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.date-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: sans-serif;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}
.date-nav .nav-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.1rem;
}

.submit-scenario-link {
    font-family: sans-serif;
    font-size: 0.85rem;
    text-align: center;
    margin: 0 0 1.25rem;
}
.submit-scenario-link a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}
.submit-scenario-link a:hover { text-decoration: underline; }
.date-nav .nav-link:hover { text-decoration: underline; }
.date-nav .nav-link-next { margin-left: auto; }

.question-text {
    font-size: 1.224rem;
    margin: 0 0 1.5rem;
    color: var(--heading);
}

.options { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }

.option-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.9rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    font-family: sans-serif;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.option-btn.opt-a { --opt-color: var(--opt-a); }
.option-btn.opt-b { --opt-color: var(--opt-b); }
.option-btn.opt-c { --opt-color: var(--opt-c); }
.option-btn.opt-d { --opt-color: var(--opt-d); }
.option-btn.opt-e { --opt-color: var(--opt-e); }
.option-btn:hover:not(:disabled) { border-color: var(--opt-color); }
.option-btn:disabled { cursor: default; opacity: 0.85; }
.option-btn.selected { border-color: var(--opt-color); background: var(--card-bg); }

.option-dot {
    position: relative;
    z-index: 2;
    width: 11px;
    height: 11px;
    min-width: 11px;
    border-radius: 50%;
    background: var(--opt-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--opt-color) 20%, transparent);
}

.option-label { position: relative; z-index: 2; font-weight: 600; flex: 1; color: var(--ink-soft); }
.option-pct { position: relative; z-index: 2; font-family: sans-serif; color: var(--muted); font-size: 0.9rem; min-width: 2.5em; text-align: right; }

.option-bar {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
}
.option-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, color-mix(in srgb, var(--opt-color) 35%, transparent), transparent);
    transition: width 0.4s ease;
}

.total-votes { font-family: sans-serif; font-size: 0.85rem; margin: 0; }

.discussion-card h2 { margin-top: 0; color: var(--heading); font-size: 1.3rem; }

.comment-form { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.reply-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.reply-form textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}
.reply-form textarea:disabled { background: var(--paper); color: var(--muted); cursor: not-allowed; }
.comment-form textarea {
    width: 100%;
    min-height: 90px;
    padding: 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--input-bg);
    color: var(--ink);
}
.comment-form textarea:disabled { background: var(--paper); color: var(--muted); cursor: not-allowed; }

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.composer-gif-btn {
    background: none;
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    font-family: sans-serif;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.composer-gif-btn:hover { border-color: var(--gold); color: var(--ink); }

.gif-attachment {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
}
.gif-attachment img { max-height: 90px; max-width: 140px; border-radius: 6px; display: block; }
.remove-gif-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-family: sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
}

.comment-gif { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; }

.comment-list { display: flex; flex-direction: column; gap: 0; }

.thread-block {
    border-top: 1px solid var(--border);
    padding: 0.5rem 0 0.3rem;
}
.comment-list > .thread-block:first-child { border-top: none; }

.chat-row {
    padding: 0.85rem 1.25rem;
    border-radius: 6px;
    transition: background-color 0.1s ease;
}
.thread-block > .chat-row:hover { background: var(--paper); }

.thread-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    background: none;
    border: none;
    color: var(--link);
    font-family: sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.thread-toggle:hover { text-decoration: underline; }
.thread-toggle-arrow { font-size: 0.6rem; }

.thread-replies {
    margin-top: 0.6rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    display: flex;
    flex-direction: column;
}
.thread-replies .chat-row.reply-row {
    border-top: 1px solid var(--border);
    padding: 0.7rem 1rem;
    border-radius: 6px;
}
.thread-replies .chat-row.reply-row:first-child { border-top: none; }
.thread-replies .chat-row.reply-row:hover { background: var(--paper); }

.comment-meta { font-family: sans-serif; font-size: 0.85rem; margin-bottom: 0.25rem; }
.comment-body { font-size: 1rem; }

.reply-context {
    font-family: sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.reply-context strong { color: var(--ink-soft); }

.quote-box {
    border-left: 3px solid var(--gold);
    background: var(--paper);
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.75rem;
    border-radius: 0 6px 6px 0;
    font-family: sans-serif;
    font-size: 0.82rem;
    line-height: 1.4;
}
.quote-author {
    display: inline;
    font-weight: 700;
    color: var(--ink-soft);
}
.quote-tag { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.quote-text-wrap { margin-top: 0.15rem; }
.quote-text { color: var(--muted); font-style: italic; }
.quote-missing { font-style: italic; }
.quote-show-more {
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.35rem;
    color: var(--link);
    font-family: sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.quote-show-more:hover { text-decoration: underline; }
.quote-jump {
    display: inline-block;
    margin-top: 0.3rem;
    color: var(--link);
    font-family: sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
}
.quote-jump:hover { text-decoration: underline; }

@keyframes flash-highlight {
    0%, 100% { background: transparent; }
    30% { background: rgba(201, 162, 75, 0.25); }
}
.flash-highlight { animation: flash-highlight 1.6s ease; border-radius: 6px; }

.comment-actions {
    display: flex;
    gap: 0.9rem;
    margin-top: 0.5rem;
    font-family: sans-serif;
}

.reply-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 0.85rem;
    color: var(--ink);
}
.reply-chip-name { font-weight: 700; color: var(--gold); }
.reply-chip-clear {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 0.25rem;
}
.reply-chip-clear:hover { color: var(--danger); }

.voter-name.opt-a { --opt-color: var(--opt-a); }
.voter-name.opt-b { --opt-color: var(--opt-b); }
.voter-name.opt-c { --opt-color: var(--opt-c); }
.voter-name.opt-d { --opt-color: var(--opt-d); }
.voter-name.opt-e { --opt-color: var(--opt-e); }
.voter-name { color: var(--opt-color, var(--ink)); }
.voter-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--opt-color, var(--muted));
    margin-right: 5px;
    vertical-align: middle;
}

.cv-marker {
    color: inherit;
    font: inherit;
    cursor: default;
}

.reaction-tooltip {
    position: fixed;
    z-index: 1300;
    background: var(--navy-dark);
    color: #fff;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 0.78rem;
    line-height: 1.35;
    max-width: 220px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
}
.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    font-family: sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1.2;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.reaction-pill img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; display: block; }
.reaction-pill .reaction-count { color: var(--muted); font-size: 0.78rem; }
.reaction-pill.mine { border-color: var(--gold); background: rgba(201, 162, 75, 0.14); }
.reaction-pill:hover { border-color: var(--gold); }

.reaction-add {
    background: none;
    border: 1.5px dashed var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-family: sans-serif;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.reaction-add:hover { border-color: var(--gold); color: var(--ink); }

.scenario-calendar {
    z-index: 1400;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(16, 28, 40, 0.3);
    padding: 0.85rem;
    width: 260px;
    font-family: sans-serif;
}
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    font-weight: 700;
    color: var(--heading);
}
.cal-nav {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--ink);
    font-size: 0.9rem;
}
.cal-nav:hover { border-color: var(--gold); }
.cal-month-label { font-size: 0.9rem; }
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
}
.cal-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 5px;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-day-empty { visibility: hidden; cursor: default; }
.cal-day-available {
    background: rgba(90, 145, 120, 0.18);
    color: var(--ink);
}
.cal-day-available:hover { background: rgba(90, 145, 120, 0.4); }
.cal-day-taken {
    background: rgba(179, 69, 43, 0.15);
    color: var(--muted);
    cursor: not-allowed;
}
.cal-day-current {
    background: var(--gold);
    color: var(--navy-dark);
    font-weight: 700;
}
.cal-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 0.68rem;
    color: var(--muted);
}
.cal-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.cal-dot-available { background: rgba(90, 145, 120, 0.6); }
.cal-dot-taken { background: rgba(179, 69, 43, 0.5); }

.picker-panel {
    z-index: 1200;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 28, 40, 0.25);
    padding: 0.6rem;
    max-width: min(320px, 90vw);
}
#emoji-picker-panel {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.15rem;
}
.emoji-option {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}
.emoji-option:hover { background: var(--paper); }

.gif-picker-panel { width: 300px; }
#gif-search-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    background: var(--input-bg);
    color: var(--ink);
}
.gif-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    max-height: 260px;
    overflow-y: auto;
}
.gif-results p { grid-column: 1 / -1; margin: 0.5rem 0; }
.gif-option {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
}
.gif-option img { width: 100%; height: 60px; object-fit: cover; display: block; border-radius: 6px; }
.gif-option:hover img { outline: 2px solid var(--gold); }

.delete-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.delete-toggle:hover { color: var(--danger); text-decoration: underline; }

.comment-deleted {
    color: var(--muted);
    font-style: italic;
}

.reply-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.reply-toggle:hover { color: var(--link); text-decoration: underline; }

.edit-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.edit-toggle:hover { color: var(--link); text-decoration: underline; }

.edited-marker {
    font-family: sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    font-style: italic;
}

.quote-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.quote-toggle-btn:hover { color: var(--gold); text-decoration: underline; }

.lock-note { text-align: center; font-family: sans-serif; font-size: 0.9rem; }

.muted { color: var(--muted); font-family: sans-serif; font-size: 0.9rem; }

.btn {
    display: inline-block;
    font-family: sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; background: var(--gold); color: var(--navy-dark); }

.alert { font-family: sans-serif; font-size: 0.9rem; padding: 0.85rem 1rem; border-radius: 8px; background: var(--alert-bg); border: 1px solid var(--alert-border); margin-bottom: 1rem; }
.alert-error { background: var(--alert-error-bg); border-color: var(--danger); color: var(--danger); }

.empty-state { text-align: center; }

/* Auth pages */
.auth-wrap { max-width: 420px; margin: 4rem auto; padding: 0 1.5rem; text-align: center; }
.auth-wrap .logo { display: inline-flex; justify-content: center; margin: 0 auto 1.5rem; font-size: 2rem; }
.auth-wrap .card { text-align: left; }
.auth-wrap .logo-mark { width: 46px; height: 46px; }
.auth-wrap form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.auth-wrap label { font-family: sans-serif; font-size: 0.9rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.35rem; }
.auth-wrap input {
    padding: 0.65rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 1rem;
}

.option-fields { display: flex; gap: 1rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
    .site-header {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto;
        row-gap: 0;
        padding: 0.85rem 3rem 0.85rem 1.1rem;
    }
    .site-header .logo {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }
    .site-header .logo-mark {
        width: 62px;
        height: 62px;
    }
    .site-header nav {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.6rem;
        row-gap: 0.4rem;
    }
    .container {
        padding: 1.5rem 1rem 3rem;
    }
    .card {
        padding: 1.25rem;
    }
    .question-text {
        font-size: 0.972rem;
    }
    .option-fields {
        flex-direction: column;
        gap: 0.75rem;
    }
    .auth-wrap {
        margin: 2rem auto;
        padding: 0 1rem;
    }
    .admin-table {
        font-size: 0.82rem;
    }
    .admin-table th, .admin-table td {
        padding: 0.5rem 0.4rem;
    }
}
.admin-table { width: 100%; border-collapse: collapse; font-family: sans-serif; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.admin-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.admin-form label { font-family: sans-serif; font-size: 0.9rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.35rem; }
.admin-form input, .admin-form textarea { padding: 0.6rem 0.75rem; border: 1.5px solid var(--border); border-radius: 6px; font-family: sans-serif; font-size: 0.95rem; }
.admin-nav { display: flex; gap: 1rem; margin-bottom: 1.5rem; font-family: sans-serif; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-family: sans-serif; }
.role-form { display: flex; gap: 0.5rem; align-items: center; }
.role-form select {
    padding: 0.35rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 0.85rem;
    background: var(--input-bg);
    color: var(--ink);
}

.badge-admin { background: var(--gold-light); color: var(--navy-dark); }
.badge-moderator { background: var(--opt-a); color: #fff; }
.badge-user { background: var(--badge-user-bg); color: var(--muted); }