/* Radix Colors (локально): шкалы slate, blue, green, red, amber (light + dark) */
@import url('/css/radix/slate.css');
@import url('/css/radix/blue.css');
@import url('/css/radix/green.css');
@import url('/css/radix/red.css');
@import url('/css/radix/amber.css');
@import url('/css/radix/slate-dark.css');
@import url('/css/radix/blue-dark.css');
@import url('/css/radix/green-dark.css');
@import url('/css/radix/red-dark.css');
@import url('/css/radix/amber-dark.css');

/* Inter (локально, variable font 400-700): latin + cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter/Inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter/Inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ── LUCIDE ICONS ── */
.lucide {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.lucide.lg { width: 1.4em; height: 1.4em; }
.lucide.xl { width: 1.8em; height: 1.8em; }

:root {
  --bg: var(--slate-1);
  --bg2: var(--slate-1);
  --bg3: var(--slate-2);
  --card: var(--slate-1);
  --card2: var(--slate-2);
  --border: var(--slate-6);
  --accent: var(--blue-9);
  --accent-rgb: 0, 145, 255;
  --accent2: var(--blue-10);
  --accent2-rgb: 5, 136, 240;
  --pink: var(--red-9);
  --pink-rgb: 229, 72, 77;
  --danger: var(--red-9);         /* красный для бейджей/ошибок (корзина и т.п.) */
  --yellow: var(--amber-9);
  --yellow-rgb: 255, 184, 0;
  --green: var(--green-9);
  --green-rgb: 48, 164, 108;
  --text: var(--slate-12);
  --text2: var(--slate-11);
  --text3: var(--slate-10);
  --busy: #7A7A92;            /* нейтральный серый для типа «Занято» в календаре */
  --busy-rgb: 122, 122, 146;
  --busy-soft: rgba(var(--busy-rgb), 0.15); /* мягкий фон бейджа «Занято» */
  --status-print: #C44569;    /* статус альбома «Отправлено в печать» */
  --status-done: #A8A8A8;     /* статус альбома «Завершено» */

  /* Цвета типов событий календаря (единый источник — calendarTypeMap в layout.php) */
  --event-shoot: var(--accent); --event-shoot-rgb: var(--accent-rgb);
  --event-shoot-soft: rgba(var(--event-shoot-rgb), 0.13);
  --event-reshoot: var(--pink); --event-reshoot-rgb: var(--pink-rgb);
  --event-reshoot-soft: rgba(var(--event-reshoot-rgb), 0.13);
  --event-delivery: var(--green); --event-delivery-rgb: var(--green-rgb);
  --event-delivery-soft: rgba(var(--event-delivery-rgb), 0.13);
  --event-other: var(--amber-11); --event-other-rgb: var(--yellow-rgb);
  --event-other-soft: rgba(var(--event-other-rgb), 0.13);

  /* профиль: код восстановления и подсказка */
  --recovery-code: #9B8FF7;   /* цвет кода восстановления на профиле */
  --hint-text: #9999BB;       /* цвет подсказки на профиле */
  /* Система скруглений: карточки 12px, кнопки/поля 10px, мелкие элементы 6px */
  --radius-card: 12px;
  --radius-control: 10px;
  --radius-chip: 6px;
  --radius: var(--radius-card);
  --radius-sm: var(--radius-control);
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  /* Отступы: между карточками и внутри карточек, верхний отступ заголовков секций */
  --space-card: 24px;      /* вертикальный отступ между карточками */
  --space-section: 32px;   /* верхний отступ заголовков секций */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Текст на цветных поверхностях */
  --on-accent: #FFFFFF;      /* текст на акцентных кнопках/бейджах */
  --on-badge: #0A0A0F;       /* текст на цветных бейджах (зелёный/жёлтый) */

  /* Панели и оверлеи */
  --nav-bg: rgba(255,255,255,0.95);    /* фон нижней навигации */
  --chat-bar-bg: rgba(18,18,26,0.95);  /* фон панели ввода чата */
  --overlay: rgba(20,20,50,0.55);      /* затемнение оверлея молнии */
  --nav-shadow: rgba(20,20,50,0.06);   /* тень нижней навигации */

  /* Мягкие фоны и границы акцента */
  --accent-soft: rgba(var(--accent-rgb), 0.15);        /* обычная подложка */
  --accent-soft-strong: rgba(var(--accent-rgb), 0.2);  /* насыщенная подложка */
  --accent-border: rgba(var(--accent-rgb), 0.3);

  /* Мягкие фоны и границы розового (ошибки/удаление) */
  --pink-soft: rgba(var(--pink-rgb), 0.15);        /* обычная подложка */
  --pink-soft-faint: rgba(var(--pink-rgb), 0.05);  /* едва заметная подложка (градиенты) */
  --pink-border: rgba(var(--pink-rgb), 0.3);

  /* Мягкие фоны и границы зелёного (успех) */
  --green-soft: rgba(var(--green-rgb), 0.12);       /* обычная подложка */
  --green-soft-faint: rgba(var(--green-rgb), 0.04); /* едва заметная подложка (градиенты) */
  --green-border: rgba(var(--green-rgb), 0.25);

  /* Мягкие фоны жёлтого (молния/предупреждение) */
  --yellow-soft: rgba(var(--yellow-rgb), 0.2);

  /* Календарь: оверлей и тень панели */
  --overlay-sheet: rgba(0,0,0,0.35);   /* затемнение за выезжающей панелью */
  --sheet-shadow: rgba(20,20,50,0.18); /* тень выезжающей панели */
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; font-size: 16px; overflow-x: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── LAYOUT ── */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
}

.page-content {
  flex: 1;
  padding: 0 16px 100px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── TOP BAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.topbar-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  color: var(--on-accent); cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.topbar-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.topbar-right {
  display: flex; align-items: center; gap: 4px;
}
.topbar-shop {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  color: var(--slate-11);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.topbar-shop:hover { color: var(--slate-12); background: var(--slate-3); }
.topbar-shop .lucide { width: 22px; height: 22px; }
.topbar-cart-badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--bg);
  backdrop-filter: none;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px var(--nav-shadow);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  will-change: transform;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px 10px;
  text-decoration: none;
  color: var(--text3);
  font-size: 10px;
  font-weight: 500;
  gap: 4px;
  transition: color 0.2s;
  position: relative;
}
.nav-item .nav-icon { font-size: 22px; line-height: 1; }
.nav-item.active { color: var(--accent); }
.nav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  background: var(--pink);
  color: var(--on-accent); font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: var(--space-card);
  box-shadow: var(--shadow);
}
.card-sm {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: var(--space-card);
  box-shadow: var(--shadow);
}
.card-accent {
  background: var(--card);
  border-color: var(--border);
}
.card-pink {
  background: var(--card);
  border-color: var(--border);
}
.card-green {
  background: var(--card);
  border-color: var(--border);
}

