/* Трекер сна — mobile-first, тёмная тема ночью. */

:root {
  --bg: #f6efe7;
  --bg-elev: #fff8f1;
  --bg-card: #fffaf3;
  --ink: #322036;
  --ink-soft: #5e4a5b;
  --ink-mute: #8a7785;
  --line: #ead8c6;
  --line-soft: #efe1d2;
  --accent: #6b4d63;          /* приглушённый бордово-розовый */
  --accent-soft: #c89bb1;
  --accent-bg: #f4dde5;
  --green: #587a4a;          /* тёплый зелёный */
  --green-soft: #d3e3c9;
  --green-bg: #ecf3e6;
  --amber: #b8851f;          /* янтарный для предупреждений */
  --amber-bg: #f5e8c8;
  --rose: #b1606e;           /* для опасного — мягкий */
  --rose-bg: #f3d7dc;
  --sand: #d8c19a;
  --shadow: 0 6px 24px rgba(99, 70, 88, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --tap: 44px;
  --header-bg: rgba(246, 239, 231, 0.92);
  --header-blur: saturate(160%) blur(14px);
  color-scheme: light;
}

:root.night {
  --bg: #1a1320;
  --bg-elev: #22182b;
  --bg-card: #271c30;
  --ink: #f1e0d8;
  --ink-soft: #c9b4c2;
  --ink-mute: #957e90;
  --line: #3a2a40;
  --line-soft: #2f2035;
  --accent: #d8a8c4;
  --accent-soft: #b07f99;
  --accent-bg: #3a2332;
  --green: #a9c79a;
  --green-soft: #6b8a5a;
  --green-bg: #1f2d1c;
  --amber: #d8b367;
  --amber-bg: #3a2c14;
  --rose: #d29098;
  --rose-bg: #3a1f24;
  --sand: #b39a72;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(26, 19, 32, 0.92);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overscroll-behavior-y: contain;
}

body {
  font-size: 17px;
  line-height: 1.45;
  transition: background 400ms ease, color 400ms ease;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="text"],
input[type="number"],
textarea, select {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 12px 14px;
  width: 100%;
  min-height: var(--tap);
  outline: none;
  transition: border-color 160ms;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

textarea { resize: vertical; min-height: 80px; line-height: 1.4; }

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.4);
}
:root.night input[type="date"]::-webkit-calendar-picker-indicator,
:root.night input[type="datetime-local"]::-webkit-calendar-picker-indicator,
:root.night input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

a { color: var(--accent); }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  position: relative;
  z-index: 1;
}

/* === Хедер === */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: var(--header-blur);
  backdrop-filter: var(--header-blur);
  border-bottom: 1px solid var(--line-soft);
  padding-top: env(safe-area-inset-top);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  min-height: 56px;
}
.header__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  flex: 0 0 auto;
}
.header__child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 12px;
  min-height: 36px;
  cursor: pointer;
  transition: background 160ms;
}
.header__child:hover { background: var(--accent-bg); }
.header__child svg { width: 16px; height: 16px; }
.header__child-name { font-weight: 600; }

.header__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: transparent;
}
.header__icon:hover { color: var(--ink); background: var(--line-soft); }
.header__icon svg { width: 22px; height: 22px; }

.header__actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* === Основное === */

.main {
  flex: 1;
  padding: 18px 18px 40px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin: 28px 4px 12px;
  font-weight: 600;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: background 400ms ease, border-color 400ms ease;
}

.row { display: flex; gap: 10px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  transition: transform 120ms, background 160ms, color 160ms, border-color 160ms;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-soft); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--line-soft); }

