:root {
    color-scheme: dark;
    --bg: #111111;
    --surface-0: #151515;
    --surface-1: #191919;
    --surface-2: #222222;
    --surface-3: #2a2a2a;
    --border: #333333;
    --border-strong: #444444;
    --text: #eeeeee;
    --text-soft: #b8b8b8;
    --text-muted: #858585;
    --accent: #76c7f0;
    --accent-strong: #9dd7f4;
    --accent-bg: #113654;
    --success: #5dd49a;
    --success-bg: #123c2b;
    --warning: #f0c36b;
    --warning-bg: #463514;
    --danger: #ff8b8b;
    --danger-bg: #4b1d22;
    --focus: #8ecdf3;
    --shadow-popover: 0 18px 50px rgba(0, 0, 0, .45);
    --radius-sm: 4px;
    --radius-md: 7px;
    --radius-lg: 10px;
    --content: 1180px;
    --content-wide: 1440px;
    --header-height: 72px;
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f8f8f7;
    --surface-0: #f4f4f2;
    --surface-1: #ffffff;
    --surface-2: #f1f1ef;
    --surface-3: #e9e9e6;
    --border: #ddddda;
    --border-strong: #c8c8c4;
    --text: #171717;
    --text-soft: #545454;
    --text-muted: #757575;
    --accent: #086ca3;
    --accent-strong: #075c8b;
    --accent-bg: #dff2fc;
    --success: #147447;
    --success-bg: #dff6e9;
    --warning: #8b5f08;
    --warning-bg: #fff0c7;
    --danger: #b72d3d;
    --danger-bg: #ffe5e8;
    --focus: #1688c2;
    --shadow-popover: 0 18px 50px rgba(0, 0, 0, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; opacity: .48; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img, svg { display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--text); font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: 1.18rem; }
h3 { font-size: 1rem; }
h4 { font-size: .95rem; }
ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
code { font-family: var(--font-mono); }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 10000; left: 1rem; top: 1rem; padding: .65rem 1rem; background: var(--text); color: var(--bg); border-radius: var(--radius-sm); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-frame { min-height: 100vh; display: flex; flex-direction: column; }

.site-header { position: sticky; z-index: 100; top: 0; height: var(--header-height); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.site-header__inner { width: min(100%, calc(var(--content-wide) + 3rem)); height: 100%; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 2rem; }
.site-brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; }
.site-brand:hover { color: var(--text); }
.site-brand__mark { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; }
.site-brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.site-brand__name { font-size: .9rem; font-weight: 700; letter-spacing: .13em; }
.site-brand__year { padding-left: .65rem; border-left: 1px solid var(--border); color: var(--text-muted); font-family: var(--font-mono); font-size: .72rem; }
.primary-nav { align-self: stretch; display: flex; align-items: stretch; gap: .2rem; }
.primary-nav a { position: relative; display: flex; align-items: center; padding: 0 .8rem; color: var(--text-soft); font-size: .84rem; font-weight: 500; text-decoration: none; }
.primary-nav a:hover { color: var(--text); }
.primary-nav a[aria-current="page"] { color: var(--text); }
.primary-nav a[aria-current="page"]::after { position: absolute; right: .8rem; bottom: -1px; left: .8rem; height: 2px; background: var(--accent); content: ""; }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.icon-button { width: 40px; height: 40px; display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-1); color: var(--text-soft); text-decoration: none; }
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button--small { width: 30px; height: 30px; border-radius: var(--radius-sm); }
.icon-button--small svg { width: 15px; height: 15px; }
.theme-icon { width: 18px; height: 18px; }
:root[data-theme="dark"] .theme-icon--moon, :root[data-theme="light"] .theme-icon--sun { display: none; }
.profile-menu { position: relative; }
.profile-menu__trigger { min-height: 42px; display: flex; align-items: center; gap: .65rem; padding: .3rem .45rem .3rem .35rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-1); text-align: left; }
.profile-menu__trigger:hover, .profile-menu__trigger[aria-expanded="true"] { border-color: var(--border-strong); background: var(--surface-2); }
.profile-menu__avatar { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; border-radius: var(--radius-sm); background: var(--accent-bg); color: var(--accent); font-family: var(--font-mono); font-size: .75rem; font-weight: 600; }
.profile-menu__identity { min-width: 0; display: grid; line-height: 1.25; }
.profile-menu__name { max-width: 145px; overflow: hidden; font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu__role { color: var(--text-muted); font-size: .68rem; }
.profile-menu__chevron { width: 15px; height: 15px; color: var(--text-muted); transition: transform .15s ease; }
.profile-menu__trigger[aria-expanded="true"] .profile-menu__chevron { transform: rotate(180deg); }
.profile-menu__popover { position: absolute; top: calc(100% + .55rem); right: 0; width: 240px; display: none; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-1); box-shadow: var(--shadow-popover); }
.profile-menu__popover[data-open] { display: block; }
.profile-menu__summary { display: grid; gap: .2rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.profile-menu__summary strong { font-size: .82rem; }
.profile-menu__actions { padding: .4rem; }
.profile-menu__actions a, .profile-menu__logout button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: .6rem .65rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-soft); font-size: .79rem; text-align: left; text-decoration: none; }
.profile-menu__actions a:hover, .profile-menu__logout button:hover { background: var(--surface-2); color: var(--text); }
.profile-menu__logout { margin: 0; padding: .4rem; border-top: 1px solid var(--border); }

