/* Kvant design system — light and dark themes, strict minimalism, accent #5A45E6. */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/onest-cyrillic-ext-wght-normal.11a468877c94.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/onest-cyrillic-wght-normal.fe2bd26ae82a.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/onest-latin-ext-wght-normal.3e2cb9888206.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";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/onest-latin-wght-normal.3db826ed1c5d.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";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("../fonts/jetbrains-mono-cyrillic-wght-normal.615bf869ebeb.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";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("../fonts/jetbrains-mono-latin-ext-wght-normal.e36841ed93d5.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: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.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;
}

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #f1f1f6;
  --surface-3: #fafaff;
  --border: #e3e3eb;
  --border-strong: #d7d7e2;
  --divider: #eeeef3;
  --text: #15151c;
  --text-2: #3a3a48;
  --muted: #5c5c6e;
  --subtle: #6e6e80;
  --faint: #8a8a9c;
  --accent: #5a45e6;
  --accent-hover: #4b37d1;
  --accent-soft: #eeebfd;
  --accent-tint: #f7f5ff;
  --accent-ring: #e6e1fc;
  --accent-text: #4533c9;
  --on-accent: #ffffff;
  --invert-bg: #15151c;
  --invert-text: #ffffff;
  --success-bg: #e5f3ea;
  --success-fg: #17683f;
  --success-dot: #1e9e57;
  --positive: #17703f;
  --warning-bg: #fcf1dd;
  --warning-fg: #875200;
  --warning-dot: #e09b1b;
  --danger-bg: #fcebe7;
  --danger-border: #f2cfc6;
  --danger-fg: #a8321c;
  --danger-text: #7a2412;
  --danger-dot: #e0553a;
  --danger-solid: #a8321c;
  --neutral-bg: #eeeef3;
  --neutral-fg: #4a4a5a;
  --neutral-dot: #8a8a9c;
  --info-bg: #f4f2fe;
  --info-border: #dcd5fa;
  --info-fg: #2f2391;
  --toggle-off: #c9c9d6;
  --chip-bg: #f1f1f6;
  --shadow-card: 0 1px 2px rgba(21, 21, 28, 0.04), 0 16px 40px -16px rgba(21, 21, 28, 0.14);
  --shadow-pop: 0 20px 48px -18px rgba(21, 21, 28, 0.28);
  --shadow-seg: 0 1px 2px rgba(21, 21, 28, 0.08), 0 0 0 1px #e3e3eb;
  --chat-bg: #e9ecf2;
  --chat-bubble: #ffffff;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d12;
  --surface: #15151c;
  --surface-2: #1c1c25;
  --surface-3: #1a1830;
  --border: #2a2a36;
  --border-strong: #3a3a48;
  --divider: #23232d;
  --text: #ededf3;
  --text-2: #c8c8d6;
  --muted: #9b9baf;
  --subtle: #8a8a9e;
  --faint: #6f6f82;
  --accent: #6a57f0;
  --accent-hover: #7b6cf6;
  --accent-soft: #221e42;
  --accent-tint: #1d1a36;
  --accent-ring: #332b6b;
  --accent-text: #c4bbff;
  --on-accent: #ffffff;
  --invert-bg: #ededf3;
  --invert-text: #15151c;
  --success-bg: #10271b;
  --success-fg: #6fdc9e;
  --success-dot: #3cc57a;
  --positive: #6fdc9e;
  --warning-bg: #2e2210;
  --warning-fg: #f2bd5b;
  --warning-dot: #e0a33a;
  --danger-bg: #33170f;
  --danger-border: #5a2618;
  --danger-fg: #ff9a85;
  --danger-text: #ffb4a6;
  --danger-dot: #f0694e;
  --danger-solid: #c2412a;
  --neutral-bg: #23232d;
  --neutral-fg: #b4b4c4;
  --neutral-dot: #6f6f82;
  --info-bg: #1a1733;
  --info-border: #332b6b;
  --info-fg: #d2cbff;
  --toggle-off: #3a3a48;
  --chip-bg: #23232d;
  --shadow-card: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  --shadow-seg: none;
  --chat-bg: #101017;
  --chat-bubble: #1c1c25;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d12;
    --surface: #15151c;
    --surface-2: #1c1c25;
    --surface-3: #1a1830;
    --border: #2a2a36;
    --border-strong: #3a3a48;
    --divider: #23232d;
    --text: #ededf3;
    --text-2: #c8c8d6;
    --muted: #9b9baf;
    --subtle: #8a8a9e;
    --faint: #6f6f82;
    --accent: #6a57f0;
    --accent-hover: #7b6cf6;
    --accent-soft: #221e42;
    --accent-tint: #1d1a36;
    --accent-ring: #332b6b;
    --accent-text: #c4bbff;
    --on-accent: #ffffff;
    --invert-bg: #ededf3;
    --invert-text: #15151c;
    --success-bg: #10271b;
    --success-fg: #6fdc9e;
    --success-dot: #3cc57a;
    --positive: #6fdc9e;
    --warning-bg: #2e2210;
    --warning-fg: #f2bd5b;
    --warning-dot: #e0a33a;
    --danger-bg: #33170f;
    --danger-border: #5a2618;
    --danger-fg: #ff9a85;
    --danger-text: #ffb4a6;
    --danger-dot: #f0694e;
    --danger-solid: #c2412a;
    --neutral-bg: #23232d;
    --neutral-fg: #b4b4c4;
    --neutral-dot: #6f6f82;
    --info-bg: #1a1733;
    --info-border: #332b6b;
    --info-fg: #d2cbff;
    --toggle-off: #3a3a48;
    --chip-bg: #23232d;
    --shadow-card: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
    --shadow-pop: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    --shadow-seg: none;
    --chat-bg: #101017;
    --chat-bubble: #1c1c25;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--divider); margin: 0; }
code, kbd, pre, .mono { font-family: var(--mono); }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); }
.skip-link:focus { top: 12px; color: var(--on-accent); }

