/* meowusiki — светлая голубая тема.
   Спокойный фон, белые карточки, тёмно-синий текст вместо чёрного,
   мягкие скругления и ненавязчивые тени. Яркий цвет — только там,
   где нужно действие. */

:root {
  /* Палитра */
  --bg: #F7FBFF;
  --bg-soft: #E2F1FF;
  --blue-light: #A9D4F4;
  --blue: #5D99D2;
  --ink: #1A3454;
  --surface: #FFFFFF;

  /* Производные оттенки текста и линий — тот же синий, разной густоты,
     чтобы интерфейс не распадался на разные серые. */
  --ink-soft: rgba(26, 52, 84, 0.64);
  --ink-faint: rgba(26, 52, 84, 0.44);
  --line: rgba(93, 153, 210, 0.18);
  --line-strong: rgba(93, 153, 210, 0.34);
  --blue-wash: rgba(169, 212, 244, 0.18);
  --blue-wash-strong: rgba(169, 212, 244, 0.34);

  /* Состояния — приглушённые, чтобы не спорить с голубым */
  --ok: #3E9B78;
  --ok-wash: rgba(62, 155, 120, 0.12);
  --warn: #C8873A;
  --warn-wash: rgba(200, 135, 58, 0.12);
  --bad: #CC6B5E;
  --bad-wash: rgba(204, 107, 94, 0.1);

  /* Формы */
  --r-xl: 26px;
  --r-lg: 20px;
  --r: 16px;
  --r-sm: 12px;

  /* Тени: две мягкие, почти незаметные */
  --shadow-sm: 0 1px 2px rgba(26, 52, 84, 0.04), 0 4px 12px rgba(26, 52, 84, 0.05);
  --shadow: 0 2px 6px rgba(26, 52, 84, 0.05), 0 14px 34px rgba(26, 52, 84, 0.08);
  --shadow-lift: 0 4px 10px rgba(26, 52, 84, 0.07), 0 20px 44px rgba(26, 52, 84, 0.11);

  /* Округлый системный шрифт: на технике Apple это SF Pro Rounded,
     на остальных — Nunito, ближайший по характеру. */
  --font: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont,
          "Segoe UI", system-ui, "Helvetica Neue", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.22;
}

p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue); }

::selection { background: var(--blue-wash-strong); }

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

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 22px;
  background: rgba(247, 251, 255, 0.86);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--blue);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
/* Название бренда — строчными. */
.brand-text strong {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  text-transform: lowercase;
}
.brand-text small { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.01em; }

.top-right { display: flex; align-items: center; gap: 8px; }

/* --- Кнопки -------------------------------------------------------------- */

.primary-button {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }

.ghost-button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 550;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.ghost-button:hover { background: var(--bg-soft); border-color: var(--blue-light); transform: translateY(-1px); }
.ghost-button:disabled { opacity: 0.45; cursor: default; transform: none; }

a.primary-button, a.ghost-button, a.share-button, a.chip {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}

.wide { width: 100%; }

.link-button {
  background: none; border: 0; padding: 0;
  color: var(--blue); font-size: 14px; font-weight: 550;
  text-decoration: none; cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.link-button.danger, .ghost-button.danger { color: var(--bad); }

.counter {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--blue); color: #fff;
  font-size: 11.5px; font-weight: 650;
}

/* --- Чипы ---------------------------------------------------------------- */

.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14.5px;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
.chip:hover { border-color: var(--blue-light); transform: translateY(-1px); }
.chip.is-selected {
  background: var(--bg-soft);
  border-color: var(--blue);
  color: var(--ink);
  font-weight: 600;
}

.mode-badge {
  font-size: 11px; letter-spacing: 0.02em;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft); background: var(--surface);
  white-space: nowrap;
}
.mode-badge.is-demo { color: var(--warn); border-color: rgba(200, 135, 58, 0.3); background: var(--warn-wash); }
.mode-badge.is-live { color: var(--ok); border-color: rgba(62, 155, 120, 0.3); background: var(--ok-wash); }

/* --- Поля ---------------------------------------------------------------- */

.input, .question-free {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* меньше 16px — iOS увеличивает страницу при фокусе */
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input::placeholder, .question-free::placeholder { color: var(--ink-faint); }
.input:focus, .question-free:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-wash);
}
select.input { appearance: none; background-image: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-soft); font-weight: 550; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* --- Карточки ------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }

