/* ============================================================ tokens */
:root {
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --backdrop: #dfe3ec;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --text: #121722;
  --muted: #697386;
  --border: #e3e6ed;
  --primary: #2f54eb;
  --primary-press: #2443c8;
  --primary-soft: #e8edff;
  --on-primary: #ffffff;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --success: #0f8a5f;
  --success-soft: #e2f5ec;
  --warning: #b25e09;
  --warning-soft: #fff1dc;
  --neutral-soft: #eceff4;
  --gold: #e3a008;
  --silver: #98a2b3;
  --bronze: #c2733a;
  --star: #f5a524;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 6%);
  --shadow-2: 0 10px 30px rgb(16 24 40 / 14%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 180ms;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --backdrop: #07090d;
    --bg: #0e121a;
    --surface: #171c26;
    --surface-2: #1d2330;
    --text: #eef1f6;
    --muted: #96a0b2;
    --border: #283042;
    --primary: #6d8bff;
    --primary-press: #5a79f5;
    --primary-soft: #1f2a4d;
    --on-primary: #0b1020;
    --danger: #ff6b5e;
    --danger-soft: #3a1d1d;
    --success: #3ccf91;
    --success-soft: #133326;
    --warning: #ffb547;
    --warning-soft: #3a2a12;
    --neutral-soft: #222938;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 12px 34px rgb(0 0 0 / 55%);
    color-scheme: dark;
  }
}

/* ============================================================ base */
* { box-sizing: border-box; }
/*
 * Масштабирование страницы отключено: pinch-zoom и двойной тап (touch-action), автоувеличение
 * шрифта при повороте (text-size-adjust). iOS игнорирует user-scalable=no — там жесты
 * дополнительно гасятся в js/ui/no-zoom.js. Прокрутка — только внутри .content, сама страница
 * не сдвигается и не «тянется».
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
button, a, input, select, textarea, label { touch-action: manipulation; }
body {
  background: var(--backdrop);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/*
 * На телефонах и планшетах приложение занимает весь экран (с отступами под «чёлку» и
 * скругления в альбомной ориентации); содержимое на широких экранах — колонкой по центру.
 * Рамка «телефона» — только на компьютере с мышью.
 */
.frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow: hidden;
  background: var(--bg);
}
.content-inner { width: 100%; max-width: 640px; margin: 0 auto; }
@media (min-width: 640px) and (hover: hover) and (pointer: fine) {
  body { display: grid; place-items: center; }
  .frame {
    width: 400px;
    height: min(860px, calc(100dvh - 40px));
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow-2);
  }
}

#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ============================================================ shell */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.topbar h1 { flex: 1; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; text-align: center; }
.topbar-spacer { width: 40px; }

.content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 28px;
}
.content.has-fab { padding-bottom: 96px; }
#app.bare .content { padding: calc(env(safe-area-inset-top) + 28px) 18px 28px; }

.bottomnav {
  display: grid;
  /* 4 или 5 пунктов: у администраторов 3–5 уровня есть «Мои» */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  transition: color var(--dur) var(--ease);
}
.nav-item.active { color: var(--primary); }
.nav-icon { position: relative; display: grid; place-items: center; width: min(52px, 100%); height: 30px; border-radius: 15px; transition: background var(--dur) var(--ease); }
.nav-item.active .nav-icon { background: var(--primary-soft); }
.nav-icon .badge { position: absolute; top: -4px; left: 31px; }
.nav-dot { position: absolute; top: 2px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.fab {
  position: absolute;
  right: 18px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 40%, transparent);
  transition: transform var(--dur) var(--ease);
}
.fab:active { transform: scale(0.94); }
.fab .icon { width: 26px; height: 26px; }

/* ============================================================ primitives */
.icon { display: inline-flex; flex: none; width: 20px; height: 20px; }
.icon svg { width: 100%; height: 100%; }
.icon.lg { width: 40px; height: 40px; }
.icon.muted { color: var(--muted); }
.icon.ok { color: var(--success); }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--neutral-soft); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn.disabled { opacity: 0.3; pointer-events: none; }
.bell .badge { position: absolute; top: 3px; left: 21px; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.danger { color: var(--danger) !important; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.card {
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  color: var(--text);
}
.list-card { padding: 4px 0; }
.list { display: flex; flex-direction: column; gap: 10px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.section-title h3 { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ============================================================ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--neutral-soft);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-press); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-text { background: transparent; min-height: 40px; align-self: center; font-size: 14px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; padding: 10px 0 2px; background: linear-gradient(transparent, var(--bg) 30%); }
.link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; padding: 6px; }

/* ============================================================ forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 750; color: var(--muted); }
.field-hint { font-size: 12.5px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* iOS не зумит поле */
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.code-input { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 800; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 13px; top: 13px; }
.search-input { padding-left: 42px; }
fieldset { margin: 0; padding: 0; border: 0; }

.kind-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-picker legend { margin-bottom: 6px; }
.kind-option { flex: 1; }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.kind-option span {
  display: block; padding: 10px 6px; text-align: center; font-weight: 700; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer;
}
.kind-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.kind-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--neutral-soft); }
.segmented > * {
  flex: 1; padding: 9px 8px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); font-weight: 750; font-size: 14px; text-align: center; cursor: pointer;
}
.segmented > .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.segmented.sm > * { padding: 6px; font-size: 12.5px; }
.segmented .fb-planned { color: var(--primary); }
.segmented .fb-done { color: var(--success); }

