/* Арена веселья — admin console. Design: DESIGN-meta.md (Meta commerce system), light only. */

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat-cyrillic.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --primary: #0064e0;
  --primary-deep: #0457cb;
  --primary-select: #0143b5;
  --primary-tint: rgba(0, 145, 255, 0.12);
  --ink-button: #000000;
  --fb-blue: #1876f2;
  --success: #31a24c;
  --success-tint: rgba(49, 162, 76, 0.12);
  --attention: #f2a918;
  --attention-ink: #8a5a00;
  --attention-tint: rgba(242, 169, 24, 0.16);
  --warning: #f7b928;
  --critical: #e41e3f;
  --critical-strong: #f0284a;
  --critical-tint: rgba(228, 30, 63, 0.08);
  --canvas: #ffffff;
  --surface-soft: #f1f4f7;
  --ink-deep: #0a1317;
  --ink: #1c1e21;
  --charcoal: #444950;
  --slate: #4b4c4f;
  --steel: #5d6c7b;
  --stone: #8595a4;
  --hairline: #ced0d4;
  --hairline-soft: #dee3e9;
  --disabled: #bcc0c4;
  --ghost-border: rgba(10, 19, 23, 0.12);

  --font: 'Montserrat', 'Optimistic VF', Helvetica, Arial, 'Noto Sans', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 16px;
  --r-xxl: 24px;
  --r-xxxl: 32px;
  --r-full: 100px;

  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 10px;
  --sp-md: 12px;
  --sp-base: 16px;
  --sp-lg: 20px;
  --sp-xl: 24px;
  --sp-xxl: 32px;
  --sp-xxxl: 40px;
  --sp-section-sm: 48px;
  --sp-section: 64px;

  --shadow-panel: 0 1px 4px rgba(20, 22, 26, 0.3);
  --shadow-float: 0 8px 28px rgba(20, 22, 26, 0.18);
  --page-max: 1280px;
  --nav-h: 0px;
  --sidebar-w: 272px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--ink-deep); }

a { color: var(--primary-deep); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration: underline; text-underline-offset: 3px; } }

img, svg { max-width: 100%; }
::selection { background: rgba(0, 100, 224, 0.18); }

:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: 2px; }

.container { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--sp-xxl); }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--steel); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon--sm { width: 16px; height: 16px; }

/* Typography */
.h1, .heading-lg { font-size: 36px; line-height: 1.28; font-weight: 500; color: var(--ink-deep); letter-spacing: -0.02em; }
.h2 { font-size: 24px; line-height: 1.25; font-weight: 500; color: var(--ink-deep); }
.h3 { font-size: 18px; line-height: 1.44; font-weight: 700; color: var(--ink-deep); }
.lead { font-size: 18px; line-height: 1.44; color: var(--charcoal); }
.caption { font-size: 12px; line-height: 1.33; color: var(--steel); }
.small { font-size: 14px; line-height: 1.43; }

/* App shell: sidebar navigation + content */
.shell { display: flex; align-items: stretch; min-height: 100vh; min-height: 100dvh; }
.shell__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-xs);
  color: var(--ink-deep);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) { .brand:hover { text-decoration: none; } }
.brand__tag { font-size: 12px; font-weight: 500; color: var(--steel); letter-spacing: 0; }

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-md) var(--sp-base);
  background: var(--surface-soft);
  border-right: 1px solid var(--hairline-soft);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 60;
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xs); min-height: 40px; padding: 0 0 0 12px; }
.sidebar .sidebar__close { display: none; }
.sidebar .search-pill { width: 100%; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--hairline-soft); }
.sidebar .search-pill:focus-within { box-shadow: inset 0 0 0 2px var(--fb-blue); }

.sidenav { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--sp-lg); }
.sidenav__group { display: flex; flex-direction: column; gap: 2px; }
.sidenav__title { padding: 0 12px 6px; font-size: 12px; font-weight: 700; color: var(--steel); letter-spacing: 0; }
.sidenav__item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 12px; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.3; }
@media (hover: hover) and (pointer: fine) { .sidenav__item:hover { background: #e4e9ee; text-decoration: none; } }
.sidenav__item .icon { width: 18px; height: 18px; color: var(--steel); }
.sidenav__item.is-active { background: var(--ink-deep); color: var(--canvas); }
.sidenav__item.is-active .icon { color: var(--canvas); }
.sidenav__label { flex: 1 1 auto; min-width: 0; }

.sidebar__profile { display: flex; align-items: center; gap: 10px; padding: var(--sp-md) 0 0 12px; border-top: 1px solid var(--hairline-soft); }
.sidebar__who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--ink-deep); overflow-wrap: anywhere; }
.sidebar__who span { font-size: 12px; font-weight: 500; color: var(--steel); }
.sidebar__profile .icon-btn { background: transparent; color: var(--steel); }
@media (hover: hover) and (pointer: fine) { .sidebar__profile .icon-btn:hover { background: #e4e9ee; color: var(--ink-deep); } }
.sidebar__profile .avatar { width: 32px; height: 32px; font-size: 13px; }

.mobilebar { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 85; background: rgba(10, 19, 23, 0.4); }

.pilltab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
@media (hover: hover) and (pointer: fine) { .pilltab:hover { text-decoration: none; border-color: var(--ink-deep); } }
.pilltab.is-active { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--canvas); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); }

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--critical);
  color: var(--canvas);
  font-size: 12px;
  font-weight: 700;
}
@media (hover: hover) and (pointer: fine) { a.count:hover { text-decoration: none; } }
.count--muted { background: rgba(10, 19, 23, 0.08); color: var(--charcoal); }
.count.is-bumped { animation: count-bump 700ms var(--ease); }
@keyframes count-bump { 30% { transform: scale(1.35); } 100% { transform: none; } }
.is-active .count--muted { background: rgba(255, 255, 255, 0.18); color: var(--canvas); }