.btn--green { background: var(--green); color: #fff; }
.btn--amber { background: var(--amber); color: #fff; }
.btn--rose { background: var(--rose); color: #fff; }

.btn--lg { min-height: 60px; font-size: 18px; padding: 0 26px; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 100px; }
.btn--block { width: 100%; }

/* === Большая кнопка трекера === */

.tracker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 18px;
}
.tracker__state {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin: 0 0 16px;
}
.tracker__big {
  --size: 220px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), var(--accent));
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 36px rgba(107, 77, 99, 0.25), inset 0 -6px 16px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  transition: transform 120ms, box-shadow 200ms;
  position: relative;
}
.tracker__big:hover { transform: scale(1.02); }
.tracker__big:active { transform: scale(0.97); }
.tracker__big[data-state="sleeping"] {
  background: radial-gradient(circle at 30% 30%, #87a08f, var(--green));
  box-shadow: 0 12px 36px rgba(88, 122, 74, 0.3), inset 0 -6px 16px rgba(0, 0, 0, 0.1);
}
.tracker__big svg { width: 44px; height: 44px; margin-bottom: 10px; }

.tracker__timer {
  margin-top: 18px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tracker__hint {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
}

.tracker__window {
  margin-top: 22px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.tracker__window-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.tracker__window-label strong { color: var(--ink); font-weight: 600; }

.window-bar {
  position: relative;
  height: 16px;
  background: var(--line-soft);
  border-radius: 100px;
  overflow: visible;
}
.window-bar__zone {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--green-soft);
  opacity: 0.7;
}
.window-bar__zone--ok { background: var(--green-soft); }
.window-bar__zone--early { background: var(--amber-bg); }
.window-bar__zone--late { background: var(--rose-bg); }
.window-bar__cursor {
  position: absolute;
  top: -4px;
  width: 6px;
  height: 24px;
  background: var(--ink);
  border-radius: 4px;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.window-bar__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
}

/* === Список действий трекера === */

.tracker__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  width: 100%;
  justify-content: center;
}
.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 15px;
  color: var(--ink-soft);
  transition: background 160ms, color 160ms;
}
.quick-chip:hover { background: var(--accent-bg); color: var(--ink); }
.quick-chip svg { width: 18px; height: 18px; }
.quick-chip--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Переключатель экранов (табы) === */

.tabs {
  display: flex;
  background: var(--bg-elev);
  border-radius: 100px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  margin: 12px 0 22px;
}
.tabs__btn {
  flex: 1;
  min-height: 40px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 160ms, color 160ms;
}
.tabs__btn--active {
  background: var(--bg-card);
  color: var(--ink);

  box-shadow: var(--shadow);
}

/* === Метрики === */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.metric {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  transition: background 400ms ease, border-color 400ms ease;
}
.metric__label {
  font-size: 13px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.metric__value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.metric__hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}
.metric--ok    { border-color: var(--green-soft); background: var(--green-bg); }
.metric--amber { border-color: var(--amber);      background: var(--amber-bg); }
.metric--rose  { border-color: var(--rose);       background: var(--rose-bg); }

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

.rec {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
}
.rec + .rec { margin-top: 10px; }
.rec__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent-bg);
  color: var(--accent);
}
.rec__title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.rec__body  { font-size: 14px; color: var(--ink-soft); margin: 0 0 6px; line-height: 1.45; }
.rec__tip   { font-size: 13px; color: var(--ink-mute); }
.rec--deficit .rec__icon { background: var(--rose-bg);  color: var(--rose); }
.rec--over    .rec__icon { background: var(--amber-bg); color: var(--amber); }
.rec--under   .rec__icon { background: var(--amber-bg); color: var(--amber); }
.rec--shift   .rec__icon { background: var(--accent-bg);color: var(--accent); }
.rec--late    .rec__icon { background: var(--accent-bg);color: var(--accent); }
.rec--early   .rec__icon { background: var(--accent-bg);color: var(--accent); }
.rec--reduce  .rec__icon { background: var(--green-bg); color: var(--green); }

