/* Hallmark · shape: landing page · genre: modern-minimal · theme: brand · redesign: restyle · hero: split headline over lede, left-aligned · nav: kept (top bar + burger, visible at rest) · footer: kept (single strip, copyright + city) · signature: kept (framed window on ground, amber LED accent) · states: hover/focus-visible/empty · axes: Onest+JetBrains Mono / amber-on-dark / matte panels · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · dismissed 54 · SectionHead (src/components/Blocks.tsx) рендерит настоящий <h2 class="h-section"> с id — проверка видит JSX-обёртку, а не заголовок в разметке */
/*
 * unistack.org — публичный сайт. Токены, кнопки, поверхности (.mat),
 * BrandMark, меню и бейджи — общие с админкой (web/src/theme.css), здесь
 * только раскладка и типографика лендинга. Цвета не хардкодим.
 */
/*
 * Шрифты сайта — те же Onest и JetBrains Mono, что в админке (имена семейств
 * совпадают с --font-sans/--font-mono в web/src/theme.css), но с
 * font-display: optional вместо swap из @fontsource: браузер не подменяет
 * системный шрифт на загруженный после первой отрисовки, поэтому текст не
 * «дёргается». Нужные начертания грузятся заранее (<link rel="preload"> в
 * Document, список — PRELOAD_FONTS в src/fonts.ts), так что к отрисовке
 * шрифт уже есть.
 */
