/* ───────────────────────────── ТОКЕНЫ ─────────────────────────────
   Палитра студии монтажа: угольный фон, "плёночное" золото как главный
   акцент (заголовки, прогресс, активные состояния), тил как второй акцент
   (иконки поддержки/чата), плюс статусные зелёный и красный. */

:root {
  --bg: #0a0a0d;
  --bg-elev: #0f0f14;
  --card-bg: #15151b;
  --card-bg-2: #1c1c24;
  --text: #f5f3ee;
  --hint: #8b8a95;
  --line: rgba(255, 255, 255, 0.07);
  --tile-border: rgba(255, 255, 255, 0.07);

  --accent: #f2b544;            /* золото — главный акцент */
  --accent-2: #ffd27a;          /* светлое золото для градиента */
  --accent-ink: #1a1205;        /* текст поверх золота */
  /* Единый «грейд» для всех стоковых фото: приглушённые, тёплые, слегка затемнённые. */
  --photo-grade: saturate(0.55) contrast(1.1) brightness(0.8) sepia(0.28);
  --accent-soft: rgba(242, 181, 68, 0.14);

  --teal: #35d1c2;              /* второй акцент */
  --teal-soft: rgba(53, 209, 194, 0.14);

  --success: #4cd37a;
  --success-soft: rgba(76, 211, 122, 0.14);
  --warn: #f2b544;
  --warn-soft: rgba(242, 181, 68, 0.14);
  --danger: #ff5a5a;
  --danger-soft: rgba(255, 90, 90, 0.14);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Inter", sans-serif;
}

body.theme-light {
  --bg: #f3f1ec;
  --bg-elev: #faf8f4;
  --card-bg: #ffffff;
  --card-bg-2: #f4f2ee;
  --text: #17161c;
  --hint: #74737d;
  --line: rgba(0, 0, 0, 0.07);
  --tile-border: rgba(0, 0, 0, 0.07);
  --accent: #d9961c;
  --accent-2: #f0b84a;
  --accent-soft: rgba(217, 150, 28, 0.12);
  --teal: #189e92;
  --teal-soft: rgba(24, 158, 146, 0.12);
  --success: #1fa564;
  --success-soft: rgba(31, 165, 100, 0.12);
  --warn: #d9961c;
  --warn-soft: rgba(217, 150, 28, 0.12);
  --danger: #e14343;
  --danger-soft: rgba(225, 67, 67, 0.10);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(242, 181, 68, 0.10), transparent 60%),
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

button { font-family: inherit; }

p { color: var(--hint); line-height: 1.5; }

/* ───────────────────────────── ЗАГРУЗКА ───────────────────────────── */

#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100vh;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--hint);
}

.loading-reel {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: reel-spin 0.9s linear infinite;
}

@keyframes reel-spin { to { transform: rotate(360deg); } }

/* ───────────────────────────── ВЕРХНЯЯ ПАНЕЛЬ ─────────────────────────────
   Верхний уровень (без "назад"): крупный золотой заголовок слева,
   брендовый знак справа — как "Главная / Crownfall" на референсе. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}

.topbar-side { width: 40px; flex-shrink: 0; }
.topbar-side-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.topbar-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

.topbar-back:active { opacity: 0.7; }

.topbar-center { flex: 1; text-align: center; min-width: 0; }

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle { margin-top: 2px; color: var(--hint); font-size: 12.5px; }

.topbar.topbar-top { gap: 12px; padding-bottom: 6px; }
.topbar.topbar-top .topbar-side:first-child { display: none; }
.topbar.topbar-top .topbar-side-right { width: auto; }
.topbar.topbar-top .topbar-center { text-align: left; }
.topbar.topbar-top .topbar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 55%, #b97c16 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* Логотип: полумесяц с четырёхлучевой звездой + надпись ARNULL (по образцу ASTRAL). */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.brand-mark svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 0 8px rgba(242, 181, 68, 0.35)); }
.brand-mark.large { flex-direction: column; gap: 10px; font-size: 22px; letter-spacing: 0.18em; }
.brand-mark.large svg { width: 72px; height: 72px; }

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn.small { width: 34px; height: 34px; font-size: 15px; }