/* --- Главный экран ------------------------------------------------------- */

#main { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Главный экран: ролик с героями во всю ширину, текст и поле ввода —
   на стеклянной подложке поверх него. Видео вписывается целиком
   (object-fit: contain), чтобы не обрезало мордочки; края растворяются
   в фоне страницы за счёт подложки того же тона. */
.hero {
  position: relative;
  /* Выходим за пределы колонки на всю ширину окна. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 0 28px;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  text-align: center;
}

.hero-stage {
  position: relative;
  flex: 1 1 auto;
  /* Сцена занимает большую часть экрана, подложка наезжает снизу. */
  min-height: 46vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* Фон сцены — бежевый из самого ролика. Цвета сняты со столбцов кадра,
     поэтому ролик и фон совпадают в каждой точке и стыка не видно.
     Плоским цветом тут не обойтись: кадр сам по себе с перепадом, слева
     серо-бежевый, справа почти белый, а под героями #d8c7bc. По краям окна
     фон уходит в цвет страницы. */
  background:
    linear-gradient(to right,
      var(--bg) 0%, #cac1bd 14%, #cac1bd 28%, #d2c8c0 38%,
      #dbd0c7 50%, #e4d9cf 62%, #ece1d7 72%, #ece1d7 86%,
      var(--bg) 100%);
}
/* Нижний край ролика растворяется в фоне страницы. */
.hero-stage::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(to bottom, rgba(247, 251, 255, 0), var(--bg));
  pointer-events: none;
}

.hero-stage .heroes {
  position: absolute; inset: 0;
  max-width: none; margin: 0;
  display: flex; align-items: center; justify-content: center;
}
/* Ролик помещается в сцену целиком: высоту задаёт сцена, ширину — его
   собственные пропорции. Размер элемента совпадает с кадром, поэтому маска
   растворяет именно края картинки, а не пустое поле вокруг неё. Само видео
   не растягивается и не размывается — качество остаётся исходным. */
.hero-stage .heroes video,
.hero-stage .heroes img {
  height: 92%; width: auto; max-width: 100%;
  object-fit: contain;
  border-radius: 0;
  animation: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 13%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 13%, #000 80%, transparent 100%);
  mask-composite: intersect;
}

.hero-panel {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100% - 32px));
  margin: -40px auto 0;
  padding: 26px 26px 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

.hero h1 { font-size: 32px; letter-spacing: -0.03em; }
.hero-sub {
  max-width: 440px; margin: 10px auto 20px;
  color: var(--ink-soft); font-size: 15.5px;
}

.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.examples .chip { font-size: 14px; color: var(--ink-soft); }
.examples .chip:hover { color: var(--ink); }

/* --- Композер ------------------------------------------------------------ */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 10px 10px 10px 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.composer:focus-within { border-color: var(--blue); box-shadow: var(--shadow-lift); }

.composer textarea {
  flex: 1;
  background: transparent;
  border: 0; outline: none; resize: none;
  color: var(--ink);
  font: inherit; font-size: 16px;
  padding: 9px 0;
  max-height: 160px;
}
.composer textarea::placeholder { color: var(--ink-faint); }

/* Стартовое поле: подсказка длинная и переносится, поэтому кнопка
   живёт на своей строке под текстом, а не зажимается сбоку. */
.composer-hero {
  max-width: 600px; margin: 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 14px 16px 14px;
}
/* Подсказка длинная: поле должно вмещать её целиком, иначе текст
   обрезается ещё до того, как человек начал печатать. */
.composer-hero textarea { padding: 4px 0 2px; min-height: 52px; }
.composer-hero .primary-button { min-width: 150px; }

/* Ряд с микрофоном и кнопкой отправки — под полем, справа. */
.composer-row { display: flex; align-items: center; gap: 10px; align-self: flex-end; }

