/* ============================================================
   Луна — интерфейс в стиле iOS (iPhone, системный дизайн).
   Системный сгруппированный фон, SF-типографика, сегментированные
   переключатели, bottom-sheets, iMessage-чат, тёмная тема.
   ============================================================ */
:root {
  color-scheme: light dark;

  /* системные токены (light) */
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --fill: #E9E9EB;
  --separator: rgba(60, 60, 67, 0.18);
  --separator-strong: rgba(60, 60, 67, 0.32);

  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);

  --tint: #AF52DE;                 /* system purple */
  --tint-deep: #8E31C7;
  --tint-soft: rgba(175, 82, 222, 0.12);
  --rose: #FF2D55;                 /* system pink — менструация */
  --rose-soft: rgba(255, 45, 85, 0.12);
  --peach: #FF9500;                /* system orange — прогноз */
  --peach-soft: rgba(255, 149, 0, 0.14);
  --green: #34C759;                /* system green — фертильное окно */
  --green-soft: rgba(52, 199, 89, 0.14);
  --green-deep: #248A3D;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.03), 0 6px 20px rgba(0, 0, 0, 0.04);
  --shadow-seg: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.16), 0 -1px 1px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 2px 10px rgba(175, 82, 222, 0.3);

  --radius: 16px;
  --radius-lg: 20px;
  --radius-seg: 9px;
  --radius-full: 999px;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.32, 0.72, 0.18, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-2: #2C2C2E;
    --fill: #26262A;
    --separator: rgba(84, 84, 88, 0.6);
    --separator-strong: rgba(235, 235, 245, 0.3);

    --label: #FFFFFF;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);

    --tint: #BF5AF2;
    --tint-deep: #AF52DE;
    --tint-soft: rgba(191, 90, 242, 0.22);
    --rose: #FF375F;
    --rose-soft: rgba(255, 55, 95, 0.22);
    --peach: #FF9F0A;
    --peach-soft: rgba(255, 159, 10, 0.22);
    --green: #32D74B;
    --green-soft: rgba(50, 215, 75, 0.22);
    --green-deep: #30D158;

    --shadow-btn: 0 2px 10px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* мягкие цветные пятна — единственный намёк на бренд на системном фоне */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46rem 30rem at 90% -12%, rgba(175, 82, 222, 0.10), transparent 62%),
    radial-gradient(40rem 28rem at -12% 24%, rgba(255, 45, 85, 0.07), transparent 60%),
    radial-gradient(42rem 30rem at 55% 112%, rgba(255, 149, 0, 0.06), transparent 62%);
}

/* тонкие скроллбары в тон приложению */
.view,
.chat-messages,
.panel,
#chat-input {
  scrollbar-width: thin;
  scrollbar-color: var(--label-3) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--label-3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--separator-strong); }

#app {
  max-width: 700px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Шапка — Large Title + сегментированный переключатель (как iOS)
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--separator);
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand svg {
  color: #fff;
  background: linear-gradient(135deg, #BF5AF2 0%, #FF375F 100%);
  border-radius: 13px;
  padding: 6px;
  width: 34px;
  height: 34px;
  box-shadow: var(--shadow-btn);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--label);
}

.brand-sub { font-size: 12.5px; color: var(--label-2); }

.tabs {
  display: flex;
  gap: 2px;
  margin-top: 12px;
  background: var(--fill);
  border-radius: var(--radius-seg);
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  border-radius: calc(var(--radius-seg) - 2px);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.tab:hover { color: var(--label); }

.tab.active {
  background: var(--surface);
  color: var(--label);
  font-weight: 600;
  box-shadow: var(--shadow-seg);
}

/* ============================================================
   Контент
   ============================================================ */
main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  scroll-behavior: smooth;
}

.view.active { display: flex; }

/* ============================================================
   Карточки — сгруппированные, как в системных приложениях iOS
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-card);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--label);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--label);
}

.card p { margin: 0; }

/* ---------- фаза цикла: hero-карточка ---------- */
.phase-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(30rem 18rem at 100% -20%, rgba(175, 82, 222, 0.22), transparent 60%),
    radial-gradient(26rem 16rem at -10% 110%, rgba(255, 45, 85, 0.14), transparent 60%),
    var(--surface);
  border: 1px solid var(--separator);
}

.phase-card::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.9), rgba(175, 82, 222, 0.16) 68%);
  filter: blur(4px);
  pointer-events: none;
}

.phase-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.phase-top p { color: var(--label-2); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }

.phase-badge {
  position: relative;
  z-index: 1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 14px;
  padding: 9px 14px;
  min-width: 88px;
  box-shadow: var(--shadow-card);
}

.phase-badge span {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tint);
  font-variant-numeric: tabular-nums;
}