.search-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  height: 40px;
  width: 240px;
  padding: 0 var(--sp-base);
  border-radius: var(--r-full);
  background: var(--surface-soft);
  color: var(--steel);
  flex: 0 0 auto;
}
.search-pill input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.search-pill:focus-within { box-shadow: inset 0 0 0 2px var(--fb-blue); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 0;
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--surface-soft); text-decoration: none; } }

/* Page skeleton */
.page { flex: 1 0 auto; padding: var(--sp-xxxl) 0 var(--sp-section); }
.page-head { display: flex; flex-direction: column; gap: var(--sp-md); margin-bottom: var(--sp-xxl); }
.page-head__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-base); flex-wrap: wrap; }
.page-head__row .h1 { display: flex; align-items: center; gap: var(--sp-md); }
.page-head__meta { display: flex; align-items: center; gap: var(--sp-xs); flex-wrap: wrap; }
.page-head__actions { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--steel); }
.crumbs a { color: var(--steel); }
@media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--ink); } }
.crumbs__sep { color: var(--stone); }
.crumbs__here { color: var(--ink); font-weight: 700; }

.section { margin-bottom: var(--sp-xxl); }
.section-label, .card__title {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: 18px;
  line-height: 1.44;
  font-weight: 700;
  color: var(--ink-deep);
  margin-bottom: var(--sp-base);
}
.section-label .icon { color: var(--steel); }

.stack { display: flex; flex-direction: column; gap: var(--sp-xl); min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-xl); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-xl); }

/* Cards */
.card, .panel {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  min-width: 0;
}
.card--flush, .frame { background: var(--canvas); border: 1px solid var(--hairline-soft); border-radius: var(--r-xl); overflow: hidden; min-width: 0; }
.card--soft { background: var(--surface-soft); border-color: transparent; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-base); margin-bottom: var(--sp-lg); }
.card__head .card__title { margin-bottom: 0; }
.card--flush .card__head { padding: var(--sp-lg) var(--sp-xl) 0; margin-bottom: var(--sp-md); }
.card__sub { font-size: 14px; color: var(--steel); margin-top: 2px; }
.card__foot { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; margin-top: var(--sp-xl); padding-top: var(--sp-lg); border-top: 1px solid var(--hairline-soft); }
.card__link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.card__link .icon { width: 16px; height: 16px; }

