/* Шрифты грузятся неблокирующим <link> в <head> каждой страницы (см. index.html) — НЕ @import
   (render-blocking; в т.ч. тормозил при медленном доступе к Google Fonts). */
/* crs-header.css — стили ЕДИНОЙ шапки Cloud RS. Грузится обычным <link> в <head> КАЖДОЙ страницы
   (статика + /app), чтобы шапка была стилизована из первого кадра, до всякого JS (нет вспышки).
   Разметку шапки рисует СЕРВЕР (app.py render_header) с состоянием сессии из cookie; JS (crs-header.js)
   только навешивает интерактив. Значения — палитра cloud-rs (литералы, не токены). */

crs-header {
  --c-accent: #32e6c0; --c-text: #fff; --c-text-muted: rgba(255, 255, 255, .6); --c-surface: #19212d;
  --r-pill: 999px; --r-card: 1.545rem; --gutter: clamp(1rem, 2.5vw, 3rem); --container: 1600px;
  --header-h: clamp(64px, 5.8vw, 112px); --fs-nav: 1.0625rem;
  --fd: "Space Grotesk", "Inter", system-ui, sans-serif; --fb: "Inter", system-ui, sans-serif;
  display: block; position: sticky; top: 0; z-index: 200;
  background: rgba(11, 14, 20, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
crs-header .crsh-inner { position: relative; width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: var(--gutter); min-height: var(--header-h); display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2.5rem); }
crs-header .crsh-logo { display: inline-flex; align-items: center; gap: .6rem; flex: none; text-decoration: none; }
crs-header .crsh-logo img { width: clamp(38px, 3vw, 58px); height: auto; }
crs-header .crsh-logo b { font-family: var(--fd); font-weight: 800; font-size: clamp(1.05rem, 1.54vw, 1.844rem);
  text-transform: none; letter-spacing: -.02em; white-space: nowrap; color: var(--c-text); }
crs-header .crsh-logo b i { color: var(--c-accent); font-style: normal; }
crs-header .crsh-nav { margin-left: auto; }
crs-header .crsh-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(.5rem, 1.35vw, 1.6rem); list-style: none; margin: 0; padding: 0; }
crs-header .crsh-nav a { color: var(--c-text-muted); text-decoration: none; font-family: var(--fb); font-weight: 700;
  font-size: var(--fs-nav); white-space: nowrap; transition: color .15s ease; cursor: pointer; }