/* ── СВОРАЧИВАЕМЫЕ СЕКЦИИ НАСТРОЕК (details/summary) ── */
.setting-acc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.setting-acc > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  list-style: none;
}
/* убрать дефолтный маркер-треугольник */
.setting-acc > summary::-webkit-details-marker { display: none; }
.setting-acc > summary::marker { content: ""; }
/* шеврон справа, поворот при открытии */
.setting-acc > summary .acc-chevron {
  margin-left: auto;
  transition: transform .2s ease;
  display: inline-flex;
  color: var(--text2);
}
.setting-acc[open] > summary .acc-chevron { transform: rotate(180deg); }
.setting-acc > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* тело секции */
.setting-acc__body { padding: 0 18px 18px; }

@media (prefers-reduced-motion: reduce) {
  .setting-acc > summary .acc-chevron { transition: none; }
}

/* ── SECTION HEADER ── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: var(--space-section) 0 16px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  width: 100%;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
}
.btn-ghost {
  background: transparent;
  color: var(--accent2);
  padding: 8px 12px;
  font-size: 13px;
}
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }
.btn-pink { background: var(--pink); color: var(--on-accent); width: 100%; }

/* ── FORM FIELDS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 44px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-input::placeholder { color: var(--text3); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236C63FF' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ── ROLE PICKER ── */
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.role-btn {
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.role-btn .role-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.role-btn .role-label { font-size: 13px; font-weight: 600; color: var(--text2); }
.role-btn.selected { border-color: var(--accent); background: var(--accent-soft); }
.role-btn.selected .role-label { color: var(--accent); }

/* ── AUTH PAGES ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-logo {
  font-size: 40px;
  margin-bottom: 12px;
}
.auth-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  text-align: center;
}
.auth-sub {
  font-size: 14px;
  color: var(--text2);
  text-align: center;
  margin-bottom: 32px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text2);
}
.auth-switch a { color: var(--accent2); text-decoration: none; font-weight: 600; }

/* ── LIGHTNING OVERLAY ── */
.lightning-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lightning-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  animation: lightning-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes lightning-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.lightning-icon { font-size: 56px; margin-bottom: 12px; display: block; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)}50%{transform:scale(1.1)} }
.lightning-title { font-size: 11px; font-weight: 700; color: var(--yellow); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.lightning-headline { font-size: 20px; font-weight: 800; margin-bottom: 12px; line-height: 1.3; }
.lightning-body { font-size: 14px; color: var(--text2); margin-bottom: 24px; line-height: 1.6; }
.lightning-read-btn {
  background: var(--accent);
  color: var(--on-accent); font-weight: 700;
  border: none; border-radius: var(--radius-control);
  padding: 14px 32px; font-size: 15px;
  cursor: pointer; width: 100%;
  transition: all 0.2s; font-family: var(--font);
}
.lightning-read-btn:hover { transform: translateY(-1px); }

/* ── STATUS BAR ── */
.status-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 4px 0 12px;
}
.status-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1 1 0; min-width: 0; gap: 6px;
  position: relative;
}
.status-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px; right: -6px;
  width: 12px;
  height: 2px;
  background: var(--border);
}
.status-step.done::after { background: var(--accent); }
.step-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; z-index: 1;
  transition: all 0.3s;
}
.status-step.done .step-dot { background: var(--accent); border-color: var(--accent); }
.status-step.current .step-dot { background: var(--card2); border-color: var(--accent); }
.step-label { font-size: 9px; font-weight: 600; color: var(--text3); text-align: center; line-height: 1.2; max-width: 100%; hyphens: auto; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.status-step.done .step-label { color: var(--text2); }
.status-step.current .step-label { color: var(--accent); }

/* ── SHOOT TASKS ── */
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-check.done { background: var(--green); border-color: var(--green); color: var(--on-badge); font-size: 12px; font-weight: 700; }
.task-name { font-size: 14px; flex: 1; }
.task-name.done { color: var(--text3); text-decoration: line-through; }
.task-date { font-size: 11px; color: var(--text3); }

/* ── CALENDAR ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.event-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-control); padding: 10px 14px;
  margin-bottom: 8px;
}
.event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.event-info { flex: 1; }
.event-name { font-size: 13px; font-weight: 600; }
.event-meta { font-size: 11px; color: var(--text3); }
.event-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.event-date-box {
  flex: 0 0 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 0;
  background: var(--bg3);
  border-radius: 10px;
}
.event-date-day { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; }
.event-date-mon { font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.event-school { font-size: 14px; font-weight: 700; color: var(--text); }
.event-time { font-size: 12px; color: var(--text2); margin-top: 3px; }
.event-desc { font-size: 13px; color: var(--text2); margin-top: 5px; line-height: 1.45; }

/* ── NEWS ── */
.news-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.news-item.lightning { border-color: var(--yellow); }
.news-item.lightning::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  background: var(--yellow);
}
.news-item.unread::before { background: var(--accent); }
.news-item:not(.lightning).unread { border-color: var(--accent-border); }
.news-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 6px;
  margin-bottom: 8px;
}
.badge-lightning { background: var(--yellow-soft); color: var(--yellow); }
.badge-normal { background: var(--accent-soft); color: var(--accent2); }
.news-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.news-body { font-size: 13px; color: var(--text2); line-height: 1.6; }
.news-time { font-size: 11px; color: var(--text3); margin-top: 8px; }
.news-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.news-date { font-size: 11px; color: var(--text3); }
.news-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.news-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink);
  flex-shrink: 0; display: inline-block;
}