.mic-button {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--blue);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.mic-button:hover { background: var(--bg-soft); transform: translateY(-1px); }
/* Пока идёт запись — заметное, но спокойное пульсирование. */
.mic-button.is-listening {
  background: var(--blue); border-color: var(--blue); color: #fff;
  animation: listening 1.6s ease-in-out infinite;
}
@keyframes listening {
  0%, 100% { box-shadow: 0 0 0 0 rgba(93, 153, 210, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(93, 153, 210, 0); }
}
.mic-hint { font-size: 12.5px; color: var(--blue); margin-top: 8px; }

/* Панель действий: полоса во всю ширину внизу экрана. Раньше это была
   плавающая «таблетка» по центру, и кнопки ленты выглядывали из-под неё
   сбоку — казалось, что кнопка наезжает на кнопку. */
.thread-actions {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 251, 255, 0.94);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
}
.thread-actions button { white-space: nowrap; }

/* --- Лента диалога ------------------------------------------------------- */

/* Нижний отступ больше высоты плавающей панели действий,
   иначе последняя кнопка в ленте уходит под неё. */
.thread { display: flex; flex-direction: column; gap: 16px; padding: 22px 0 110px; }

.turn-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 20px 20px 6px 20px;
  padding: 11px 16px;
  white-space: pre-wrap;
}

.say { display: flex; gap: 11px; align-items: flex-start; }
.say-mark {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 11px;
  background: var(--bg-soft);
  display: grid; place-items: center;
  overflow: hidden;
  font-size: 15px;
}
.say-mark img { width: 100%; height: 100%; object-fit: cover; }
.say-body { flex: 1; min-width: 0; }
.say-text { color: var(--ink); }
.say-text.is-muted { color: var(--ink-soft); font-size: 14.5px; }

.thinking { display: flex; gap: 5px; align-items: center; height: 32px; }
.thinking i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-light);
  animation: bounce 1.3s infinite var(--ease);
}
.thinking i:nth-child(2) { animation-delay: 0.16s; }
.thinking i:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* --- Факты запроса ------------------------------------------------------- */

.brief-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fact {
  font-size: 13px; color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px;
}
.fact b { color: var(--ink); font-weight: 600; }
.fact.is-negative { color: var(--warn); border-color: rgba(200, 135, 58, 0.28); background: var(--warn-wash); }

/* --- Вопросы ------------------------------------------------------------- */

.question + .question { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.question-text { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.question-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.question-free { margin-top: 10px; }
.questions-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.questions-actions .hint { font-size: 13px; color: var(--ink-faint); }

/* --- Рекомендации -------------------------------------------------------- */

.options { display: flex; flex-direction: column; gap: 12px; }

.option {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: rise 0.42s var(--ease) both;
}
.option:nth-child(2) { animation-delay: 0.07s; }
.option:nth-child(3) { animation-delay: 0.14s; }
.option:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blue-light); }
.option.is-chosen { border-color: var(--blue); background: linear-gradient(var(--blue-wash), var(--blue-wash)), var(--surface); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.option-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.option-head h3 { font-size: 19px; }
.option-kind {
  font-size: 11.5px; letter-spacing: 0.02em;
  color: var(--blue); background: var(--bg-soft);
  border-radius: 999px; padding: 4px 10px; font-weight: 600;
}
.option-summary { color: var(--ink-soft); font-size: 14.5px; margin: 10px 0 14px; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-soft);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px;
}
.meta-item b { color: var(--ink); font-weight: 600; }

.why { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.why li { position: relative; padding-left: 20px; font-size: 14.5px; }
.why li::before {
  content: ""; position: absolute; left: 5px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue-light);
}

/* В карточке два разных рода кнопок: действия приложения и переходы
   наружу. Раньше они были четырёх разных форм и путались между собой.
   Теперь у всех одна высота и одно скругление, а различаются они
   заливкой и размером шрифта. */
.option-actions {
  display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px;
}
.option-actions > * {
  height: 42px;
  border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px;
  font-size: 14.5px;
}
/* Переходы наружу — ниже и спокойнее: это не главное действие. */
.option .invite-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.option .invite-actions > * {
  height: 36px;
  border-radius: 11px;
  padding: 0 14px;
  font-size: 13.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}
.option .invite-actions > *:hover { background: var(--bg-soft); border-color: var(--blue-light); }
/* Бронь — единственная выделенная из внешних ссылок. */
.option .invite-actions .is-booking {
  color: var(--blue); border-color: var(--blue-light);
  background: var(--bg-soft); font-weight: 600;
}
.option .invite-actions .is-booking:hover { border-color: var(--blue); }

