:root {
  --screen: #f4f6f4;
  --surface: #ffffff;
  --ink: #1e2823;
  --muted: #6b756f;
  --line: #e2e7e3;
  --accent: #3f5c4e;
  --accent-soft: #e7eee9;
  --warn: #8a6a3a;
  --warn-soft: #f3ecdf;
  --danger: #8b4a45;
  --danger-soft: #f3e6e5;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--screen);
  color: var(--ink);
  overscroll-behavior-y: none;
}

body {
  font-size: 16px;
  line-height: 1.4;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}
button { cursor: pointer; }
button:active { transform: scale(0.99); }

.app, .shell { height: 100%; }
.boot {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.hidden { display: none !important; }

.stage { height: 100%; }

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* Общая верхняя плашка: подписка, тренажёр, общий список и настройки на любом экране */
.app-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  background: var(--screen);
}
.top-chrome {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: calc(var(--safe-top) + 4px) 8px 6px;
  background: var(--screen);
  border-bottom: 1px solid var(--line);
  z-index: 12;
}
.top-chrome-grow { flex: 1; min-width: 8px; }
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.stage > .screen { flex: 1; min-height: 0; }
/* Safe-area уже в top-chrome — у локальных bar отступ меньше */
.app-frame .bar {
  padding-top: 8px;
}

/* —— App bar —— */
.bar {
  padding: calc(var(--safe-top) + 10px) 8px 10px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  background: var(--screen);
}
.bar h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.on, .icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.spacer { width: 42px; flex-shrink: 0; }

.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 24px;
  -webkit-overflow-scrolling: touch;
}
.scroll.pad-bottom { padding-bottom: calc(28px + var(--safe-bottom)); }

/* Кнопка записи висит над списком: голос — главное действие, до него всегда один палец. */
.fab {
  position: absolute;
  right: 18px;
  bottom: calc(20px + var(--safe-bottom));
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent);
  color: #f4f6f4;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(63, 92, 78, 0.32);
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(0.96); }
/* Место для кнопки в конце списка, иначе она накрывает последнюю запись. */
.scroll.pad-fab { padding-bottom: calc(96px + var(--safe-bottom)); }

.incoming-banner {
  background: var(--warn-soft);
  border: 1px solid rgba(138, 106, 58, 0.22);
  color: var(--warn);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  width: 100%;
}

