:root {
  color-scheme: light dark;
  --bg: light-dark(#efeae0, #121614);
  --wash: light-dark(#e4f2e6, #1a2620);
  --card: light-dark(#fbf8f2, #1c221e);
  --ink: light-dark(#1b1914, #f3efe6);
  --muted: light-dark(#5c564c, #b1aa9e);
  --line: light-dark(#e0d8c8, #313830);
  --line-strong: light-dark(#c9c0b0, #4a554c);
  --accent: light-dark(#145c48, #d5f26a);
  --on-accent: light-dark(#f4fff8, #142006);
  --no-bg: light-dark(#f6e6d4, #3d3126);
  --no-fg: light-dark(#6d3e12, #f3d7bc);
  --tan: light-dark(#c4843a, #e0a15a);
  --hover: light-dark(#f3eee4, #262d28);
  --done-bg: light-dark(#e7f3ec, #17241c);
  --shadow: light-dark(0 1px 2px rgba(40, 30, 10, .06), 0 1px 2px rgba(0, 0, 0, .35));
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 280px at 0% -10%, var(--wash), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
}
h1, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}
.skip:focus { top: 12px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 56px; }
header { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.kicker {
  margin: 0 0 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.logo { width: 32px; height: 32px; flex: none; color: var(--accent); }
.lede { max-width: 52ch; margin-top: 8px; color: var(--muted); font-size: .95rem; }
.score {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 4px 16px;
  min-width: min(100%, 280px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow);
}
.score p { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.score strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}
.meter {
  grid-column: 1 / -1;
  display: flex;
  height: 8px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.meter span { display: block; height: 100%; width: 0; }
#meter-done { background: var(--accent); }
#meter-skip { background: var(--tan); }
.toolbar { display: grid; gap: 10px; margin: 22px 0 8px; }
#q {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 14px;
}
#q:focus-visible { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .btn, summary {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 12px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 8px;
  max-width: 100%;
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700; }
.btn.primary:hover, .chip:hover, .btn:hover, summary:hover { filter: brightness(1.03); }
.menu { position: relative; }
summary { list-style: none; display: inline-flex; align-items: center; }
summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 3;
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.menu-pop button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 8px;
  cursor: pointer;
}
.menu-pop button:hover { background: var(--hover); }
.statusline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 1.4em;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .85rem;
}
#toast:not(:empty) { color: var(--ink); font-weight: 600; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.grid5 {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 88px minmax(168px, 240px) 76px;
  column-gap: 14px;
  align-items: center;
}
.cols {
  padding: 12px 12px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.right { text-align: right; }
ul { list-style: none; margin: 0; padding: 0; }
.row { padding: 8px 12px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.cols + ul .row:first-child { border-top: 0; }
.row:hover { background: var(--hover); }
.row[data-mark="done"] { background: var(--done-bg); }
.row[data-mark="done"]:hover { background: var(--hover); }
.row[data-mark="skip"] .name { text-decoration: line-through; text-decoration-thickness: 1px; }
.row[data-tier="t1"] { box-shadow: inset 3px 0 0 var(--accent); }
.row[data-tier="t2"] { box-shadow: inset 3px 0 0 light-dark(#6e9a7c, #7eae8c); }
.row[data-tier="t3"] { box-shadow: inset 3px 0 0 light-dark(#d2b48c, #a68560); }
.row[data-tier="t4"] { box-shadow: inset 3px 0 0 var(--line-strong); }
.row[data-tier="platform"] { box-shadow: inset 3px 0 0 var(--ink); }
.row[data-tier="method"] { box-shadow: inset 3px 0 0 var(--tan); }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
}
.mark[data-state="done"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mark[data-state="skip"] { border-style: dashed; color: var(--muted); }
.who { min-width: 0; }
.name { font-weight: 600; letter-spacing: -.01em; }
.host {
  color: var(--muted);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row[data-tier="method"] .host { white-space: normal; }
.dr { text-align: right; }
.drn {
  font-family: var(--serif);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  letter-spacing: -.03em;
}
.bar {
  display: block;
  height: 3px;
  width: 100%;
  margin-top: 4px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.bar i { display: block; height: 100%; width: var(--p); background: var(--accent); }
.meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.push { margin-left: auto; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-do { background: var(--accent); color: var(--on-accent); }
.badge-no { background: var(--no-bg); color: var(--no-fg); }
.tier { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 600;
  justify-self: end;
}
.open:hover { border-color: var(--accent); color: var(--accent); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 12px; }
footer { margin-top: 22px; color: var(--muted); font-size: .82rem; }
footer a { color: inherit; }
kbd {
  font: 0.8em ui-monospace, monospace;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
@media (max-width: 720px) {
  header { flex-direction: column; align-items: stretch; }
  .menu-pop { position: static; margin-top: 6px; }
  .cols { display: none; }
  .row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "mark who dr" "mark meta open";
    row-gap: 4px;
    padding: 10px;
  }
  .mark { grid-area: mark; width: 44px; height: 44px; }
  .open { height: 40px; }
  .who { grid-area: who; }
  .dr { grid-area: dr; }
  .meta { grid-area: meta; justify-content: flex-start; flex-wrap: wrap; }
  .open { grid-area: open; }
}
@media (max-width: 480px) {
  .wrap { padding: 16px 12px 40px; }
  .score { min-width: 0; }
  .tools label { flex: 1 1 auto; }
  select { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
