/* Фонотека: полка с корешками кассет. Ореховый фон, бумажные корешки с
   цветной наклейкой — бумага только у них. Открытый плейлист — вкладыш
   кассеты прямо на ореховом фоне: полоса корешка и сгиб слева.
   Янтарный — только то, что играет сейчас. */
:root {
  --shelf: #2b211c;
  --shelf-deep: #1d1612;
  --paper: #ece3d1;
  --paper-hi: #f4ecdc;
  --ink: #231b16;
  --ink-soft: #6d5d4d;
  --muted: #a8977f;
  --line: #3d312a;
  --amber: #f2b544;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --player-h: 72px;
  color-scheme: dark;
}
/* плеер ещё не появлялся — не резервируем под него место */
body:has(#player[hidden]) { --player-h: 0px; }

* { box-sizing: border-box; }
/* Корневой rubber-band глушится ещё и нативно в mac-web-runtime
   (elasticity корневого NSScrollView); здесь — для обычных браузеров. */
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0;
  min-height: 100dvh;
  overscroll-behavior: none;
  background: var(--shelf);
  color: var(--paper);
  font: 400 1rem/1.5 var(--text);
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom) + 16px);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* mac-web-runtime: вся шапка перетаскивает окно; в браузере --app-region инертен.
   Интерактив внутри (.brand, .saver) помечен no-drag.
   Sticky, не fixed: fixed-хедер в WKWebView пропадает при ресайзе окна.
   Шапка стеклянная: список уезжает под неё и размывается. */
.top-strip {
  --app-region: drag;
  position: sticky;
  top: 0;
  z-index: 5; /* ниже плеера (10) и toast (20) */
  background: rgb(43 33 28 / 0.72);
  -webkit-backdrop-filter: saturate(1.3) blur(18px);
  backdrop-filter: saturate(1.3) blur(18px);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px 16px;
  /* в runtime — отступ правее системных traffic lights; в браузере фолбэк 20px */
  padding-inline-start: max(20px, calc(var(--epwa-titlebar-x, 0px) + 16px));
  transition: opacity 0.2s;
}
/* приложение mac-web-runtime: окно не в фокусе — шапка приглушена, как у нативных */
body.is-inactive .top { opacity: 0.55; }
.brand { font: 700 1.375rem/1 var(--display); text-decoration: none; letter-spacing: -0.01em; --app-region: no-drag; }
.top-meta { margin-left: auto; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
@media (max-width: 479px) { .top-meta { display: none; } }

.saver { --app-region: no-drag; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 0.875rem; }
.saver-track {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--line);
  transition: background 0.15s;
}
.saver-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.saver:hover { color: var(--paper); }
.saver[aria-checked="true"] { color: var(--paper); }
.saver[aria-checked="true"] .saver-track { background: var(--amber); }
.saver[aria-checked="true"] .saver-track::after { transform: translateX(14px); background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .saver-track, .saver-track::after { transition: none; } }