/* ── LOTTERY ── */
.lottery-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  text-align: center;
  margin-bottom: 12px;
}
.lottery-emoji { font-size: 48px; margin-bottom: 12px; }
.lottery-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.lottery-prize { font-size: 13px; color: var(--accent2); margin-bottom: 4px; }
.lottery-status { font-size: 12px; color: var(--text3); }
.won-badge {
  background: var(--yellow);
  color: var(--on-badge);
  font-size: 11px; font-weight: 800;
  padding: 4px 12px; border-radius: var(--radius-chip);
  display: inline-block; margin-top: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.lottery-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 14px;
}
.ticket-visual {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--card2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-control);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.ticket-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.ticket-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
}
.win-card {
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease, margin .35s ease, padding .35s ease;
}
.win-seen-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  font-family: var(--font);
}

/* ── CHAT BOT ── */
/* Страница чата: фиксируем высоту, чтобы список сообщений скроллился сам,
   а поле ввода оставалось прижато к низу (topbar 65px + bottomnav 60px). */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 125px);
  min-height: 0;
  overflow: hidden;
  padding: 0 16px;
  /* не даём flex-контейнеру растянуть страницу выше экрана,
     иначе внутренний скролл чата не заработает */
  flex: 0 0 auto;
}
.chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.chat-msg {
  max-width: 75%;
  padding: 12px 16px;
  margin-bottom: 8px;
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 14px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 16px 16px 2px 16px;
  margin-left: auto;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg3);
  color: var(--text);
  border-radius: 16px 16px 16px 2px;
  margin-right: auto;
}
.chat-msg.bot em {
  font-style: normal;
  font-weight: 700;
}
.chat-msg .chat-time { font-size: 10px; color: var(--text3); margin-top: 4px; padding: 0 4px; }
.chat-msg.user .chat-time { text-align: right; }
.chat-input-bar {
  position: fixed; bottom: 72px;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  padding: 12px 16px;
  background: var(--bg);
  backdrop-filter: none;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
  will-change: transform;
}
.chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-control);
  padding: 10px 16px;
  min-height: 44px;
  font-size: 14px; color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn,
