/* =========================================================
   MOV — «жидкое стекло»
   Правила: без обводок (border/outline), без цветных теней,
   без свечения. Тени — только нейтральные, мягкие, для глубины.
   Углы — сильно скруглены.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Literata:opsz,wght@6..72,400;6..72,500;6..72,600&display=swap');

:root {
  --r-xl: 34px;
  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-full: 999px;

  --pad: 20px;

  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-read: 'Literata', Georgia, 'Times New Roman', serif;

  /* нейтральная тень — только для глубины, не цветная и не свечение */
  --shadow-1: 0 1px 2px rgba(24, 12, 48, 0.05), 0 8px 24px -8px rgba(24, 12, 48, 0.16);
  --shadow-2: 0 4px 10px rgba(24, 12, 48, 0.08), 0 16px 40px -12px rgba(24, 12, 48, 0.22);
  --shadow-soft: 0 2px 6px rgba(24, 12, 48, 0.07);

  /* размытие уменьшено — форму «стекла» теперь даёт преломление (SVG-дисторсия),
     а не сила блюра */
  --glass-blur: 8px;
  --glass-blur-fallback: 20px;
  --glass-sat: 195%;

  /* ---- светлая тема (по умолчанию) ---- */
  --bg-canvas: #f4f2fa;
  --glass-fill: rgba(255, 255, 255, var(--glass-alpha, 0.58));
  --glass-fill-strong: rgba(255, 255, 255, 0.76);
  --glass-fill-soft: rgba(255, 255, 255, 0.4);
  --text-1: #1a1726;
  --text-2: rgba(26, 23, 38, 0.6);
  --text-3: rgba(26, 23, 38, 0.4);
  --accent: #6e56cf;
  --accent-2: #d6499b;
  --track-fill: rgba(26, 23, 38, 0.09);

  /* затемняющая/осветляющая плёнка поверх фонового фото — держит текст,
     который лежит прямо на канвасе (не на стекле), читаемым */
  --scrim-op: 0.42;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg-canvas: #100c1c;
  --glass-fill: rgba(35, 29, 54, var(--glass-alpha, 0.46));
  --glass-fill-strong: rgba(40, 34, 61, 0.68);
  --glass-fill-soft: rgba(40, 34, 61, 0.32);
  --text-1: #f2eefb;
  --text-2: rgba(242, 238, 251, 0.64);
  --text-3: rgba(242, 238, 251, 0.4);
  --accent: #a892ff;
  --accent-2: #f27ab8;
  --track-fill: rgba(242, 238, 251, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.24), 0 10px 28px -10px rgba(0, 0, 0, 0.55);
  --shadow-2: 0 6px 14px rgba(0, 0, 0, 0.3), 0 20px 46px -14px rgba(0, 0, 0, 0.6);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.32);

  --scrim-op: 0.32;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg-canvas: #100c1c;
    --glass-fill: rgba(35, 29, 54, var(--glass-alpha, 0.46));
    --glass-fill-strong: rgba(40, 34, 61, 0.68);
    --glass-fill-soft: rgba(40, 34, 61, 0.32);
    --text-1: #f2eefb;
    --text-2: rgba(242, 238, 251, 0.64);
    --text-3: rgba(242, 238, 251, 0.4);
    --accent: #a892ff;
    --accent-2: #f27ab8;
    --track-fill: rgba(242, 238, 251, 0.12);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.24), 0 10px 28px -10px rgba(0, 0, 0, 0.55);
    --shadow-2: 0 6px 14px rgba(0, 0, 0, 0.3), 0 20px 46px -14px rgba(0, 0, 0, 0.6);
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.32);
    --scrim-op: 0.32;
    color-scheme: dark;
  }
}

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

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-canvas);
}

/* body — неподвижная «рама»: сама никогда не скроллится, поэтому
   фиксированный фон физически не может уехать при скролле контента.
   Скроллится только внутренний контейнер .app. */
body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--text-1);
  transition: background-color .4s ease;
}

button, input {
  font-family: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}