/* «Приложение для Mac» — только в браузере на Mac: переход в приложение через Pier */
.get-app {
  --app-region: no-drag;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.get-app:hover { box-shadow: inset 0 0 0 1.5px var(--amber); }

/* подсказка «Установите Pier» — бумажная карточка под шапкой, справа */
.pier-panel {
  position: fixed;
  top: calc(var(--top-h, 78px) + 8px);
  right: max(16px, calc((100vw - 1200px) / 2 + 20px));
  z-index: 20;
  width: min(23rem, calc(100vw - 32px));
  padding: 18px 20px 16px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.pier-panel h2 { margin: 0 0 6px; font: 700 1.125rem/1.2 var(--display); letter-spacing: -0.01em; }
.pier-panel p { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.9375rem; }
.pier-panel ol { margin: 0 0 14px; padding-left: 1.2em; font-size: 0.9375rem; }
.pier-panel li { margin-bottom: 4px; }
.pier-panel a { color: var(--ink); font-weight: 600; }
.pier-panel .btn-ghost { min-height: 36px; padding: 0 16px; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(35, 27, 22, 0.3); }
.pier-panel .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 24px;
  outline: none;
}

/* ── полка ─────────────────────────────────────────── */
.shelf ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.spine {
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 64px;
  padding: 11px 16px 11px 30px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  border-radius: 2px;
  /* торец кассеты: светлая грань сверху, тень снизу */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 0 rgba(0, 0, 0, 0.28);
}
.spine::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 14px;
  background: var(--band);
  border-radius: 2px 0 0 2px;
}
/* корешки на полке стоят неровно — как настоящие кассеты */
.shelf li:nth-child(3n + 2) .spine { margin-right: 10px; }
.shelf li:nth-child(4n + 3) .spine { margin-right: 4px; margin-left: 6px; }
.spine:hover { background: var(--paper-hi); }
.spine-title { font: 500 1rem/1.2 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
.spine-meta { color: var(--ink-soft); font-size: 0.8125rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
/* выбранная кассета выдвинута с полки к вкладышу */
.spine.is-selected { background: var(--paper-hi); box-shadow: inset 0 0 0 2px var(--ink), 0 2px 0 rgba(0, 0, 0, 0.28); }
.spine.is-playing::before { background: var(--amber); }
.spine.is-playing .spine-meta::before { content: "играет, "; color: var(--ink); font-weight: 500; }

.empty { color: var(--muted); max-width: 36em; padding: 24px 0; }
.empty code { color: var(--paper); font-size: 0.9em; }

/* ── плейлист: вкладыш кассеты ─────────────────────── */
.back { display: inline-block; padding: 6px 0 12px; color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.back::before { content: "‹ "; }
.back:hover { color: var(--paper); }

.pl {
  --strip: 14px;
  position: relative;
  padding: 6px 20px 12px calc(var(--strip) + 20px);
  /* полоса корешка и сгиб вкладыша; фон не скроллится вместе с треками */
  background: linear-gradient(to right,
    var(--band) var(--strip),
    transparent var(--strip) calc(var(--strip) + 6px),
    rgba(236, 227, 209, 0.14) calc(var(--strip) + 6px) calc(var(--strip) + 7px),
    transparent calc(var(--strip) + 7px));
  border-radius: 2px 0 0 2px;
  scrollbar-color: var(--line) transparent;
}
.pl-head { padding: 0 0 18px; }
.pl-title {
  margin: 0 0 6px;
  font: 700 clamp(1.625rem, 5.5vw, 2.75rem)/1.05 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.pl-meta { margin: 0 0 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { min-height: 44px; padding: 0 22px; border-radius: 22px; font-weight: 600; }
/* главная кнопка — из той же бумаги, что корешки */
.btn-primary { background: var(--paper); color: var(--ink); }
.btn-primary:hover { background: var(--paper-hi); }
.btn-ghost { box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }

.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--muted); }
.track {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px 10px 4px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.tracks li:last-child .track { border-bottom: 0; }
.track:hover { background: rgba(236, 227, 209, 0.04); }
.t-no { color: var(--muted); text-align: right; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.t-main { min-width: 0; }
.t-title, .t-artist { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-title { font-weight: 500; }
.t-artist { color: var(--muted); font-size: 0.875rem; }
.t-time { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* текущий трек выделен на вкладыше маркером */
.track.is-current,
.track.is-current:hover { background: var(--amber); color: var(--ink); border-radius: 2px; border-bottom-color: transparent; }
.track.is-current .t-title { font-weight: 600; }
.track.is-current .t-artist,
.track.is-current .t-time { color: var(--ink); }
/* вместо номера — эквалайзер; шевелится, только пока звучит */
.track.is-current .t-no { position: relative; color: transparent; }
.track.is-current .t-no::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.3em;
  width: 13px;
  height: 12px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 100% / 3px 55% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 5px 100% / 3px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 10px 100% / 3px 35% no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  body:has(.player.is-playing) .track.is-current .t-no::after { animation: eq 0.9s ease-in-out infinite; }
}
@keyframes eq {
  0%, 100% { background-size: 3px 55%, 3px 100%, 3px 35%; }
  33% { background-size: 3px 100%, 3px 40%, 3px 75%; }
  66% { background-size: 3px 30%, 3px 80%, 3px 100%; }
}

@media (max-width: 899px) {
  .pl { margin-inline: -8px; padding-right: 14px; }
}

@media (min-width: 900px) {
  /* Страница целиком не скроллится. Полка и вкладыш — во всю высоту окна,
     каждый скроллится сам и уезжает под стеклянные шапку и плеер (размытие —
     там). Отступы внутри панелей = высоте шапки и плеера: в покое ничего
     под ними не прячется. */
  body:has(.split) { padding-bottom: 0; }
  main:has(.split) { padding-bottom: 0; margin-top: calc(-1 * var(--top-h, 78px)); }
  .split { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 40px; align-items: start; }
  .split .shelf,
  .split .pl {
    --under-top: var(--top-h, 78px);
    --under-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
    max-height: 100dvh;
    overflow: auto;
    scrollbar-width: thin;
    /* докрученный корешок или трек встаёт между шапкой и плеером, не под ними */
    scroll-padding-block: calc(var(--under-top) + 12px) calc(var(--under-bottom) + 12px);
  }
  /* полка без своего фона и без скроллбара: корешки стоят прямо на стене.
     4px по бокам — чтобы рамка фокуса не обрезалась. Первый корешок —
     вровень с верхом полосы вкладыша. */
  .split .shelf {
    padding: var(--under-top) 4px calc(var(--under-bottom) + 16px);
    margin-inline: -4px;
    scrollbar-width: none;
  }
  .split .shelf::-webkit-scrollbar { display: none; }
  .split .pl {
    padding: calc(var(--under-top) + 12px) 8px calc(var(--under-bottom) + 16px) calc(var(--strip) + 28px);
    /* полоса корешка и сгиб — только между шапкой и плеером */
    background-position: 0 var(--under-top);
    background-size: 100% calc(100% - var(--under-top) - var(--under-bottom));
    background-repeat: no-repeat;
  }
  .split .pl-title { font-size: clamp(1.75rem, 3vw, 2.75rem); }
}

/* ── плеер ─────────────────────────────────────────── */
.player {
  --progress: 0%;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: var(--player-h);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  /* стекло, как у шапки: список уезжает под плеер и размывается */
  background: rgb(29 22 18 / 0.78);
  -webkit-backdrop-filter: saturate(1.3) blur(18px);
  backdrop-filter: saturate(1.3) blur(18px);
  box-shadow: 0 -1px 0 rgb(61 49 42 / 0.6);
}
.player[hidden] { display: none; }
.player::before {  /* тонкая полоска прогресса над свёрнутым плеером */
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: var(--progress);
  height: 2px;
  background: var(--amber);
}
.player-open { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.player-cover { flex: none; width: 48px; height: 48px; border-radius: 2px; object-fit: cover; background: var(--shelf); }
.player-text { display: grid; min-width: 0; }
.player-title, .player-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-title { font-weight: 600; }
.player-artist { color: var(--muted); font-size: 0.875rem; }
.player-controls { display: flex; align-items: center; gap: 4px; }
.ctl { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--paper); }
.ctl svg { width: 24px; height: 24px; fill: currentColor; }
.ctl:hover { background: rgba(236, 227, 209, 0.07); }
.ctl.play { width: 48px; height: 48px; background: var(--amber); color: var(--ink); }
.ctl.play:hover { background: #f6c566; }
.player-close, .timeline { display: none; }

.timeline {
  grid-template-columns: 1fr auto;
  grid-template-areas: "seek seek" "cur left";
  align-items: center;
  row-gap: 2px;
}
.timeline .seek { grid-area: seek; }
#t-cur { grid-area: cur; }
#t-left { grid-area: left; text-align: right; }
.time { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
.seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--amber) var(--progress), var(--line) var(--progress));
}
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--paper); }
.seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--amber); }
.seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--paper); }