.chat-send {
  width: 44px; height: 44px;
  background: var(--accent);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
  transition: all 0.2s; flex-shrink: 0;
}
.chat-send-btn:hover,
.chat-send:hover { transform: scale(1.05); }

.chat-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  flex-shrink: 0;
  background: var(--bg);
  z-index: 5;
}
.chat-input-row .chat-input { flex: 1; }

/* .typing-dots — три точки-индикатора набора */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3);
  animation: typingPulse 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ── PROFILE ── */
.profile-header {
  text-align: center;
  padding: 32px 20px 24px;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 12px;
}
.profile-name { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; word-break: break-word; }
.profile-meta { font-size: 13px; color: var(--text2); margin-top: 4px; }
.profile-role { font-size: 13px; color: var(--text2); margin-top: 4px; }
.profile-role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 20px; padding: 4px 14px;
  font-size: 12px; font-weight: 600; color: var(--accent2);
  margin-top: 10px;
}
.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.menu-item:hover { background: var(--card2); }
.menu-icon { font-size: 22px; width: 32px; text-align: center; }
.menu-label { flex: 1; font-size: 15px; font-weight: 500; }
.menu-arrow { color: var(--text3); font-size: 18px; }

/* ── INFO ROWS ── */
.info-row {
  display: flex; justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-label { color: var(--text2); }
.info-value { color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; word-break: break-word; }

/* ── HOME HERO ── */
.home-greeting { padding: 20px 0 0; margin-bottom: 4px; }
.greeting-sub { font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.greeting-name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.event-type-badge {
  font-size: 10px; font-weight: 700;
  padding: 4px 9px; border-radius: 99px;
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* ── QUICK ACCESS ── */
.quick-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 18px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
  font-size: 13px; font-weight: 600;
  position: relative;
  transition: transform .15s, border-color .15s;
}
.quick-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.quick-icon { font-size: 26px; line-height: 1; }
.quick-label { font-size: 13px; font-weight: 600; color: var(--text); }
.quick-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--pink); color: var(--on-accent);
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* Широкая карточка «Галерея класса» — заглушка (без перехода). */
.quick-card-wide {
  background: var(--slate-2);
  opacity: 0.85;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
}
.quick-card-wide:hover {
  background: var(--slate-3);
  border-color: var(--border);
}

/* ── Анкета ученика в профиле ── */
.profile-anketa {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none; color: var(--text);
  margin-bottom: 16px;
}
.profile-anketa__icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  flex-shrink: 0;
}
.profile-anketa__icon .lucide { width: 20px; height: 20px; }
.profile-anketa__body {
  display: flex; flex-direction: column; gap: 2px;
}
.profile-anketa__title {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.profile-anketa__subtitle {
  font-size: 13px; font-weight: 500;
}
.profile-anketa.--locked {
  opacity: 0.75;
}
.profile-anketa.--locked .profile-anketa__icon {
  background: var(--slate-3); color: var(--slate-11);
}
.profile-anketa.--locked .profile-anketa__subtitle {
  color: var(--slate-9);
}
.profile-anketa.--open {
  cursor: pointer;
  border-color: var(--green);
  transition: transform .15s, border-color .15s;
}
.profile-anketa.--open:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}
.profile-anketa.--open .profile-anketa__icon {
  background: var(--green); color: #fff;
}
.profile-anketa.--open .profile-anketa__subtitle {
  color: var(--green);
}
/* Зелёная пульсирующая точка — сигнал, что анкета открыта и ждёт заполнения. */
.profile-anketa__pulse {
  position: absolute; top: 12px; right: 12px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 160, 67, .5);
  animation: anketa-pulse 1.6s infinite;
}
@keyframes anketa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 160, 67, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(46, 160, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 160, 67, 0); }
}