/* ───────────────────────────── КОНТЕЙНЕР / КАРТОЧКИ ───────────────────────────── */

.container { position: relative; padding: 6px 16px 16px; }
.has-bottom-nav { padding-bottom: 96px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
}

.menu-btn:active { opacity: 0.75; }

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 8px 20px rgba(242, 181, 68, 0.22);
}

.btn-primary:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(242, 181, 68, 0.18); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card-bg-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.btn-secondary:active { opacity: 0.8; }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hint);
  margin: 16px 0 8px;
}

input[type=text], input[type=number], textarea, select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type=text]:focus, input[type=number]:focus, textarea:focus {
  border-color: rgba(242, 181, 68, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { min-height: 88px; resize: vertical; }

.format-options { display: flex; flex-wrap: wrap; gap: 8px; }

.format-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.format-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.field-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.field-line:last-of-type { border-bottom: none; }
.field-line b { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; color: var(--hint); padding: 28px 0; font-size: 14px; }
.step-indicator { color: var(--hint); font-size: 13px; margin-bottom: 4px; }

/* ───────────────────────────── ЗАГОЛОВКИ СЕКЦИЙ ───────────────────────────── */

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 12px;
}

.section-row .section-label { margin: 0; }

.section-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 6px 0 12px;
}

.bell-badge {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell-badge svg { width: 18px; height: 18px; }

.bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--bg);
}

.bell-badge.empty .bell-count { display: none; }

/* ───────────────────────────── ГЛАВНАЯ: ПРИВЕТСТВИЕ ───────────────────────────── */

.greeting-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 6px 0 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(242, 181, 68, 0.18), transparent 55%),
    var(--card-bg);
  cursor: pointer;
  overflow: hidden;
}

.greeting-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 60%, rgba(53, 209, 194, 0.08));
}

.avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--teal), #1a8e85);
  color: #052321;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px rgba(53, 209, 194, 0.45);
}

.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-circle.small { width: 28px; height: 28px; font-size: 12px; box-shadow: none; }

.greeting-text { flex: 1; min-width: 0; }
.greeting-title { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.greeting-sub { color: var(--hint); font-size: 13px; margin-top: 2px; }
.greeting-arrow { color: var(--hint); font-size: 22px; line-height: 1; }

/* ───────────────────────────── СЧЁТЧИКИ ───────────────────────────── */

.counters-row {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--card-bg);
  overflow: hidden;
}

.counter-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px;
  position: relative;
}

.counter-pill + .counter-pill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  height: 56%;
  width: 1px;
  background: var(--line);
}

.counter-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.counter-dot svg { width: 15px; height: 15px; }
.counter-dot.open { background: var(--success-soft); color: var(--success); }
.counter-dot.total { background: var(--accent-soft); color: var(--accent); }
.counter-dot.closed { background: var(--danger-soft); color: var(--danger); }
.counter-dot.taken { background: var(--teal-soft); color: var(--teal); }

.counter-text { display: flex; flex-direction: column; line-height: 1.1; }
.counter-value { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.counter-label { font-size: 10px; color: var(--hint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }

/* ───────────────────────────── CTA: ЗАКАЗАТЬ МОНТАЖ ───────────────────────────── */

.cta-order {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 132px;
  padding: 20px;
  margin: 4px 0 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(242, 181, 68, 0.35);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background: var(--card-bg);
}

/* Фото под единый «грейд»: приглушённая насыщенность, тёплый сдвиг, тёмная виньетка.
   Так разные стоковые снимки выглядят как одна серия. */
.cta-order::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cta-art, none) right center / cover no-repeat;
  filter: var(--photo-grade);
}
.cta-order .cta-order-shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(10, 10, 13, 0.94) 32%, rgba(10, 10, 13, 0.55) 68%, rgba(10, 10, 13, 0.15));
}

