/* DAYLIGHT: «новое оформление» в духе iOS. Подключается ПОСЛЕ style.css и glass.css; pult.css при этом отключается (см. index.html и
   applyDesign в app.js). Тема следует за пользователем: светлая и тёмная (Telegram: html[data-theme], вне него: системная настройка).
   Откат: переключатель «Оформление» в «Аккаунте» или localStorage espublish_ui != "day". Меняются только цвета, фон, формы и движение;
   разметка страниц и логика те же. */
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/inter-tight-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/inter-tight-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ----- Палитра: светлая (пастельный «рабочий стол») ----- */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", 'Inter Tight', system-ui, sans-serif;
  --bg: #E9EBF0; --bg2: rgba(255, 255, 255, 0.7); --surface: rgba(250, 250, 253, 0.92);
  --text: #111114; --text2: #6B6B76; --hint: #8A8A93;
  --accent: #111114; --accent-text: #FFFFFF;
  --line: rgba(60, 60, 90, 0.1); --line-hover: rgba(60, 60, 90, 0.2); --hover: rgba(60, 60, 90, 0.05);
  --glass: rgba(60, 60, 90, 0.06); --glass-soft: rgba(255, 255, 255, 0.62);
  --card-glass: rgba(255, 255, 255, 0.72); --dash: rgba(60, 60, 90, 0.2); --divider: rgba(60, 60, 90, 0.08);
  --glass-bd: rgba(255, 255, 255, 0.9); --hi: #FFFFFF;
  --sh: 0 10px 30px rgba(60, 60, 90, 0.1), 0 1px 2px rgba(60, 60, 90, 0.06);
  --sh-soft: 0 2px 8px rgba(60, 60, 90, 0.1);
  --field-line: rgba(60, 60, 90, 0.17); --field-bg: rgba(255, 255, 255, 0.92);
  --tab-on: #0A74F0; --tab-lens: rgba(60, 70, 110, 0.12); --tab-lens-bd: rgba(60, 70, 110, 0.08);
  --tab-lens-hi: rgba(255, 255, 255, 0.55); --tab-lens-edge: rgba(255, 255, 255, 0.95);
  --glow: rgba(17, 17, 20, 0.2); --danger: #D62B2B;
  --dl-a: rgba(255, 255, 255, 0.95); --dl-b: rgba(110, 120, 156, 0.2); --dl-c: rgba(140, 150, 186, 0.16); --dl-d: rgba(70, 80, 120, 0.1);
  --dl-grid: rgba(60, 70, 110, 0.07);
  --dl-bar: rgba(233, 235, 240, 0.8);
  --r-card: 26px; --r-field: 16px; --gap-card: 12px;
}
/* ----- Тёмная: графит с приглушёнными цветными пятнами ----- */
html[data-theme="dark"] {
  --bg: #090A0F; --bg2: rgba(255, 255, 255, 0.06); --surface: rgba(26, 26, 38, 0.93);
  --text: #F5F5F7; --text2: rgba(245, 245, 247, 0.64); --hint: rgba(245, 245, 247, 0.42);
  --accent: #F5F5F7; --accent-text: #0B0B12;
  --line: rgba(255, 255, 255, 0.1); --line-hover: rgba(255, 255, 255, 0.2); --hover: rgba(255, 255, 255, 0.07);
  --glass: rgba(255, 255, 255, 0.07); --glass-soft: rgba(255, 255, 255, 0.05);
  --card-glass: rgba(34, 34, 48, 0.58); --dash: rgba(255, 255, 255, 0.18); --divider: rgba(255, 255, 255, 0.07);
  --glass-bd: rgba(255, 255, 255, 0.1); --hi: rgba(255, 255, 255, 0.14);
  --sh: 0 14px 40px rgba(0, 0, 0, 0.5);
  --sh-soft: 0 2px 10px rgba(0, 0, 0, 0.4);
  --field-line: rgba(255, 255, 255, 0.16); --field-bg: rgba(255, 255, 255, 0.06);
  --tab-on: #4DA3FF; --tab-lens: rgba(0, 0, 0, 0.34); --tab-lens-bd: rgba(255, 255, 255, 0.06);
  --tab-lens-hi: rgba(255, 255, 255, 0.16); --tab-lens-edge: rgba(255, 255, 255, 0.3);
  --glow: rgba(245, 245, 247, 0.14); --danger: #FF6B6B;
  --dl-a: rgba(96, 110, 170, 0.3); --dl-b: rgba(70, 82, 140, 0.22); --dl-c: rgba(50, 62, 110, 0.26); --dl-d: rgba(0, 0, 0, 0.45);
  --dl-grid: rgba(150, 165, 220, 0.06);
  --dl-bar: rgba(9, 10, 15, 0.78);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #090A0F; --bg2: rgba(255, 255, 255, 0.06); --surface: rgba(26, 26, 38, 0.93);
    --text: #F5F5F7; --text2: rgba(245, 245, 247, 0.64); --hint: rgba(245, 245, 247, 0.42);
    --accent: #F5F5F7; --accent-text: #0B0B12;
    --line: rgba(255, 255, 255, 0.1); --line-hover: rgba(255, 255, 255, 0.2); --hover: rgba(255, 255, 255, 0.07);
    --glass: rgba(255, 255, 255, 0.07); --glass-soft: rgba(255, 255, 255, 0.05);
    --card-glass: rgba(34, 34, 48, 0.58); --dash: rgba(255, 255, 255, 0.18); --divider: rgba(255, 255, 255, 0.07);
    --glass-bd: rgba(255, 255, 255, 0.1); --hi: rgba(255, 255, 255, 0.14);
    --sh: 0 14px 40px rgba(0, 0, 0, 0.5);
    --sh-soft: 0 2px 10px rgba(0, 0, 0, 0.4);
    --field-line: rgba(255, 255, 255, 0.16); --field-bg: rgba(255, 255, 255, 0.06);
    --tab-on: #4DA3FF; --tab-lens: rgba(0, 0, 0, 0.34); --tab-lens-bd: rgba(255, 255, 255, 0.06);
    --tab-lens-hi: rgba(255, 255, 255, 0.16); --tab-lens-edge: rgba(255, 255, 255, 0.3);
  --glow: rgba(245, 245, 247, 0.14); --danger: #FF6B6B;
    --dl-a: rgba(96, 110, 170, 0.3); --dl-b: rgba(70, 82, 140, 0.22); --dl-c: rgba(50, 62, 110, 0.26); --dl-d: rgba(0, 0, 0, 0.45);
    --dl-grid: rgba(150, 165, 220, 0.06);
    --dl-bar: rgba(9, 10, 15, 0.78);
  }
}