.card.is-flashed { animation: card-flash 1800ms var(--ease); }
@keyframes card-flash {
  0% { box-shadow: 0 0 0 0 rgba(49, 162, 76, 0); }
  20% { box-shadow: 0 0 0 4px rgba(49, 162, 76, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(49, 162, 76, 0); }
}

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-base); }
.kpi {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xxs);
  padding: var(--sp-lg) var(--sp-xl);
  border-radius: var(--r-xl);
  background: var(--surface-soft);
  color: inherit;
  min-width: 0;
}
@media (hover: hover) and (pointer: fine) { a.kpi:hover { text-decoration: none; background: #e8edf2; } }
.kpi__label { font-size: 14px; color: var(--steel); display: flex; align-items: center; gap: 6px; }
.kpi__value { font-size: 28px; line-height: 1.21; font-weight: 500; color: var(--ink-deep); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi__hint { font-size: 12px; color: var(--steel); }
.kpi--alert .kpi__value { color: var(--critical); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  min-height: 44px;
  padding: 12px 28px;
  border: 2px solid transparent;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) { .btn:hover { text-decoration: none; } }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; transform: none; }

.btn--primary, .btn-pill { background: var(--ink-button); color: var(--canvas); }
@media (hover: hover) and (pointer: fine) { .btn--primary:hover, .btn-pill:hover { background: #22272b; color: var(--canvas); } }
.btn--primary:active, .btn-pill:active { background: var(--charcoal); }
.btn--primary:disabled, .btn-pill:disabled { background: var(--disabled); color: var(--canvas); }

.btn--cobalt { background: var(--primary); color: var(--canvas); }
@media (hover: hover) and (pointer: fine) { .btn--cobalt:hover { background: var(--primary-deep); color: var(--canvas); } }
.btn--cobalt:disabled { background: var(--disabled); }

.btn--secondary, .btn-ghost { background: transparent; color: var(--ink-deep); border-color: var(--ink-deep); }
@media (hover: hover) and (pointer: fine) { .btn--secondary:hover, .btn-ghost:hover { background: var(--surface-soft); color: var(--ink-deep); } }

.btn--ghost, .btn-line { background: transparent; color: var(--ink-deep); border-color: var(--ghost-border); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover, .btn-line:hover { border-color: var(--ink-deep); color: var(--ink-deep); } }
.btn--ghost:disabled, .btn-line:disabled, .btn--secondary:disabled, .btn-ghost:disabled { color: var(--disabled); border-color: var(--hairline-soft); background: transparent; }

.btn--danger { background: transparent; color: var(--critical); border-color: rgba(228, 30, 63, 0.35); }
@media (hover: hover) and (pointer: fine) { .btn--danger:hover { background: var(--critical-tint); border-color: var(--critical); color: var(--critical); } }
.btn--danger:disabled { color: var(--disabled); border-color: var(--hairline-soft); background: transparent; }

.btn--sm, .btn-ghost--sm, .btn-line--sm { min-height: 36px; padding: 6px 16px; }
.btn--block { width: 100%; }
.btn--sm.btn--square { width: 36px; padding: 0; justify-content: center; flex: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-arrow { display: inline-block; transition: transform 160ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .btn:hover .btn-arrow { transform: translateX(3px); } }

.inline-form { margin: 0; display: inline-flex; }

/* Badges */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.33;
  white-space: nowrap;
}
.badge--success { background: var(--success); color: var(--canvas); }
.badge--xs { padding: 1px 7px; font-size: 11px; letter-spacing: 0; }
.version-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.badge--attention, .pill--attention, .badge--warn { background: var(--attention); color: var(--canvas); }
.badge--critical { background: var(--critical); color: var(--canvas); }
.badge--promo { background: var(--warning); color: var(--ink-deep); }
.badge--outline { background: transparent; border: 1px solid var(--hairline); color: var(--charcoal); }
.badge--cobalt { background: var(--primary-tint); color: var(--primary-deep); }
@media (hover: hover) and (pointer: fine) { a.badge:hover { text-decoration: none; filter: brightness(0.97); } }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; opacity: 0.9; }
.badge--neutral .dot, .pill .dot { background: var(--stone); }
.dot--pulse { background: var(--success) !important; animation: pulse 2.4s ease-in-out infinite; }
.dot--alert { background: var(--critical) !important; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* Forms */
label, .field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.43;
  color: var(--ink);
}

.field, .form-row { min-width: 0; }
.field__help, .field-help { display: block; margin-top: 6px; font-size: 14px; line-height: 1.43; color: var(--steel); }
.field__error { margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--critical-strong); }
.field__was { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--attention-ink); }

.input {
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-md);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}
.input::placeholder { color: var(--stone); }
@media (hover: hover) and (pointer: fine) { .input:hover { border-color: var(--stone); } }
.input:focus { border-color: var(--fb-blue); box-shadow: inset 0 0 0 1px var(--fb-blue); }
.input.is-invalid { border-color: var(--critical-strong); }
.input.is-changed { border-color: var(--primary); background: #f5f9ff; }
.input:disabled { background: var(--surface-soft); color: var(--steel); }
textarea.input { height: auto; min-height: 120px; padding: var(--sp-md); line-height: 1.5; resize: vertical; }
select.input {
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6c7b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 56px; }
.input-suffix__text { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 700; color: var(--steel); pointer-events: none; }
.input-with-btn { display: flex; gap: var(--sp-xs); }
.input-with-btn .input { flex: 1 1 auto; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-lg) var(--sp-xl); }
.form-grid .form-row--wide, .form-grid .field--wide { grid-column: 1 / -1; }
.form-grid__actions, .form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; }
.form-actions__status { font-size: 14px; color: var(--steel); }
.form-actions__status.is-dirty { color: var(--primary-deep); font-weight: 700; }
.field-group-label { display: block; font-size: 16px; font-weight: 700; color: var(--ink-deep); }
.field-help--lead { margin-top: 2px; max-width: 70ch; }
.field-counter { margin-top: 4px; font-size: 12px; color: var(--stone); text-align: right; font-variant-numeric: tabular-nums; }
.field-counter.is-near { color: var(--attention-ink); }
.field-counter.is-limit { color: var(--critical-strong); font-weight: 700; }

.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-md); }
.radio-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radio-card { position: relative; margin: 0; cursor: pointer; font-weight: 400; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card__box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: var(--sp-base) var(--sp-lg);
  border: 1px solid var(--ghost-border);
  border-radius: var(--r-lg);
  background: var(--canvas);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.radio-card__title { font-size: 16px; font-weight: 700; color: var(--ink-deep); }
.radio-card__text { font-size: 13px; color: var(--steel); line-height: 1.4; }
@media (hover: hover) and (pointer: fine) { .radio-card:hover .radio-card__box { border-color: var(--stone); } }
.radio-card input:checked + .radio-card__box { border-color: var(--primary-select); box-shadow: inset 0 0 0 1px var(--primary-select); }
.radio-card input:focus-visible + .radio-card__box { outline: 2px solid var(--fb-blue); outline-offset: 2px; }
.radio-card--debit input:checked + .radio-card__box { border-color: var(--critical); box-shadow: inset 0 0 0 1px var(--critical); }

.game-group { display: flex; flex-direction: column; gap: var(--sp-sm); }
.game-group__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); flex-wrap: wrap; }
.game-group__title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-deep); display: flex; align-items: center; gap: var(--sp-xs); }
.game-group__actions { display: flex; gap: var(--sp-xs); }
.game-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-xs); }
.game-toggle { display: flex; align-items: center; gap: var(--sp-sm); margin: 0; padding: var(--sp-sm) var(--sp-md); border: 1px solid var(--ghost-border); border-radius: var(--r-lg); background: var(--canvas); cursor: pointer; font-weight: 500; transition: border-color 150ms var(--ease), background 150ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .game-toggle:hover { border-color: var(--stone); } }
.game-toggle input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink-button); }
.game-toggle__title { font-size: 14px; color: var(--ink-deep); line-height: 1.3; }
.game-toggle:has(input:not(:checked)) { background: var(--surface-soft); border-style: dashed; }
.game-toggle:has(input:not(:checked)) .game-toggle__title { color: var(--stone); text-decoration: line-through; }
.game-toggle:has(input:disabled) { cursor: default; }
.game-toggle:has(input:focus-visible) { outline: 2px solid var(--fb-blue); outline-offset: 2px; }