@font-face {
  font-family: "Onest Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 900;
  src: url(/assets/onest-cyrillic-wght-normal-DayYxulF.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 900;
  src: url(/assets/onest-latin-ext-wght-normal-QAhDxQuo.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 900;
  src: url(/assets/onest-latin-wght-normal-Dun_Rd-l.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 800;
  src: url(/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 800;
  src: url(/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Hallmark · shape: app screen · genre: modern-minimal · theme: brand · redesign: polish · nav: kept (sidebar + topbar + menus) · signature: kept (framed window on ground, amber LED accent) · states: hover/focus-visible/disabled/active/empty · axes: Onest+JetBrains Mono / amber-on-dark / matte panels · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P8 H8 E8 S6 R8 V7 · weakest: S, uppercase micro-labels flattened the hierarchy — sentence-cased, and the focus ring faded in — rings are instant now */
/*
 * unistack cell — design system: matte "instrument panel".
 *
 * Layers:
 *   - Ground (--bg) — the sidebar sits directly on it.
 *   - Window (--window) — one framed panel holding the topbar and content.
 *   - Surfaces (.mat, menus, modals) — opaque, separated by 1px hairlines and
 *     a 1px top highlight. No blur, no colour washes, no specular rims; blur
 *     is reserved for the modal backdrop only.
 *
 * Accent is a server-LED amber, used sparingly: primary action, active nav,
 * focus. Status colours (ok / warn / danger) are separate from it.
 * Type: Onest (UI) + JetBrains Mono (IDs, IPs, metrics), self-hosted via
 * @fontsource-variable (imported in main.tsx) — the cell may run offline.
 *
 * Legacy class names (.glass, .mat, .mat-thick, .simplebar-glass) and token
 * names (--glass-*, --mat-*) are kept so page markup and CSS did not need to
 * change; they now resolve to matte surfaces.
 *
 * Theme: [data-theme="light|dark"] on <html>, set before the bundle loads by
 * the inline script in index.html and kept in sync by ThemeContext. All
 * colours live here as tokens — components never hardcode them.
 */

/* --- Theme-independent tokens -------------------------------------------- */

:root {
  --font-sans: "Onest Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Small, strict radii. Inner = outer - padding where nested. */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-pill: 999px;

  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.25, 0.9, 0.3, 1);
  --dur-1: 0.12s;
  --dur-2: 0.18s;
  --dur-3: 0.26s;

  /* Only the modal backdrop blurs. The others stay as no-op hooks. */
  --blur: none;
  --blur-soft: none;
  --blur-backdrop: blur(3px);
  --blur-edge: none;

  --shell-gap: 8px;

  /* The VM console screen is dark in both themes — it is the guest's screen,
     not a surface of the UI. Tinted near-black, never #000. */
  --console-screen: #0b0a09;
  --console-overlay: rgba(10, 9, 8, 0.66);
  --console-ink: #f2efe9;

  /* Opaque end of a fade mask — only its alpha matters, so one tinted value for both themes. */
  --mask-opaque: #0f0e0d;
}

:root[data-theme="light"] {
  color-scheme: light;

  /* Ground + the framed window. */
  --bg: #efeeeb;
  --window: #f8f8f6;
  --sunken: #ebeae6;

  /* Surfaces (legacy names). */
  --glass-clear: #f4f3f0;
  --glass-regular: #ffffff;
  --glass-thick: #ffffff;
  --glass-edge: rgba(28, 24, 18, 0.085);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-shade: transparent;
  --glass-spec-1: transparent;
  --glass-spec-2: transparent;
  --mat-regular: #ffffff;
  --mat-thick: #ffffff;
  --mat-edge: rgba(28, 24, 18, 0.085);
  --solid-1: #f4f3f0;
  --solid-2: #ffffff;

  /* Text / fill hierarchy (secondary + tertiary ≥ 4.5:1 on white). */
  --label: #19181a;
  --secondary-label: #57554f;
  --tertiary-label: #6e6b65;
  --fill: rgba(28, 24, 18, 0.05);
  --secondary-fill: rgba(28, 24, 18, 0.028);
  --separator: rgba(28, 24, 18, 0.085);

  /* Controls. Fields are sunken; buttons are raised surfaces. */
  --control-bg: #ffffff;
  --control-bg-hover: #f4f3f0;
  --control-edge: rgba(28, 24, 18, 0.16);
  /* Fields get a solid edge ≥3:1 against every surface they sit on. */
  --field-edge: #6f6c66;
  --field-bg: #ebeae6;
  --field-inset: inset 0 1px 1px rgba(28, 24, 18, 0.04);
  --kbd-bg: #f1f0ec;
  --kbd-edge: rgba(28, 24, 18, 0.18);

  /* Accent + status. */
  --accent: #c0510b;
  --accent-press: #a94608;
  --accent-text: #ffffff;
  --accent-hi: rgba(255, 255, 255, 0.2);
  --accent-shadow: 0 1px 2px rgba(28, 24, 18, 0.18);
  --danger: #c22f2a;
  --danger-text: #ffffff;
  --ok: #17784b;
  --warn: #8f6500;
  --info: #2f63a6;
  --violet: #7a4cc2;
  --brand-accent: #d93a34;
  --brand-base: #4a4a48;
  --tint-accent: rgba(192, 81, 11, 0.1);
  --tint-danger: rgba(194, 47, 42, 0.09);
  --ring: rgba(192, 81, 11, 0.2);

  --scroll-track: rgba(28, 24, 18, 0.05);
  --scroll-thumb: rgba(28, 24, 18, 0.2);
  --scroll-thumb-hover: rgba(28, 24, 18, 0.34);

  /* Floating surfaces (popups). */
  --surface: #ffffff;
  --surface-border: rgba(28, 24, 18, 0.16);

  /* Elevation: short and dark, only for things that float. */
  --shadow-1: 0 1px 1px rgba(28, 24, 18, 0.04);
  --shadow-2: 0 1px 2px rgba(28, 24, 18, 0.06), 0 8px 20px rgba(28, 24, 18, 0.08);
  --shadow-float: 0 1px 2px rgba(28, 24, 18, 0.06), 0 14px 36px rgba(28, 24, 18, 0.14);
  --shadow-window: 0 1px 2px rgba(28, 24, 18, 0.05), 0 8px 28px rgba(28, 24, 18, 0.06);
  --surface-shadow: var(--shadow-float);
  --backdrop-dim: rgba(30, 27, 22, 0.22);
  --grain: 0;

  /* Chart palette — literal colours (canvas can't resolve var()/color-mix). */
  --chart-1: #c0510b;
  --chart-2: #2f63a6;
  --chart-3: #17784b;
  --chart-4: #c22f2a;
  --chart-label: #6e6b65;
  --chart-grid: rgba(28, 24, 18, 0.09);
  --chart-tooltip-bg: #ffffff;
  --chart-tooltip-text: #19181a;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #080809;
  --window: #111113;
  --sunken: #0c0c0e;

  --glass-clear: #1d1d20;
  --glass-regular: #17171a;
  --glass-thick: #1a1a1d;
  --glass-edge: rgba(255, 255, 255, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.055);
  --glass-shade: transparent;
  --glass-spec-1: transparent;
  --glass-spec-2: transparent;
  --mat-regular: #17171a;
  --mat-thick: #1a1a1d;
  --mat-edge: rgba(255, 255, 255, 0.07);
  --solid-1: #17171a;
  --solid-2: #1d1d20;

  --label: #ecebe8;
  --secondary-label: #a6a39d;
  --tertiary-label: #8a8781;
  --fill: rgba(255, 255, 255, 0.055);
  --secondary-fill: rgba(255, 255, 255, 0.03);
  --separator: rgba(255, 255, 255, 0.07);

  --control-bg: #1d1d20;
  --control-bg-hover: #242428;
  --control-edge: rgba(255, 255, 255, 0.13);
  --field-edge: #6b6b6d;
  --field-bg: #0c0c0e;
  --field-inset: inset 0 1px 1px rgba(0, 0, 0, 0.3);
  --kbd-bg: #232327;
  --kbd-edge: rgba(255, 255, 255, 0.14);

  --accent: #ff9447;
  --accent-press: #ffa766;
  /* Dark ink on the amber LED — kept clear of --bg so the label reads as ink,
     not as a hole punched in the fill. */
  --accent-text: #2b1706;
  --accent-hi: rgba(255, 255, 255, 0.28);
  --accent-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --danger: #ff6d61;
  --danger-text: #1f0605;
  --ok: #52c78f;
  --warn: #e6c04f;
  --info: #7aa7e6;
  --violet: #b394f0;
  --brand-accent: #ff5a4e;
  --brand-base: #6e6b65;
  --tint-accent: rgba(255, 148, 71, 0.13);
  --tint-danger: rgba(255, 109, 97, 0.12);
  --ring: rgba(255, 148, 71, 0.3);

  --scroll-track: rgba(255, 255, 255, 0.05);
  --scroll-thumb: rgba(255, 255, 255, 0.2);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.34);

  --surface: #1a1a1d;
  --surface-border: rgba(255, 255, 255, 0.13);

  --shadow-1: 0 1px 1px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-float: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 18px 50px rgba(0, 0, 0, 0.6);
  --shadow-window: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 20px 60px rgba(0, 0, 0, 0.5);
  --surface-shadow: var(--shadow-float);
  --backdrop-dim: rgba(0, 0, 0, 0.55);
  --grain: 0.035;

  --chart-1: #ff9447;
  --chart-2: #7aa7e6;
  --chart-3: #52c78f;
  --chart-4: #ff6d61;
  --chart-label: #8a8781;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --chart-tooltip-bg: #1a1a1d;
  --chart-tooltip-text: #ecebe8;
}

/* Legacy alias: older page CSS refers to --glass-bg. */
:root { --glass-bg: var(--glass-regular); }

* { box-sizing: border-box; }

html, body, #root { height: 100%; }

body {
  margin: 0;
  color: var(--label);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur-3) ease, color var(--dur-2) ease;
}
/* Film grain over the dark ground only (--grain is 0 in light). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

code, kbd, pre, .mono { font-family: var(--font-mono); }
.mono { font-size: 0.92em; letter-spacing: -0.01em; }

/* Keyboard hint chip. */
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--secondary-label);
  background: var(--kbd-bg);
  border: 1px solid var(--kbd-edge);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
}

/* --- Focus ---------------------------------------------------------------- */

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

/* --- Surfaces ------------------------------------------------------------ */

/* Raised panel (legacy name .glass). */
.glass,
.glass-thick {
  position: relative;
  background: var(--glass-regular);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-1);
}
.glass-thick { background: var(--glass-thick); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float); }

