:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #7c9cff;
  --danger: #ff6b6b;
  --ok: #4fd18b;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; background: var(--accent); color: #0b0d12; font-weight: 600; padding: 10px 16px; }
button.ghost { background: transparent; color: var(--muted); padding: 8px 10px; font-weight: 500; }
button.ghost:hover { color: var(--text); }
input { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; outline: none; width: 100%; }
input:focus { border-color: var(--accent); }

.screen { max-width: 720px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }

/* вход */
#login { display: grid; place-items: center; min-height: 100dvh; }
.login-card { width: 100%; max-width: 340px; display: grid; gap: 12px; text-align: center; }
.logo { width: 72px; height: 72px; margin: 0 auto; border-radius: 20px; background: var(--surface); display: grid; place-items: center; font-size: 40px; font-weight: 800; color: var(--accent); }
.logo span, .brand span { color: #fff; }
.login-card h1 { margin: 4px 0 8px; font-size: 22px; }
.error { color: var(--danger); min-height: 1.4em; margin: 0; font-size: 14px; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.top-actions { display: flex; gap: 4px; }

.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #232a44; border: 1px solid #34406a; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.banner button { flex-shrink: 0; }

/* ввод */
.add { display: flex; gap: 8px; margin-bottom: 20px; position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 6px 0; }
.add button { width: 50px; flex-shrink: 0; font-size: 20px; padding: 0; }

/* списки */
.group { margin-bottom: 22px; }
.group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 4px; font-weight: 600; }
.group.overdue h2 { color: var(--danger); }
.task { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 12px 12px 14px; margin-bottom: 8px; }
.task.flash { border-color: var(--accent); }
.check { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--muted); background: transparent; padding: 0; }
.check:hover { border-color: var(--accent); }
.task.done .check { background: var(--ok); border-color: var(--ok); }
.task.done .title { color: var(--muted); text-decoration: line-through; }
.body { flex: 1; min-width: 0; }
.title { word-wrap: break-word; }
.meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.meta .late { color: var(--danger); }
.del { background: transparent; color: var(--muted); padding: 6px 8px; font-size: 18px; font-weight: 400; opacity: .6; }
.del:hover { color: var(--danger); opacity: 1; }
.empty { color: var(--muted); text-align: center; margin-top: 40px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; max-width: calc(100% - 32px); font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4); z-index: 10; }
.toast.err { border-color: var(--danger); }