.site-footer { width: min(100% - 3rem, var(--content-wide)); margin: auto auto 0; padding: 2.2rem 0; display: flex; justify-content: center; gap: .65rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; }
.page-shell { width: min(calc(100% - 3rem), var(--content)); margin: 0 auto; padding: 3.5rem 0 4.5rem; }
.page-shell--wide { width: min(calc(100% - 3rem), var(--content-wide)); }
.page-shell--narrow { max-width: 1080px; }
.page-heading { margin-bottom: 2rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.page-heading > div:first-child { max-width: 760px; }
.page-heading h1 { margin-top: .35rem; }
.page-heading p:not(.eyebrow) { max-width: 680px; margin-top: .7rem; color: var(--text-soft); font-size: .95rem; }
.page-heading__meta { display: flex; gap: 1.5rem; }
.page-heading__meta span { display: grid; gap: .2rem; color: var(--text-soft); font-family: var(--font-mono); font-size: .72rem; }
.page-heading__meta small { color: var(--text-muted); font-family: var(--font-sans); font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { color: var(--text-muted); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--text-muted); }
.surface { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-1); }
.section-block { margin-top: 1rem; padding: 1.4rem; }
.section-heading, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.2rem; }
.section-heading h2, .panel-heading h2 { margin-top: .25rem; }
.section-heading__hint, .panel-heading > span { color: var(--text-muted); font-family: var(--font-mono); font-size: .68rem; }
.section-heading--compact { padding: 1rem 1.1rem; margin: 0; border-bottom: 1px solid var(--border); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .55rem .9rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; line-height: 1.2; text-decoration: none; }
.button svg { width: 17px; height: 17px; }
.button--primary { border-color: var(--accent); background: var(--accent); color: #07141a; }
:root[data-theme="light"] .button--primary { color: #fff; }
.button--primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #07141a; }
:root[data-theme="light"] .button--primary:hover { color: #fff; }
.button--secondary { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.button--secondary:hover { background: var(--surface-3); color: var(--text); }
.button--block { width: 100%; }
.button--small { min-height: 30px; padding: .35rem .65rem; font-size: .68rem; }
.text-link { font-size: .78rem; font-weight: 600; }
input, select, textarea { min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
input, textarea { padding: .55rem .7rem; }
select { padding: .5rem 2rem .5rem .7rem; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--border-strong) 50%, var(--text-muted)); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 28%, transparent); outline-offset: 1px; }

.badge, .status-label { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; min-height: 24px; padding: .2rem .5rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); color: var(--text-soft); font-size: .65rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge--small { min-height: 20px; margin-left: .4rem; padding: .1rem .35rem; font-size: .58rem; }
.badge--info { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-bg); color: var(--accent-strong); }
.badge--success { border-color: color-mix(in srgb, var(--success) 32%, transparent); background: var(--success-bg); color: var(--success); }
.badge--danger { border-color: color-mix(in srgb, var(--danger) 32%, transparent); background: var(--danger-bg); color: var(--danger); }
.badge-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent); }
.status-dot--danger { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--border); }
.metric-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; background: var(--surface-1); }
.metric > span { color: var(--text-soft); font-size: .72rem; font-weight: 500; }
.metric strong { margin: .6rem 0; font-family: var(--font-mono); font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -.05em; }
.metric strong small { color: var(--text-muted); font-size: .9rem; }
.metric > small { color: var(--text-muted); font-size: .65rem; }

