/* ==========================================================================
   «Вещи на месте» — Premium UI (Apple / Linear / Things inspired)
   ========================================================================== */
:root {
  --bg: #f3f6f8;
  --bg-grad:
    radial-gradient(1100px 500px at 10% -10%, rgba(20, 184, 166, 0.13), transparent 60%),
    radial-gradient(900px 450px at 95% 0%, rgba(15, 118, 110, 0.10), transparent 55%),
    linear-gradient(180deg, #f7f9fb 0%, #eef2f6 100%);
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #ffffff;
  --card-hover: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-2: #14b8a6;
  --primary-grad: linear-gradient(135deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  --primary-soft: rgba(20, 184, 166, 0.11);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.09);
  --radius: 18px;
  --radius-sm: 13px;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.07), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.18), 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --tabbar-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f13;
    --bg-grad:
      radial-gradient(1000px 480px at 15% -10%, rgba(20, 184, 166, 0.16), transparent 60%),
      radial-gradient(850px 420px at 90% 0%, rgba(45, 212, 191, 0.08), transparent 55%),
      linear-gradient(180deg, #0b0f13 0%, #10161b 100%);
    --card: rgba(22, 29, 36, 0.88);
    --card-solid: #161d24;
    --card-hover: #1c252e;
    --surface-2: #1f2933;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.15);
    --primary: #14b8a6;
    --primary-dark: #0d9488;
    --primary-2: #2dd4bf;
    --primary-grad: linear-gradient(135deg, #14b8a6 0%, #0d9488 60%, #0f766e 100%);
    --primary-soft: rgba(20, 184, 166, 0.15);
    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.14);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 28px 60px -12px rgba(0, 0, 0, 0.7);
    --glass: rgba(18, 24, 30, 0.78);
    --glass-border: rgba(255, 255, 255, 0.09);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f13;
  --bg-grad:
    radial-gradient(1000px 480px at 15% -10%, rgba(20, 184, 166, 0.16), transparent 60%),
    radial-gradient(850px 420px at 90% 0%, rgba(45, 212, 191, 0.08), transparent 55%),
    linear-gradient(180deg, #0b0f13 0%, #10161b 100%);
  --card: rgba(22, 29, 36, 0.88);
  --card-solid: #161d24;
  --card-hover: #1c252e;
  --surface-2: #1f2933;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --primary-2: #2dd4bf;
  --primary-grad: linear-gradient(135deg, #14b8a6 0%, #0d9488 60%, #0f766e 100%);
  --primary-soft: rgba(20, 184, 166, 0.15);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 28px 60px -12px rgba(0, 0, 0, 0.7);
  --glass: rgba(18, 24, 30, 0.78);
  --glass-border: rgba(255, 255, 255, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .85; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; line-height: 1.45; }

.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

/* ----- Верхняя стеклянная панель ----- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 900px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 12px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .topbar {
    top: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: 12px 20px;
  }
}
.topbar h1 {
  font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 10px;
}
.topbar h1 img {
  width: 32px; height: 32px; border-radius: 10px;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.28);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  width: 40px; height: 40px; border-radius: 12px; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--card-hover); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.93); }

main#view {
  max-width: 900px; margin: 0 auto;
  padding: 18px 16px calc(var(--tabbar-h) + 104px + env(safe-area-inset-bottom));
}

/* ----- Нижний плавающий док (навигация) ----- */
.tabbar {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 20;
  display: flex; align-items: center; gap: 6px;
  width: min(420px, calc(100vw - 28px));
  padding: 6px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 7px 6px 8px;
  border-radius: 16px;
  color: var(--muted); font-size: 12px; font-weight: 500;
  transition: all .2s cubic-bezier(.2, .8, .2, 1);
}
.tabbar .ti { font-size: 20px; filter: grayscale(.85); opacity: .65; transition: transform .2s, filter .2s, opacity .2s; }
.tabbar a.active {
  color: var(--primary);
  font-weight: 650;
  background: var(--primary-soft);
}
.tabbar a.active .ti { filter: none; opacity: 1; transform: translateY(-1px) scale(1.06); }

/* ----- Плавающая кнопка «＋» ----- */
.fab {
  position: fixed; z-index: 21;
  right: max(20px, calc(50vw - 450px + 20px));
  bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
  width: 62px; height: 62px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--primary-grad); color: #fff; font-size: 32px; font-weight: 300; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 28px -6px rgba(13, 148, 136, 0.55), 0 4px 10px rgba(13, 148, 136, 0.3);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s;
}
.fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 34px -6px rgba(13, 148, 136, 0.65), 0 6px 14px rgba(13, 148, 136, 0.35);
}
.fab:active { transform: scale(.94); }

/* ----- Поля и кнопки ----- */
.input {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card-solid);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--muted); opacity: .75; }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px var(--primary-soft);
}
select.input { padding-right: 10px; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 10px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card-solid);
  box-shadow: var(--shadow-sm);
  cursor: pointer; font-weight: 600; font-size: 15px; text-align: center;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--card-hover); border-color: var(--primary-2); }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--primary-grad);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 6px 16px -3px rgba(13, 148, 136, 0.42);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); border-color: rgba(225, 29, 72, 0.22); background: var(--danger-soft); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 13.5px; border-radius: 11px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.round { width: 46px; padding: 0; border-radius: 14px; font-size: 22px; flex: 0 0 46px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }

/* ----- Панель поиска, фильтров и сводки ----- */
.toolbar {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters select { min-width: 0; }
.list-info {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  margin: 4px 4px 12px;
  font-variant-numeric: tabular-nums;
}

/* ----- Карточки вещей ----- */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.card:active { transform: scale(.985); }

.thumb {
  flex: 0 0 78px; height: 78px; border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .04);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.card:hover .thumb img { transform: scale(1.05); }

.card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card-title {
  font-weight: 650; font-size: 16px; letter-spacing: -0.01em;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  overflow-wrap: anywhere;
}
.qty {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.card-meta {
  color: var(--muted); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); margin-top: 8px;
}
.empty .big { font-size: 56px; margin-bottom: 6px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.08)); }
.empty h3 { color: var(--text); margin: 8px 0 6px; font-size: 18px; }
.empty .btn { margin-top: 14px; }

/* ----- Места хранения ----- */
.crumbs {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 10px;
}
.crumbs .sep { opacity: .45; }
.place-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin: 4px 0 10px;
}
.place-head h2, .section-title {
  margin: 4px 0 10px; font-size: 24px; font-weight: 750; letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.place-tools { display: flex; gap: 8px; }
.section-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 22px 4px 10px; font-weight: 700;
}
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  opacity: 1;
}
.row-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.row-name { flex: 1; font-weight: 650; font-size: 16px; overflow-wrap: anywhere; }
.row-count {
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  background: var(--surface-2); padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chev { color: var(--muted); font-size: 22px; line-height: 1; opacity: .6; }

.hint {
  background: var(--primary-soft); border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: var(--radius); padding: 14px 16px; font-size: 14.5px; margin: 8px 0 12px;
  line-height: 1.5;
}

/* ----- Сферы (Плитки) ----- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 124px; padding: 16px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.tile:active { transform: scale(.97); }
.tile-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; margin-bottom: 2px;
}
.tile-name { font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tile-count {
  color: var(--muted); font-size: 13px; font-weight: 500;
  margin-top: auto; font-variant-numeric: tabular-nums;
}
.add-tile {
  border: 1.5px dashed var(--line-strong); background: transparent;
  color: var(--primary); align-items: center; justify-content: center; text-align: center;
  box-shadow: none;
}
.add-tile .tile-icon { background: var(--primary-soft); color: var(--primary); }

/* ----- Модальные окна (Bottom Sheet / Dialog) ----- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 13, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease-out;
}
.modal {
  position: relative;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  width: 100%; max-width: 560px;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 26px 26px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: up .22s cubic-bezier(.16, 1, .3, 1);
}
.modal::before {
  content: "";
  display: block; width: 40px; height: 4px; border-radius: 999px;
  background: var(--line-strong);
  margin: -8px auto 14px;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 24px; padding: 24px; }
  .modal::before { display: none; }
}
.modal h2 { margin: 0 0 16px; font-size: 21px; font-weight: 750; overflow-wrap: anywhere; }
.modal-text { white-space: pre-line; margin: 0 0 8px; line-height: 1.5; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-actions .btn { flex: 1 1 auto; }

.field { display: block; margin-bottom: 15px; }
.field > span {
  display: block; font-size: 13.5px; color: var(--muted);
  margin-bottom: 6px; font-weight: 600; letter-spacing: -0.005em;
}
.with-add { display: flex; gap: 8px; }
.with-add select, .with-add input { flex: 1; min-width: 0; }
.with-add .btn { flex: 0 0 48px; padding: 0; font-size: 20px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.qty-input { width: 92px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.stepper b { min-width: 40px; text-align: center; font-size: 21px; font-variant-numeric: tabular-nums; }

/* ----- Область фото и баннер ИИ ----- */
.photo-box {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; cursor: pointer;
  background: var(--surface-2); border: 2px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.photo-box:hover { border-color: var(--primary); }
.photo-box img { width: 100%; height: 100%; object-fit: contain; background: #090d10; }
.photo-empty { text-align: center; color: var(--muted); font-size: 15px; font-weight: 500; padding: 16px; }
.photo-empty .big { font-size: 46px; display: block; margin-bottom: 6px; }
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.photo-buttons .btn { flex: 1 1 auto; font-size: 14px; padding: 9px 12px; }

.ai-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; margin-bottom: 15px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(13, 148, 136, 0.08));
  color: var(--text); font-size: 14px; font-weight: 500;
  border: 1px solid rgba(20, 184, 166, 0.35);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.08);
}
.ai-banner.err { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); box-shadow: none; }