/* Content card / table container. */
.mat {
  position: relative;
  background: var(--mat-regular);
  border: 1px solid var(--mat-edge);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-1);
}

/* Focused surface (modals). */
.mat-thick { background: var(--mat-thick); }

/* --- Breadcrumbs (inline with the page title) ---------------------------- */

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.breadcrumb-link {
  color: var(--tertiary-label);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r-xs);
  transition: color var(--dur-1) ease;
}
@media (hover: hover) {
  .breadcrumb-link:hover { color: var(--label); }
}
.breadcrumb-sep { color: var(--tertiary-label); font-size: 12px; opacity: 0.7; }

/* --- Typography helpers -------------------------------------------------- */

h1, h2, h3 { color: var(--label); font-weight: 650; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: 20px; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 14px; margin: 0; }

.dim { color: var(--secondary-label); }
.faint { color: var(--tertiary-label); }

/* Micro-label for sections and table heads. Sentence case — uppercase +
   tracking flattened the hierarchy against 11px body text. */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--tertiary-label);
}

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

/* --- Brand mark (sidebar + login): isometric cube ------------------------ */

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: block;
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--control-edge);
  background: var(--control-bg);
  color: var(--label);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-1);
  transition:
    background var(--dur-1) ease,
    border-color var(--dur-1) ease,
    color var(--dur-1) ease,
    opacity var(--dur-1) ease;
}
@media (hover: hover) {
  .btn:hover { background: var(--control-bg-hover); }
  /* Accent frame on hover, like .input/.select and .segmented-item. Primary
     (accent fill) and ghost (frameless) buttons keep their own hover. */
  .btn:not(.btn-primary):not(.btn-ghost):not(:disabled):hover { border-color: var(--accent); }
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-text);
  box-shadow: inset 0 1px 0 var(--accent-hi), var(--accent-shadow);
}
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent-press); }
}
.btn kbd { height: 18px; min-width: 18px; font-size: 10.5px; margin-right: -4px; }
.btn-primary kbd { background: transparent; border-color: var(--accent-hi); color: inherit; opacity: 0.85; }
/* Touch screens have no keyboard to hint at. */
@media (hover: none) {
  .btn kbd { display: none; }
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--secondary-label);
}
@media (hover: hover) {
  .btn-ghost:hover { background: var(--fill); color: var(--label); }
}