.auth-page { background: var(--bg); }
.auth-page .site-footer { max-width: 1060px; }
.auth-shell { width: min(calc(100% - 3rem), 1060px); min-height: calc(100vh - 72px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); padding: 5rem 0; }
.auth-intro h1 { max-width: 620px; margin-top: .8rem; font-size: clamp(3rem, 7vw, 5.5rem); line-height: .98; }
.auth-intro__copy { max-width: 560px; margin-top: 1.5rem; color: var(--text-soft); font-size: 1.02rem; }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 5rem; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .09em; }
.auth-brand strong { color: var(--accent); }
.auth-brand__mark { width: 34px; height: 34px; overflow: hidden; }
.auth-brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.auth-panel { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-1); }
.auth-panel__header { display: flex; align-items: center; gap: .65rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; }
.auth-panel__body { padding: 1.6rem; }
.auth-panel__body h2 { margin-bottom: 1rem; font-size: 1.3rem; }
.auth-panel__body > p { margin: .55rem 0 1.5rem; color: var(--text-soft); font-size: .82rem; }
.alert { margin-bottom: 1rem; padding: .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .75rem; }
.alert--warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-bg); color: var(--warning); }
.alert p { margin: .3rem 0; }
.alert ul { padding-left: 1.2rem; }

.profile-overview { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.5rem; }
.profile-overview__identity { display: flex; align-items: center; gap: 1rem; }
.profile-overview__avatar, .profile-header__avatar { display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border)); border-radius: var(--radius-md); background: var(--accent-bg); color: var(--accent); font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; }
.profile-overview__avatar { width: 64px; height: 64px; }
.profile-overview__identity h2 { margin-top: .25rem; }
.profile-overview__identity p { color: var(--text-muted); font-family: var(--font-mono); font-size: .72rem; }
.profile-overview__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.definition-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.definition-grid > div { min-height: 84px; display: flex; flex-direction: column; justify-content: center; gap: .35rem; padding: 1rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.definition-grid dt { color: var(--text-muted); font-size: .65rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.definition-grid dd { color: var(--text); font-size: .85rem; font-weight: 500; overflow-wrap: anywhere; }
.definition-grid dd small { display: block; margin-top: .25rem; color: var(--text-muted); font-size: .68rem; }

.challenge-heading { align-items: center; }
.countdown-block { min-width: 190px; padding-left: 1.2rem; border-left: 1px solid var(--border); }
.countdown-block span { display: block; color: var(--text-muted); font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.countdown-block strong { display: block; margin-top: .35rem; font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500; letter-spacing: .02em; }
.competition-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); align-items: start; gap: 1rem; }
.standings-panel { position: sticky; top: calc(var(--header-height) + 1rem); overflow: hidden; }
.ranking-list { list-style: none; }
.ranking-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: .85rem; min-height: 68px; padding: .75rem 1rem; border-top: 1px solid var(--border); }
.ranking-row:first-child { border-top: 0; }
.ranking-row--current { box-shadow: inset 2px 0 var(--accent); background: var(--accent-bg); }
.ranking-row__rank { color: var(--text-muted); font-family: var(--font-mono); font-size: .7rem; }
.ranking-row__team { display: grid; color: var(--text); font-size: .78rem; font-weight: 600; }
.ranking-row__team small { margin-top: .1rem; color: var(--text-muted); font-size: .61rem; font-weight: 400; }
.ranking-row > strong { font-family: var(--font-mono); font-size: .86rem; }
.ranking-row > strong small { color: var(--text-muted); font-size: .6rem; }
.ranking-list--large { max-width: 760px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ranking-list--large .ranking-row { min-height: 80px; }
.challenge-board { min-width: 0; }
.board-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: .9rem 1.1rem; }
.board-toolbar h2 { margin-top: .2rem; }
.board-toolbar__meta { display: flex; align-items: center; gap: .7rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; }
.challenge-categories { display: grid; gap: 1rem; }
.challenge-category { overflow: hidden; }
.challenge-category__header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.challenge-category__header h3 { margin-top: .25rem; font-size: 1.15rem; }
.challenge-category__header p:not(.eyebrow) { margin-top: .35rem; color: var(--text-muted); font-size: .75rem; }
.challenge-category__header > span { color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; }
.challenge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.challenge-grid__filler { background: var(--surface-1); }
.challenge-card { position: relative; min-width: 0; min-height: 330px; display: flex; flex-direction: column; padding: 1.1rem; background: var(--surface-1); }
.challenge-card--solved { background: color-mix(in srgb, var(--success-bg) 35%, var(--surface-1)); }
.challenge-card--locked { background: color-mix(in srgb, var(--surface-0) 75%, var(--surface-1)); }
.challenge-card__admin-actions { display: flex; justify-content: flex-end; gap: .25rem; margin-bottom: .7rem; }
.challenge-card__admin-actions form { margin: 0; }
.challenge-card__header { display: flex; justify-content: space-between; gap: 1rem; padding-right: 0; }
.challenge-card__kicker { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .58rem; text-transform: uppercase; }
.challenge-card__kicker span + span::before { margin-right: .5rem; color: var(--border-strong); content: "/"; }
.challenge-card__header h4 { font-size: 1.05rem; }
.challenge-card__points { display: grid; align-content: start; color: var(--text); font-family: var(--font-mono); font-size: 1.05rem; text-align: right; }
.challenge-card__points small { color: var(--text-muted); font-size: .55rem; font-weight: 500; }
.challenge-card__description { margin: 1rem 0; color: var(--text-soft); font-size: .78rem; }
.challenge-card__detail { margin: .1rem 0 .8rem; padding: .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-0); }
.challenge-card__detail-label { display: block; margin-bottom: .4rem; color: var(--text-muted); font-size: .6rem; font-weight: 700; text-transform: uppercase; }
.inline-list { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; }
.inline-list li { padding: .15rem .35rem; border: 1px solid var(--border); border-radius: 2px; color: var(--text-muted); font-size: .62rem; }
.inline-list li.is-complete { border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); text-decoration: line-through; }
.challenge-card__footer { margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--border); }
.solve-count { display: block; margin-bottom: .55rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .6rem; }
.answer-form { display: flex; gap: .45rem; }
.answer-form input { min-width: 0; flex: 1; }
.challenge-status { min-height: 40px; display: flex; align-items: center; gap: .55rem; color: var(--text-muted); font-size: .72rem; }
.challenge-status svg { width: 17px; height: 17px; }
.challenge-status--success { color: var(--success); }
.solve-history { margin-top: .7rem; color: var(--text-muted); font-size: .68rem; }
.solve-history__label { display: block; font-weight: 600; }
.solve-history ul { margin-top: .55rem; border-top: 1px solid var(--border); list-style: none; }
.solve-history li { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.solve-history li.is-current { color: var(--accent); }
.solve-history strong { font-family: var(--font-mono); font-size: .62rem; }

.prose { overflow-wrap: anywhere; }
.prose > * + * { margin-top: .7em; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1em; }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose code { padding: .12rem .3rem; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-0); color: var(--accent-strong); font-size: .88em; }
.prose pre { max-width: 100%; overflow: auto; padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.prose pre code { padding: 0; border: 0; background: transparent; }
.prose blockquote { margin-left: 0; padding-left: .8rem; border-left: 2px solid var(--border-strong); color: var(--text-muted); }

.view-switcher { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1.5rem; margin-top: 1rem; padding: 1.1rem; }
.view-switcher h2 { margin-top: .2rem; }
.view-switcher p:not(.eyebrow) { margin-top: .25rem; color: var(--text-muted); font-size: .72rem; }
.inline-form { display: flex; gap: .5rem; }
.link-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .85rem; margin-top: 1rem; }
.link-form__field { display: flex; flex: 1 1 240px; flex-direction: column; gap: .35rem; min-width: 0; }
.link-form__field label { color: var(--text-muted); font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.link-form__alias-wrap { display: flex; align-items: center; gap: .4rem; padding: 0 .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); }
.link-form__alias-wrap span { color: var(--text-muted); font-family: var(--font-mono); font-size: .78rem; }
.link-form__alias-wrap input { flex: 1; min-width: 0; padding: .55rem 0; border: 0; background: transparent; }
.link-form__alias-wrap input:focus { outline: none; }
.link-form__alias-wrap:focus-within { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 28%, transparent); outline-offset: 1px; }
.link-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.analytics-workspace { margin-top: 1rem; overflow: hidden; }
.tabs { display: flex; overflow-x: auto; gap: .25rem; padding: .45rem; border-bottom: 1px solid var(--border); background: var(--surface-0); scrollbar-width: thin; }
.tab-button { min-height: 38px; display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .75rem; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: .74rem; font-weight: 600; white-space: nowrap; }
.tab-button span { padding: .08rem .32rem; border-radius: 999px; background: var(--surface-2); font-family: var(--font-mono); font-size: .58rem; }
.tab-button:hover { background: var(--surface-2); color: var(--text); }
.tab-button.active { border-color: var(--border); background: var(--surface-1); color: var(--text); }
.tab-content { padding: 1.3rem; }
.class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.class-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-0); }
.class-card > header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--border); }
.class-card > header h3 { margin-top: .2rem; }
.class-card > header > strong { font-family: var(--font-mono); }
.class-card > header > strong small { color: var(--text-muted); font-size: .6rem; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.mini-metrics > div { padding: .8rem 1rem; border-right: 1px solid var(--border); }
.mini-metrics > div:last-child { border-right: 0; }
.mini-metrics dt { color: var(--text-muted); font-size: .6rem; text-transform: uppercase; }
.mini-metrics dd { margin-top: .3rem; font-family: var(--font-mono); font-size: 1rem; }
.class-card__section { padding: 1rem; border-top: 1px solid var(--border); }
.class-card__section:first-of-type { border-top: 0; }
.class-card__section h4 { margin-bottom: .55rem; color: var(--text-muted); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.data-list { list-style: none; }
.data-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-top: 1px solid var(--border); color: var(--text-soft); font-size: .72rem; }
.data-list li:first-child { border-top: 0; }
.data-list li > span:last-child, .data-list li > strong { color: var(--text-muted); font-family: var(--font-mono); font-size: .61rem; font-weight: 500; text-align: right; }
.data-list--roomy li { align-items: center; min-height: 46px; padding: .65rem 0; }

.table-scroll { width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); scrollbar-width: thin; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .73rem; }
th { position: sticky; z-index: 1; top: 0; padding: .65rem .75rem; border-bottom: 1px solid var(--border-strong); background: var(--surface-0); color: var(--text-muted); font-size: .59rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { max-width: 250px; padding: .7rem .75rem; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td a { font-weight: 500; }
.numeric { text-align: right; }
.answer-cell { display: block; max-width: 180px; overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.link-alias { width: fit-content; text-decoration: underline dotted; text-decoration-color: var(--text-muted); text-underline-offset: 3px; cursor: help; }
.mono-link { font-family: var(--font-mono); font-size: .64rem; }
.table-subtext { display: block; margin-top: .2rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .58rem; }
tbody tr.is-incorrect td { color: var(--text-muted); }
.points-table { min-width: 580px; }
.points-table td.is-current { background: var(--accent-bg); color: var(--accent); font-weight: 700; }

.empty-state { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 1.5rem; color: var(--text-muted); text-align: center; }
.empty-state strong { color: var(--text-soft); font-size: .82rem; }
.empty-state span { max-width: 440px; font-size: .72rem; }
.empty-state--large { min-height: 260px; }
.empty-state__icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: .5rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: var(--font-mono); }

.breadcrumb { display: flex; gap: .5rem; margin-bottom: 1.4rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.detail-heading { align-items: center; }
.record-hero { display: grid; grid-template-columns: minmax(0, 1fr) 180px; overflow: hidden; }
.record-hero__primary { padding: 1.4rem; }
.record-hero__primary h2 { margin-top: .35rem; font-size: 1.4rem; }
.record-hero__primary p { margin-top: .45rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .67rem; }
.record-hero__score { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding: 1.4rem; border-left: 1px solid var(--border); background: var(--surface-0); }
.record-hero__score span { color: var(--text-muted); font-size: .65rem; }
.record-hero__score strong { margin-top: .25rem; font-family: var(--font-mono); font-size: 2rem; }
.code-block { margin-top: 1rem; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.code-block span { display: block; padding: .55rem .7rem; border-bottom: 1px solid var(--border); background: var(--surface-0); color: var(--text-muted); font-size: .6rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.code-block code { display: block; overflow: auto; padding: .9rem; color: var(--accent-strong); white-space: pre-wrap; word-break: break-all; }
.profile-header { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 1.3rem; margin-bottom: 1rem; padding: 1.4rem; }
.profile-header__avatar { width: 86px; height: 86px; font-size: 2rem; }
.profile-header__identity h1 { margin-top: .2rem; font-size: 2rem; }
.profile-header__identity > p:not(.eyebrow) { margin-top: .35rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .68rem; }
.progress-panel { margin-top: 1rem; padding: 1rem; }
.progress-panel > div:first-child { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; color: var(--text-soft); font-size: .72rem; }
.progress-panel strong { font-family: var(--font-mono); }
.progress-track { width: 100%; height: 6px; display: block; overflow: hidden; border: 0; border-radius: 999px; background: var(--surface-3); color: var(--accent); appearance: none; }
.progress-track::-webkit-progress-bar { border-radius: inherit; background: var(--surface-3); }
.progress-track::-webkit-progress-value { border-radius: inherit; background: var(--accent); }
.progress-track::-moz-progress-bar { border-radius: inherit; background: var(--accent); }
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.challenge-description { padding: 1.3rem; margin-bottom: 1rem; color: var(--text-soft); }
.first-blood-panel { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 1.2rem; margin-top: 1rem; padding: 1rem; border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: color-mix(in srgb, var(--danger-bg) 30%, var(--surface-1)); }
.first-blood-panel__mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: var(--radius-sm); color: var(--danger); font-family: var(--font-mono); font-weight: 700; }
.first-blood-panel h2 { margin-top: .2rem; }
.first-blood-panel p:not(.eyebrow) { margin-top: .25rem; color: var(--text-muted); font-size: .72rem; }
.first-blood-panel dl { display: flex; gap: 1.5rem; }
.first-blood-panel dl div { display: grid; gap: .25rem; }
.first-blood-panel dt { color: var(--text-muted); font-size: .58rem; text-transform: uppercase; }
.first-blood-panel dd { font-family: var(--font-mono); font-size: .7rem; }
.link-list { border: 1px solid var(--border); border-radius: var(--radius-sm); list-style: none; }
.link-list li + li { border-top: 1px solid var(--border); }
.link-list a { display: flex; justify-content: space-between; padding: .7rem .8rem; color: var(--text-soft); font-size: .74rem; text-decoration: none; }
.link-list a:hover { background: var(--surface-2); color: var(--text); }
.team-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--border); background: var(--border); }
.team-stat-grid article { padding: .9rem; background: var(--surface-0); }
.team-stat-grid h3 { margin-bottom: .7rem; font-size: .78rem; }
.team-stat-grid dl div { display: flex; justify-content: space-between; gap: .7rem; padding: .35rem 0; border-top: 1px solid var(--border); font-size: .65rem; }
.team-stat-grid dt { color: var(--text-muted); }
.team-stat-grid dd { font-family: var(--font-mono); }
.admin-answer > code { display: block; overflow: auto; padding: 1rem; border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border)); border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning); word-break: break-all; }

