:root {
  --bg: #f6f7f8; --card: #fff; --ink: #1c2328; --mute: #66727c; --line: #e1e5e8;
  --brand: #0e7c86; --brand-ink: #fff; --soft: #e3f3f4; --warn: #b4540a; --ok: #1d7a43; --bad: #b3261e;
  --r: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12171a; --card: #1b2227; --ink: #e8edf0; --mute: #98a5ae; --line: #2b353b; --brand: #3bb3bd; --brand-ink: #06262a;
          --soft: #173238; --warn: #e8a15a; --ok: #5fcb8a; --bad: #f08a83; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hd { padding: 20px 0 8px; }
.hd h1 { font-size: 1.6rem; }
.sub { color: var(--mute); font-size: .92rem; margin-top: 2px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 12px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--brand); }
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; background: var(--bg); padding: 8px 0; margin: 0 -4px; overflow-x: auto; }
.tabs button { flex: 1; min-width: max-content; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; color: var(--mute); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--soft); color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.item { display: grid; grid-template-columns: 40px 1fr; gap: 10px; cursor: pointer; }
.item .ico { font-size: 1.6rem; text-align: center; line-height: 1.2; }
.item h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.item .meta { color: var(--mute); font-size: .88rem; margin-top: 2px; overflow-wrap: anywhere; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--brand); margin-right: 4px; font-weight: 600; }
.tag.planned { background: #fdebd6; color: var(--warn); } .tag.done { background: #dcf3e5; color: var(--ok); } .tag.skipped { background: var(--line); color: var(--mute); }
@media (prefers-color-scheme: dark) { .tag.planned { background: #3a2a14; } .tag.done { background: #15301f; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.vote { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 10px; font-size: .9rem; }
.vote[aria-pressed="true"] { background: var(--soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.primary { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); border-radius: 12px; padding: 10px 14px; }
.fab { position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; font-size: 2rem; line-height: 1; box-shadow: 0 6px 18px rgba(0,0,0,.3); padding: 0; }
.empty { text-align: center; color: var(--mute); padding: 36px 12px; }
.day h2 { font-size: 1.05rem; margin: 18px 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.day h2 small { color: var(--mute); font-weight: 500; }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat .card { margin: 0; } .stat b { display: block; font-size: 1.35rem; } .stat span { color: var(--mute); font-size: .85rem; }
.rowbar { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; margin: 6px 0; font-size: .92rem; }
.rowbar .bar { margin: 0; }
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 18px; padding: 0; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog form { padding: 16px; display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--mute); font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.link { display: flex; gap: 8px; } .link input { font-size: .85rem; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 8px 0; }
.banner { background: #fdebd6; color: #7a3a00; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: .9rem; }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.on { opacity: 1; }
.home { padding-top: 40px; } .home h1 { font-size: 2rem; margin-bottom: 6px; }

[hidden] { display: none !important; }
