/* КАДРЫ — общий стиль: тёмный экран, неоновый зелёный, мягкое свечение */
:root {
  color-scheme: dark;

  --bg: #070b0a;
  --bg-2: #0b1110;
  --screen: #0f1517;
  --screen-2: #131b1d;
  --panel: #111a1a;
  --panel-2: #162220;
  --panel-3: #1c2a27;
  --panel-glass: rgba(17, 27, 26, 0.78);

  --line: rgba(140, 255, 190, 0.09);
  --line-2: rgba(140, 255, 190, 0.16);
  --line-strong: rgba(140, 255, 190, 0.28);

  --text: #e4f1ea;
  --text-2: #b3c6bd;
  --muted: #7b9188;
  --muted-2: #56695f;

  --neon: #3ff591;
  --neon-2: #23c873;
  --neon-3: #138a4c;
  --neon-ink: #04140b;
  --neon-soft: rgba(63, 245, 145, 0.1);
  --neon-soft-2: rgba(63, 245, 145, 0.18);
  --glow-sm: 0 0 12px rgba(63, 245, 145, 0.35);
  --glow: 0 0 0 1px rgba(63, 245, 145, 0.55), 0 0 22px rgba(63, 245, 145, 0.32), inset 0 0 14px rgba(63, 245, 145, 0.12);
  --glow-lg: 0 0 0 1px rgba(63, 245, 145, 0.6), 0 0 40px rgba(63, 245, 145, 0.35);

  --amber: #f4c25b;
  --amber-soft: rgba(244, 194, 91, 0.12);
  --coral: #ff7a66;
  --coral-soft: rgba(255, 122, 102, 0.12);
  --blue: #67b8ff;
  --blue-soft: rgba(103, 184, 255, 0.12);
  --violet: #b494ff;
  --violet-soft: rgba(180, 148, 255, 0.12);
  --danger: #ff6b5b;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -16px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -28px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.95);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --transition: 180ms var(--ease);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--neon);
  color: var(--neon-ink);
}

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--xs {
  width: 14px;
  height: 14px;
}

.icon--lg {
  width: 26px;
  height: 26px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.mono,
.mono-code {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.noscript {
  padding: 16px;
  text-align: center;
  background: var(--coral-soft);
  color: var(--coral);
}

/* Фон с сеткой и точками, как на экране-референсе */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(63, 245, 145, 0.08), transparent 70%),
    radial-gradient(40% 40% at 85% 85%, rgba(63, 245, 145, 0.05), transparent 70%),
    linear-gradient(rgba(140, 255, 190, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(140, 255, 190, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--bg);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: var(--glow-sm);
}

/* Бренд: эмблема + название */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

/* Значок целиком: щит с мечом, без рамки и без обрезки */
.brand-mark {
  position: relative;
  height: 44px;
  aspect-ratio: 622 / 1138;
  flex: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(63, 245, 145, 0.4));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--text);
}

.brand-caption {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Кнопки */
.btn {
  --btn-h: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: var(--btn-h);
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition),
    color var(--transition), transform var(--transition), opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.45;
}

.btn--sm {
  --btn-h: 36px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 10px;
  gap: 7px;
}

.btn--lg {
  --btn-h: 54px;
  padding: 0 24px;
  font-size: 16px;
  border-radius: 14px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: var(--btn-h);
  padding: 0;
}

/* Главная кнопка — неоновая рамка со свечением, как на референсе */
.btn--primary {
  color: var(--neon);
  background: linear-gradient(180deg, rgba(63, 245, 145, 0.14), rgba(63, 245, 145, 0.06));
  border-color: rgba(63, 245, 145, 0.85);
  box-shadow: 0 0 18px rgba(63, 245, 145, 0.28), inset 0 0 14px rgba(63, 245, 145, 0.14);
  text-shadow: 0 0 10px rgba(63, 245, 145, 0.45);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(63, 245, 145, 0.22), rgba(63, 245, 145, 0.1));
  box-shadow: 0 0 28px rgba(63, 245, 145, 0.42), inset 0 0 18px rgba(63, 245, 145, 0.2);
}