.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chips-scroll { display: flex; gap: 8px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 13px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 700;
}
.filter-chip .count { padding: 0 6px; border-radius: 8px; background: var(--neutral-soft); color: var(--muted); font-size: 12px; }
.filter-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter-chip.active .count { background: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
.mini-chip { padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 650; cursor: pointer; }
.mini-chip:active { background: var(--primary-soft); }

/* ============================================================ status chips */
.chip {
  display: inline-flex; align-items: center; flex: none; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 750; white-space: nowrap; background: var(--neutral-soft); color: var(--muted);
}
.st-in_progress { background: var(--primary-soft); color: var(--primary); }
.st-review { background: var(--warning-soft); color: var(--warning); }
.st-returned, .st-overdue { background: var(--danger-soft); color: var(--danger); }
.st-done { background: var(--success-soft); color: var(--success); }
.kind-appeal { background: var(--primary-soft); color: var(--primary); }
.kind-wish { background: var(--success-soft); color: var(--success); }
.kind-issue { background: var(--warning-soft); color: var(--warning); }

/* ============================================================ task cards */
.task-card { display: flex; flex-direction: column; gap: 10px; transition: transform var(--dur) var(--ease); }
.task-card:active { transform: scale(0.99); }
.task-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-title { font-weight: 750; font-size: 15.5px; line-height: 1.3; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item .icon { width: 15px; height: 15px; }
.task-heading { margin: 10px 0 12px; font-size: 21px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; }
.task-desc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; font-weight: 650; }

.stars { display: inline-flex; gap: 2px; color: var(--border); }
.stars .icon { width: 18px; height: 18px; }
.stars.sm .icon { width: 14px; height: 14px; }
.stars .filled { color: var(--star); }
.stars .filled svg, .rate-btn.on svg { fill: currentColor; }

.rate-picker { display: flex; flex-direction: column; gap: 6px; }
.rate-row { display: flex; gap: 6px; }
.rate-btn {
  flex: 1; display: grid; place-items: center; height: 52px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--border); cursor: pointer;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.rate-btn .icon { width: 28px; height: 28px; }
.rate-btn.on { color: var(--star); border-color: color-mix(in srgb, var(--star) 45%, var(--border)); background: color-mix(in srgb, var(--star) 12%, var(--surface)); }
.rate-btn:active { transform: scale(0.92); }
.rate-caption { font-size: 13px; font-weight: 700; color: var(--muted); }

.notice { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); font-size: 14px; }
.notice > .icon { margin-top: 1px; }
.notice p { margin-top: 3px; }
.notice .stars { margin-top: 4px; }
.notice-danger { background: var(--danger-soft); color: color-mix(in srgb, var(--danger) 80%, var(--text)); }
.notice-warning { background: var(--warning-soft); color: color-mix(in srgb, var(--warning) 75%, var(--text)); }
.notice-success { background: var(--success-soft); color: color-mix(in srgb, var(--success) 75%, var(--text)); }
.notice-info { background: var(--primary-soft); color: color-mix(in srgb, var(--primary) 75%, var(--text)); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--muted); }
.tl-approved .tl-dot { background: var(--success); }
.tl-rejected .tl-dot { background: var(--danger); }
.tl-submitted .tl-dot { background: var(--warning); }
.tl-started .tl-dot { background: var(--primary); }
.tl-head { font-size: 14px; }
.tl-sub { font-size: 12.5px; color: var(--muted); }
.tl-text { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 14px; white-space: pre-wrap; }

/* ============================================================ rows, profile, stats */
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px;
  border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
a.list-row:active, button.list-row:active { background: var(--surface-2); }
.list-row.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
/* длинные ФИО переносятся на вторую строку, а не обрезаются — на узком экране видно всё */
.row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-weight: 700; overflow-wrap: anywhere; }
.row-title.wrap { white-space: normal; font-weight: 600; font-size: 14px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dot.on { background: var(--primary); }
.menu-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.menu-icon.danger { background: var(--danger-soft); }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(140deg, var(--primary-soft), color-mix(in srgb, var(--primary) 22%, var(--surface)));
  color: var(--primary); font-weight: 800; font-size: 14px; letter-spacing: 0.02em;
}
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }

.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card h2 { font-size: 18px; font-weight: 800; line-height: 1.25; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat strong { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--muted); }

.access-card { display: flex; flex-direction: column; gap: 10px; }
.code-display {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border);
  font-size: 24px; font-weight: 800; letter-spacing: 0.2em; font-variant-numeric: tabular-nums;
}
.code-display.big { font-size: 30px; padding: 16px 12px 16px 20px; }

