:root {
  --bg: #f2f2f7; --card: #ffffff; --text: #111; --muted: #8a8a8e; --line: #e3e3e8; --accent: #0a84ff;
  --red: #ff453a; --yellow: #ffd60a; --indigo: #5e5ce6; --green: #30d158; --chip: #e9e9ee; --shadow: 0 1px 2px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f2f2f7; --muted: #8e8e93; --line: #2c2c2e; --chip: #2c2c2e; --shadow: none; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
#app { max-width: 760px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
.top { display: flex; align-items: center; gap: 8px; padding: 10px 0 4px; min-height: 48px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.top .sp { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 19px; color: var(--accent); }
.icon-btn.rec, .mic.rec { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 { font-size: 34px; margin: 6px 0 14px; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; }
h3.sec { font-size: 15px; color: var(--muted); margin: 22px 4px 6px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: .5px solid var(--line); width: 100%; text-align: left; }
.nav:last-child { border-bottom: 0; }
.nav .ic { width: 26px; text-align: center; font-size: 20px; }
.nav .cnt { margin-left: auto; color: var(--muted); }
.nav .cnt.red { color: var(--red); }
.nav::after { content: "›"; color: #c4c4c8; font-size: 22px; margin-left: 6px; }
.nav .cnt + ::after { margin-left: 6px; }
.row { display: flex; gap: 12px; padding: 11px 14px; border-bottom: .5px solid var(--line); align-items: flex-start; }
.row:last-child { border-bottom: 0; }
.row .main { flex: 1; min-width: 0; }
.ttl { word-break: break-word; }
.done .ttl { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 13px; color: var(--muted); align-items: center; }
.chip { background: var(--chip); border-radius: 10px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.chip.red { color: var(--red); }
.chk { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #b5b5ba; flex: none; margin-top: 1px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.chk.completed { background: var(--accent); border-color: var(--accent); }
.chk.canceled { border-color: var(--accent); color: var(--accent); }
.flag { margin-left: auto; font-size: 14px; flex: none; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
#addbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: .5px solid var(--line); z-index: 8; }
#addbar form { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
#addbar input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 22px; border: 0; background: var(--card); box-shadow: var(--shadow); outline: none; }
.mic { color: var(--accent); font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.fab { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); color: #fff; font-size: 26px; display: grid; place-items: center; flex: none; }
.fab.voice { background: var(--card); color: var(--accent); box-shadow: var(--shadow); font-size: 20px; }
.fab.voice.rec { color: var(--red); animation: pulse 1s infinite; }
/* лист редактирования */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 760px; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet .top { top: 0; padding-top: 14px; }
.sheet .title { font-weight: 600; }
.field { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: .5px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field input[type=text], .field textarea, .field input:not([type]) { flex: 1; border: 0; background: none; outline: none; min-width: 0; resize: none; }
.field textarea { min-height: 56px; }
.field label { color: var(--muted); min-width: 92px; }
.field select, .field input[type=date], .field input[type=time], .field input[type=number] { background: var(--chip); border: 0; border-radius: 8px; padding: 6px 8px; }
.field input[type=number] { width: 70px; }
.field.col { flex-wrap: wrap; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
.pill { background: var(--chip); border-radius: 16px; padding: 6px 12px; font-size: 15px; }
.pill.on { background: var(--accent); color: #fff; }
.btn { display: block; width: 100%; text-align: left; padding: 13px 14px; border-bottom: .5px solid var(--line); color: var(--accent); }
.btn:last-child { border-bottom: 0; }
.btn.danger { color: var(--red); }
.ck { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: .5px solid var(--line); }
.ck input[type=text] { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.ck .box { width: 22px; height: 22px; border-radius: 11px; border: 2px solid #b5b5ba; display: grid; place-items: center; color: #fff; font-size: 12px; flex: none; }
.ck .box.on { background: var(--accent); border-color: var(--accent); }
.h-row { display: flex; align-items: center; gap: 6px; margin: 22px 4px 6px; }
.h-row input { flex: 1; font-weight: 700; font-size: 17px; color: var(--accent); background: none; border: 0; outline: none; min-width: 0; }
.h-row button { color: var(--muted); font-size: 18px; width: 32px; height: 32px; }
.proj-head input.big { font-size: 28px; font-weight: 700; border: 0; background: none; outline: none; width: 100%; padding: 4px 0; }
.proj-head textarea { width: 100%; border: 0; background: none; outline: none; color: var(--muted); resize: none; min-height: 44px; }
.progress { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; margin: 6px 0 4px; }
.progress i { display: block; height: 100%; background: var(--accent); }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(40,40,44,.95); color: #fff; padding: 10px 16px; border-radius: 18px; font-size: 15px; z-index: 40; max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center; }
#toast.show { opacity: 1; }
.banner { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.banner b { display: block; margin-bottom: 4px; }
.small { font-size: 13px; color: var(--muted); }
.live { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--card); box-shadow: 0 4px 18px rgba(0,0,0,.2); border-radius: 22px; padding: 10px 16px; z-index: 30; max-width: 92vw; }

select { background: var(--card); border: 0; border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow); }
select[data-f=tagFilter] { max-width: 100%; }