/* ── Три состояния открытой анкеты по прогрессу заполнения ── */
/* 0% — красная рамка, срочно */
.profile-anketa.--urgent {
  border-color: var(--red-9);
  background: var(--red-2);
}
.profile-anketa.--urgent .profile-anketa__icon {
  background: var(--red-9); color: #fff;
}
.profile-anketa.--urgent .profile-anketa__subtitle {
  color: var(--red-11);
  font-weight: 600;
}
/* 1–99% — жёлтый акцент */
.profile-anketa.--in-progress {
  border-color: var(--amber-9);
  background: var(--amber-2);
}
.profile-anketa.--in-progress .profile-anketa__icon {
  background: var(--amber-9); color: #fff;
}
.profile-anketa.--in-progress .profile-anketa__subtitle {
  color: var(--amber-11);
}
/* 100% — зелёный */
.profile-anketa.--done {
  border-color: var(--green-9);
  background: var(--green-2);
}
.profile-anketa.--done .profile-anketa__icon {
  background: var(--green-9); color: #fff;
}
.profile-anketa.--done .profile-anketa__subtitle {
  color: var(--green-11);
  font-weight: 600;
}

/* ── MISC ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text2); font-size: 13px; }
.text-xs { font-size: 11px; color: var(--text3); }
.tag {
  display: inline-block;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-chip); padding: 4px 10px;
  font-size: 12px; font-weight: 500; color: var(--text2);
}
.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--pink-soft); border: 1px solid var(--pink-border); color: var(--pink); }
.alert-success { background: var(--green-soft); border: 1px solid var(--green-border); color: var(--green); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── PROGRESS BAR ── */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.6s ease; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }
.fade-up-1 { animation-delay: 0.05s; opacity: 0; }
.fade-up-2 { animation-delay: 0.1s; opacity: 0; }
.fade-up-3 { animation-delay: 0.15s; opacity: 0; }
.fade-up-4 { animation-delay: 0.2s; opacity: 0; }
.fade-up-5 { animation-delay: 0.25s; opacity: 0; }

@media (min-width: 431px) {
  .bottom-nav, .app-shell, .chat-input-bar { max-width: 430px; }
}