/* Notices & toasts */
.notice {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-base) var(--sp-lg);
  border-radius: var(--r-xl);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.43;
}
.notice + .notice { margin-top: var(--sp-xs); }
.notice__icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; margin-top: 1px; }
.notice__body { min-width: 0; }
.notice__title { font-weight: 700; color: var(--ink-deep); }
.notice__line { margin-top: 2px; overflow-wrap: anywhere; }
.notice__time { margin-top: 4px; font-size: 12px; color: var(--steel); }
.notice--success { background: var(--success-tint); }
.notice--success .notice__icon { color: var(--success); }
.notice--error { background: var(--critical-tint); box-shadow: inset 0 0 0 1px rgba(228, 30, 63, 0.25); }
.notice--error .notice__icon { color: var(--critical); }
.notice--info { background: var(--primary-tint); }
.notice--info .notice__icon { color: var(--primary-deep); }
.notice--warn { background: var(--attention-tint); }
.notice--warn .notice__icon { color: var(--attention-ink); }
.card > .notice, .card form > .notice { margin-bottom: var(--sp-lg); }

.toasts {
  position: fixed;
  top: calc(var(--nav-h) + 16px);
  right: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-base) var(--sp-lg);
  border-radius: var(--r-xl);
  background: var(--ink-deep);
  color: var(--canvas);
  box-shadow: var(--shadow-float);
  font-size: 14px;
  line-height: 1.43;
  pointer-events: auto;
  animation: toast-in 260ms var(--ease) both;
}
.toast.is-leaving { animation: toast-out 220ms var(--ease) both; }
.toast__icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.toast--success .toast__icon { color: #5fd47b; }
.toast--error { background: var(--critical); }
.toast--info .toast__icon { color: #7cc0ff; }
.toast__body { flex: 1 1 auto; min-width: 0; }
.toast__title { font-weight: 700; }
.toast__line { margin-top: 2px; color: rgba(255, 255, 255, 0.86); overflow-wrap: anywhere; }
.toast__close { flex: 0 0 auto; width: 28px; height: 28px; margin: -4px -8px 0 0; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, 0.7); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@media (hover: hover) and (pointer: fine) { .toast__close:hover { background: rgba(255, 255, 255, 0.12); color: var(--canvas); } }
.toast__close .icon { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

.sync-banner {
  position: sticky;
  top: var(--nav-h);
  z-index: 45;
  background: var(--warning);
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 700;
}
.sync-banner[hidden] { display: none; }
.sync-banner__inner { max-width: var(--page-max); margin: 0 auto; padding: var(--sp-md) var(--sp-xxl); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-base); flex-wrap: wrap; }
.sync-banner .btn { min-height: 36px; padding: 6px 18px; background: var(--ink-deep); color: var(--canvas); }

/* Tables */
.table-scroll { overflow-x: auto; }
.th-sort { color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort.is-active { color: var(--ink); }
.data-table, .table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.43; }
.data-table th, .table th {
  text-align: left;
  padding: var(--sp-md) var(--sp-base);
  font-size: 12px;
  font-weight: 700;
  color: var(--steel);
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline-soft);
  white-space: nowrap;
}
.data-table td, .table td { padding: var(--sp-md) var(--sp-base); border-bottom: 1px solid var(--hairline-soft); vertical-align: middle; color: var(--ink); }
.data-table tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .data-table tbody tr:hover td, .table tbody tr:hover td { background: #f7f9fb; } }
.data-table a, .table a { color: var(--ink-deep); font-weight: 700; }
.data-table .muted, .table .muted { color: var(--steel); }
.table td.is-num, .table th.is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-plus { color: var(--success); font-weight: 700; }
.amount-minus { color: var(--ink); }
.cell-main { display: block; font-weight: 700; color: var(--ink-deep); }
.cell-sub { display: block; font-size: 13px; color: var(--steel); margin-top: 1px; }
[data-href] { cursor: pointer; }
.data-table--compact th, .data-table--compact td { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.data-table td.is-warn { color: var(--attention-ink); font-weight: 700; background: rgba(242, 169, 24, 0.08); }
.data-table td.is-bad { color: var(--critical); font-weight: 700; background: rgba(228, 30, 63, 0.06); }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th { text-align: left; font-weight: 700; color: var(--ink); padding: 10px 0; width: 46%; vertical-align: top; }
.spec-table td { color: var(--charcoal); padding: 10px 0; text-align: right; overflow-wrap: anywhere; }
.spec-table tr + tr th, .spec-table tr + tr td { border-top: 1px solid var(--hairline-soft); }

.table-empty, .empty { padding: var(--sp-xxl) var(--sp-xl); text-align: center; color: var(--steel); font-size: 14px; }
.empty-link { font-weight: 700; }

.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md) var(--sp-base); border-bottom: 1px solid var(--hairline-soft); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .list-row--link:hover, .list-row[data-href]:hover { background: #f7f9fb; } }
.list-row__main { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink-deep); overflow-wrap: anywhere; }
.list-row__main--wrap { white-space: normal; overflow-wrap: anywhere; }
.list-row__sub { display: block; font-size: 13px; font-weight: 400; color: var(--steel); overflow-wrap: anywhere; }
.list-row__meta { font-size: 12px; color: var(--steel); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; padding: var(--sp-lg) 0 0; flex-wrap: wrap; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
@media (hover: hover) and (pointer: fine) { .page-btn:hover { text-decoration: none; border-color: var(--ink-deep); } }
.page-btn.active { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--canvas); }
.page-btn.disabled { color: var(--disabled); border-color: var(--hairline-soft); pointer-events: none; }
.page-btn .icon { width: 16px; height: 16px; }
.page-gap { color: var(--stone); padding: 0 2px; }

/* Filters */
.filter-bar { display: flex; align-items: flex-end; gap: var(--sp-base); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.filter-bar .form-row, .filter-bar .field { flex: 0 1 220px; }
.filter-bar .form-row--grow, .filter-bar .field--grow { flex: 1 1 280px; max-width: 460px; }
.filter-bar .form-row--date { flex: 0 1 170px; }
.filter-bar .form-row--version { flex: 0 1 340px; }
.filter-pills { display: flex; gap: var(--sp-xs); flex-wrap: wrap; margin-bottom: var(--sp-lg); }

/* Split layout with sticky rail (client page, ticket page) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-xxl); align-items: start; }
.rail { position: sticky; top: calc(var(--nav-h) + 24px); display: flex; flex-direction: column; gap: var(--sp-base); }
.rail-card { background: var(--canvas); border: 1px solid var(--hairline-soft); border-radius: var(--r-xl); padding: var(--sp-xl); box-shadow: var(--shadow-panel); }
.rail-card__label { font-size: 14px; color: var(--steel); }
.rail-card__balance { display: inline-block; font-size: 36px; line-height: 1.2; font-weight: 500; color: var(--ink-deep); font-variant-numeric: tabular-nums; margin: 2px 0 var(--sp-base); white-space: nowrap; border-radius: var(--r-sm); }
.rail-card__balance.is-low { color: var(--critical); }
.rail-card__actions { display: flex; flex-direction: column; gap: var(--sp-xs); margin-top: var(--sp-lg); }
.rail-card__actions form { margin: 0; display: flex; }
.rail-card__actions .btn { width: 100%; }
.rail-card .spec-table th, .rail-card .spec-table td { padding: 8px 0; }
.sync-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--steel); margin-top: var(--sp-base); }
.sync-status .dot { background: var(--success); }
.sync-status.is-stale .dot { background: var(--attention); }
.sync-status.is-offline .dot { background: var(--critical); }
.is-updated { animation: value-flash 1600ms var(--ease); }
@keyframes value-flash { 0% { background: rgba(247, 185, 40, 0.6); } 100% { background: transparent; } }

.pilltabs { display: flex; gap: var(--sp-xs); flex-wrap: wrap; margin-bottom: var(--sp-xl); }

/* Client header */
.client-head { display: flex; align-items: center; gap: var(--sp-lg); min-width: 0; }
.client-head__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink-deep);
  color: var(--canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex: 0 0 auto;
  text-transform: uppercase;
}
.avatar--sm { width: 36px; height: 36px; font-size: 14px; }

/* Support thread */
.thread { display: flex; flex-direction: column; gap: var(--sp-md); }
.bubble { max-width: 78%; padding: var(--sp-md) var(--sp-base); border-radius: var(--r-xl); background: var(--surface-soft); color: var(--ink); }
.bubble--user { align-self: flex-start; border-bottom-left-radius: var(--r-sm); }
.bubble--admin { align-self: flex-end; background: var(--ink-deep); color: var(--canvas); border-bottom-right-radius: var(--r-sm); }
.bubble__meta { display: flex; justify-content: space-between; gap: var(--sp-base); font-size: 12px; font-weight: 700; margin-bottom: 4px; color: var(--steel); }
.bubble--admin .bubble__meta { color: rgba(255, 255, 255, 0.65); }
.bubble__text { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.reply-form { margin-top: var(--sp-xl); }
.reply-form__actions { display: flex; gap: var(--sp-md); flex-wrap: wrap; margin-top: var(--sp-md); }

/* Stats (legacy markup) */
.stat-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-base); }
.frame.stat-band { border: 0; border-radius: 0; overflow: visible; background: transparent; }
.stat-cell { padding: var(--sp-lg) var(--sp-xl); border-radius: var(--r-xl); background: var(--surface-soft); min-width: 0; }
.stat-cell__value { font-size: 28px; line-height: 1.21; font-weight: 500; color: var(--ink-deep); font-variant-numeric: tabular-nums; }
.stat-cell__label { margin-top: 4px; font-size: 14px; color: var(--steel); display: flex; align-items: center; gap: 6px; }
.stats-note, .stats-legend { margin: 0 0 var(--sp-base); font-size: 14px; color: var(--steel); }
.tone-chip { display: inline-block; font-size: 12px; font-weight: 700; border-radius: var(--r-full); padding: 2px 10px; margin-right: 4px; }
.tone-chip.is-warn { background: var(--attention); color: var(--canvas); }
.tone-chip.is-bad { background: var(--critical); color: var(--canvas); }
.dash-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-xl); align-items: start; }
.dash-columns > * { min-width: 0; }
.stats-session { border-bottom: 1px solid var(--hairline-soft); }
.stats-session:last-child { border-bottom: 0; }
.stats-session > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-lg); padding: var(--sp-md) var(--sp-base); font-size: 14px; }
.stats-session > summary::-webkit-details-marker { display: none; }
.stats-session > summary:hover, .stats-session[open] > summary { background: #f7f9fb; }
.stats-session__main { min-width: 0; font-weight: 700; color: var(--ink-deep); }
.stats-session__body { border-top: 1px solid var(--hairline-soft); padding: var(--sp-lg); display: flex; flex-direction: column; gap: var(--sp-lg); background: var(--surface-soft); }
.stats-block, .stats-player { background: var(--canvas); border: 1px solid var(--hairline-soft); border-radius: var(--r-xl); overflow: hidden; min-width: 0; }
.stats-player__head { display: flex; flex-wrap: wrap; gap: var(--sp-xs) var(--sp-lg); padding: var(--sp-md) var(--sp-base); border-bottom: 1px solid var(--hairline-soft); font-size: 14px; font-weight: 700; color: var(--ink-deep); }
.stats-sub { padding: var(--sp-md) var(--sp-base) 4px; font-size: 12px; font-weight: 700; color: var(--steel); }
.stats-inline { display: flex; flex-wrap: wrap; gap: 4px var(--sp-lg); padding: 0 var(--sp-base) var(--sp-md); font-size: 13px; }
.rule { border: 0; border-top: 1px solid var(--hairline-soft); margin: 0 0 var(--sp-xxl); }

/* Login */
.login-body { background: var(--surface-soft); }
.login-wrap { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--sp-section) var(--sp-xl); }
.login-head { text-align: center; margin-bottom: var(--sp-xxl); display: flex; flex-direction: column; gap: var(--sp-xs); }
.login-card { width: 100%; max-width: 420px; background: var(--canvas); border-radius: var(--r-xxl); padding: var(--sp-xxxl); display: flex; flex-direction: column; gap: var(--sp-lg); box-shadow: var(--shadow-panel); }
.login-foot { margin-top: var(--sp-xl); font-size: 14px; color: var(--steel); text-align: center; }

