/* Визуальный язык сервиса (README §5.8, задание T15).
 *
 * Цвета живут только здесь и только переменными на :root: тёмную тему даёт
 * prefers-color-scheme, тему телеграма — те же переменные, переписанные из
 * themeParams в app.js. Отдельных стилей «для телеграма» нет.
 *
 * У каждого статуса два токена: --st-*-fg (текст и обводка, контраст с фоном
 * проверяется тестом) и --st-*-bg (подложка плашки). Пятёрка §5.8:
 * серый ожидание, синий работа, зелёный готово, янтарный внимание, красный ошибка.
 */

:root {
  color-scheme: light;

  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #16181d;
  --muted: #59616d;
  --line: #d9dee5;
  --shadow: 0 1px 2px rgba(16, 20, 28, .08), 0 8px 24px rgba(16, 20, 28, .06);

  --accent: #1f5fd0;
  --accent-hover: #174ba8;
  --accent-fg: #ffffff;
  --accent-soft: #e5edfc;

  --st-wait-fg: #5b6370;
  --st-wait-bg: #e9ecf1;
  --st-work-fg: #1f5fd0;
  --st-work-bg: #e3ecfb;
  --st-done-fg: #16704a;
  --st-done-bg: #dff1e7;
  --st-warn-fg: #8a5300;
  --st-warn-bg: #fbeed3;
  --st-err-fg: #b4231f;
  --st-err-bg: #fbe3e1;

  --hl-raster: #6b2fb5;
  --hl-raster-soft: rgba(107, 47, 181, .16);

  /* Подложка подсветки во вьюере (T17 п.3). Обводка берёт статусный цвет §5.8,
     а заливка обязана быть сквозной — под ней текст страницы. */
  --hl-shrunk-soft: rgba(191, 132, 0, .18);
  --hl-missing-soft: rgba(180, 35, 31, .16);
  --hl-edited-soft: rgba(31, 95, 208, .14);
  --hl-skip-soft: rgba(91, 99, 112, .14);

  --radius: 10px;
  --gap: 12px;
  --pad: 16px;              /* боковые поля, T15 п.3 */
  --container: 720px;       /* §5.8 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #14161a;
    --surface: #1c1f25;
    --surface-2: #23272f;
    --text: #e7eaee;
    --muted: #a4adba;
    --line: #2e343d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);

    --accent: #7aa6ff;
    --accent-hover: #9dbeff;
    --accent-fg: #10131a;
    --accent-soft: #23304a;

    --st-wait-fg: #a4adba;
    --st-wait-bg: #272c34;
    --st-work-fg: #7aa6ff;
    --st-work-bg: #1e293f;
    --st-done-fg: #62cc95;
    --st-done-bg: #17301f;
    --st-warn-fg: #e9b545;
    --st-warn-bg: #33270f;
    --st-err-fg: #ff8b83;
    --st-err-bg: #3a1c1c;

    --hl-raster: #c4a2ff;
    --hl-raster-soft: rgba(196, 162, 255, .22);

    --hl-shrunk-soft: rgba(233, 181, 69, .22);
    --hl-missing-soft: rgba(255, 139, 131, .20);
    --hl-edited-soft: rgba(122, 166, 255, .20);
    --hl-skip-soft: rgba(164, 173, 186, .18);
  }
}

/* Явный выбор темы: телеграм (themeParams.colorScheme) и переключатель в шапке. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #14161a;
  --surface: #1c1f25;
  --surface-2: #23272f;
  --text: #e7eaee;
  --muted: #a4adba;
  --line: #2e343d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);

  --accent: #7aa6ff;
  --accent-hover: #9dbeff;
  --accent-fg: #10131a;
  --accent-soft: #23304a;

  --st-wait-fg: #a4adba;
  --st-wait-bg: #272c34;
  --st-work-fg: #7aa6ff;
  --st-work-bg: #1e293f;
  --st-done-fg: #62cc95;
  --st-done-bg: #17301f;
  --st-warn-fg: #e9b545;
  --st-warn-bg: #33270f;
  --st-err-fg: #ff8b83;
  --st-err-bg: #3a1c1c;

  --hl-raster: #c4a2ff;
  --hl-raster-soft: rgba(196, 162, 255, .22);

  --hl-shrunk-soft: rgba(233, 181, 69, .22);
  --hl-missing-soft: rgba(255, 139, 131, .20);
  --hl-edited-soft: rgba(122, 166, 255, .20);
  --hl-skip-soft: rgba(164, 173, 186, .18);
}

/* --- основа ------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);      /* базовый кегль 15 px, §5.8 */
  overflow-x: hidden;              /* горизонтальной прокрутки нет ни на одной ширине */
  overflow-wrap: anywhere;
}