/* развёрнутый плеер на телефоне */
@media (max-width: 899px) {
  .player.is-open {
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 22px;
    padding: max(56px, env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom));
    background: var(--shelf);
    box-shadow: none;
  }
  .player.is-open::before { display: none; }
  .player.is-open .player-close { display: grid; position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; }
  .player.is-open .player-open { flex-direction: column; align-items: flex-start; gap: 22px; width: min(100%, 420px); cursor: default; }
  .player.is-open .player-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 3px;
    background: var(--shelf-deep);
    box-shadow: 0 28px 48px -24px rgba(0, 0, 0, 0.9);
  }
  /* без обложки — иконка приложения: у неё свой скруглённый фон, подложка и тень не нужны */
  .player.is-open .player-cover[src$="/icons/icon.svg"] { background: none; box-shadow: none; }
  .player.is-open .player-text { gap: 6px; }
  .player.is-open .player-title { font: 700 1.5rem/1.15 var(--display); letter-spacing: -0.01em; white-space: normal; text-wrap: balance; }
  .player.is-open .player-artist { font-size: 1rem; white-space: normal; }
  .player.is-open .timeline { display: grid; width: min(100%, 420px); }
  .player.is-open .player-controls { gap: 28px; }
  .player.is-open .ctl.play { width: 72px; height: 72px; }
  .player.is-open .ctl.play svg { width: 32px; height: 32px; }
  body.sheet-open { overflow: hidden; }
  @media (prefers-reduced-motion: no-preference) {
    .player.is-open { animation: sheet-up 0.22s ease-out; }
  }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

@media (min-width: 900px) {
  .player { grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1.4fr); gap: 24px; padding-inline: 24px; }
  .player::before { display: none; }
  .player-controls { order: 2; }
  .timeline { order: 3; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "cur seek left"; column-gap: 12px; }
}