/* Footer */
.foot { border-top: 1px solid var(--hairline-soft); padding: var(--sp-xl) 0; font-size: 14px; color: var(--steel); }
.foot__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-base); flex-wrap: wrap; }
.foot a { color: var(--steel); }

.notfound { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-xl); text-align: center; padding: var(--sp-section) var(--sp-xl); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

.kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.row-link { color: inherit; }
@media (hover: hover) and (pointer: fine) { .row-link:hover { text-decoration: none; } }
.list-row > .icon--sm { color: var(--stone); }
.section > .card__head { margin-bottom: var(--sp-md); }
h2.section-label { margin: 0; }

.card.card--flush { padding: 0; }
.card--flush .table th:first-child, .card--flush .table td:first-child { padding-left: var(--sp-xl); }
.card--flush .table th:last-child, .card--flush .table td:last-child { padding-right: var(--sp-xl); }
.card--flush .list-row { padding-left: var(--sp-xl); padding-right: var(--sp-xl); }
.card--flush > .empty { padding-top: var(--sp-lg); }
.split .kpi__value { font-size: 22px; }

.data-table td.mono, .data-table .mono { font-family: var(--font); font-size: inherit; font-variant-numeric: tabular-nums; }

/* Workspace: list pane + main */
.page--workspace { padding: var(--sp-xl) 0 var(--sp-section); }
.workspace { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--sp-xl); display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--sp-xl); align-items: start; }
.workspace__main { min-width: 0; }
.workspace__main > .page-head { margin-bottom: var(--sp-xl); }