button { cursor: pointer; }
button:focus-visible, .continue-card:focus-visible, .fab-search:focus-visible {
  filter: brightness(1.08);
}

svg { display: block; }

[hidden] { display: none !important; }

/* ---------------------------------------------------------
   Фон: фото приложения + зернистость сверху. Оба слоя —
   position:fixed внутри неподвижного body, поэтому при скролле
   .app они физически не могут сдвинуться.

   Раньше здесь был анимированный точечный паттерн (mask-position
   плыл в бесконечном keyframes каждые 90s) — он тормозил приложение
   не только при скролле, а вообще всегда: фон под стеклянными
   панелями менялся каждый кадр, и backdrop-filter пересчитывал
   преломление 60 раз в секунду даже когда экран никто не трогал.
   Статичное фото ничего не анимирует, поэтому этот источник лагов
   пропадает целиком. */
.pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: center/cover no-repeat url('images/bg.jpg');
}

/* Плёнка цвета канваса поверх фото: сама фотография очень тёмная,
   а часть текста (заголовки экранов и т.п.) лежит прямо на фоне,
   а не на стекле, — без этой плёнки он бы терялся, особенно в
   светлой теме. */
.pattern::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-canvas);
  opacity: var(--scrim-op);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------
   Стекло — базовый приём
   --------------------------------------------------------- */
/* Стекло с преломлением: SVG-фильтр (feTurbulence -> feDisplacementMap)
   гнёт то, что видно сквозь панель, как настоящее стекло, а не просто
   размывает его. -webkit-backdrop-filter — запасной вариант для браузеров
   без поддержки SVG-фильтров в backdrop-filter (например, Safari): там
   остаётся просто более сильный блюр. */
.glass {
  position: relative;
  contain: paint;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur-fallback)) saturate(var(--glass-sat));
  backdrop-filter: url(#glass-distortion) blur(var(--glass-blur)) saturate(var(--glass-sat)) brightness(1.05);
  box-shadow: var(--shadow-1);
}

/* Кромка стекла: вместо блёклой заливки через всю грань — резкая тонкая
   светлая линия по внутреннему верхнему краю (там задаётся box-shadow
   выше) плюс компактный блик-глянец в углу, где «ловит» свет. Оба слоя
   не зависят от backdrop-filter, поэтому работают и там, где SVG-дисторсия
   недоступна (например, Safari). */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130% 100% at 14% -14%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 42%);
  mix-blend-mode: overlay;
}

/* мелкие элементы — облегчённый фильтр (без хроматической аберрации,
   меньше область фильтра): и на маленькой площади преломление выглядит
   аккуратнее, и стоит заметно дешевле — таких элементов на экране много */