.btn-danger { color: var(--danger); }
@media (hover: hover) {
  .btn-danger:hover { background: var(--tint-danger); }
}

/* Small table-row action buttons. */
.btn-sm {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 12px;
}

/* --- Segmented control (theme switch и подобные) ------------------------- */

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-sm);
  background: var(--sunken);
  border: 1px solid var(--separator);
}
.segmented-item {
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--tertiary-label);
  cursor: pointer;
  transition: background var(--dur-1) ease, color var(--dur-1) ease, border-color var(--dur-1) ease;
}
.segmented-item[aria-checked="true"] {
  background: var(--control-bg);
  border-color: var(--separator);
  color: var(--label);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-1);
}
/* Hover: accent frame only on the hovered item (like .input/.select), the
   selected one included — after the checked rule so it wins. */
@media (hover: hover) {
  .segmented-item:hover { color: var(--label); border-color: var(--accent); }
}

/* --- Forms --------------------------------------------------------------- */

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--secondary-label);
  margin: 0 0 6px;
}

.input, .select {
  width: 100%;
  min-height: 32px;
  font: inherit;
  font-size: 13px;
  color: var(--label);
  background: var(--field-bg);
  border: 1px solid var(--field-edge);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  box-shadow: var(--field-inset);
  /* Transparent outline stays visible in forced-colors mode. */
  outline: 2px solid transparent;
  outline-offset: 0;
  /* background-color only: the .select arrow is a background-image and must
     not be reset or animated (it used to vanish on focus and slide in from
     the left on blur). box-shadow is not transitioned: the focus ring must
     appear instantly. */
  transition: border-color var(--dur-1) ease, background-color var(--dur-1) ease;
}
.input::placeholder { color: var(--tertiary-label); }
.input:focus-visible, .select:focus-visible {
  outline-color: transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  background-color: var(--control-bg);
}
/* Hover highlight: the same accent border the date/time "from"/"to" fields
   get on hover (see .dp-field:hover), so every input/selector reads as
   interactive before focus. */
@media (hover: hover) {
  .input:hover, .select:hover {
    border-color: var(--accent);
  }
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--tertiary-label) 50%),
    linear-gradient(135deg, var(--tertiary-label) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 11px) 55%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

/* --- Status badges: a dot with a soft halo + plain text ----------------- */
/* Variants only set --tone (page CSS adds its own statuses the same way). */

.badge {
  --tone: var(--tertiary-label);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--label);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--tone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent);
}
.badge-active, .badge-online { --tone: var(--ok); }
.badge-error, .badge-revoked { --tone: var(--danger); }
.badge-creating, .badge-deleting { --tone: var(--warn); }
.badge-creating::before, .badge-deleting::before { animation: blink 1.1s ease-in-out infinite; }
.badge-blocked { --tone: var(--danger); }
/* Volume statuses (pages render `badge badge-<status>` directly). */
.badge-available, .badge-attached { --tone: var(--ok); }
.badge-attaching, .badge-detaching, .badge-resizing, .badge-restoring, .badge-migrating { --tone: var(--warn); }
.badge-attaching::before, .badge-detaching::before, .badge-resizing::before, .badge-restoring::before, .badge-migrating::before { animation: blink 1.1s ease-in-out infinite; }
/* Status badge + its reason (status_reason), see components/StatusBadge. */
.status-badge { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; max-width: 100%; }
.status-reason {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 340px;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.status-reason svg { flex: none; }
.status-reason-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes blink { 50% { opacity: 0.3; } }

/* --- Data table (shared by every list page) ------------------------------ */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--separator);
}
.data-table th {
  color: var(--tertiary-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding-top: 9px;
  padding-bottom: 9px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody td { transition: background var(--dur-1) ease; }
.data-table tr.row-clickable { cursor: pointer; }
@media (hover: hover) {
  .data-table tbody tr:hover td { background: var(--secondary-fill); }
}

/* --- Sortable column headers (components/SortHeader) ---------------------- */

.th-sortable { padding: 0; }
.th-sortable.th-sort-right { text-align: right; }
.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.th-sort-right .th-sort-btn { justify-content: flex-end; }
.th-sort-arrow {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--tertiary-label);
  transition: color var(--dur-1) ease;
}
@media (hover: hover) {
  .th-sort-btn:hover { color: var(--label); }
  .th-sort-btn:hover .th-sort-arrow { color: var(--secondary-label); }
}
.th-sort-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.th-sort-active, .th-sort-active .th-sort-btn { color: var(--accent); }
.th-sort-active .th-sort-arrow { color: var(--accent); }

/* --- List search + filter result (pages/*Page.tsx toolbars) -------------- */

.list-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.list-search { min-width: 200px; }
.list-sort { display: inline-flex; align-items: center; gap: 6px; }
.list-sort-dir { padding: 6px 10px; font-size: 11px; line-height: 1; }
.list-search-empty {
  padding: 18px 14px;
  color: var(--secondary-label);
  font-size: 13.5px;
  text-align: center;
}

/* --- Page header, tabs --------------------------------------------------- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Tabs: text with a 2px underline on the active one, over a hairline. */
.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 10px;
  /* Hairline as an inset shadow (not a border) so the active underline sits
     inside the box: overflow-x:auto would otherwise add a 1px vertical scroll. */
  box-shadow: inset 0 -1px 0 var(--separator);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 5px 10px 7px;
  border: none;
  background: transparent;
  color: var(--tertiary-label);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-1) ease;
}
.tab.active { color: var(--label); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--label);
}
@media (hover: hover) {
  .tab:not(.active):hover { color: var(--label); }
}

