/*
 * Каркас оболочки и вкладки. Здесь только то, что одинаково у всех раскрасок:
 * сетка страницы, панель, общие состояния экранов. Всё оформление живёт в
 * переменных со значениями по умолчанию — приложение перекрашивает оболочку
 * своими значениями и не правит этот файл.
 */

/* Каркас обязан быть самодостаточным: приложение подключает один shell.css и не
   должно догадываться, что ядру нужен ещё и сброс. Пиксельная раскраска
   объявляет `* { box-sizing: border-box }` в своих стилях и потому выглядела
   верно, а Gemmia — нет: при content-box `width: 100%` считается без padding и
   рамки, и строки «Ещё» вместе с карточками работ вылезали за правый край на
   22px, обрезая шеврон и заводя горизонтальную прокрутку. Правило ограничено
   оболочкой, чтобы не переписывать раскладку страниц приложения вокруг неё. */
.app-shell,
.app-shell *,
.app-shell *::before,
.app-shell *::after {
  box-sizing: border-box;
}

/* Магазин очков */
.store-screen .shell-status { gap: 18px; }

.store-notice {
  min-height: 0;
  margin: 0 0 12px;
  color: var(--shell-muted, #6f6877);
  font-size: 14px;
}

.store-notice:empty { display: none; }
.store-notice.is-error { color: #a33a46; }
.store-notice.is-success { color: #28705a; }

.store-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--shell-card, #fff);
  box-shadow: 0 8px 24px rgba(35, 27, 45, .07);
}

.store-balance-label { color: var(--shell-muted, #6f6877); }
.store-balance-value { font-size: 18px; }

.store-balance-value,
.store-price-inline,
.store-avatar-price {
  display: inline-flex;
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shell-artpoints-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: inherit;
  font-variant-numeric: tabular-nums;
  line-height: inherit;
  white-space: nowrap;
}

.shell-artpoints-number {
  line-height: inherit;
  /* Trim font leading, not glyphs. Baseline alignment also works without trim. */
  text-box: trim-both cap alphabetic;
}
.shell-artpoints-mark,
.shell-score-trophy {
  display: inline-block;
  align-self: baseline;
  height: var(--shell-number-cap, 1cap);
  /* Match text's baseline snapping without rounding the painted icon size. */
  height: round(nearest, var(--shell-number-cap, 1cap), 1px);
  flex: 0 0 auto;
  color: currentColor;
  line-height: 0;
  vertical-align: baseline;
  transform: translate3d(0, var(--shell-number-descent, 0px), 0);
}
.shell-artpoints-mark svg,
.shell-score-trophy svg {
  display: block;
  /* The tight viewBox supplies the aspect ratio. Never squeeze it into a square. */
  width: auto;
  height: var(--shell-number-cap, 1cap);
  overflow: visible;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.store-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(58, 45, 70, .09);
  border-radius: 20px;
  background: var(--shell-card, #fff);
  box-shadow: 0 10px 30px rgba(35, 27, 45, .06);
}

.store-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 14px;
}

.store-card-visual {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--shell-accent, #7958b7);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--shell-accent-soft, #ece2fb), var(--shell-surface, #fffaf5));
  transform: rotate(-3deg);
}

.store-card-visual svg { width: 34px; height: 34px; transform: rotate(3deg); }
.store-card-visual[data-store-icon="store-gold"] { color: #9b6418; background: #fff0bd; }
.store-card-visual[data-store-icon="store-gold-stack"] { color: #7153a5; background: #eee5ff; }
.store-card-visual[data-store-icon="store-no-ads"] { color: #307264; background: #dff5ee; }
.store-card-visual[data-store-icon="store-hints"] { color: #a85d22; background: #ffe6d4; }
.store-card-visual[data-store-icon="store-photo-month"] { color: #2d6eaa; background: #dfefff; }
.store-card-visual[data-store-icon="store-photo-forever"] { color: #a34670; background: #ffe2ef; }
.store-card-visual[data-store-icon="store-avatar"] { color: #5f55a6; background: #e9e5ff; }

.store-card-copy { min-width: 0; }
.store-card-title { margin: 0; font-size: 17px; line-height: 1.25; }
.store-card-description { margin: 7px 0 0; color: var(--shell-muted, #6f6877); line-height: 1.45; }
.store-state { margin: 0; color: #6c4fa0; font-weight: 700; }
.store-buy {
  display: inline-flex;
  align-self: center;
  justify-content: center;
  align-items: center;
  gap: 0.3em;
  width: min(100%, 240px);
  margin-top: auto;
  text-align: center;
  text-decoration: none;
}

.store-buy.is-unaffordable,
.store-avatar-swatch.is-unaffordable {
  color: var(--shell-muted, #6f6877);
  background: var(--shell-soft, #efe9e0);
  box-shadow: none;
  opacity: .62;
}

.store-points-link {
  justify-self: center;
  color: var(--shell-link, #2f6fd0);
  font-size: 14px;
  font-weight: 750;
  text-underline-offset: 3px;
}

.store-code {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(108, 79, 160, .08);
}

.store-code-label { grid-column: 1 / -1; color: var(--shell-muted, #6f6877); font-size: 13px; }
.store-code-value { overflow-wrap: anywhere; font-size: 16px; font-weight: 800; }
.store-copy { padding: 8px 12px; }

.store-avatar-colors {
  display: grid;
  grid-template-columns: repeat(7, minmax(46px, 1fr));
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding: 3px 1px 7px;
}

.store-avatar-swatch {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 46px;
  padding: 7px 4px 6px;
  color: var(--shell-muted, #6f6877);
  border: 1px solid var(--shell-line, rgba(70, 55, 45, .12));
  border-radius: 13px;
  background: var(--shell-surface, #fff);
  cursor: pointer;
  text-decoration: none;
}

.store-avatar-swatch.is-selected {
  color: var(--shell-ink, #2f2925);
  box-shadow: 0 0 0 2px var(--shell-accent, #d66c3f);
}

.avatar-color-dot {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid color-mix(in srgb, var(--avatar-color, var(--shell-accent, #d66c3f)) 72%, #fff);
  border-radius: 50%;
  background: var(--avatar-color, var(--shell-accent, #d66c3f));
  box-shadow: 0 2px 6px rgba(34, 27, 24, .16);
}
.avatar-color-dot::before {
  content: "";
  width: 56%;
  height: 56%;
  background: #fff;
  -webkit-mask: var(--avatar-mark-mask, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5.5h10l2 5-7 8-7-8 2-5Zm1 4.5 4 4 4-4-4-2-4 2Z'/%3E%3C/svg%3E")) center / contain no-repeat;
  mask: var(--avatar-mark-mask, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5.5h10l2 5-7 8-7-8 2-5Zm1 4.5 4 4 4-4-4-2-4 2Z'/%3E%3C/svg%3E")) center / contain no-repeat;
}
.avatar-color-dot[data-avatar-color="paper"]::before { background: #30283b; }
[data-avatar-color="blue"] { --avatar-color: #0076b8; }
[data-avatar-color="paper"] { --avatar-color: #fffaf4; }
[data-avatar-color="cyan"] { --avatar-color: #00a8a8; }
[data-avatar-color="copper"] { --avatar-color: #a8551f; }
[data-avatar-color="rose"] { --avatar-color: #df5b77; }
[data-avatar-color="mint"] { --avatar-color: #5eaa91; }
[data-avatar-color="graphite"] { --avatar-color: #30283b; }
[data-avatar-color="gold"] { --avatar-color: #d49a00; }
[data-avatar-color="violet"] { --avatar-color: #7956d8; }
[data-avatar-color="lime"] { --avatar-color: #6f9f18; }

.store-avatar-dot { width: 32px; height: 32px; }
.store-avatar-name { max-width: 100%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.store-avatar-cost { min-height: 14px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.store-avatar-cost svg { width: 100%; height: 100%; }

@media (max-width: 420px) {
  .store-code { grid-template-columns: 1fr; }
  .store-code-label { grid-column: auto; }
}

/* Баланс и история очков ----------------------------------------------- */
.points-screen .shell-status {
  display: grid;
  gap: 18px;
}

.points-summary {
  padding: 18px;
  border: 1px solid var(--shell-line, rgb(45 38 56 / 12%));
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    var(--shell-accent-soft, #ece2fb),
    var(--shell-surface, #fffaf5)
  );
}

.points-nickname {
  margin: 0 0 9px;
  color: var(--shell-accent, #7958b7);
  font-size: 14px;
  font-weight: 750;
}

.points-balance-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.points-balance-value {
  color: var(--shell-ink, #2d2638);
  font-size: clamp(38px, 10vw, 56px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.points-balance-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.points-balance-note {
  margin: 11px 0 0;
  color: var(--shell-muted, #746d7e);
  font-size: 13px;
  line-height: 1.45;
}

.points-ledger {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.points-ledger-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--shell-line, rgb(45 38 56 / 12%));
  border-radius: 14px;
  background: var(--shell-surface, #fffaf5);
}

.points-ledger-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.points-ledger-reason {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.points-ledger-date {
  color: var(--shell-muted, #746d7e);
  font-size: 11px;
}

.points-ledger-amount {
  color: var(--shell-accent, #7958b7);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.points-ledger-amount.is-negative {
  color: var(--shell-danger, #b44343);
}

/* Достижения и недельный рейтинг ----------------------------------------- */
.achievements-screen .shell-status {
  display: grid;
  gap: 18px;
}

.achievement-families,
.achievement-family,
.achievement-grid {
  display: grid;
  gap: 10px;
}

.achievement-families {
  margin-top: 14px;
}

.achievement-family-title {
  margin: 8px 2px 0;
  color: var(--shell-muted, #756d68);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.achievement-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--shell-border, rgba(70, 55, 45, 0.12));
  border-radius: 16px;
  background: var(--shell-surface, #fff);
}

.achievement-card.is-next {
  border-color: color-mix(in srgb, var(--shell-accent, #d66c3f) 40%, transparent);
}

.achievement-card.is-earned {
  border-color: color-mix(in srgb, var(--shell-accent, #d66c3f) 50%, transparent);
  background: color-mix(in srgb, var(--shell-accent-soft, #f7e7df) 55%, var(--shell-surface, #fff));
}

.achievement-card.is-locked {
  background: color-mix(in srgb, var(--shell-surface, #fff) 82%, transparent);
  filter: saturate(.45);
  opacity: .68;
}

.achievement-card.is-locked .achievement-card-symbol {
  color: var(--shell-muted, #756d68);
  filter: grayscale(1);
  opacity: 0.65;
}

.achievement-card-symbol,
.achievement-unlock-symbol {
  display: grid;
  place-items: center;
  color: var(--shell-accent, #d66c3f);
  font-size: 30px;
}
.achievement-card-symbol svg { width: 30px; height: 30px; }
.achievement-unlock-symbol svg { width: 54px; height: 54px; }

.achievement-card-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.achievement-card-title,
.achievement-card-text,
.achievement-progress-label {
  display: block;
}

.achievement-card-text,
.achievement-progress-label {
  color: var(--shell-muted, #756d68);
  font-size: 13px;
}

.achievement-next-title {
  margin: 18px 0 8px;
  font-size: 14px;
}

.achievement-progress {
  height: 6px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--shell-track, rgba(70, 55, 45, 0.1));
}

.achievement-progress i {
  display: block;
  width: var(--achievement-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--shell-accent, #d66c3f);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--shell-surface, #fff);
}

.leaderboard-row.is-you {
  box-shadow: inset 0 0 0 1px var(--shell-accent, #d66c3f);
}

.leaderboard-position,
.leaderboard-value {
  font-variant-numeric: tabular-nums;
}

.leaderboard-position { color: var(--shell-muted, #756d68); }
.leaderboard-value { font-weight: 750; }

.achievement-unlock {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 17, 15, 0.62);
}

.achievement-unlock[hidden] { display: none; }

.achievement-unlock-card {
  width: min(360px, 100%);
  padding: 28px 22px 22px;
  border-radius: 24px;
  text-align: center;
  background: var(--shell-surface, #fff);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.achievement-unlock-symbol { font-size: 54px; }
.achievement-unlock-title { margin: 8px 0; font-size: 24px; }
.achievement-unlock-text { margin: 0 0 20px; color: var(--shell-muted, #756d68); }

.app-shell {
  /* Цвета вынесены в переменные, а не заданы прямо: Gemmia тёплая, пиксельная
     фиолетовая, а следующая может быть детской. Перекрасить оболочку нужно
     уметь, не трогая ядро. */
  --shell-bg: #f7f1e8;
  --shell-surface: #fffaf5;
  --shell-ink: #2d2638;
  --shell-muted: #716a7a;
  --shell-line: rgb(45 38 56 / 12%);
  /* Роли цвета (--shell-accent, --shell-together, --shell-link и др.) выводятся
     из пяти входных цветов приложения — см. блок «Цветовые роли» ниже. */
  /* «Готово» — отдельная роль статуса, а не второй цвет приложения (контракт
     28.09.2026): раньше галочки завершённых работ ехали за цветом «вместе» и
     в тёмной теме получали белую надпись на светлой заливке. Значение — прежний
     синий ядра; белый текст на нём читается (4.9:1) в обеих темах. Приложение
     может задать своё --shell-done и --shell-on-done. */
  --shell-done: #2f6fd0;
  --shell-on-done: #fff;
  --shell-radius: 16px;
  /* Радиус всего нажимаемого: кнопки, вкладки, пункты меню, действия в
     строках. Меньше радиуса карточки намеренно — кнопка внутри карточки
     с равным радиусом выглядит выпирающей. */
  --shell-control-radius: 18px;
  --shell-button-radius: var(--shell-control-radius);
  --shell-button-primary-radius: var(--shell-button-radius);
  --shell-button-secondary-radius: var(--shell-button-radius);
  --shell-button-danger-radius: var(--shell-button-radius);

  display: grid;
  /* Три строки: шапка, содержимое, панель. Содержимому обязателен minmax(0,1fr),
     иначе строка растягивается под содержимое и панель уезжает за экран.
     Колонку ограничиваем по той же причине: у <canvas> собственная ширина равна
     ретина-буферу, и колонка сетки честно растянется под две тысячи пикселей.
     На этом уже дважды теряли холст — правило простое: есть canvas, пишем
     minmax(0, 1fr). */
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  /* Именно height, а не min-height. С min-height высота каркаса остаётся
     неопределённой, строка minmax(0,1fr) вырастает под длинный каталог, и
     панель уезжает вниз документа — на восьмидесяти картинах она оказалась
     на пятнадцатой тысяче пикселей, то есть её просто не было на экране.
     Поймано глазами в браузере на 390px. Определённая высота заставляет
     прокручиваться содержимое, а не страницу. */
  height: 100vh; /* запасной вариант там, где нет динамических единиц */
  height: 100dvh;
  color: var(--shell-ink);
  background: var(--shell-bg);
}

/* --- Цветовые роли (контракт фабрики 28.09.2026, palette.json) ---
   Приложение задаёт ровно пять входных цветов — на `.app-shell` (или на
   `:root, .app-shell`, если на них ссылаются экраны самого приложения):
     --shell-primary         основной, светлая тема (на нём белый текст)
     --shell-primary-dark    основной, тёмная тема (на нём текст #17151c)
     --shell-primary-text    необязательно: основной для мелкого текста на светлом
     --shell-secondary       дополнительный = «Вместе» = ссылки, светлая тема
     --shell-secondary-dark  то же, тёмная тема
   Имена ролей и места их применения — забота ядра, приложение их больше не
   задаёт. Старые имена (--shell-accent, --shell-together, --shell-accent-text)
   остаются выводимыми, чтобы код приложений продолжал работать.
   Роли объявлены и на :root: так их видят экраны приложения вне оболочки
   (холст, шапка пазла), и тёмная тема переключает их там же.
   Запасные значения — аварийная нейтральная палитра; если хост не поставил
   бренд, оболочка пишет предупреждение в консоль (layout.js). */
:root,
.app-shell {
  --shell-accent: var(--shell-primary, #7958b7);
  --shell-accent-text: var(--shell-primary-text, var(--shell-accent));
  --shell-accent-soft: color-mix(in srgb, var(--shell-accent) 10%, var(--shell-surface, #fffaf5));
  --shell-on-accent: #fff;
  --shell-together: var(--shell-secondary, #2f6fd0);
  --shell-together-soft: color-mix(in srgb, var(--shell-together) 12%, var(--shell-surface, #fffaf5));
  --shell-on-together: #fff;
  --shell-link: var(--shell-together);
}

/* Тёмная тема берёт *-dark: светлые оттенки ролей, текст на их заливке —
   #17151c (решает ядро, не приложение). */
html.coloring-theme-dark,
html.coloring-theme-dark .app-shell {
  --shell-accent: var(--shell-primary-dark, #b9a3e3);
  --shell-accent-text: var(--shell-accent);
  --shell-accent-soft: color-mix(in srgb, var(--shell-accent) 22%, var(--shell-surface, #242129));
  --shell-on-accent: #17151c;
  --shell-together: var(--shell-secondary-dark, #8fb4ee);
  --shell-together-soft: color-mix(in srgb, var(--shell-together) 22%, var(--shell-surface, #242129));
  --shell-on-together: #17151c;
  --shell-link: var(--shell-together);
}

/* Тема задаётся одним классом на html: так полноэкранный холст и оболочка не
   расходятся, а «как в системе» остаётся решением JS-модуля настроек. Более
   высокая специфичность нужна намеренно — приложение подключает свой CSS после
   shell.css и перекрашивает обычную светлую тему переменными. */
html.coloring-theme-dark .app-shell {
  --shell-bg: #17151c;
  --shell-surface: #242129;
  --shell-ink: #f2edf5;
  --shell-muted: #aaa2b1;
  --shell-line: rgb(242 237 245 / 14%);
  /* Подложка «тихих» кнопок. Без неё в тёмной теме оставался светлый запасной
     #efe9e0 под светлой надписью: «Войти по почте» на экране входа было не
     прочесть (24.09, Scaria). Считается от поверхности и чернил самого
     приложения, поэтому годится и для своей тёмной палитры. */
  --shell-soft: color-mix(in srgb, var(--shell-ink) 12%, var(--shell-surface));
}

/* Тёмная палитра для экранов САМОГО приложения — холста, палитры, диалогов.
   Оболочка выше красится своими `--shell-*`; эти имена — те, которыми уже
   пользуются раскраски, поэтому приложение получает тёмную тему, ничего у
   себя не объявляя. Свой оттенок задаётся переопределением одной переменной.

   Значения выровнены по Паззии: она единственная, где тёмную тему смотрели
   глазами и правили по замечаниям. */
html.coloring-theme-dark {
  color-scheme: dark;
  --paper: #17141d;
  --paper-deep: #211c29;
  --surface: #27212f;
  --canvas-bg: #1c1922;
  --ink: #f2edf7;
  --muted: #aaa1b3;
  --line: rgb(242 237 247 / 14%);
}

/* Скрытие обязано побеждать display из правил ниже. Мы уже дважды ловили это:
   элемент с [hidden] остаётся видимым, если ему где-то назначен display: grid
   или flex. Без !important панель и пустые состояния всплывали бы поверх. */
.app-shell [hidden] {
  display: none !important;
}

/* Шапка ростом в одну строку: знак приложения слева, действия справа.
   Высота задана явно, чтобы её нельзя было случайно раздуть содержимым —
   именно раздутая шапка «на треть экрана» и была первой жалобой на витрину. */
.shell-header {
  position: relative; /* якорь для панели меню */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: max(4px, env(safe-area-inset-top)) 12px 5px;
  background: var(--shell-surface);
}

.shell-header-lead,
.shell-header-actions,
.shell-header-screen-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

/* --- счёт и меню в правом углу шапки ---
   Пилюля счёта повторяет iFutureArt: значок, число, скруглённый фон в мягком
   акценте. Числа моноширинные — иначе при 9 → 10 пилюля дёргается и тянет
   взгляд туда, где ничего не произошло. */
.shell-score {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 11px 7px 9px;
  color: var(--shell-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  background: var(--shell-accent-soft);
  cursor: pointer;
}

.shell-score-content {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

.shell-header-action,
.shell-menu-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: var(--shell-control-radius);
  background: color-mix(in srgb, var(--shell-ink) 6%, transparent);
  cursor: pointer;
}

.shell-header-action svg,
.shell-menu-button svg { width: 19px; height: 19px; }
.shell-header-action { color: var(--shell-accent-text); }
.shell-menu-button.is-open { color: var(--shell-accent); background: var(--shell-accent-soft); }

/* Панель прижата к правому краю шапки: кнопка стоит там же, и открывшееся
   меню не должно перепрыгивать через экран. Ширина ограничена, чтобы на
   планшете панель не растянулась во всю шапку. */
.shell-menu {
  position: absolute;
  top: calc(100% - 2px);
  inset-inline-end: 12px;
  z-index: 20;
  display: grid;
  gap: 2px;
  width: min(260px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  background: var(--shell-surface);
  box-shadow: 0 14px 34px rgb(45 38 56 / 18%);
}

.shell-menu-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  border: 0;
  border-radius: var(--shell-control-radius);
  background: transparent;
  cursor: pointer;
}

.shell-menu-item:active { background: color-mix(in srgb, var(--shell-ink) 6%, transparent); }
.shell-menu-icon { display: grid; place-items: center; width: 22px; height: 22px; color: var(--shell-accent-text); }
.shell-menu-icon svg { width: 20px; height: 20px; }
.shell-menu-copy { display: grid; gap: 2px; min-width: 0; }
.shell-menu-copy strong { font-size: 14px; font-weight: 750; }
.shell-menu-note { color: var(--shell-muted); font-size: 12px; line-height: 1.35; }

.shell-header-titles { min-width: 0; }

/* Заголовок появляется только на подэкранах, поэтому он скромный: крупный
   набор здесь соревновался бы с названиями картин в галерее. */
.shell-title {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-brand {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0;
  color: inherit;
  border: 0;
  background: none;
  cursor: inherit;
}

.shell-brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 9px;
}

.shell-brand-mark svg,
.shell-brand-mark img { width: 100%; height: 100%; }

.shell-brand-word {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

/* На узком подэкране остаётся узнаваемый знак, а слово уступает место
   кнопке «назад», заголовку и постоянным действиям. */
.shell-brand.is-with-back .shell-brand-word { display: none; }

.shell-back {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: var(--shell-control-radius);
  background: color-mix(in srgb, var(--shell-ink) 6%, transparent);
  cursor: pointer;
}

.shell-back svg { width: 19px; height: 19px; }

.shell-content {
  min-width: 0;
  min-height: 0;
  padding: 10px 12px 18px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.shell-content:focus { outline: none; }

/* --- нижняя навигация --- */

.shell-nav {
  position: relative;
  isolation: isolate;
  pointer-events: auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 6px 4px;
  /* Панель не «висит» над содержимым, а занимает свою строку сетки, поэтому
     перекрыть содержимое она не может в принципе. Остаётся только домашний
     индикатор телефона — под него и добавляется safe-area. */
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--shell-line);
  background: var(--shell-surface);
}

.shell-tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 2px;
  color: var(--shell-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  border-radius: var(--shell-control-radius);
  -webkit-tap-highlight-color: transparent;
}

.shell-tab-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.shell-tab-icon svg { width: 22px; height: 22px; }

.shell-tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Точка-маркер: приложение зажигает её, когда в разделе что-то ждёт человека
   (живая комната, новая картина). По умолчанию скрыта. */
.shell-tab-dot {
  position: absolute;
  top: -1px;
  inset-inline-end: -2px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--shell-surface);
  border-radius: 50%;
  background: var(--shell-together);
}

/* Подпись активной вкладки чуть темнее акцента (в тёмной теме — светлее).
   Фон вкладки — оттенок того же акцента, и цвет на оттенке самого себя
   высокого контраста не даёт в принципе: замер показал 4.13–4.38 при норме
   4.5, и увеличение доли акцента в фоне только ухудшало дело. Сдвиг подписи
   к основному цвету текста поднимает минимум до 4.9 и оставляет заливку
   заметной. */
.shell-tab.is-active {
  color: color-mix(in srgb, var(--shell-accent-text) 85%, var(--shell-ink));
  background: var(--shell-accent-soft);
}
/* Та же поправка для «Вместе»: чистый цвет на своём оттенке давал 4.1–4.4
   (замер по palette.json 28.09.2026), со сдвигом к чернилам — не ниже 4.7. */
.shell-tab.is-accent.is-active { color: color-mix(in srgb, var(--shell-together) 85%, var(--shell-ink)); background: var(--shell-together-soft); }

/* --- общие состояния экранов --- */

.shell-screen { display: grid; gap: 12px; align-content: start; }

.shell-status { display: grid; }
.shell-status-text { margin: 24px 0; color: var(--shell-muted); text-align: center; }

.shell-empty,
.shell-notice {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px 20px;
  text-align: center;
  border: 1px dashed var(--shell-line);
  border-radius: var(--shell-radius);
  background: color-mix(in srgb, var(--shell-surface) 60%, transparent);
}

.shell-empty-sign {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0;
  color: var(--shell-accent-text);
  font-size: 26px;
}
.shell-empty-sign svg { width: 100%; height: 100%; }
.shell-empty-mascot {
  width: min(164px, 52vw);
  height: 164px;
  object-fit: contain;
}

/* В заметке знак — не украшение, а значок: «!» сам по себе читался как
   сбой отрисовки, а не как предупреждение. Кружок делает его намеренным.
   Заглушку раздела (.shell-empty) не трогаем: там знак крупный и уместен. */
.shell-notice .shell-empty-sign {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--shell-accent, #7958b7) 12%, transparent);
}
.shell-empty-title { font-size: 15px; }
.shell-empty-text { display: grid; gap: 8px; max-width: 32ch; color: var(--shell-muted); font-size: 13px; line-height: 1.5; }
.shell-empty-text .shell-paragraph { margin: 0; }

.shell-button {
  margin-top: 6px;
  padding: 11px 18px;
  color: var(--shell-on-accent, #fff);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  border: 0;
  border-radius: var(--shell-button-primary-radius, var(--shell-control-radius, 18px));
  background: var(--shell-accent);
  cursor: pointer;
}

.shell-button-primary {
  border-radius: var(--shell-button-primary-radius, var(--shell-control-radius, 18px));
}
.shell-button-primary.is-together { color: var(--shell-on-together, #fff); background: var(--shell-together); }
/* Внешний переход (kind: "external") — роль «ссылка»; значение то же, что у
   «Вместе», но имя своё, чтобы роли можно было развести. */
.shell-button-primary.is-link { color: var(--shell-on-together, #fff); background: var(--shell-link); }
/* Одиночное действие — основной цвет приложения (контракт 28.09.2026). Раньше
   здесь был «стандартный синий» #2f6fd0, который никто из хостов не задавал. */
.shell-button-primary[data-button-color="solo"] { color: var(--shell-on-accent, #fff); background: var(--shell-solo, var(--shell-accent)); }
.shell-button-secondary,
.shell-button-quiet,
.shell-button-ghost,
.shell-button.is-secondary {
  border-radius: var(--shell-button-secondary-radius, var(--shell-control-radius, 18px));
}
.shell-button-secondary {
  color: var(--shell-ink, #2d2638);
  background: var(--shell-soft, #efe9e0);
}
.shell-button-danger {
  border-radius: var(--shell-button-danger-radius, var(--shell-control-radius, 18px));
  /* Белый на красном в обеих темах: красный не зависит от темы, а общий
     цвет надписи кнопки (--shell-on-accent) в тёмной теме тёмный. */
  color: #fff;
  background: var(--shell-danger, #c4453f);
}
.shell-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- общий попап --- */

.shell-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(25 20 31 / 58%);
  backdrop-filter: blur(5px);
}

.shell-dialog {
  display: grid;
  gap: 16px;
  width: min(100%, 420px);
  max-height: min(80dvh, 620px);
  overflow-y: auto;
  padding: 22px;
  color: var(--shell-ink, #2d2638);
  border: 1px solid var(--shell-line, rgb(45 38 56 / 14%));
  border-radius: var(--shell-radius, 16px);
  background: var(--shell-surface, #fffaf5);
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

.shell-dialog-title { margin: 0; font-size: 20px; line-height: 1.25; }
.shell-dialog-copy { display: grid; gap: 10px; }
.shell-dialog-paragraph { margin: 0; color: var(--shell-muted); font-size: 14px; line-height: 1.55; }
.shell-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.shell-dialog-actions .shell-button { min-width: 110px; margin: 0; }

.shell-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

/* --- плитка каталога ---
   Главный экран обеих раскрасок — галерея картин, а не лента баннеров: люди
   пришли выбрать картинку, и первое, что они должны увидеть, — сами картинки.
   Отсюда два столбца прямо под шапкой, без вводного текста и без счётчиков
   вроде «80 сюжетов»: число картин человеку ничего не даёт, а верхнюю треть
   экрана съедает. Ровно так устроена галерея iFutureArt. */
.shell-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shell-tiles > li { position: relative; display: grid; min-width: 0; }

/* Кнопка «(i)»: вход на страницу картины. Мишень 30px в углу превью — меньше
   делать нельзя (не попасть пальцем), больше некуда (закроет картинку). */
.shell-tile-info {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  text-decoration: none;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--shell-ink) 62%, transparent);
  cursor: pointer;
}

.shell-tile-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--shell-surface);
  cursor: pointer;
}

.shell-tile-body:active { transform: scale(0.985); }

.shell-tile-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1;
  background: color-mix(in srgb, var(--shell-ink) 7%, transparent);
}

.shell-tile-preview img { width: 100%; height: 100%; object-fit: cover; }
.shell-tile-fallback { color: var(--shell-muted); font-size: 26px; }

/* Значок процента — только на начатых картинах: «0%» на каждой плитке
   зашумляет галерею и ничего не сообщает. */
.shell-tile-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  padding: 3px 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 76%, transparent);
}
.shell-tile-badge.is-done,
.work-card-badge.is-done,
.room-card-percent.is-done { display: inline-flex; align-items: center; gap: 3px; }
.shell-done-icon { display: inline-grid; place-items: center; width: 12px; height: 12px; }
.shell-done-icon svg { width: 100%; height: 100%; }

.shell-tile-badge.is-done { color: var(--shell-on-done, #fff); background: var(--shell-done); }

/* Значок времени поверх превью. Нижний правый угол — единственный свободный:
   слева внизу подпись способа у мандал, справа сверху процент, слева сверху
   кнопка «(i)». В iFutureArt он лежит слева внизу по той же логике — там
   заняты другие углы. */
.shell-time-pill {
  position: absolute;
  inset-inline-end: 7px;
  bottom: 10px;
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 3px 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 72%, transparent);
}

.shell-time-pill-sign { width: 11px; height: 11px; line-height: 1; opacity: 0.85; }
.shell-time-pill-sign svg { width: 100%; height: 100%; }
.shell-tile-fallback svg,
.work-card-fallback svg { width: 26px; height: 26px; }

.shell-tile-progress-label {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 7px;
  padding: 3px 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 72%, transparent);
}

.shell-tile-copy { display: grid; align-content: start; gap: 5px; padding: 9px 10px 11px; }

.shell-tile-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shell-tile-note { color: var(--shell-muted); font-size: 11px; }

.shell-tile-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: color-mix(in srgb, var(--shell-ink) 18%, transparent);
}

.shell-tile-track i { display: block; width: var(--shell-progress, 0%); height: 100%; background: var(--shell-accent); }

/* --- карточка работы --- */

.work-card { position: relative; }

.work-card-body {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 10px;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--shell-surface);
  cursor: pointer;
}

/* Крестик не вложен в большую кнопку карточки: два независимых действия не
   должны образовывать вложенные button. Дополнительный отступ сохраняет место
   для него и не даёт длинному названию оказаться под кнопкой. */
.work-card.has-remove .work-card-body { padding-inline-end: 46px; }

.work-card-remove {
  position: absolute;
  z-index: 1;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--shell-muted);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  border: 1px solid var(--shell-line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--shell-surface) 92%, transparent);
  cursor: pointer;
}

.work-card-remove:disabled { cursor: wait; opacity: 0.5; }
.work-card-remove:focus-visible { outline: 3px solid var(--shell-accent-soft); outline-offset: 2px; }
@media (hover: hover) { .work-card-remove:hover { color: #c4453f; border-color: color-mix(in srgb, #c4453f 38%, transparent); } }

.work-card-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 12px;
  background: color-mix(in srgb, var(--shell-ink) 8%, transparent);
}

.work-card-preview img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--card-preview-scale, 1)); }

/* Переключатель вариантов одной картины (размеры Pixia, детали Паззии) —
   под телом карточки, отдельными кнопками (владелец 30.09.2026). */
.work-card.has-variants .work-card-body { border-end-start-radius: 0; border-end-end-radius: 0; }
.work-card-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 10px;
  border: 1px solid var(--shell-line);
  border-top: 0;
  border-end-start-radius: var(--shell-radius);
  border-end-end-radius: var(--shell-radius);
  background: var(--shell-surface);
}
.work-card-variant {
  min-height: 30px;
  padding: 4px 10px;
  color: var(--shell-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--shell-line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.work-card-variant.is-active {
  color: var(--shell-on-accent, #fff);
  border-color: var(--shell-accent);
  background: var(--shell-accent);
}
.work-card-variant:focus-visible { outline: 3px solid var(--shell-accent-soft); outline-offset: 2px; }
.work-card-fallback { color: var(--shell-muted); font-size: 22px; }

.work-card-badge {
  position: absolute;
  inset-inline-end: 4px;
  bottom: 4px;
  padding: 2px 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--shell-ink) 78%, transparent);
}

/* Законченная работа — тот же цвет готовности, что и на плитке каталога:
   одна работа в двух списках не должна выглядеть двумя разными. */
.work-card-badge.is-done { color: var(--shell-on-done, #fff); background: var(--shell-done); }

.work-card-copy { display: grid; gap: 6px; align-content: center; min-width: 0; }
.work-card-title { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.work-card-note { color: var(--shell-muted); font-size: 11px; }

.work-card-track { height: 5px; overflow: hidden; border-radius: 10px; background: color-mix(in srgb, var(--shell-ink) 10%, transparent); }
.work-card-track i { display: block; width: var(--shell-progress, 0%); height: 100%; background: var(--shell-accent); }
.work-card-action { color: var(--shell-accent-text); font-size: 12px; font-weight: 800; }

/* --- страница одной картины ---
   Превью во всю ширину: это главное, ради чего сюда заходят, и делить экран
   пополам ради пустого поля незачем. Числа идут чипами в одну строку с
   переносом — так их видно целиком, не листая. */

.shell-picture-hero {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: color-mix(in srgb, var(--shell-ink) 6%, transparent);
}

.shell-picture-hero img { width: 100%; height: 100%; object-fit: contain; }
.shell-picture-fallback { color: var(--shell-muted); font-size: 40px; }

.shell-picture-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  padding: 4px 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 76%, transparent);
}

.shell-picture-badge.is-done { color: var(--shell-on-done, #fff); background: var(--shell-done); }

.shell-picture-caption {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 10px;
  padding: 4px 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 62%, transparent);
}

.shell-picture-title { margin: 2px 0 0; font-size: 20px; font-weight: 850; letter-spacing: -0.02em; }

.shell-picture-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shell-picture-fact {
  display: flex;
  gap: 5px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 6%, transparent);
}

.shell-picture-fact-value { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.shell-picture-fact-label { color: var(--shell-muted); font-size: 12px; }

.shell-picture-track { height: 7px; overflow: hidden; border-radius: 10px; background: color-mix(in srgb, var(--shell-ink) 10%, transparent); }
.shell-picture-track i { display: block; width: var(--shell-progress, 0%); height: 100%; background: var(--shell-accent); }
.shell-picture-progress-note { margin: 0; color: var(--shell-muted); font-size: 13px; }

.shell-picture-action { display: block; margin-top: 4px; text-align: center; text-decoration: none; }

.shell-picture-secondary {
  display: block;
  padding: 11px 18px;
  color: var(--shell-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-control-radius);
  background: transparent;
  cursor: pointer;
}

.shell-picture-note { margin: 0; color: var(--shell-muted); font-size: 12px; line-height: 1.5; }

/* --- строки «Ещё» и «Настроек» --- */

.shell-row-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--shell-surface);
  cursor: pointer;
}

.shell-row-icon { display: grid; place-items: center; width: 24px; height: 24px; color: var(--shell-accent-text); }
/* Строки-переходы наружу (сайт, соцсети, почта поддержки, документы) — роль
   «ссылка», а не основной цвет. */
a.shell-row-body:is([href^="http"], [href^="mailto:"], [target="_blank"]) .shell-row-icon,
a.shell-menu-item:is([href^="http"], [href^="mailto:"], [target="_blank"]) .shell-menu-icon { color: var(--shell-link); }
.shell-row-icon svg { width: 21px; height: 21px; }
.shell-row-copy { display: grid; gap: 3px; min-width: 0; }
.shell-row-copy strong { font-size: 14px; }
.shell-row-note { color: var(--shell-muted); font-size: 12px; line-height: 1.4; }
.shell-row-chevron { display: grid; place-items: center; color: var(--shell-muted); }
.shell-row-chevron svg { width: 18px; height: 18px; }

.shell-row-action {
  padding: 8px 12px;
  color: var(--shell-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-control-radius);
  background: transparent;
  cursor: pointer;
}

.shell-row.is-danger .shell-row-action { color: #c4453f; border-color: color-mix(in srgb, #c4453f 34%, transparent); }

/* --- общие переключатели настроек --- */

.shell-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--shell-surface);
}

.shell-setting-row.is-stacked { grid-template-columns: minmax(0, 1fr); }

.shell-switch { position: relative; display: inline-grid; cursor: pointer; }
.shell-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shell-switch-track {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 18%, transparent);
  transition: background .16s ease;
}
.shell-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--shell-surface);
  box-shadow: 0 1px 4px rgb(0 0 0 / 24%);
  transition: transform .16s ease;
}
.shell-switch input:checked + .shell-switch-track { background: var(--shell-accent); }
.shell-switch input:checked + .shell-switch-track::after { transform: translateX(18px); }
.shell-switch input:focus-visible + .shell-switch-track { outline: 3px solid var(--shell-accent-soft); outline-offset: 2px; }

.shell-theme-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--shell-ink) 8%, transparent);
}
.shell-theme-button {
  min-width: 0;
  padding: 8px 6px;
  color: var(--shell-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  border: 0;
  border-radius: var(--shell-control-radius);
  background: transparent;
  cursor: pointer;
}
.shell-theme-button.is-active { color: var(--shell-ink); background: var(--shell-surface); }

.shell-setting-radio {
  width: 22px;
  height: 22px;
  accent-color: var(--shell-accent);
  cursor: pointer;
}

.shell-setting-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--shell-ink) 8%, transparent);
}

.shell-setting-choice-button,
.shell-setting-action {
  min-height: 36px;
  padding: 7px 11px;
  border: 0;
  color: var(--shell-muted);
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.shell-setting-choice-button { border-radius: var(--shell-control-radius); }

.shell-setting-choice-button.is-active {
  color: var(--shell-ink);
  background: var(--shell-surface);
  box-shadow: 0 1px 5px rgb(0 0 0 / 10%);
}

.shell-setting-action {
  color: color-mix(in srgb, var(--shell-link) 85%, var(--shell-ink));
  background: var(--shell-together-soft);
}

.shell-setting-action:disabled { cursor: wait; opacity: .64; }

.shell-switch input:disabled + .shell-switch-track { cursor: wait; opacity: .46; }
.shell-setting-row.is-static { grid-template-columns: minmax(0, 1fr); }
.shell-notification-status {
  min-height: 20px;
  margin: 0;
  color: var(--shell-muted);
  font-size: 13px;
  line-height: 1.5;
}
.shell-notification-status.is-error { color: #a33a46; }
.shell-notification-status.is-success { color: #28705a; }

.shell-highlight-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shell-highlight-button {
  display: grid;
  gap: 5px;
  place-items: center;
  min-width: 0;
  padding: 7px 4px;
  border: 2px solid transparent;
  border-radius: var(--shell-control-radius);
  color: var(--shell-muted);
  background: color-mix(in srgb, var(--shell-ink) 5%, var(--shell-surface));
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.shell-highlight-button.is-active { border-color: var(--shell-accent); color: var(--shell-ink); }
.shell-highlight-swatch { width: 36px; height: 30px; border-radius: 8px; background: #f1efed; }
.shell-highlight-swatch.is-crosshatch {
  background-color: #f1efed;
  background-image: repeating-linear-gradient(45deg, transparent 0 5px, #aaa4ae 5px 6px),
    repeating-linear-gradient(-45deg, transparent 0 5px, #aaa4ae 5px 6px);
}
.shell-highlight-swatch.is-color { background: color-mix(in srgb, var(--shell-accent) 38%, #fff); }
.shell-highlight-swatch.is-dots { background-color: #f1efed; background-image: radial-gradient(#96909d 2px, transparent 2px); background-size: 9px 9px; }
.shell-highlight-swatch.is-outline { background: #f1efed; box-shadow: inset 0 0 0 3px var(--shell-accent); }
.shell-highlight-swatch.is-transparency { background: conic-gradient(#c7c7c7 25%, #ebebeb 0 50%, #c7c7c7 0 75%, #ebebeb 0) 0 0 / 12px 12px; }
.shell-highlight-swatch.is-transparencyBlue { background: conic-gradient(#5c9fd8 25%, #cfe6ff 0 50%, #5c9fd8 0 75%, #cfe6ff 0) 0 0 / 12px 12px; }

/* --- переключатель подборок --- */

.shell-segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--shell-ink) 7%, transparent);
}

.shell-segment {
  padding: 9px 6px;
  color: var(--shell-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  border: 0;
  border-radius: var(--shell-control-radius);
  background: transparent;
  cursor: pointer;
}

.shell-segment.is-active { color: var(--shell-ink); background: var(--shell-surface); }

/* --- вход в комнату по ссылке --- */

.shell-join { display: grid; gap: 8px; }
.shell-join-label { color: var(--shell-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.shell-join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.shell-join-row-with-paste { grid-template-columns: minmax(0, 1fr) auto auto; }

.shell-join-input {
  min-width: 0;
  padding: 12px 14px;
  color: inherit;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-control-radius);
  background: var(--shell-surface);
}

.shell-join .shell-button { margin: 0; }
.shell-join-hint { margin: 0; color: var(--shell-muted); font-size: 12px; line-height: 1.5; }
.shell-join-message { display: grid; gap: 6px; margin: 0; color: #c4453f; font-size: 12px; }
.shell-join-message .shell-paragraph { margin: 0; }

.room-invite-start { display: grid; justify-items: start; }
.room-list-controls { display: grid; gap: 10px; }
.room-invite-start-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin: 0;
}
/* «Начать вместе» — действие роли «вместе» (контракт 28.09.2026), а не
   основного цвета. Приложения подмешивают сюда классы своих кнопок «Из фото»
   (startButtonClass) и тёмные правки к ним вида html.coloring-theme-dark .x —
   тройной класс перебивает их заливку и надпись. */
.app-shell .room-invite-start .room-invite-start-button {
  color: var(--shell-on-together);
  border-color: transparent;
  background: var(--shell-together);
}
.room-invite-start-sign { display: inline-block; font-size: 17px; line-height: 1; }
.room-invite-start-card { display: grid; gap: 14px; }
.room-invite-start-card .room-invite-preview-title { padding-inline-end: 42px; }
.room-invite-create-own { margin: 2px 0 0; }

/* «Начать вместе» — самостоятельный маршрут, а не нижний лист. Два блока
   читаются сверху вниз и не меняют ширину/порядок на телефоне. */
.room-start-screen {
  display: grid;
  align-content: start;
  gap: 14px;
  width: min(100%, 620px);
  margin-inline: auto;
  padding: 12px 12px 28px;
}
.room-start-block {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--shell-ink) 10%, transparent);
  border-radius: 22px;
  background: var(--shell-surface);
}
.room-start-title { margin: 0; font-size: clamp(20px, 5.5vw, 26px); line-height: 1.18; }
.room-start-screen .shell-join { gap: 10px; }
.room-start-screen .shell-join-row { grid-template-columns: minmax(0, 1fr) auto; }
.room-start-screen .shell-join-row .shell-button-primary { grid-column: 1 / -1; }
.room-start-screen .shell-join-hint { margin: 0; color: var(--shell-muted); line-height: 1.45; }
.room-start-steps { display: grid; gap: 12px; margin: 0; padding-inline-start: 24px; }
.room-start-steps li { padding-inline-start: 3px; line-height: 1.45; }
.room-start-icon-step { display: list-item; }
.room-start-together-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 34px;
  margin-inline-start: 8px;
  vertical-align: middle;
  color: var(--shell-together);
}
.room-start-together-icon svg { width: 22px; height: 22px; }
.room-completed-together-tip {
  position: absolute;
  z-index: 12;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: max-content;
  max-width: min(260px, 78vw);
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--shell-on-together, #fff);
  background: var(--shell-together);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--shell-together) 35%, transparent);
  pointer-events: none;
}
.room-completed-tip-anchor { position: relative !important; overflow: visible !important; }
.room-completed-together-tip::before {
  content: '';
  position: absolute;
  inset-block-start: -5px;
  inset-inline-end: 16px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
}
.room-participants-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.room-participants-row::-webkit-scrollbar { display: none; }
.room-participant-chip {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 4px 9px 4px 4px;
  color: var(--shell-ink, #2d2638);
  border: 1px solid color-mix(in srgb, var(--shell-together, #2f8f85) 48%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-together, #2f8f85) 10%, var(--shell-surface, #fff));
}
.room-participant-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--shell-on-together, #fff);
  font-size: 11px;
  font-weight: 850;
  border-radius: 50%;
  background: var(--shell-together, #2f8f85);
}
.room-participant-words { display: grid; min-width: 0; line-height: 1.05; }
.room-participant-name { max-width: 96px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.room-participant-status { color: var(--shell-muted, #777); font-size: 9px; font-weight: 700; }
.room-participant-score { font-size: 14px; font-variant-numeric: tabular-nums; }
.room-start-catalog { width: 100%; min-height: 50px; }

.room-invite-preview {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(25 25 30 / 58%);
  backdrop-filter: blur(6px);
}
.room-invite-preview[hidden] { display: none; }
.room-invite-preview-card {
  position: relative;
  width: min(440px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  overflow: auto;
  border-radius: 24px;
  padding: 18px;
  background: var(--shell-surface, #fff);
  color: var(--shell-ink, #28262d);
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}
.room-invite-preview-close {
  position: absolute;
  inset-inline-end: 12px;
  top: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 88%);
  color: #28262d;
  font-size: 25px;
  cursor: pointer;
}
.room-invite-preview-status { padding: 32px 12px; text-align: center; font-weight: 750; }
.room-invite-preview-content { display: grid; gap: 10px; }
.room-invite-preview-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--shell-soft, #f2f0f5);
}
.room-invite-preview-eyebrow {
  margin: 4px 0 0;
  color: var(--shell-muted, #6e6978);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.room-invite-preview-title { margin: 0; font-size: clamp(22px, 6vw, 30px); }
.room-invite-preview-inviter,
.room-invite-preview-places { margin: 0; color: var(--shell-muted, #6e6978); font-weight: 700; }
.room-invite-preview-code {
  direction: ltr;
  unicode-bidi: isolate;
  justify-self: start;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--shell-soft, #f2f0f5);
  font: 850 22px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .08em;
}
.room-invite-waiting-code {
  direction: ltr;
  unicode-bidi: isolate;
  justify-self: center;
  margin: 14px 0 8px;
  font: 900 clamp(34px, 11vw, 52px)/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .1em;
}
.room-invite-waiting-actions { display: grid; gap: 9px; }
.room-invite-waiting-continue {
  border: 0;
  padding: 8px;
  background: none;
  color: var(--shell-muted, #6e6978);
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 560px) {
  .shell-join-row { grid-template-columns: minmax(0, 1fr) auto; }
  .shell-join-row .shell-button-primary { grid-column: 1 / -1; }
  .room-invite-preview { align-items: end; padding: 0; }
  .room-invite-preview-card { width: 100%; border-radius: 24px 24px 0 0; padding: 16px 16px 24px; }
}

.shell-section { display: grid; gap: 8px; }
.shell-section-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }

/* Надзаголовок остался только внутри содержимого: в шапке он добавлял вторую
   строку и поднимал её высоту вдвое. */
.shell-eyebrow {
  margin: 0;
  color: var(--shell-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.shell-section-text { display: grid; gap: 8px; color: var(--shell-muted); font-size: 13px; line-height: 1.55; }
.shell-section-text .shell-paragraph { margin: 0; }

/* --- картина дня ---
   Картина здесь одна, поэтому плитка занимает всю ширину, а не половину:
   это не галерея с выбором, а сегодняшнее задание, и делить экран пополам
   ради пустого столбца незачем. */
.shell-daily .shell-daily-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
.shell-daily-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.shell-daily-date {
  margin: 0;
  color: var(--shell-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: end;
  text-transform: uppercase;
}
.shell-daily-records {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 4px 14px;
  list-style: none;
  border: 1px solid var(--shell-line);
  border-radius: 18px;
  background: var(--shell-surface);
  box-shadow: 0 8px 24px rgb(45 38 56 / 7%);
}
.shell-daily-record {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 6px 0;
}
.shell-daily-record + .shell-daily-record { border-top: 1px solid var(--shell-line); }
.shell-daily-record-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--shell-accent);
  border-radius: 10px;
  background: var(--shell-accent-soft);
}
.shell-daily-record-icon svg { width: 19px; height: 19px; }
.shell-daily-record-copy { min-width: 0; margin: 0; font-size: 14px; line-height: 1.35; }
.shell-daily-record-label { font-weight: 800; }
.shell-daily-record-value { margin-inline-start: .28em; }
.shell-daily-record-artpoints {
  display: inline-flex;
  margin-inline-start: .32em;
  vertical-align: -.08em;
}
.shell-daily-record-artpoints .shell-artpoints-number { display: none; }
.shell-daily-record-artpoints .shell-artpoints-mark { width: 1.15em; height: .92em; }
.shell-daily-record:last-child .shell-daily-record-copy { white-space: nowrap; }
.shell-daily-facts {
  display: grid;
  /* Второй столбец не шире оставшегося места: иначе строка рекорда с пятью
     именами растягивает сетку за край экрана вместо того, чтобы прокручиваться. */
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  gap: 4px 12px;
  margin: 12px 0 0;
  font-size: 13px;
}
.shell-daily-fact-label { color: var(--shell-muted); }
.shell-daily-fact-value { margin: 0; min-width: 0; font-weight: 700; }
/* Строка рекорда с именами — одна горизонтально прокручиваемая строка, как ряд
   участников на карточках «Вместе»: все имена, без переносов, обрезки и
   многоточия (владелец 22.09: «я хотел прокрутку а-ля во „Вместе“, чтобы все были»). */
.shell-daily-fact-value.is-scrollable {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
/* Имя в строке рекорда — ссылка на профиль, как на карточках «Вместе». */
.shell-daily-fact-person {
  padding: 0; border: 0; background: none; font: inherit; color: var(--shell-link, inherit);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.shell-daily-done { margin: 12px 0 0; color: var(--shell-muted); font-size: 13px; }
.shell-daily-action { display: inline-block; text-decoration: none; text-align: center; }
/* «Со всеми» и «вместе» используют общий залитый shell-button-primary.is-together. */
/* Негромкое третье действие — «поделиться» и прочее, что не про прохождение
   картины. Вот его действительно надо приглушить. */
.shell-daily-action.is-secondary {
  border: 1px solid var(--shell-line);
  background: transparent;
  color: var(--shell-together);
}
/* Подпись под кнопкой — «сейчас собирают трое». Прижата к своей кнопке
   отрицательным отступом сверху: иначе она висит ровно между двумя кнопками
   и непонятно, к какой относится. */
.shell-daily-action-note {
  margin: -6px 0 0;
  text-align: center;
  color: var(--shell-muted);
  font-size: 13px;
}

.app-shell a:focus-visible,
.app-shell button:focus-visible,
.app-shell input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--shell-accent) 40%, transparent);
  outline-offset: 2px;
}

/* На планшете и в браузере плитка 2×N растянулась бы до размера постера,
   поэтому столбцов становится больше, а не шире. */
@media (min-width: 560px) {
  .shell-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

@media (min-width: 720px) {
  .shell-content { padding-inline: max(12px, calc((100% - 720px) / 2)); }
  .shell-nav { padding-inline: max(4px, calc((100% - 720px) / 2)); }
  .shell-header { padding-inline: max(12px, calc((100% - 720px) / 2)); }
  .shell-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- экран входа ---
   Появился, потому что без него человек каждый заход становился новым
   гостем: гостевой ключ терялся, очки писались очередному безымянному
   человеку, и владелец видел «0 очков» при исправном счётчике.

   Гость никого не запирает, но и не спорит с кнопками входа: текстовая
   кнопка «Продолжить без входа» и серая сноска под ней (владелец 21.09). */
.shell-login { display: grid; gap: 12px; }
.shell-login-title { margin: 0; font-size: 19px; }
.shell-login-lead { margin: 0; color: var(--shell-muted, #6f6877); font-size: 13px; line-height: 1.5; }
/* Гость — второстепенный путь: текстовая кнопка без рамки, под ней сноска. */
.shell-login-guest {
  margin: 0;
  min-height: 36px;
  color: var(--shell-link, #2f6fd0);
  background: transparent;
  box-shadow: none;
}
.shell-login-note {
  margin: -8px 0 0;
  color: var(--shell-muted, #6f6877);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.shell-login-buttons { display: grid; gap: 8px; }
/* Слой первого входа (`первый-вход.js`): карточка по центру поверх
   приложения. Цвета — переменные оболочки, приложение перекрашивает их само. */
.shell-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.45);
}
.shell-login-card {
  width: min(420px, 100%);
  padding: 20px 16px 18px;
  border-radius: 24px;
  color: var(--shell-ink, #2f2925);
  background: var(--shell-surface, #fff);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.shell-login-buttons .shell-button { margin: 0; }
/* Цвета поставщиков — их собственные, узнаваемость кнопки здесь важнее
   нашей палитры: человек ищет глазами знакомый чёрный Apple и белый Google. */
.shell-button-apple { background: #000; }
.shell-button-google { color: #1f1f1f; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16); }
/* GIS рисует кнопку внутри своего iframe: только он может надёжно сохранить
   пользовательский жест и открыть popup в Safari. Контейнер держит то же
   место в сетке, пока SDK загружается, затем уступает его официальной кнопке. */
.shell-google-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 40px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  border-radius: var(--shell-button-primary-radius, var(--shell-control-radius, 18px));
}
.shell-google-button > div { width: 100% !important; }
/* При строгом CSP GIS не может применить свой вставленный <style>. Safari в
   ITP-режиме оставляет в контейнере семантическую popup-кнопку; оформляем её
   без привязки к сгенерированным именам классов Google. */
.shell-google-button > div > div:first-child > [role="button"] {
  position: relative;
  display: flex;
  align-items: center;
  width: 100% !important;
  height: 40px;
  padding: 0 12px;
  overflow: hidden;
  color: #3c4043;
  font: 500 14px/1 "Google Sans", arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #dadce0;
  border-radius: var(--shell-button-primary-radius, var(--shell-control-radius, 18px));
  background: #fff;
}
.shell-google-button > div > div:first-child > [role="button"] > div:nth-child(2) {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
}
.shell-google-button > div > div:first-child svg { display: block; width: 18px; height: 18px; margin-inline-end: 8px; }
.shell-google-button > div > div:first-child span:not([id]) { flex: 1; overflow: hidden; text-align: center; text-overflow: ellipsis; }
.shell-google-button > div > div:first-child span[id] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.shell-google-button.is-busy { pointer-events: none; opacity: 0.65; }
.mode-picker-icon svg { display: block; width: 28px; height: 28px; }
.mode-badge-icon svg { display: block; width: 14px; height: 14px; }
.shell-button-quiet { color: var(--shell-ink, #2d2638); background: var(--shell-soft, #efe9e0); }
.shell-button-ghost {
  margin: 0;
  color: var(--shell-ink, #2d2638);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--shell-line, rgb(45 38 56 / 22%));
}
.shell-login-email-slot,
.shell-login-email,
.shell-login-email-code,
.shell-login-email-code-request,
.shell-login-email-code-verify { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.shell-login .shell-join-input { width: 100%; min-width: 0; box-sizing: border-box; }
/* Значение вычисляет оболочка по фактическому краю меню, включая safe-area. */
:root .toast[data-shell-toast-bottom] { bottom: var(--shell-toast-bottom); }


/* Счётчик рядом с названием вкладки: бледнее самого названия, чтобы читался
   как пометка, а не как часть слова. */
.shell-segment-count {
  margin-inline-start: 6px;
  color: var(--shell-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.shell-segment.is-active .shell-segment-count { color: var(--shell-accent); }

/* --- вкладка «Вместе»: сетка комнат --- */

/* Два в ряд с превью во всю ширину карточки — как в Colovia. Лента строк с
   превью размером с ноготь не отвечала на единственный вопрос, ради которого
   на эту вкладку заходят: насколько там продвинулись. Отдельный класс, а не
   правка `.work-card`: «Мои работы» строками и остаются. */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Одна колонка на совсем узком: две карточки по 150px ужимают превью до
   размера, на котором прогресс снова не виден, — а ради него всё и затевалось. */
@media (max-width: 340px) {
  .rooms-grid { grid-template-columns: minmax(0, 1fr); }
}

.room-card {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 8px;
  border-radius: var(--shell-radius);
  background: var(--shell-surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}

.room-card-body {
  display: grid;
  gap: 8px;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  border: 0;
  background: none;
  cursor: pointer;
}

.room-card-preview {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--shell-radius) - 6px);
  background: var(--shell-bg);
}

.room-card-preview img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--card-preview-scale, 1)); }

.room-card-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--shell-muted);
  font-size: 24px;
}

/* Углы превью. Числа читаются взглядом по углам, а не строкой под картинкой:
   место под ней занято названием и участниками. */
.room-card-percent,
.room-card-time,
.room-live,
.room-card-globe {
  position: absolute;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  border-radius: 999px;
}
.room-card-globe svg { width: 13px; height: 13px; }

.room-card-percent {
  inset-block-start: 6px;
  inset-inline-end: 6px;
  color: var(--shell-ink);
  background: color-mix(in srgb, var(--shell-surface) 88%, transparent);
  backdrop-filter: blur(3px);
}

.room-card-percent.is-done { color: var(--shell-on-done, #fff); background: var(--shell-done); }

.room-card-time {
  inset-block-end: 6px;
  inset-inline-end: 6px;
  color: #fff;
  background: rgb(0 0 0 / 52%);
  backdrop-filter: blur(3px);
}

.room-card-globe {
  inset-block-end: 6px;
  inset-inline-start: 6px;
  padding: 2px 5px;
  background: color-mix(in srgb, var(--shell-surface) 88%, transparent);
}

/* «Сейчас в комнате» — плашкой в углу превью, а не серой строчкой под ним.
   Присутствие это единственное, что на карточке меняется само и ради чего
   в комнату заходят прямо сейчас; строкой оно читалось как ещё одна подпись.
   Пульсация только у точки: мигающая надпись мешает прочесть число. */
.room-live {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  color: var(--shell-on-together, #fff);
  letter-spacing: 0.04em;
  background: var(--shell-together);
}

.room-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: room-live-pulse 1.6s ease-in-out infinite;
}

@keyframes room-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* Кому мигание мешает — не мигает. Плашка при этом остаётся на месте: она
   несёт число, а не только внимание. */
@media (prefers-reduced-motion: reduce) {
  .room-live-dot { animation: none; }
}

.room-card-copy { display: grid; gap: 4px; }

.room-card-title {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Сложность чипом, а не хвостом названия через «·»: «Лиса на подстилке · 3×4»
   читалось одним длинным названием, и размер терялся там, где по нему
   выбирают. */
.room-card-level {
  justify-self: start;
  padding: 2px 7px;
  color: var(--shell-muted);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 7%, transparent);
}

.room-card-track {
  display: block;
  overflow: hidden;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-ink) 10%, transparent);
}

.room-card-track i {
  display: block;
  width: var(--room-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--shell-together);
}

/* Подпись переносится на вторую строку, а не обрывается многоточием: в
   колонке шириной в пол-экрана «Из каталога · 3 участника · 214…» съедало
   ровно то число, ради которого строку и читают. */
.room-card-note {
  overflow: hidden;
  color: var(--shell-muted);
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* А вот имена обрываем: их всегда больше, чем влезет, и хвост «и ещё N»
   уже сказал, сколько осталось за кадром. */
.room-card .room-people {
  overflow: hidden;
  color: var(--shell-muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card .room-people { color: color-mix(in srgb, var(--shell-ink) 62%, transparent); }

.room-card .room-people-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.room-card .room-person-action {
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  background: transparent;
}

.room-card button.room-person-action:not([disabled]) {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Действия над комнатой в строку: на узком экране переносятся сами. */
.room-card .room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.room-card .room-actions .shell-button {
  flex: 1 1 auto;
  margin: 0;
  padding: 7px 8px;
  font-size: 11px;
}

.room-card .room-actions .shell-button[disabled] { opacity: 0.55; cursor: default; }

/* Позвать людей — главное действие карточки, и красится оно цветом «вместе».
   До этого обе кнопки были серыми обводками: вкладка, ради которой цвет и
   заводился, единственная его не показывала. */
.room-card .room-actions .room-invite,
.room-card .room-actions .room-call {
  color: var(--shell-together);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shell-together) 45%, transparent);
}

.room-card .room-actions .room-call[disabled] { color: var(--shell-muted); }

/* «Убрать из списка» — не действие, ради которого сюда пришли: оно уходит на
   всю ширину под две первые кнопки и остаётся серым. */
.room-card .room-actions .room-hide { flex-basis: 100%; }

/* Одна картина, начатая в нескольких размерах: превью одно, размеры листаются
   вбок. Прокрутка родная, с прилипанием — свой обработчик жеста спорил бы с
   прокруткой самого списка и терял инерцию. */
.work-stack {
  display: block;
  padding: 0;
  border: 0;
  background: none;
}
.work-stack-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.work-stack-track::-webkit-scrollbar { display: none; }
.work-stack-slide {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: start;
}
.work-stack-slide > .work-card { list-style: none; }
.work-stack-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 6px 0 2px;
}
.work-stack-dot {
  padding: 3px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--shell-soft);
  color: var(--shell-muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.work-stack-dot.is-active {
  background: var(--shell-accent);
  color: var(--shell-on-accent, #fff);
}

/* Поле поиска над списком. */
.shell-search { padding: 0 16px 10px; }
.shell-search .shell-input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  color: inherit;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-control-radius);
  background: var(--shell-surface);
}


/* --- письменность справа налево --- */

/*
 * Всё, что можно, уже описано логическими свойствами и разворачивается само.
 * Здесь остаётся то, что логикой не выражается.
 *
 * Стрелки. «Назад» и шеврон строки указывают направление движения, а не
 * сторону экрана: в арабском назад — это вправо. Отражаем сам рисунок, а не
 * переставляем кнопку.
 *
 * Кружок тумблера ездит по оси X жёстким `translateX`, и в rtl он уезжал бы
 * из дорожки наружу.
 */
[dir="rtl"] .shell-back svg,
[dir="rtl"] .shell-row-chevron svg { transform: scaleX(-1); }

[dir="rtl"] .shell-switch input:checked + .shell-switch-track::after {
  transform: translateX(-18px);
}
.points-ledger-icon { flex: 0 0 24px; width: 24px; height: 24px; color: var(--shell-accent, #0076b8); }
.points-ledger-icon svg { display: block; width: 100%; height: 100%; }
.points-ledger-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.points-ledger-title { display: block; font-size: 13px; }
.points-ledger-amount { flex-shrink: 0; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.photo-create-screen { width: min(100%, 780px); margin-inline: auto; }
.photo-create-form { display: grid; gap: 16px; }
.photo-create-intro { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.photo-create-intro h2 { margin: 0 0 4px; font-size: 20px; }
.photo-create-intro p { margin: 0; color: var(--muted, #667085); font-size: 13px; line-height: 1.45; }
.photo-create-mascot { width: 72px; height: 72px; object-fit: contain; }
.photo-create-picker { position: relative; justify-self: start; cursor: pointer; }
.photo-create-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.photo-create-editor { display: grid; gap: 14px; }
.photo-create-panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-create-pane { display: grid; gap: 7px; color: var(--ink, #25222b); font-size: 13px; }
.photo-create-frame,.photo-create-result { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 18px; background: #e7e3ea; box-shadow: inset 0 0 0 1px rgb(32 25 42 / .08); }
.photo-create-frame { cursor: grab; touch-action: none; }
.photo-create-frame:active { cursor: grabbing; }
.photo-create-frame canvas,.photo-create-result img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.photo-create-crop-grid { position: absolute; inset: 9px; pointer-events: none; border: 2px solid rgb(255 255 255 / .94); border-radius: 14px; background: linear-gradient(90deg, transparent 33.1%, rgb(255 255 255 / .72) 33.2% 33.5%, transparent 33.6% 66.4%, rgb(255 255 255 / .72) 66.5% 66.8%, transparent 66.9%),linear-gradient(transparent 33.1%, rgb(255 255 255 / .72) 33.2% 33.5%, transparent 33.6% 66.4%, rgb(255 255 255 / .72) 66.5% 66.8%, transparent 66.9%); box-shadow: 0 0 0 1px rgb(32 25 42 / .38), inset 0 0 0 1px rgb(32 25 42 / .18); }
.photo-create-result.is-loading::after { position: absolute; inset: 0; display: grid; place-items: center; content: '…'; background: rgb(255 255 255 / .55); font-size: 28px; }
.photo-create-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-create-photo-actions .shell-button { margin: 0; }
.photo-create-zoom { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; font-size: 13px; font-weight: 700; }
.photo-create-zoom input { width: 100%; accent-color: var(--accent, #7654a6); }
.photo-create-fields { display: grid; gap: 14px; }
.photo-create-title { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.photo-create-title input { min-width: 0; padding: 10px 12px; border: 1px solid rgb(48 39 58 / .16); border-radius: 12px; background: var(--surface, #fff); color: inherit; font: inherit; }
.photo-create-sizes { min-width: 0; margin: 0; padding: 0; border: 0; }
.photo-create-sizes legend { margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.photo-create-size-buttons { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 5px; }
.photo-create-size { display: grid; flex: 0 0 auto; min-width: 82px; padding: 9px 11px; border: 1px solid rgb(48 39 58 / .14); border-radius: 13px; background: var(--surface, #fff); color: inherit; cursor: pointer; text-align: left; }
.photo-create-size span { color: var(--muted, #667085); font-size: 10px; }
.photo-create-size.is-selected { border-color: var(--accent, #7654a6); background: color-mix(in srgb, var(--accent, #7654a6) 12%, var(--surface, #fff)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #7654a6) 18%, transparent); }
.photo-create-submit { justify-self: stretch; min-height: 46px; margin: 0; }
.photo-create-message { min-height: 18px; margin: -6px 0 0; color: var(--muted, #667085); font-size: 12px; }
@media (max-width: 619px) { .photo-create-panes { grid-template-columns: 1fr 1fr; gap: 8px; } .photo-create-mascot { width: 58px; height: 58px; } }

/* --- Лист поверх картины: «Настройки процесса» и «Как играть» (30.09.2026) ---
   Лист — сам `.app-shell`: оболочка приложения на время картины спрятана, а
   цвета и вид строк объявлены на `.app-shell`. Картина под листом живёт как
   была — лист её только закрывает, не пересоздаёт. */
.app-shell.shell-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  grid-template-rows: auto minmax(0, 1fr);
  /* Свой непрозрачный фон: у части приложений фон оболочки прозрачный (его
     рисует body), а под листом — картина. */
  background: var(--shell-sheet-bg, var(--paper, var(--shell-surface)));
  box-shadow: 0 -8px 32px rgb(0 0 0 / 18%);
  animation: shell-sheet-in .18s ease-out;
}
.shell-sheet .shell-header-titles { min-width: 0; }
.shell-sheet .shell-sheet-content { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@keyframes shell-sheet-in { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .app-shell.shell-sheet { animation: none; } }

/* Подпись подраздела «Для всех картин» — мелко под заголовком шапки. */
.shell-process-subtitle {
  margin: 0 4px 10px;
  color: var(--shell-muted);
  font-size: 13px;
  line-height: 1.35;
}
/* «?» окна ожидания — маленький, в углу карточки (30.09.2026). */
.room-waiting-help { font-size: 18px; font-weight: 800; line-height: 1; }