.icon-btn.glass,
.chip.glass,
.stat-card.glass {
  backdrop-filter: url(#glass-distortion-sm) blur(var(--glass-blur)) saturate(var(--glass-sat)) brightness(1.05);
}

/* Вложенное стекло (кнопка/сегмент-контрол внутри уже стеклянной шапки) —
   без собственного backdrop-filter: родитель уже размыл фон, повторный
   тяжёлый фильтр только дублирует работу GPU и не даёт заметной разницы. */
.library-header .icon-btn.glass,
.library-header .segmented.glass {
  background: var(--glass-fill-strong);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---------------------------------------------------------
   Каркас приложения
   --------------------------------------------------------- */
.app {
  position: relative;
  z-index: 2;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.screen {
  padding: max(env(safe-area-inset-top), 22px) var(--pad) 0;
  min-height: 100dvh;
  animation: rise .42s cubic-bezier(.22,1,.36,1);
}

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

.tab-spacer { height: 118px; }

/* Шапка библиотеки прилипает к верху экрана — обложки книг уезжают под неё
   при скролле, а не наоборот. Отрицательные отступы «съедают» верхний и
   боковые паддинги .screen, чтобы бар был во всю ширину, затем те же
   значения возвращены внутрь как padding — контент оказывается там же,
   где был бы без стика. */
.library-header {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: calc(-1 * max(env(safe-area-inset-top), 22px)) calc(-1 * var(--pad)) 0;
  padding: max(env(safe-area-inset-top), 22px) var(--pad) 16px;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.library-header .segmented { margin-bottom: 0; }
.screen-library .continue-card { margin-top: 20px; }

/* ---------------------------------------------------------
   Топбар / заголовки
   --------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.brand-mark {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
}
.topbar h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.topbar-search { align-items: center; margin-bottom: 18px; }

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  color: var(--text-1);
  flex-shrink: 0;
  transition: transform .18s ease, background-color .3s ease;
}
.icon-btn:active { transform: scale(.92); }

.avatar {
  width: 46px;
  height: 46px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.avatar-lg { width: 60px; height: 60px; font-size: 22px; }

/* ---------------------------------------------------------
   Сегментированный контрол
   --------------------------------------------------------- */
.segmented {
  position: relative;
  display: flex;
  padding: 5px;
  border-radius: var(--r-full);
  margin-bottom: 22px;
}
.seg-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 10px 0;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  transition: color .25s ease;
}
.seg-btn.is-active { color: var(--text-1); }
.seg-thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 3);
  border-radius: var(--r-full);
  background: var(--glass-fill-strong);
  box-shadow: var(--shadow-soft);
  transition: transform .32s cubic-bezier(.22,1,.36,1);
}

/* ---------------------------------------------------------
   Карточка «продолжить чтение»
   --------------------------------------------------------- */
.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-xl);
  margin-bottom: 30px;
  transition: transform .18s ease;
}
.continue-card:active { transform: scale(.98); }

.continue-cover {
  width: 58px;
  height: 78px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.92);
}
.cover-glyph { width: 26px; height: 26px; }

