:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  color: #142842;
  background: #b9caff;
  --page-bg: #b9caff;
  --surface: #fffefa;
  --chart-bg: #ffffff;
  --ink: #142842;
  --accent: #ce3d56;
  --answer: #1d7877;
  --neutral-button: #eff1f3;
  --disabled-button: #dce1e7;
  --account-button: #fff5cc;
  --border: #d8e0e9;
  --grid: #dbe3ec;
  --muted: #566980;
  --focus: #523ca6;
}
:root[data-palette="mint"] {
  --page-bg: #bfe9d8;
  --surface: #fffdf6;
  --chart-bg: #ffffff;
  --ink: #17372f;
  --accent: #ad3557;
  --answer: #336fb3;
  --neutral-button: #edf2ed;
  --disabled-button: #dce4df;
  --account-button: #ffe4b5;
  --border: #cfded8;
  --grid: #d6e4dc;
  --muted: #496459;
  --focus: #7143a9;
}
:root[data-palette="peach"] {
  --page-bg: #f8d2bf;
  --surface: #fffdf9;
  --chart-bg: #ffffff;
  --ink: #39283d;
  --accent: #5948ab;
  --answer: #c64a45;
  --neutral-button: #f2eceb;
  --disabled-button: #e3d9db;
  --account-button: #fff0b5;
  --border: #e6d9d9;
  --grid: #e9dee2;
  --muted: #685b6c;
  --focus: #a6365d;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--page-bg); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page { max-width: 1020px; margin: 0 auto; padding: 16px 18px 36px; }
.site-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 16px; }
.brand-link { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-fallback { font-family: Georgia, Cambria, serif; font-size: clamp(1.9rem, 3vw, 2.45rem); line-height: 1; font-weight: 800; }
.brand-logo { display: none; position: relative; width: clamp(170px, 18vw, 205px); aspect-ratio: 852 / 267; }
.brand-logo-ink, .brand-logo-accent { position: absolute; inset: 0; mask-size: 100% 100%; mask-repeat: no-repeat; -webkit-mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; }
.brand-logo-ink { background: var(--ink); mask-image: url("assets/brand/wordmark-ink-mask.png"); -webkit-mask-image: url("assets/brand/wordmark-ink-mask.png"); }
.brand-logo-accent { background: var(--accent); mask-image: url("assets/brand/wordmark-accent-mask.png"); -webkit-mask-image: url("assets/brand/wordmark-accent-mask.png"); }
@supports (mask-image: url("assets/brand/wordmark-ink-mask.png")) or (-webkit-mask-image: url("assets/brand/wordmark-ink-mask.png")) {
  .brand-logo { display: block; }
  .brand-fallback { display: none; }
}
.main-nav { display: flex; align-items: center; justify-content: center; gap: 5px; }
.main-nav a { padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: color-mix(in srgb, var(--surface) 65%, transparent); }
.main-nav a[aria-current="page"] { font-weight: 700; }
.account-link { border: 0; border-radius: 10px; background: var(--account-button); padding: 10px 16px; color: var(--ink); font-weight: 650; white-space: nowrap; }
.panel { background: var(--surface); border: 0; border-radius: 18px; padding: 32px; }
.screen { min-height: 360px; }
h1 { margin: 0 0 10px; font-family: Georgia, Cambria, serif; font-size: clamp(1.85rem, 4vw, 2.45rem); line-height: 1.1; letter-spacing: -.025em; }
h2 { margin: 18px 0 8px; font-size: 1.12rem; }
p { line-height: 1.45; }
.eyebrow { margin: 0 0 7px; color: var(--ink); font-size: .76rem; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.small-note { color: var(--muted); font-size: .9rem; }
.lead { margin: 0 0 22px; color: var(--muted); }
.actions, .toolbar, .filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.actions { margin-top: 18px; }
.primary, .secondary, .tool, .filter { min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font-weight: 650; }
.primary { background: var(--accent); color: #fff; }
.secondary, .tool, .filter { background: var(--neutral-button); color: var(--ink); }
.resume-action { background: var(--account-button); }
.account-link[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--ink); }
.primary:disabled { background: var(--disabled-button); color: var(--muted); }
.secondary:disabled, .tool:disabled, .filter:disabled { color: var(--muted); opacity: .65; }
.primary:not(:disabled):hover, .account-link:hover { filter: brightness(.94); }
.secondary:not(:disabled):hover, .tool:not(:disabled):hover, .filter:not(:disabled):hover { border-color: var(--accent); }
.tool.active, .filter.active { background: var(--accent); color: #fff; }
.text-button { border: 0; padding: 5px 0; background: none; color: var(--accent); text-decoration: underline; }
.back-link { margin-bottom: 15px; font-weight: 650; }
.feature-card, .item-card, .empty-state { border: 1px solid var(--border); border-radius: 11px; padding: 17px; }
.feature-card h2, .item-card h2 { margin: 0 0 6px; }
.feature-card p { margin: 5px 0; }
.feature-card p:empty { display: none; }
#today { padding-block: 42px; text-align: center; }
#today .lead { margin-inline: auto; }
#today .feature-card { max-width: 560px; margin-inline: auto; padding: 22px; background: var(--chart-bg); }
#today .actions { justify-content: center; }
#today .actions .primary { min-width: 150px; }
.home-help { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; font-size: .9rem; }
.screen h1[tabindex="-1"]:focus { outline: none; }
.item-list { display: grid; gap: 10px; margin-top: 17px; }
.item-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.item-card > div { min-width: 0; }
.item-card p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.item-card .secondary, .item-card .primary { white-space: nowrap; }
.filter-row { margin: 18px 0 10px; }
.steps { padding-left: 23px; max-width: 670px; }
.steps li { padding-left: 4px; margin: 12px 0; line-height: 1.55; }
.account-form { display: grid; gap: 12px; max-width: 390px; margin: 14px 0; }
.account-form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 650; }
.account-form input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.account-form .primary { justify-self: start; }
.status { min-height: 1.2em; color: var(--muted); }
.status:empty, #sync-status:empty { display: none; }
.settings-block { margin-top: 24px; }
.settings-block h2 { margin-top: 26px; }
.settings-block .filter-row { margin-top: 7px; }
.settings-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); }
.settings-links a { display: inline-flex; align-items: center; min-height: 44px; }
.palette-options .palette-option { border-color: transparent; }
.palette-option[data-palette="periwinkle"] { background: #b9caff; color: #142842; }
.palette-option[data-palette="mint"] { background: #bfe9d8; color: #17372f; }
.palette-option[data-palette="peach"] { background: #f8d2bf; color: #39283d; }
.palette-options .palette-option.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.round-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.round-heading h1 { margin: 8px 0 0; font-size: clamp(1.55rem, 3.6vw, 2.25rem); }
.round-progress { display: flex; align-items: center; gap: 13px; }
.round-progress .eyebrow { margin: 0; }
.round-dots { display: inline-flex; align-items: center; gap: 8px; }
.round-dots span { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--border); }
.round-dots span.done { background: var(--ink); }
.round-dots span.current { background: var(--accent); }
.unit-switch { border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; color: var(--ink); background: var(--neutral-button); font-size: .85rem; font-weight: 650; white-space: nowrap; }
.unit-switch:hover { border-color: var(--accent); }
.toolbar { margin-top: 19px; }
.toolbar-space { flex: 1; }
.chart-wrap { border: 1px solid var(--border); border-radius: 12px; background: var(--chart-bg); overflow: hidden; margin-top: 10px; }
#chart { width: 100%; height: auto; display: block; touch-action: none; user-select: none; cursor: crosshair; }
#chart:focus-visible { outline-offset: -4px; }
.keyboard-hint { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
#chart:focus-visible[role="application"] + .keyboard-hint { position: static; width: auto; height: auto; margin: 10px 14px; overflow: visible; clip: auto; white-space: normal; font-size: .85rem; color: var(--muted); }
#chart .keyboard-guide { stroke: var(--focus); }
#chart .keyboard-cursor { fill: var(--chart-bg); fill-opacity: .65; stroke: var(--focus); }
#chart text { font-family: system-ui, -apple-system, Segoe UI, sans-serif; }
#chart .chart-background { fill: var(--chart-bg); }
#chart .grid-line { stroke: var(--grid); }
#chart .axis-label, #chart .axis-title { fill: var(--ink); }
#chart .player-line { stroke: var(--accent); }
#chart .player-point { fill: var(--accent); }
#chart .start-dot { fill: var(--accent); stroke: var(--chart-bg); }
#chart .start-value { fill: var(--accent); }
#chart .answer-line { stroke: var(--answer); }
#chart .answer-label { fill: var(--answer); }
#chart .player-label { fill: var(--accent); }
.result { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }
.result-score, .complete-score-block { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.result h2 { margin-top: 18px; font-family: Georgia, Cambria, serif; font-size: 1.35rem; }
.result p { max-width: 70ch; }
.result details { margin: 18px 0 14px; border-top: 1px solid var(--border); padding-top: 15px; }
.result summary { width: fit-content; cursor: pointer; font-weight: 650; border-radius: 10px; padding: 9px 13px; background: var(--neutral-button); }
.result summary:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.result ol { padding-left: 23px; }
.result li { margin: 7px 0; line-height: 1.45; }
.main-score, .complete-score { color: var(--accent); font-family: Georgia, Cambria, serif; font-size: clamp(2.8rem, 6vw, 3.5rem); font-weight: 800; line-height: 1; letter-spacing: -.045em; }
.score-caption { color: var(--muted); font-size: .96rem; font-weight: 650; }
.complete-score-block { margin: 16px 0 20px; }
#first-score-note:empty { display: none; }
#complete-rounds .item-card { min-height: 88px; }
#complete-rounds .item-card h2 { font-size: 1.05rem; }
#complete-rounds .round-score { color: var(--accent); font-size: 1.2rem; font-weight: 750; }
.source { color: var(--muted); font-size: .86rem; }
.site-footer { display: flex; justify-content: flex-end; margin: 18px 0; font-size: .82rem; }
.debug { background: var(--surface); }
.debug pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .78rem; line-height: 1.5; }
.editor-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 22px; margin-top: 18px; }
.editor-sidebar { border-right: 1px solid var(--border); padding-right: 15px; }
.editor-sidebar h2 { margin-top: 0; }
.editor-sidebar .item-card { padding: 10px; flex-direction: column; align-items: stretch; }
.editor-sidebar .item-card h2 { font-size: .92rem; }
.editor-main { min-width: 0; }
.editor-main details { margin: 14px 0; }
.editor-main summary { cursor: pointer; font-weight: 650; }
.editor-main label { display: grid; gap: 5px; margin: 10px 0; font-size: .9rem; font-weight: 650; }
.editor-main input, .editor-main select, .editor-main textarea { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 9px; background: var(--chart-bg); color: inherit; }
.editor-main textarea { resize: vertical; font-family: inherit; }
.editor-main textarea[spellcheck="false"] { font-family: ui-monospace, Consolas, monospace; font-size: .84rem; }
.editor-fields { border: 1px solid var(--border); border-radius: 8px; margin: 18px 0; padding: 9px 15px 15px; }
.editor-fields legend { padding: 0 6px; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.editor-preview { border-top: 1px solid var(--border); margin-top: 25px; padding-top: 8px; }
.editor-preview svg { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
.editor-preview svg .preview-grid { stroke: var(--grid); }
.editor-preview svg .preview-label { fill: var(--ink); }
.editor-preview svg .preview-answer { stroke: var(--answer); }
.editor-preview svg .preview-start { fill: var(--accent); }
.editor-checks { margin-top: 18px; }
.editor-checks details { margin: 6px 0; border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; }
.editor-checks summary { cursor: pointer; font-weight: 650; }
.editor-checks ul { margin: 6px 0; padding-left: 22px; }
.editor-checks li { margin: 4px 0; }
.editor-checks .errors { color: #9d2525; }
.editor-checks .warnings { color: #7b5916; }
@media (max-width: 700px) {
  .page { padding: 13px 10px 30px; }
  .site-header { grid-template-columns: 1fr auto; gap: 9px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
  .main-nav a { min-height: 44px; }
  .panel { padding: 17px; }
  #today { padding-block: 28px; }
  .item-card { padding: 14px; }
  .item-card h2 { font-size: 1rem; line-height: 1.4; }
  .item-card button { flex-shrink: 0; }
  #complete-rounds .item-card { flex-direction: row; align-items: center; }
  #complete-rounds .item-card button { align-self: auto; }
  .toolbar-space { flex-basis: 100%; }
  .round-heading { flex-direction: column; }
  .actions button { flex: 1 1 auto; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 14px; }
  .field-grid { grid-template-columns: 1fr; }
}
