:root {
  --bg: #f6f6f4; --card: #fff; --text: #1a1a1a; --muted: #777; --line: #e6e6e2; --accent: #1a1a1a; --accent-text: #fff;
  --hi: #d6453d; --med: #e0a030; --lo: #4a9d6a; --warn: #c0392b; --ok: #2f8f5b;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --card: #1d1d1d; --text: #ececec; --muted: #9a9a9a; --line: #2e2e2e; --accent: #f0f0f0; --accent-text: #111; --warn: #ff7b6e; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: 1.35rem; margin: 2px 0 0; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; }
.warn { color: var(--warn); }
.boot, .empty, .hint { color: var(--muted); text-align: center; }
.hint { text-align: left; font-size: .85rem; }
.error { color: var(--warn); }

.app { max-width: 680px; margin: 0 auto; padding: 14px 14px 110px; padding-top: max(14px, env(safe-area-inset-top)); }
@media (min-width: 1024px) { .app { max-width: 760px; } }
.top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.date { color: var(--muted); font-size: .85rem; }
.hbtns { display: flex; gap: 2px; }
.icon { background: none; border: 0; font-size: 1.2rem; padding: 8px; border-radius: 10px; }
.icon:hover { background: var(--line); }
.icon.live { background: var(--hi); }
.icon:disabled { opacity: .35; }

.progress { position: relative; height: 22px; background: var(--line); border-radius: 11px; overflow: hidden; margin-bottom: 10px; }
.progress div { position: absolute; inset: 0 auto 0 0; background: var(--ok); opacity: .35; transition: width .3s; }
.progress span { position: relative; font-size: .75rem; line-height: 22px; padding-left: 10px; }

.input { width: 100%; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; outline: none; }
.input:focus { border-color: var(--accent); }
.input.num { width: 64px; display: inline-block; padding: 6px 8px; }
select.input { width: auto; display: inline-block; padding: 6px 8px; }
.search { margin-bottom: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .85rem; }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.filter { margin-top: 0; }

.tabs { display: flex; border-bottom: 1px solid var(--line); margin-top: 8px; }
.tabs button { flex: 1; padding: 10px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs button.on { color: var(--text); border-color: var(--accent); font-weight: 600; }

ul { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; }
.row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.row .main { flex: 1; min-width: 0; cursor: pointer; }
.row .title { font-weight: 500; overflow-wrap: anywhere; }
.row.is-done .title { text-decoration: line-through; color: var(--muted); }
.meta { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--med); display: inline-block; }
.dot.hi { background: var(--hi); } .dot.lo { background: var(--lo); }
.slots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }
.slot { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: none; font-size: .8rem; }
.slot.done { background: var(--ok); color: #fff; border-color: var(--ok); }
.slot:disabled { opacity: .5; cursor: default; }
.row.standing { background: color-mix(in srgb, var(--med) 10%, var(--card)); }

.bar { flex-wrap: wrap; position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; align-items: center; padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); max-width: 680px; margin: 0 auto; }
@media (min-width: 1024px) { .bar { max-width: 760px; } }
.btn { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger { color: var(--warn); }
.btn.big { padding: 14px 24px; font-size: 1.05rem; }
.btn:disabled { opacity: .4; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--accent); color: var(--accent-text); padding: 10px 16px; border-radius: 10px; max-width: 90%; font-size: .9rem; z-index: 99; }

.login { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 20px; }

dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; background: var(--card); color: var(--text);
  border-radius: 18px 18px 0 0; margin: auto auto 0; overflow: auto; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .45); }
@media (min-width: 768px) { dialog.sheet { margin: auto; border-radius: 18px; } }
dialog.sheet header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.body { padding: 14px 16px 18px; }
.form { display: flex; flex-direction: column; gap: 8px; }
label { font-size: .8rem; color: var(--muted); display: block; margin-top: 4px; }
label .input { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.every { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.times { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.timebox { display: inline-flex; align-items: center; }
.timebox .input { width: 120px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.lead { margin: 0 0 8px; }
.evrow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.repline { margin: 2px 0; color: var(--muted); font-size: .9rem; }
textarea.input { resize: vertical; }

.aivoice { flex-basis: 100%; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.aivoice input { width: 16px; height: 16px; accent-color: var(--accent); }
.aivoice span { opacity: .8; }
@media (max-width: 420px) { .aivoice span { display: none; } }
.app { padding-bottom: 130px; }

.actions.left { justify-content: flex-start; margin-top: 6px; }
.banner { display: block; width: 100%; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--med); border-radius: 10px; background: color-mix(in srgb, var(--med) 14%, var(--card)); text-align: left; font-size: .85rem; }
