:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --surface: #fff;
  --text: #1c1b19;
  --muted: #5e5a54;
  --faint: #8a847b;
  --line: #e4e0d8;
  --accent: #1f4fd8;
  --accent-soft: #e8eefc;
  --spoiler: #f3f1ec;
  --ok: #0f6b45;
  --ok-soft: #e5f4ec;
  --warn: #9a5b00;
  --sans: ui-sans-serif, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1e1e1c;
    --text: #f2efe8;
    --muted: #b7b1a6;
    --faint: #8d877d;
    --line: #32302c;
    --accent: #8eafff;
    --accent-soft: #24304a;
    --spoiler: #262622;
    --ok: #7dcca8;
    --ok-soft: #1a2e24;
    --warn: #e0b060;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}
a { color: var(--accent); }
a:hover { text-decoration: none; }
.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 24px;
}
.topbar a { text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar .right { display: flex; gap: 14px; align-items: center; }
.sync[data-state="synced"] { color: var(--ok); }
.sync[data-state="error"] { color: var(--warn); }
h1 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 8px;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 4px;
}
p { margin: 0 0 12px; }
.lead, .note, .blurb { color: var(--muted); }
.stats {
  display: flex;
  gap: 28px;
  margin: 20px 0 16px;
}
.stat b {
  display: block;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.stat span {
  color: var(--faint);
  font-size: 13px;
  font-family: var(--sans);
}
.callout {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 8px 0;
}
.callout strong { display: block; margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; }
.lists {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.list-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
}
.list-card:hover { border-color: var(--accent); }
.list-card h3 { margin: 0 0 4px; color: var(--accent); }
.list-card p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
}
.bar-label {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { font-size: 15px; margin: 0 0 8px; }
.links { font-family: var(--sans); font-size: 14px; }
.links a { margin-right: 14px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
.filters button, .task-head, summary { font-family: var(--sans); }
.filters button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}
.filters button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.task {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.task.solved .name { color: var(--ok); }
.task input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  accent-color: var(--ok);
}
.task-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.name {
  font-weight: 600;
  text-decoration: none;
}
.name:hover { text-decoration: underline; }
.meta {
  color: var(--faint);
  font-size: 13px;
  font-family: var(--sans);
}
.level {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
}
.helps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: flex-start;
  margin-top: 8px;
}
.helps details[open] { flex-basis: 100%; }
details.spoiler summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  user-select: none;
}
details.spoiler summary::-webkit-details-marker { display: none; }
details.spoiler summary .when-open { display: none; }
details.spoiler[open] summary .when-closed { display: none; }
details.spoiler[open] summary .when-open { display: inline; }
details.spoiler .panel {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--spoiler);
  border-radius: 6px;
}
details.spoiler .panel p { margin: 0 0 8px; }
details.spoiler .panel p:last-child { margin-bottom: 0; }
details.spoiler .label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.list-card .this-week {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
}
.level.now {
  color: var(--accent);
  font-weight: 600;
}
.task:target { scroll-margin-top: 16px; }
.contest-tasks {
  margin-top: 4px;
  font-size: 15px;
}
.contest-tasks a { text-decoration: none; }
.contest-tasks a:hover { text-decoration: underline; }
.overlap {
  margin: 6px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--warn);
}
.contest-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}
.score input {
  width: 72px;
  margin: 0 4px;
  padding: 2px 6px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.section.hidden { display: none; }
.after { margin-top: 8px; }
.missing { color: var(--muted); }
@media (max-width: 640px) {
  .sources { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
}