.btn--primary:disabled {
  box-shadow: none;
  text-shadow: none;
  border-color: var(--line-strong);
  color: var(--muted);
  opacity: 1;
  background: rgba(255, 255, 255, 0.02);
}

/* Залитая неоновая — для главного действия раунда */
.btn--neon {
  color: var(--neon-ink);
  background: linear-gradient(180deg, #6bffab, var(--neon) 55%, var(--neon-2));
  border-color: #8dffc0;
  box-shadow: 0 0 24px rgba(63, 245, 145, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--neon:hover:not(:disabled) {
  box-shadow: 0 0 34px rgba(63, 245, 145, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--neon:disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-2);
  box-shadow: none;
  opacity: 1;
}

.btn--ghost {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-2);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.btn--soft {
  color: var(--neon);
  background: var(--neon-soft);
  border-color: rgba(63, 245, 145, 0.22);
}

.btn--soft:hover:not(:disabled) {
  background: var(--neon-soft-2);
  border-color: rgba(63, 245, 145, 0.4);
}

.btn--danger {
  color: #fff;
  background: linear-gradient(180deg, #ff8676, var(--danger));
  border-color: rgba(255, 140, 125, 0.8);
  box-shadow: 0 0 18px rgba(255, 107, 91, 0.3);
}

.btn--danger-soft {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: rgba(255, 122, 102, 0.28);
}

.btn--danger-soft:hover:not(:disabled) {
  border-color: rgba(255, 122, 102, 0.55);
  background: rgba(255, 122, 102, 0.18);
}

.btn.is-loading .icon {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

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

/* Поля ввода — рамка как на референсе */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

.field-hint {
  font-size: 12.5px;
  color: var(--muted);
}

.input,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(170, 210, 190, 0.28);
  background: rgba(8, 14, 13, 0.7);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:hover,
.textarea:hover {
  border-color: rgba(170, 210, 190, 0.42);
}

.input:focus,
.textarea:focus {
  border-color: rgba(63, 245, 145, 0.8);
  box-shadow: 0 0 0 3px rgba(63, 245, 145, 0.14), 0 0 18px rgba(63, 245, 145, 0.16);
  background: rgba(8, 18, 14, 0.9);
}

.input[type="date"] {
  color-scheme: dark;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group > .icon {
  position: absolute;
  left: 15px;
  color: var(--muted);
  pointer-events: none;
  transition: color var(--transition);
}

.input-group .input {
  padding-left: 46px;
  min-height: 52px;
  font-size: 16px;
}

.input-group:focus-within > .icon {
  color: var(--neon);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 102, 0.35);
  background: var(--coral-soft);
  color: #ffb3a7;
  font-size: 13.5px;
}

.form-error .icon {
  width: 18px;
  height: 18px;
  color: var(--coral);
  margin-top: 1px;
}

/* Статусы */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip .dot,
.dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.chip--approved,
.chip--done {
  color: var(--neon);
  background: var(--neon-soft);
  border-color: rgba(63, 245, 145, 0.3);
}

.chip--approved .dot,
.chip--done .dot {
  box-shadow: var(--glow-sm);
}

.chip--submitted,
.chip--review {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(244, 194, 91, 0.3);
}

.chip--returned {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: rgba(255, 122, 102, 0.32);
}

.chip--in_progress,
.chip--active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(103, 184, 255, 0.3);
}

.chip--new {
  color: var(--violet);
  background: var(--violet-soft);
  border-color: rgba(180, 148, 255, 0.3);
}

.chip--locked,
.chip--not_started {
  color: var(--muted);
}

.chip--applied {
  color: var(--violet);
  background: var(--violet-soft);
  border-color: rgba(180, 148, 255, 0.32);
}

.chip--ready,
.chip--enlisted {
  color: var(--neon-ink);
  background: var(--neon);
  border-color: var(--neon);
}

.chip--rejected,
.chip--blocked {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: rgba(255, 122, 102, 0.32);
}

.chip--pending {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(244, 194, 91, 0.3);
}

/* Аватары */
.avatar {
  --avatar-c: var(--neon);
  width: 40px;
  height: 40px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--avatar-c);
  background: color-mix(in srgb, var(--avatar-c) 12%, #0b1311);
  border: 1px solid color-mix(in srgb, var(--avatar-c) 40%, transparent);
}

.avatar--sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
  border-radius: 9px;
}

.avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
  border-radius: 15px;
}

/* Инициалы ровно по центру квадрата на любом телефоне: системный шрифт, строка
   высотой с букву, а где браузер умеет — обрезка строки по высоте заглавных букв */
.avatar {
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  line-height: 1;
}

.avatar-initials {
  display: block;
  line-height: 1;
  padding-left: 0.02em;
  text-box: trim-both cap alphabetic;
}

.avatar.has-photo {
  overflow: hidden;
  padding: 0;
}

.avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.avatar--0 { --avatar-c: #3ff591; }
.avatar--1 { --avatar-c: #67b8ff; }
.avatar--2 { --avatar-c: #f4c25b; }
.avatar--3 { --avatar-c: #b494ff; }
.avatar--4 { --avatar-c: #4fe3d6; }
.avatar--5 { --avatar-c: #ff8f7a; }

/* Прогресс */
.progress-track {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon-3), var(--neon));
  box-shadow: 0 0 10px rgba(63, 245, 145, 0.55);
  transition: width 600ms var(--ease);
}

/* Сегментная полоска раундов — общая для кандидата и куратора */
.rounds-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}

.rounds-bar > i {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.rounds-bar > i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--fill, 0%);
  border-radius: inherit;
  background: currentColor;
}

.rounds-bar > i.is-done {
  color: var(--neon);
  --fill: 100%;
  box-shadow: 0 0 8px rgba(63, 245, 145, 0.5);
}

.rounds-bar > i.is-current {
  color: var(--neon-2);
}

.rounds-bar > i.is-review {
  color: var(--amber);
  --fill: 100%;
}

.rounds-bar > i.is-returned {
  color: var(--coral);
  --fill: 100%;
}

/* Живой индикатор */
.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: var(--glow-sm);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--neon);
  opacity: 0;
  animation: ping 2.2s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  80%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Переписка */
.thread-empty {
  margin: auto 0;
  padding: 26px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: 88%;
}

.message--own {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.message--own .message-meta {
  justify-content: flex-end;
}

.message-meta strong {
  color: var(--text-2);
  font-weight: 600;
}

.message-meta time {
  font-family: var(--font-mono);
  font-size: 11px;
}

.message-bubble {
  padding: 10px 13px;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message--own .message-bubble {
  border-radius: 14px 14px 4px 14px;
  border-color: rgba(63, 245, 145, 0.4);
  background: linear-gradient(180deg, rgba(63, 245, 145, 0.16), rgba(63, 245, 145, 0.08));
  box-shadow: 0 0 16px rgba(63, 245, 145, 0.08);
}

.system-event {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.system-event > .icon {
  color: var(--neon);
}

.system-event > span:not(.system-event-line) {
  min-width: 0;
}

.system-event time {
  flex: none;
  margin-left: auto;
  font-size: 11px;
  color: var(--muted-2);
}

.system-event-line {
  width: 14px;
  height: 1px;
  flex: none;
  background: var(--line-strong);
}

/* Установка на телефон: кнопки видны, только когда установка возможна
   и приложение ещё не открыто как установленное (класс ставит common.js) */
html:not(.can-install) [data-install] {
  display: none !important;
}

.auth-install {
  margin-top: 14px;
}

.install-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.install-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text);
}

.install-step-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon);
  background: var(--neon-soft);
  box-shadow: inset 0 0 0 1px rgba(63, 245, 145, 0.35);
}

.install-actions {
  display: grid;
  gap: 10px;
}

.install-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.install-note .icon {
  flex: none;
  margin-top: 1px;
}

/* Уведомления на телефон: плашка показывает текст и кнопку своего состояния
   (класс push-* на <html> ставит common.js) */
html:not(.push-off) .push-when-off,
html:not(.push-on) .push-when-on,
html:not(.push-denied) .push-when-denied,
html:not(.push-install) .push-when-install,
html:not(.push-unsupported) .push-when-unsupported,
html:not(.push-off):not(.push-on):not(.push-denied):not(.push-install):not(.push-unsupported) .push-panel,
html:not(.push-off):not(.push-install) .push-panel--banner,
html.push-banner-dismissed .push-panel--banner {
  display: none !important;
}

.push-panel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
}

.push-panel--banner {
  margin-bottom: 14px;
  padding: 14px 44px 14px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 245, 145, 0.3);
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(63, 245, 145, 0.12), transparent 70%),
    var(--panel);
  box-shadow: 0 0 32px -14px rgba(63, 245, 145, 0.45);
}