.conf {
  font-size: 11px; letter-spacing: 0.01em;
  border-radius: 999px; padding: 3px 9px; border: 1px solid transparent;
}
.conf-estimate { color: var(--warn); border-color: rgba(200, 135, 58, 0.26); background: var(--warn-wash); }
.conf-unknown { color: var(--ink-faint); border-color: var(--line-strong); }
.conf-verified { color: var(--ok); border-color: rgba(62, 155, 120, 0.26); background: var(--ok-wash); }

.notes {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong);
  font-size: 12.5px; color: var(--ink-faint);
  display: flex; flex-direction: column; gap: 4px;
}
.notes strong { color: var(--ink-soft); font-weight: 600; }

/* --- Готовый план от AI --------------------------------------------------- */

.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.plan-head { padding: 22px 24px 18px; background: var(--bg-soft); }
.plan-head h2 { font-size: 21px; }
.plan-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: 14.5px; }

.plan-section { padding: 18px 24px; border-top: 1px solid var(--line); }
.plan-section h4 {
  font-size: 12px; letter-spacing: 0.02em;
  color: var(--ink-faint); margin-bottom: 12px; font-weight: 650;
}

.timeline { display: flex; flex-direction: column; }
.timeline-row { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 10px 0; }
.timeline-row + .timeline-row { border-top: 1px solid var(--line); }
.timeline-time { color: var(--blue); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.timeline-what { font-size: 14.5px; }
.timeline-note { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }

.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; gap: 12px; font-size: 14.5px; }
.kv-row span:first-child { color: var(--ink-soft); flex: none; min-width: 132px; }

.prep { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.prep li { font-size: 14.5px; }
.prep .why-small { display: block; color: var(--ink-faint); font-size: 13px; }

.money { display: flex; flex-direction: column; }
.money-row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 0; font-size: 14.5px;
}
.money-row + .money-row { border-top: 1px solid var(--line); }
.money-row.is-total { border-top: 1px solid var(--line-strong); font-weight: 650; }
.money-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.money-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.step { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.owner {
  flex: none; font-size: 11px; letter-spacing: 0.01em;
  border-radius: 999px; padding: 3px 9px; margin-top: 2px;
  border: 1px solid var(--line-strong); color: var(--ink-soft);
}
.owner.is-meow { color: var(--blue); border-color: rgba(93, 153, 210, 0.32); background: var(--bg-soft); }

.risk { font-size: 14px; }
.risk + .risk { margin-top: 11px; }
.risk b { font-weight: 600; }
.risk span { color: var(--ink-soft); display: block; }

.disclaimer { background: var(--warn-wash); border-top: 1px solid rgba(200, 135, 58, 0.22); }
.disclaimer h4 { color: var(--warn); }
.disclaimer ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13.5px; }
.disclaimer li + li { margin-top: 4px; }

/* --- Ошибки -------------------------------------------------------------- */

.error {
  background: var(--bad-wash);
  border: 1px solid rgba(204, 107, 94, 0.28);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-size: 14px;
  color: #9d4538;
}

/* --- Приглашение партнёра ------------------------------------------------ */

.invite-card { border-color: var(--line-strong); }
.invite-title { font-size: 16px; font-weight: 650; margin-bottom: 5px; }
.invite-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }

.invite-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.invite-row .question-free { flex: 1; min-width: 180px; margin-top: 0; }

.invite-link {
  display: block; width: 100%;
  margin: 12px 0;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--blue);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.invite-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.share-button {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px; font-weight: 550;
  color: var(--ink); text-decoration: none;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.share-button:hover { border-color: var(--blue-light); transform: translateY(-1px); }

.waiting {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  color: var(--ink-soft); font-size: 13.5px;
}
.waiting i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue-light);
  animation: bounce 1.5s infinite var(--ease);
}

