/* ЦРЕ. Система «Федерация»: белое поле, тонкие линии, таблицы как главный жанр.
   Source Serif 4 — заголовки, даты, места, крупные цифры; Golos Text — интерфейс, таблицы, текст.
   Синий #393186 — рубрики, рамки, подвал; красный #E31E25 — только главная кнопка и красный угол.
   Без градиентов, теней и скруглений. Шрифты свои (static/fonts, OFL), кириллица + латиница. */

@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap;
  src: url("../fonts/golos-cyrillic-400.a82793f97f91.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap;
  src: url("../fonts/golos-latin-400.4b88b42724af.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap;
  src: url("../fonts/golos-cyrillic-600.894768c4c711.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap;
  src: url("../fonts/golos-latin-600.2938437410d6.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap;
  src: url("../fonts/source-serif-cyrillic-600.146a6c4f5403.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap;
  src: url("../fonts/source-serif-latin-600.beb0c8d8bee8.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

:root {
  /* Цвет */
  --blue: #393186; --blue-dark: #2a2468; --red: #e31e25; --red-dark: #b8161c;
  --ink: #141414; --ink2: #4a4a52; --ink3: #6e6e78; --grey: #b2b3b3;
  --line: #d9d9dc; --field: #85858f; --mist: #f2f2f3; --slot: #e7e7ea; --slot-line: #cfcfd5;
  --ok: #0e7a3b; --warn: #8a5300; --paper: #fff;
  /* Не меняются с темой: фирменный синий под белым текстом (полоса, подвал, кнопки) и тёмная подложка
     надписей поверх фото. --blue в тёмной теме светлеет — для ссылок и тонких линий на тёмном */
  --brand: #393186; --brand-dark: #2a2468; --scrim: #141414;
  /* Меняются с темой: поле ввода, текст на заливке --ink, линии таблиц и досок, вторая заливка ячеек */
  --field-bg: #fff; --on-ink: #fff; --red-hover: var(--red-dark); --red-ink: var(--red); --line2: #a3a3b0; --line3: #8c8c99; --cell: #f7f7f8;
  /* Старые имена — чтобы частные стили страниц жили на новой системе */
  --muted: var(--ink2); --line-strong: var(--ink); --blue-tint: var(--mist);
  /* Шрифты */
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --head: var(--serif);
  /* Сетка */
  --wrap: 1200px; --gut: 32px; --hdr: 80px;
}
@media (max-width: 900px) { :root { --gut: 16px; --hdr: 64px; } }
/* Тёмная тема (data-theme="dark" на <html>, ставит скрипт в base.html — пока только THEME_PREVIEW_USERS).
   Графит с лёгкой синевой; поверхности чуть светлее фона; синий для текста — светлый оттенок фирменного,
   статусы подобраны под AA на тёмном. Фото, медальные кружки и карты не перекрашиваем */
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #9c95ff; --blue-dark: #c0bbff; --red-dark: #ff6b70; --red-hover: #c8171e; --red-ink: #ff5a60;
  --ink: #ececf1; --ink2: #b6b6c4; --ink3: #9090a4; --grey: #6c6c82;
  --line: #2e2e44; --field: #6b6b84; --mist: #1b1b2a; --slot: #23233a; --slot-line: #34344e;
  --ok: #4cc47e; --warn: #f0a94a; --paper: #12121c;
  --field-bg: #1b1b2a; --on-ink: #12121c; --line2: #46465f; --line3: #56566f; --cell: #1b1b2a;
}
/* На печать (протоколы, бланк согласия) — всегда светлая: тёмная тема печаталась бы светлым текстом по белому */
@media print {
  :root[data-theme="dark"] {
    color-scheme: light;
    --blue: #393186; --blue-dark: #2a2468; --red-dark: #b8161c; --red-hover: #b8161c; --red-ink: #e31e25;
    --ink: #141414; --ink2: #4a4a52; --ink3: #6e6e78; --grey: #b2b3b3;
    --line: #d9d9dc; --field: #85858f; --mist: #f2f2f3; --slot: #e7e7ea; --slot-line: #cfcfd5;
    --ok: #0e7a3b; --warn: #8a5300; --paper: #fff;
    --field-bg: #fff; --on-ink: #fff; --line2: #a3a3b0; --line3: #8c8c99; --cell: #f7f7f8;
  }
  :root[data-theme="dark"] .logo-light { display: block; }
  :root[data-theme="dark"] .logo-dark { display: none; }
}
/* Смена темы кнопкой — короткий переход цветов; при загрузке страницы его нет (класс только на 0,45 с) */
.theme-anim, .theme-anim *:not(.tt, .tt *), .theme-anim *::before, .theme-anim *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* Рамка фокуса — только с клавиатуры: на телефоне после нажатия не остаётся синего квадрата */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Атрибут hidden сильнее любых display у компонентов */
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--paper); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* Номер телефона не рвётся по дефису на две строки */
a[href^="tel:"] { white-space: nowrap; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 .4em; text-transform: none; }
/* Заголовки переносим ровными строками: без одинокого «этап» на последней */
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 60px; line-height: 1.05; letter-spacing: -.015em; }
h2 { font-size: 38px; line-height: 1.1; letter-spacing: -.01em; }
h3 { font-size: 22px; line-height: 1.22; }
h4 { font: 600 18px/1.3 var(--font); margin: 0 0 .4em; }
@media (max-width: 1200px) { h1 { font-size: 50px; } }
@media (max-width: 900px) { h1 { font-size: 36px; line-height: 1.08; } h2 { font-size: 28px; } h3 { font-size: 20px; } }
@media (max-width: 420px) { h1 { font-size: 31px; } }
b, strong { font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--ink2); }
.name-hidden { color: var(--ink2); font-weight: 400; }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.nw { white-space: nowrap; }
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.section { padding-top: 48px; padding-bottom: 56px; }
.page-head + .section { padding-top: 32px; }
@media (max-width: 900px) { .section, .page-head + .section { padding-top: 24px; padding-bottom: 40px; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--ink); color: var(--on-ink); font-weight: 600; }
.skip:focus { top: 8px; color: var(--on-ink); }

/* ---------- Типографика ---------- */
.kicker { font: 600 13px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.kicker .sep { color: var(--grey); margin: 0 8px; }
.kicker .kick, .kicker.kick { color: var(--red-dark); }
.lead { font-size: 19px; line-height: 1.55; color: var(--ink2); }
.cap-s { font: 600 12px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
@media (max-width: 900px) { .lead { font-size: 17px; } }
/* Ссылка-действие: синяя, с линией снизу и стрелкой */
.lnk { font-weight: 600; color: var(--blue); text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 1px; }
.lnk:hover { color: var(--blue-dark); }
.lnk.arr::after, .arr::after { content: "\2009\2192"; font-weight: 400; }

/* ---------- Служебная строка, шапка ---------- */
.util { background: var(--brand); color: #fff; font-size: 13px; }
.util .container { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 36px; }
.util span { opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.util nav { display: flex; gap: 24px; white-space: nowrap; }
.util a { color: #fff; text-decoration: none; }
.util a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 1100px) { .util .ux { display: none; } }
@media (max-width: 900px) { .util { display: none; } }

.topbar { background: var(--paper); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 32px; min-height: var(--hdr); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 56px; width: auto; }
/* Копия сайта без загруженного логотипа («Настройки сайта»): короткое название текстом */
.brand-name { font: 600 28px/1 var(--head); color: var(--brand); letter-spacing: .01em; white-space: nowrap; }
/* В тёмной теме синий логотип (шапка, «О ЦРЕ», главная) подменяется белым, тем же, что в подвале */
.logo-dark, [data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; padding: 6px 0; box-shadow: inset 0 -2px 0 transparent; }
.nav a:hover { color: var(--blue); }
.nav a.active { box-shadow: inset 0 -2px 0 var(--blue); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-search { display: flex; width: 240px; min-width: 0; }
.site-search input[type=search] { height: 40px; min-height: 0; padding: 0 12px; font-size: 14px; border-right: 0; min-width: 0; }
.site-search button { flex: none; height: 40px; padding: 0 12px; border: 1px solid var(--field); border-left: 0; background: var(--field-bg); color: var(--ink2); cursor: pointer; display: grid; place-items: center; }
.site-search button:hover { color: var(--blue); }
.auth { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.auth form { margin: 0; }
/* Профиль в шапке: аватарка (фото карточки или инициалы) и меню */
.uava { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--brand); color: #fff; font: 600 15px/1 var(--font); letter-spacing: .02em; }
.uava img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.uava-lg { width: 48px; height: 48px; font-size: 17px; }
.um-head .uava { display: inline-grid; margin: 0; font: 600 17px/1 var(--font); color: #fff; }  /* не «.nav-drop a span» */
.um-btn { display: inline-flex; align-items: center; gap: 6px; padding: 2px; border: 0; background: none; cursor: pointer; color: var(--ink2); border-radius: 24px; }
.um-btn .uava { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--line); transition: box-shadow .15s; }
.um-btn:hover .uava, .um.open .um-btn .uava { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--blue); }
.um-btn:hover, .um.open .um-btn { color: var(--blue); }
.um-btn svg { transition: transform .15s; }
.um.open .um-btn svg { transform: rotate(180deg); }
.um .um-drop { left: auto; right: 0; width: 280px; margin-top: 10px; white-space: normal; }
.um-head { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.um-head .um-who { min-width: 0; margin: 0; color: var(--ink); }
.um-head .um-who b { display: block; font: 600 15px/1.3 var(--font); overflow-wrap: anywhere; }
.um-head .um-who span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--ink3); }
.um-drop form { margin: 0; }
.um-link { display: block; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer;
  font: 600 15px/1.3 var(--font); color: var(--ink); text-decoration: none; }
.um-head:hover, .um-head:focus-visible, .um-link:hover, .um-link:focus-visible { background: var(--mist); color: var(--blue); }
.um-out { color: var(--ink2); }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 0; position: relative; }
.menu-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.menu-toggle span:nth-child(1) { top: 14px; } .menu-toggle span:nth-child(2) { top: 21px; } .menu-toggle span:nth-child(3) { top: 28px; }
.topbar.open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.open .menu-toggle span:nth-child(2) { opacity: 0; }
.topbar.open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-extra { display: none; }
/* Кнопка темы: солнце с лучами → полумесяц (includes/theme_toggle.html). Цвет — текста шапки, без своей заливки */
.tt { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.tt::before { content: ""; position: absolute; inset: -2px; }
.tt:hover { color: var(--blue); }
.tt svg { overflow: visible; }
.tt-core, .tt-rays, .tt-cut { transform-origin: 12px 12px; transition: transform .5s cubic-bezier(.4, 0, .2, 1), opacity .3s ease; }
.tt-core { transform: scale(.5); }
.tt-cut { transform: translate(7px, -7px); }
.tt-rays { transition-delay: .08s; }
[data-theme="dark"] .tt-core, [data-theme="dark"] .tt-cut { transform: none; }
[data-theme="dark"] .tt-rays { transform: rotate(45deg) scale(.55); opacity: 0; transition-delay: 0s; }
/* Смена темы волной от кнопки (View Transitions): кнопку браузер показывает живой, а не снимком страницы */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(sky-d), ::view-transition-group(sky-m) { animation-duration: 0s; }
::view-transition-old(sky-d), ::view-transition-old(sky-m) { display: none; }
::view-transition-new(sky-d), ::view-transition-new(sky-m) { animation: none; }
.tt-m { display: none; }
@media (prefers-reduced-motion: reduce) { .tt-core, .tt-rays, .tt-cut { transition: none; } }
/* «О «ЦРЕ»» в шапке: кнопка как пункт меню, под ней белая карточка от нижнего края шапки */
.nav { align-self: stretch; align-items: center; }
.nav-more { position: relative; align-self: stretch; display: flex; align-items: center; }
.nav-more-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  font: 600 15px/1.5 var(--font); color: var(--ink); white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.nav-more-btn svg { flex: none; transition: transform .15s; }
.nav-more-btn:hover, .nav-more.open .nav-more-btn { color: var(--blue); }
.nav-more-btn.active { box-shadow: inset 0 -2px 0 var(--blue); }
.nav-more.open .nav-more-btn svg { transform: rotate(180deg); }
.nav-drop { display: none; position: absolute; top: 100%; left: -16px; z-index: 60; width: 300px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--blue); box-shadow: 0 14px 32px rgba(20, 20, 40, .1); }
.nav-more.open .nav-drop, .nav-more:not([data-ready]):hover .nav-drop, .nav-more:not([data-ready]):focus-within .nav-drop { display: block; }
.nav-more.open .nav-drop { animation: nav-drop .14s ease-out; }
@keyframes nav-drop { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .nav-more.open .nav-drop { animation: none; } }
.nav .nav-drop a { display: block; padding: 10px 12px; white-space: normal; box-shadow: none; color: var(--ink); }
.nav-drop a b { display: block; font: 600 15px/1.3 var(--font); }
.nav-drop a span { display: block; margin-top: 2px; font: 400 13px/1.35 var(--font); color: var(--ink3); }
.nav .nav-drop a:hover, .nav .nav-drop a:focus-visible { background: var(--mist); color: var(--blue); }
.nav .nav-drop a.on { box-shadow: inset 3px 0 0 var(--blue); }
.nav .nav-drop a.on b { color: var(--blue); }
.nav-drop a:focus-visible { outline-offset: -2px; }
@media (max-width: 1200px) and (min-width: 901px) {
  .topbar .container { gap: 22px; }
  .nav { gap: 16px; } .nav a, .nav-more-btn { font-size: 14px; }
  .site-search { width: 44px; }
  .site-search input[type=search] { display: none; }
  .site-search button { border-left: 1px solid var(--field); width: 44px; }
}
@media (max-width: 900px) {
  .brand img { height: 44px; }
  .brand-name { font-size: 22px; }
  .menu-toggle { display: block; margin-right: -10px; }
  /* Тема на телефоне — рядом с меню, без раскрытия; кнопка из .tools прячется */
  .tt-m { display: grid; width: 44px; height: 44px; margin-left: auto; }
  .tt-m::before { inset: 0; }
  .tt-m + .menu-toggle { margin-left: 4px; }
  .tools .tt { display: none; }
  .topbar .container { flex-wrap: wrap; gap: 0; }
  .nav, .tools { display: none; width: 100%; }
  .topbar.open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  .topbar.open .nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--line); }
  .topbar.open .nav a { font: 600 22px/1.2 var(--serif); padding: 14px 0; border-bottom: 1px solid var(--line); box-shadow: none; }
  .topbar.open .nav a.active { color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); padding-left: 14px; }
  /* «О «ЦРЕ»» на телефоне — группа меню, раскрывается нажатием */
  .topbar.open .nav-more { display: block; border-bottom: 1px solid var(--line); }
  .topbar.open .nav-more-btn { width: 100%; justify-content: space-between; padding: 14px 0; font: 600 22px/1.2 var(--serif); box-shadow: none; }
  .topbar.open .nav-more-btn.active { color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); padding-left: 14px; }
  .topbar.open .nav-more-btn svg { width: 14px; height: 9px; margin-right: 4px; }
  .nav-drop { position: static; width: auto; padding: 0 0 12px; border: 0; box-shadow: none; }
  .topbar.open .nav .nav-drop a { padding: 10px 14px; border: 0; border-left: 1px solid var(--line); font: inherit; }
  .topbar.open .nav .nav-drop a.on { box-shadow: inset 3px 0 0 var(--blue); }
  .nav-drop a b { font-size: 17px; }
  .topbar.open .tools { display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin: 0; padding: 16px 0 20px; }
  .topbar.open .site-search { width: 100%; }
  .site-search input[type=search] { height: 48px; font-size: 16px; }
  .site-search button { height: 48px; width: 52px; }
  .topbar.open .auth { justify-content: space-between; }
  /* Профиль в меню телефона — без кнопки-аватарки: шапка с именем, «Кабинет» и «Выйти» сразу видны */
  .topbar.open .um { display: block; width: 100%; }
  .um-btn { display: none; }
  .um .um-drop { display: grid; grid-template-columns: 1fr 1fr; position: static; width: auto; margin: 0; padding: 0;
    border: 1px solid var(--line); box-shadow: none; animation: none; }
  .um-head { grid-column: 1 / -1; margin: 0; }
  .um-link { padding: 14px 12px; text-align: center; }
  .um-drop form { border-left: 1px solid var(--line); }
  .topbar.open .auth .btn { flex: 1; }
  .topbar.open .menu-extra { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
  .menu-extra a { color: var(--ink2); }
}

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 24px;
  background: var(--red); color: #fff; border: 1.5px solid var(--red); border-radius: 0;
  font: 600 15px/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--red-hover); border-color: var(--red-hover); color: #fff; text-decoration: none; }
.btn-blue { background: var(--brand); border-color: var(--brand); } .btn-blue:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-line { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-line:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink2); border-color: var(--line); }
.btn-ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-white { background: #fff; color: var(--brand); border-color: #fff; } .btn-white:hover { background: transparent; color: #fff; border-color: #fff; }
.btn-vk { background: var(--paper); color: var(--ink); border-color: var(--ink); } .btn-vk .ico { color: #0077ff; } .btn-vk:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); } .btn-vk:hover .ico { color: var(--on-ink); }
.btn-sm { min-height: 40px; padding: 7px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) { .btn-sm { min-height: 44px; } }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }

/* ---------- Метки ---------- */
.tag { display: inline-block; font: 600 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border: 1px solid currentColor; white-space: nowrap; color: var(--blue); }
.tag.kick { color: var(--red-dark); } .tag.mma, .tag.ink { color: var(--ink); } .tag.grey { color: var(--ink3); }
.tag.fill { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
@media (max-width: 900px) { .chip { min-height: 44px; } .chip-row { margin-bottom: 28px; } }
.corner-sq { display: inline-block; width: 10px; height: 10px; flex: none; vertical-align: 0; background: var(--red); }
.corner-sq.blue { background: var(--blue); }

/* Переключатели (вид спорта, дисциплина, сезон) — вкладки с синей линией */
.switch { display: flex; gap: 0 28px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.switch a { padding: 14px 0 12px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 15px; box-shadow: inset 0 -3px 0 transparent; }
.switch a:hover { color: var(--ink); }
.switch a.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--blue); }
/* Число рядом с названием вкладки; .badge — плашкой (есть запросы), .hot — красной: ждут вашего ответа */
.switch a .count { font-weight: 400; color: var(--muted); margin-left: 4px; }
.switch a .count.badge { display: inline-block; min-width: 20px; padding: 3px 6px; margin-left: 8px; background: var(--ink); color: var(--on-ink); font: 600 12px/14px var(--font); font-variant-numeric: tabular-nums; text-align: center; vertical-align: 1px; }
.switch a .count.hot { background: var(--red); color: #fff; }
/* Вкладки внутри блока страницы (role="tablist", static/js/tabs.js) */
.switch.tabs { margin: 16px 0 24px; }
.switch.tabs a { white-space: nowrap; }
/* Блок с вкладками и панели открываются по якорю (#students) — не под липкой шапкой */
.tabbed, [role="tabpanel"] { scroll-margin-top: calc(var(--hdr) + 16px); }
.tab-lead { margin: 0 0 16px; }
.tab-h { margin: 0 0 4px; font-size: 20px; }
[role="tabpanel"] > .request ~ .tab-h { margin-top: 32px; }
[role="tabpanel"] > .empty { padding-top: 4px; max-width: 640px; }
/* На телефоне — в одну строку с прокруткой, а не одинокая вкладка во второй строке */
@media (max-width: 600px) {
  .switch-scroll { flex-wrap: nowrap; overflow-x: auto; gap: 0 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .switch-scroll::-webkit-scrollbar { display: none; }
  .switch-scroll a { flex: none; white-space: nowrap; }
}
/* Список обновляется без перезагрузки (htmx): пока идёт запрос, старые строки чуть бледнеют */
.live-region { transition: opacity .15s; }
.live-region.htmx-request { opacity: .55; transition-delay: .12s; }
.live-area { scroll-margin-top: calc(var(--hdr) + 16px); }

/* Заголовок блока: заголовок + ссылка, жирная линия снизу */
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; flex-wrap: wrap; }
.head h2 { margin: 0; }
.head > a, .head .more { font-weight: 600; text-decoration: none; border-bottom: 1.5px solid currentColor; white-space: nowrap; }
.head > a::after, .head .more::after { content: "\2009\2192"; font-weight: 400; }
.head-plain { border-bottom: 0; padding-bottom: 0; margin-bottom: 20px; }
.head .sub, .head-sub { font-size: 15px; color: var(--ink2); margin: 6px 0 0; flex-basis: 100%; }

/* Шапка внутренней страницы: белое поле, рубрика, заголовок антиквой */
.page-head { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.page-head .container { padding-top: 36px; padding-bottom: 32px; }
.page-head h1 { margin: 0; max-width: 960px; overflow-wrap: break-word; hyphens: auto; }
.page-head .kicker { margin-bottom: 12px; }
.page-head p { margin: 14px 0 0; color: var(--ink2); font-size: 19px; line-height: 1.5; max-width: 760px; }
.page-head a { color: var(--blue); }
.page-head .facts { margin-top: 20px; }
@media (max-width: 900px) { .page-head .container { padding-top: 20px; padding-bottom: 24px; } .page-head p { font-size: 17px; margin-top: 10px; } }
.crumbs { font-size: 13px; color: var(--ink2); margin-bottom: 14px; }
.crumbs a { color: var(--blue); font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: var(--blue); }

/* ---------- Списки-строки: турниры, клубы ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--line); }
.rowlink { display: grid; grid-template-columns: 96px 1fr auto; gap: 24px; align-items: center; padding: 18px 0; color: inherit; text-decoration: none; }
.rowlink:hover { color: inherit; }
.rowlink:hover .rowtitle { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.rowtitle { font-weight: 600; font-size: 18px; line-height: 1.3; }
.rowmeta { color: var(--ink2); font-size: 14px; margin-top: 4px; }
.date { line-height: 1; font-variant-numeric: lining-nums; }
.date b { display: block; font: 600 32px/1 var(--serif); color: var(--ink); }
.date span { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); letter-spacing: .04em; margin-top: 6px; }
.poster-thumb { width: 96px; aspect-ratio: 1; object-fit: cover; background: var(--slot); }
/* Фирменный фон в миниатюре: кадр сдвинут к рингу или татами */
img.is-brand { object-position: 72% 60%; filter: brightness(.8); }
.kind { font: 600 12px/1.3 var(--font); text-transform: uppercase; color: var(--blue); letter-spacing: .07em; }
.kind.kick { color: var(--red-dark); }
.state { font-size: 14px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.rowlink:hover .btn-line { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 600px) {
  .rowlink { grid-template-columns: 64px 1fr; gap: 14px; padding: 16px 0; }
  .rowlink > .state, .rowlink > .mark, .rowlink > .btn { grid-column: 2; white-space: normal; justify-self: start; }
  .poster-thumb { width: 64px; }
  .date b { font-size: 26px; }
  .rowtitle { font-size: 16px; }
}

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font: 600 12px/1.2 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink2); padding: 12px 14px 12px 0; border-bottom: 2px solid var(--ink); white-space: nowrap; vertical-align: bottom; }
.table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.num, .table th.num { text-align: right; }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table tbody tr:hover { background: var(--mist); }
.table a { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a:hover { color: var(--blue); text-decoration: underline; }
.table a.btn { color: #fff; } .table a.btn-outline { color: var(--ink); }
/* Таблица .fold на телефоне: строка складывается без прокрутки вбок.
   f-main — имя крупно, f-sub — остальные колонки одной мелкой строкой ниже,
   f-lead — место слева (таблице нужен fold-lead), f-end — баллы справа (fold-end).
   f-pre — подпись, видная только в сложенной строке. */
.table .f-pre { display: none; }
@media (max-width: 600px) {
  .table.fold thead { display: none; }
  .table.fold, .table.fold tbody { display: block; }
  .table.fold tbody { border-top: 2px solid var(--ink); }
  .table.fold tr { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table.fold.fold-lead tr { padding-left: 48px; }
  .table.fold.fold-end tr { padding-right: 72px; }
  .table.fold td { display: block; border: 0; padding: 0; text-align: left; }
  .table.fold .f-main { flex: 1 0 100%; font-size: 16px; }
  .table.fold .f-sub { font-size: 13px; color: var(--ink2); }
  .table.fold .f-sub:empty { display: none; }
  .table.fold .f-sub:not(:empty) ~ .f-sub:not(:empty)::before { content: "·"; margin: 0 6px; }
  .table.fold .f-pre { display: inline; }
  .table.fold .f-lead, .table.fold .f-end { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; }
  .table.fold .f-lead { left: 0; width: 40px; }
  .table.fold .f-end { right: 0; justify-content: flex-end; font: 600 20px/1 var(--serif); }
  .table.fold .f-end b { font-weight: inherit; }
  .table.fold .f-act { flex: 1 0 100%; margin-top: 8px; }
  .table.fold .f-act:empty { display: none; }
  .table.fold .f-sub .sub { display: inline; margin: 0 0 0 6px; }
  /* «Ваши бои» (draws/_my_bouts.html): угол рядом с именем, клуб соперника в скобках */
  .table.fold.my-bouts .f-main .sub { display: inline; margin-left: 8px; }
  .table.fold.my-bouts .f-sub .sub { margin: 0; }
}
.my-bouts .corner-sq { margin-right: 4px; }
.place { font: 600 22px/1 var(--serif); color: var(--blue); font-variant-numeric: lining-nums; }
/* Места 1–3 — медальным кружком (золото/серебро/бронза), как в протоколе призёров: рейтинг, профиль спортсмена */
.place-1, .place-2, .place-3 { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid; font: 600 16px/1 var(--font); font-variant-numeric: tabular-nums; vertical-align: middle;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.place-1, .place-2, .place-3 { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .18); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.place-1 { background: radial-gradient(circle at 32% 26%, #fff4c2, #f0c94a 50%, #c99a1e); border-color: #a87d12; color: #4a3700; }
.place-2 { background: radial-gradient(circle at 32% 26%, #fff, #d5d8de 50%, #a2a8b2); border-color: #858b96; color: #2f333b; }
.place-3 { background: radial-gradient(circle at 32% 26%, #fbe3cc, #d39a66 50%, #a86a36); border-color: #8f5627; color: #4a2810; }
/* Сводка медалей: три плитки с медалью на ленте (.medal из ui.css), числом и подложкой цвета металла, как пьедестал рейтинга */
.medal-tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line2); background: var(--paper); }
.medal-tally .mt-item { --tint: #fdf6dd; --edge: #b8871a; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px;
  align-items: center; padding: 12px 16px 12px; border-bottom: 3px solid var(--edge); background: linear-gradient(180deg, var(--tint), var(--paper) 85%); }
.medal-tally .mt-2 { --tint: #f1f2f5; --edge: #8d939e; }
.medal-tally .mt-3 { --tint: #f9ece1; --edge: #9a5f2e; }
.medal-tally .mt-item + .mt-item { border-left: 1px solid var(--line); }
.medal-tally .medal { grid-row: 1 / span 2; width: 40px; padding-top: 15px; }
.medal-tally .medal .medal-r { width: 22px; height: 20px; margin-left: -11px; }
.medal-tally .medal .medal-d { width: 40px; height: 40px; font-size: 19px; }
.medal-tally b { align-self: end; font: 600 30px/1 var(--serif); font-variant-numeric: lining-nums; }
.medal-tally .mt-l { align-self: start; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
/* Ноль медалей этого металла — бесцветная медаль и без подложки, чтобы взгляд шёл на то, что есть */
.medal-tally .mt-zero { --edge: var(--line); background: var(--paper); }
.medal-tally .mt-zero .medal { filter: grayscale(1); opacity: .4; }
.medal-tally .mt-zero b, .medal-tally .mt-zero .mt-l { color: var(--ink3); }
@media (max-width: 600px) {
  .medal-tally .mt-item { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; row-gap: 6px; padding: 12px 4px 10px; }
  .medal-tally .medal { grid-row: auto; width: 34px; padding-top: 13px; }
  .medal-tally .medal .medal-r { width: 20px; height: 18px; margin-left: -10px; }
  .medal-tally .medal .medal-d { width: 34px; height: 34px; font-size: 16px; }
  .medal-tally b { font-size: 26px; }
  .medal-tally .mt-l { margin-top: 0; font-size: 11px; letter-spacing: .02em; }
}
[data-theme="dark"] .medal-tally .mt-1 { --tint: rgba(201, 162, 39, .14); }
[data-theme="dark"] .medal-tally .mt-2 { --tint: rgba(154, 160, 171, .12); }
[data-theme="dark"] .medal-tally .mt-3 { --tint: rgba(184, 122, 69, .14); }
@media print { .medal-tally .mt-item { background: none; } }
/* «без разряда» в списках — тише, чтобы не рябило в каждой строке */
.t-norank { color: var(--ink3); }
.result { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.result.win { color: var(--ok); } .result.loss { color: var(--ink2); } .result.draw { color: var(--ink3); }

/* Метка статуса без заливки */
.mark { font-size: 14px; font-weight: 600; white-space: nowrap; }
.mark.ok { color: var(--ok); } .mark.warn { color: var(--warn); } .mark.off { color: var(--ink3); } .mark.wait { color: var(--blue); }

/* ---------- Формы ---------- */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--ink2); margin-bottom: 6px; }
.field .help { font-size: 13px; color: var(--ink2); margin-top: 6px; }
.field .error { font-size: 13px; color: var(--red-dark); margin-top: 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], input[type=file], select, textarea {
  width: 100%; min-height: 48px; font: 16px/1.3 var(--font); padding: 11px 14px; border: 1px solid var(--field); border-radius: 0; background: var(--field-bg); color: var(--ink); }
input[type=file] { padding: 7px 10px 7px 7px; font-size: 14px; color: var(--ink2); cursor: pointer; }
input[type=file]::file-selector-button { min-height: 32px; margin-right: 12px; padding: 6px 14px; border: 1.5px solid var(--ink); border-radius: 0; background: var(--field-bg); color: var(--ink); font: 600 14px/1.2 var(--font); cursor: pointer; }
input[type=file]:hover::file-selector-button { background: var(--ink); color: var(--on-ink); }
input[type=file]:disabled::file-selector-button { border-color: var(--line); color: var(--ink3); background: transparent; cursor: not-allowed; }
textarea { min-height: 96px; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--field-bg) 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' fill='none' stroke='%234a4a52' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; }
select[multiple] { background-image: none; padding-right: 14px; }
[data-theme="dark"] select:not([multiple]) { 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' fill='none' stroke='%23b6b6c4' stroke-width='1.6'/%3E%3C/svg%3E"); }
input::placeholder, textarea::placeholder { color: var(--ink3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
input:disabled, select:disabled, textarea:disabled { background: var(--mist); color: var(--ink2); border-color: var(--line); cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--blue); margin: 2px 0 0; flex: none; }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.searchbar input, .searchbar select { flex: 1 1 200px; width: auto; min-width: 0; max-width: 100%; }
.panel { border-top: 2px solid var(--ink); padding-top: 24px; }
.box { border: 1px solid var(--line); padding: 24px; }
@media (max-width: 600px) { .box { padding: 18px 16px; } }

/* Сообщения: полоса слева цветом смысла, без заливок-плашек */
.alert { padding: 12px 16px; margin-bottom: 16px; background: var(--mist); border-left: 3px solid var(--blue); }
.alert-success { border-left-color: var(--ok); }
.alert-error { border-left-color: var(--red); color: var(--ink); }
.alert-warning { border-left-color: var(--warn); }
/* Громкое предупреждение (площадки: снятый стоит в бою) — красная плашка */
.alert-loud { background: var(--red); color: #fff; border-left-color: var(--red-dark, #8e1b14); }
.alert-loud b, .alert-loud li { color: #fff; }
/* Напоминание (жеребьёвка: «уже в паре», одноклубники, смешанная пара) — не ошибка */
.alert-info { border-left-color: var(--warn); }
/* Жеребьёвка: страница осталась на месте списка — сообщения поверх, под шапкой (внизу — панель «Составить пару») */
.flash-float { position: fixed; z-index: 60; left: 50%; top: 92px; transform: translateX(-50%); margin: 0;
  width: min(640px, calc(100% - 32px)); padding: 0; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); }
.flash-float .alert { margin: 0; padding-right: 44px; background: var(--paper, var(--mist)); }
.flash-float .alert + .alert { border-top: 1px solid var(--line, rgba(0,0,0,.1)); }
/* Предупреждение и ошибка во всплывашке — сплошным красным, чтобы не пропустить (просьба секретаря) */
.flash-float .alert-warning, .flash-float .alert-error { background: var(--red); color: #fff; border-left-color: var(--red-dark); font-weight: 600; }
.flash-float .alert + .alert-warning, .flash-float .alert + .alert-error { border-top-color: var(--red-dark); }
/* Напоминание во всплывашке — жёлтое, не красное: это не ошибка, но висит, пока не закроют */
.flash-float .alert-info { background: #fff1bf; color: #3d2f00; border-left: 4px solid var(--warn); }
[data-theme="dark"] .flash-float .alert-info { background: #4a3c12; color: #ffe9a8; }
/* Кружок под крестиком: читается и на белой, и на красной плашке */
.flash-close { position: absolute; top: 6px; right: 6px; z-index: 1; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--paper);
  font-size: 24px; line-height: 1; color: var(--ink2); cursor: pointer; }
/* Кабинет тренера, новый спортсмен: такой уже есть на платформе */
.twins p { margin: 6px 0 0; }
.twins ul { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.twins li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.twins li form { margin: 0; }

/* «Открытая рамка» из логотипа: синяя линия с разрывом под рубрику и внизу справа */
.frame { position: relative; border: 2px solid var(--blue); padding: 30px 28px 24px; }
.frame > .cap { position: absolute; top: -12px; left: 18px; font: 600 13px/22px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); background: var(--paper); padding: 0 10px; white-space: nowrap; max-width: calc(100% - 36px); overflow: hidden; text-overflow: ellipsis; }
.frame::after { content: ""; position: absolute; right: 28px; bottom: -2px; width: 56px; height: 2px; background: var(--paper); }
.mist .frame > .cap, .mist .frame::after { background: var(--mist); }
@media (max-width: 600px) { .frame { padding: 26px 18px 20px; } }

/* Факты строкой «подпись — значение» */
.facts { display: flex; flex-wrap: wrap; gap: 14px 36px; }
.facts div span { display: block; font-size: 13px; color: var(--ink2); }
.facts div b { font-size: 17px; font-weight: 600; }
/* Факты таблицей: подпись слева, значение справа (первый экран турнира) */
.factlist { margin: 0; border-top: 2px solid var(--ink); }
.factlist > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.factlist dt { color: var(--ink2); flex: none; }
.factlist dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.factlist .hl dd { color: var(--red-dark); }
.score { display: flex; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.score div { flex: 1; padding: 14px 8px; text-align: center; border-left: 1px solid var(--line); }
.score div:first-child { border-left: 0; }
.score b { display: block; font: 600 38px/1 var(--serif); font-variant-numeric: lining-nums; }
@media (max-width: 600px) { .score { flex-wrap: wrap; } .score div { flex: 1 1 72px; min-width: 0; } .score b { font-size: 28px; } }
.score span { display: block; margin-top: 6px; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
/* Телефон: подписи «взвешено», «оплачено» целым словом, без переноса посреди слова */
@media (max-width: 600px) { .score div { padding: 12px 4px; } .score span { font-size: 11px; letter-spacing: .02em; overflow-wrap: normal; } }

/* ---------- Фото: слоты под афишу, портрет, логотип ---------- */
.slot { position: relative; display: grid; place-items: center; background: var(--slot); border: 1px solid var(--slot-line); overflow: hidden; color: var(--ink3); }
.slot > img.slot-mark { width: 30%; max-width: 96px; height: auto; opacity: .3; }
.slot-poster::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--blue); }
.r169 { aspect-ratio: 16 / 9; } .r32 { aspect-ratio: 3 / 2; } .r45 { aspect-ratio: 4 / 5; } .r11 { aspect-ratio: 1; } .r43 { aspect-ratio: 4 / 3; }
.cover { display: block; width: 100%; object-fit: cover; background: var(--slot); }
.logo-plate { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.logo-plate img { max-width: 80%; max-height: 80%; object-fit: contain; }

.profile { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.profile-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; background: var(--slot); display: grid; place-items: center; }
/* Нет фото — монограмма на фирменной подложке с тонкой штриховкой, знак ЦРЕ и подпись внизу (раньше — серый квадрат с бледным знаком) */
.profile-photo.empty-photo { position: relative; overflow: hidden; border-bottom: 5px solid var(--brand);
  background: repeating-linear-gradient(135deg, rgba(57, 49, 134, .05) 0 1px, transparent 1px 12px), linear-gradient(160deg, #f6f5fc, #dedcf0); }
.empty-photo .ep-initials { font: 600 112px/1 var(--serif); letter-spacing: .01em; color: var(--brand); text-shadow: 0 2px 0 #fff; }
.profile-photo.empty-photo img { position: absolute; left: 18px; bottom: 16px; width: 64px; opacity: .55; }
.empty-photo .ep-note { position: absolute; right: 18px; bottom: 18px; font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.profile-photo.empty-photo:not(:has(.ep-initials)) img { position: static; width: 40%; }
[data-theme="dark"] .profile-photo.empty-photo { border-bottom-color: var(--blue);
  background: repeating-linear-gradient(135deg, rgba(156, 149, 255, .06) 0 1px, transparent 1px 12px), linear-gradient(160deg, #22223a, #17172a); }
[data-theme="dark"] .empty-photo .ep-initials { color: var(--blue); text-shadow: none; }
[data-theme="dark"] .profile-photo.empty-photo img { filter: brightness(0) invert(1); opacity: .35; }
@media (max-width: 900px) {
  .empty-photo .ep-initials { font-size: 64px; }
  .profile-photo.empty-photo img { left: 12px; bottom: 12px; width: 44px; }
  .empty-photo .ep-note { display: none; }
}
@media (max-width: 700px) { .profile { grid-template-columns: 1fr; gap: 20px; } .profile-photo { width: 150px; font-size: 44px; } }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.poster { width: 100%; }
.docs { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--ink2); } .kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv:not(.panel) { grid-template-columns: minmax(0, 1fr); gap: 0; } .kv:not(.panel) dt { font-size: 13px; } .kv:not(.panel) dd { margin-bottom: 12px; } }
.pr-sec { margin-top: 64px; margin-bottom: 4px; }
@media (max-width: 900px) { .pr-sec { margin-top: 48px; } }

/* Карта */
.map { height: 460px; z-index: 0; border: 1px solid var(--line); }
@media (max-width: 600px) { .map { height: 340px; } }

/* ---------- Подвал ---------- */
.footer { background: var(--brand); color: #fff; margin-top: 72px; font-size: 15px; }
.footer .container { padding-top: 56px; padding-bottom: 28px; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr)); gap: 40px; }
.foot-logo { height: 64px; width: auto; }
.footer .foot-name { display: inline-block; font: 600 30px/1 var(--head); letter-spacing: .01em; }
.foot-org { font-size: 14px; color: rgba(255, 255, 255, .86); margin: 16px 0 0; max-width: 340px; }
.footer h2 { font: 600 13px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .72); margin: 0 0 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 5px 0; }
.footer li a { display: inline-flex; align-items: center; gap: 8px; }
.footer .legal { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .25); margin-top: 40px; padding-top: 20px; }
.footer .legal a { color: rgba(255, 255, 255, .82); }
.footer .legal a:hover { color: #fff; }
.footer .legal span { color: rgba(255, 255, 255, .82); }
@media (max-width: 900px) {
  .footer { margin-top: 48px; }
  .footer .container { padding-top: 40px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .foot-grid > div:first-child, .foot-grid > div:last-child { grid-column: 1 / -1; }
  .footer li { padding: 0; } .footer li a { min-height: 44px; }
  .footer .legal { gap: 0 20px; } .footer .legal a { display: inline-flex; align-items: center; min-height: 40px; }
}

.empty { padding: 28px 0; color: var(--ink2); }
.pagination { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 28px; }
/* «Назад»/«Дальше» — кнопками в рамке, как в новостях: на телефоне в них легко попасть */
.pagination > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 16px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; }
.pagination > a:hover { border-color: var(--ink); color: var(--ink); }
.credentials { border: 2px solid var(--blue); padding: 20px; }

@media (max-width: 600px) {
  .hide-sm { display: none; }
  .rating-bar { flex-direction: column; align-items: stretch !important; }
  .rating-bar .switch { width: 100%; }
}
.sub { display: block; font-size: 13px; font-weight: 400; margin-top: 2px; color: var(--ink2); }

/* Запросы на привязку: ждут ответа в кабинете */
.request { border: 1px solid var(--ink); padding: 16px 20px; display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.request + .request { margin-top: 12px; }
.request p { margin: 0; flex: 1 1 320px; min-width: 0; }
.request .row form { margin: 0; }

/* Фотоотчёт турнира и портреты тренеров */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
/* Превью режутся до 3:2, но от верха кадра: головы не обрезаются */
.photo-grid img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 25%; background: var(--slot); }
.photo-grid figure { margin: 0; }
.photo-grid figcaption { margin-top: 6px; font-size: 13px; color: var(--ink2); }
/* «Все фото»: кадры целиком, мозаикой колонками — вертикальные и горизонтальные вперемешку */
.photo-show { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 12px; }
.photo-show .photo-grid { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.photo-cover img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--slot); }
/* Большой кадр вертикальный (класс ставит скрипт в base.html) — целиком, на размытой копии того же кадра */
.photo-cover, .t-photo a { position: relative; display: block; overflow: hidden; }
.photo-cover.is-portrait, .t-photo a.is-portrait { background: var(--scrim); }
.is-portrait::before { content: ""; position: absolute; inset: -24px; background: var(--ph, none) center / cover no-repeat; filter: blur(20px) brightness(.8); }
.photo-cover.is-portrait img, .t-photo a.is-portrait img { position: relative; object-fit: contain; background: transparent; }
@media (min-width: 701px) {
  .photo-show .photo-grid { grid-template-rows: repeat(2, minmax(0, 1fr)); height: 100%; }
  .photo-show .photo-grid a { display: block; min-height: 0; }
  .photo-show .photo-grid img { height: 100%; aspect-ratio: auto; }
}
@media (max-width: 700px) { .photo-show { grid-template-columns: 1fr; gap: 8px; } .photo-show .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } .photo-show .photo-grid img { aspect-ratio: 1; } }
.coach-photo { width: 200px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; background: var(--slot); display: block; }
.coach-avatar { width: 40px; height: 40px; object-fit: cover; vertical-align: middle; margin-right: 10px; background: var(--slot); }

/* 404 и 403 */
.err-page { max-width: 760px; padding-top: 24px; }
.err-page .kicker { margin-bottom: 12px; }
.err-page .lead { max-width: 60ch; margin: 16px 0 28px; }
.err-page .searchbar { margin-bottom: 20px; }

/* Вход, регистрация, пароль, анкета: слева арена с логотипом и тем, что даёт кабинет, справа узкая форма на белом */
.auth-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: calc(100vh - var(--hdr) - 36px); margin-bottom: -72px; }
.auth-side { position: relative; isolation: isolate; color: #fff; background: #0b0d26; }
.auth-side::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 12, 40, .35) 0%, rgba(10, 12, 40, .55) 45%, rgba(10, 12, 40, .9) 100%),
              url("../brand/hero/auth-16x9.3d23751493c7.webp") center 30% / cover no-repeat; }
.auth-side-in { position: sticky; top: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  min-height: calc(100vh - var(--hdr) - 36px); padding: 56px 56px 56px max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); }
.auth-logo { width: 96px; height: auto; }
.auth-side-kicker { font: 600 13px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.auth-side-h { font: 600 56px/1.05 var(--serif); letter-spacing: -.015em; margin: 12px 0 28px; }
.auth-perks { list-style: none; margin: 0; padding: 0; max-width: 470px; border-top: 1px solid rgba(255, 255, 255, .3); }
.auth-perks li { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .3); font-size: 16px; line-height: 1.45; color: rgba(255, 255, 255, .88); }
.auth-perks b { color: #fff; font-weight: 600; }
.auth-side-note { margin: 18px 0 0; font-size: 14px; color: rgba(255, 255, 255, .75); max-width: 470px; }
.auth-pane { display: flex; justify-content: center; align-items: center; padding: 48px 40px; background: var(--paper); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card > h1 { font-size: 40px; margin: 0 0 6px; }
.auth-sub { margin: 0 0 22px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.auth-hint { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink3); }
.auth-hint-top { margin: -8px 0 18px; }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; font-size: 13px; color: var(--ink3); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.auth-form .field label { margin-bottom: 6px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.auth-label-row label { margin: 0 !important; }
.auth-label-row a { font-size: 14px; }
.auth-form .btn { margin-top: 4px; }
.auth-foot { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink2); }
.auth-foot a, .auth-foot .link-btn { font-weight: 600; }
.auth-switch { margin-bottom: 20px; }
.btn-vkfill { background: #0077ff; border-color: #0077ff; color: #fff; }
.btn-vkfill:hover { background: #0062d1; border-color: #0062d1; }
.btn-vkfill .ico { color: #fff; }
@media (max-width: 1100px) {
  .auth-side-in { padding: 48px 40px; }
  .auth-side-h { font-size: 44px; }
  .auth-pane { padding: 40px 32px; }
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-bottom: -72px; }
  .auth-side-in { position: static; min-height: 0; height: 180px; flex-direction: row; justify-content: flex-start; align-items: flex-end; gap: 16px;
    padding: 20px var(--gut); }
  .auth-side::before { background-position: center 25%; }
  .auth-logo { width: 52px; }
  .auth-side-kicker { font-size: 11px; }
  .auth-side-h { font-size: 30px; margin: 4px 0 0; }
  .auth-perks, .auth-side-note { display: none; }
  .auth-pane { display: block; padding: 28px var(--gut) 48px; }
  .auth-card { max-width: 480px; margin: 0 auto; }
  .auth-card > h1 { font-size: 32px; }
}
.cab-h { margin: 10px 0 28px; }

/* Плашка «Подтвердите почту»: текст и кнопка повторной отправки в одну строку, на телефоне — друг под другом */
.verify-note { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.verify-note form { margin: 0; }

/* Выбор роли — первый шаг регистрации и анкеты: крупные карточки вместо незаметных вкладок */
.role-choice { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.role-card { display: block; width: 100%; padding: 18px 20px; border: 2px solid var(--line-strong); border-left: 6px solid var(--blue);
  background: var(--paper); color: var(--ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.role-card:hover, .role-card:focus-visible { border-color: var(--blue); background: var(--mist); }
.role-card b { display: block; font-size: 19px; margin-bottom: 4px; }
.role-card span { display: block; font-size: 14px; line-height: 1.45; color: var(--ink2); }
.role-card-quiet { border-left-color: var(--line-strong); }
.role-card-form { margin: 0; }
.role-back { display: inline-block; margin: 0 0 16px; font-size: 14px; }

/* Поиск над длинным списком (клубы) */
.select-search { margin-bottom: 8px; }
.select-search-note:empty { display: none; }

/* Плашка «Разрешите сообщения от ЦРЕ во ВКонтакте» в кабинете */
.vk-allow { display: flex; gap: 16px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 24px; padding: 16px 20px; background: var(--mist); border-left: 4px solid #0077ff; }
.vk-allow b { display: block; font-size: 17px; margin-bottom: 4px; }
.vk-allow span { display: block; font-size: 14px; line-height: 1.45; color: var(--ink2); max-width: 640px; }
.vk-allow .btn { flex: none; }
@media (max-width: 600px) { .vk-allow .btn { width: 100%; } }
/* Страховка в кабинете */
.insurance { margin-top: 24px; }
.insurance .ins-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.insurance .ins-head h2 { margin: 0; font-size: 22px; }
.insurance .ins-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; }
.insurance .ins-list { list-style: none; margin: 12px 0; padding: 0; }
.insurance .ins-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line, #e3e3ea); }
.insurance .ins-list .sub { flex-basis: 100%; font-size: 14px; }
.insurance .ins-upload { margin-top: 12px; }
.insurance .ins-upload summary { cursor: pointer; font-weight: 600; color: var(--blue, #393186); }
.insurance .ins-upload form { margin-top: 12px; }
.insurance .ins-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* Кабинет тренера: круглое фото слева от имени, текст переносится рядом, а не под фото */
.cab-ath { display: flex; gap: 10px; align-items: flex-start; }
.cab-ath .ava { margin-top: -4px; }
.cab-ath-b { min-width: 0; }
.ins-mark { display: inline-block; margin-top: 4px; font-weight: 400; text-decoration: none; }
/* Длинная причина отказа переносится; нет полиса или он кончается — заметной плашкой */
.insurance .mark, .ins-mark { white-space: normal; overflow-wrap: anywhere; }
.insurance .ins-head .mark.warn, .ins-mark.warn { padding: 2px 8px; background: #fdf1df; border-radius: 4px; font-weight: 600; }
[data-theme="dark"] .insurance .ins-head .mark.warn, [data-theme="dark"] .ins-mark.warn { background: rgba(240, 169, 74, .14); }
.insurance .ins-del { display: inline; margin: 0 0 0 auto; }
@media (max-width: 480px) { .insurance .ins-dates { grid-template-columns: minmax(0, 1fr); } }