/* === Теги (качество, место, признаки усталости) === */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.tag {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  transition: background 160ms, color 160ms, border-color 160ms;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tag:hover { background: var(--accent-bg); color: var(--ink); }
.tag--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.tag--active.tag--green { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.tag--active.tag--amber { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.tag--active.tag--rose  { background: var(--rose-bg);  border-color: var(--rose);  color: var(--rose);  }

/* === История === */

.history { display: flex; flex-direction: column; gap: 10px; }
.history__item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.history__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.history__icon--night { background: var(--line-soft); color: var(--ink-soft); }
.history__body  { min-width: 0; }
.history__time  { font-size: 14px; color: var(--ink); font-weight: 600; }
.history__meta  { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.history__meta-item {
  font-size: 12px;
  color: var(--ink-mute);
  background: var(--line-soft);
  border-radius: 100px;
  padding: 3px 8px;
}
.history__actions { display: flex; gap: 4px; }
.history__reopen {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-soft);
  border-radius: 100px;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}

.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
}
.iconbtn:hover { background: var(--line-soft); color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; }

/* === Графики и тепловая карта === */

.chart {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: background 400ms ease, border-color 400ms ease;
}
.chart__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.chart svg { width: 100%; height: auto; display: block; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heatmap__cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--line-soft);
}

/* === Поля ввода (form) === */

.field { display: block; margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}
.field__hint {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 6px;
}

/* === Модалка === */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal {
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  position: relative;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.25);
  animation: modalUp 240ms ease;
}
@keyframes modalUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-right: 48px;
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: background 160ms, color 160ms, transform 120ms;
}
.modal__close:hover { background: var(--line-soft); color: var(--ink); }
.modal__close:active { transform: scale(0.94); }
.modal__close svg { width: 20px; height: 20px; stroke-width: 2.2; }
.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal__actions .btn { flex: 1; }

/* === Пустые состояния === */

.empty {
  text-align: center;
  padding: 28px 18px;
  color: var(--ink-mute);
}
.empty__icon { font-size: 36px; margin-bottom: 8px; }

.disclaimer {
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 18px;
  line-height: 1.5;
}

/* === Онбординг === */