.state-hero { padding: clamp(2rem, 5vw, 4rem); text-align: center; }
.state-hero__icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 1.2rem; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-2); color: var(--accent); }
.state-hero__icon svg { width: 28px; height: 28px; }
.state-hero h1 { margin-top: .5rem; }
.state-hero > p:not(.eyebrow) { max-width: 600px; margin: .8rem auto 0; color: var(--text-soft); }
.state-schedule { max-width: 560px; margin: 2rem auto 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--border); }
.state-schedule div { padding: .8rem; }
.state-schedule div + div { border-left: 1px solid var(--border); }
.state-schedule dt { color: var(--text-muted); font-size: .62rem; text-transform: uppercase; }
.state-schedule dd { margin-top: .3rem; font-family: var(--font-mono); font-size: .72rem; }

.toast-region { position: fixed; z-index: 1000; right: 1rem; bottom: 1rem; width: min(390px, calc(100% - 2rem)); display: grid; gap: .5rem; }
.toast { display: grid; grid-template-columns: 4px minmax(0, 1fr) 32px; align-items: center; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-2); box-shadow: var(--shadow-popover); animation: toast-in .18s ease-out; }
.toast__indicator { align-self: stretch; background: var(--accent); }
.toast--success .toast__indicator { background: var(--success); }
.toast--error .toast__indicator { background: var(--danger); }
.toast--warning .toast__indicator { background: var(--warning); }
.toast__content { padding: .75rem .8rem; color: var(--text); font-size: .76rem; }
.toast__close { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); }
.toast__close:hover { background: var(--surface-3); color: var(--text); }
.toast__close svg { width: 14px; height: 14px; }
.toast--closing { opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; z-index: 500; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .72); }
.terms-modal { width: min(620px, 100%); max-height: min(760px, calc(100vh - 2rem)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: var(--shadow-popover); }
.terms-modal__header { padding: 1.3rem; border-bottom: 1px solid var(--border); }
.terms-modal__header h2 { margin-top: .3rem; font-size: 1.35rem; }
.terms-modal__header p:last-child { margin-top: .5rem; color: var(--text-soft); font-size: .78rem; }
.terms-modal__content { overflow-y: auto; padding: 1.3rem; color: var(--text-soft); font-size: .8rem; outline-offset: -3px; }
.terms-modal__content li + li { margin-top: .55rem; }
.terms-modal__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; border-top: 1px solid var(--border); background: var(--surface-0); }
.terms-modal__footer p { max-width: 300px; color: var(--text-muted); font-size: .67rem; }