/* ── мини-плеер (приложение): окно ужато до плеера и висит поверх остальных ── */
/* Под страницей — матовое стекло окна (epwa.setWindowMaterial('hud')): фон прозрачный. */
body.is-mini { padding: 0; overflow: hidden; background: transparent; }
body.is-mini .top-strip,
body.is-mini main,
body.is-mini .toast { display: none; }
body.is-mini .player {
  --app-region: drag; /* окно тянется за любое место, кроме кнопок и перемотки */
  inset: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "open controls" "timeline timeline";
  align-content: center;
  row-gap: 2px;
  padding: 26px 12px 4px; /* сверху — светофоры окна */
  /* ореховый оттенок поверх тёмного стекла: сквозь него чуть видно рабочий стол,
     но цвет — Фонотеки, а светлый текст читается */
  background: rgb(43 33 28 / 0.72);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.is-mini .player::before { display: none; }
body.is-mini .player-open { grid-area: open; --app-region: no-drag; }
body.is-mini .player-cover { width: 44px; height: 44px; }
body.is-mini .player-controls { grid-area: controls; gap: 0; --app-region: no-drag; }
body.is-mini .ctl.play { width: 40px; height: 40px; }
body.is-mini .timeline {
  grid-area: timeline;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  grid-template-areas: "cur reel-l seek reel-r left";
  column-gap: 8px;
  --app-region: no-drag;
}

/* Катушки кассеты по краям перемотки: лента перетекает слева направо по ходу
   трека (--p от 0 до 1), катушки крутятся, пока звучит. */
.reel { display: none; }
body.is-mini .reel {
  --tape: calc((1 - var(--p, 0)) * 6px + 1px);
  display: block;
  width: 16px;
  height: 16px;
  margin-inline: 7px; /* место под намотанную ленту */
  border-radius: 50%;
  border: 1.5px solid var(--paper);
  /* ступица с тремя зубцами и отверстием */
  background:
    radial-gradient(circle, var(--shelf-deep) 0 2px, transparent 2.5px),
    repeating-conic-gradient(var(--paper) 0 22deg, transparent 22deg 120deg);
  box-shadow: 0 0 0 var(--tape) #6b4a33;
  animation: reel-spin 1.8s linear infinite paused;
}
body.is-mini .reel-l { grid-area: reel-l; }
body.is-mini .reel-r { grid-area: reel-r; --tape: calc(var(--p, 0) * 6px + 1px); }
body.is-mini:has(.player.is-playing) .reel { animation-play-state: running; }
@keyframes reel-spin { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { body.is-mini .reel { animation: none; } }

/* ── «Сейчас играет» на весь экран: обложка слева, трек и управление справа ── */
body.is-stage { overflow: hidden; }
body.is-stage .top-strip,
body.is-stage main { display: none; }
body.is-stage .player {
  inset: 0;
  display: grid;
  grid-template-columns: min(60vh, 42vw) minmax(18rem, 32rem);
  grid-template-rows: 1fr auto auto auto 1fr;
  grid-template-areas: "cover ." "cover text" "cover timeline" "cover controls" "cover .";
  justify-content: center;
  align-content: center;
  column-gap: clamp(32px, 5vw, 72px);
  row-gap: 20px;
  padding: 6vh 6vw;
  background: var(--shelf);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.is-stage .player::before,
body.is-stage .player-close { display: none; }
/* кнопка-обёртка растворяется: обложка и текст — отдельные ячейки сетки */
body.is-stage .player-open { display: contents; cursor: default; }
body.is-stage .player-cover {
  grid-area: cover;
  align-self: center;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--shelf-deep);
  box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.9);
}
body.is-stage .player-cover[src$="/icons/icon.svg"] { background: none; box-shadow: none; }
body.is-stage .player-text { grid-area: text; gap: 10px; }
body.is-stage .player-title {
  font: 700 clamp(2rem, 3.6vw, 3.5rem)/1.05 var(--display);
  letter-spacing: -0.02em;
  white-space: normal;
  overflow: visible; /* с отрицательным трекингом последняя буква выступает — не обрезаем */
  text-wrap: balance;
}
body.is-stage .player-artist { font-size: clamp(1.0625rem, 1.4vw, 1.375rem); white-space: normal; }
body.is-stage .timeline {
  grid-area: timeline;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "seek seek" "cur left";
  column-gap: 0;
}
body.is-stage .player-controls { grid-area: controls; justify-content: flex-start; gap: 24px; margin-left: -10px; }
body.is-stage .ctl.play { width: 72px; height: 72px; }
body.is-stage .ctl.play svg { width: 32px; height: 32px; }
@media (max-width: 700px) {
  body.is-stage .player {
    grid-template-columns: min(80vw, 44vh);
    grid-template-rows: auto;
    grid-template-areas: "cover" "text" "timeline" "controls";
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 20;
  max-width: min(92vw, 30rem);
  padding: 10px 16px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9375rem;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