.pane {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px);
  max-height: calc(100dvh - var(--nav-h) - 32px);
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.pane__head { display: flex; flex-direction: column; gap: var(--sp-md); padding: var(--sp-base); border-bottom: 1px solid var(--hairline-soft); }
.pane__title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xs); }
.pane__actions { display: flex; align-items: center; gap: var(--sp-xs); }
.pane__title { font-size: 18px; font-weight: 700; color: var(--ink-deep); display: flex; align-items: center; gap: 8px; }
.pane__list { overflow-y: auto; padding: var(--sp-xs); display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.pane__empty { padding: var(--sp-base); text-align: center; font-size: 14px; color: var(--steel); }

.pane-item { display: flex; align-items: center; gap: var(--sp-md); padding: 10px 12px; border-radius: 12px; color: var(--ink); min-width: 0; }
@media (hover: hover) and (pointer: fine) { .pane-item:hover { background: var(--surface-soft); text-decoration: none; } }
.pane-item.is-active { background: var(--ink-deep); color: var(--canvas); }
.pane-item.is-active .avatar { background: var(--canvas); color: var(--ink-deep); }
.pane-item__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pane-item__title { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.pane-item__sub { font-size: 12px; color: var(--steel); overflow-wrap: anywhere; }
.pane-item.is-active .pane-item__sub, .pane-item.is-active .pane-item__meta, .pane-item.is-active .pane-item__closed { color: rgba(255, 255, 255, 0.7); }
.pane-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.pane-item__value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pane-item__value.is-alert { color: var(--critical); }
.pane-item.is-active .pane-item__value.is-alert { color: #ff8da0; }
.pane-item__meta, .pane-item__closed { font-size: 12px; color: var(--steel); white-space: nowrap; }
.pane-item__flags { display: flex; gap: 3px; }
.flag { width: 8px; height: 8px; border-radius: 50%; background: var(--stone); }
.flag--waiting { background: var(--attention); }
.flag--low { background: var(--critical); }
.flag--outdated { background: #a121ce; }
.flag--points { background: var(--primary); }
.points-rows .list-row { align-items: flex-start; }
.points-rows .list-row__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--canvas);
  color: var(--ink);
  font: 700 13px/1.4 var(--font);
  cursor: pointer;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--ink-deep); text-decoration: none; } }