/* ----- Фон: строгий, но не плоский — холодный графит с мягким верхним светом, тонкая сетка под маской и виньетка ----- */
body { font-family: var(--sans); }
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 42% at 50% 0%, var(--dl-a) 0%, transparent 70%),
    radial-gradient(circle at 12% 78%, var(--dl-c) 0%, transparent 42%),
    radial-gradient(circle at 92% 40%, var(--dl-b) 0%, transparent 40%),
    var(--bg);
  animation: dl-drift-a 60s ease-in-out infinite alternate; will-change: transform; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; animation: none; will-change: auto;   /* glass.css крутил этот слой (bg-drift) — сетка «ехала» наклонно */
  background:
    linear-gradient(var(--dl-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--dl-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(ellipse 120% 80% at 50% 110%, var(--dl-d) 0%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 0%, transparent 78%); }
@keyframes dl-drift-a { 0% { transform: translate3d(-2%, -1%, 0) scale(1); } 100% { transform: translate3d(2%, 3%, 0) scale(1.06); } }
@keyframes dl-drift-b { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(0, 0, 0); } }
body.keyboard-open::before, body.keyboard-open::after { animation-play-state: paused; }

/* ----- Шапка: фон идёт под «островком», содержимое — под ним ----- */
.head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 0; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.035em; }
.top.scrolled .head { background: var(--dl-bar);
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); }
html[data-theme="dark"] .top.scrolled .head { background: var(--dl-bar); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .top.scrolled .head { background: var(--dl-bar); } }
.account { box-shadow: var(--sh); }

/* ----- Вкладки, сегменты, чипы ----- */
.tabs button { font-size: 15px; font-weight: 600; padding: 9px 17px; box-shadow: var(--sh); }
.tabs button.on, .tabs button.on:hover { box-shadow: 0 8px 22px var(--glow); }
.seg { padding: 4px; box-shadow: var(--sh-soft); }
.seg__hl { transition: transform 420ms cubic-bezier(0.3, 1.25, 0.4, 1), width 420ms cubic-bezier(0.3, 1.25, 0.4, 1), height 420ms ease-out; box-shadow: 0 4px 14px var(--glow); }
/* чипы лежат в прокручиваемой полосе: тень у них не нужна (контейнер обрезал бы её в видимый прямоугольник), хватает рамки и стекла */
.chip { box-shadow: none; }
.chips { padding: 2px 2px 4px; }
/* ряд чипов на странице тянется до краёв экрана: при прокрутке чипы уходят за край телефона, а не обрезаются посреди страницы */
.chips:not(.card .chips):not(.section-card .chips):not(.cr-kicker .chips) { margin-left: calc(-1 * var(--side, 16px)); margin-right: calc(-1 * var(--side, 16px));
  padding: 2px var(--side, 16px) 14px; margin-bottom: -6px; scroll-padding-inline: var(--side, 16px); }

