/* Colors and type from HorseSensei2 packages/design/src/tokens.ts. */
:root {
  --surface: #F4F1EA; --raised: #FCFBF8; --sunk: #F1EDE4;
  --border: #E4DFD3; --border-strong: #CFC8B7;
  --text: #1A1815; --text-2: #514B40; --text-faint: #67604F;
  --mark-faint: #9C9486;
  --accent: #337A57; --accent-text: #2B6349; --on-accent: #FCFBF8;
  --focus: #35566B; --danger: #A33520;
  --caution: #79591A; --caution-bg: #F6EBD3;
  --late-bg: #F7E1DA; --today-bg: #E3EFE8;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #121110; --raised: #1A1917; --sunk: #232220;
    --border: #2E2C28; --border-strong: #403D38;
    --text: #F2EFE8; --text-2: #B0A99C; --text-faint: #968F82;
    --mark-faint: #6E6759;
    --accent: #4E9E78; --accent-text: #74C79C; --on-accent: #121110;
    --focus: #8FB3C4; --danger: #EE8B72;
    --caution: #DDAA4C; --caution-bg: #2E2616;
    --late-bg: #3A1F18; --today-bg: #1D2E25;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font: 16px/1.35 var(--sans); letter-spacing: -0.011em;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 560px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(120px + env(safe-area-inset-bottom));
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Header */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
h1 { font-size: 30px; line-height: 34px; font-weight: 700; letter-spacing: -0.022em; margin: 0; }
.date { color: var(--text-faint); font-size: 15px; margin-top: 2px; }
.me {
  border: 1px solid var(--border-strong); background: var(--raised); border-radius: 999px;
  padding: 8px 14px; min-height: 40px; font-size: 15px; font-weight: 600; color: var(--text-2);
}
.banner { background: var(--sunk); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; color: var(--text-2); }
.banner.warn { background: var(--caution-bg); border-color: transparent; color: var(--caution); }
.banner button { background: none; border: 0; padding: 0; text-decoration: underline; color: inherit; font-weight: 600; }

/* Sections */
section { margin-top: 22px; }
h2 {
  font-size: 13px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); margin: 0 0 8px 4px; display: flex; gap: 8px; align-items: baseline;
}
h2 .count { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
h2.late { color: var(--danger); }
.list { background: var(--raised); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.empty { color: var(--text-faint); font-size: 15px; padding: 14px 16px; }

/* Rows */
.row { border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.line { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; min-height: 64px; }
.tick {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  border: 2px solid var(--border-strong); background: var(--raised);
  display: grid; place-items: center; padding: 0;
}
.tick svg { width: 24px; height: 24px; opacity: 0; }
.tick svg path { stroke: var(--on-accent); }
.tick:active { transform: scale(0.96); }
.row.is-done .tick { background: var(--accent); border-color: var(--accent); }
.row.is-done .tick svg { opacity: 1; }
.body { flex: 1; min-width: 0; background: none; border: 0; padding: 4px 0; text-align: left; }
.name { display: block; font-size: 16px; line-height: 21px; color: var(--text); overflow-wrap: anywhere; }
.sub { display: block; font-size: 13px; line-height: 18px; color: var(--text-faint); margin-top: 2px; }
.row.is-done .name { color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--mark-faint); }
.pill {
  flex: none; font: 500 13px/16px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  background: var(--sunk); color: var(--text-2); border-radius: 999px; padding: 5px 9px;
}
.pill.late { background: var(--late-bg); color: var(--danger); }
.pill.today { background: var(--today-bg); color: var(--accent-text); }
.row.is-failed { background: var(--caution-bg); }
.row.is-failed .sub { color: var(--caution); font-weight: 600; }
.more { padding: 0 16px 14px 66px; font-size: 15px; color: var(--text-2); }
.more p { margin: 0 0 10px; white-space: pre-wrap; }
.more a { color: var(--accent-text); font-weight: 600; }
.row.static .line { min-height: 52px; }
.row.static .tick { width: 28px; height: 28px; border-radius: 8px; margin: 0 8px; }
.row.static .tick svg { width: 16px; height: 16px; }

/* Add a job */
.add { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.add input {
  flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); padding: 0 12px; font-size: 16px;
}
.btn {
  min-height: 44px; border-radius: 12px; border: 0; padding: 0 16px; font-weight: 600;
  background: var(--accent-text); color: var(--on-accent);
}
.btn.quiet { background: var(--sunk); color: var(--text-2); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.5; }
.refresh { display: block; margin: 26px auto 0; }
.fineprint { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 10px; }

/* Setup */
.setup { max-width: 420px; margin: 8vh auto 0; }
.setup p { color: var(--text-2); }
.setup label { display: block; font-weight: 600; margin: 22px 0 8px; }
.setup input { width: 100%; min-height: 48px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--raised); padding: 0 14px; font-size: 17px; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.people button { min-height: 52px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--raised); font-weight: 600; font-size: 17px; }
.people button[aria-pressed="true"] { background: var(--accent-text); color: var(--on-accent); border-color: var(--accent-text); }
.setup .btn { width: 100%; margin-top: 26px; min-height: 52px; font-size: 17px; }
.err { color: var(--danger); font-weight: 600; margin-top: 12px; }

/* Undo bar */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom)); width: min(528px, calc(100% - 32px));
  background: var(--text); color: var(--surface); border-radius: 14px; padding: 8px 8px 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 6px 24px rgba(26, 24, 21, 0.25); font-size: 15px;
}
.toast[hidden] { display: none; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; color: var(--surface); font-weight: 700; text-decoration: underline; }