.cta-order::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, transparent);
}

.cta-order-text { position: relative; z-index: 1; }
.cta-order-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cta-order-kicker::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: rec-blink 1.6s ease-in-out infinite;
}
@keyframes rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.cta-order-title { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: #fff; }
.cta-order-sub { font-size: 13px; color: rgba(255, 255, 255, 0.72); margin-top: 4px; }
.cta-order-arrow {
  position: relative;
  z-index: 1;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  flex-shrink: 0;
}

.cta-order:active { transform: scale(0.99); }

/* ───────────────────────────── ПЛИТКИ РАЗДЕЛОВ ─────────────────────────────
   Иконка-бейдж слева сверху, арт справа, подпись снизу — как на референсе. */

.tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.tile {
  position: relative;
  min-height: 152px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--tile-border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1), border-color 0.2s, box-shadow 0.2s;
}

.tile.art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--art) center / cover no-repeat;
  filter: var(--photo-grade);
  transform: scale(1.02);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}

.tile.art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(10, 10, 13, 0.96) 24%, rgba(10, 10, 13, 0.6) 55%, rgba(10, 10, 13, 0.2)),
    var(--tile-tint-wash, transparent);
}
.tile.art.tint-orange { --tile-tint-wash: rgba(242, 181, 68, 0.14); }
.tile.art.tint-blue   { --tile-tint-wash: rgba(80, 160, 255, 0.14); }
.tile.art.tint-purple { --tile-tint-wash: rgba(160, 100, 255, 0.16); }
.tile.art.tint-red    { --tile-tint-wash: rgba(255, 90, 90, 0.14); }
.tile.art.tint-pink   { --tile-tint-wash: rgba(255, 110, 180, 0.14); }
.tile.art.tint-cyan   { --tile-tint-wash: rgba(80, 220, 210, 0.14); }

.tile-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(20, 20, 26, 0.75);
  border: 1px solid var(--tile-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent);
}

.tile-icon svg { width: 18px; height: 18px; }

.tile-title { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; color: #fff; }
.tile-sub { font-size: 12px; color: rgba(255, 255, 255, 0.65); }

.tile:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.14); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35); }
.tile:hover.art::before { transform: scale(1.08); }
.tile:active { transform: scale(0.985); }

/* Цветные бейджи иконок — вместо тонировки всей плитки */
.tile.tint-orange .tile-icon, .tile.tint-pink .tile-icon { color: var(--accent); }
.tile.tint-blue .tile-icon, .tile.tint-cyan .tile-icon { color: var(--teal); }
.tile.tint-purple .tile-icon { color: #c9a0ff; }
.tile.tint-red .tile-icon { color: var(--danger); }
.tile.tint-green .tile-icon { color: var(--success); }

/* Плитки без арта (профиль): плоские карточки с иконкой и ссылкой "Открыть" */
.tile.tile-plain {
  min-height: 0;
  justify-content: flex-start;
  gap: 4px;
  padding: 16px;
}

.tile.tile-plain .tile-icon {
  position: static;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin-bottom: 26px;
  background: var(--accent-soft);
  border: none;
  backdrop-filter: none;
}

.tile.tile-plain .tile-icon svg { width: 20px; height: 20px; }
.tile.tile-plain.tint-blue .tile-icon, .tile.tile-plain.tint-cyan .tile-icon { background: var(--teal-soft); }
.tile.tile-plain.tint-purple .tile-icon { background: rgba(160, 110, 255, 0.16); }
.tile.tile-plain.tint-red .tile-icon { background: var(--danger-soft); }

.tile.tile-plain .tile-title { color: var(--text); font-size: 15.5px; }
.tile.tile-plain .tile-sub { color: var(--hint); }
.tile-open {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ───────────────────────────── НИЖНИЙ ТАБ-БАР ─────────────────────────────
   Активная вкладка "выступает" над панелью отдельной карточкой. */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 10, 13, 0.85);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 14px 14px 0 0;
  background: transparent;
  color: var(--hint);
  font-size: 10.5px;
  font-weight: 600;
  padding: 12px 0 6px;
  cursor: pointer;
  transition: color 0.15s, transform 0.2s cubic-bezier(.2,.8,.2,1);
}