.snow-overlay { position: fixed; z-index: 400; inset: 0; overflow: hidden; pointer-events: none; }
.snowflake { position: absolute; top: -10px; left: var(--x); width: var(--size); height: var(--size); border-radius: 50%; background: currentColor; color: rgba(255,255,255,.65); animation: snow var(--duration) linear infinite; animation-delay: var(--delay); }
@keyframes snow { to { transform: translate3d(20px, calc(100vh + 20px), 0); } }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
    .metric-grid--four { grid-template-columns: repeat(4, 1fr); }
    .competition-grid { grid-template-columns: 240px minmax(0, 1fr); }
    .challenge-grid { grid-template-columns: 1fr; }
    .challenge-grid__filler { display: none; }
    .team-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
    :root { --header-height: 64px; }
    .site-header__inner { padding: 0 1rem; gap: 1rem; }
    .site-brand__year, .profile-menu__identity { display: none; }
    .primary-nav { order: 3; position: fixed; z-index: 90; right: 0; bottom: 0; left: 0; height: 58px; justify-content: space-around; border-top: 1px solid var(--border); background: var(--surface-1); }
    .primary-nav a { flex: 1; justify-content: center; padding: 0 .3rem; font-size: .7rem; }
    .primary-nav a[aria-current="page"]::after { top: -1px; right: 20%; bottom: auto; left: 20%; }
    .site-footer { margin-bottom: 58px; }
    .page-shell { width: min(calc(100% - 2rem), var(--content)); padding: 2.5rem 0 3.5rem; }
    .page-shell--wide { width: min(calc(100% - 2rem), var(--content-wide)); }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .page-heading__meta { flex-wrap: wrap; }
    .auth-shell { width: min(calc(100% - 2rem), 620px); min-height: auto; grid-template-columns: 1fr; gap: 2.5rem; padding: 2rem 0 4rem; }
    .auth-brand { margin-bottom: 3rem; }
    .auth-intro h1 { font-size: clamp(2.8rem, 13vw, 4.5rem); }
    .competition-grid { grid-template-columns: 1fr; }
    .standings-panel { position: static; }
    .ranking-list--compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ranking-list--compact .ranking-row:nth-child(2) { border-top: 0; }
    .ranking-list--compact .ranking-row:nth-child(even) { border-left: 1px solid var(--border); }
    .metric-grid, .metric-grid--four { grid-template-columns: repeat(2, 1fr); }
    .view-switcher { grid-template-columns: 1fr; gap: 1rem; }
    .inline-form { width: 100%; }
    .inline-form select { min-width: 0; flex: 1; }
    .class-grid, .two-column-grid { grid-template-columns: 1fr; }
    .definition-grid--three { grid-template-columns: repeat(2, 1fr); }
    .first-blood-panel { grid-template-columns: 48px minmax(0, 1fr); }
    .first-blood-panel dl { grid-column: 1 / -1; padding-top: .8rem; border-top: 1px solid var(--border); }
}

