:root {
    color-scheme: light;
    --paper: #f6efe4;
    --surface: #fffaf1;
    --surface-soft: #e9e0d3;
    --ink: #081d38;
    --muted: #58677a;
    --line: #0b2747;
    --shadow-ink: #081d38;
    --yellow: #f2d45c;
    --pink: #ff6f9f;
    --blue: #3bd8ed;
    --green: #8fe4c1;
    --lavender: #b5a7ee;
    --on-accent: #071b34;
    --danger: #a32f35;
    --danger-bg: #f9d4cd;
    --success: #356242;
    --dot: #cfd4d8;
    --sketch-radius: 5px 11px 4px 9px / 9px 4px 10px 5px;
    --body-font: "Space Grotesk", "Segoe UI", sans-serif;
    --hand-font: "Patrick Hand", "Comic Sans MS", cursive;
    --display-font: "Bangers", "Impact", "Arial Narrow", sans-serif;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #071b34;
    --surface: #102943;
    --surface-soft: #183753;
    --ink: #edf6ff;
    --muted: #9fb4c8;
    --line: #74a4b8;
    --shadow-ink: #020b16;
    --yellow: #9d873a;
    --pink: #8a3c60;
    --blue: #236c80;
    --green: #397b66;
    --lavender: #594e86;
    --danger: #ffc1b8;
    --danger-bg: #603e3b;
    --success: #b4d69e;
    --dot: #153453;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--muted) var(--paper); }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: var(--body-font); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
::selection { background: var(--yellow); color: var(--on-accent); }
.hidden { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--yellow); color: var(--on-accent); border: 2px solid var(--line); }
.skip-link:focus { top: 16px; }
.page-shell { width: min(1240px, calc(100% - 96px)); margin: 0 auto; }
#bar { display: flex; align-items: center; gap: 24px; min-height: 88px; margin-top: 18px; padding: 0 18px; border: 2px solid var(--line); background: var(--surface); color: #081d38; box-shadow: 5px 5px 0 var(--shadow-ink); }
.brand-block { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; margin-right: auto; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; background: var(--pink); color: #081d38; border: 2px solid #081d38; border-radius: 3px; box-shadow: 3px 3px 0 #081d38; font: 36px/1 var(--display-font); transform: rotate(-3deg); padding-bottom: 5px; }
.brand-copy { display: flex; flex-direction: column; gap: 0; }
.brand-title { font: 30px/1.1 var(--display-font); letter-spacing: 0.8px; color: #081d38; }
.brand-kicker { font: 14px/1.4 var(--hand-font); color: #58677a; }
#welcome { max-width: 250px; overflow-wrap: anywhere; position: relative; font: 19px/1.3 var(--hand-font); }
.quick-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#login, #admin, #logout { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 2px solid #081d38; border-radius: 3px; box-shadow: 3px 3px 0 #081d38; background: #fffaf1; color: #081d38; font-size: 12px; font-weight: 700; transition: transform 150ms, box-shadow 150ms; }
#login, #admin { padding: 0; }
#login a, #admin a { padding: 10px 18px; text-decoration: none; }
#admin { background: var(--pink); color: #081d38; }
#logout { padding: 10px 18px; }
#login:hover, #admin:hover, #logout:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--shadow-ink); }
#login:active, #admin:active, #logout:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 17px; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 44px 0 25px; }
.section-heading > div, .admin-heading { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.section-index { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }
.section-heading h1, .section-heading h2, .card-head h2 { margin: 0; font: clamp(40px, 4.5vw, 64px)/1 var(--display-font); letter-spacing: 1px; }
.count-badge { display: inline-grid; place-items: center; min-width: 28px; height: 27px; padding: 0 7px; border: 1.5px solid var(--line); border-radius: 50% 45% 48% 40%; background: var(--surface); color: var(--ink); font: 18px var(--hand-font); }
.hand-note { margin: 0; color: var(--muted); font: 20px/1.3 var(--hand-font); }
.section-heading .hand-note { transform: rotate(-3deg); }
.section-heading .hand-note span { font-size: 27px; padding-left: 7px; }
.page-footer { margin: 44px 0 0; padding: 23px 0 32px; border-top: 2px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-footer > span:first-child { font-size: 9px; font-weight: 600; letter-spacing: 1.3px; color: var(--muted); }
.page-footer .hand-note { font-size: 18px; }
.floating-controls { position: fixed; right: 21px; bottom: 21px; z-index: 30; display: flex; align-items: center; gap: 10px; }
#theme-toggle, #scroll-top { position: static; width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); color: #081d38; box-shadow: 3px 3px 0 var(--shadow-ink); font: 25px/1 var(--body-font); transition: transform 150ms; }
#scroll-top { background: var(--blue); }
#theme-toggle:hover, #scroll-top:hover { transform: translateY(-3px); }
input, select, textarea { background: #fffaf1; color: #081d38; border: 2px solid #081d38; border-radius: 3px; padding: 10px 12px; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="file"] { font-size: 11px; }
input[type="file"]::file-selector-button { margin-right: 8px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: var(--sketch-radius); background: var(--blue); color: var(--on-accent); font: 600 11px var(--body-font); cursor: pointer; }
.form-status { color: var(--danger); font-size: 12px; }

html[data-theme="dark"] #bar {
    background: #102943;
    color: var(--ink);
    border-color: var(--line);
}
html[data-theme="dark"] .brand-title,
html[data-theme="dark"] #welcome { color: var(--ink); }
html[data-theme="dark"] .brand-kicker { color: var(--muted); }
html[data-theme="dark"] #login,
html[data-theme="dark"] #admin,
html[data-theme="dark"] #logout {
    background: #183753;
    color: var(--ink);
    border-color: var(--line);
    box-shadow: 3px 3px 0 #020b16;
}
html[data-theme="dark"] #admin { background: #713650; }
html[data-theme="dark"] #theme-toggle,
html[data-theme="dark"] #scroll-top {
    color: var(--ink);
    border-color: var(--line);
}
html[data-theme="dark"] #theme-toggle { background: #183753; }
html[data-theme="dark"] #scroll-top { background: #205e72; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #0c2239;
    color: var(--ink);
    border-color: var(--line);
}
@media (max-width: 1000px) {
    .page-shell { width: calc(100% - 64px); }
    #bar { gap: 16px; }
    #welcome { font-size: 17px; max-width: 170px; }
    .brand-kicker { font-size: 14px; }
}
@media (max-width: 780px) {
    .page-shell { width: calc(100% - 40px); }
    #bar { min-height: 96px; flex-wrap: wrap; gap: 15px; padding: 20px 22px; }
    .brand-block { flex: 1; }
    #welcome { order: 3; flex-basis: 100%; max-width: none; margin-left: auto; text-align: right; }
    .quick-actions { margin-left: auto; justify-content: flex-end; }
    .section-heading .hand-note { font-size: 17px; }
}
@media (max-width: 560px) {
    .page-shell { width: calc(100% - 32px); }
    .brand-title { font-size: 25px; }
    .brand-mark { width: 39px; height: 39px; font-size: 31px; }
    .brand-kicker { font-size: 12px; }
    .quick-actions { gap: 9px; }
    #login, #admin, #logout { min-height: 38px; font-size: 11px; }
    #login a, #admin a, #logout { padding: 8px 11px; }
    .section-heading { align-items: flex-start; padding: 26px 0 23px; gap: 9px; }
    .section-heading > div { gap: 9px; }
    .section-heading h2 { font-size: 28px; }
    .section-heading .hand-note { display: none; }
    .page-footer { margin-top: 30px; flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 75px; }
    .floating-controls { right: 15px; bottom: 15px; }
}
@media (max-width: 380px) { #bar { gap: 16px 9px; } .quick-actions { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