.onboard {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  text-align: center;
}
.onboard__logo { font-size: 56px; margin-bottom: 8px; }
.onboard__title { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.onboard__sub {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 24px;
  line-height: 1.45;
}
.onboard .field { text-align: left; }

/* === Профили детей === */

.child-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.child-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  background: var(--accent-bg);
  color: var(--accent);
  flex-shrink: 0;
}
.child-avatar--boy  { background: #d8e4f0; color: #4a6b8a; }
.child-avatar--girl { background: var(--accent-bg); color: var(--accent); }

/* === Переключатели выбора (пол, тема) === */

.choice { display: flex; gap: 10px; }
.choice__btn {
  flex: 1;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.choice__btn:hover { background: var(--accent-bg); color: var(--ink); }
.choice__btn--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Лента дня === */

.day-strip {
  display: flex;
  gap: 3px;
  align-items: stretch;
  height: 32px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line-soft);
}
.day-strip__sleep { height: 100%; background: var(--accent-soft); }
.day-strip__sleep--night { background: var(--accent); }
.day-strip__comment {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* === Утилиты === */

.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.center { text-align: center; }
.muted  { color: var(--ink-mute); }
.small  { font-size: 14px; }

/* === Под-события у активного сна (пауза) === */

.tracker__sub-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
  width: 100%;
}
.tracker__big--paused {
  background: radial-gradient(circle at 30% 30%, var(--amber-soft, #e0c08a), var(--amber));
  animation: pulsePause 1.6s ease-in-out infinite;
}
@keyframes pulsePause {
  0%, 100% { box-shadow: 0 12px 36px rgba(184, 133, 31, 0.3), inset 0 -6px 16px rgba(0, 0, 0, 0.1); }
  50%      { box-shadow: 0 12px 48px rgba(184, 133, 31, 0.5), inset 0 -6px 16px rgba(0, 0, 0, 0.1); }
}

/* === Тост === */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 200;
  max-width: calc(100% - 32px);
  text-align: center;
  animation: toastIn 200ms ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* === Фиалки на заднем плане === */

.violets {
  display: none;
}
.balloons { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.balloon { position: absolute; width: 72px; height: 108px; opacity: .38; }
.balloon::before {
  content: ''; position: absolute; top: 0; left: 4px; width: 64px; height: 78px;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 33% 27%, #eef8e8 0, #d5e9c9 35%, #b8d5ad 100%);
  box-shadow: inset -9px -8px 14px rgba(78, 125, 82, .12);
}
.balloon::after {
  content: ''; position: absolute; top: 76px; left: 35px; width: 1px; height: 32px;
  background: #92b397;
}
.balloon:nth-child(1) { top: 8%; left: -24px; transform: rotate(-12deg); }
.balloon:nth-child(2) { top: 27%; right: -28px; transform: rotate(9deg) scale(.85); }
.balloon:nth-child(3) { bottom: 15%; left: -30px; transform: rotate(7deg) scale(.75); }
.balloon:nth-child(4) { bottom: 5%; right: -28px; transform: rotate(-9deg) scale(.9); }
html.night .balloon { opacity: .2; }
.violets__item {
  position: absolute;
  animation: violets-drift 22s ease-in-out infinite;
  will-change: transform;
}
.violets__item:nth-child(1) { top: 4%;   left: -6%;  transform: rotate(-12deg) scale(.9);  animation-delay: -1s;  opacity: .55; }
.violets__item:nth-child(2) { top: 18%;  right: -8%; transform: rotate(8deg)  scale(1.1); animation-delay: -5s;  opacity: .65; }
.violets__item:nth-child(3) { bottom: 12%; left: -4%;  transform: rotate(-6deg)  scale(.8);  animation-delay: -10s; opacity: .50; }
.violets__item:nth-child(4) { bottom: 22%; right: 2%;  transform: rotate(14deg) scale(1);   animation-delay: -16s; opacity: .60; }
.violets__item:nth-child(5) { top: 44%;  left: 4%;   transform: rotate(20deg) scale(.7);  animation-delay: -8s;  opacity: .45; }
.violets__item:nth-child(6) { top: 58%;  right: -10%;transform: rotate(-10deg) scale(1.05);animation-delay: -13s; opacity: .58; }
@keyframes violets-drift {
  0%, 100% { transform: translate3d(0,0,0) rotate(var(--r,0deg)) scale(var(--s,1)); }
  50%      { transform: translate3d(8px,-12px,0) rotate(calc(var(--r,0deg) + 4deg)) scale(calc(var(--s,1) * 1.03)); }
}
/* Дневная тема: голубые лепестки, зелёные листья, жёлтая серединка */
html.day .violets__item .petals { fill: #5a8fd6; }
html.day .violets__item .leaves { fill: #4a7a3a; }
html.day .violets__item .center circle:nth-child(1) { fill: #f4c84a; }
/* Ночная тема: глубокий синий с лёгким свечением */
html.night .violets__item {
  filter: drop-shadow(0 0 22px rgba(111, 158, 224, 0.25));
}
html.night .violets__item .petals { fill: #7da7e8; }
html.night .violets__item .leaves { fill: #3a6a4a; }
@media (prefers-reduced-motion: reduce) {
  .violets__item { animation: none; }
}

/* === Узкие экраны === */


/* === Нижняя навигация === */

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--bg-elev);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
}
.bottomnav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 8px;
}
.bottomnav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 4px 8px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 160ms;
}
.bottomnav__btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
.bottomnav__btn--active {
  color: var(--accent);
}
.bottomnav__btn--active svg {
  color: var(--accent);
}
@media (max-width: 360px) {
  .bottomnav__btn { font-size: 10px; min-height: 52px; }
  .bottomnav__btn svg { width: 20px; height: 20px; }
}

@media (max-width: 360px) {
  .main { padding: 14px 14px 36px; }
  .header__inner { padding: 10px 14px; }
  .header__title { font-size: 18px; }
  .tracker__big { --size: 180px; font-size: 22px; }
  .tracker__timer { font-size: 26px; }
}
