/* «Что купить» — спокойный магазинный список: светлый фон, белые карточки отделов,
   ввод внизу под большой палец. Цвет отдела приходит из разметки как --c. */

:root {
  color-scheme: light dark;
  --bg: #F2F3EF;
  --surface: #FFFFFF;
  --surface-2: #F2F3EF;
  --field: #F7F8F5;
  --basket: #E7E9E4;
  --text: #17201B;
  --text-2: #3E4843;
  --muted: #5B6560;
  --line: #E0E3DD;
  --hair: #EDEFEA;
  --accent: #1E7A4C;
  --accent-soft: #DDEEE3;
  --accent-ink: #17583A;
  --accent-text: #FFFFFF;
  --ink: #17201B;
  --ink-text: #FFFFFF;
  --danger: #A3302F;
  --live: #23A05D;
  --tint: 13%;
  --label-mix: 100%;
  --shadow: 0 12px 32px rgb(23 32 27 / 0.16), 0 2px 6px rgb(23 32 27 / 0.06);
  --radius: 20px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --composer-h: 92px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121513;
    --surface: #1C201D;
    --surface-2: #252A26;
    --field: #161917;
    --basket: #1A1E1B;
    --text: #E9ECE8;
    --text-2: #C9CFCA;
    --muted: #9AA39D;
    --line: #2F3531;
    --hair: #272C28;
    --accent: #3FB67A;
    --accent-soft: #1D3326;
    --accent-ink: #8FDCB2;
    --accent-text: #07130C;
    --ink: #E9ECE8;
    --ink-text: #121513;
    --danger: #FF7A6E;
    --tint: 20%;
    --label-mix: 55%;
    --shadow: 0 14px 34px rgb(0 0 0 / 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #121513;
  --surface: #1C201D;
  --surface-2: #252A26;
  --field: #161917;
  --basket: #1A1E1B;
  --text: #E9ECE8;
  --text-2: #C9CFCA;
  --muted: #9AA39D;
  --line: #2F3531;
  --hair: #272C28;
  --accent: #3FB67A;
  --accent-soft: #1D3326;
  --accent-ink: #8FDCB2;
  --accent-text: #07130C;
  --ink: #E9ECE8;
  --ink-text: #121513;
  --danger: #FF7A6E;
  --tint: 20%;
  --label-mix: 55%;
  --shadow: 0 14px 34px rgb(0 0 0 / 0.5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font);
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.spacer { flex: 1; }

/* Цвет отдела: --c задаётся в разметке */
.dept-label { color: color-mix(in srgb, var(--c) var(--label-mix), #fff); }
.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--muted));
}

/* ---------- Шапка ---------- */

.topbar,
.list,
.banner,
.composer > * { max-width: 640px; margin-inline: auto; }

.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 16px) 20px 10px;
}

.title-row { display: flex; align-items: center; gap: 8px; }

.title-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
}
.title-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.title-btn svg { flex: none; width: 22px; height: 22px; color: var(--muted); stroke-width: 2.2; }

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(23 32 27 / 0.08);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[aria-pressed="true"] { background: #F5C542; color: #3A2A00; }

.sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.sync-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.sync-badge.offline { background: var(--surface-2); color: var(--muted); }
.sync-badge.offline .sync-dot { background: var(--muted); }
#sync-text { overflow: hidden; text-overflow: ellipsis; }

.progress-block { display: flex; flex-direction: column; gap: 8px; }
.progress-text { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#summary { font-size: 15px; font-weight: 600; }
#summary-right { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lists-strip {
  display: flex;
  gap: 8px;
  margin: 2px -20px 0;
  padding: 0 20px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.lists-strip::-webkit-scrollbar { display: none; }
.ls-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 70vw;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.ls-chip svg { width: 16px; height: 16px; }
.ls-chip .ls-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-chip .ls-count {
  min-width: 22px;
  margin-right: -6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.ls-chip.current { background: var(--ink); color: var(--ink-text); }
.ls-chip.current .ls-count { background: color-mix(in srgb, var(--ink-text) 20%, transparent); color: inherit; }
.ls-chip.add { border: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent); background: none; color: var(--muted); }

/* ---------- Плашки ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
}
@media (max-width: 680px) { .banner { margin-inline: 16px; } }
.banner.move { background: color-mix(in srgb, #F5C542 22%, var(--surface)); }
.banner-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; }
.banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.banner-text span { color: var(--muted); font-size: 13px; }
.banner .btn { flex: none; }
.banner-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.banner-close svg { width: 18px; height: 18px; }

/* ---------- Список ---------- */

.list {
  padding: 4px 16px calc(env(safe-area-inset-bottom) + var(--composer-h) + 40px);
}

/* Карточка отдела: строки плоские (для плавного переезда), а вид — как у карточки */
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-top: 12px;
  padding: 4px 14px 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
}
.group-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.group-head .g-count { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }

.item {
  position: relative;
  display: block;
  padding: 0 14px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}
.item.last { padding-bottom: 4px; border-radius: 0 0 var(--radius) var(--radius); }
.item-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
}
.item.first .item-inner { border-top: 0; }
.item:focus-visible .item-inner { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 12px; }