@media (max-width: 560px) {
    body { font-size: 14px; }
    .site-brand__mark { width: 28px; height: 28px; }
    .site-brand__name { font-size: .8rem; }
    .site-header__actions { gap: .35rem; }
    .profile-menu__trigger { min-height: 40px; padding: .25rem; }
    .profile-menu__avatar { width: 30px; height: 30px; }
    .profile-menu__chevron { display: none; }
    .profile-menu__popover { position: fixed; top: calc(var(--header-height) - 2px); right: .6rem; left: .6rem; width: auto; }
    .page-shell, .page-shell--wide { width: min(calc(100% - 1.25rem), var(--content)); padding-top: 1.8rem; }
    h1 { font-size: 2rem; }
    .site-footer { width: calc(100% - 1.25rem); flex-wrap: wrap; padding: 1.6rem 0; }
    .challenge-heading .countdown-block { min-width: 0; width: 100%; padding: .8rem 0 0; border-top: 1px solid var(--border); border-left: 0; }
    .ranking-list--compact { grid-template-columns: 1fr; }
    .ranking-list--compact .ranking-row:nth-child(2) { border-top: 1px solid var(--border); }
    .ranking-list--compact .ranking-row:nth-child(even) { border-left: 0; }
    .board-toolbar { align-items: flex-start; flex-direction: column; }
    .challenge-category__header { align-items: flex-start; }
    .challenge-card { min-height: 300px; padding: .9rem; }
    .answer-form { flex-direction: column; }
    .answer-form .button { width: 100%; }
    .metric-grid, .metric-grid--four { grid-template-columns: 1fr 1fr; }
    .metric { min-height: 110px; }
    .tab-content { padding: .8rem; }
    .profile-overview { align-items: flex-start; flex-direction: column; }
    .profile-overview__badges { justify-content: flex-start; }
    .definition-grid, .definition-grid--three { grid-template-columns: 1fr; }
    .profile-header { grid-template-columns: 58px minmax(0, 1fr); padding: 1rem; }
    .profile-header__avatar { width: 58px; height: 58px; font-size: 1.25rem; }
    .profile-header__identity h1 { font-size: 1.4rem; }
    .record-hero { grid-template-columns: 1fr; }
    .record-hero__score { align-items: flex-start; border-top: 1px solid var(--border); border-left: 0; }
    .first-blood-panel { grid-template-columns: 1fr; }
    .first-blood-panel dl { grid-column: auto; flex-direction: column; }
    .team-stat-grid { grid-template-columns: 1fr; }
    .state-schedule { grid-template-columns: 1fr; }
    .state-schedule div + div { border-top: 1px solid var(--border); border-left: 0; }
    .terms-modal__footer { align-items: stretch; flex-direction: column; }
    .terms-modal__footer .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