.bottom-nav-item .bn-icon { width: 22px; height: 22px; display: block; }
.bottom-nav-item .bn-icon svg { width: 22px; height: 22px; }

.bottom-nav-item.active {
  color: var(--text);
  background: var(--card-bg);
  border-color: var(--line);
  border-bottom-color: transparent;
  transform: translateY(-8px);
  padding-bottom: 14px;
  margin-bottom: -8px;
}

.bottom-nav-item.active .bn-icon { color: var(--accent); }

/* ───────────────────────────── ЗАКАЗЫ / СТАТУСЫ ───────────────────────────── */

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 8px;
  cursor: pointer;
}

.order-row:active { opacity: 0.8; }
.order-row-main { min-width: 0; flex: 1; }
.order-row-title { font-size: 14px; }
.order-row-title b { color: var(--accent); }
.order-row-person { color: var(--hint); font-size: 12px; margin-top: 2px; }
.order-row-description { color: var(--hint); font-size: 11.5px; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.status-pill.new { background: var(--warn-soft); color: var(--warn); }
.status-pill.new .status-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-pill.taken { background: var(--success-soft); color: var(--success); }
.status-pill.taken .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-pill.closed { background: var(--danger-soft); color: var(--danger); }
.status-pill.closed .status-dot { background: var(--danger); }

.status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.status-banner .status-dot { width: 9px; height: 9px; }

.intern-order-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 3px 0 2px;
  font-size: 13px;
}

/* ───────────────────────────── ЧАТ ───────────────────────────── */

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 10px;
}

.msg {
  padding: 10px 12px;
  border-radius: 16px;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.4;
}

.msg .author { font-size: 11px; color: var(--hint); margin-bottom: 3px; }
.msg.client { background: var(--card-bg); border: 1px solid var(--line); align-self: flex-start; }
.msg.admin { background: var(--accent-soft); align-self: flex-end; text-align: right; }

.msg-photo {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 14px;
  margin: 2px 0 6px;
  cursor: pointer;
  object-fit: cover;
}

.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; }
.chat-input-row .btn-primary, .chat-input-row .btn-secondary { margin-top: 0; }

.global-chat-container { padding-bottom: 100px; }
.global-chat-note {
  margin-bottom: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--teal-soft);
  color: var(--hint);
  font-size: 11.5px;
  line-height: 1.4;
  border-left: 3px solid var(--teal);
}

.global-chat-box { max-height: 60vh; padding: 6px 2px; margin-bottom: 12px; }
.global-msg-wrap { display: flex; align-items: flex-end; gap: 7px; width: 100%; }
.global-msg-wrap.own { flex-direction: row-reverse; }
.global-msg-avatar { width: 32px; height: 32px; flex: 0 0 32px; }
.global-msg { margin: 0; }
.global-msg .author { font-weight: 700; }
.global-msg-photo { max-height: 300px; }

.global-mod-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.mod-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 10px;
  padding: 4px 8px;
  cursor: pointer;
}
.mod-btn.danger { color: var(--danger); }

.order-msg-group { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.order-msg-group.client { align-self: flex-start; align-items: flex-start; }
.order-msg-group.admin { align-self: flex-end; align-items: flex-end; }
.order-msg-group.grouped { margin-top: -6px; }
.order-msg-head { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.order-msg-group.admin .order-msg-head { flex-direction: row-reverse; }
.order-msg-head .avatar-circle { width: 22px !important; height: 22px !important; font-size: 10px !important; box-shadow: none; }
.order-msg-name { font-size: 11px; color: var(--hint); font-weight: 600; }
.order-msg-group .msg { margin: 0; max-width: 100%; }
.order-msg-group.admin .msg { text-align: right; }
.author-bio { margin: 2px 0 6px; color: var(--hint); font-size: 10.5px; line-height: 1.3; }

/* ───────────────────────────── УВЕДОМЛЕНИЯ ───────────────────────────── */

.home-notifications { margin-bottom: 16px; }
.notification-empty { padding: 10px 0 14px; font-size: 12.5px; text-align: left; }
.notification-grid { display: grid; gap: 10px; }

.notification-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(242, 181, 68, 0.28);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(242, 181, 68, 0.16), transparent 55%),
    var(--card-bg);
}

