#marathonDialog {
  color-scheme: dark;
  --panel: var(--tool-panel);
  --edge: var(--tool-border);
  --text: #f1f1f4;
  --muted: #aeb3c0;
  --gold: #ffad83;
  --green: #8be1a8;
}
.marathon-window *, .marathon-window *::before, .marathon-window *::after { box-sizing: border-box; }
.marathon-window [hidden] { display: none !important; }
.marathon-window :is(h3, #tracker h2, #tracker p) { margin: 0; }
.marathon-window #tracker h2 { font-size: 1.2rem; }
.marathon-window .hint { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.marathon-window .panel { padding: clamp(1rem, 3vw, 1.4rem); border: 1px solid var(--edge); border-radius: 1rem; background: var(--panel); }
.marathon-window .character-controls, .marathon-window .task-fields, .marathon-window .actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.marathon-window .character-controls { margin-block: .85rem; gap: 1rem; }
.marathon-window .character-controls > *, .marathon-window .task-fields > * { flex: 1 1 12rem; min-width: 0; }
.marathon-window .character-controls form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; flex-grow: 2; }
.marathon-window .character-controls form label { flex: 1 1 10rem; min-width: 0; }
.marathon-window label { display: grid; gap: .4rem; font-weight: 600; font-size: .875rem; }
.marathon-window input, .marathon-window textarea, .marathon-window select, .marathon-window button:not(:where(.marathon-close)) { font: inherit; border-radius: .55rem; min-height: 2.75rem; }
.marathon-window input, .marathon-window textarea, .marathon-window select { width: 100%; padding: .6rem .75rem; background: #12141d; color: var(--text); border: 1px solid #505366; }
.marathon-window textarea { resize: vertical; }
.marathon-window button:not(:where(.marathon-close)) { cursor: pointer; padding: .55rem .8rem; font-weight: 700; color: #261912; border: 1px solid transparent; background: var(--gold); }
.marathon-window button:not(:where(.marathon-close)):hover { filter: brightness(1.12); }
.marathon-window .secondary { background: #262938; color: var(--text); border-color: #505366; }
.marathon-window :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.marathon-window #character-tasks, .marathon-window #task-form, .marathon-window #tasks { display: grid; gap: .85rem; }
.marathon-window #character-tasks { margin-top: .85rem; }
.marathon-window #task-form { margin-top: .85rem; }
.marathon-window .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.marathon-window .stats span { color: var(--muted); font-size: .8rem; display: block; }
.marathon-window .stats strong { display: block; margin-top: .3rem; font-size: clamp(1rem, 3vw, 1.45rem); overflow-wrap: anywhere; }
.marathon-window .stats > :last-child strong, .marathon-window .reward { color: var(--gold); }
.marathon-window .section-title { margin-block: .65rem .85rem; }
.marathon-window .section-title .hint { margin-top: .25rem; }
.marathon-window .empty, .marathon-window .notice { margin-block: .85rem; padding: 1rem; border: 1px dashed var(--edge); border-radius: .75rem; color: var(--muted); }
.marathon-window .notice { color: #ffd4c4; border-color: #ae655e; }
.marathon-window .task-top, .marathon-window .progress-caption { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .5rem 1rem; }
.marathon-window .task h3 { font-size: 1.08rem; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; flex: 1 1 16rem; }
.marathon-window .reward, .marathon-window .progress-caption { font-size: .85rem; }
.marathon-window .progress-caption { color: var(--muted); margin-top: .85rem; }
.marathon-window .done .task-status { color: var(--green); }
.marathon-window progress { display: block; width: 100%; height: .6rem; margin-block: .4rem .8rem; border: 0; border-radius: 1rem; background: #333747; overflow: hidden; accent-color: var(--green); }
.marathon-window progress::-webkit-progress-bar { background: #333747; }
.marathon-window progress::-webkit-progress-value { background: var(--green); }
.marathon-window progress::-moz-progress-bar { background: var(--green); }
.marathon-window .days { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: .35rem; margin-bottom: .85rem; }
.marathon-window .days button { padding-inline: .2rem; background: #262938; color: var(--text); border-color: #505366; font-variant-numeric: tabular-nums; }
.marathon-window .days button[aria-pressed="true"] { background: #234639; color: #d6f9e2; border-color: #65b582; }
.marathon-window .days button[aria-pressed="true"]::after { content: " ✓"; }
@media (max-width: 34rem) {
  .marathon-window .stats { grid-template-columns: 1fr; }
  .marathon-window .stats .panel { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .75rem; }
  .marathon-window .stats strong { margin: 0; text-align: end; }
}