.phase-badge small { font-size: 11px; color: var(--label-2); }

.progress-track {
  position: relative;
  z-index: 1;
  height: 7px;
  background: var(--fill);
  border-radius: var(--radius-full);
  margin-top: 18px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--rose), var(--tint));
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(175, 82, 222, 0.45);
  transition: width 0.5s var(--ease);
}

/* ---------- прогноз ---------- */
.pred-list { list-style: none; margin: 0; padding: 0; }

.pred-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 14px;
}

.pred-list li + li { border-top: 1px solid var(--separator); }

.pred-list li span { color: var(--label-2); }
.pred-list li strong {
  color: var(--label);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- луна ---------- */
.moon-card { display: flex; gap: 16px; align-items: center; }

.moon-icon {
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--tint-soft);
  color: var(--tint);
}

.moon-icon svg { width: 26px; height: 26px; }

.moon-name { font-weight: 600; color: var(--label); }
.moon-guidance { font-size: 13.5px; color: var(--label-2); margin-top: 4px; line-height: 1.5; }

/* ---------- аффирмация ---------- */
.affirmation-card p {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--label);
}

/* ---------- действия ---------- */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============================================================
   Кнопки — filled / tinted / plain, как в iOS
   ============================================================ */
.btn {
  appearance: none;
  border: none;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  padding: 13px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s var(--ease), opacity 0.15s ease,
              background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn:focus-visible,
.icon-btn:focus-visible,
.tab:focus-visible,
.cal-day:focus-visible,
.seg-btn:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--tint);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover { background: var(--tint-deep); }

.btn-secondary {
  background: var(--tint-soft);
  color: var(--tint);
}

.btn-secondary:hover { background: color-mix(in srgb, var(--tint-soft) 75%, var(--tint) 25%); }

.btn-ghost {
  background: transparent;
  color: var(--tint);
}

.btn-ghost:hover { background: var(--tint-soft); }

.icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--tint);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.icon-btn:hover { background: var(--tint-soft); }
.icon-btn:active { transform: scale(0.92); opacity: 0.8; }

/* ============================================================
   Календарь — точки под числом (как в приложении «Календарь»)
   ============================================================ */
.cal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.cal-header h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 17px;
  text-transform: capitalize;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  appearance: none;
  border: none;
  background: transparent;
  aspect-ratio: 1;
  border-radius: 50%;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--label);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cal-day:hover { background: var(--surface-2); }
.cal-day:active { transform: scale(0.9); }
.cal-day.blank { pointer-events: none; }

.cal-day span { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }

.cal-day::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}

.cal-day.m-period::after { background: var(--rose); }
.cal-day.m-predicted::after { background: var(--peach); }
.cal-day.m-fertile::after { background: var(--green); }
.cal-day.m-period.m-predicted::after { background: linear-gradient(90deg, var(--rose) 0 50%, var(--peach) 50% 100%); }

.cal-day.m-ovulation {
  background: var(--tint);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(175, 82, 222, 0.35);
}

.cal-day.m-today { box-shadow: 0 0 0 2px var(--tint); }
.cal-day.m-today span { font-weight: 700; }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--label-2);
}

.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-period { background: var(--rose); }
.dot-predicted { background: var(--peach); }
.dot-fertile { background: var(--green); }
.dot-ovulation { background: var(--tint); }

.cal-hint { margin-top: 12px; font-size: 12px; color: var(--label-3); }

/* ---------- записи ---------- */
.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
}

.period-row + .period-row { border-top: 1px solid var(--separator); }

.period-row-info { display: flex; flex-direction: column; gap: 2px; }
.period-row-info span:first-child { font-weight: 600; font-size: 14px; }
.period-row-sub { font-size: 12.5px; color: var(--label-2); }

.empty-note { font-size: 14px; color: var(--label-2); line-height: 1.5; }

/* ============================================================
   Панели — bottom-sheets как в iOS (затемнение + лист снизу)
   ============================================================ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.scrim.on {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 700px;
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: min(82dvh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.22);
}

.panel.open {
  display: flex;
  animation: sheet-in 0.32s var(--ease);
}

.panel::before {
  content: "";
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--separator-strong);
  margin: -2px auto 10px;
  flex: none;
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-header h3 { margin: 0; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-size: 13px; font-weight: 500; color: var(--label-2); }

input[type="date"], input[type="text"], textarea {
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--label);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover, textarea:hover { background: color-mix(in srgb, var(--surface-2) 82%, var(--label) 18%); }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--tint);
  box-shadow: 0 0 0 4px var(--tint-soft);
}

textarea { resize: vertical; }

::placeholder { color: var(--label-3); }

.panel-actions { display: flex; gap: 10px; }
.panel-actions .btn { flex: 1; }

/* ---------- сегментированные переключатели ---------- */
.seg-block { display: flex; flex-direction: column; gap: 8px; }
.seg-label { font-size: 13px; font-weight: 500; color: var(--label-2); }

