:root {
  color-scheme: light;
  --blue: #1D5C4D;
  --blue-dark: #164636;
  --ink: #1D5C4D;
  --muted: #5A6B62;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --card: var(--surface);
  --surface-2: #f8fafc;
  --field: #ffffff;
  --line: #e2e8f0;
  --danger: #dc2626;
  --error-bg: #fef2f2;
  --error-line: #fecaca;
  --error-ink: #991b1b;
  --ok-bg: #f0fdf4;
  --ok-line: #bbf7d0;
  --ok-ink: #166534;
  --ok-strong: #15803d;
  --tint-bg: #E8F2EC;
  --tint-line: #BCDCCB;
  --tint-bg-active: #D5E9DD;
  --tabbar-bg: rgba(255, 255, 255, .96);
  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --amber-soft: #fffbeb;
  --amber-ink: #92400e;
  --placeholder-bg: #e2e8f0;
  --icon-ink: #334155;
  --radius: 16px;
  /* Токены движения: единая кривая и длительности для всего интерфейса */
  --ease-out: cubic-bezier(.22, .8, .3, 1);
  --dur-fast: 140ms;
  --dur-med: 240ms;
}
/* Тёмная тема: те же токены, другие значения. Тема ставится скриптом
   в <head> (localStorage «pomnyu-theme»: light | dark | system). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #3AA87E;
  --blue-dark: #7CC7A6;
  --ink: #E9F2EC;
  --muted: #9DB8AB;
  --bg: #0E2019;
  --surface: #173529;
  --card: #173529;
  --surface-2: #1E4231;
  --field: #122A20;
  --line: #2C5543;
  --danger: #f87171;
  --error-bg: #3a1d22;
  --error-line: #7f1d1d;
  --error-ink: #fca5a5;
  --ok-bg: #14291d;
  --ok-line: #14532d;
  --ok-ink: #86efac;
  --ok-strong: #4ade80;
  --tint-bg: #173F30;
  --tint-line: #2C5543;
  --tint-bg-active: #1E4D3A;
  --tabbar-bg: rgba(14, 32, 25, .92);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, .18);
  --amber-soft: rgba(245, 158, 11, .1);
  --amber-ink: #fbbf24;
  --placeholder-bg: #1E4231;
  --icon-ink: #CFE0D6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%;
  /* Протяжка страницы (overscroll): верх рисуется цветом верхней
     полосы, низ — цветом фона, чтобы не было шва при оттягивании. */
  background: linear-gradient(to bottom, var(--blue) 50%, var(--bg) 50%); }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--blue); }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--blue); color: #fff;
  padding-top: calc(10px + env(safe-area-inset-top));
  /* Высота ОДИНАКОВАЯ на всех экранах (фикс 2026-11-24): кнопка справки
     ⓘ есть не везде, и без min-height зелёная полоса была на 8px выше
     там, где кнопка есть (38px против 30px у бренда). */
  min-height: calc(58px + env(safe-area-inset-top));
}
.brand { color: #fff; font-weight: 700; font-size: 19px; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; }
/* Знак бренда (белка): растровая иконка в шапке и крупно на экранах входа */
.brand-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: none; display: block;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .35), 0 2px 6px rgba(0, 0, 0, .25);
}
.brand-hero {
  width: 64px; height: 64px; border-radius: 16px; display: block; margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(14, 32, 25, .18);
}
/* Короткая строка-посыл на входе и регистрации */
.tagline { margin: 2px 0 6px; font-size: 17px; font-weight: 600; color: var(--blue-dark); }
.topnav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { color: #D5E9DD; text-decoration: none; font-size: 16px; }
.linklike { background: none; border: 0; color: #D5E9DD; font-size: 16px; cursor: pointer; padding: 0; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px 14px 48px; }
h1 { font-size: 24px; margin: 6px 0 10px; }
h1.page { margin-top: 4px; }
h2 { font-size: 19px; margin: 4px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-ink); padding: 10px 12px; border-radius: 12px; }
.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); padding: 10px 12px; border-radius: 12px; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.card.narrow { max-width: 460px; margin: 32px auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.inner { margin-top: 10px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 16px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
select, textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--field);
  min-height: 52px; width: 100%;
}
input[type="file"] { font: inherit; padding: 12px 0; }
textarea { min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px;
  border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-dark); }