.continue-info { flex: 1; min-width: 0; }
.continue-label {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.continue-info h3 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-2);
}
.progress-track {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--track-fill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.chev { color: var(--text-3); flex-shrink: 0; }

.section-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------
   Сетка книг
   --------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 8px;
}
.book-card { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.book-cover {
  aspect-ratio: 3 / 4.3;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease;
}
.book-card:active .book-cover { transform: scale(.96); }
.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(255,255,255,.28), rgba(255,255,255,0) 45%);
}
.book-cover .cover-title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1.22;
}
.book-meta { padding: 0 2px; }
.book-meta .b-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-meta .b-author {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-grad-1 { background: linear-gradient(150deg, #6e56cf, #9b82f0); }
.cover-grad-2 { background: linear-gradient(150deg, #4338ca, #6d5bd0); }
.cover-grad-3 { background: linear-gradient(150deg, #b23d6d, #e8779e); }
.cover-grad-4 { background: linear-gradient(150deg, #0f8b8d, #3fc5bd); }
.cover-grad-5 { background: linear-gradient(150deg, #b5792e, #e8ac5e); }
.cover-grad-6 { background: linear-gradient(150deg, #443c5e, #7a6fa0); }

/* ---------------------------------------------------------
   Плавающая строка поиска на библиотеке
   --------------------------------------------------------- */
.fab-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border-radius: var(--r-full);
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  margin: 22px 0 6px;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--r-full);
  color: var(--text-2);
}
.search-field input {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.search-field input::placeholder { color: var(--text-3); font-weight: 500; }

.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 26px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
}

/* ---------------------------------------------------------
   Читалка
   --------------------------------------------------------- */
.screen-reader { padding: 0; }

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: max(env(safe-area-inset-top), 16px) 14px 0;
  padding: 10px 10px 10px 10px;
  border-radius: var(--r-full);
}
.reader-title {
  text-align: center;
  flex: 1;
  min-width: 0;
}
.reader-title p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-title span {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 600;
}

.reader-page {
  min-height: 100dvh;
  padding: 110px 26px 160px;
  font-family: var(--font-read);
  font-size: var(--reader-fs, 18px);
  line-height: 1.75;
  transition: background-color .45s ease, color .45s ease;
}
.reader-page p { margin: 0 0 1.3em; }
.reader-page .drop-cap {
  font-weight: 600;
  font-size: 1.18em;
  margin-bottom: .9em;
}

.reader-page[data-reader-theme="sepia"] { background: #f4ecd8; color: #493c2c; }
.reader-page[data-reader-theme="light"] { background: #fffdf9; color: #2a2620; }
.reader-page[data-reader-theme="dark"]  { background: #191622; color: #ded7ef; }

.reader-toolbar {
  position: fixed;
  left: 50%;
  bottom: max(env(safe-area-inset-bottom), 20px);
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  border-radius: var(--r-full);
  width: min(92%, 420px);
  justify-content: space-between;
}
.tool-btn {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-1);
  padding: 8px 12px;
  border-radius: var(--r-full);
}
.theme-dots { display: flex; gap: 10px; }
.theme-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease;
  position: relative;
}
.theme-dot.is-active { transform: scale(1.15); }
.theme-dot.is-active::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--glass-fill-soft);
  z-index: -1;
}
.dot-light { background: #fffdf9; }
.dot-sepia { background: #e9dcbd; }
.dot-dark  { background: #26212f; }

/* ---------------------------------------------------------
   Профиль
   --------------------------------------------------------- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-xl);
  margin-bottom: 22px;
}
.profile-hero h3 { margin: 0 0 3px; font-size: 18px; font-weight: 800; }
.profile-hero p { margin: 0; font-size: 13px; color: var(--text-3); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}
.stat-card {
  padding: 16px 8px;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num { font-size: 20px; font-weight: 800; }
.stat-label { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.settings-list {
  border-radius: var(--r-xl);
  padding: 6px 18px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
}
.settings-row + .settings-row { position: relative; }
.settings-row + .settings-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--track-fill);
}
.settings-row > span:first-child { font-size: 14.5px; font-weight: 700; }

.mini-segmented {
  display: flex;
  padding: 4px;
  border-radius: var(--r-full);
  background: var(--track-fill);
}
.mini-seg-btn {
  padding: 7px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.mini-seg-btn.is-active {
  background: var(--glass-fill-strong);
  color: var(--text-1);
  box-shadow: var(--shadow-soft);
}

.glass-slider {
  -webkit-appearance: none;
  width: 128px;
  height: 6px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--accent) 0 65%, var(--track-fill) 65%);
}
.glass-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.glass-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.glass-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--track-fill);
}

.toggle {
  width: 50px;
  height: 30px;
  border-radius: var(--r-full);
  background: var(--track-fill);
  position: relative;
  transition: background-color .25s ease;
  flex-shrink: 0;
}
.toggle .toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
}
.toggle.is-on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.toggle.is-on .toggle-knob { transform: translateX(20px); }

/* ---------------------------------------------------------
   Нижняя навигация
   --------------------------------------------------------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(env(safe-area-inset-bottom), 18px);
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 8px;
  border-radius: var(--r-full);
  width: min(88%, 340px);
}
.tab-item {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 9px;
  border-radius: var(--r-full);
  color: var(--text-3);
  transition: color .25s ease;
}
.tab-item span { font-size: 10.5px; font-weight: 700; }
.tab-item.is-active { color: var(--accent); }
.tab-thumb {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: calc((100% - 16px) / 3);
  border-radius: var(--r-full);
  background: var(--glass-fill-strong);
  box-shadow: var(--shadow-soft);
  transition: transform .34s cubic-bezier(.22,1,.36,1);
  z-index: 0;
}

/* ---------------------------------------------------------
   Установка PWA — плашка
   --------------------------------------------------------- */
.install-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(92%, 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-xl);
  animation: rise .5s cubic-bezier(.22,1,.36,1);
}
.install-icon img { border-radius: var(--r-md); display: block; }
.install-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.install-text strong { font-size: 13.5px; font-weight: 800; }
.install-text span { font-size: 11.5px; color: var(--text-3); }
.install-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.install-dismiss {
  color: var(--text-3);
  font-size: 13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (min-width: 481px) {
  body { display: flex; justify-content: center; }
  .app { box-shadow: var(--shadow-2); border-radius: var(--r-xl); margin: 18px auto; height: calc(100dvh - 36px); }
}
