:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --card: #151924;
  --line: #262c3a;
  --fg: #f4f1ea;
  --dim: #a3a9b6;
  --accent: #ffbf6e;
  --good: #7ddc9a;
  --bad: #ff7a6b;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; }
[hidden] { display: none !important; }
h1 { font-size: 30px; margin: 0; letter-spacing: -.01em; }
.top h1 { font-size: 24px; white-space: nowrap; }
h2 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.sub { color: var(--dim); margin: 4px 0 0; font-size: 15px; }
.error { color: var(--bad); }

input, textarea, select, button { font: inherit; color: inherit; border-radius: 12px; }
input, textarea, select { width: 100%; background: #0f131c; border: 1px solid var(--line); padding: 12px 14px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { background: var(--accent); color: #17120a; border: 0; padding: 12px 18px; font-weight: 650; cursor: pointer; }
button:active { transform: scale(.98); }
button.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); }
.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.row > input, .row > select { flex: 1; min-width: 0; }
form.row { margin-top: 0; }
.check { display: flex; align-items: center; gap: 6px; color: var(--dim); white-space: nowrap; }
.check input { width: auto; }

#login { text-align: center; padding-top: 18vh; }
#login .logo { width: 84px; height: 84px; border-radius: 20px; }
#login form { margin-top: 28px; display: grid; gap: 12px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 22px 2px 16px; }
.chip { flex: none; margin-left: 12px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); margin-right: 7px; vertical-align: 1px; }
.dot.on { background: var(--good); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }

.person { margin-top: 14px; }
.person:first-child { margin-top: 0; }
.person-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.person-head .bar { width: 5px; height: 18px; border-radius: 3px; background: var(--c, var(--accent)); }
.person-head .meta { margin-left: auto; color: var(--dim); font-weight: 600; font-size: 14px; }
.chore { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #0f131c; color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 8px; font-weight: 500; }
.chore .box { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--dim); display: grid; place-items: center; }
.chore.done { color: var(--dim); }
.chore.done .title { text-decoration: line-through; }
.chore.done .box { background: var(--good); border-color: var(--good); }
.chore.done .box::after { content: ""; width: 10px; height: 6px; border: solid #0b0d12; border-width: 0 0 3px 3px; transform: translateY(-1px) rotate(-45deg); }
.empty { color: var(--dim); margin: 0; }

ul { list-style: none; margin: 12px 0 0; padding: 0; }
#notes li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
#notes li .text { flex: 1; }
#notes li .meta { display: block; color: var(--dim); font-size: 13px; margin-top: 2px; }
#notes li button { padding: 6px 12px; background: transparent; color: var(--bad); border: 1px solid var(--line); font-size: 14px; }
#agenda li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
#agenda li .when { color: var(--accent); width: 92px; flex: none; font-weight: 600; }
#cal-refresh { margin-top: 12px; }

footer { text-align: center; margin-top: 8px; }

dialog { background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); width: min(92vw, 420px); padding: 18px; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog form { display: grid; gap: 10px; }
#who-list { display: flex; flex-wrap: wrap; gap: 8px; }
#who-list button { background: #0f131c; color: var(--fg); border: 1px solid var(--line); }
#who-list button.on { border-color: var(--accent); color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #222838;
  border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; font-size: 15px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