img, svg, canvas, video { max-width: 100%; height: auto; }
pre, code { font-family: var(--mono); white-space: pre-wrap; word-break: break-word; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.stack > * + * { margin-top: var(--gap); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- шапка --------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.top__title { font-size: 15px; font-weight: 600; margin: 0; min-width: 0; }
.top__sub { color: var(--muted); font-size: 13px; }
.top__back { color: var(--text); font-size: 18px; line-height: 1; padding: 4px 8px; margin-left: -8px; }
.top__user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }

main { padding: var(--gap) 0 48px; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}

.card--flat { box-shadow: none; }
.card__title { display: block; color: var(--text); font-weight: 600; }
.card__title:hover { color: var(--accent); }

.doc-list { display: flex; flex-direction: column; gap: var(--gap); list-style: none; margin: 0; padding: 0; }

.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* --- статусы ------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--st-wait-fg);
  background: var(--st-wait-bg);
}

.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.tone-wait { color: var(--st-wait-fg); background: var(--st-wait-bg); }
.tone-work { color: var(--st-work-fg); background: var(--st-work-bg); }
.tone-done { color: var(--st-done-fg); background: var(--st-done-bg); }
.tone-warn { color: var(--st-warn-fg); background: var(--st-warn-bg); }
.tone-err  { color: var(--st-err-fg);  background: var(--st-err-bg); }

.text-wait { color: var(--st-wait-fg); }
.text-work { color: var(--st-work-fg); }
.text-done { color: var(--st-done-fg); }
.text-warn { color: var(--st-warn-fg); }
.text-err  { color: var(--st-err-fg); }

/* Прогресс — всегда с числом рядом, спиннеров в сервисе нет (§5.8). */
.bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar__fill { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.bar__fill.tone-wait { background: var(--st-wait-fg); }
.bar__fill.tone-work { background: var(--st-work-fg); }
.bar__fill.tone-done { background: var(--st-done-fg); }
.bar__fill.tone-warn { background: var(--st-warn-fg); }
.bar__fill.tone-err  { background: var(--st-err-fg); }
.num { font-variant-numeric: tabular-nums; }

/* --- кнопки и поля ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--wide { width: 100%; }
.btn--icon { min-height: 32px; padding: 4px 10px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

select, input[type="text"], input[type="number"], textarea {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field { min-width: 0; flex: 1 1 160px; }
.fields { display: flex; flex-wrap: wrap; gap: var(--gap); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: auto; min-height: 0; }

/* --- дроп-зона ----------------------------------------------------------- */

.drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 20px var(--pad);
  text-align: center;
  cursor: pointer;
}

.drop--over { border-color: var(--accent); background: var(--accent-soft); }
.drop__hint { color: var(--muted); font-size: 13px; }

/* --- оверлей ------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(10, 12, 16, .45);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.overlay__panel {
  width: 100%;
  max-width: var(--container);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.overlay__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--line);
}

.overlay__title { font-weight: 600; }
.overlay__body { padding: var(--pad); overflow: auto; }
.overlay__close {
  min-height: 32px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

/* Телефон: оверлей на весь экран (T15 п.7, §5.7). */
@media (max-width: 719px) {
  .overlay { padding: 0; }
  .overlay__panel { max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; }
}

body.is-locked { overflow: hidden; }

/* --- мелочи, которые ломают вёрстку на 320 px ---------------------------- */

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }

@media (max-width: 380px) {
  .fields { gap: 8px; }
  .top__inner { min-height: 48px; }
}

/* Анимации только на появление строк ленты (§5.8). */
@media (prefers-reduced-motion: no-preference) {
  .appear { animation: appear .18s ease-out; }
}

