:root {
  --bg: #F2F2F7; --card: #fff; --ink: #1D1D1F; --muted: #6E6E73; --line: #E5E5EA;
  --accent: #C2410C; --accent-dark: #9A3412; --accent-soft: #FDE7DC; --warm: #FEF3C7; --warm-ink: #854D0E;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { padding: env(safe-area-inset-top) 0 calc(84px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
main { max-width: 1000px; margin: 0 auto; }
.view { padding: 0 18px; }
.top { padding: 18px 2px 6px; }
.date { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; }
h1 { margin: 2px 0 0; font-size: 34px; font-weight: 700; }
#count { font-size: 13px; padding-bottom: 8px; }

.actions { display: flex; justify-content: space-between; margin: 16px 0; max-width: 420px; }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; width: 72px; font-size: 11.5px; }
.actions button span { width: 52px; height: 52px; border-radius: 16px; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.actions button:disabled { opacity: .4; }

.cols { display: grid; gap: 18px; }
@media (min-width: 760px) {
  .cols { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  #upnext { position: sticky; top: 12px; order: 2; }
}
#upnext { order: -1; }

.card-next { background: var(--accent); color: #fff; border-radius: 16px; padding: 16px; }
.card-next .k { font-size: 12px; font-weight: 600; opacity: .92; }
.card-next .t { font-size: 20px; font-weight: 700; margin: 4px 0 2px; }
.card-next .m { font-size: 13px; opacity: .92; }
.card-next .b { display: flex; gap: 8px; margin-top: 12px; }
.card-next .b button { flex: 1; height: 42px; border: 0; border-radius: 10px; font-size: 15px; }
.card-next .b .w { background: #fff; color: var(--accent-dark); font-weight: 600; }
.card-next .b .g { background: rgba(255,255,255,.2); color: #fff; }

.group { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 4px 6px; text-transform: uppercase; }
.group.hot { color: var(--accent); }
ul.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; border-bottom: 1px solid #EDEDF0; font-size: 16px; }
.row:last-child { border-bottom: 0; }
.row .title { flex: 1; min-width: 0; }
.row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row.done { color: #AEAEB2; }
.row.done .title { text-decoration: line-through; }
.chk { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid #AEAEB2; background: none; padding: 0; }
.row.done .chk { background: #AEAEB2; }
.day { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--warm); color: var(--warm-ink); }
.day.hot { background: var(--accent-soft); color: var(--accent-dark); }
.empty { padding: 14px; color: var(--muted); font-size: 15px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: rgba(249,249,251,.94);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: 1px solid #E0E0E5; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: #8E8E93; background: none; border: 0; width: 76px; }
.tabs button.on { color: var(--accent); }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-body { background: var(--card); width: 100%; max-width: 560px; border-radius: 14px 14px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.sheet-body:before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: #C7C7CC; margin: 0 auto 14px; }
.sheet h2 { margin: 2px 0; font-size: 24px; }
.sheet .k { font-size: 12px; font-weight: 600; color: var(--accent-dark); }
.sheet label, .pair label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 16px; text-transform: uppercase; }
textarea, input { width: 100%; margin-top: 8px; border: 1px solid #D9D9DE; border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; background: #fff; }
.ex { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #EDEDF0; font-size: 15px; font-style: italic; }
.ex span:first-child { width: 40px; flex: none; color: var(--muted); font-style: normal; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.btns button, button.primary, button.plain { flex: 1; height: 46px; border-radius: 12px; border: 1px solid #D9D9DE; background: #fff; font-size: 16px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; width: 100%; margin-top: 16px; }
button.primary:disabled, .btns button:disabled { opacity: .45; }
button.link { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 14px; }
button.danger { color: #B91C1C; }

.pair { max-width: 420px; margin: 0 auto; padding: 60px 24px; }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1D1D1F; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; z-index: 20; max-width: 90%; }