/* ---------- Шапка экрана ---------- */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.topbar__kicker { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.topbar__title { font-size: var(--fs-2xl); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: var(--sp-6) 0 var(--sp-3); }
.section-title h2 { font-size: 1.05rem; }
.section-title a, .link-btn { font-size: var(--fs-sm); font-weight: 600; color: var(--signal); text-decoration: none; background: none; border: 0; padding: var(--sp-1); cursor: pointer; }

/* ---------- Нижняя навигация: плавающая «таблетка» ---------- */
.nav {
  position: fixed; z-index: 20; left: 50%; bottom: calc(env(safe-area-inset-bottom) + var(--sp-3));
  transform: translateX(-50%);
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--max-w) - 2 * var(--gutter)));
  height: var(--nav-h); padding: 6px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  background: var(--ink); border-radius: var(--r-pill); box-shadow: var(--shadow-nav);
}
.nav[hidden] { display: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-pill); color: var(--paper); opacity: 0.6; text-decoration: none;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  transition: opacity var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out), transform var(--dur-1);
}
.nav a svg { width: 22px; height: 22px; }
.nav a[aria-current="page"] { opacity: 1; background: var(--signal); color: var(--signal-ink); }
.nav a:active { transform: scale(0.94); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-5); border-radius: var(--r-pill);
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font-weight: 700; letter-spacing: 0.01em; cursor: pointer; text-decoration: none;
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), opacity var(--dur-2);
}
.btn:hover { background: var(--ink-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--signal { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn--signal:hover { background: #ec3f12; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--sm { min-height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- Карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow-1); }
.stack { display: grid; gap: var(--sp-3); }

/* ---------- Пропуск ---------- */
.pass {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: var(--pass-bg); color: var(--pass-ink); padding: var(--sp-5);
  box-shadow: var(--shadow-2); isolation: isolate;
}
.pass::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; z-index: -1;
  border-radius: 50%; background: radial-gradient(circle, var(--signal) 0%, transparent 70%); opacity: 0.55;
}
.pass__row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); }
.pass__label { font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }
.pass__name { font-family: var(--font-display); font-size: clamp(1.15rem, 5.6vw, var(--fs-xl)); line-height: 1.08; margin-top: var(--sp-2); hyphens: auto; overflow-wrap: anywhere; }
.pass__name span { display: block; }
.pass__qr { background: #fbf9f4; border-radius: var(--r-md); padding: 10px; width: 132px; height: 132px; flex: none; }
.pass__qr img { width: 100%; height: 100%; }
.pass__meta { display: flex; gap: var(--sp-5); margin-top: var(--sp-5); font-size: var(--fs-sm); }
.pass__meta b { display: block; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.pass--big .pass__qr { width: min(78vw, 300px); height: min(78vw, 300px); margin: var(--sp-5) auto 0; }

/* ---------- Занятие в расписании ---------- */
.event { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.event > * { min-width: 0; }
.event .btn { white-space: nowrap; padding: 0 var(--sp-3); }
.event:last-child { border-bottom: 0; }
.event__time { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1; }
.event__time small { display: block; margin-top: 4px; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.event__name { font-weight: 700; display: flex; align-items: center; gap: var(--sp-2); }
.event__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.event__sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.event__name { line-height: 1.2; }
.event--cancelled { opacity: 0.5; }
.event--cancelled .event__name { text-decoration: line-through; }

/* Полоса заполненности мест — данные как часть системы. */
.seats { display: flex; align-items: center; gap: var(--sp-2); margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; }
.seats__bar { position: relative; flex: 0 0 48px; height: 4px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.seats__bar i { position: absolute; inset: 0; transform-origin: left; background: var(--go); border-radius: 4px; }
.seats__bar i.is-tight { background: var(--wait); }
.seats__bar i.is-full { background: var(--stop); }

/* ---------- Полоса недели ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: var(--sp-4); }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--sp-2) 0;
  border-radius: var(--r-md); border: 1px solid transparent; background: none; cursor: pointer;
  transition: background-color var(--dur-2), transform var(--dur-1);
}
.day span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.day b { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.day:active { transform: scale(0.95); }
.day[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.day[aria-pressed="true"] span { color: var(--paper); opacity: 0.7; }
.day.is-today:not([aria-pressed="true"]) { border-color: var(--signal); }
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.week-nav__label { font-weight: 700; text-transform: capitalize; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Чипы-фильтры ---------- */
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); margin: 0 calc(-1 * var(--gutter)) var(--sp-3); padding-inline: var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Бейджи статусов ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.badge--go { background: var(--go-soft); color: var(--go); }
.badge--wait { background: var(--wait-soft); color: var(--wait); }
.badge--stop { background: var(--stop-soft); color: var(--stop); }
.badge--signal { background: var(--signal-soft); color: var(--signal); }

/* ---------- Абонемент ---------- */
.plan { position: relative; overflow: hidden; }
.plan__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.plan__name { font-family: var(--font-display); font-size: var(--fs-lg); }
.plan__big { font-family: var(--font-display); font-size: var(--fs-hero); font-weight: 700; line-height: 0.9; letter-spacing: -0.04em; margin-top: var(--sp-4); }
.plan__big small { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: var(--sp-2); }
.plan__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--ink-2); }
.plan__services { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); }
.plan__price { font-family: var(--font-display); font-size: var(--fs-lg); white-space: nowrap; }

/* ---------- Формы ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; min-height: 50px; padding: 0 var(--sp-4); border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--card); font-size: 16px;
  transition: border-color var(--dur-2);
}
.input:focus { outline: none; border-color: var(--ink); }
.input[aria-invalid="true"] { border-color: var(--stop); }
.form-error { color: var(--stop); font-size: var(--fs-sm); min-height: 1.2em; }
.hint { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Список-строки ---------- */
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row__title { font-weight: 600; }
.row__sub { font-size: var(--fs-sm); color: var(--muted); }
button.row { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }

/* ---------- Пустые состояния и скелетоны ---------- */
.empty { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--muted); }
.empty__mark { font-family: var(--font-display); font-size: var(--fs-2xl); color: var(--line); margin-bottom: var(--sp-2); }
.skeleton { border-radius: var(--r-md); background: linear-gradient(90deg, var(--paper-2) 25%, var(--card) 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Тост ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top) + var(--sp-3));
  transform: translate(-50%, -20px); opacity: 0; max-width: calc(100% - 2 * var(--gutter));
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--ink); color: var(--paper);
  font-weight: 600; box-shadow: var(--shadow-2); transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2);
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast--error { background: var(--stop); color: #fff; }

/* ---------- Нижний лист (диалог) ---------- */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: var(--max-w); background: transparent; }
.sheet::backdrop { background: rgba(22, 20, 15, 0.5); }
.sheet[open] .sheet__body { animation: sheet-up var(--dur-3) var(--ease-out); }
.sheet__body { background: var(--card); color: var(--ink); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--sp-5) var(--gutter) calc(var(--sp-5) + env(safe-area-inset-bottom)); }
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: -8px auto var(--sp-4); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- Демо-вход ---------- */
.demo { margin-bottom: var(--sp-5); }
.demo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-3); }
.demo-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); min-height: 168px;
  padding: var(--sp-4); border-radius: var(--r-lg); border: 0; text-align: left; cursor: pointer;
  background: var(--signal); color: var(--signal-ink); box-shadow: var(--shadow-2);
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-2);
}
.demo-tile--ink { background: var(--pass-bg); color: var(--pass-ink); }
.demo-tile:active { transform: scale(0.97); }
.demo-tile:disabled { opacity: 0.6; }
.demo-tile__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); margin-bottom: auto; }
.demo-tile__icon svg { width: 24px; height: 24px; }
.demo-tile__title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; line-height: 1.1; }
.demo-tile__text { font-size: var(--fs-sm); opacity: 0.8; line-height: 1.3; }
.demo__or { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-5); color: var(--muted); font-size: var(--fs-sm); }
.demo__or::before, .demo__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