.notification-glow { display: none; }
.notification-head { display: flex; align-items: center; gap: 9px; position: relative; z-index: 1; }
.notification-icon { font-size: 16px; color: var(--accent); display: flex; }
.notification-icon svg { width: 16px; height: 16px; }
.notification-title { font-size: 14px; font-weight: 800; }
.notification-text { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--text); }
.notification-meta { margin-top: 10px; color: var(--hint); font-size: 11px; }

.admin-create-card { margin-top: 4px; }
.form-help { margin-top: 6px; color: var(--hint); font-size: 11px; line-height: 1.35; }

.admin-notice-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card-bg);
  margin-bottom: 8px;
  border: 1px solid var(--line);
}
.admin-notice-row.expired { opacity: 0.55; }
.admin-notice-main { min-width: 0; flex: 1; }
.admin-notice-main .list-row-sub { margin-top: 4px; overflow-wrap: anywhere; }

/* ───────────────────────────── ПРОФИЛЬ ─────────────────────────────
   Баннер студии с перфорацией киноплёнки по краям, аватар "выезжает" на баннер. */

.profile-banner {
  position: relative;
  height: 150px;
  margin: 0 -16px;
  background: var(--card-bg);
  overflow: hidden;
}
.profile-banner-photo {
  position: absolute;
  inset: 0;
  background: var(--banner-art) center 40% / cover no-repeat;
  filter: var(--photo-grade);
}

.profile-banner::before,
.profile-banner::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 14px;
  background: repeating-linear-gradient(to bottom, transparent 0 6px, rgba(0, 0, 0, 0.75) 6px 14px, transparent 14px 18px);
  opacity: 0.85;
}
.profile-banner::before { left: 8px; }
.profile-banner::after { right: 8px; }

.profile-banner-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 10, 13, 0.35), rgba(10, 10, 13, 0.1) 40%, var(--bg));
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: -56px;
  padding-bottom: 8px;
  position: relative;
}

.profile-avatar-wrap { position: relative; cursor: pointer; }

.profile-header .avatar-circle {
  width: 104px;
  height: 104px;
  font-size: 40px;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(53, 209, 194, 0.5), 0 14px 30px rgba(0, 0, 0, 0.5);
}

.profile-avatar-badge {
  position: absolute;
  right: -4px;
  bottom: 4px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  transform: rotate(-8deg);
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--bg), 0 6px 14px rgba(242, 181, 68, 0.35);
}
.profile-avatar-badge svg { width: 16px; height: 16px; }

.profile-header .profile-name {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.profile-header .profile-role {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hint);
  font-size: 14px;
}
.profile-handle { color: var(--hint); }
.profile-role-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.profile-edit-icon { display: inline-flex; color: var(--hint); }
.profile-edit-icon svg { width: 14px; height: 14px; }

/* Уровень аккаунта — тайм-лайн с плейхедом вместо обычного прогресс-бара */
.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 10px 0 12px;
}

.level-badge {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: var(--accent-soft);
  border: 1px solid rgba(242, 181, 68, 0.35);
  color: var(--accent);
}
.level-badge-num { font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.level-badge-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }

.level-body { flex: 1; min-width: 0; }
.level-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.level-title { font-weight: 800; font-size: 15px; }
.level-next { color: var(--hint); font-size: 11.5px; white-space: nowrap; }

