:root {
  --bg: #14110f;
  --panel: #1f1a17;
  --panel-2: #2a2420;
  --line: #3a322c;
  --ink: #f4ede4;
  --muted: #a89a8c;
  --amber: #f2a93b;
  --amber-ink: #1a1208;
  --red: #e2574c;
  --green: #6cc28a;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }
a { color: var(--amber); }
h1 { font-size: 26px; line-height: 1.15; margin: 4px 0 2px; letter-spacing: -0.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 28px 0 10px; font-weight: 600; }
p { margin: 6px 0; }
.sub { color: var(--muted); font-size: 14px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand { font-weight: 800; letter-spacing: 0.14em; font-size: 12px; text-transform: uppercase; color: var(--amber); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.brand::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.hot { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }

label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=number], input[type=date], input[type=password], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 48px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

button, .btn {
  font: inherit; font-weight: 650; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  border-radius: 10px; padding: 0 14px; min-height: 44px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button.primary, .btn.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); width: 100%; min-height: 52px; font-size: 17px; margin-top: 16px; }
button.danger { color: var(--red); }
button.small { min-height: 36px; padding: 0 10px; font-size: 14px; }
button:disabled { opacity: 0.45; cursor: default; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 0; padding: 12px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--amber); }
.toggle span { font-size: 15px; color: var(--ink); }
.toggle small { display: block; color: var(--muted); font-size: 13px; }

/* the list */
ol.list { list-style: none; margin: 0; padding: 0; }
ol.list li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
ol.list li:last-child { border-bottom: 0; }
.num { width: 28px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.who { flex: 1; min-width: 0; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); }
li.up { background: linear-gradient(90deg, rgba(242,169,59,0.16), transparent); border-radius: 10px; }
li.up .num { color: var(--amber); }
li.done .who b, li.noshow .who b { color: var(--muted); }
li.noshow .who b { text-decoration: line-through; }
li.me .who b::after { content: " (you)"; color: var(--amber); font-weight: 500; }
.chip { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.chip.up { background: var(--amber); color: var(--amber-ink); }
.chip.done { color: var(--green); }
.chip.noshow { color: var(--red); }
.chip.notes { background: transparent; border: 1px solid var(--line); }

.big { font-size: 44px; font-weight: 800; line-height: 1; color: var(--amber); }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }

/* notes */
.targets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.targets button { flex: 0 0 auto; border-radius: 99px; }
.targets button[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tags button { min-height: 56px; flex-direction: column; gap: 0; font-size: 15px; }
.tags button small { font-weight: 400; color: var(--muted); font-size: 12px; }
.tags button[aria-pressed=true] { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.tags button[aria-pressed=true] small { color: var(--amber-ink); }

.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tagline .chip { background: var(--panel-2); color: var(--ink); }
.group h3 { margin: 18px 0 4px; font-size: 16px; }

/* host */
.hostrow { flex-wrap: wrap; }
.hostrow .ctrls { display: flex; gap: 6px; width: 100%; padding-left: 40px; flex-wrap: wrap; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 180px; margin: 0 auto; cursor: zoom-in; }
.qr img { width: 100%; display: block; }
.qr.full { position: fixed; inset: 0; width: auto; margin: 0; border-radius: 0; display: flex; align-items: center; justify-content: center; z-index: 10; cursor: zoom-out; }
.qr.full img { width: min(90vw, 90vh); }
.tabs { display: flex; gap: 8px; margin: 16px 0 4px; }
.tabs button { flex: 1; }
.tabs button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.linkbox { display: flex; gap: 8px; align-items: center; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); background: var(--panel-2); padding: 10px; border-radius: 8px; }

.board li .count { font-weight: 800; font-variant-numeric: tabular-nums; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 8px; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 99px; font-weight: 650; opacity: 0; transition: .2s; pointer-events: none; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { margin-top: 32px; text-align: center; font-size: 14px; }
.targets.wrap { flex-wrap: wrap; overflow: visible; }

/* --- v3: timer, rhythm notes, undo, set list rows --- */
.clock { font-variant-numeric: tabular-nums; font-weight: 800; }
.clock.chip { background: var(--panel-2); color: var(--ink); }
.clock.light { background: var(--amber); color: var(--amber-ink); }
.clock.over { background: var(--red); color: #fff; }
.big-clock { display: block; font-size: 52px; line-height: 1.1; padding: 6px 12px; border-radius: 12px; text-align: center; background: var(--panel-2); }
.big-clock.light { background: var(--amber); color: var(--amber-ink); }
.big-clock.over { background: var(--red); color: #fff; }
.timer .tname { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.nline { margin: 2px 0; }
.nlabel { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.ask { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border-left: 3px solid var(--amber); }
.ask .nlabel { display: block; margin-bottom: 2px; }
button.laugh { width: 100%; margin-top: 12px; min-height: 48px; }
button.laugh[aria-pressed=true] { background: var(--green); color: #0d1a12; border-color: var(--green); }
button.small.on { color: var(--green); border-color: var(--green); }
.fromrow { align-items: flex-end; }
.fromrow > div { flex: 1 1 auto; }
.toggle.mini { flex: 0 0 auto; margin: 0; min-height: 48px; padding: 0 12px; gap: 8px; }
#undo { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); display: flex; gap: 12px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 8px 8px 8px 16px; border-radius: 99px; font-weight: 650; opacity: 0; transition: .2s; pointer-events: none; z-index: 30; max-width: 92vw; }
#undo.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#undo button { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.jrow { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.jfields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.jfields input { min-height: 44px; }
.jrow > button { margin-top: 4px; }