.push-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--neon);
  background: var(--neon-soft);
  box-shadow: inset 0 0 0 1px rgba(63, 245, 145, 0.3);
}

html.push-on .push-icon {
  color: var(--neon-ink);
  background: var(--neon);
  box-shadow: var(--glow-sm);
}

html.push-denied .push-icon,
html.push-unsupported .push-icon {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.push-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.push-copy strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.push-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.push-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

html.push-denied .push-actions,
html.push-unsupported .push-actions:not(:has(.push-when-unsupported)) {
  display: none;
}

.push-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.push-dismiss:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.profile-push,
.status-push {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}

.status-push {
  margin-bottom: 12px;
}

.admin-push {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}

/* Модальные окна */
.modal {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--screen-2), var(--screen));
  color: var(--text);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(63, 245, 145, 0.08), 0 0 60px -20px rgba(63, 245, 145, 0.25);
  overflow: auto;
}

.modal--wide {
  width: min(640px, calc(100vw - 24px));
}

.modal::backdrop {
  background: rgba(2, 6, 5, 0.8);
}

.modal[open] {
  animation: modal-in 220ms var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.modal-head h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.modal-head .eyebrow {
  margin-bottom: 8px;
}

.modal-head p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.modal-body {
  padding: 18px 22px 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* на телефоне кнопки окна растягиваются и переносятся, а не вылезают за край */
@media (max-width: 420px) {
  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .btn {
    flex: 1 1 auto;
  }
}

/* Уведомления */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 11px 15px;
  border-radius: 13px;
  border: 1px solid rgba(63, 245, 145, 0.45);
  background: rgba(10, 20, 16, 0.94);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 0 24px rgba(63, 245, 145, 0.2), var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 240ms var(--ease);
}

.toast .icon {
  width: 18px;
  height: 18px;
  color: var(--neon);
}

.toast--error {
  border-color: rgba(255, 122, 102, 0.5);
  box-shadow: 0 0 24px rgba(255, 122, 102, 0.18), var(--shadow-md);
}

.toast--error .icon {
  color: var(--coral);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms, transform 200ms;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Заставка при запуске: эмблема целиком на весь экран.
   Свободные края заполняет размытая копия той же картинки.
   Числа совпадают с tools/make-splash.py — по ним сделаны заставки iPhone. */
.boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  background: #030705;
  transition: opacity 420ms var(--ease);
}

.boot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(26px) brightness(0.42);
  transform: scale(1.15);
}