.level-track {
  position: relative;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--card-bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.level-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b97c16, var(--accent) 60%, var(--accent-2));
  transition: width 0.8s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.level-fill::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px var(--accent-2);
}
.level-hint { margin-top: 8px; font-size: 12px; color: var(--hint); display: flex; align-items: center; gap: 6px; }
.level-hint svg { width: 13px; height: 13px; color: var(--teal); }

.referral-card { margin-bottom: 12px; }
.referral-card label { display: block; margin: 0 0 10px; }
.referral-row { display: flex; gap: 8px; }
.referral-row input { flex: 1; margin: 0; }
.referral-row .btn-secondary { margin-top: 0; }
.referral-code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px dashed rgba(242, 181, 68, 0.45);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.referral-code-display .btn-secondary { margin-top: 0; }
.referral-code-value { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: 0.08em; color: var(--accent); }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 8px;
}
.list-row .list-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-row .list-row-title { font-weight: 600; font-size: 14px; }
.list-row .list-row-sub { font-size: 12px; color: var(--hint); }

.pill-tiny {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-tiny.banned { background: var(--danger-soft); color: var(--danger); }
.pill-tiny.admin { background: var(--teal-soft); color: var(--teal); }
.pill-tiny.main-admin { background: var(--accent-soft); color: var(--accent); }

/* ───────────────────────────── СВЕТЛАЯ ТЕМА ───────────────────────────── */

body.theme-light {
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(217, 150, 28, 0.12), transparent 60%),
    var(--bg);
}
body.theme-light .topbar { background: linear-gradient(to bottom, var(--bg) 70%, transparent); }
body.theme-light .bottom-nav { background: rgba(243, 241, 236, 0.88); }
body.theme-light .tile.art::after { background: linear-gradient(to top, rgba(10, 10, 13, 0.92) 22%, rgba(10, 10, 13, 0.5) 55%, rgba(10, 10, 13, 0.1)); }
body.theme-light .cta-order { background: #1a1712; }

/* ───────────────────────────── ШТОРКА УВЕДОМЛЕНИЙ ───────────────────────────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: sheet-fade 0.2s ease-out;
}
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up 0.28s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-grip { width: 42px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.sheet-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ───────────────────────────── РЕФЕРАЛЫ ───────────────────────────── */

.referral-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--hint);
  margin-top: 8px;
}
.referral-lock svg { width: 14px; height: 14px; flex-shrink: 0; }

.referral-inviter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(242, 181, 68, 0.25);
  font-size: 13px;
}
.referral-inviter strong { color: var(--accent); }

.ref-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  margin-bottom: 8px;
  cursor: pointer;
}
.ref-stat-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ref-stat-count {
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}
.ref-stat-count.zero { background: var(--card-bg-2, var(--line)); color: var(--hint); }
.ref-invitees { padding: 4px 6px 12px 22px; display: none; }
.ref-stat-row.open + .ref-invitees { display: block; }
.ref-invitee {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-left: 2px solid var(--line);
  padding-left: 12px;
  font-size: 13px;
}
.ref-invitee-date { margin-left: auto; font-size: 11px; color: var(--hint); }
body.theme-light .profile-banner-fade { background: linear-gradient(to bottom, rgba(10, 10, 13, 0.2), rgba(10, 10, 13, 0.05) 40%, var(--bg)); }
body.theme-light .bell-count { border-color: var(--bg); }
body.theme-light .tile-icon { background: rgba(20, 20, 26, 0.7); }

/* ───────────────────────────── АНИМАЦИЯ ПОЯВЛЕНИЯ ───────────────────────────── */