@keyframes appear {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* --- страница входа ------------------------------------------------------ */

.login { max-width: 420px; margin: 40px auto 0; text-align: center; }
.login__widget { display: flex; justify-content: center; min-height: 48px; margin: 16px 0 8px; }

/* --- каркас документа ---------------------------------------------------- */

.stage {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stage:last-child { border-bottom: 0; }
.stage__name { flex: 1 1 auto; min-width: 0; }
.stage__num { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Alpine скрывает компонент до инициализации — иначе оверлей мигает при загрузке. */
[x-cloak] { display: none !important; }

/* --- лента документа (T16, §5.2) ----------------------------------------- */

.feed { list-style: none; margin: 0; padding: 0; }
.feed__item { border-bottom: 1px solid var(--line); }
.feed__item:last-child { border-bottom: 0; }

/* Строка этапа свёрнута по умолчанию: подробности открывает родной <details>. */
details.stage { display: block; padding: 0; border-bottom: 0; }

.stage__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}

.stage__head::-webkit-details-marker { display: none; }
.stage__head::after { content: "▾"; color: var(--muted); font-size: 11px; }
details[open] > .stage__head::after { content: "▴"; }

/* Три числа строки: что сделано, сколько потрачено, сколько осталось. */
.stage__nums {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  flex: 1 1 100%;
  order: 3;
  color: var(--muted);
}

.stage__body { padding: 0 0 10px; color: var(--muted); }
.facts, .units { list-style: none; margin: 0 0 6px; padding: 0; }
.facts li { padding: 1px 0; }
.facts li::before { content: "└ "; color: var(--muted); }
.unit { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 1px 0; }
.unit__name { font-variant-numeric: tabular-nums; }
.unit[data-unit-state="done"] .unit__state { color: var(--st-done-fg); }
.unit[data-unit-state="running"] .unit__state { color: var(--st-work-fg); }
.unit[data-unit-state="failed"] .unit__state { color: var(--st-err-fg); }

/* Ошибка этапа — такая же строка ленты, красная, с причиной и «повторить». */
.feed__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--st-err-fg);
  background: var(--st-err-bg);
}

/* --- карточка решения (§5.3) --------------------------------------------- */