/* —— Cards —— */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  text-align: left;
  width: 100%;
  display: block;
}
.card .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card .title { font-size: 16px; font-weight: 650; line-height: 1.3; }
.card.done .title { text-decoration: line-through; color: var(--muted); }
.card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.soft { background: var(--screen); color: var(--muted); }
/* Счётчик непрочитанного в строке настроек: тот же кружок, что и на иконке в шапке. */
.pill.count {
  min-width: 22px;
  padding: 4px 7px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  text-align: center;
}
.pill.buy { background: #eef2e6; color: #5d7038; }
.pill.sport { background: #e8f0f2; color: #3d6a73; }
.pill.care { background: #f3ebe8; color: #7a5a4e; }
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 48px 16px;
  line-height: 1.5;
}

/* —— Карточка списка с галочкой —— */
/* Смахивание записи влево: «Удалить» лежит под карточкой и открывается сдвигом. */
.swipe {
  position: relative;
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
}
.swipe-del {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 96px;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.swipe-front {
  position: relative;
  transition: transform 0.18s ease;
  /* Вертикаль оставляем браузеру — список должен листаться как обычно. */
  touch-action: pan-y;
}
.swipe.open .swipe-front { transform: translateX(-96px); }
.swipe.dragging .swipe-front { transition: none; }
.swipe .card-row { margin-bottom: 0; }

/* Смахивание записи влево: «Удалить» лежит под карточкой и открывается сдвигом. */
.swipe {
  position: relative;
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
}
.swipe-del {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 96px;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.swipe-front {
  position: relative;
  transition: transform 0.18s ease;
  /* Вертикаль оставляем браузеру — список должен листаться как обычно. */
  touch-action: pan-y;
}
.swipe.open .swipe-front { transform: translateX(-96px); }
.swipe.dragging .swipe-front { transition: none; }
.swipe .card-row { margin-bottom: 0; }

.card-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.card-row.overdue { border-color: rgba(138, 106, 58, 0.4); }
/* Прошедшее по времени зачёркнуто, как сделанное — видно, что срок уже был. */
.card-row.overdue .title { text-decoration: line-through; color: var(--muted); }
.card-row.overdue .meta { color: var(--warn); }
.swipe.flash .card-row {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.card-row .tick {
  width: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}
.card-row .tick i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid #b3bdb6;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
}
.card-row .tick.on { background: var(--accent-soft); }
.card-row .tick.on i {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.card-row .card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-row .card-main {
  width: 100%;
  min-width: 0;
  padding: 14px;
  text-align: left;
}
.card-row .chip-row.in-card {
  padding: 0 14px 12px;
  margin: -4px 0 0;
  flex-wrap: wrap;
}
.card-row.done .title { text-decoration: line-through; color: var(--muted); }
.card-row .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card-row .title { font-size: 16px; font-weight: 650; line-height: 1.3; }
.card-row .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* —— Шаги первого запуска —— */
.step {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.step-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.step.done .step-num { background: var(--accent); color: #f4f6f4; }
.step-body { flex: 1; min-width: 0; }
.step-body .name { font-size: 16px; font-weight: 650; }
.step-body .sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Подсказка о прокрутке: «заглушки» цвета фона едут вместе с вкладками и
     открывают мягкое затухание у того края, за которым осталось содержимое. */
  background:
    linear-gradient(to right, var(--screen) 74%, rgba(244, 246, 244, 0)) left center,
    linear-gradient(to left, var(--screen) 74%, rgba(244, 246, 244, 0)) right center,
    radial-gradient(farthest-side at 0 50%, rgba(30, 40, 35, 0.22), rgba(30, 40, 35, 0)) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(30, 40, 35, 0.22), rgba(30, 40, 35, 0)) right center;
  background-repeat: no-repeat;
  background-size: 36px 100%, 36px 100%, 26px 100%, 26px 100%;
  background-attachment: local, local, scroll, scroll;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.tab.on { background: var(--accent-soft); color: var(--accent); }
/* Сколько записей ждёт разбора: входящие от людей и просроченное. */
.tab-count {
  display: inline-block;
  margin-left: 5px;
  min-width: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.tabs-line {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.tabs-line .tab { flex: 1; text-align: center; }

/* —— Chat —— */
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble {
  max-width: 92%;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 15px;
}
.bubble.me {
  align-self: flex-end;
  background: var(--accent);
  color: #f4f6f4;
  border-bottom-right-radius: 6px;
}
.bubble.ai {
  align-self: flex-start;
  /* Единая ширина: иначе ответы с чипами шире ответов без них и лента «прыгает». */
  width: 92%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.bubble.ai strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.ai-line { font-size: 14px; }
.ai-bell { margin-top: 8px; font-size: 12px; color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-size: 13px;
  font-weight: 650;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.chip.on {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.chip.big {
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 12px;
}
.chip.danger { background: var(--danger-soft); color: var(--danger); }

.group-chip {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.group-chip .chip {
  border: none;
  border-radius: 0;
  margin: 0;
}
.group-chip .chip.ghost { background: var(--surface); }
.group-chip .chip.on {
  box-shadow: none;
  background: var(--accent);
  color: #fff;
}
.group-trash {
  width: 44px;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  color: var(--danger);
  border: none;
  border-left: 1px solid var(--line);
  padding: 0;
}
.group-trash svg { width: 18px; height: 18px; }

.composer {
  padding: 10px 12px calc(12px + var(--safe-bottom));
  display: flex;
  gap: 8px;
  /* Микрофон стоит над отправкой: обе кнопки под большим пальцем одной руки. */
  align-items: flex-end;
  background: var(--screen);
  flex-shrink: 0;
}
.composer-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.composer input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  min-width: 0;
}
.composer input:focus { border-color: #b7c4bc; }
.composer .round {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent);
  color: #f4f6f4;
}
.composer .round.soft { background: var(--accent-soft); color: var(--accent); }
/* Тот же микрофон, что на закладках, только размером с кнопку отправки. */
.composer .round.mic {
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(63, 92, 78, 0.28);
}
.composer .round.mic:active { transform: scale(0.96); }
.composer .round svg { width: 20px; height: 20px; }

/* —— Record —— */
.record {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}
.rec-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--accent);
}
.rec-ring svg { width: 40px; height: 40px; }
.rec-ring.live::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(63, 92, 78, 0.3);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.07); opacity: 1; }
}
.rec-text {
  font-size: 16px;
  color: var(--ink);
  min-height: 48px;
  max-width: 320px;
}
.rec-text.dim { color: var(--muted); }
.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn {
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 650;
  background: var(--accent);
  color: #f4f6f4;
}
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; }

/* —— Fields —— */
.field { display: block; margin-bottom: 12px; }
.field > span, .field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 13px 12px;
  outline: none;
  font: inherit;
  color: inherit;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: #b7c4bc; }
.actions-col { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* —— Wheel picker —— */
.pick-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.pick-block.open { border-color: #b7c4bc; }
.pick-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  text-align: left;
}
.pick-head .lab {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 62px;
}
.pick-head .val { flex: 1; font-size: 16px; font-weight: 650; }
.pick-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pick-block.open .pick-ico { background: var(--accent); color: #f4f6f4; }
.pick-ico svg { width: 19px; height: 19px; }
.pick-body {
  display: none;
  padding: 0 8px 14px;
  border-top: 1px solid var(--line);
}
.pick-block.open .pick-body { display: block; }
.wheels {
  display: flex;
  gap: 6px;
  position: relative;
  height: 180px;
  margin-top: 10px;
}
.wheels::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
  background: var(--accent-soft);
  border-radius: 10px;
  pointer-events: none;
}
.wheel {
  flex: 1;
  height: 180px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
  scrollbar-width: none;
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-pad { height: 70px; }
.wheel-item {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.45;
  scroll-snap-align: center;
}
.wheel-item.on { color: var(--ink); opacity: 1; font-weight: 700; }
.pick-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* —— Settings —— */
.setting {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
}
.setting .name { font-size: 15px; font-weight: 600; }
.setting .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
a.setting { text-decoration: none; color: inherit; }
.setting.danger-row .name { color: #8f3f38; }
.group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 2px 8px;
}
.toggle {
  width: 44px;
  height: 27px;
  border-radius: 999px;
  background: #c5cdc8;
  position: relative;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
.toggle.on i { left: 20px; }

.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  background: var(--surface);
}
.seg button.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
/* Типов записи стало больше — на телефоне всегда в два ряда, иначе не влезают. */
.seg { flex-wrap: wrap; }
.seg button { flex: 1 1 22%; }

.code-box {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
}
.code-box .code {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.code-box .hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.code-box .code.key {
  font-size: 16px;
  letter-spacing: 0.06em;
  /* Переносим только по дефисам: разрыв посреди группы мешает сверить ключ глазами. */
  overflow-wrap: break-word;
}

.keys-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.code-tile {
  flex: 1;
  min-width: 0;
  background: var(--accent-soft);
  border: none;
  border-radius: 14px;
  padding: 10px 10px 12px;
  text-align: left;
  color: inherit;
}
.code-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.code-tile-lab {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.code-tile-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.65);
  color: var(--accent);
  flex-shrink: 0;
}
.code-tile-ico svg { width: 15px; height: 15px; }
.code-tile .code {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  word-break: break-all;
  line-height: 1.25;
}
.code-tile .code.key {
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.ico-pill {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
}
.ico-pill svg { width: 16px; height: 16px; }

/* —— Alarm shelf —— */
.alarm-head {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 14px 10px;
  flex-shrink: 0;
}
.alarm-list { padding-top: 0; }
.alarm-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  margin-bottom: 10px;
  text-align: left;
  color: inherit;
}
.alarm-card.off .alarm-time,
.alarm-card.off .alarm-meta { color: #b0b8b3; }
.alarm-time {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.alarm-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.alarm-fab { background: var(--accent); }
.alarm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 24, 0.45);
  display: grid;
  place-items: end center;
  padding: 16px;
  z-index: 20;
}
.alarm-modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 22px;
  padding: 20px 16px 16px;
  margin-bottom: calc(8px + var(--safe-bottom));
}
.alarm-modal-title {
  text-align: center;
  font-size: 18px;
  font-weight: 750;
}
.alarm-modal-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 12px;
}
.alarm-wheels {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}
.alarm-wheel-col { width: 88px; text-align: center; }
.alarm-wheel-lab {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.alarm-modal-actions {
  display: flex;
  gap: 8px;
}
.alarm-modal-actions .btn { flex: 1; }

.shelf-row {
  padding: 8px 10px;
  gap: 6px;
}
.shelf-row-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: none;
  padding: 4px 2px;
  color: inherit;
}
.shelf-row-main .sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.shelf-edit-btn { width: 38px; height: 38px; }
.shelf-vis-btn {
  background: none;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
}
.pref-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 0 2px;
}
.pref-custom-lab {
  font-size: 13px;
  color: var(--muted);
  min-width: 42px;
}
.pref-custom input {
  width: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  background: var(--surface);
}
.pref-row {
  flex-wrap: nowrap;
  margin-bottom: 14px;
  align-items: stretch;
}
.pref-row > button {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 4px;
}
.pref-inline {
  flex: 1.2 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 4px 6px;
}
.pref-inline.on {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}
.pref-inline input {
  width: 36px;
  border: none;
  background: transparent;
  text-align: center;
  padding: 6px 0;
  min-width: 0;
}
.pref-inline input::-webkit-outer-spin-button,
.pref-inline input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pref-inline input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.setting.flat {
  border: none;
  border-radius: 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.setting.flat:last-child { border-bottom: none; }
.alarm-desc {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.alarm-desc input {
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: var(--ink);
}
.repeat-opt {
  justify-content: flex-start;
  gap: 12px;
}
.repeat-opt.on .name { color: var(--accent); }
.repeat-tick {
  width: 22px;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.repeat-tick.empty { opacity: 0; }
.day-opt { justify-content: space-between; }
.day-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #c5cdc8;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.day-check.on {
  background: var(--accent);
  border-color: var(--accent);
}
.shelf-row.reorder {
  outline: 2px solid var(--accent-soft);
  background: #f7faf8;
}
.shelf-move {
  width: 36px;
  height: 36px;
  font-size: 16px;
  color: var(--muted);
}
.voice-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(244, 246, 244, 0.55);
  backdrop-filter: blur(1.5px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.voice-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  pointer-events: none;
}
.voice-ring {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: none;
  box-shadow: none;
  border-radius: 0;
  position: relative;
}
.voice-ring svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.7;
}
.voice-ring.live svg {
  animation: voice-mic 1.35s ease-in-out infinite;
}
.voice-ring.live::before,
.voice-ring.live::after { display: none; }
@keyframes voice-mic {
  0%, 100% { transform: scale(1); opacity: 0.72; }
  50% { transform: scale(1.14); opacity: 1; }
}
.voice-hint {
  max-width: 280px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-top: 8px;
}
.voice-hint.dim {
  color: var(--muted);
  font-weight: 500;
}

/* —— Extras / подписки —— */
.extras-scrim {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(20, 28, 24, 0.34);
  border: none;
  padding: 0;
}
.extras-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 41;
  width: min(86vw, 320px);
  background: var(--surface);
  box-shadow: 8px 0 28px rgba(30, 40, 35, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(-104%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}
.extras-drawer.on { transform: translateX(0); }
.extras-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 10px 14px 16px;
  border-bottom: 1px solid var(--line);
}
.extras-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.extras-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.extras-mark svg { width: 22px; height: 22px; }
.extras-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.extras-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.extras-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.extras-empty {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  padding: 0 12px;
}
.extras-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--screen);
  color: inherit;
}
.extras-card-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.extras-card-ico svg { width: 20px; height: 20px; }
.extras-card-txt { flex: 1; min-width: 0; }
.extras-card-txt .name { font-weight: 700; font-size: 15px; }
.extras-card-txt .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.extras-card.static { cursor: default; align-items: flex-start; }
.extras-card + .extras-card { margin-top: 10px; }
.extras-card-txt .pill { display: inline-block; margin-top: 8px; }
.extras-plan {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--accent-soft);
  margin-bottom: 14px;
}
.extras-plan.pro { border-color: var(--accent); }
.extras-plan .name { font-weight: 750; font-size: 15px; }
.extras-plan .sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.extras-soon {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Счётчик невыполненного на иконке общего списка в верхней панели. */
.chrome-badge { position: relative; }
.chrome-count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* —— Переписка с поддержкой —— */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 18px;
}
.chat-msg { display: flex; flex-direction: column; max-width: 86%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.them { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.mine .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-msg.them .chat-bubble {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.chat-when {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* Шапка закладки без записей: иконка и одна поясняющая строка. */
.tab-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px 4px;
}
.tab-lead-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tab-lead-ico svg { width: 21px; height: 21px; }
.tab-lead p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* —— Soft-skills simulator —— */
.sim-hero {
  text-align: center;
  margin: 12px 0 18px;
}
.sim-hero-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.sim-hero-mark svg { width: 26px; height: 26px; }
.sim-hero h3 { font-size: 20px; font-weight: 750; }
.sim-disclaimer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 18px;
}
.sim-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.sim-entries { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sim-entry {
  width: 100%;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 13px 14px;
  color: inherit;
}
.sim-entry:disabled { opacity: 0.5; }
.sim-entry .name { font-weight: 700; font-size: 14px; color: var(--accent); }
.sim-entry .sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field .chips { margin-bottom: 4px; }

.scale-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.scale-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.scale-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scale-name { font-weight: 700; font-size: 14px; }
.scale-val { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.scale-delta { font-style: normal; font-size: 12px; margin-left: 4px; }
.scale-delta.up { color: var(--ok, #2e9e6b); }
.scale-delta.down { color: var(--warn, #c9770f); }
.scale-delta.flat { color: var(--muted); }
.scale-bar {
  margin: 8px 0 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent-soft);
  overflow: hidden;
}
.scale-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.scale-hint { font-size: 12px; color: var(--muted); line-height: 1.4; }

.sim-cases { display: flex; flex-direction: column; gap: 10px; }
.sim-case {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  color: inherit;
}
.sim-case:disabled { opacity: 0.5; }
.sim-case-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.sim-case-role {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sim-case-steps { font-size: 12px; color: var(--muted); }
.sim-case .name { font-size: 17px; font-weight: 750; }
.sim-case .sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.sim-case-help {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.sim-case-help span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.sim-constructs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.sim-constructs span {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}
.sim-constructs span.sim-char {
  background: var(--ink);
  color: var(--surface);
}
.sim-section-title {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.sim-method-list { display: flex; flex-direction: column; gap: 8px; }
.sim-method-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.sim-method-item .name { font-weight: 700; font-size: 14px; }
.sim-method-item .sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.sim-limit-list {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
}
.sim-score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.sim-score-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.sim-score-top .level { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.sim-score-top .avg { font-size: 18px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.sim-score-top .avg span { font-size: 13px; color: var(--muted); font-weight: 600; }
.sim-level-hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; max-width: 16rem; }
.sim-score-strategy { font-size: 13px; color: var(--muted); margin: 10px 0 8px; }
.sim-score-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--muted);
}
.sim-score-legend b { color: var(--ink); margin-right: 2px; }
.sim-score-bars { display: flex; flex-direction: column; gap: 12px; }
.sim-score-item { display: flex; flex-direction: column; gap: 4px; }
.sim-score-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 1.4rem;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.sim-score-name { font-weight: 650; }
.sim-score-track {
  height: 10px;
  border-radius: 99px;
  background: #e8ece9;
  overflow: hidden;
  min-width: 0;
}
.sim-score-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.35s ease;
}
.sim-score-fill.none { background: #c5cdc8; }
.sim-score-fill.low { background: #b07a3a; }
.sim-score-fill.mid { background: #6a8f5a; }
.sim-score-fill.good { background: var(--accent); }
.sim-score-val { text-align: right; font-variant-numeric: tabular-nums; }
.sim-score-desc { font-size: 12px; color: var(--muted); line-height: 1.35; padding-left: 0; }
.sim-score-band { font-size: 11px; color: var(--ink); opacity: 0.75; line-height: 1.3; }
.sim-scripts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.sim-script {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.sim-script span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.sim-script p { margin: 0; font-size: 14px; line-height: 1.4; }
.sim-script-note { font-size: 13px; color: var(--muted); }
.sim-play { padding-bottom: calc(18px + var(--safe-bottom)); }
.sim-progress {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 14px 8px;
}
.sim-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 22px;
  text-align: center;
}
.sim-pulse {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0;
  cursor: pointer;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sim-pulse::before {
  content: "";
  position: absolute;
  inset: -36px;
  border-radius: 50%;
}
.sim-pulse svg { width: 30px; height: 30px; }
.sim-pulse.live { animation: voice-mic 1.4s ease-in-out infinite; }
.sim-pulse.hold {
  animation: none;
  background: var(--danger-soft);
  color: var(--danger);
  transform: scale(1.04);
}
.sim-pulse.busy,
.sim-pulse:disabled { opacity: 0.7; cursor: default; }
.sim-line {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 34rem;
}
.sim-hint { font-size: 13px; color: var(--muted); }
.sim-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 0;
  touch-action: none;
}
.sim-hold-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  max-width: 16rem;
  line-height: 1.35;
}
.sim-hold-hint.cancel {
  color: var(--danger);
}
.sim-hold-hint.pulse {
  animation: sim-hold-pulse 1.6s ease-in-out infinite;
}
@keyframes sim-hold-pulse {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}
.btn.round-mic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #f4f6f4;
  box-shadow: 0 10px 22px rgba(63, 92, 78, 0.28);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: relative;
}
.btn.round-mic::before {
  content: "";
  position: absolute;
  inset: -40px;
  border-radius: 50%;
}
.btn.round-mic.holding {
  background: var(--danger);
  transform: scale(1.06);
  box-shadow: 0 12px 26px rgba(139, 74, 69, 0.35);
}
.btn.round-mic.holding.cancel-arm,
.sim-pulse.hold.cancel-arm {
  background: var(--danger-soft);
  color: var(--danger);
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}
.btn.round-mic svg { width: 26px; height: 26px; }
.btn.round-mic:disabled { opacity: 0.45; }
.screen.sim-play {
  touch-action: none;
  overscroll-behavior: none;
}
.sim-report-head { margin-bottom: 14px; }
.sim-report-head .name { font-size: 18px; font-weight: 750; }
.sim-report-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sim-report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 18px;
  white-space: normal;
}

.shortcut-rail {
  display: flex;
  gap: 8px;
  margin: -2px 0 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Поля по краям, чтобы первая и последняя закладка тоже вставали по центру. */
  padding: 2px calc(50% - 72px);
}
.shortcut-rail::-webkit-scrollbar { display: none; }
.shortcut-pick {
  flex: 0 0 144px;
  scroll-snap-align: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 10px;
  font-size: 15px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shortcut-pick.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}
.shortcut-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}

/* Строка «поле + кнопка»: создать группу, показать и скопировать ключ */
.row-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.row-form input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
}
.row-form .btn { flex-shrink: 0; }

.auth-switch {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.person.col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.person.col .chip-row { margin: 0; }
.person > .hint { font-size: 12px; color: var(--muted); }

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
}
.person.on { border-color: var(--accent); background: var(--accent-soft); }
.check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid #aab4ad;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
}
.person.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.person .who { flex: 1; }
.person .who b { font-size: 15px; font-weight: 650; }
.person .who small { display: block; font-size: 12px; color: var(--muted); }

/* —— Подключение рядом —— */
/* QR должен читаться камерой с расстояния вытянутой руки, поэтому он во всю ширину. */
.qr-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.qr-box svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
}
.qr-wait {
  color: var(--muted);
  font-size: 14px;
  padding: 60px 0;
}
.code-box .code.room-code {
  font-size: 34px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 2px 0;
}
.hint { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* —— Auth —— */
.auth { justify-content: center; }
.auth-inner {
  padding: 24px 20px calc(24px + var(--safe-bottom));
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
.brand { text-align: center; margin-bottom: 24px; }
.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: var(--accent);
  color: #f4f6f4;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.brand-mark svg { width: 28px; height: 28px; }
.brand h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.brand p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.auth-form .note { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }

/* —— Согласие на обработку данных —— */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
}
.consent input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--accent);
}
.consent a { color: var(--accent); }
.consent-text {
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.consent-text p { margin: 0 0 10px; }

/* —— Toast —— */
/* Тост живёт под шапкой: снизу он ложился на «Сохранить» и переключатель типа.
   Точное значение top проставляет toast() по нижней границе шапки экрана. */
.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  top: calc(var(--safe-top) + 62px);
  background: var(--ink);
  color: #f4f6f4;
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 24px rgba(20, 30, 25, 0.18);
  z-index: 60;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.has-do {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.toast-do {
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Сообщение с кнопкой («Вернуть») должно ловить нажатия — обычное не мешает работать. */
.toast.has-do {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.toast-do {
  color: #a9cbb7;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* Выбор звука: слева название, справа кружок «послушать». */
.sound-row {
  padding: 6px 8px 6px 14px;
  gap: 8px;
}
.sound-row.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sound-row.on .name { color: var(--accent); }
.sound-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 7px 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
}
.sound-main .name { font-size: 15px; font-weight: 600; }
.sound-main .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sound-play {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.sound-play.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Пуш, пришедший при открытом приложении: живой баннер поверх экрана. */
.live-notice {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(var(--safe-top) + 10px);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(20, 30, 25, 0.22);
  z-index: 70;
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.2s, transform 0.2s;
  color: inherit;
}
.live-notice.on { opacity: 1; transform: translateY(0); }
.live-notice-text { flex: 1; min-width: 0; display: block; }
.live-notice-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-notice-body {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-notice-close { flex-shrink: 0; color: var(--muted); font-size: 14px; padding: 0 2px; }

@media (min-width: 680px) {
  .live-notice { left: 50%; right: auto; width: 396px; margin-left: -198px; }
}

.offline-bar {
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  padding: 7px 12px;
}

/* На большом экране показываем приложение как телефон, чтобы верстка не растягивалась */
@media (min-width: 680px) {
  body {
    display: grid;
    place-items: center;
    background: #e6eae7;
    padding: 24px;
  }
  .app {
    width: 400px;
    height: min(840px, calc(100vh - 48px));
    background: var(--screen);
    border: 1px solid var(--line);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(30, 40, 35, 0.16);
  }
  .toast {
    left: 50%;
    right: auto;
    transform: translate(-50%, -10px);
    width: 340px;
  }
  .toast.show { transform: translate(-50%, 0); }
}