/* --- Loading skeleton ---------------------------------------------------- */

.skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
}
.skeleton-line {
  display: block;
  height: 10px;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--fill) 25%, var(--secondary-fill) 50%, var(--fill) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton-line--title { width: 45%; height: 14px; }
.skeleton-line--short { width: 30%; }
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  min-height: 140px;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* --- Toasts -------------------------------------------------------------- */

.toast-region {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float);
  color: var(--label);
  font-size: 13px;
  font-weight: 500;
  cursor: default;
  animation: toast-in var(--dur-3) var(--ease-out);
}
.toast::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.toast--error::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}
.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--tertiary-label);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
@media (hover: hover) {
  .toast-close:hover { background: var(--fill); color: var(--label); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Modal --------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-dim);
  -webkit-backdrop-filter: var(--blur-backdrop);
  backdrop-filter: var(--blur-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
  animation: fade-in var(--dur-2) ease;
}
.modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 20px;
  width: 420px;
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float);
  animation: modal-in var(--dur-2) var(--ease-out);
}
/* Forms with lists (disk pickers) need room for size · type · model · state. */
.modal--wide { width: 560px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--separator);
}
.modal-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

/* Phones: modals become bottom sheets. */
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: calc(100dvh - 48px);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 20px 16px max(16px, env(safe-area-inset-bottom));
    animation: sheet-in var(--dur-3) var(--ease-out);
  }
}
/* Narrow (rail / phone): wide tables scroll horizontally; the actions column
   stays reachable. */
@media (max-width: 900px) {
  .data-table th:last-child,
  .data-table td:last-child {
    position: sticky;
    right: 0;
    background: var(--mat-regular);
  }
}
@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* --- Menus (row actions, profile, language) ------------------------------ */
/* One popup recipe for every dropdown. */

.menu-surface,
.row-menu-dropdown,
.profile-menu,
.topbar-menu-dropdown {
  padding: 5px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 20;
  transform-origin: top right;
  animation: menu-in var(--dur-2) var(--ease-out);
}

.menu-item,
.row-menu-item,
.profile-menu-item {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: none;
  /* concentric: menu radius - padding (5) */
  border-radius: calc(var(--r-lg) - 5px);
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1) ease, color var(--dur-1) ease;
}
@media (hover: hover) {
  .menu-item:hover:not(:disabled),
  .row-menu-item:hover:not(:disabled),
  .profile-menu-item:hover:not([aria-disabled="true"]) {
    background: var(--fill);
  }
}
.menu-item:disabled,
.row-menu-item:disabled { opacity: 0.42; cursor: default; }
/* Пункт с пояснением (kebab-меню хоста): подпись + короткая строка ниже. */
.row-menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.row-menu-item-hint {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--secondary-label);
}
/* Keyboard navigation highlights the item like the pointer does. */
.menu-item:focus-visible,
.row-menu-item:focus-visible {
  outline: none;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.menu-item--danger,
.row-menu-item--danger,
.profile-menu-item--danger { color: var(--danger); }
@media (hover: hover) {
  .menu-item--danger:hover:not(:disabled),
  .row-menu-item--danger:hover:not(:disabled),
  .profile-menu-item--danger:hover { background: var(--tint-danger); }
}
.row-menu-item--danger:focus-visible { background: var(--tint-danger); }

/* --- Row action menu (kebab) --------------------------------------------- */

.row-menu { position: relative; display: inline-block; }
.row-menu-trigger {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--tertiary-label);
  cursor: pointer;
  transition: background var(--dur-1) ease, border-color var(--dur-1) ease, color var(--dur-1) ease;
}
@media (hover: hover) {
  /* Accent frame on hover, like .btn / .input / .segmented-item. */
  .row-menu-trigger:hover { background: var(--fill); border-color: var(--accent); color: var(--label); }
}
.row-menu-trigger:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) {
  .row-menu-trigger:disabled:hover { background: transparent; color: var(--tertiary-label); }
}
.row-menu-trigger--open { background: var(--control-bg); border-color: var(--control-edge); color: var(--label); }
/* Positioned by FloatingLayer (top layer), fills its fixed width. */
.row-menu-dropdown { width: 100%; box-sizing: border-box; }