.seg-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--fill);
  border-radius: var(--radius-seg);
  padding: 2px;
}

.seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-seg) - 2px);
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--label);
  font-weight: 600;
  box-shadow: var(--shadow-seg);
}

/* ============================================================
   Чат — iMessage
   ============================================================ */
#view-chat { padding: 0; }

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg { display: flex; }
.msg--user { justify-content: flex-end; }
.msg--bot { justify-content: flex-start; align-items: flex-end; gap: 8px; }

/* аватар Луны */
.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #BF5AF2 0%, #FF375F 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(175, 82, 222, 0.35);
}

.avatar svg { width: 15px; height: 15px; }

.bubble {
  max-width: 78%;
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.msg--user .bubble {
  background: var(--tint);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.msg--bot .bubble {
  background: var(--fill);
  color: var(--label);
  border-bottom-left-radius: 6px;
}

.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 6px 0 8px; padding-left: 20px; }
.bubble li { margin: 3px 0; }
.bubble blockquote {
  margin: 8px 0;
  padding: 7px 13px;
  border-left: 3px solid var(--tint);
  color: var(--label-2);
  font-style: italic;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border-radius: 0 10px 10px 0;
}
.bubble h4 { margin: 12px 0 5px; font-size: 15.5px; font-weight: 700; }
.bubble code {
  background: color-mix(in srgb, var(--tint-soft) 60%, transparent);
  color: var(--tint);
  padding: 1.5px 6px;
  border-radius: 7px;
  font-size: 13px;
}

/* индикатор стриминга — три пульсирующие точки */
.bubble[data-streaming="1"]::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  width: 20px;
  height: 8px;
  background-image:
    radial-gradient(circle at 4px 4px, currentColor 2px, transparent 2.6px),
    radial-gradient(circle at 10px 4px, currentColor 2px, transparent 2.6px),
    radial-gradient(circle at 16px 4px, currentColor 2px, transparent 2.6px);
  background-repeat: no-repeat;
  animation: blink 1.1s infinite;
}

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

/* ---------- подсказки ---------- */
/* На десктопе чипы переносятся на новую строку; скролл — только на телефонах,
   где им нужен один ряд, чтобы не съедать вертикаль у списка сообщений. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 16px 10px;
  flex: none;
}

.chips-label { font-size: 12px; color: var(--label-2); margin-right: 2px; }

.chat-wrap.has-history .chips { display: none; }

.chip {
  appearance: none;
  border: 1px solid var(--separator);
  background: var(--surface);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tint);
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s ease, transform 0.1s ease;
}

.chip:hover { background: var(--tint-soft); }
.chip:active { transform: scale(0.96); }

/* ---------- ввод ---------- */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--separator);
}

#chat-input {
  flex: 1;
  max-height: 130px;
  border-radius: 18px;
  background: var(--fill);
  resize: none;
}

#chat-input:focus { background: var(--surface-2); }

.chat-input-row .btn {
  flex: none;
  height: 36px;
  padding: 0 16px;
  font-size: 15px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-input-row .icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
}

.disclaimer {
  margin: 0;
  padding: 4px 16px 10px;
  font-size: 10.5px;
  color: var(--label-3);
  text-align: center;
  line-height: 1.4;
  flex: none;
}

.hidden { display: none !important; }

/* ============================================================
   Мелкие экраны + доступность
   ============================================================ */
/* Компактная шапка на телефонах — больше места контенту */
@media (max-width: 480px) {
  .app-header { padding: calc(10px + env(safe-area-inset-top)) 14px 8px; }

  /* Чипы в один ряд с горизонтальным скроллом — не тратят вертикаль */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar { display: none; }

  .chips-label, .chip { flex: none; white-space: nowrap; }

  .brand-name { font-size: 23px; }

  .brand svg {
    width: 30px;
    height: 30px;
    padding: 5px;
    border-radius: 11px;
  }

  .tabs { margin-top: 9px; }

  .tab { padding: 7px 8px; font-size: 12.5px; }
}

@media (max-width: 380px) {
  .bubble { max-width: 90%; }
  .card { padding: 16px; }
  .phase-badge { min-width: 76px; }
  .chat-input-row { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .chat-input-row .btn { padding: 0 12px; }
}

/* Маленькая высота экрана (альбомная/раскрытая клавиатура): убираем чипы
   в любом состоянии и максимально расширяем ленту сообщений */
@media (max-height: 640px) {
  .chips { display: none; }
  .disclaimer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
}