.detail-photo {
  margin: -22px -20px 18px; background: #090d10;
  border-radius: 24px 24px 0 0; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) {
  .detail-photo { margin: -24px -24px 18px; }
}
.detail-photo img { display: block; width: 100%; max-height: 56vh; object-fit: contain; }
.detail-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center;
  background: var(--surface-2); padding: 16px; border-radius: 16px;
  border: 1px solid var(--line);
}
.detail-label { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.loc-link { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choices .btn { justify-content: flex-start; width: 100%; padding: 13px 16px; font-size: 15px; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 7px; }
.emoji {
  height: 46px; font-size: 24px; cursor: pointer;
  border: 2px solid transparent; border-radius: 12px; background: var(--surface-2);
  transition: transform .12s, background .15s, border-color .15s;
}
.emoji:hover { transform: scale(1.06); }
.emoji.sel { border-color: var(--primary); background: var(--primary-soft); }

/* ----- Всплывающее уведомление (Toast) ----- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom));
  max-width: 90vw; padding: 11px 20px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff; font-size: 14.5px; font-weight: 500; text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28); animation: fade .15s;
}

/* ----- Экран входа ----- */
.auth {
  max-width: 420px; margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top)) 20px 40px; text-align: center;
}
.auth-logo img {
  width: 88px; height: 88px; border-radius: 24px;
  box-shadow: 0 16px 36px -8px rgba(13, 148, 136, 0.45);
}
.auth h1 { margin: 16px 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.panel {
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  border-radius: 22px; padding: 22px; text-align: left;
  box-shadow: var(--shadow);
}
.auth-msg { font-size: 14px; margin: 4px 0 8px; font-weight: 500; }
.auth-msg.err { color: var(--danger); }
.auth-msg.ok { color: var(--primary); }

/* ----- Служебные экраны ----- */
.center-screen {
  min-height: 100vh; min-height: 100dvh; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
}
.center-screen h2 { margin: 0; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3.5px solid var(--line-strong); border-top-color: var(--primary);
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(28px) scale(.98); opacity: .4; } }