.chip span { color: var(--steel); font-weight: 500; }
.chip.is-active { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--canvas); }
.chip.is-active span { color: rgba(255, 255, 255, 0.7); }
.chip--alert span { color: var(--critical); font-weight: 700; }
.chip--alert.is-active span { color: #ff8da0; }

.input--sm { height: 40px; font-size: 14px; border-radius: var(--r-full); background: var(--surface-soft); border-color: transparent; padding: 0 var(--sp-base); }
.input--sm:focus { background: var(--canvas); }
/* iOS Safari zooms the page into any field under 16px on focus */
@media (pointer: coarse) { .input--sm, .search-pill input { font-size: 16px; } }


/* Client list */
.list-toolbar { display: flex; align-items: center; gap: var(--sp-md) var(--sp-base); flex-wrap: wrap; padding: var(--sp-base) var(--sp-xl); border-bottom: 1px solid var(--hairline-soft); }
.list-toolbar__search { flex: 0 1 340px; min-width: 200px; }
.list-toolbar__count { margin-left: auto; font-size: 13px; color: var(--steel); }
.client-cell { display: flex; align-items: center; gap: var(--sp-md); min-width: 0; }
@media (hover: hover) and (pointer: fine) { .client-cell:hover { text-decoration: none; } }
.client-cell__text { display: flex; flex-direction: column; min-width: 0; }
.cell-main.is-alert { color: var(--critical); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }

/* Invite steps */
.steps { list-style: none; margin: 0 0 var(--sp-xl); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-md); }
.steps__item { display: flex; align-items: flex-start; gap: var(--sp-md); padding: var(--sp-base); border-radius: var(--r-xl); background: var(--surface-soft); font-size: 14px; line-height: 1.43; color: var(--charcoal); }
.steps__item strong { color: var(--ink-deep); }
.steps__num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink-deep); color: var(--canvas); font-size: 13px; font-weight: 700; }

/* Client header card */
.client-card { background: var(--canvas); border: 1px solid var(--hairline-soft); border-radius: var(--r-xl); padding: var(--sp-xl); margin-bottom: var(--sp-lg); }
.client-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-base); flex-wrap: wrap; }
.client-card__actions { display: flex; gap: var(--sp-xs); flex-wrap: wrap; }
.client-card .sync-status { margin-top: var(--sp-md); }

.facts { display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(5, minmax(0, 1fr)); gap: var(--sp-md); margin: var(--sp-lg) 0 0; }
.facts--compact { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 var(--sp-xs); }
.fact { background: var(--surface-soft); border-radius: 12px; padding: 10px 14px; min-width: 0; }
.fact dt { font-size: 12px; color: var(--steel); margin-bottom: 2px; }
.fact dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-deep); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; border-radius: 4px; }
.fact dd.fact__big { white-space: nowrap; }
.fact dd.fact__big { font-size: 20px; line-height: 1.3; }
.fact dd.fact__big.is-low { color: var(--critical); }

.client-strip { display: flex; align-items: center; gap: var(--sp-lg); margin-top: var(--sp-base); padding: var(--sp-md) var(--sp-base); border-radius: 12px; background: var(--surface-soft); color: var(--ink); flex-wrap: wrap; }
@media (hover: hover) and (pointer: fine) { .client-strip:hover { text-decoration: none; background: #e8edf2; } }
.client-strip__main { display: flex; flex-direction: column; flex: 1 1 140px; min-width: 0; font-size: 14px; }
.client-strip__main span, .client-strip__fact span { font-size: 12px; font-weight: 400; color: var(--steel); }
.client-strip__fact { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; }

.balance-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: var(--sp-base); align-items: end; }
fieldset.radio-cards { border: 0; padding: 0; margin: 0; min-width: 0; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-xs); padding: var(--sp-section-sm) var(--sp-xl); }
.empty-state__icon { width: 44px; height: 44px; fill: none; stroke: var(--success); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--sp-xs); }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Responsive */

@media (max-width: 1023px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .kpis, .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .dash-columns, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
  :root { --nav-h: 56px; }
  .shell { display: block; }
  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    height: var(--nav-h);
    padding: 0 var(--sp-base) 0 var(--sp-xs);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--hairline-soft);
  }
  .mobilebar .brand { flex: 1 1 auto; min-width: 0; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 86vw);
    height: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 220ms var(--ease), visibility 0s linear 220ms;
    box-shadow: var(--shadow-float);
    z-index: 90;
  }
  .shell.is-nav-open .sidebar { transform: none; visibility: visible; transition: transform 220ms var(--ease); }
  .sidebar .sidebar__close { display: inline-flex; background: transparent; }
}

@media (max-width: 767px) {
  .container { padding-left: var(--sp-base); padding-right: var(--sp-base); }
  .page { padding-top: var(--sp-xl); }
  .h1, .heading-lg { font-size: 28px; }
  .form-grid, .radio-cards, .radio-cards--2 { grid-template-columns: 1fr; }
  .kpis, .stat-band { grid-template-columns: 1fr 1fr; gap: var(--sp-xs); }
  .kpi { padding: var(--sp-md) var(--sp-base); }
  .kpi__value { font-size: 22px; }
  .card, .panel, .rail-card { padding: var(--sp-lg); }
  .bubble { max-width: 92%; }
  .brand__tag { display: none; }
  .toasts { right: 16px; }
  .stats-session > summary { grid-template-columns: 1fr; gap: 2px; }
  .input-with-btn { flex-direction: column; }
}

@media (max-width: 1280px) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .balance-row { grid-template-columns: 1fr 1fr; }
  .balance-row .btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 1023px) {
  .workspace { grid-template-columns: minmax(0, 1fr); padding: 0 var(--sp-base); }
  .pane { position: static; max-height: none; }
  .pane .pane__list { max-height: 60vh; }
  .pane--secondary { display: none; }
  .steps { grid-template-columns: 1fr; }
  .kpis--3 { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 767px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .balance-row { grid-template-columns: 1fr; }
  .kpis--3 { grid-template-columns: 1fr; }
  .client-card { padding: var(--sp-lg); }
}

/* AI keys (/ai) */
.ai-key { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-xl); padding: var(--sp-lg) var(--sp-xl); border-top: 1px solid var(--hairline-soft); }
.ai-key:first-of-type { margin-top: var(--sp-md); }
.ai-key__main { display: grid; gap: var(--sp-sm); min-width: 0; align-content: start; }
.ai-note { padding: var(--sp-sm) var(--sp-xl) var(--sp-md); }
.ai-key__name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-sm); font-weight: 700; color: var(--ink-deep); }