/* --- Motion -------------------------------------------------------------- */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Route / section entrance. */
.page-enter { animation: rise var(--dur-3) var(--ease-out); }

/* Staggered card reveal. */
.stagger > * { animation: rise 0.3s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.11s; }
.stagger > *:nth-child(5) { animation-delay: 0.14s; }
.stagger > *:nth-child(6) { animation-delay: 0.17s; }
.stagger > *:nth-child(n + 7) { animation-delay: 0.2s; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--dur-2); }

/* --- Scrollbars ---------------------------------------------------------- */
/* Every native scrollbar: thin neutral thumb. SimpleBar areas (lists) use the
   .simplebar-glass theme below for an always-visible thumb. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 3px;
}
@media (hover: hover) {
  *::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
  }
}

/* Shared SimpleBar theme — thin, always-visible (autoHide={false}) scrollbar.
   Apply the .simplebar-glass class to any <SimpleBar>. */
.simplebar-glass .simplebar-track.simplebar-vertical {
  width: 5px;
  background: var(--scroll-track);
  border-radius: 3px;
}
.simplebar-glass .simplebar-track.simplebar-horizontal {
  height: 5px;
  background: var(--scroll-track);
  border-radius: 3px;
}
.simplebar-glass .simplebar-scrollbar::before {
  background-color: var(--scroll-thumb);
  border-radius: 3px;
  opacity: 1; /* override SimpleBar default (opacity:0) so it's always shown */
}
.simplebar-glass .simplebar-track.simplebar-vertical .simplebar-scrollbar::before,
.simplebar-glass .simplebar-track.simplebar-horizontal .simplebar-scrollbar::before {
  top: 1px;
  bottom: 1px;
  left: 1px;
  right: 1px;
}
.simplebar-glass .simplebar-scrollbar.simplebar-visible::before {
  opacity: 1;
}
@media (hover: hover) {
  .simplebar-glass .simplebar-scrollbar:hover::before {
    background-color: var(--scroll-thumb-hover);
  }
}

/* --- Accessibility & fallbacks ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  :root[data-theme] {
    --blur-backdrop: none;
    --grain: 0;
  }
}

@media (prefers-contrast: more) {
  :root[data-theme="light"] {
    --separator: rgba(28, 24, 18, 0.32);
    --glass-edge: rgba(28, 24, 18, 0.32);
    --control-edge: rgba(28, 24, 18, 0.45);
    --mat-edge: rgba(28, 24, 18, 0.32);
    --secondary-label: #3b3a36;
    --tertiary-label: #4a4844;
  }
  :root[data-theme="dark"] {
    --separator: rgba(255, 255, 255, 0.3);
    --glass-edge: rgba(255, 255, 255, 0.3);
    --control-edge: rgba(255, 255, 255, 0.42);
    --mat-edge: rgba(255, 255, 255, 0.3);
    --secondary-label: #d0cdc7;
    --tertiary-label: #bcb9b3;
  }
  :root[data-theme] { --grain: 0; }
}

@media (forced-colors: active) {
  .glass, .glass-thick, .mat, .modal, .menu-surface, .row-menu-dropdown,
  .profile-menu, .topbar-menu-dropdown, .btn, .input, .select {
    border: 1px solid CanvasText;
  }
  .btn-primary { background: Highlight; color: HighlightText; }
  .badge::before { forced-color-adjust: none; }
}

/* --- Detail card / title (projects, VM, segment settings ...) ---------- */
.detail-title { display: flex; align-items: center; gap: 14px; }
.detail-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin-top: 18px;
}
.detail-card .field-label { margin-top: 4px; }
.detail-card .field-hint {
  margin: -6px 0 0;
  font-size: 12px;
  color: var(--secondary-label);
}
.detail-meta { color: var(--secondary-label); font-size: 13px; }
/* Storage tariff section (segment settings). */
.tariff-title { font-size: 12px; color: var(--secondary-label); margin-bottom: 6px; }
.tariff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tariff-name { font-size: 13px; }
.tariff-input { display: flex; align-items: center; gap: 8px; }
.tariff-input .input { width: 110px; }
.tariff-input .dim { font-size: 12px; white-space: nowrap; }
.detail-empty {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

/* --- Cards grid (hosts / projects / user detail) ----------------------- */
.cards-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* --- Full-height list pages (hosts / flavors / users / vms) -------------- */
/* The shell is pinned to the viewport (layout.css), so the active list takes
   the remaining height of .content and scrolls internally. `.list-page` marks
   the page root, `.list-scroll` the inner scroll container. The layout is
   pinned to 100dvh (like the storage page) so the list never overflows the
   viewport — the page size is then fitted to the visible height (see
   useFitPageSize) instead of the browser scrolling. */
.layout:has(> .main > .content > .list-page) { height: 100dvh; }
.main:has(> .content > .list-page) { min-height: 0; }
.content:has(> .list-page) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  min-height: 0;
}
.list-page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.list-scroll { flex: 1; min-height: 0; overflow-y: auto; }