.boot-art {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100vw, 100vh * 736 / 1408);
  height: min(100vh, 100vw * 1408 / 736);
  width: min(100vw, 100dvh * 736 / 1408);
  height: min(100dvh, 100vw * 1408 / 736);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(180deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(180deg, transparent, #000 4%, #000 96%, transparent);
  mask-composite: intersect;
}

.boot-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  width: 120px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.boot-line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--neon);
  box-shadow: var(--glow-sm);
  animation: boot-line 1.1s var(--ease) infinite;
}

@keyframes boot-line {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

/* ===== Экран входа (общий для обоих приложений) ===== */
.auth-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 22px 22px 24px;
  border-radius: 34px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(80% 40% at 50% 0%, rgba(63, 245, 145, 0.09), transparent 70%),
    linear-gradient(180deg, rgba(22, 32, 35, 0.97), rgba(13, 19, 21, 0.98));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

.auth-bar-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.auth-bar-role .icon {
  color: var(--neon);
}

.auth-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--text-2);
  transition: color var(--transition), border-color var(--transition);
}

.auth-switch:hover {
  color: var(--neon);
  border-color: rgba(63, 245, 145, 0.4);
}

.auth-emblem {
  position: relative;
  display: grid;
  place-items: center;
  margin: 18px auto 10px;
  height: clamp(210px, 34vh, 340px);
  aspect-ratio: 622 / 1138;
}