crs-header .crsh-nav a:hover, crs-header .crsh-nav a.is-active { color: var(--c-accent); }
crs-header .crsh-controls { display: flex; align-items: center; gap: clamp(.6rem, 1.1vw, 1.2rem); flex: none; }
crs-header .crsh-lang { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r-pill); flex: none; }
crs-header .crsh-lang button { padding: .35em .75em; background: none; border: 0; border-radius: var(--r-pill); color: var(--c-text-muted);
  font-family: var(--fb); font-weight: 700; font-size: clamp(.75rem, .83vw, 1rem); line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
crs-header .crsh-lang button:hover { color: var(--c-text); }
crs-header .crsh-lang button.is-active { color: #07130f; background: var(--c-accent); }
crs-header .crsh-icon { background: transparent; border: 1px solid rgba(255, 255, 255, .14); color: var(--c-text-muted);
  border-radius: var(--r-pill); width: 34px; height: 34px; flex: none; display: grid; place-items: center; cursor: pointer; text-decoration: none; transition: all .15s; }
crs-header .crsh-icon:hover { color: var(--c-accent); border-color: var(--c-accent); background: rgba(50, 230, 192, .1); }
crs-header .crsh-cell-bell { width: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
crs-header .crsh-cell-auth { min-width: 132px; flex: none; display: flex; align-items: center; justify-content: flex-end; }
crs-header .crsh-btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; padding: .55em 1.6em;
  background: var(--c-accent); color: var(--c-text); font-family: var(--fb); font-weight: 700; font-size: var(--fs-nav); line-height: 1.13;
  border: 0; border-radius: var(--r-pill); box-shadow: 0 0 1.5rem rgba(50, 230, 192, .35); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, filter .2s; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
crs-header .crsh-btn:hover { filter: brightness(1.08); box-shadow: 0 0 2.2rem rgba(50, 230, 192, .55); }
crs-header .crsh-btn:active { transform: translateY(1px); }
crs-header [hidden] { display: none !important; }
crs-header .crsh-invisible { visibility: hidden !important; }
crs-header .crsh-burger { display: none; order: 2; margin-left: auto; width: 44px; height: 44px; padding: 10px 6px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: space-between; }
crs-header .crsh-burger span { display: block; height: 3px; border-radius: 2px; background: var(--c-text); transition: transform .25s, opacity .2s; }
crs-header .crsh-burger.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
crs-header .crsh-burger.is-open span:nth-child(2) { opacity: 0; }
crs-header .crsh-burger.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
@media (max-width: 1200px) {
  crs-header .crsh-burger { display: flex; }
  crs-header .crsh-nav { position: absolute; top: 100%; right: var(--gutter); width: min(280px, calc(100vw - 2 * var(--gutter)));
    margin: 0; padding: .5rem; background: var(--c-surface); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-card);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55); display: none; z-index: 60;
    /* меню скроллится, если не влезает по высоте (иначе нижние пункты, напр. «Админ», недоступны) */
    max-height: calc(100dvh - var(--header-h) - 1rem); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  crs-header .crsh-nav.is-open { display: block; }
  crs-header .crsh-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  crs-header .crsh-nav a { display: block; padding: .85rem 1rem; font-size: 1.0625rem; }
  crs-header .crsh-nav li + li { border-top: 1px solid rgba(255, 255, 255, .07); }
  crs-header .crsh-controls { order: 3; }
}
/* Узкие телефоны (Samsung S21 ≈ 360px): шапка НЕ должна переполняться. Оставляем в строке
   логотип + вход/профиль + бургер; язык и support-иконки уводим в выпадающее меню. */
@media (max-width: 640px) {
  crs-header { --header-h: 58px; }
  crs-header .crsh-inner { gap: .4rem; padding-inline: 12px; }
  crs-header .crsh-logo img { width: 30px; }
  crs-header .crsh-logo b { font-size: 1rem; }
  crs-header .crsh-lang { display: none; }               /* язык авто-определяется по браузеру (navigator.language) */
  crs-header .crsh-icon[data-sup] { display: none; }      /* support-иконки — в support-виджете внизу */
  crs-header .crsh-controls { order: 2; margin-left: auto; gap: .35rem; }
  crs-header .crsh-burger { order: 3; margin-left: .1rem; }
  crs-header .crsh-cell-auth { min-width: 0; }
  crs-header .crsh-btn { padding: .5em .9em; max-width: 38vw; font-size: .9rem; }
  crs-header .crsh-nav { right: 12px; width: min(320px, calc(100vw - 24px)); }
}
/* ── Модалка профиля (в document.body, вне crs-header → нет ловушки containing-block) ── */
.crsh-modal { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: start center;
  padding: clamp(1rem, 6vh, 5rem) 1rem 2rem; background: rgba(0, 0, 0, .55); overflow-y: auto; font-family: "Inter", system-ui, sans-serif; }
.crsh-dialog { width: 100%; max-width: 460px; background: #151d28; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); padding: 16px 16px 18px; }
.crsh-dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.crsh-dtitle { font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 600; font-size: 18px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crsh-x { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  background: transparent; color: rgba(255, 255, 255, .7); font-size: 20px; line-height: 1; cursor: pointer; transition: all .15s; }
.crsh-x:hover { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); }
.crsh-card { background: #19212d; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.crsh-card h3 { margin: 0 0 12px; color: #32e6c0; font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 600; font-size: 15px; }
.crsh-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid rgba(50, 230, 192, .12); }
.crsh-row:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.crsh-row span:first-child { color: rgba(255, 255, 255, .5); }
.crsh-row span:last-child { color: #fff; text-align: right; word-break: break-all; }
.crsh-logout { width: 100%; padding: 11px 16px; border-radius: 999px; border: 0; background: #e5484d; color: #fff;
  font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 600; font-size: 14px; cursor: pointer; transition: filter .15s; }
.crsh-logout:hover { filter: brightness(1.08); }
/* ── Cookie-баннер (в /app; на статике свой в script.js, тот же ключ crs.cookie-consent) ── */
.crsh-cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px 18px; justify-content: center; padding: 16px clamp(1rem, 4vw, 3rem);
  background: rgba(35, 35, 35, .97); border-top: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px);
  font-family: "Inter", system-ui, sans-serif; color: rgba(255, 255, 255, .85); }
.crsh-cookie p { margin: 0; font-size: 13.5px; line-height: 1.5; max-width: 760px; }
.crsh-cookie a { color: #32e6c0; text-decoration: none; }
.crsh-cookie a:hover { text-decoration: underline; }
.crsh-cookie .crsh-ck-btns { display: flex; gap: 10px; flex: none; }
.crsh-cookie button { padding: 9px 18px; border-radius: 999px; font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600; font-size: 13px; cursor: pointer; transition: filter .15s, background .15s, color .15s; white-space: nowrap; }
.crsh-cookie .crsh-ck-ess { background: transparent; border: 1px solid rgba(255, 255, 255, .28); color: #fff; }
.crsh-cookie .crsh-ck-ess:hover { background: rgba(255, 255, 255, .08); }
.crsh-cookie .crsh-ck-all { background: #32e6c0; border: 0; color: #07130f; box-shadow: 0 0 1.2rem rgba(50, 230, 192, .35); }
.crsh-cookie .crsh-ck-all:hover { filter: brightness(1.08); }
