/* Спокойная светлая тема, одна на всех: под системную тёмную не подстраиваемся. */
:root{
  --ink:#111827; --muted:#6b7280; --line:#e5e7eb; --page:#f4f5f7; --card:#ffffff;
  --accent:#0f9d58; --accent-dark:#0b7c45; --warn:#b45309; --bad:#b3261e;
  --radius:16px; --shadow:0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
/* display у .screen — grid, и без !important он побеждает атрибут hidden:
   экран входа оставался на месте поверх формы */
[hidden]{display:none !important}
html,body{margin:0; background:var(--page); color:var(--ink);
  font:16px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased}
/* 160px — хватает и под нижние вкладки, и под плавающую полосу «Записать»
   над ними одновременно, когда виден экран явок */
body{padding:0 0 160px; max-width:560px; margin:0 auto; min-height:100vh}

.top{position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:calc(10px + env(safe-area-inset-top)) 16px 10px; background:rgba(244,245,247,.92);
  backdrop-filter:saturate(180%) blur(12px); border-bottom:1px solid var(--line)}
.brand{display:flex; align-items:center; gap:10px; font-size:15px}
.brand small{display:block; color:var(--muted); font-size:12px; line-height:1.2}
.mark{display:grid; place-items:center; width:34px; height:34px; border-radius:10px;
  background:var(--ink); color:#fff; font-weight:700; font-size:13px; letter-spacing:.02em}
.me{border:0; background:transparent; color:var(--muted); font:inherit; font-size:12px;
  max-width:44vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:6px 0}

/* Вкладки — внизу, как основная навигация приложения, а не верхняя полоска:
   на телефоне до неё дотягивается большой палец без перехвата. */
.tabs{position:fixed; left:0; right:0; bottom:0; z-index:21; display:flex; gap:6px;
  padding:8px 16px calc(8px + env(safe-area-inset-bottom)); background:rgba(244,245,247,.96);
  backdrop-filter:saturate(180%) blur(12px); border-top:1px solid var(--line);
  max-width:560px; margin:0 auto}
.tab{flex:1 1 auto; border:0; border-radius:10px; padding:9px 6px; background:#eef1f4; color:var(--muted);
  font:inherit; font-size:13px; font-weight:600}
.tab.on{background:var(--ink); color:#fff}
.bar2{padding:4px 2px 24px}
.bar2 .btn{box-shadow:none}

.screen{padding:16px 16px 0; display:grid; gap:14px}
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:14px}
.card.center{text-align:center; padding:28px 20px}
h1{margin:0 0 6px; font-size:20px}
h2{margin:0; font-size:15px}
.cardhead{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.muted{color:var(--muted); font-size:14px; margin:0 0 18px}
.note{color:var(--muted); font-size:13px; margin:12px 0 0}
.note.bad{color:var(--bad)}
.pill{min-width:28px; padding:2px 10px; border-radius:999px; background:#eef1f4; color:var(--muted);
  font-size:13px; font-weight:600; text-align:center}
.pill.on{background:var(--accent); color:#fff}

.field{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 2px}
.field + .field{border-top:1px solid var(--line)}
.field > span{color:var(--muted); font-size:14px; flex:0 0 auto}
.field input,.field select{flex:1 1 auto; min-width:0; text-align:right; border:0; background:transparent;
  font:inherit; font-weight:600; color:var(--ink); padding:6px 0; appearance:none}
.field select{text-align-last:right}
.field input:focus,.field select:focus{outline:none}

.search{position:relative; margin-top:4px}
.search input{width:100%; padding:14px 40px 14px 14px; border:1px solid var(--line); border-radius:12px;
  font:inherit; background:#fbfcfd; color:var(--ink)}
.search input:focus{outline:none; border-color:var(--accent); background:#fff;
  box-shadow:0 0 0 4px rgba(15,157,88,.10)}
.clear{position:absolute; right:6px; top:50%; transform:translateY(-50%); width:32px; height:32px;
  border:0; border-radius:50%; background:#eef1f4; color:var(--muted); font-size:18px; line-height:1}

.hints{list-style:none; margin:10px 0 0; padding:0; max-height:46vh; overflow:auto;
  border:1px solid var(--line); border-radius:12px; background:#fff}
.hints li{display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 14px; cursor:pointer}
.hints li + li{border-top:1px solid var(--line)}
.hints li:active{background:#f2fbf6}
.hints .cp{color:var(--muted); font-size:12px; white-space:nowrap}
.hints mark{background:#d9f2e5; color:inherit; border-radius:3px; padding:0 1px}

.picked{list-style:none; margin:0 0 10px; padding:0; display:grid; gap:8px}
.picked li{display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:12px;
  background:#f7f8fa; border:1px solid var(--line); animation:pop .16s ease-out}
.picked .n{font-weight:600}
.picked .cp{color:var(--muted); font-size:12px; margin-left:auto; white-space:nowrap}
.picked .x{flex:0 0 auto; width:28px; height:28px; border:0; border-radius:50%; background:#eef1f4;
  color:var(--muted); font-size:16px; line-height:1}
@keyframes pop{from{opacity:0; transform:translateY(-4px)}to{opacity:1; transform:none}}

/* bottom — высота .tabs (8+8 паддинг + ~36px кнопка + safe-area), чтобы полоса
   «Записать» села прямо над вкладками, а не под ними */
.bar{position:fixed; left:0; right:0; bottom:calc(52px + env(safe-area-inset-bottom)); z-index:20;
  padding:12px 16px 8px;
  background:linear-gradient(180deg, rgba(244,245,247,0), rgba(244,245,247,.96) 28%);
  max-width:560px; margin:0 auto}
.btn{width:100%; padding:15px 18px; border:0; border-radius:14px; background:var(--accent); color:#fff;
  font:inherit; font-weight:700; letter-spacing:.01em; box-shadow:0 6px 18px rgba(15,157,88,.28)}
.btn:disabled{background:#c9ced6; box-shadow:none}
.btn:active:not(:disabled){background:var(--accent-dark)}
.btn.ghost{background:#eef1f4; color:var(--ink); box-shadow:none; margin-top:16px}
.gbtn{display:flex; justify-content:center; min-height:44px}

.doneIcon{width:56px; height:56px; margin:0 auto 12px; border-radius:50%; display:grid; place-items:center;
  background:#e7f6ee; color:var(--accent); font-size:26px}
.doneIcon.bad{background:#fdecea; color:var(--bad)}
.donelist{list-style:none; margin:8px 0 0; padding:0; text-align:left; display:grid; gap:6px}
.donelist li{padding:10px 12px; border-radius:10px; background:#f7f8fa; font-size:14px}
.donelist li.bad{background:#fdecea; color:var(--bad)}

.spacer{height:8px}
.toast{position:fixed; left:50%; bottom:84px; transform:translateX(-50%); z-index:30; max-width:88vw;
  padding:12px 16px; border-radius:12px; background:#111827; color:#fff; font-size:14px;
  box-shadow:0 10px 30px rgba(16,24,40,.25)}
