:root { color-scheme: light; }

.main-nav { margin-left: auto; }
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-size: .8125rem;
    font-weight: 650;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--soft); border-color: var(--teal); }
.theme-toggle svg { width: 19px; height: 19px; flex-shrink: 0; }
.theme-icon-sun, [data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }

[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e5eff1;
    --muted: #a9bec4;
    --teal: #79d8d0;
    --navy: #123b45;
    --navy-dark: #b6f1e8;
    --paper: #101c22;
    --white: #172930;
    --line: #385059;
    --soft: #203d40;
    --shadow: 0 10px 32px rgb(0 0 0 / 12%);
}
[data-theme="dark"] :is(a, button, input, select, textarea):focus-visible { outline-color: #79d8d0; }
[data-theme="dark"] :is(.city-tab, .filter-panel, .notice-card, .panel, .empty-state, .button-secondary, .workflow-strip b) { background: var(--white); }
[data-theme="dark"] .site-footer { background: #13232a; }
[data-theme="dark"] .city-tab.selected { background: var(--navy); border-color: #54858c; }
[data-theme="dark"] .notice-card:hover { border-color: #73989d; box-shadow: var(--shadow); }
[data-theme="dark"] .empty-state { border-color: #58747d; }
[data-theme="dark"] .button-primary { background: #79d8d0; border-color: #79d8d0; color: #102c32; }
[data-theme="dark"] .button-primary:hover { background: #a0e8e0; border-color: #a0e8e0; color: #102c32; }
[data-theme="dark"] .button-secondary { border-color: #66888e; }
[data-theme="dark"] .button-secondary:hover { background: var(--soft); border-color: var(--teal); }
[data-theme="dark"] :is(.button-accent, .button-accent:hover, .skip-link) { color: #0d2f39; }
[data-theme="dark"] .field :is(input, textarea, select) { background-color: #112127; border-color: #66818b; }
[data-theme="dark"] .field :is(input, textarea)::placeholder { color: #9db4bc; }
[data-theme="dark"] .field :is(input, textarea, select):hover { border-color: #8cabb4; }
[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23a9bec4' stroke-width='1.6'/%3E%3C/svg%3E"); }
[data-theme="dark"] :is(.workflow-strip, .import-evidence) { background: #1b3438; border-color: #456a6b; }
[data-theme="dark"] .workflow-strip span { color: #bed7d7; }
[data-theme="dark"] .workflow-strip b { border-color: #638580; }
[data-theme="dark"] :is(.opportunity-fields, .pending-box) { background: #13272d; border-color: #38565f; }
[data-theme="dark"] .note-icon { background: var(--soft); }
[data-theme="dark"] .publication-ok { background: #1b3830; }
[data-theme="dark"] .deadline-diff > div:last-child { border-color: #456a6b; }
[data-theme="dark"] :is(.preview-banner, .import-issues) { background: #352f1c; border-color: #786638; }
[data-theme="dark"] :is(.preview-banner span, .import-issues > p, .import-issues .eyebrow) { color: #edce87; }
[data-theme="dark"] .import-issue-check { border-color: #786638; }
[data-theme="dark"] .opportunity-fields .remove-opportunity { color: #ffb3b0; }
[data-theme="dark"] :is(.badge-success, .badge-open) { background: #1c3d2e; color: #b0e6c3; }
[data-theme="dark"] :is(.badge-warning, .badge-scheduled) { background: #463919; color: #f4d38a; }
[data-theme="dark"] :is(.badge-neutral, .badge-closed, .badge-muted) { background: #293b43; color: #c4d5db; }
[data-theme="dark"] :is(.badge-info, .badge-unknown) { background: #1d3b50; color: #a9d9f1; }
[data-theme="dark"] :is(.badge-danger, .badge-suspended) { background: #4b292d; color: #ffb3b0; }
[data-theme="dark"] .alert-success { background: #1c3d2e; color: #b0e6c3; border-color: #42775a; }
[data-theme="dark"] .alert-error { background: #4b292d; color: #ffb3b0; border-color: #8c5458; }
[data-theme="dark"] .alert-info { background: #1d3b50; color: #a9d9f1; border-color: #486f88; }

@media (max-width: 800px) {
    .header-inner { gap: 16px; }
    .main-nav { gap: 16px; }
}
@media (max-width: 600px) {
    .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding-block: 12px 8px; }
    .brand { grid-column: 1; grid-row: 1; }
    .theme-toggle { grid-column: 2; grid-row: 1; padding-inline: 10px; font-size: .75rem; }
    .main-nav, .main-nav:has(form) { grid-column: 1 / -1; grid-row: 2; margin-left: 0; max-width: none; justify-content: flex-start; flex-wrap: wrap; gap: 8px 22px; }
    .main-nav > a, .main-nav:has(form) > a, .main-nav .nav-button, .main-nav:has(form) .nav-button { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; }
}