/* A list table that fills its panel and scrolls internally, with the
   pagination footer pinned below the last row (the tasks-page pattern).
   The outer `.list-scroll` keeps its height; the inner `.list-table-scroll`
   is the actual scroll area, so the footer never scrolls away. */
.list-table-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.list-table-scroll { flex: 1; min-height: 0; overflow: auto; }

/* Pagination footer (prev / range / next) shared by every list page.
   Fixed height (not derived from the row height) so it stays a constant
   bar under the table on every list. */
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 48px;
  box-sizing: border-box;
  border-top: 1px solid var(--mat-edge);
}
.list-page-btn { padding: 4px 12px; font-size: 13px; }
.list-page-indicator {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  color: var(--secondary-label);
  font-variant-numeric: tabular-nums;
}
/* Topbar menus: compact trigger + listbox dropdown (surface recipe shared
   with .menu-surface in theme.css). Used by the public site (site/src/site.css
   imports this file); the admin moved language/theme into the profile menu. */
.topbar-menu { position: relative; }

.topbar-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--secondary-label);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--dur-1) ease, color var(--dur-1) ease, border-color var(--dur-1) ease;
}
@media (hover: hover) {
  .topbar-menu-trigger:hover { color: var(--label); background: var(--fill); border-color: var(--accent); }
}
.topbar-menu-trigger--open {
  color: var(--label);
  background: var(--control-bg);
  border-color: var(--control-edge);
}
.topbar-menu-chevron { color: var(--tertiary-label); transition: transform var(--dur-2) var(--ease-out); }
.topbar-menu-trigger--open .topbar-menu-chevron { transform: rotate(180deg); }

.topbar-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 96px;
}
.topbar-menu-item {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: calc(var(--r-lg) - 5px);
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1) ease, color var(--dur-1) ease;
}
@media (hover: hover) {
  .topbar-menu-item:hover { background: var(--fill); }
}
.topbar-menu-item--active { color: var(--label); }
.topbar-menu-item--active .topbar-menu-check { color: var(--accent); }

.topbar-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-menu-check { margin-left: auto; }
.topbar-menu-dropdown--wide { min-width: 176px; }
:root {
  /* Контент ограничен по ширине и отцентрован: на широких экранах текст
     не расползается к краям, поле растёт из симметрии. */
  --container: min(1440px, 100%);
  --gutter: clamp(16px, 4vw, 72px);
  --header-h: 60px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); overflow-x: clip; }
html, body { height: auto; }
body { overflow-x: clip; }
body {
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--surface-border);
}
.skip-link:focus { top: 12px; }

/* --- Typography ---------------------------------------------------------- */

.h-hero {
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.h-page { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
.h-section { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 680; }
h3 { font-size: 16px; line-height: 1.3; }
.lead { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; color: var(--secondary-label); max-width: 68ch; text-wrap: pretty; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.005em; }

/* --- Buttons ------------------------------------------------------------- */

.btn { text-decoration: none; }
.btn-lg { min-height: 42px; padding: 9px 18px; font-size: 15px; border-radius: var(--r-md); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cta-center { justify-content: center; }

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) ease;
}
.scrolled .site-header { border-bottom-color: var(--separator); }
.header-row { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.header-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--label); }
.header-logo-text { font-size: 17px; font-weight: 680; letter-spacing: -0.02em; }
.header-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.header-nav-link {
  padding: 6px 10px; border-radius: var(--r-sm);
  color: var(--secondary-label); text-decoration: none; font-size: 14px; font-weight: 400;
  transition: color var(--dur-1) ease, background var(--dur-1) ease;
}
.header-nav-link[aria-current="page"] { color: var(--label); }
@media (hover: hover) { .header-nav-link:hover { color: var(--label); background: var(--fill); } }
.header-nav-cta { display: none; }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-cta { margin-left: 8px; }
.topbar-menu-dropdown[hidden] { display: none; }
.topbar-menu-item { text-decoration: none; }
.topbar-menu-item .topbar-menu-check { visibility: hidden; }
.topbar-menu-item--active .topbar-menu-check { visibility: visible; }