.hello-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #7a3cff));
  border: 0; color: #fff;
}
.hello-card h2 { font-size: 19px; font-weight: 800; }
.hello-card p { opacity: 0.85; font-size: 14px; margin-top: 2px; }
.hello-score { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: 14px; background: rgb(255 255 255 / 18%); color: #fff; }
.hello-score strong { font-size: 24px; line-height: 1; }
.hello-score span { font-size: 11px; opacity: 0.9; }

.appeal-intro { display: flex; gap: 14px; align-items: flex-start; }
.appeal-intro .icon { color: var(--primary); }
.appeal-intro h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.appeal-card { display: flex; flex-direction: column; gap: 10px; }
.appeal-card.unread { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.demo-card { border-style: dashed; }
.demo-card input { min-height: 36px; padding: 6px 10px; font-size: 16px; }

.pwa-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.pwa-card > .icon { color: var(--primary); }
.pwa-card strong { display: block; font-size: 14.5px; }
.pwa-card p { margin-top: 2px; }
.pwa-card.highlight { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.btn:disabled { opacity: 0.6; pointer-events: none; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; color: var(--muted); text-align: center; }
.empty .icon { opacity: 0.5; }

/* ============================================================ rating */
.month-switch { display: flex; align-items: center; justify-content: space-between; }
.month-switch strong { font-size: 16px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-top: 8px; }
.podium-item {
  position: relative; flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); text-align: center;
}
.podium-item.place-1 { padding-top: 26px; border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.podium-item.me { box-shadow: 0 0 0 2px var(--primary); }
.podium-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.podium-item strong { font-size: 14px; }
.medal { position: absolute; top: -11px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; background: var(--bronze); }
.place-1 .medal { background: var(--gold); }
.place-2 .medal { background: var(--silver); }
.place { flex: none; width: 24px; text-align: center; font-weight: 800; color: var(--muted); }
.place.place-1 { color: var(--gold); }
.place.place-2 { color: var(--silver); }
.place.place-3 { color: var(--bronze); }
.rating-row.me { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }
.points { font-size: 18px; font-weight: 800; }

/* ============================================================ login */
.login { display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.brand-mark {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #7a3cff)); color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}
.brand-mark .icon { width: 32px; height: 32px; }
.brand h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; }
.brand p { color: var(--muted); }
.login-card { display: flex; flex-direction: column; gap: 16px; }
.login-sub { font-size: 17px; font-weight: 800; }
.demo-box { padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.demo-box summary { display: flex; align-items: center; gap: 8px; font-weight: 750; cursor: pointer; list-style: none; }
.demo-box summary::-webkit-details-marker { display: none; }
.demo-box h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.demo-box .field-hint { margin-top: 6px; }
.demo-row {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 4px;
  border: 0; border-top: 1px solid var(--border); background: transparent; text-align: left; font-size: 14px; cursor: pointer;
}
.demo-row span:first-child { font-weight: 650; }
.owner-link { align-self: center; font-weight: 650; }

/* ============================================================ owner, restaurants */
.restaurant-line { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.restaurant-line .icon { width: 14px; height: 14px; }
.restaurant-card { padding: 14px 16px; }
.restaurant-no {
  display: grid; place-items: center; flex: none; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 17px;
}

/* ============================================================ small & wide screens */
.sheet { max-width: 640px; margin: 0 auto; }
.content { overflow-x: hidden; }
.card.form > .row-title { white-space: normal; }
@media (max-width: 360px) {
  .content { padding: 12px 12px 24px; }
  .chips-scroll { margin: 0 -12px; padding: 0 12px 2px; }
  #app.bare .content { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .list-row { padding: 11px 12px; gap: 10px; }
  .topbar h1 { font-size: 16px; }
  .nav-item { font-size: 10px; }
  .btn-row { flex-wrap: wrap; }
  .code-display.big { font-size: 24px; }
  .stats { gap: 8px; }
  .stat strong { font-size: 20px; }
  .podium { gap: 6px; }
}
/* телефон в альбомной ориентации: экономим высоту */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { padding-top: calc(env(safe-area-inset-top) + 6px); padding-bottom: 6px; }
  #app.bare .content { padding-top: calc(env(safe-area-inset-top) + 14px); }
  .brand-mark { width: 48px; height: 48px; }
}

/* ============================================================ sheet, toast */
#overlays { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; pointer-events: auto;
  background: rgb(10 14 22 / 45%); animation: fade-in var(--dur) var(--ease);
}
.sheet {
  width: 100%; max-height: 88%; overflow-y: auto; padding: 8px 18px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 24px 24px 0 0; background: var(--bg); box-shadow: var(--shadow-2);
  animation: slide-up 240ms var(--ease);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.overlay.closing { animation: fade-out var(--dur) var(--ease) forwards; }
.overlay.closing .sheet { animation: slide-down var(--dur) var(--ease) forwards; }

#toasts { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 12px); display: flex; flex-direction: column; gap: 8px; z-index: 30; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 650; box-shadow: var(--shadow-2);
  animation: drop-in 260ms var(--ease); transition: opacity 300ms, transform 300ms;
}
.toast .icon { color: var(--success); }
.toast-error { background: var(--danger); color: #fff; }
.toast-error .icon { color: #fff; }
.toast.out { opacity: 0; transform: translateY(-8px); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes slide-down { to { transform: translateY(100%); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