/* ----- Заголовки ----- */
.page-title { margin: 6px 0 18px; font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.section { margin: 26px 4px 12px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.item__title { font-weight: 600; letter-spacing: -0.01em; }

/* ----- Поверхности: матовое стекло, мягкая тень, крупные скругления ----- */
.card, .list, .tile, .stat, .bubble, .thumb, .table-wrap, .banner, .pcard, .ccard, .section-collapsible,
.job__card, .dialog, .upload, .editor__preview, .profile-card, .section-card {
  background: var(--card-glass); border: 1px solid var(--glass-bd); border-radius: var(--r-card);
  box-shadow: var(--sh), inset 0 1px 0 var(--hi);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); }
.pcard { border-radius: 24px; }
.pcard__art { border-radius: 18px; }
.sheet__panel, .cp-panel { background: var(--surface); border-radius: 30px 30px 0 0; }
.toast { border-radius: 999px; box-shadow: var(--sh); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.avatar { border-radius: 50%; }

/* ----- Кнопки и поля ----- */
.btn { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; padding: 15px 22px; box-shadow: 0 10px 24px var(--glow); transition: transform 160ms cubic-bezier(0.3, 1.3, 0.5, 1), opacity 200ms ease-out, background 200ms ease-out, border-color 200ms ease-out; }
.btn--soft, .btn--ghost, .btn--danger { box-shadow: none; }
.btn:active { transform: scale(0.96); }
input[type=text], input[type=search], input[type=password], input[type=datetime-local], textarea, select {
  border-radius: var(--r-field); background: var(--glass-soft); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.actions { background: var(--dl-bar); border-top-color: var(--line); }
html[data-theme="dark"] .actions { background: var(--dl-bar); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .actions { background: var(--dl-bar); } }

/* ----- Движение: страница появляется снизу, карточки приподнимаются ----- */
@keyframes dl-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.view > * { animation: dl-rise 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.view > *:nth-child(2) { animation-delay: 40ms; } .view > *:nth-child(3) { animation-delay: 80ms; }
.view > *:nth-child(4) { animation-delay: 120ms; } .view > *:nth-child(5) { animation-delay: 160ms; }
.view > *:nth-child(n+6) { animation-delay: 200ms; }
.cards > * { animation: dl-rise 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 55ms + 60ms); }
.tpl-card, .ccard--tap, .pcard, .item { transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), background 120ms ease-out, border-color 200ms ease-out; }
@media (hover: hover) { .tpl-card:hover, .ccard--tap:hover, .pcard:hover { transform: translateY(-3px); } }
.tpl-card:active, .ccard--tap:active, .pcard:active { transform: scale(0.97); }
.tpl-card.on { box-shadow: 0 0 0 2px var(--accent), var(--sh); }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  .view > *, .cards > * { animation: none; }
}

/* =====================================================================================================================
   Структура нового оформления (как в макете «Daylight»): шапка с кружком-аватаром, плавающая нижняя панель с иконками,
   большая карточка «Последний макет» и ряд «Все макеты». Классическое оформление этих правил не получает.
   ===================================================================================================================== */

/* ----- Шапка: название слева, аватар кружком справа ----- */
.account { padding: 3px; width: 44px; height: 44px; justify-content: center; border-radius: 50%; gap: 0; }
.account__name, .account .chev { display: none; }
.account .avatar { width: 36px; height: 36px; font-size: 15px; font-weight: 700; }
.page-title { font-size: 36px; }

/* ----- Нижняя панель в духе «жидкого стекла» iOS: подписи всегда под иконками, у выбранной — стеклянная «линза» ----- */
body > .tabs {
  position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 7;
  width: min(calc(100% - 32px), calc(var(--n, 4) * 88px + 12px)); margin: 0 auto; height: 68px; padding: 6px; gap: 0; overflow: visible;
  display: flex; align-items: stretch;
  background: var(--card-glass); border: 1px solid var(--glass-bd); border-radius: 34px;
  box-shadow: var(--sh), inset 0 1px 0 var(--hi);
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); }
body > .tabs[hidden] { display: none; }
body > .tabs { touch-action: none; user-select: none; -webkit-user-select: none; }   /* палец можно вести по панели (см. initTabScrub в app.js) */
body > .tabs button { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 100%; padding: 0; font-size: 0; border: 0; border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: transparent; box-shadow: none;
  color: var(--text); -webkit-tap-highlight-color: transparent; transition: color 220ms ease-out;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
body > .tabs button::before { content: ""; display: block; flex: none; width: 26px; height: 26px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
body > .tabs button::after { content: attr(data-short); font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap; }
body > .tabs button:hover { background: transparent; color: var(--text); }
body > .tabs button.on, body > .tabs button.on:hover, body > .tabs button.hot { background: transparent; color: var(--tab-on); box-shadow: none; }
/* «линза»: темнее панели, едет к выбранной вкладке пружиной; под пальцем увеличивается и светлеет, как на iPhone */
body > .tabs .tabs__lens { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: var(--lens-w, 0px); border-radius: 999px; pointer-events: none;
  translate: var(--lens-x, 0px) 0; scale: 1; opacity: 0; background: var(--tab-lens); box-shadow: inset 0 0 0 1px var(--tab-lens-bd);
  transition: opacity 200ms ease-out, scale 320ms cubic-bezier(0.3, 1.3, 0.4, 1), background 240ms ease-out, box-shadow 240ms ease-out; }
body > .tabs.ready .tabs__lens { transition: translate 460ms cubic-bezier(0.3, 1.15, 0.4, 1), width 460ms cubic-bezier(0.3, 1.15, 0.4, 1),
  opacity 200ms ease-out, scale 320ms cubic-bezier(0.3, 1.3, 0.4, 1), background 240ms ease-out, box-shadow 240ms ease-out; }
body > .tabs.has-on .tabs__lens { opacity: 1; }
body > .tabs.pressed .tabs__lens { opacity: 1; scale: 1.18 1.12; background: var(--tab-lens-hi); box-shadow: inset 0 0 0 1px var(--tab-lens-edge), 0 8px 22px var(--glow);
  -webkit-backdrop-filter: blur(3px) saturate(1.8) brightness(1.08); backdrop-filter: blur(3px) saturate(1.8) brightness(1.08); }
body > .tabs.scrubbing .tabs__lens { transition: opacity 200ms ease-out, scale 320ms cubic-bezier(0.3, 1.3, 0.4, 1), background 240ms ease-out, box-shadow 240ms ease-out; }   /* за пальцем без запаздывания */
/* палец ведёт по панели: выбранной остаётся цвет только у той, что под линзой */
body > .tabs.scrubbing button.on:not(.hot) { color: var(--text); }
body > .tabs .tab-beta { display: none; }
body > .tabs .tab-badge { top: 5px; right: calc(50% - 22px); font-size: 10px; }   /* font-size кнопки 0, поэтому размер — здесь */
.tabs button[data-tab="create"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='5'/%3E%3Cpath d='M12 8.5v7M8.5 12h7'/%3E%3C/svg%3E"); }
.tabs button[data-tab="video"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='4'/%3E%3Cpath d='m10 9.5 5 2.5-5 2.5z'/%3E%3C/svg%3E"); }
.tabs button[data-tab="news"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 7h14M5 12h14M5 17h9'/%3E%3C/svg%3E"); }
.tabs button[data-tab="audio"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 10v4M9 7v10M13 4v16M17 8v8M21 11v2'/%3E%3C/svg%3E"); }
.tabs button[data-tab="snippets"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6h14a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-7l-4 3v-3H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); }
.tabs button[data-tab="posts"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='3'/%3E%3Cpath d='M4 10h16'/%3E%3C/svg%3E"); }
.tabs button[data-tab="base"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='m4 17 5-4 4 3 3-2 4 3'/%3E%3C/svg%3E"); }
.view { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
.toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
/* панель действий (формы, редакторы) стоит над меню — меню остаётся на экране всегда; клавиатура прячет обе */
#bar { left: 16px; right: 16px; max-width: 520px; margin: 0 auto; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.actions, .actions.editor-bottom-bar { padding-bottom: 8px; border: 1px solid var(--glass-bd); border-radius: 30px; box-shadow: var(--sh); }
body.has-bar .view { padding-bottom: calc(var(--bar-h, 60px) + 112px + env(safe-area-inset-bottom, 0px) + 20px); }
body.has-bar .toast { bottom: calc(var(--bar-h, 80px) + 104px + env(safe-area-inset-bottom, 0px)); }
body > .tabs { transition: opacity 150ms ease-out; }
body.keyboard-open > .tabs { opacity: 0; pointer-events: none; }

/* ----- «Создать»: карточка последнего макета и ряд всех макетов ----- */
.tpl-pick__head { margin: 6px 0 20px; }   /* левый край — тот же, что у логотипа, «Ведомства» и чипов (раньше стоял на 4 px правее) */
.tpl-pick__head .page-title { margin: 0; }
.tpl-pick__sub { font-size: 17px; font-weight: 500; line-height: 1.3; }
.tpl-hero { position: relative; overflow: hidden; min-height: 284px; margin: 0 0 6px; padding: 22px 24px 24px; border-radius: 36px; color: #fff;
  background: linear-gradient(150deg, #3A36FF 0%, #8B4DFF 48%, #FF5C9D 100%);
  box-shadow: 0 26px 50px rgba(95, 70, 255, 0.34); animation: dl-float 7s ease-in-out infinite; }
.tpl-hero[hidden] { display: none; }
.tpl-hero::before, .tpl-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.tpl-hero::before { width: 230px; height: 230px; right: -60px; top: -70px; background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%); animation: dl-orb 9s ease-in-out infinite; }
.tpl-hero::after { width: 150px; height: 150px; left: -40px; bottom: -30px; background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 70%); animation: dl-orb 11s ease-in-out infinite reverse; }
.tpl-hero > * { position: relative; z-index: 1; }
.tpl-hero__label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.tpl-hero__name { margin-top: 8px; font-size: 54px; line-height: 1.02; font-weight: 800; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.tpl-hero__sub { margin: 12px 0 18px; font-size: 15px; color: rgba(255, 255, 255, 0.82); }
.tpl-hero__go { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 24px; background: #fff; color: #111114;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 24px rgba(17, 17, 20, 0.25);
  transition: transform 200ms cubic-bezier(0.3, 1.3, 0.5, 1), box-shadow 200ms; }
.tpl-hero__go:active { transform: scale(0.95); }
.tpl-all { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }
.tpl-all[hidden] { display: none; }
.tpl-all__title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.tpl-all__toggle { border: 0; background: transparent; padding: 4px 2px; font: inherit; font-size: 15px; font-weight: 500; color: var(--text2); cursor: pointer; }
.tpl-pick .tpl-recent { display: none; }   /* «Недавние» заменены карточкой «Последний макет» */
.tpl-pick:not(.tpl-pick--all) .tpl-grid { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  margin: -10px calc(-1 * var(--side, 16px)) 0; padding: 12px var(--side, 16px) 30px; scroll-padding-inline: var(--side, 16px); }   /* поля с запасом: прокручиваемая полоса не должна обрезать тени карточек */
.tpl-pick:not(.tpl-pick--all) .tpl-grid::-webkit-scrollbar { display: none; }
.tpl-pick:not(.tpl-pick--all) .tpl-card { flex: 0 0 132px; scroll-snap-align: start; }
@keyframes dl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }   /* без поворота: на паузе кадра край карточки казался кривым */
@keyframes dl-orb { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-26px, 18px); } }
@media (prefers-reduced-motion: reduce) { .tpl-hero, .tpl-hero::before, .tpl-hero::after { animation: none; } }

/* ----- Переключатель в духе iOS: зелёный включённый, светлая дорожка, круглая ручка с тенью ----- */
.switch { width: 52px; height: 32px; }
.switch__knob { border-radius: 16px; background: rgba(120, 120, 128, 0.3); transition: background 260ms ease-out; }
.switch__knob::after { top: 2px; left: 2px; width: 28px; height: 28px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.2);
  transition: transform 320ms cubic-bezier(0.3, 1.3, 0.4, 1), width 200ms ease-out; }
.switch__input:checked + .switch__knob { background: #34C759; }
.switch__input:checked + .switch__knob::after { transform: translateX(20px); }
.switch__input:active + .switch__knob::after { width: 33px; }
.switch__input:checked:active + .switch__knob::after { transform: translateX(15px); }
html[data-theme="dark"] .switch__knob { background: rgba(120, 120, 128, 0.42); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .switch__knob { background: rgba(120, 120, 128, 0.42); } }
html[data-theme="dark"] .switch__input:checked + .switch__knob { background: #30D158; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .switch__input:checked + .switch__knob { background: #30D158; } }

/* ----- Поля ввода: видимая рамка (белое на белом в светлой теме сливалось) ----- */
input[type=text], input[type=search], input[type=password], input[type=datetime-local], input[type=number], textarea, select {
  background: var(--field-bg); border: 1px solid var(--field-line); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
::placeholder { color: var(--hint); opacity: 1; }
::selection { background: rgba(10, 132, 255, 0.28); }

/* ----- Липкий блок формы (превью + вкладки): стеклянная панель с закруглённым низом вместо полосы на всю ширину ----- */
.dock { padding: 8px var(--side) 10px; border-bottom: 1px solid var(--glass-bd); border-radius: 0 0 28px 28px;
  background: var(--dl-bar); box-shadow: 0 12px 30px rgba(60, 60, 90, 0.08); }
html[data-theme="dark"] .dock { background: var(--dl-bar); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .dock { background: var(--dl-bar); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); } }
.dock .upload, .dock .seg { box-shadow: none; }

/* ----- Карточки макетов: без рамки в рамке. Плитка-превью (3:4) со спокойной подложкой и скруглением, название — под ней, без своей коробки ----- */
.tpl-pick .tpl-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; gap: 0; }
.tpl-pick .tpl-card:hover { border-color: transparent; }
.tpl-pick .tpl-card__thumb { border-radius: 24px; background: var(--glass); border: 0; box-shadow: none;
  transition: background 220ms ease-out, box-shadow 220ms ease-out, transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.tpl-pick .tpl-card__img { inset: 9px; max-width: calc(100% - 18px); max-height: calc(100% - 18px); border-radius: 15px;
  box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(20, 20, 40, 0.22); }
.tpl-pick .tpl-card__body { padding: 10px 2px 0; gap: 2px; }
.tpl-pick .tpl-card__name { font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: 0; text-align: center; text-wrap: balance;
  -webkit-line-clamp: 3; color: var(--text2); transition: color 200ms ease-out; }
.tpl-pick .tpl-card.on .tpl-card__name, .tpl-pick .tpl-card:hover .tpl-card__name { color: var(--text); }
.tpl-pick .tpl-card.on { box-shadow: none; }
.tpl-pick .tpl-card.on .tpl-card__thumb { box-shadow: 0 0 0 2px var(--accent); }
@media (hover: hover) { .tpl-pick .tpl-card:hover { transform: none; } .tpl-pick .tpl-card:hover .tpl-card__thumb { transform: translateY(-3px); background: var(--hover); } }
.tpl-pick:not(.tpl-pick--all) .tpl-card { flex-basis: 128px; }
.tpl-pick:not(.tpl-pick--all) .tpl-grid { padding-bottom: 22px; }

/* ----- Выбор стиля: язык нижнего меню — стеклянная лента, под каждым цветом его название, у выбранного «линза» и синяя подпись ----- */
.sdots { gap: 2px; padding: 6px; border-radius: 30px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--hi);
  scroll-snap-type: x proximity; scroll-padding-inline: 6px; }
.sdot { flex: none; scroll-snap-align: center; width: auto; min-width: 66px; max-width: 88px; height: 70px; padding: 0 6px; gap: 6px;
  flex-direction: column; border-radius: 24px; color: var(--text); -webkit-tap-highlight-color: transparent;
  transition: background 240ms ease-out, color 200ms ease-out, box-shadow 240ms ease-out, transform 320ms cubic-bezier(0.3, 1.3, 0.4, 1); }
.sdot:active { transform: scale(0.94); }
.sdot__fill { flex: none; width: 36px; height: 36px; position: relative;
  /* только цвет стиля: объёмная «капля» — блик сверху слева, тёмный низ, цветное свечение под ней */
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.62) 0, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 72% 86%, color-mix(in srgb, var(--sa, #888) 55%, #000) 0, rgba(0, 0, 0, 0) 62%),
    var(--sa, #888) !important;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.16), inset 0 2px 3px rgba(255, 255, 255, 0.4), 0 6px 14px color-mix(in srgb, var(--sa, #888) 42%, transparent); }
.sdot.on .sdot__fill { animation: dl-drop-pulse 2.6s ease-in-out infinite; }   /* выбранный «дышит»: от него расходится мягкая волна его цвета */
@keyframes dl-drop-pulse {
  0% { box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.16), inset 0 2px 3px rgba(255, 255, 255, 0.4), 0 6px 14px color-mix(in srgb, var(--sa, #888) 42%, transparent), 0 0 0 0 color-mix(in srgb, var(--sa, #888) 50%, transparent); }
  70%, 100% { box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.16), inset 0 2px 3px rgba(255, 255, 255, 0.4), 0 6px 14px color-mix(in srgb, var(--sa, #888) 42%, transparent), 0 0 0 11px color-mix(in srgb, var(--sa, #888) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .sdot.on .sdot__fill { animation: none; } }
.sdot__base { display: none; }
.sdot::after { content: attr(aria-label); max-width: 100%; font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.sdot.on { background: var(--tab-lens); box-shadow: inset 0 0 0 1px var(--tab-lens-bd); color: var(--tab-on); }
.sdot.on .sdot__fill { transform: scale(1.08); }
.sdot__fill { transition: transform 320ms cubic-bezier(0.3, 1.3, 0.4, 1); }
@media (hover: hover) { .sdot:not(.on):hover { background: var(--hover); } }
.sdot--plus { font-size: 0; border: 0; background: transparent; color: var(--text2); }
.sdot--plus::before { content: "+"; flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  font-size: 22px; font-weight: 400; line-height: 1; color: var(--text2); border: 1.5px dashed var(--dash); }
.sdot--plus::after { font-size: 11px; }
.sdots__cap { display: none; }   /* название теперь под самим цветом, подсказка — подпись «Свой цвет» у плюса */

/* ----- Полоса прокрутки скрыта везде (белая вертикальная полоса справа при пролистывании); прокрутка работает как раньше ----- */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; background: transparent; }

/* ----- Чипы (ведомства и др.): выбранный плавно перекрашивается, нажатие пружинит ----- */
.chip { transition: background 280ms ease-out, color 220ms ease-out, border-color 280ms ease-out, box-shadow 320ms ease-out, transform 320ms cubic-bezier(0.3, 1.3, 0.4, 1); }
.chip:active { transform: scale(0.95); }
.chip.on { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .chip, .chip.on { transition: none; transform: none; } }

/* ----- Меню «⋯» панели действий: открывается над панелью, а не под нижним меню; панель действий выше нижнего меню по слою ----- */
#bar { z-index: 8; }
.menu { position: absolute; right: 6px; left: auto; bottom: calc(100% + 12px); min-width: 230px; padding: 6px; border-radius: 26px;
  background: var(--bg); border: 1px solid var(--glass-bd); box-shadow: var(--sh), inset 0 1px 0 var(--hi);   /* сплошной фон: под меню не должны просвечивать поля формы */
  transform-origin: 100% 100%; animation: dl-menu-in 260ms cubic-bezier(0.3, 1.2, 0.4, 1) both; }
.menu__item { min-height: 50px; padding: 0 16px; border-radius: 18px; font-weight: 600; }
@keyframes dl-menu-in { from { opacity: 0; transform: scale(0.9) translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }

/* ----- Круглая кнопка «+» (создать ведомство, канал, категорию…) стоит над нижним меню, а не под ним; списку добавлен запас под неё ----- */
.fab { right: 20px; bottom: calc(14px + 66px + 16px + env(safe-area-inset-bottom, 0px)); z-index: 6; width: 58px; height: 58px;
  box-shadow: 0 12px 28px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.18); transition: transform 320ms cubic-bezier(0.3, 1.3, 0.4, 1), opacity var(--ease); }
body.keyboard-open .fab { opacity: 0; pointer-events: none; }
body:has(.fab) .view { padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }   /* последняя строка списка не прячется под кнопку */

/* ----- Страница «Отправить новость» (для отправителей предложки): три карточки — материал, текст, канал; крупная кнопка ----- */
.nf-head { margin: 6px 0 20px; }
.nf-head .page-title { margin: 0 0 6px; }
.nf-head__sub { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--text2); }
.news-form { display: flex; flex-direction: column; gap: 12px; }
.news-form .bound-chip { align-self: flex-start; margin: 0; padding: 9px 16px; font-weight: 600; background: var(--card-glass); border: 1px solid var(--glass-bd); box-shadow: var(--sh-soft); }
.nf-card { margin: 0; padding: 18px; }
.nf-card__title { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: -0.005em; color: var(--text2); }
.nf-card .upload { margin: 0; max-width: none; border-radius: 22px; background: var(--glass); box-shadow: none; }
.nf-card .upload--empty { border: 1.5px dashed var(--dash); }
.nf-card .upload__ph { padding: 22px 16px; }
.nf-card .upload__plus { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--card-glass); box-shadow: var(--sh-soft); }
.nf-card .upload__plus::before { left: 13px; right: 13px; top: 21.25px; background: var(--text); }
.nf-card .upload__plus::after { top: 13px; bottom: 13px; left: 21.25px; background: var(--text); }
.nf-card .upload__hint { font-size: 17px; font-weight: 700; color: var(--text); }
.nf-card .upload__sub { margin-top: 4px; font-size: 13px; color: var(--hint); }
.nf-card textarea, .nf-card input[type=text] { margin: 0; }
.nf-card .counter { margin: 8px 4px 0; text-align: right; font-size: 12px; color: var(--hint); }
.nf-card .helper { margin: 10px 2px 0; font-size: 13px; line-height: 1.35; color: var(--hint); }
.nf-send { margin-top: 6px; }
.nf-send .btn { width: 100%; height: 56px; font-size: 17px; font-weight: 700; }
.news-done { padding: 40px 20px 28px; }
.news-done__check { position: relative; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: #34C759; box-shadow: 0 14px 30px rgba(52, 199, 89, 0.4);
  animation: dl-done-pop 520ms cubic-bezier(0.3, 1.5, 0.4, 1) both; }
.news-done__check::after { content: ""; position: absolute; left: 24px; top: 17px; width: 14px; height: 28px; border: solid #fff; border-width: 0 5px 5px 0; border-radius: 2px; transform: rotate(40deg); }
.news-done__title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
@keyframes dl-done-pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .news-done__check { animation: none; } }

/* ----- Генератор видео: шаги с номерами, значки «готово», подсказка о сборке, кадры-«карточки» ----- */
.view:has(.tt-step) { counter-reset: tt-step; }
.tt-step { counter-increment: tt-step; padding: 18px 18px 20px; }
.tt-step > .label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.tt-step > .label::before { content: counter(tt-step); flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--text2); font-size: 14px; font-weight: 700; transition: background 240ms ease-out, color 240ms ease-out; }
.tt-step > .label[data-state="done"]::before { content: "✓"; background: #34C759; color: #fff; box-shadow: none; }
.tt-step > .label[data-state="done"]::after { content: attr(data-note); margin-left: auto; padding: 4px 11px; border-radius: 999px; background: var(--glass);
  font-size: 13px; font-weight: 600; color: var(--text2); }
.tt-ready { margin: 0 0 12px; padding: 14px 18px; border-radius: 22px; font-size: 15px; font-weight: 600; line-height: 1.35; background: var(--card-glass);
  border: 1px solid var(--glass-bd); box-shadow: var(--sh-soft); }
.tt-ready[data-state="ok"] { color: #1F8F43; background: rgba(52, 199, 89, 0.14); border-color: rgba(52, 199, 89, 0.3); box-shadow: none; }
.tt-ready[data-state="todo"] { color: var(--text2); }
.tt-ready[hidden] { display: none; }
html[data-theme="dark"] .tt-ready[data-state="ok"] { color: #5FE08A; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .tt-ready[data-state="ok"] { color: #5FE08A; } }
.tt-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.tt-frame { border: 0; border-radius: 18px; box-shadow: var(--sh-soft); transition: transform 320ms cubic-bezier(0.3, 1.3, 0.4, 1), box-shadow 220ms ease-out; }
.tt-frame:active { transform: scale(0.96); }
.tt-frame.on { box-shadow: 0 0 0 3px var(--accent), var(--sh); transform: translateY(-3px); }
.tt-frame__n, .tt-frame__dur { background: rgba(20, 20, 30, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tt-frame--add { border: 1.5px dashed var(--dash); background: var(--glass); box-shadow: none; color: var(--text2); }
.tt-frame--add:hover { background: var(--hover); }
.tt-plus { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--card-glass); box-shadow: var(--sh-soft); color: var(--text); font-size: 26px; }
.tt-tools { gap: 8px; margin: 10px 0 6px; }
.tt-step .caption { margin-top: 8px; font-size: 13px; line-height: 1.4; }
.tt-step .tt-listen, .tt-step .tt-tools .btn { box-shadow: none; }
.tt-board { height: 44px; gap: 4px; border-radius: 22px; padding: 4px; background: var(--glass); }
.tt-board__part { border-radius: 18px; font-size: 13px; font-weight: 600; }
.tt-result__video { border-radius: 24px; box-shadow: var(--sh); }

/* ----- Панель действий с одной кнопкой («Собрать ролик»): кнопка на всю ширину по центру, а не прижата влево ----- */
.actions.actions--single { padding: 6px; }
.actions.actions--single .actions__row .btn, .actions.actions--single .actions__row--main .btn:first-child {
  flex: 1 1 100%; width: 100%; min-width: 0; height: 56px; font-size: 17px; font-weight: 700; }
.actions.actions--single .btn[disabled] { opacity: 1; background: var(--glass); color: var(--hint); box-shadow: none; }   /* недоступна — спокойная серая, а не «выцветшая чёрная» */
.tt-frame.tt-frame--lift { transition: box-shadow 200ms ease-out; transform-origin: center; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 0 3px var(--accent); }   /* поднятый кадр едет за пальцем без пружины */
.tt-grid--drag .tt-frame:not(.tt-frame--lift) { transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ----- Окно «Озвучить текст»: сплошная панель, поле с пределом высоты, ряд кнопок в одну строку, «Озвучить» всегда под рукой ----- */
.sheet__panel:has(.tt-speak) { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; padding-bottom: 0; }
.sheet__panel:has(.tt-flow) { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }   /* «Кадры по тексту»: сплошная панель, страница не просвечивает */
.tt-speak { display: flex; flex-direction: column; gap: 4px; }
.tt-speak .field { margin: 0; }
.tt-speak__text { min-height: 120px; max-height: min(40vh, 340px); overflow-y: auto; font-size: 17px; line-height: 1.4; }   /* длинный текст прокручивается в самом поле, окно не растягивается */
.tt-speak .caption { margin: 2px 2px 6px; font-size: 13px; line-height: 1.4; }
.tt-speak__tools { display: flex; flex-wrap: nowrap; gap: 8px; margin: 4px 0 6px; }
.tt-speak__tools .btn { flex: 1 1 0; min-width: 0; width: auto; height: 46px; padding: 0 10px; font-size: 15px; white-space: normal; line-height: 1.15; }
.tt-speak .tt-listen { width: 100%; height: 44px; margin: 4px 0 2px; }
.tt-speak .tt-dict { margin: 4px 0 8px; padding: 16px; border-radius: 24px; background: var(--card-glass); box-shadow: inset 0 0 0 1px var(--line); gap: 10px; }
.tt-dict__title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.tt-speak .tt-dict .caption { margin: -4px 0 2px; }
.tt-speak .tt-dict .tt-words { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.tt-speak .tt-dict .tt-words:empty { display: none; }
.tt-dict__row { display: flex; align-items: center; width: 100%; height: 46px; padding: 0 8px 0 16px; border-radius: 16px; background: var(--glass); font-size: 16px; justify-content: flex-start; }
.tt-dict__w { font-weight: 600; }
.tt-dict__arrow { margin: 0 8px; color: var(--hint); }
.tt-dict__say { color: var(--accent-2, #0A74F0); font-weight: 600; flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-dict__x { flex: none; width: 30px; height: 30px; margin-left: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--hover); color: var(--text2); font-size: 18px; line-height: 1; }
.tt-speak .tt-dict__add { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.tt-dict__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tt-dict__cap { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--hint); padding: 0 4px; }
.tt-speak .tt-dict__add input { width: 100%; margin: 0; height: 48px; padding: 0 14px; }
.tt-speak .tt-dict__add .btn { grid-column: 1 / -1; height: 48px; }
.tt-speak__tools .btn.on { background: var(--tab-lens); color: var(--tab-on); box-shadow: inset 0 0 0 1px var(--tab-lens-bd); }
.tt-speak .tt-words { margin: 0 0 8px; }
.tt-speak__go { position: sticky; bottom: 0; z-index: 2; margin: 6px calc(-1 * var(--side)) 0; padding: 10px var(--side) calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 72%, transparent); }   /* кнопка закреплена внизу окна: при клавиатуре и длинном тексте она не уезжает */
.tt-speak__go .btn { width: 100%; height: 56px; font-size: 17px; font-weight: 700; }
body.keyboard-open .sheet { transition: height 160ms ease-out; }
body.keyboard-open .tt-speak__go { padding-bottom: 12px; }

/* ----- «Озвучить текст» при открытой клавиатуре: окно — это поле ввода на всю видимую высоту и кнопка «Озвучить» над клавиатурой;
   пояснения, ряд кнопок и словарь прячутся, пока человек печатает (вернутся, когда клавиатура закроется) ----- */
body.keyboard-open .sheet:has(.tt-speak) { align-items: flex-start; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; height: calc(var(--vvh, 100%) + 600px); }   /* фон сплошной и уходит под клавиатуру: страница не просвечивает сквозь стеклянную клавиатуру iOS */
body.keyboard-open .sheet__panel:has(.tt-speak) { display: flex; flex-direction: column; height: calc(var(--vvh, 100%) - env(safe-area-inset-top, 0px) - 8px); max-height: none; margin-top: calc(env(safe-area-inset-top, 0px) + 8px);   /* ниже «острова» и строки состояния */
 
  padding-bottom: 0; overflow: hidden; border-radius: 26px 26px 0 0; }
body.keyboard-open .sheet__panel:has(.tt-speak) .sheet__title { flex: none; }
body.keyboard-open .tt-speak { flex: 1 1 auto; min-height: 0; }
body.keyboard-open .tt-speak:has(.tt-speak__text:focus) .field { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
body.keyboard-open .tt-speak:has(.tt-speak__text:focus) .tt-speak__text { flex: 1 1 auto; height: auto !important; max-height: none; min-height: 0; }
body.keyboard-open .tt-speak:has(.tt-speak__text:focus) :is(.caption, .tt-speak__tools, .tt-listen, .tt-dict) { display: none; }
body.keyboard-open .tt-speak:has(.tt-dict input:focus) :is(.field, .tt-speak__tools, .tt-listen, .tt-speak > .caption) { display: none; }
body.keyboard-open .tt-speak:has(.tt-dict input:focus) .tt-dict { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
body.keyboard-open .tt-speak__go { position: static; margin: auto calc(-1 * var(--side)) 0; padding: 8px var(--side) 10px; background: transparent; flex: none; }
body.keyboard-open .tt-speak__go .btn { height: 52px; }

/* ----- Крестик «убрать кадр» на фото: тонкий белый крест на тёмном стеклянном круге ----- */
.tt-frame__x { position: absolute; top: 1px; right: 1px; width: 34px; height: 34px; cursor: pointer; -webkit-tap-highlight-color: transparent;   /* зона касания 34 px, виден круг 24 px */
  background: radial-gradient(circle at center, rgba(20, 20, 30, 0.58) 0 12px, rgba(255, 255, 255, 0.2) 12px 12.8px, transparent 13px); transition: transform 200ms cubic-bezier(0.3, 1.3, 0.4, 1); }
.tt-frame__x::before, .tt-frame__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.8px; margin: -0.9px 0 0 -5.5px; border-radius: 1px; background: #fff; transform: rotate(45deg); }
.tt-frame__x::after { transform: rotate(-45deg); }
.tt-frame__x:active { transform: scale(0.86); }