/* Иконка темы в триггере — по текущему режиму. */
.theme-icon { display: none; }
:root:not([data-theme-mode]) .theme-icon[data-theme-icon="system"],
[data-theme-mode="system"] .theme-icon[data-theme-icon="system"],
[data-theme-mode="light"] .theme-icon[data-theme-icon="light"],
[data-theme-mode="dark"] .theme-icon[data-theme-icon="dark"] { display: inline-flex; }

.header-burger {
  display: none; place-items: center; width: 36px; height: 36px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--label); cursor: pointer;
}
.burger-close { display: none; }
.nav-open .burger-open { display: none; }
.nav-open .burger-close { display: block; }

@media (max-width: 860px) {
  .header-burger { display: grid; }
  .header-cta { display: none; }
  .header-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 20px;
    background: var(--bg);
    box-shadow: var(--shadow-2);
  }
  /* Скрипт (client.ts) вешает .js на <html>: без JS меню видно всегда,
     анимация «выезда» — только когда скрипт точно есть. */
  .js .header-nav {
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
  }
  .js .nav-open .header-nav { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .header-nav-link { padding: 12px 10px; font-size: 16px; }
  .header-nav-cta { display: inline-flex; margin-top: 10px; min-height: 42px; }
}

/* --- Sections ------------------------------------------------------------ */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--window); color: var(--label); border-block: 1px solid var(--separator); }
.page-top { padding-top: clamp(48px, 7vw, 80px); }
.section-tight { padding-top: clamp(32px, 4vw, 56px); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; max-width: 820px; }

/* --- Hero ---------------------------------------------------------------- */

.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 5vw, 64px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; }
.hero-copy .cta-row { margin-top: 8px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.led { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hero-note { font-size: 13px; }
.hero-note a { color: var(--secondary-label); }
.hero-shot { margin: 0; position: relative; }
.hero-shot::before {
  content: ""; position: absolute; inset: 8% 4% 4%;
  background: radial-gradient(closest-side, var(--tint-accent), transparent);
  filter: blur(30px); z-index: -1;
}
[data-theme="dark"] .hero-shot img { filter: brightness(0.92) contrast(1.02); }


/* --- Cards --------------------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  padding: 22px; display: flex; flex-direction: column; gap: 10px; height: 100%;
  transition: background var(--dur-1) ease, border-color var(--dur-1) ease;
}
/* Наведение — как у триггеров меню темы и языка: заливка --fill и рамка
   --control-edge поверх поверхности карточки. */
@media (hover: hover) {
  .card:hover {
    background: linear-gradient(var(--fill), var(--fill)), var(--mat-regular);
    border-color: var(--control-edge);
  }
}
.card-link-card { text-decoration: none; color: inherit; }
.card-link-card:focus-visible { border-color: var(--accent); }
.card-more {
  margin-top: auto; padding-top: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 14px; font-weight: 550;
}
.card-more svg { transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) { .card-link-card:hover .card-more svg { transform: translateX(3px); } }
.card p { font-size: 14px; line-height: 1.55; }
.card-icon {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--r-md); background: var(--tint-accent); color: var(--accent);
  margin-bottom: 4px; flex: none;
}
.card-link { margin-top: auto; padding-top: 6px; color: var(--accent); text-decoration: none; font-size: 13.5px; }
@media (hover: hover) { .card-link:hover { text-decoration: underline; } }

.roadmap { margin-top: 12px; padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.roadmap-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.roadmap-list { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.roadmap-list li { position: relative; padding-left: 14px; color: var(--secondary-label); }
.roadmap-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 1px; background: var(--control-edge); }

/* --- Platforms ----------------------------------------------------------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.split .section-head { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; font-size: 13.5px; border-radius: var(--r-sm);
  background: var(--mat-regular); border: 1px solid var(--mat-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-1);
}

/* --- Steps & support ----------------------------------------------------- */

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.step { padding: 22px 20px; border-top: 2px solid var(--separator); display: flex; flex-direction: column; gap: 8px; }
.step:first-child { border-top-color: var(--accent); }
.step-num { font-size: 12px; color: var(--accent); letter-spacing: 0.005em; }
.step p { font-size: 14px; }

.support { margin-top: 28px; padding: 20px 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.support > div { display: flex; flex-direction: column; gap: 4px; max-width: 60ch; }
.support p { font-size: 14px; }

.address { margin-top: 12px; padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.address address { font-style: normal; margin-top: 4px; font-size: 14px; }

.final { text-align: center; }
.final-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.final .lead { margin: 0 auto; }

.not-found { display: flex; flex-direction: column; gap: 14px; }
.not-found-code { font-size: 14px; color: var(--accent); }

/* --- Footer -------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--separator); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px;
  padding-top: 14px; padding-bottom: 16px;
  font-size: 13px; color: var(--tertiary-label);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .cards-3, .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