.container > * { animation: rise-in 0.45s cubic-bezier(.2,.8,.2,1) both; }
.container > *:nth-child(2) { animation-delay: 0.05s; }
.container > *:nth-child(3) { animation-delay: 0.10s; }
.container > *:nth-child(4) { animation-delay: 0.15s; }
.container > *:nth-child(5) { animation-delay: 0.20s; }
.container > *:nth-child(6) { animation-delay: 0.25s; }
.container > *:nth-child(n+7) { animation-delay: 0.30s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (hover: none) {
  .tile:hover { transform: none; box-shadow: none; }
  .tile:hover.art::before { transform: scale(1.02); }
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   ДОПОЛНЕНИЯ ПОВЕРХ МАКЕТА: AI-помощник, бейдж уровня, редактируемый баннер.
   Используют те же токены (--accent, --card-bg, --hint и т.д.), что и
   остальной дизайн, поэтому переключение темы работает без правок здесь.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── AI-плашка вверху экрана заказа ─── */
.ai-popup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-soft), var(--card-bg) 75%);
  border: 1px solid var(--accent-soft);
  cursor: pointer;
  margin-bottom: 14px;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.ai-popup.show { transform: translateY(0); opacity: 1; }
.ai-popup-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-popup-icon svg { width: 20px; height: 20px; }
.ai-popup-text { flex: 1; min-width: 0; }
.ai-popup-title { font-size: 13.5px; font-weight: 700; font-family: var(--font-display); }
.ai-popup-sub { font-size: 11.5px; color: var(--hint); margin-top: 2px; }
.ai-popup-close {
  border: none; background: transparent;
  color: var(--hint); font-size: 20px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}

/* ─── Экран AI-помощника ─── */
.ai-studio label { display: block; margin: 14px 0 6px; color: var(--hint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.ai-privacy {
  font-size: 11.5px;
  color: var(--hint);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ai-warn {
  font-size: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ai-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ai-tab {
  flex: 1;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  background: var(--card-bg);
  color: var(--hint);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ai-tab.active { background: var(--accent); color: var(--accent-ink); }
.ai-hint { font-size: 12.5px; color: var(--hint); line-height: 1.5; }
.ai-list { margin: 0; padding-left: 18px; font-size: 13px; }
.ai-list li { margin-bottom: 4px; }
.ai-effect { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ai-effect:last-child { border-bottom: none; }
.ai-effect-head { font-weight: 700; font-size: 13.5px; }
.ai-tool { font-size: 10.5px; color: var(--accent); margin-left: 6px; }
.ai-effect-body { font-size: 12.5px; color: var(--hint); margin-top: 3px; }
.ai-cut-meta { font-size: 12px; color: var(--hint); margin-bottom: 6px; }
.ai-clip { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ai-clip:last-child { border-bottom: none; }
.ai-clip-num {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ai-clip-head { font-size: 13px; font-weight: 600; }
.ai-clip-body { font-size: 12px; color: var(--hint); margin-top: 2px; }
.ai-chat-box { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ai-msg {
  align-self: flex-start;
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--card-bg-2);
  font-size: 13px;
  line-height: 1.45;
}
.ai-msg.mine { align-self: flex-end; background: var(--accent-soft); }
.ai-chat-row { display: flex; gap: 8px; align-items: center; }
.ai-chat-row input { flex: 1; }
.ai-chat-row .btn-primary { width: 46px; flex-shrink: 0; }
.ai-export-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ai-export-row .btn-secondary { flex: 1 1 45%; font-size: 12.5px; }
.ai-drive-info { margin-top: 10px; }
.ai-drive-info a { color: var(--accent); }

/* ─── Бейдж уровня в чате ─── */
.lvl-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* ─── Редактируемый баннер профиля: по умолчанию — фирменный градиент ─── */
.profile-banner-gradient .profile-banner-photo {
  background: linear-gradient(135deg, var(--teal) 0%, #2a2a55 45%, var(--accent) 100%);
  filter: none; /* градиент не нуждается в фото-грейде */
}
.profile-banner-actions {
  position: absolute;
  right: 14px; bottom: 14px;
  display: flex; gap: 8px;
  z-index: 2;
}
.profile-banner-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none;
  background: rgba(10, 10, 13, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.profile-banner-btn svg { width: 16px; height: 16px; }
.profile-banner-btn:active { opacity: 0.8; }