.auth-emblem::before {
  content: "";
  position: absolute;
  inset: 12% -40%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(63, 245, 145, 0.26), transparent);
  animation: emblem-glow 5s ease-in-out infinite;
}

.auth-emblem img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(63, 245, 145, 0.35));
}

/* Цифровой дождь за значком (рисует common.js): шире значка, края растворяются */
[data-rain] {
  position: relative;
}

[data-rain] > img {
  position: relative;
  z-index: 1;
}

.matrix-rain {
  position: absolute;
  top: -8px;
  left: 50%;
  width: var(--rain-width, min(390px, calc(100vw - 36px)));
  height: calc(100% + 16px);
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(ellipse closest-side, rgba(1, 6, 3, 0.85), rgba(1, 6, 3, 0.5) 60%, transparent);
  -webkit-mask-image: radial-gradient(ellipse closest-side, #000 52%, rgba(0, 0, 0, 0.6) 78%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side, #000 52%, rgba(0, 0, 0, 0.6) 78%, transparent 100%);
}

.status-emblem,
.result-icon {
  --rain-width: min(300px, calc(100vw - 72px));
}

/* «Дыхание» значка: пульсирует только мягкое свечение позади (дёшево для любого компьютера) */
@keyframes emblem-glow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.auth-head {
  text-align: center;
  margin-bottom: 20px;
}

.auth-head h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.auth-head p {
  margin: 8px auto 0;
  max-width: 320px;
  color: var(--text-2);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.auth-meta a {
  color: var(--neon);
}

.auth-meta a:hover {
  text-decoration: underline;
}

.demo-box {
  margin-top: 18px;
  padding: 13px;
  border-radius: 16px;
  border: 1px dashed var(--line-strong);
  background: rgba(63, 245, 145, 0.03);
}

.demo-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.demo-box-head .icon {
  width: 15px;
  height: 15px;
  color: var(--neon);
}

.demo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.demo-pill code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon);
}

.demo-pill:hover {
  border-color: rgba(63, 245, 145, 0.5);
  background: var(--neon-soft);
  box-shadow: 0 0 14px rgba(63, 245, 145, 0.15);
}

.auth-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
}

.home-indicator {
  width: 120px;
  height: 4px;
  margin: 20px auto 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 480px) {
  .auth-screen {
    padding: 0;
    place-items: stretch;
  }

  .auth-card {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: calc(16px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
  }

  .home-indicator {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

/* ===== Погоны внутренних званий ===== */
.shoulder-board {
  display: block;
  width: 34px;
  height: auto;
  --pg-field: #2b3230;
  --pg-field-2: #222826;
  --pg-edge: #3d4643;
  --pg-mark: #4c5652;
  --pg-button: #59635f;
  overflow: visible;
}

.shoulder-board .pg-field {
  fill: var(--pg-field);
}

.shoulder-board .pg-edge {
  fill: none;
  stroke: var(--pg-edge);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.shoulder-board .pg-mark,
.shoulder-board .pg-star {
  fill: var(--pg-mark);
}

.shoulder-board .pg-button {
  fill: var(--pg-button);
}

.shoulder-board .pg-button-shine {
  fill: rgba(255, 255, 255, 0.18);
}

/* присвоенное звание: зелёное поле, золотые лычки и звёзды */
.is-earned .shoulder-board,
.shoulder-board.is-earned {
  --pg-field: #1c3a28;
  --pg-edge: #3ff591;
  --pg-mark: #f4c25b;
  --pg-button: #e0ad3a;
  filter: drop-shadow(0 0 7px rgba(244, 194, 91, 0.35));
}

/* буква К/О в номере куратора: обычный шрифт и акцент, чтобы «О» не путали с нулём */
.unit-letter {
  font-family: var(--font-sans);
  font-weight: 800;
  color: var(--amber);
  letter-spacing: 0;
}