.btn.big { min-height: 60px; font-size: 19px; width: 100%; }
.btn.wide { width: 100%; }
.btn.small { min-height: 42px; padding: 8px 14px; font-size: 15px; }
.ai-ico { width: 19px; height: 19px; vertical-align: -4px; margin-right: 7px; }
.btn.danger { color: var(--danger); border-color: var(--error-line); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.addbtn { margin: 14px 0 18px; box-shadow: 0 6px 16px rgba(29, 92, 77, .28); }
.searchbar { display: flex; gap: 10px; }
.searchbar input { flex: 1; }
.searchbar .btn { min-width: 104px; }
.grid { column-count: 2; column-gap: 12px; }
.grid > * { break-inside: avoid; page-break-inside: avoid; margin-bottom: 12px; }
@media (min-width: 640px) { .grid { column-count: 3; } }
.thing {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; text-decoration: none; color: var(--ink); overflow: hidden;
}
.thing img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--placeholder-bg); }
.thing-name { font-weight: 700; font-size: 16px; padding-right: 40px; }
.thing-path { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.thing.archived { opacity: .85; }
.thing form { margin-top: 6px; }
.bigphoto { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.preview { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; }
.place { font-size: 19px; font-weight: 600; color: var(--blue-dark); display: flex; align-items: center; gap: 9px; }
.comment { white-space: pre-wrap; }
.badge { display: inline-block; background: var(--amber-bg); color: var(--amber-ink); padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; }
/* Режим «Переезд»: чип статуса коробки на карточке вещи + номер коробки. */
.boxchip { display: inline-block; background: var(--amber-bg); color: var(--amber-ink); padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin-left: 6px; white-space: nowrap; }
.boxnum { font-size: 46px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; margin: 4px 0 2px; }
.boxhint { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.boxnum-small { font-size: 22px; font-weight: 800; text-decoration: none; }
.locthumb-big { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; display: block; margin-top: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form input { flex: 1; min-height: 42px; }
details.subtle { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
details.subtle summary { cursor: pointer; color: var(--blue); font-weight: 600; padding: 4px 0; }
details.subtle .inner { padding-top: 8px; }
.loctree { list-style: none; margin: 0; padding: 0; }
.loctree li { padding: 10px 0 10px calc(var(--d) * 22px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.loctree li .placelink { flex: 1; min-width: 0; }
.loc-actions { display: inline-flex; gap: 6px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--gold, #d9a62e); background: transparent; text-decoration: none; }
.iconbtn:active { transform: scale(0.94); }
.iconbtn.listening { border-color: var(--gold, #d9a62e); box-shadow: 0 0 0 3px rgba(217, 166, 46, 0.35); }
.loctree li:last-child { border-bottom: 0; }
.locrow { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.locname { font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }

/* Фото места: шапка страницы места и миниатюры в списках */
.place-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 12px; }
.place-photo-form { margin-top: 12px; }
.locthumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.locthumb-ico { width: 26px; height: 26px; color: var(--muted); flex: none; }
.chipthumb { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex: none; }
/* Аватарка места в карточках вещей и на странице вещи: фото места, а если
   его нет — значок стеллажа в рамке того же размера (30×30), чтобы строка
   пути не прыгала. Рамка — var(--line): корректна в светлой и тёмной темах. */
.loc-avatar { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; flex: none; border: 1px solid var(--line); background: var(--surface-2); }
.thing img.loc-avatar { width: 30px; height: 30px; aspect-ratio: auto; }
.loc-avatar-none { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.locactions { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.locactions details.subtle { flex: 1; }

/* Выбор источника фото: камера или медиатека */
.photo-pick { display: flex; gap: 10px; margin-top: 6px; }
.photo-pick .photo-btn { flex: 1; }
.field-label { font-weight: 600; display: block; }

/* Несколько фото: полоса превью в формах и миниатюры на карточке вещи */
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumbstrip { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbbtn { padding: 0; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; }
.thumbbtn img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; display: block; }
.thumbbtn.active { border-color: var(--blue); }
.photos-admin { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.photo-cell { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 132px; }
.photo-cell img { width: 132px; height: 132px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photo-cell .btn { width: 100%; }

/* Распознавание по фото: варианты названия чипсами */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  border: 1.5px solid var(--blue); color: var(--blue-dark); background: var(--tint-bg);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 15px;
  font-weight: 600; cursor: pointer;
}
.chip:active { background: var(--blue); color: #fff; }
.attached-ok { color: var(--ok-strong); font-weight: 700; font-size: 17px; }

/* ===== Этап 1: навигация, поиск-главная, шаги, история, QR, премиум ===== */
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wrap { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
/* Появление страницы — без анимации (решение владельца 2026-11-24:
   убран параллакс-слой pageIn — экран рисуется сразу и целиком). */

/* Нижняя панель вкладок */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: stretch; justify-content: space-around;
  background: var(--tabbar-bg); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; text-decoration: none; color: var(--muted);
  font-size: 12.5px; font-weight: 600; border-radius: 12px;
}
.tab-ico { font-size: 21px; line-height: 1.1; }
.tab.active { color: var(--blue-dark); }
.tab:active { transform: scale(.96); }
.tab-add { justify-content: flex-start; }
.tab-plus {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-top: -22px;
  border-radius: 50%; background: var(--blue); color: #fff;
  font-size: 30px; font-weight: 400; line-height: 1;
  box-shadow: 0 6px 16px rgba(29, 92, 77, .4); border: 3px solid var(--surface);
}
.tab-add:active .tab-plus { background: var(--blue-dark); }
.btn {
  transition: transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}
.btn:active { transform: scale(.975) translateY(1px); }
.thing { transition: box-shadow .15s ease; position: relative; }
.thing:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }

/* Главный экран: поиск и чипы */
.searchbar.big input { min-height: 60px; font-size: 18px; border-radius: 14px; }
.searchbar.big .btn { min-height: 60px; }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 15px;
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.fchip.active { border-color: var(--blue); background: var(--tint-bg); color: var(--blue-dark); }
.fchip.quick { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-ink); }
.fchip:active { transform: scale(.97); }

/* Лента последних действий */
.feed { list-style: none; margin: 6px 0 0; padding: 0; }
.feed li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed-text { margin-left: 4px; }
.feedrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plate {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 6px; border-radius: 999px;
  background: var(--tint-bg); border: 1px solid var(--tint-line);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.plate:active { background: var(--tint-bg-active); }
.plate .loc-avatar { width: 26px; height: 26px; border-radius: 50%; }

/* Карточка вещи: ссылка и звезда */
.thing-link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); flex: 1; }
.thing-link img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--placeholder-bg); }
.starform { position: absolute; top: 6px; right: 6px; margin: 0; }
.star {
  border: 0; background: rgba(255, 255, 255, .9); border-radius: 50%;
  width: 38px; height: 38px; font-size: 21px; line-height: 1; cursor: pointer;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
.star.on { color: var(--amber); }
/* Включение избранного: звезда «подпрыгивает», из неё разлетаются
   золотые искорки (слой .spark-layer создаётся скриптом поверх страницы). */
@keyframes star-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.32) rotate(10deg); }
  100% { transform: scale(1); }
}
.star.pop { animation: star-pop .38s var(--ease-out); }
.spark-layer { position: absolute; z-index: 60; pointer-events: none; }
.spark {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--amber); opacity: 0;
  /* Движение задаёт скрипт через Web Animations API (см. starBurst). */
}
.spark.star {
  width: 8px; height: 8px; left: -4px; top: -4px; border-radius: 0;
  background: #FFB92E;
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
}
@keyframes spark-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .star.pop { animation: none; }
}

/* Плашки результата поиска и умная белка (сценарий владельца 2026-11-07):
   нашлось — сосна с галочкой; не нашлось — тёплый янтарь с лупой-вопросом
   (не ошибка!); белка — золото жёлудя. */
.res-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px; border-radius: 16px; margin: 12px 0 4px;
  border: 1px solid var(--line); background: var(--surface);
  animation: flashIn var(--dur-med) var(--ease-out) both;
}
.res-banner .res-ico { width: 26px; height: 26px; flex: none; }
.res-banner .res-text { flex: 1 1 200px; font-weight: 600; }
.res-banner .res-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res-banner.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.res-banner.warn { background: #FBF2DA; border-color: #ECD9A4; color: #7A5A10; }
.res-banner.smart { background: #FBF2DA; border-color: #ECD9A4; color: #7A5A10; }
[data-theme="dark"] .res-banner.warn,
[data-theme="dark"] .res-banner.smart { background: #3A2F14; border-color: #6B5518; color: #F0D089; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .res-banner.warn,
  :root:not([data-theme="light"]) .res-banner.smart { background: #3A2F14; border-color: #6B5518; color: #F0D089; }
}
.res-banner .sq-ava { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.btn.amber {
  background: linear-gradient(180deg, #F7C948, #EDAE2C);
  color: #4A3205; border: none; display: inline-flex; align-items: center; gap: 7px;
}
.btn.amber .sq-ava { width: 22px; height: 22px; border-radius: 6px; }
.res-banner .dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.res-banner .dots i {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  animation: dotBlink 1.1s infinite;
}
.res-banner .dots i:nth-child(2) { animation-delay: .18s; }
.res-banner .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dotBlink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .res-banner .dots i { animation: none; opacity: .7; }
}
.ai-tag {
  display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 999px;
  background: #F7C948; color: #4A3205; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase;
}
.ai-reason { display: block; margin-top: 3px; color: #8A6D1F; font-size: 13px; font-style: italic; }

/* Подарочный бессрочный Plus (решение владельца 2026-11-15): тёплое
   золото, как у белки. Баннер — на главном экране (закрываемый),
   карточка — постоянная, в профиле. */
.gift-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: 16px; margin: 12px 0 4px;
  border: 1px solid #ECD9A4; background: #FBF2DA; color: #7A5A10;
  animation: flashIn var(--dur-med) var(--ease-out) both;
}
.gift-banner[hidden] { display: none; }
.gift-banner .gift-ico { width: 26px; height: 26px; flex: none; margin-top: 1px; }
.gift-banner .gift-text { flex: 1 1 200px; line-height: 1.45; }
.gift-close {
  flex: none; background: none; border: 0; cursor: pointer; color: inherit;
  font-size: 22px; line-height: 1; padding: 0 2px; opacity: .75;
}
.gift-close:hover { opacity: 1; }
[data-theme="dark"] .gift-banner { background: #3A2F14; border-color: #6B5518; color: #F0D089; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gift-banner { background: #3A2F14; border-color: #6B5518; color: #F0D089; }
}
.gift-card { border-color: #ECD9A4; background: #FBF2DA; color: #7A5A10; }
[data-theme="dark"] .gift-card { background: #3A2F14; border-color: #6B5518; color: #F0D089; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gift-card { background: #3A2F14; border-color: #6B5518; color: #F0D089; }
}
.gift-title { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; font-size: 17px; }
.gift-title .ico { width: 22px; height: 22px; flex: none; }
.gift-card p { margin: 6px 0; line-height: 1.5; }
.gift-card .muted { color: inherit; opacity: .8; }
[data-theme="dark"] .ai-reason { color: #E3C878; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ai-reason { color: #E3C878; }
}

/* Тосты: единый формат всплывающих сообщений — иконка события в цветном
   кружке + текст цветом события; карточка над нижним меню. */
.toasts {
  position: fixed; left: 12px; right: 12px; z-index: 200;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(10, 30, 20, .22);
  animation: toastIn var(--dur-med) var(--ease-out) both;
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
}
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-ico {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.toast-ico svg { width: 17px; height: 17px; }
.toast-text { font-weight: 600; line-height: 1.3; }
.toast.success .toast-ico { background: var(--ok-bg); color: var(--ok-ink); }
.toast.success .toast-text { color: var(--ok-ink); }
.toast.info .toast-ico { background: var(--ok-bg); color: var(--ink); }
.toast.info .toast-text { color: var(--ink); }
.toast.warn .toast-ico { background: #F7C948; color: #4A3205; }
.toast.warn .toast-text { color: #7A5A10; }
.toast.error .toast-ico { background: var(--error-bg); color: var(--error-ink); }
.toast.error .toast-text { color: var(--error-ink); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}
.star.big { width: 48px; height: 48px; font-size: 27px; background: var(--surface-2); }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
/* Карточка вещи: место и «обновлено» слева, кнопка «Назад» справа
   (место кнопки выбрано владельцем, 2026-11-06) */
.item-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.item-meta { min-width: 0; }
.item-meta .place { margin: 0 0 4px; }
.item-meta .muted { margin: 0; }
.item-back { flex: none; }
/* Стандартная строка с кнопкой «Назад» вверху второстепенных страниц */
.backline { margin: 2px 0 10px; }
.item-head h1 { margin-right: auto; }
.status-form { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 14px; }

/* Шаги формы добавления */
fieldset.step {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface);
}
fieldset.step legend {
  font-weight: 700; font-size: 17px; padding: 4px 10px;
  background: var(--blue); color: #fff; border-radius: 999px;
}
.scanbox { display: flex; flex-direction: column; gap: 8px; }
.scanbox video { width: 100%; border-radius: 12px; background: #0f172a; max-height: 260px; }

/* Микрофон для диктовки */
.with-mic { display: flex; gap: 8px; align-items: stretch; }
.with-mic input, .with-mic textarea { flex: 1; }
.mic-btn {
  min-width: 52px; border: 1.5px solid var(--tint-line); border-radius: 12px;
  background: var(--tint-bg); font-size: 21px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mic-btn .mic-ico { color: var(--blue); }
.mic-ico { width: 22px; height: 22px; color: var(--icon-ink); }
.mic-btn .wave { display: none; align-items: center; gap: 2.5px; height: 22px; }
.mic-btn .wave i {
  width: 3.5px; height: 100%; border-radius: 2px; transform-origin: center;
  background: linear-gradient(180deg, #f87171, #dc2626);
  animation: eq 0.9s ease-in-out infinite;
}
.mic-btn .wave i:nth-child(1) { transform: scaleY(.45); animation-delay: 0s; }
.mic-btn .wave i:nth-child(2) { transform: scaleY(.8); animation-delay: .12s; }
.mic-btn .wave i:nth-child(3) { transform: scaleY(1); animation-delay: .24s; }
.mic-btn .wave i:nth-child(4) { transform: scaleY(.7); animation-delay: .36s; }
.mic-btn .wave i:nth-child(5) { transform: scaleY(.5); animation-delay: .48s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.mic-btn.listening { background: var(--error-bg); border-color: var(--danger); animation: recpulse 1.6s ease-out infinite; }
.mic-btn.listening .mic-ico { display: none; }
.mic-btn.listening .wave { display: inline-flex; }
@keyframes recpulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .35); }
  70% { box-shadow: 0 0 0 9px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mic-btn.listening { animation: none; }
  .mic-btn .wave i { animation: none; }
}

/* Проводник мест */
.placelink { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); }
.placelink:hover .locname { color: var(--blue-dark); }
.crumbs { color: var(--muted); margin: 4px 0 10px; }
.crumbs a { text-decoration: none; }

/* QR-метки */
.qrbox { text-align: left; }
.qrimg { width: 220px; max-width: 70vw; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.qrlabel {
  border: 2px solid #0f172a; border-radius: 12px; padding: 18px;
  text-align: center; max-width: 420px; margin: 18px auto; background: #fff; color: #0f172a;
}
.qrlabel img { width: 300px; max-width: 80vw; height: auto; }
.qrlabel-name { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.qrlabel-path { color: var(--muted); margin-top: 8px; }
.qrlabel .qrlabel-path, .qrlabel .qrlabel-hint { color: #5A6B62; }
.qrlabel-hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.qrsheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qrlabel.small { margin: 0; padding: 12px; max-width: none; }
.qrlabel.small img { width: 100%; }
.qrlabel.small .qrlabel-name { font-size: 18px; }
@media print {
  .tabbar, .topbar, .noprint { display: none !important; }
  body { background: #fff; color: #0f172a; }
  .wrap { padding: 0; max-width: none; }
  .qrlabel { break-inside: avoid; }
  .printbox { break-inside: avoid; }
}

/* Печатная опись переезда (Задача 3.8) */
.printbox { margin: 22px 0; }
.printbox h2 { font-size: 19px; margin: 0 0 8px; }
.printitems { list-style: none; margin: 0; padding: 0; }
.printitems li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pcheck { flex: none; width: 15px; height: 15px; border: 1.6px solid currentColor; border-radius: 3px; position: relative; top: 2px; }
.printfoot { margin-top: 28px; }

/* Фото в рамке (вещь, место, коробка): снимок стоит неподвижно.
   Правило владельца (2026-11-06): никаких сдвигов и масштабирования фото
   внутри рамки — ни при прокрутке, ни при загрузке. */
.photo-frame { overflow: hidden; border-radius: 12px; background: var(--surface-2); }
.photo-frame .bigphoto { border-radius: 0; transform: none; }
/* Одиночное фото: картинку нельзя утащить или выделить долгим нажатием. */
.photo-frame > .bigphoto { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
/* Галерея вещи (несколько фото): скользящая лента — снимки едут следом за
   пальцем и доворачиваются до целого кадра (scroll-snap). Заказ владельца
   2026-11-06: перелистывание должно быть заметно, а не мгновенная смена. */
.photo-track {
  display: flex; height: 52vh; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.photo-track::-webkit-scrollbar { display: none; }
.photo-track .slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.photo-track .slide img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: var(--surface-2);
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
}
.photo-head { margin-bottom: 12px; }
.photo-frame > .place-photo {
  border-radius: 0; margin-bottom: 0; transform: none;
  width: 100%; height: 220px; max-height: none;
}

/* Мягкое проявление фото: только прозрачность, без движения и масштаба
   (правило владельца, 2026-11-06). JS ставит .imgfade до загрузки снимка
   и .img-in после его декодирования: фото спокойно проявляется из
   подложки рамки. Без JS и при reduced-motion фото просто видны. */
/* Проявление фото анимацией отключено 2026-11-24: снимки видны сразу,
   подложка рамки держит место до загрузки (aspect-ratio у img). */

/* Свои векторные иконки (шаблон icons.html) */
.ico { width: 22px; height: 22px; flex: none; }
.ico.inl { width: 15px; height: 15px; vertical-align: -2px; }
.photo-btn { flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; padding: 14px 10px; }
.photo-ico { width: 29px; height: 29px; color: var(--blue); }
.tab-ico { display: flex; justify-content: center; }
.tab-ico .ico { width: 24px; height: 24px; }
.tab-plus { color: #fff; display: flex; align-items: center; justify-content: center; }
.tab-plus .ico { width: 26px; height: 26px; }
.brand .ico { vertical-align: -5px; }
h1 .ico { vertical-align: -4px; }
.btn .ico { vertical-align: -5px; margin-right: 5px; }
.photo-btn .ico { margin-right: 0; }
.quick-link {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 10px 0 6px; min-height: 48px;
  background: var(--tint-bg); border-color: var(--tint-line); color: var(--blue-dark);
  font-weight: 600; text-decoration: none;
}
.quick-link:active { background: var(--tint-bg-active); }
select.invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .16);
  animation: shake .3s ease;
}
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.loc-error { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { select.invalid { animation: none; } }

/* Голосовые заметки: рекордер, плеер, значок в карточках */
.voice-block { margin-top: 14px; }
.card .voice-block { border-top: 1px dashed var(--line); padding-top: 14px; }
.voice-block audio { width: 100%; margin: 8px 0; }
.voice-rec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn.voice-start {
  background: var(--error-bg); border: 1.5px solid var(--error-line);
  color: var(--danger); font-weight: 700;
}
.btn.voice-start .mic-ico { color: var(--danger); }
.voice-live {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--error-bg); border: 1.5px solid var(--danger); border-radius: 12px;
  padding: 6px 8px 6px 12px; animation: recpulse 1.6s ease-out infinite;
}
.voice-live[hidden] { display: none; }
.voice-live .wave { display: inline-flex; align-items: center; gap: 2.5px; height: 22px; }
.voice-live .wave i {
  width: 3.5px; height: 100%; border-radius: 2px; transform-origin: center;
  background: linear-gradient(180deg, #f87171, #dc2626);
  animation: eq 0.9s ease-in-out infinite;
}
.voice-live .wave i:nth-child(1) { transform: scaleY(.45); animation-delay: 0s; }
.voice-live .wave i:nth-child(2) { transform: scaleY(.8); animation-delay: .12s; }
.voice-live .wave i:nth-child(3) { transform: scaleY(1); animation-delay: .24s; }
.voice-live .wave i:nth-child(4) { transform: scaleY(.7); animation-delay: .36s; }
.voice-live .wave i:nth-child(5) { transform: scaleY(.5); animation-delay: .48s; }
.voice-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--danger); min-width: 36px; }
.voice-done { margin-top: 10px; }
.voice-done-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.voice-error { margin-top: 8px; }
.voice-file-row input[type="file"] { padding: 6px 0 0; }
.voice-badge { color: var(--blue-dark); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .voice-live { animation: none; }
  .voice-live .wave i { animation: none; }
}

/* Темы оформления: сегмент-переключатель в профиле */
.seg {
  display: flex; gap: 6px; padding: 5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
}
.seg-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 6px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.seg-btn:has(> input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.seg-btn:active { transform: scale(.97); }

/* Строка настройки со свитчем (современный паттерн вкл/выкл):
   слева иконка + подпись, справа — переключатель-«пилюля». */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
}
.set-row .set-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600; color: var(--ink);
}
.set-row .set-label .ico { width: 24px; height: 24px; }
.set-row form { margin: 0; }
.switch {
  position: relative; flex: none; width: 52px; height: 32px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: #BFCBC2; -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-med) var(--ease-out);
}
:root[data-theme="dark"] .switch { background: #2C5543; }
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(14, 32, 25, .35);
  transition: transform var(--dur-med) var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"] .knob { transform: translateX(20px); }
.switch:active .knob { transform: scale(.94); }
.switch[aria-checked="true"]:active .knob { transform: translateX(20px) scale(.94); }

/* ===== Общие пространства, ответственность, аватары, справка (U11) ===== */
.spacechip { display: inline-block; background: var(--tint-bg); color: var(--blue-dark); border: 1px solid var(--tint-line); padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin-left: 6px; white-space: nowrap; }
.thing-path .holderline { color: var(--blue-dark); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; vertical-align: middle; background: var(--surface-2); }
/* Смена аватара — нажатием по самой аватарке (стандартный паттерн):
   маленький значок фотоаппарата в углу; отдельной плашки для этого нет. */
.avatar-edit { position: relative; flex: none; }
.avatar-tap { display: block; position: relative; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; background: none; border: 0; padding: 0; }
/* Обратная связь в админке: сообщения пользователей из профиля. */
.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.fb-item.fb-new { border-color: var(--tint-line); background: var(--tint-bg); }
.fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; }
.fb-head .spacechip { margin-left: 0; }
.fb-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item .actions { margin-top: 4px; }
.fb-mine-title { margin: 18px 0 10px; font-size: 17px; }
.fb-msg { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 8px 0; }
.fb-msg-admin { border-left-color: var(--blue); }
.fb-msg-head { margin: 0 0 2px; font-size: 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fb-msg .fb-text { margin: 0; }
.fb-reply-form { margin-top: 10px; }

/* Нижний лист действий (аватар и т.п.): свой список вместо системного —
   в системный iOS пункт «Убрать фото» не добавить. */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(16, 44, 32, .58); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.sheet[hidden] { display: none; }
/* Лёгкая фирменная подкраска фона листа: сосна, растворённая в поверхности
   (заказ владельца, 2026-11-06). Фолбэк для старых браузеров — плоский tint. */
.sheet-card { background: var(--tint-bg); background: color-mix(in srgb, var(--surface) 86%, var(--blue) 14%); color: var(--ink); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); overflow: hidden; }
.sheet-card form { margin: 0; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px 18px; background: none; border: 0; border-bottom: 1px solid var(--line);
  font-size: 17px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.sheet-item:active { background: var(--surface-2); }
.sheet-item.danger { color: var(--danger); }
.sheet-item.sheet-cancel { border-bottom: 0; justify-content: center; color: var(--muted); }
.avatar-tap:active .avatar-badge { transform: scale(.9); }
.avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(14, 32, 25, .3);
  transition: transform var(--dur-fast) var(--ease-out);
  pointer-events: none;
}
.avatar-badge .ico { width: 14px; height: 14px; }
.avatar-hint { margin: 10px 0 0; }
.avatar-init { display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-weight: 700; letter-spacing: .02em; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.profile-head h2 { margin: 0; }
.holder-block { border: 1px solid var(--tint-line); background: var(--tint-bg); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.holder-block .holderline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.membercell { display: inline-flex; align-items: center; gap: 10px; }
.invitebox { border: 1px dashed var(--tint-line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.invitelink { word-break: break-all; font-size: 13.5px; }
.invitecode { font-size: 26px; font-weight: 800; letter-spacing: 4px; color: var(--blue-dark); }
.qr-svg svg { width: 180px; height: 180px; max-width: 60vw; }
.helpbtn { margin-left: auto; background: rgba(255, 255, 255, .16); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.helpbtn:active { transform: scale(.94); }
.help-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10, 25, 18, .55); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; overflow-y: auto; }
.help-overlay[hidden] { display: none; }
.help-card { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 20px; max-width: 520px; width: 100%; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.help-card h2 { margin-top: 0; }
.help-card p { margin-bottom: 16px; }

/* План пользователя и промокоды */
.plan-line { margin: .35rem 0 0; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.plan-badge { display: inline-block; padding: .12em .65em; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .04em; }
.promo-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.2rem; font-weight: 700; letter-spacing: .06em; }

/* Профиль: компактная шапка и раскрывающиеся разделы */
.profile-card .profile-head { margin-bottom: 0; }
details.acc { padding: 0; overflow: hidden; }
.acc-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px; cursor: pointer; list-style: none;
  border-bottom: 1px solid transparent;
  font-size: 19px; font-weight: 700; line-height: 1.3;
  /* Подсветка заголовка повторяет скругление плашки: без собственного
     радиуса её острые углы в момент нажатия вылезают за углы карточки
     (замечено владельцем на iPhone, 2026-11-06). Системная серая
     подсветка iOS отключена — реакция на нажатие только наша. */
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
details.acc:not([open]) > .acc-summary { border-radius: calc(var(--radius) - 1px); }
.acc-summary::-webkit-details-marker { display: none; }
.acc-summary::marker { content: none; }
.acc-summary:hover { background: var(--surface-2); }
.acc-summary:active { background: var(--surface-2); }
.acc-summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
details.acc[open ] > .acc-summary { background: var(--tint-bg); border-bottom-color: var(--tint-line); }
.acc-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.acc-chevron {
  width: 11px; height: 11px; flex: none; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .22s var(--ease-out);
}
details.acc[open ] .acc-chevron { transform: rotate(225deg); }
/* Высота .acc-body анимируется JS (плавное открытие/закрытие);
   внутренние отступы — на .acc-inner, чтобы свёрнутое тело было ровно 0 */
.acc-body { padding: 0; overflow: hidden; }
details.acc { scroll-margin-top: 76px; }
.acc-sub { display: flex; align-items: center; gap: 7px; font-size: 16px; margin: 4px 0 10px; }
.acc-inner { padding: 18px; }
.acc-inner > :first-child { margin-top: 0; }
.acc-inner > :last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .acc-chevron { transition: none; } }

/* ===== Язык движения: тактильность, появление, оверлеи, отклики =====
   Только transform/opacity; всё движение умирает в блоке reduced-motion
   в конце файла, а JS-эффекты при reduced-motion даже не стартуют. */

/* Кнопки и чипы: мягкая тень у главных, подъём при наведении (только мышь) */
.btn.primary { box-shadow: 0 1px 3px rgba(14, 32, 25, .22); }
@media (hover: hover) {
  .btn.primary:hover { box-shadow: 0 5px 16px rgba(14, 32, 25, .3); transform: translateY(-1px); }
}
.fchip {
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.plate {
  transition: background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.plate:active { transform: scale(.98) translateY(1px); }
.chip { transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.chip:active { transform: scale(.97); }
.seg-btn { transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.tab { transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.tab-plus { transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.tab-add:active .tab-plus { transform: scale(.93); }
.thumbbtn { transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.thumbbtn:active { transform: scale(.96); }
.helpbtn { transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }

/* Звезда избранного: пружинный «поп» при нажатии (класс ставит JS) */
.star { transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.star:active { transform: scale(.88); }
@keyframes starPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.star.pop { animation: starPop .3s var(--ease-out); }

/* Появление карточек и строк, когда они входят в кадр.
   Начальное скрытое состояние действует ТОЛЬКО под .js-motion (класс на
   <html> ставит JS при живом IntersectionObserver): без JS всё видно. */
/* Появление карточек при входе в кадр отключено 2026-11-24 (параллакс
   давал дёргание и микровспышки при прокрутке): карточки видны сразу. */

/* Справка (U11): оверлей мягко проявляется, карточка чуть подрастает */
.help-overlay { opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.help-overlay.show { opacity: 1; }
.help-card {
  opacity: 0; transform: scale(.98) translateY(8px);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.help-overlay.show .help-card { opacity: 1; transform: none; }

/* Плашки-уведомления: скользят сверху с проявлением */
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.error, .ok { animation: flashIn var(--dur-med) var(--ease-out) both; }

/* Сниженное движение: один глобальный выключатель. Гасит все анимации и
   переходы приложения, включая введённые выше; JS при этом медиа-запросе
   параллакс, появление и анимацию аккордеона не инициализирует. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js-motion .reveal { opacity: 1 !important; transform: none !important; }
}

/* Админка платформы (/admin): с телефона — обычная одна колонка; на
   десктопе (админкой пользуются с компьютера) — широкая раскладка:
   контейнер 1220px только для этой страницы, статистика 4 в ряд,
   графики и ручки — две колонки, пользователи — настоящая таблица. */
.admin-entry { margin: 14px 0; }
.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { font-weight: 600; }
.stat-sub { color: var(--muted); font-size: 14px; }
.bars { display: flex; flex-direction: column; gap: 3px; }
.bar-row {
  display: grid; grid-template-columns: 44px 1fr 26px;
  align-items: center; gap: 8px; font-size: 13px;
}
.bar-date { color: var(--muted); }
.bar-track {
  display: block; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; height: 12px; overflow: hidden;
}
.bar-fill {
  display: block; height: 100%; background: var(--blue); border-radius: 6px;
  transition: width var(--dur-med) var(--ease-out);
}
.bar-n { text-align: right; font-weight: 600; }
.utable { width: 100%; border-collapse: collapse; }
.utable th, .utable td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
.utable thead th { color: var(--muted); font-size: 14px; }
.utable tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.utable tbody tr:hover { background: var(--surface-2); }
@media (max-width: 1023.98px) {
  /* Узкий экран: таблица превращается в блоки с подписями колонок. */
  .utable thead { display: none; }
  .utable, .utable tbody, .utable tr, .utable td { display: block; width: 100%; }
  .utable tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .utable td { border-bottom: 0; padding: 3px 0; }
  .utable td[data-label]::before {
    content: attr(data-label); display: block;
    color: var(--muted); font-size: 13px;
  }
}
@media (min-width: 1024px) {
  .wrap:has(> .admin-panel) { max-width: 1220px; }
  .statgrid { grid-template-columns: repeat(4, 1fr); }
  .admin-cols {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    align-items: start; margin: 14px 0;
  }
  .admin-cols > .card, .admin-cols > div { margin: 0; }
}

/* Поиск и компактные строки пользователей в админке (2026-11-06) */
.u-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; margin-bottom: 6px; }
.u-search .ico { color: var(--muted); flex: none; }
.u-filter { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; font: inherit; color: var(--ink); outline: none; }
.urows { display: flex; flex-direction: column; }
.urow { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.urow:last-child { border-bottom: 0; }
.urow-ava { width: 38px; height: 38px; font-size: 16px; }
.urow-main { flex: 1; min-width: 0; }
.urow-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.uid { color: var(--pine); font-weight: 700; font-size: 12.5px; background: color-mix(in srgb, var(--pine) 12%, transparent); padding: 1px 7px; border-radius: 999px; }
.urow-sub { font-size: 13.5px; overflow-wrap: anywhere; }
.urow form { flex: none; }

/* Окно оплаты Plus (релиз 1.1): нижний шит по одобренному макету
   (store/paywall-mockup.html) поверх затемнённого экрана. Фирменные
   акценты — из макета, поверхности и текст — переменные темы. */
.pw-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(20, 35, 27, .48); display: flex; align-items: flex-end; justify-content: center; padding: 14px; }
.pw-overlay[hidden] { display: none; }
.pw-sheet { background: var(--surface); color: var(--ink); border-radius: 24px; padding: 24px 22px 20px; width: 100%; max-width: 520px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); max-height: calc(100vh - 28px); overflow-y: auto; }
.pw-top { display: flex; align-items: center; gap: 12px; }
.pw-icon { width: 52px; height: 52px; border-radius: 14px; }
.pw-sheet h2 { font-size: 21px; line-height: 1.2; margin: 0; }
.pw-why { margin-top: 10px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.pw-plus { list-style: none; margin: 14px 0 4px; padding: 0; }
.pw-plus li { font-size: 14.5px; padding: 4.5px 0 4.5px 26px; position: relative; }
.pw-plus li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 13px; height: 7px; border-left: 3px solid #2E7D4F; border-bottom: 3px solid #2E7D4F; transform: rotate(-45deg); }
.pw-plans { display: flex; gap: 10px; margin: 14px 0 12px; }
.pw-plan { flex: 1; border: 2px solid var(--line); border-radius: 16px; padding: 12px; background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.pw-plan.sel { border-color: #1F4433; background: var(--surface-2); }
.pw-plan-t { display: block; font-size: 13px; color: var(--muted); }
.pw-plan-p { display: block; font-size: 21px; font-weight: 700; margin-top: 2px; }
.pw-plan-s { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pw-badge { display: inline-block; background: #E7A93C; color: #4a3200; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 2px 8px; margin-top: 6px; text-transform: uppercase; }
.pw-later { display: block; width: 100%; background: none; border: 0; color: var(--muted); font-size: 14.5px; padding: 12px 0 2px; cursor: pointer; font: inherit; text-align: center; }
.pw-fine { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 8px; line-height: 1.4; }

/* «Надиктовать список» (Задача 4, мокап dictate-list-mockup.png):
   шапка места, большая кнопка микрофона, строки с золотыми буллетами. */
.dict-head { margin-bottom: 4px; }
.dict-place { margin: 0; font-size: 26px; }
.dict-path { color: var(--muted); margin: 2px 0 0; }
.mic-big {
  display: flex; align-items: center; justify-content: center;
  width: 96px; height: 96px; margin: 20px auto 6px; border-radius: 50%;
  border: none; background: var(--blue); color: #fff; cursor: pointer;
}
.mic-big .mic-big-ico { width: 44px; height: 44px; }
.mic-big.listening { background: var(--amber); animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .45); }
  50% { box-shadow: 0 0 0 16px rgba(245, 158, 11, 0); }
}
.dict-status { text-align: center; color: var(--muted); margin: 4px 0 10px; }
.dict-live {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
}
.dict-manual { display: block; margin: 10px 0; color: var(--muted); }
.dict-manual textarea { width: 100%; margin-top: 6px; }
.dict-caption { font-weight: 700; margin: 14px 0 6px; }
.dict-list { list-style: none; margin: 0 0 14px; padding: 0; }
.dict-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.dict-dot {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: #d9a62e;
}
.dict-name { flex: 1; cursor: pointer; }
.dict-edit { flex: 1; font: inherit; }
.dict-del {
  flex: none; border: none; background: none; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 6px;
}
.dict-more {
  display: inline-block; margin-top: 12px; border: none; background: none;
  color: var(--blue); font: inherit; font-weight: 600; cursor: pointer;
  padding: 4px 0;
}

/* Выбор иконки места (Задача 2 пакета DEV-PACK-2026-11-21) */
.iconpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.iconpick .fchip { cursor: pointer; }

/* Наблюдатель в пространстве (Задача 3.10): только просмотр и поиск —
   все формы и ряды действий на странице скрыты, сервер записи не примет. */
.readonly-space form, .readonly-space .actions, .readonly-space .photo-edit-btn, .readonly-space .pencil-btn { display: none !important; }

/* Живой чат поддержки с Белкой (2026-11-21) */
.chat-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.chat-ava { width: 52px; height: 52px; border-radius: 14px; }
.chat-msgs { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 14px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-ava { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.msg { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 9px 12px; }
.msg-row.me .msg { background: #14532d; border-color: #1d6a3c; color: #eafff2; }
.msg p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.msg-when { display: block; margin-top: 4px; font-size: 11px; opacity: 0.65; text-align: right; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 76px; background: var(--bg); padding: 8px 0; }
.chat-form textarea { flex: 1; min-height: 44px; }
.cardlink { text-decoration: none; color: inherit; }

/* Карандаши и камеры редактирования (2026-11-22): всё, что можно
   редактировать, обязано показывать значок — карандаш у полей и
   названий, камера прямо на фотографиях. */
.photo-frame { position: relative; }
.photo-edit-btn { position: absolute; right: 10px; bottom: 10px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; background: rgba(8, 24, 18, 0.8); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.photo-edit-btn .ico { width: 18px; height: 18px; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row h1 { margin: 0; }
.pencil-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.pencil-btn .ico { width: 18px; height: 18px; }

/* Видеоинструкция по шагам (2026-11-23): плеер в окне «Информации»
   раздела и на страницах регистрации / стартового экрана. Клипы —
   вертикальные 9:16; высота ограничена, чтобы плеер не съедал экран. */
.help-video, .howto-video { display: block; width: 100%; max-height: 58vh; aspect-ratio: 9 / 16; object-fit: contain; background: #000; border-radius: 12px; margin: 0 auto 14px; }
.howto-block { margin: 14px 0; }
.howto-block h3 { margin: 0 0 8px; font-size: 1rem; }

/* Сплэш первого экрана (решение владельца 2026-11-24: минимализм,
   оригинальная фирменная графика, без нейросетевых сценок). Показ —
   один раз за сессию: класс no-splash на <html> ставит инлайн-скрипт
   в base.html; уборку узла и пропуск по касанию делает app.js. */
.splash { position: fixed; inset: 0; z-index: 2000; background: #204537;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; animation: splash-out .55s ease 2.5s forwards; }
html.no-splash .splash { display: none; }
.splash.splash-done { animation: splash-out .35s ease forwards; }
.splash-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(64, 122, 92, .9), rgba(32, 69, 55, 0) 62%); }
.splash-icon-wrap { position: relative; overflow: hidden; border-radius: 31px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
  animation: splash-in .7s cubic-bezier(.2, .8, .25, 1) both; }
.splash-icon { display: block; width: 136px; height: 136px; }
.splash-icon-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .34) 50%, transparent 68%);
  transform: translateX(-130%); animation: splash-sheen 1.15s ease .5s forwards; }
.splash-name { position: relative; color: #fff; font-size: 31px; font-weight: 700;
  letter-spacing: .2px; margin-top: 24px; animation: splash-up .6s ease .3s both; }
.splash-tag { position: relative; color: rgba(255, 255, 255, .85); font-size: 16px;
  margin-top: 9px; animation: splash-up .6s ease .5s both; }
@keyframes splash-in { from { opacity: 0; transform: scale(.9) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes splash-up { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: none; } }
@keyframes splash-sheen { to { transform: translateX(130%); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .splash { animation-delay: .4s; }
  .splash-icon-wrap, .splash-name, .splash-tag { animation: none; }
  .splash-icon-wrap::after { display: none; }
}

/* Опасная зона карточки предмета: удаление (в архив, с возвратом). */
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(127, 127, 127, .25); }

/* ===== Переходы между экранами — мягкость «как в iPhone» (2026-11-24).
   View Transitions: браузер держит снимок старого экрана, пока новый
   полностью не готов, и едва заметно сдвигает один в другой — без
   вспышек, рывков и проявления из прозрачности. Шапка и нижнее меню
   стоят неподвижно (свои именованные группы без анимации). Где WebView
   переходы не поддерживает, экраны меняются мгновенно — хуже не будет. */
@view-transition { navigation: auto; }
.topbar { view-transition-name: wik-topbar; }
.tabbar { view-transition-name: wik-tabbar; }
::view-transition-group(wik-topbar),
::view-transition-group(wik-tabbar) { animation: none; }
::view-transition-old(wik-topbar),
::view-transition-new(wik-topbar),
::view-transition-old(wik-tabbar),
::view-transition-new(wik-tabbar) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { animation: none; background: var(--bg); }
::view-transition-new(root) { animation: wik-vt-in .22s ease both; background: var(--bg); }
@keyframes wik-vt-in {
  from { transform: scale(.985); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
/* Сдвигов и видов по смыслу навигации нет (убраны по слову владельца
   2026-11-24): один спокойный переход на все экраны — появление из
   центра, см. wik-vt-in выше. */

/* SPA-переход (стейдж): при навигации без перезагрузки появляется
   только содержимое <main> — шапка и таб-бар не анимируются и не
   перерисовываются. Лёгкое проявление из центра, как wik-vt-in. */
main.wrap.spa-in { animation: spaIn .16s ease both; }
@keyframes spaIn {
  from { opacity: 0; transform: scale(.99); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  main.wrap.spa-in { animation: none; }
}