.decision { margin: 8px 0; }
.decision > * + * { margin-top: 8px; }
.decision__count { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.decision__question { font-weight: 500; margin: 0; }
.card--warn { border-color: var(--st-warn-fg); }

.options { list-style: none; margin: 0; padding: 0; }
.option { padding: 4px 0; }
.option__label { display: flex; align-items: baseline; gap: 8px; color: var(--text); font-size: 15px; margin: 0; }
.option__label input { width: auto; min-height: 0; }
.option__why { margin: 0 0 0 24px; }
.option__own { margin: 4px 0 0 24px; max-width: calc(100% - 24px); }

.quote { border-left: 2px solid var(--line); padding-left: 10px; }
.quote__text { margin: 0; font-style: italic; }
.quote__page { white-space: nowrap; }

/* --- оверлеи: глоссарий, расход, выдача (T18) ---------------------------- */

/* Фильтр глоссария: плашки статусов, выбранная обведена акцентом. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover { border-color: var(--line); }
.chip--on { border-color: currentColor; font-weight: 500; }

.section__title { margin-top: 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; }

.terms { list-style: none; margin: 0; padding: 0; }

.term { padding: 10px 0; border-bottom: 1px solid var(--line); }
.term:last-child { border-bottom: 0; }
.term > * + * { margin-top: 6px; }
.term__src { font-weight: 500; }
.term__ru { margin: 0; }
.term__edit > * + * { margin-top: 8px; }

.term__scope {
  padding: 8px 10px;
  border-radius: var(--radius);
}

.term__scope > * + * { margin-top: 8px; }

/* Расход: числа справа, столбец модели не растягивает таблицу на телефоне. */
.spend { font-variant-numeric: tabular-nums; }
.spend th, .spend td { vertical-align: top; }
.spend .right { text-align: right; }
.spend__sub td { border-bottom: 0; padding-top: 0; }
.spend__lost td:first-child { color: var(--st-err-fg); }
.spend tfoot th { border-bottom: 0; font-weight: 600; }

/* Выдача: четыре карточки файлов и блок удаления. */
.files { list-style: none; margin: 0; padding: 0; }
.files > li + li { margin-top: 10px; }
.file { padding: 8px 0; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file > * + * { margin-top: 4px; }

.danger { border-color: var(--st-err-bg); }
.danger__confirm { padding: 10px; border-radius: var(--radius); }

/* --- надписи на растровых схемах (T23) ---------------------------------- */

/* Слой вьюера поверх PNG: рамка надписи, прочитанной vision-моделью со схемы.
   Сверить её текст с оригиналом нечем — в текстовом слое его нет, — поэтому
   у неё свой, шестой цвет: промах координат ловится только глазами (T17 п.3). */
.seg--raster {
  position: absolute;
  outline: 2px solid var(--hl-raster);
  background: var(--hl-raster-soft);
}

.seg--raster::after {
  content: "схема";
  position: absolute;
  top: -1.1em;
  left: 0;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--hl-raster);
  color: var(--surface);
  font-size: 11px;
  line-height: 1.1em;
}

/* --- админка (T24) --------------------------------------------------------
   Экран владельца сервиса: несколько таблиц подряд. Своей вёрстки почти нет —
   таблицы используют те же правила, что расход документа (`.spend`), — только
   поля ввода в ячейках надо ужать, иначе строка таблицы разъезжается. */
.admin section { scroll-margin-top: 56px; }
.admin table input[type="text"] { min-height: 32px; padding: 4px 8px; }
.admin table .btn--icon { white-space: nowrap; }
.admin form.row { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin form.row select, .admin form.row input { width: auto; min-height: 32px; padding: 4px 8px; }

/* --- развороты и правка сегмента (T17) ------------------------------------
   Оверлею с двумя страницами нужна вся ширина окна, а не колонка 720 px.
   Обе колонки лежат в одном прокручиваемом ящике: прокрутка синхронна потому,
   что она одна. Зум меняет ширину ящика, а блоки поверх картинки заданы в
   долях страницы и от этого не сдвигаются. */

.overlay--wide .overlay__panel { max-width: 1120px; }

.spread__page { max-width: 5em; min-height: 32px; padding: 4px 8px; text-align: center; }
.spread__scroll { overflow: auto; -webkit-overflow-scrolling: touch; }

.spread__panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  width: 100%;
  align-items: start;
}

.pane { margin: 0; min-width: 0; }
.pane__sheet { position: relative; background: var(--surface-2); border: 1px solid var(--line); }
.pane__png { display: block; width: 100%; }
.pane__boxes { position: absolute; inset: 0; }

/* Блоки сквозные для мыши: клик ловит лист и попадает в самый маленький блок
   под точкой — иначе рамка таблицы перехватывала бы клики по своим строкам. */
.seg { position: absolute; pointer-events: none; }
.seg--shrunk { outline: 2px solid var(--st-warn-fg); background: var(--hl-shrunk-soft); }
.seg--missing { outline: 2px solid var(--st-err-fg); background: var(--hl-missing-soft); }
.seg--edited { outline: 2px solid var(--st-work-fg); background: var(--hl-edited-soft); }
.seg--skip { outline: 2px dashed var(--st-wait-fg); background: var(--hl-skip-soft); }

/* Значок «модель не уверена в переводе» — точка в углу блока. */
.seg--note::after {
  content: "•";
  position: absolute;
  top: -.4em;
  right: -.2em;
  color: var(--st-warn-fg);
  font-size: 18px;
  line-height: 1;
}

.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 0; padding: 0; }
.legend__item { display: flex; align-items: center; gap: 6px; }
.legend__box { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.legend__note { color: var(--st-warn-fg); }

.editor__src { background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; }
.editor textarea { width: 100%; }

/* Телефон (README §5.7): одна страница, какая — решает переключатель. */
.spread__toggle { display: none; }

@media (max-width: 719px) {
  .spread__panes { grid-template-columns: 1fr; }
  .spread__toggle { display: flex; }
  .spread[data-view="ru"] [data-pane="orig"] { display: none; }
  .spread[data-view="orig"] [data-pane="ru"] { display: none; }
}

/* --- Mini App и телефон (T19, README §5.7) --------------------------------
   Своих «телеграмных» стилей нет: тема ложится в те же переменные, их пишет
   static/js/miniapp.js. Ниже — только то, что внутри телеграма лишнее: его
   нативные кнопки заменяют вход виджетом, «Закрыть» и «←». Метку `data-tg`
   ставит встроенный скрипт base.html до первой отрисовки, поэтому ничего из
   спрятанного мелькнуть не успевает. */

:root[data-tg="1"] .login__widget { display: none; }
:root[data-tg="1"] .overlay__close { display: none; }
:root[data-tg="1"] .top__back { display: none; }

/* Правка сегмента на телефоне — нижний лист (T19 п.6): перекрывает разворот
   снизу со своей прокруткой, оставляя место системной полосе жестов. */
@media (max-width: 719px) {
  .editor {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    margin: 0;
    max-height: 72vh;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
    box-shadow: var(--shadow);
    padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  }
}