.partner-answer { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.partner-note { margin-top: 9px; color: var(--ink-soft); font-size: 14px; font-style: italic; }

.hint-line { color: var(--ink-faint); font-size: 12.5px; margin-top: 10px; }

/* --- Страница опроса ----------------------------------------------------- */

.survey-body { padding-bottom: 48px; }
.survey { max-width: 600px; margin: 0 auto; padding: 28px 20px 48px; }
.survey-loading { color: var(--ink-faint); text-align: center; padding: 40px 0; }
.survey-head { margin-bottom: 20px; }
.survey-head h1 { font-size: 25px; line-height: 1.25; }
.survey-head h1 b { color: var(--blue); font-weight: 700; }
.survey-head p { color: var(--ink-soft); font-size: 15px; margin: 10px 0 0; }
.survey-name { margin-bottom: 14px; }
.survey .question-chips .chip { font-size: 15px; padding: 10px 17px; }
.survey-actions { margin-top: 20px; }
.survey-actions .primary-button { width: 100%; padding: 14px; font-size: 16px; }

.survey-done { text-align: center; padding: 48px 0; }
.survey-done-mark { margin-bottom: 14px; }
.survey-done h1 { font-size: 27px; }
.survey-done p { color: var(--ink-soft); margin: 10px auto 0; max-width: 360px; }

/* --- Экраны приложения --------------------------------------------------- */

.app-body { padding-bottom: 44px; }
.page { max-width: 680px; margin: 0 auto; padding: 24px 20px 56px; }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 27px; }
.page-head p { color: var(--ink-soft); font-size: 15px; margin: 8px 0 0; }

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

.muted { color: var(--ink-soft); }
.small { font-size: 13.5px; }
.empty-note { color: var(--ink-faint); font-size: 14.5px; }
.plain-list { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 14px; }
.plain-list li + li { margin-top: 4px; }

.section-title {
  font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--ink-faint); font-weight: 650;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-section-block { margin-top: 28px; }
.plan-section-block > .section-title { margin-bottom: 12px; }

.switch-line { margin-top: 18px; color: var(--ink-soft); font-size: 14.5px; text-align: center; }

/* Вход через Google. Кнопка светлая и явно не главная: основной путь —
   почта и пароль, Google рядом как короткая дорожка. */
.google-block { margin-top: 18px; }
.or-line {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-faint); font-size: 13px; margin-bottom: 14px;
}
.or-line::before, .or-line::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--line);
}
.google-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  font-size: 15.5px; font-weight: 600; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.google-button:hover { background: var(--blue-wash); border-color: var(--blue-light); }
.google-mark {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-wash-strong); color: #4285F4;
  font-weight: 700; font-size: 15px;
}
.center-card { text-align: center; }
.center-card h1 { font-size: 23px; line-height: 1.3; }
.center-card h1 b { color: var(--blue); }
.center-card p { margin: 10px 0 18px; }
.back-link { display: inline-block; margin-top: 26px; }

/* --- Бейджи -------------------------------------------------------------- */

.badge {
  font-size: 11.5px; letter-spacing: 0.01em; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--ink-soft);
  background: var(--surface);
}
.badge-draft { color: var(--ink-faint); }
.badge-invitation_pending, .badge-warn { color: var(--warn); border-color: rgba(200,135,58,0.3); background: var(--warn-wash); }
.badge-accepted, .badge-ok { color: var(--ok); border-color: rgba(62,155,120,0.3); background: var(--ok-wash); }
.badge-declined, .badge-cancelled, .badge-bad { color: var(--bad); border-color: rgba(204,107,94,0.3); background: var(--bad-wash); }
.badge-muted { color: var(--ink-faint); }

/* --- Карточки планов ----------------------------------------------------- */

.plan-list { display: flex; flex-direction: column; gap: 11px; }

.plan-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 17px 19px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.plan-card:hover { border-color: var(--blue-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card-head h3 { font-size: 17px; }
.plan-card .meta { margin-top: 10px; }
.plan-card-note { margin-top: 9px; font-size: 13px; color: var(--warn); }

/* --- Уведомления --------------------------------------------------------- */

.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--r-sm); padding: 12px 15px;
  transition: transform 0.18s var(--ease);
}
.notif:hover { transform: translateX(2px); }
.notif.is-unread { border-left-color: var(--blue); background: var(--bg-soft); }
.notif-title { font-size: 14.5px; font-weight: 550; }
.notif-body { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }

/* --- Активности ---------------------------------------------------------- */

.activity-list { display: flex; flex-direction: column; gap: 11px; }