/* Mobile adaptation (05.11.2026) */
@media (max-width: 767px) {
  .ai-key { grid-template-columns: 1fr; gap: var(--sp-sm); padding: var(--sp-md) var(--sp-lg); }
  .ai-note { padding-inline: var(--sp-lg); }
}
.list-row__badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-md); }
.table-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.card__head { flex-wrap: wrap; }
.btn { max-width: 100%; }
@media (pointer: coarse) { .btn--sm { min-height: 40px; } }

@media (max-width: 767px) {
  .page { padding-bottom: var(--sp-section-sm); }
  .btn { padding-left: 20px; padding-right: 20px; }
  .btn--sm { padding-left: 14px; padding-right: 14px; }
  .h2 { font-size: 20px; }
  .lead { font-size: 16px; }
  .page-head { margin-bottom: var(--sp-xl); }
  .page-head__row .h1 { flex-wrap: wrap; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; }

  .card--flush .card__head { padding: var(--sp-base) var(--sp-base) 0; }
  .card--flush .list-row { padding-left: var(--sp-base); padding-right: var(--sp-base); }
  .card--flush .table th:first-child, .card--flush .table td:first-child { padding-left: var(--sp-base); }
  .card--flush .table th:last-child, .card--flush .table td:last-child { padding-right: var(--sp-base); }
  .card__title { font-size: 17px; flex-wrap: wrap; }
  .card__foot .btn, .form-actions .btn { flex: 1 1 auto; }

  .pilltabs { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(-1 * var(--sp-base)); margin-right: calc(-1 * var(--sp-base)); padding: 0 var(--sp-base) 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-bottom: var(--sp-lg); }
  .pilltabs::-webkit-scrollbar { display: none; }
  .pilltabs .pilltab { flex: 0 0 auto; }

  .filter-bar { gap: var(--sp-md); margin-bottom: var(--sp-lg); }
  .filter-bar .form-row, .filter-bar .field, .filter-bar .form-row--grow, .filter-bar .field--grow, .filter-bar .form-row--version { flex: 1 1 100%; max-width: none; }
  .filter-bar .form-row--date { flex: 1 1 calc(50% - 6px); }
  .filter-bar > .btn { flex: 1 1 auto; }
  .filter-pills .chip, .chips .chip { padding: 7px 14px; }

  .list-toolbar { padding: var(--sp-md) var(--sp-base); }
  .list-toolbar__search { flex: 1 1 100%; min-width: 0; }
  .list-toolbar__count { margin-left: 0; }

  .client-card { padding: var(--sp-base); }
  .client-card__top { flex-direction: column; align-items: stretch; }
  .client-card__actions { width: 100%; }
  .client-card__actions .inline-form, .client-card__actions .btn { flex: 1 1 auto; }
  .client-head { gap: var(--sp-md); }
  .client-head .avatar { width: 44px; height: 44px; font-size: 16px; }
  .client-head__text .h1 { font-size: 24px; overflow-wrap: anywhere; }
  .client-head__text .h2 { overflow-wrap: anywhere; }
  .page-head__meta { min-width: 0; overflow-wrap: anywhere; }
  .facts { gap: var(--sp-xs); }
  .fact { padding: 8px 12px; }
  .fact dd.fact__big { font-size: 18px; }
  .facts--compact { grid-template-columns: 1fr 1fr; }
  .client-strip { gap: var(--sp-md); }

  .rail-card__balance { font-size: 30px; }
  .steps__item { padding: var(--sp-md); }
  .game-toggles { grid-template-columns: 1fr; }
  .radio-card__box { padding: var(--sp-md) var(--sp-base); }
  .spec-table th { width: 40%; }
  .thread { gap: var(--sp-sm); }
  .reply-form__actions .btn { flex: 1 1 auto; }

  .points-rows .list-row { flex-wrap: wrap; align-items: flex-start; row-gap: var(--sp-sm); column-gap: var(--sp-md); padding-top: var(--sp-base); padding-bottom: var(--sp-base); }
  .points-rows .list-row__main { flex: 1 1 calc(100% - 48px); }
  .points-rows .list-row__badges { flex: 1 1 100%; gap: 6px; padding-left: 48px; }
  .points-rows .list-row__actions { flex: 1 1 100%; justify-content: stretch; gap: var(--sp-xs); }
  .points-rows .list-row__actions .inline-form { flex: 1 1 140px; }
  .points-rows .list-row__actions .btn { width: 100%; }

  .table th, .table td { padding: 10px 12px; }

  .table--cards { display: block; }
  .table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--cards tbody { display: block; }
  .table--cards tr { display: flex; flex-wrap: wrap; gap: 6px var(--sp-lg); padding: var(--sp-md) var(--sp-base); border-bottom: 1px solid var(--hairline-soft); }
  .table--cards tbody tr:last-child { border-bottom: 0; }
  .table--cards td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .table--cards td:first-child { flex: 1 1 100%; }
  .table--cards td.muted { flex: 1 1 100%; }
  .table--cards td.is-num { text-align: left; }
  .table--cards tbody tr td { background: transparent; }
  .table--cards td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--stone); text-transform: uppercase; letter-spacing: 0.04em; }
  .table--cards td.muted::before { display: none; }
  .table--cards td.nowrap { white-space: normal; }
  .card--flush .table--cards td:first-child, .card--flush .table--cards td:last-child { padding-left: 0; padding-right: 0; }
}

@media (max-width: 380px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .facts, .facts--compact { grid-template-columns: 1fr; }
  .h1, .heading-lg { font-size: 24px; }
  .kpis, .stat-band { grid-template-columns: 1fr; }
}