/* ----------------------------------------------------------- utilities */
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.text-2 { color: var(--text-2); }
.positive { color: var(--positive); }
.danger-text { color: var(--danger-fg); }
.warning-text { color: var(--warning-fg); }
.accent-text { color: var(--accent-text); }
.small { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-15 { font-size: 15px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row-12 { display: flex; align-items: center; gap: 12px; }
.row-16 { display: flex; align-items: center; gap: 16px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.grow { flex-grow: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* --------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand__logo { height: 28px; width: auto; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark rect, .brand-mark .mark-bg { fill: var(--accent); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1;
  white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--secondary { border-color: var(--border-strong); background: var(--surface); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { color: var(--danger-fg); }
.btn--danger:hover { background: var(--danger-bg); color: var(--danger-fg); }
.btn--danger-solid { background: var(--danger-solid); color: #fff; font-weight: 600; }
.btn--danger-solid:hover { color: #fff; filter: brightness(1.08); }
.btn--dark { background: var(--invert-bg); color: var(--invert-text); font-weight: 600; }
.btn--dark:hover { color: var(--invert-text); opacity: 0.9; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--radius-md); }
.btn--xl { height: 52px; padding: 0 24px; font-size: 16px; border-radius: var(--radius-md); }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--subtle); }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 500; }
.link-btn:hover { color: var(--accent-hover); }

/* --------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; color: var(--text); }
.field__label--sm { font-size: 13px; }
.field__help { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--danger-fg); }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); background: var(--surface); color: var(--text); font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input--sm, .select--sm { height: 40px; border-radius: var(--radius); font-size: 14px; padding: 0 12px; }
.input--mono { font-family: var(--mono); font-size: 14px; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select { padding-right: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input[aria-invalid="true"], .field--error .input, .field--error .select, .field--error .textarea { border-color: var(--danger-dot); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 13px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-input { height: 56px; text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: 0.3em; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--subtle); pointer-events: none; }
.search .input { height: 38px; padding-left: 36px; background: var(--bg); border-color: var(--border); font-size: 14px; border-radius: var(--radius); }

/* toggle switch built on a checkbox */
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--toggle-off); transition: background .15s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { left: 18px; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.mini-switch { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--toggle-off); flex-shrink: 0; }
.mini-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.mini-switch--on { background: var(--accent); }
.mini-switch--on::after { left: 14px; }

/* selectable option cards (radio / checkbox inside a label) */
.options { display: grid; gap: 10px; }
.options--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.options--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.option {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.option:hover { border-color: var(--border-strong); }
.option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.option input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 3px var(--accent-ring); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.option:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.option--col { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; }
.option__title { font-size: 15px; font-weight: 600; }
.option__sub { font-size: 13px; color: var(--muted); }
.option__price { margin-top: 8px; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.option__side { margin-left: auto; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.option__code { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--chip-bg); color: var(--text-2); font-family: var(--mono); font-size: 13px; font-weight: 600; }
.option__icon { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--chip-bg); color: var(--text-2); }

/* segmented control (radio buttons or links) */
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--surface-2); }
.segmented--block { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.segmented__item { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.segmented__item input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__item:hover { color: var(--text); }
.segmented__item.is-active, .segmented__item:has(input:checked), .segmented__item[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow-seg); color: var(--text); }
.segmented__item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented--sm .segmented__item { height: 32px; padding: 0 12px; font-size: 14px; }
.segmented__hint { color: var(--positive); font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------- surfaces */
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.card--pad { padding: 24px; }
.card--pad-20 { padding: 20px 24px; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.card__title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card__title--sm { font-size: 16px; }
.card__body { padding: 20px 24px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.step-num { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.panel { padding: 14px; border-radius: var(--radius-md); background: var(--bg); }
.panel--dashed { padding: 16px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-3); }

.stat { padding: 20px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.stat__label { color: var(--muted); font-size: 14px; }
.stat__value { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.stat__value--mono { font-family: var(--mono); }
.stat__meta { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------ badges and chips */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge--success { background: var(--success-bg); color: var(--success-fg); }
.badge--success .dot { background: var(--success-dot); }
.badge--pending { background: var(--accent-soft); color: var(--accent-text); }
.badge--pending .dot { background: var(--accent); }
.badge--warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge--warning .dot { background: var(--warning-dot); }
.badge--danger { background: var(--danger-bg); color: var(--danger-fg); }
.badge--danger .dot { background: var(--danger-dot); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge--neutral .dot { background: var(--neutral-dot); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag--success { background: var(--success-bg); color: var(--success-fg); }
.tag--pending { background: var(--accent-soft); color: var(--accent-text); }
.tag--warning { background: var(--warning-bg); color: var(--warning-fg); }
.tag--danger { background: var(--danger-bg); color: var(--danger-fg); }
.tag--neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 7px; border-radius: var(--radius-sm); background: var(--chip-bg); color: var(--text-2); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 500; }
.counter { min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; }
.counter--muted { background: var(--surface-2); color: var(--text-2); }
.filter-chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; }
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.is-active { border-color: var(--invert-bg); background: var(--invert-bg); color: var(--invert-text); }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 15px; }
.alert svg { flex-shrink: 0; }
.alert__body { flex-grow: 1; min-width: 0; }
.alert--info { border-color: var(--info-border); background: var(--info-bg); color: var(--info-fg); }
.alert--success { background: var(--success-bg); color: var(--success-fg); }
.alert--warning { background: var(--warning-bg); color: var(--warning-fg); }
.alert--danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.alert--compact { padding: 12px 14px; font-size: 14px; border-radius: var(--radius-md); }
.messages { display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { height: 44px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table--hover tbody tr { cursor: pointer; }
.table--hover tbody tr:hover td { background: var(--surface-3); }
.table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.cell-main { font-size: 15px; font-weight: 600; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 13px; }
.row-link { color: inherit; }
.row-link:hover { color: inherit; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

.kv { display: flex; flex-direction: column; }
.kv__row { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 50px; border-bottom: 1px solid var(--divider); }
.kv__row:last-child { border-bottom: 0; }
.kv__key { color: var(--muted); font-size: 14px; }
.kv__value { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; }
.kv__value--text { font-family: var(--font); }
.kv__actions { display: flex; justify-content: flex-end; gap: 4px; }
.kv-grid { display: grid; grid-template-columns: 120px minmax(0, 1fr); row-gap: 10px; column-gap: 12px; font-size: 14px; }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { margin: 0; }

.tabs { display: flex; gap: 24px; overflow-x: auto; }
.tabs--line { border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.tab__count { color: var(--subtle); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.tabs--sm .tab { height: 44px; }

.progress { height: 6px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 999px; background: var(--accent); }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline__item { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 12px; }
.timeline__dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--neutral-dot); }
.timeline__dot--accent { background: var(--accent); }
.timeline__dot--success { background: var(--success-dot); }
.timeline__dot--danger { background: var(--danger-dot); }
.timeline__title { font-size: 14px; font-weight: 500; }
.timeline__meta { color: var(--muted); font-size: 13px; }

.avatar { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--invert-bg); color: var(--invert-text); font-size: 13px; font-weight: 600; }
.avatar--soft { background: var(--surface-2); color: var(--text-2); }
.avatar--accent { background: var(--accent); color: var(--on-accent); }

.empty { padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); }
.empty__icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.empty__title { color: var(--text); font-size: 16px; font-weight: 600; }

.code-block { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.copy-field { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.copy-field__value { flex-grow: 1; min-width: 0; font-family: var(--mono); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret { font-family: var(--mono); letter-spacing: 0.1em; }
.secret--shown { letter-spacing: 0; }
.is-copied { color: var(--positive) !important; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

/* dropdown built on <details> */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.dropdown__item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: var(--radius); background: none; color: var(--text); font-size: 14px; text-align: left; }
.dropdown__item:hover { background: var(--surface-2); color: var(--text); }
.dropdown__item.is-active { color: var(--accent-text); font-weight: 600; }

dialog.modal { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: rgba(13, 13, 18, 0.45); }
.modal__body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--invert-bg); color: var(--invert-text); font-size: 14px; box-shadow: var(--shadow-pop); }

/* ------------------------------------------------------------ site layout */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.site-header { position: sticky; top: 0; z-index: 40; height: 72px; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-nav { display: flex; align-items: center; gap: 32px; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--text); }
.site-nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.lang-form { display: inline-flex; }

.hero { padding: 96px 0; }
.hero__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 72px; align-items: center; }
.hero__eyebrow { align-self: flex-start; }
.hero__title { font-size: 60px; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.hero__lead { max-width: 540px; color: var(--muted); font-size: 19px; line-height: 1.55; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 12px 24px; color: var(--muted); font-size: 14px; }
.hero__facts span { display: inline-flex; align-items: center; gap: 8px; }
.hero__facts svg { color: var(--accent-text); }
.hero__visual { position: relative; height: 470px; }
.preview-card { position: absolute; top: 0; right: 0; width: min(540px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 20px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-card); }
.preview-card .kv { border: 1px solid var(--border); border-radius: 12px; }
.preview-card .kv__row { grid-template-columns: 110px minmax(0, 1fr) 32px; padding: 0 8px 0 16px; min-height: 52px; }
.preview-toast { position: absolute; left: 0; top: 344px; width: 300px; padding: 16px; display: flex; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-pop); }

.section { padding: 88px 0; }
.section--surface { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.section__title { font-size: 40px; line-height: 1.1; }
.section__lead { color: var(--muted); font-size: 17px; }

.price-table { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.price-row { display: grid; grid-template-columns: 200px repeat(4, minmax(0, 1fr)) 150px 210px 140px; gap: 16px; align-items: center; min-height: 84px; padding: 0 24px; border-bottom: 1px solid var(--divider); }
.price-row:last-child { border-bottom: 0; }
.price-row--head { min-height: 48px; background: var(--bg); border-bottom-color: var(--border); color: var(--muted); font-size: 13px; font-weight: 500; }
.price-row--featured { background: var(--surface-3); }
.price-row__name { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.price-row__spec { font-family: var(--mono); font-size: 15px; }
.price-row__spec-label { display: none; }
.price-row__price { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.price-row__price small { color: var(--subtle); font-size: 14px; font-weight: 400; }
.price-row__total { color: var(--subtle); font-size: 13px; }
.price-row__action { justify-self: end; }
.price-row.is-hidden { display: none; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.step { padding-top: 24px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border-strong); }
.step__num { color: var(--accent-text); font-family: var(--mono); font-size: 14px; font-weight: 600; }
.step__title { font-size: 22px; letter-spacing: -0.01em; }
.feature { padding: 28px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.feature__icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); }
.feature__title { font-size: 18px; }

.faq-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; list-style: none; cursor: pointer; font-size: 18px; font-weight: 600; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .faq-plus { color: var(--muted); transition: transform .2s; }
.faq-item[open] summary .faq-plus { transform: rotate(45deg); }
.faq-item__answer { max-width: 720px; padding: 0 0 24px; color: var(--muted); font-size: 16px; }
.faq-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 80px; }

.site-footer { padding: 64px 0 40px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr 1fr; gap: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.footer-col__title { color: var(--subtle); font-size: 13px; font-weight: 600; }
.footer-col a { color: var(--text); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 48px; padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border); color: var(--subtle); font-size: 14px; }

.prose { max-width: 760px; color: var(--text-2); font-size: 16px; line-height: 1.7; }
.prose h2 { margin: 32px 0 12px; font-size: 24px; color: var(--text); }
.prose h3 { margin: 24px 0 8px; font-size: 19px; color: var(--text); }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 15px; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; }
.prose blockquote { margin: 0 0 14px; padding: 8px 16px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); font-size: 0.9em; }

/* ------------------------------------------------------------- auth pages */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-header { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.auth-main { flex-grow: 1; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px 64px; }
.auth-card { width: min(440px, 100%); padding: 36px; display: flex; flex-direction: column; gap: 20px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); }
.auth-card__kicker { color: var(--subtle); font-size: 13px; font-weight: 600; }
.auth-card__title { font-size: 26px; }
.tg-widget { display: flex; justify-content: center; min-height: 40px; }

/* -------------------------------------------------------- application shell */
.shell { min-height: 100vh; display: flex; }
.sidebar { position: sticky; top: 0; width: 256px; height: 100vh; flex-shrink: 0; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); }
.sidebar--staff { padding: 20px 12px; gap: 16px; }
.sidebar__brand { height: 40px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-groups { display: flex; flex-direction: column; gap: 14px; }
.nav-group__title { padding: 0 12px 4px; color: var(--subtle); font-size: 12px; font-weight: 600; }
.nav__item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--radius); color: var(--text-2); font-size: 15px; font-weight: 500; }
.sidebar--staff .nav__item { height: 36px; font-size: 14px; }
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav__label { flex-grow: 1; min-width: 0; }
.nav__count { color: var(--subtle); font-family: var(--mono); font-size: 13px; }
.nav__item.is-active .nav__count { color: inherit; }
.admin-badge { height: 22px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: var(--radius-sm); background: var(--invert-bg); color: var(--invert-text); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.tg-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border); border-radius: 12px; }
.tg-card__icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.user-row { padding: 0 4px; display: flex; align-items: center; gap: 10px; }
.user-row__meta { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-row__name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row__role { color: var(--muted); font-size: 13px; }

.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; flex-shrink: 0; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 14px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs__current { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance-chip { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 5px 0 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 14px; }
.balance-chip:hover { color: var(--text); border-color: var(--border-strong); }
.balance-chip__value { font-family: var(--mono); font-weight: 600; }
.balance-chip__cta { height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; }
.bell { position: relative; }
.bell__dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--danger-dot); }
.content { padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-title { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
.page-lead { color: var(--muted); font-size: 15px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.layout-order { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 16px; align-items: start; }
.sticky { position: sticky; top: 88px; }
.mobile-bar { display: none; }

/* order summary */
.summary-lines { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; }
.summary-line__amount { font-family: var(--mono); white-space: nowrap; }
.summary-line--discount { color: var(--positive); }
.summary-total { padding-top: 16px; display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--border); }
.summary-total__value { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }

/* chart */
.chart { position: relative; height: 248px; }
.chart__grid { position: absolute; left: 44px; right: 0; height: 1px; background: var(--divider); }
.chart__grid--base { background: var(--border-strong); }
.chart__tick { position: absolute; left: 0; width: 34px; color: var(--subtle); font-family: var(--mono); font-size: 11px; text-align: right; }
.chart__bars { position: absolute; left: 44px; right: 0; top: 0; bottom: 0; display: flex; }
.chart__slot { position: relative; flex: 1 1 0; min-width: 0; padding: 0; border: 0; background: transparent; cursor: default; }
.chart__bar { position: absolute; left: 50%; bottom: 28px; width: 12px; margin-left: -6px; border-radius: 4px 4px 0 0; background: var(--accent); }
.chart__slot:hover .chart__bar, .chart__slot:focus-visible .chart__bar { background: var(--accent-hover); }
.chart__label { position: absolute; left: 50%; transform: translateX(-50%); color: var(--text-2); font-family: var(--mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chart__date { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); color: var(--subtle); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.chart__tip { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); padding: 8px 10px; display: none; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-pop); text-align: left; white-space: nowrap; pointer-events: none; }
.chart__slot:hover .chart__tip, .chart__slot:focus-visible .chart__tip { display: flex; }
.chart__slot:hover .chart__label, .chart__slot:focus-visible .chart__label { visibility: hidden; }
.chart__slot--start .chart__tip { left: 0; transform: none; }
.chart__slot--end .chart__tip { left: auto; right: 0; transform: none; }
.chart__tip-value { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.chart__tip-meta { color: var(--muted); font-size: 12px; }
.chart-table { display: grid; grid-template-rows: repeat(6, 36px); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 16px; font-size: 13px; }
.chart-table__cell { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider); }

/* list rows (queues) */
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--divider); }
.list-row:last-child { border-bottom: 0; }

/* chat (ticket conversation) */
.chat { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 80%; padding: 12px 14px; border-radius: 14px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble--client { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--accent-soft); }
.bubble--staff { align-self: flex-start; border-bottom-left-radius: 4px; background: var(--surface-2); }
.bubble__meta { margin-top: 6px; color: var(--muted); font-size: 12px; }

/* --------------------------------------------------------------- errors */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-code { font-family: var(--mono); font-size: 64px; font-weight: 600; color: var(--accent); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .price-row { grid-template-columns: 150px repeat(4, minmax(0, 1fr)) 110px 170px 120px; padding: 0 16px; }
  .layout-order { grid-template-columns: minmax(0, 1fr) 320px; }
  .options--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .hero__grid, .faq-layout { grid-template-columns: 1fr; gap: 40px; }
  .hero__visual { height: 440px; max-width: 560px; }
  .hero__title { font-size: 48px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2, .layout-order, .layout-side { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(13, 13, 18, 0.45); }
  .mobile-bar { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 24px 16px 40px; }
}

@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .site-nav { display: none; }
  .site-nav.is-open { position: absolute; left: 0; right: 0; top: 72px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .menu-toggle { display: inline-flex; }
  .header-actions .hide-sm { display: none; }
  .hero { padding: 56px 0; }
  .hero__title { font-size: 38px; }
  .hero__lead { font-size: 17px; }
  .hero__visual { height: auto; display: flex; flex-direction: column; gap: 16px; }
  .preview-card, .preview-toast { position: static; width: 100%; }
  .section { padding: 64px 0; }
  .section__title { font-size: 32px; }
  .steps, .grid-3, .grid-2, .form-grid, .form-grid--3, .options--2, .options--3, .options--5 { grid-template-columns: 1fr; }
  .price-row--head { display: none; }
  .price-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 20px 16px; }
  .price-row__name { grid-column: 1 / -1; }
  .price-row__spec-label { display: block; color: var(--subtle); font-family: var(--font); font-size: 12px; }
  .price-row__locations { grid-column: 1 / -1; }
  .price-row__action { justify-self: start; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .kv__row { grid-template-columns: 110px minmax(0, 1fr) auto; }
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--divider); }
  .table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 !important; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; }
  .table--stack td[data-label=""]::before { content: none; }
  .auth-card { padding: 24px; }
  .page-title { font-size: 24px; }
  .grid-4 { grid-template-columns: 1fr; }
  .balance-chip__label { display: none; }
  .bubble { max-width: 92%; }
}

/* ------------------------------------------------------------- additions */
.filter-chip-label { display: inline-flex; cursor: pointer; }
.filter-chip-label input:checked + .filter-chip { border-color: var(--invert-bg); background: var(--invert-bg); color: var(--invert-text); }
.filter-chip-label input:focus-visible + .filter-chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.method-info { display: none; align-items: flex-start; gap: 10px; color: var(--text-2); }
.method-info svg { margin-top: 3px; }
.topup-form:has(input[name="method"][value="yookassa"]:checked) .method-info--yookassa,
.topup-form:has(input[name="method"][value="stripe"]:checked) .method-info--stripe,
.topup-form:has(input[name="method"][value="cryptobot"]:checked) .method-info--cryptobot { display: flex; }
.topup-form:has(input[name="method"][value="manual"]:checked) .method-info--manual { display: flex; flex-direction: column; }
.input--file { height: auto; padding: 10px 12px; font-size: 14px; }
.qr svg { width: 100%; height: auto; }
@media (max-width: 860px) {
  .hide-sm { display: none !important; }
}

/* ---------------------------------------------------------------- staff panel */
.choice-list { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.choice-list label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.choice-list input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.topbar__search { flex-grow: 1; max-width: 440px; }
.topbar__search .input { height: 38px; }
.staff-only { padding: 16px; display: flex; flex-direction: column; gap: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-3); }
.staff-only__title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.fieldset legend { margin-bottom: 10px; padding: 0; font-size: 15px; font-weight: 600; }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section + .form-section { padding-top: 20px; border-top: 1px solid var(--divider); }
.form-section__title { font-size: 16px; }
.form-section__title small { color: var(--subtle); font-size: 14px; font-weight: 400; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex-grow: 1; min-width: 0; }
.quote-block { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-pane { display: flex; flex-direction: column; gap: 16px; }
.preview-pane__label { color: var(--subtle); font-size: 12px; font-weight: 600; }
.preview-box { padding: 14px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 14px; }
.preview-chat { padding: 12px; border-radius: var(--radius-md); background: var(--chat-bg); }
.preview-chat .bubble { max-width: 100%; background: var(--chat-bubble); }
.preview-button { height: 32px; margin-top: 6px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--chat-bubble); color: var(--accent-text); font-size: 13px; font-weight: 600; }
.upload-row { display: flex; align-items: center; gap: 12px; }
.upload-row__thumb { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.upload-row__thumb img { max-width: 100%; max-height: 100%; }
.mono { font-family: var(--mono); }
.json-block { max-height: 320px; overflow: auto; margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters .input, .filters .select { width: auto; min-width: 180px; height: 36px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar__search { display: none; }
  .filters .input, .filters .select { width: 100%; }
}
.chart-card .chart-table { display: none; }
.chart-card:has(input[name="chart-view"][value="table"]:checked) .chart { display: none; }
.chart-card:has(input[name="chart-view"][value="table"]:checked) .chart-table { display: grid; }
.queue-row__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.queue-row__title { font-size: 15px; font-weight: 600; }
.queue-row__meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .chart-card .chart { overflow-x: auto; } .chart__date { display: none; } }
.chat--staff .bubble--client { align-self: flex-start; border-radius: 14px; border-bottom-left-radius: 4px; background: var(--surface-2); }
.chat--staff .bubble--staff { align-self: flex-end; border-radius: 14px; border-bottom-right-radius: 4px; background: var(--accent-soft); }
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .legal-layout { grid-template-columns: 1fr; gap: 32px; } }
.layout-2--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.layout-2--wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.layout-2--split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
.list-row__aside { width: 280px; flex-shrink: 0; }
.search .input { max-width: 100%; }
@media (max-width: 1024px) {
  .layout-2--even, .layout-2--wide, .layout-2--split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .list-row { flex-wrap: wrap; }
  .list-row__aside { width: 100%; }
  .inline-form { flex-wrap: wrap; }
}
.layout-2 > *, .layout-side > *, .layout-order > * { min-width: 0; }
@media (max-width: 480px) { .topbar .breadcrumbs { display: none; } }