.activity {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 17px 19px;
  box-shadow: var(--shadow-sm);
}
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.activity-head h3 { font-size: 17px; }
.activity .meta { margin-top: 10px; }
.activity-actions { display: flex; gap: 16px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }

.booking-note {
  margin-top: 10px; padding: 9px 12px;
  background: var(--bg-soft); border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink-soft);
}

.attend-row { display: flex; align-items: center; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.attend-row .chip { padding: 7px 14px; font-size: 14px; }

.totals { margin-top: 14px; }
.warn-card { border-color: rgba(200,135,58,0.28); background: var(--warn-wash); margin-bottom: 14px; }

/* --- Оценка -------------------------------------------------------------- */

.stars { display: flex; gap: 4px; margin-bottom: 14px; }
.star {
  background: none; border: 0; padding: 2px 4px;
  font-size: 28px; line-height: 1; color: var(--line-strong);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.star:hover { transform: scale(1.14); }
.star.is-on { color: #E8B84B; }

.danger-zone { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }

/* --- Дорога и карта ------------------------------------------------------ */

.map {
  height: 260px;
  margin: 14px 0;
  border-radius: var(--r); border: 1px solid var(--line);
  overflow: hidden; background: var(--bg-soft);
}
.leaflet-container { background: var(--bg-soft); font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-control-attribution { background: rgba(255,255,255,0.78) !important; color: var(--ink-faint) !important; }
.leaflet-control-attribution a { color: var(--blue) !important; }

.travel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }

.legs { display: flex; flex-direction: column; margin: 12px 0 4px; }
.leg { display: flex; gap: 10px; padding: 9px 0; }
.leg + .leg { border-top: 1px solid var(--line); }
.leg-arrow { color: var(--blue-light); flex: none; }
.leg-body { min-width: 0; }
.leg-title { font-size: 14.5px; }
.leg-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-faint); margin-top: 2px;
}

/* --- Персонажи и пустые состояния ---------------------------------------- */

/* Герои живут в отдельном слое: пока картинок нет, блоки просто
   не показываются, и вёрстка не разъезжается. */
.heroes {
  display: flex; justify-content: center;
  margin: 0 auto 10px;
  width: 100%;
  max-width: 560px;
}
.heroes img, .hero-art {
  width: 100%; height: auto; display: block;
  animation: float 5.5s ease-in-out infinite;
}
/* Видео с героями — крупное, на всю ширину блока. Без рамки и тени:
   фон у ролика белый и должен сливаться со страницей. */
.heroes video {
  width: 100%; height: auto; display: block;
  border-radius: var(--r-lg);
  animation: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.scene {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-soft);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 14px;
}
.scene img, .scene video { width: 78px; height: 78px; object-fit: contain; flex: none; }
.scene-text { min-width: 0; }
.scene-title { font-weight: 650; font-size: 15.5px; }
.scene-sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }

.empty-state {
  text-align: center;
  padding: 26px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty-state img { width: 110px; height: auto; margin: 0 auto 12px; display: block; }
.empty-state .empty-title { font-weight: 650; font-size: 16px; }
.empty-state .empty-sub { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }

/* --- Мобильные ----------------------------------------------------------- */

@media (max-width: 640px) {
  .page { padding: 18px 16px 48px; }
  .page-head h1 { font-size: 23px; }
  .hero { padding: 0 0 22px; min-height: calc(100vh - 56px); }
  .hero-stage { min-height: 42vh; }
  .hero-panel { margin-top: -28px; padding: 20px 18px 18px; width: calc(100% - 24px); }
  .examples .chip { font-size: 13.5px; padding: 8px 14px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 15px; margin-bottom: 20px; }

  .top { padding: 10px 14px; gap: 8px; }
  .brand { min-width: 0; }
  .brand-text small { display: none; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .brand-text strong { font-size: 16px; }
  .top-right { flex-shrink: 0; gap: 6px; }
  .ghost-button { padding: 7px 12px; font-size: 13px; }
  .mode-badge { font-size: 10px; padding: 4px 8px; }

  .composer-hero { padding: 14px; }
  .composer-hero textarea { min-height: 78px; }
  .composer-row { align-self: stretch; }
  .composer-hero .primary-button { flex: 1; min-width: 0; }
  .thread-actions { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .thread-actions .ghost-button,
  .thread-actions .primary-button { flex: 1; font-size: 13.5px; padding: 10px 12px; }

  .turn-user { max-width: 88%; }
  .questions-actions { flex-direction: column; align-items: flex-start; gap: 9px; }
  .invite-row { flex-direction: column; align-items: stretch; }
  .invite-row .primary-button { width: 100%; }
  .share-button { flex: 1; justify-content: center; }
  .field-row { flex-direction: column; gap: 14px; }
  .activity-actions { flex-wrap: wrap; gap: 13px; }
  /* Главные действия на узком экране — во всю строку, по одному.
     Внешние ссылки остаются компактными и встают по несколько в ряд,
     иначе карточка вытягивается на пол-экрана. */
  .option-actions > * { flex: 1 1 100%; padding: 0 12px; }
  .option .invite-actions > * { flex: 0 0 auto; padding: 0 12px; font-size: 13px; }
  .kv-row { flex-direction: column; gap: 2px; }
  .kv-row span:first-child { min-width: 0; font-size: 13px; }
  .timeline-row { grid-template-columns: 50px 1fr; }
  .survey-head h1 { font-size: 22px; }
  .scene img, .scene video { width: 64px; height: 64px; }
  .thread { padding-bottom: 120px; }
  .app-body { padding-bottom: 32px; }
}

/* На узких экранах шапке не хватает места на все три кнопки:
   оставляем словесный знак, значок прячем. */
@media (max-width: 430px) {
  .brand-mark { display: none; }
  /* Длинное имя модели на узком экране прижимает логотип — прячем его. */
  .mode-badge { font-size: 9.5px; padding: 4px 7px; max-width: 72px; overflow: hidden;
                text-overflow: ellipsis; white-space: nowrap; }
  .ghost-button { padding: 6px 11px; font-size: 12.5px; }
  .counter { min-width: 17px; height: 17px; font-size: 10.5px; margin-left: 4px; }
}

/* Уважаем системную настройку «меньше движения». */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .heroes img, .hero-art { animation: none; }
}

/* --- Подсказка о погоде --------------------------------------------------- */

.weather-hint {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  font-size: 14px;
}
.weather-hint.is-wet { background: var(--warn-wash); }
.weather-mark { font-size: 17px; line-height: 1; }
.weather-hint b { font-weight: 600; }
.weather-advice { color: var(--ink-soft); }

/* Второй шаг выбора времени появляется под частью суток. */
.slot-row { margin-top: 8px; }

/* --- Бронирование -------------------------------------------------------- */

/* Вне карточек вариантов бронь остаётся обычной светлой кнопкой. */
.share-button.is-booking { color: var(--blue); font-weight: 600; }
.share-button.is-small { padding: 6px 12px; font-size: 13px; }

.booking-block {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.booking-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-faint); margin-bottom: 8px;
}
.booking-window { color: var(--blue); font-weight: 600; }

/* --- Выбор времени ------------------------------------------------------- */

/* Сетка получасовых меток: быстрый выбор в один тап, одинаковая ширина
   колонок — глаз не прыгает по разной длине подписей. */
.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.time-chip {
  padding: 9px 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

@media (max-width: 640px) {
  .time-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
  .time-chip { font-size: 13.5px; padding: 10px 0; }
}

/* Настоящее место под заголовком варианта и честная подпись про бронь. */
.venue-line {
  margin: -2px 0 10px;
  font-size: 15px;
  color: var(--ink);
}

.venue-line span {
  color: var(--ink-soft);
  font-weight: 500;
}

.venue-about {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.booking-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Полоса дня: что уже занято и какие окна остались свободными. */
.day-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 14px;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 15px;
}

.day-row.is-busy {
  background: var(--blue-wash-strong);
  color: var(--ink);
  font-weight: 550;
}

.day-row.is-free {
  background: var(--surface);
  border: 1px dashed var(--line);
}

.day-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.day-what { flex: 1 1 auto; }

.day-row .ghost-button.is-small {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}

/* Афиша города: карточки анонсов из открытых каналов. */
.events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px;
}

.event-card {
  display: block;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--blue-wash);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.event-card:hover { background: var(--blue-wash-strong); }

.event-source {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-bottom: 3px;
}

.event-text {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
}