.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--c);
  border-radius: 50%;
}
.check svg { width: 14px; height: 14px; stroke-width: 3.2; opacity: 0; color: #fff; }

.i-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.i-name { font-size: 17px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.i-note { font-size: 13px; color: var(--muted); }
.i-qty {
  flex: none;
  max-width: 38%;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edit-btn {
  flex: none;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.edit-btn svg { width: 18px; height: 18px; }
.edit-btn:hover { background: var(--surface-2); color: var(--text); }
@media (hover: hover) {
  .edit-btn { display: grid; opacity: 0; }
  .item:hover .edit-btn, .item:focus-within .edit-btn { opacity: 1; }
}

.item.flash .item-inner { animation: flash 0.9s ease-out; }
@keyframes flash {
  0% { background: color-mix(in srgb, var(--c) 22%, transparent); }
  100% { background: transparent; }
}

/* Корзина */
.basket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  margin-top: 16px;
  padding: 2px 10px 2px 14px;
  border-radius: var(--radius);
  background: var(--basket);
}
.basket-head.open { border-radius: var(--radius) var(--radius) 0 0; }
.basket-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 600;
}
.basket-toggle .chev { width: 18px; height: 18px; color: var(--muted); stroke-width: 2.2; transition: transform 0.2s; }
.basket-head.open .chev { transform: rotate(180deg); }
.clear-btn {
  margin-left: auto;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.item.done { background: var(--basket); }
.item.done .item-inner { min-height: 48px; border-top-color: color-mix(in srgb, var(--muted) 18%, transparent); }
.item.done.first .item-inner { border-top: 1px solid color-mix(in srgb, var(--muted) 18%, transparent); }
.item.done .check { border-color: var(--c); background: var(--c); opacity: 0.55; }
.item.done .check svg { opacity: 1; }
.item.done .i-name {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.item.done .i-note { display: none; }
.item.done .i-qty { background: transparent; color: var(--muted); font-weight: 400; }

.all-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 26px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.all-done .badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.all-done .badge svg { width: 26px; height: 26px; stroke-width: 2.6; }
.all-done b { font-size: 18px; }
.all-done span { font-size: 14px; color: var(--muted); }

/* Пустой список */
.empty { margin-top: 28px; padding: 0 8px; text-align: center; color: var(--muted); }
.empty-art {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border-radius: 26px;
  background: var(--surface);
  color: var(--accent);
}
.empty-art svg { width: 44px; height: 44px; stroke-width: 1.8; }
.empty h2 { margin: 16px 0 6px; color: var(--text); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.empty p { max-width: 380px; margin: 6px auto; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.example {
  height: 40px;
  padding: 0 14px;
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
}
.empty .btn { margin-top: 18px; }

/* ---------- Нижняя панель ---------- */

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 14px);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
}

.add-form { position: relative; display: flex; align-items: center; gap: 10px; }
#add-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}
#add-input:focus { border-color: var(--accent); }
#add-input::placeholder { color: var(--muted); opacity: 0.85; }

.round-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.round-btn.mic, .round-btn.add {
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
.round-btn.mic svg, .round-btn.add svg { width: 24px; height: 24px; stroke-width: 2.2; }
.round-btn:active { transform: scale(0.95); }

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  max-height: 46vh;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.suggestions li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--surface-2); }
.suggestions .s-name { flex: 1; min-width: 0; font-size: 16px; }
.suggestions .s-name b { font-weight: 700; }
.suggestions .s-meta { font-size: 13px; color: var(--muted); white-space: nowrap; }

.quick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.quick-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.quick-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.quick-chips::-webkit-scrollbar { display: none; }

/* Фишки: быстрые кнопки, выбор отдела, ходовые продукты */
.chip, .pchip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.chip .dot, .pchip .dot { width: 8px; height: 8px; }
.chip[aria-pressed="true"], .pchip[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface));
  font-weight: 600;
}
.pchip svg { width: 16px; height: 16px; stroke-width: 3; color: color-mix(in srgb, var(--c) var(--label-mix), #fff); }
.pchip[aria-pressed="true"] { padding-left: 10px; }
.pchip.editing { border-style: dashed; padding-right: 10px; }
.pchip.editing svg { color: var(--danger); stroke-width: 2.6; }
.pchip.flash { animation: chip-flash 0.9s ease-out; }
@keyframes chip-flash { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent); } 100% { box-shadow: 0 0 0 4px transparent; } }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  inset: auto 16px calc(env(safe-area-inset-bottom) + var(--composer-h) + 14px) 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  overflow: visible;
  background: #1E2420;
  color: #F2F3EF;
  box-shadow: var(--shadow);
  font-size: 15px;
  animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Тост сделан «поповером», чтобы его было видно и поверх открытых окон; положение задано выше. */
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.toast-action {
  flex: none;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: #8FDCB2;
  font-weight: 700;
}

/* ---------- Окна-шторки ---------- */

.sheet {
  width: min(560px, 100vw);
  max-width: 100vw;
  max-height: 90dvh;
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.sheet.tall { height: 90dvh; }
@media (min-width: 640px) {
  .sheet { margin: auto; border-radius: 28px; }
}
.sheet::backdrop { background: rgb(23 32 27 / 0.42); }
.sheet[open] { animation: sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { transform: translateY(28px); opacity: 0; } }

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 22px);
}
.sheet-body::before {
  content: "";
  align-self: center;
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.sheet-sub { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
.close-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
}
.close-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.sheet-foot {
  position: sticky;
  bottom: calc(-1 * (env(safe-area-inset-bottom) + 22px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: auto -20px calc(-1 * (env(safe-area-inset-bottom) + 22px));
  padding: 14px 20px calc(env(safe-area-inset-bottom) + 22px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.sheet-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.btn {
  height: 48px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.btn.ink { border-color: var(--ink); background: var(--ink); color: var(--ink-text); }
.btn.text { padding: 0 4px; border: 0; background: none; }
.btn.danger { color: var(--danger); }
.btn.small { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-text) 22%, transparent);
  font-size: 13px;
  font-weight: 700;
}

.field { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field > legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field input, .inline-form input, .share-link {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  font-size: 16px;
  outline: none;
}
.field input:focus, .inline-form input:focus { border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.square-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.square-btn svg { width: 20px; height: 20px; stroke-width: 2.4; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Выбрать из списка */
.picker-groups { display: flex; flex-direction: column; gap: 18px; padding-bottom: 6px; }
.picker-group { display: flex; flex-direction: column; gap: 10px; }
.picker-head { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.picker-head .dot { width: 9px; height: 9px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-empty { margin: 8px 0 0; }

/* Поделиться */
.choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}
.choice.primary { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.choice-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-2);
}
.choice.primary .choice-icon { background: var(--accent); color: var(--accent-text); }
.choice-icon svg { width: 25px; height: 25px; }
.choice-text { display: flex; flex-direction: column; gap: 4px; }
.choice-text b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; }
.choice-text > span { font-size: 14px; line-height: 1.4; color: var(--text-2); }
.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.note-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
.note-box svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.share-link { font-size: 14px; }

/* Списки */
.lists-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.list-row.current { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.lr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
}
.lr-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; }
.lr-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lr-meta svg { width: 14px; height: 14px; }
.lr-act {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
}
.lr-act:hover { background: var(--surface); color: var(--text); }
.lr-act.on { color: var(--accent); }
.lr-act svg { width: 20px; height: 20px; }
.join-block summary { padding: 6px 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.join-block .inline-form { margin-top: 8px; }

/* Установка */
.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 10px; line-height: 1.45; }
.inline-icon { width: 20px; height: 20px; vertical-align: -4px; color: #1A73E8; }

/* Настройки */
.settings-block { padding: 6px 0 14px; border-bottom: 1px solid var(--line); }
.settings-block h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.settings-block p { margin: 0 0 10px; font-size: 14px; }
.order-list { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; }
.order-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 4px 4px 4px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface));
}
.order-list .o-name { flex: 1; font-weight: 500; }
.order-list button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.order-list button:hover:not(:disabled) { background: var(--surface); }
.order-list button:disabled { opacity: 0.25; }
.order-list svg { width: 18px; height: 18px; }

/* ---------- Голосовой ввод ---------- */

.voice { gap: 18px; }
.voice-head { display: flex; align-items: center; gap: 8px; }
.voice-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.voice-hint { margin-left: auto; font-size: 13px; color: var(--muted); }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.voice.listening .rec-dot { background: #D93B3B; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.voice-text { min-height: 60px; margin: 0; font-size: 22px; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; }
.voice-text .interim { color: var(--muted); }
.voice-found { display: flex; flex-direction: column; gap: 10px; }
.voice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface));
  font-size: 15px;
  font-weight: 600;
}
.vchip .dot { width: 8px; height: 8px; }
.vchip .vq { color: color-mix(in srgb, var(--c) var(--label-mix), #fff); font-weight: 700; }
.vchip.pending { border: 1.5px dashed color-mix(in srgb, var(--c) 45%, transparent); background: var(--surface); color: var(--muted); }

.mic-stage { position: relative; align-self: center; display: grid; place-items: center; width: 148px; height: 148px; }
.ring { position: absolute; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ring.r1 { inset: 0; }
.ring.r2 { inset: 18px; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.voice.listening .ring.r1 { animation: breathe 1.6s ease-in-out infinite; }
.voice.listening .ring.r2 { animation: breathe 1.6s ease-in-out 0.3s infinite; }
@keyframes breathe { 50% { transform: scale(0.88); opacity: 0.6; } }
.mic-big {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 38%, transparent);
}
.mic-big svg { width: 34px; height: 34px; stroke-width: 2.2; }
.voice-actions { display: flex; gap: 10px; }
.voice-actions .btn { flex: 1; height: 52px; border-radius: 16px; }
.voice-actions .btn.ink { flex: 1.4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
