/* =============================================================================
   ПивМастер UI skins — radical themes (not just recolor)
   data-ui: default | enterprise | charcoal | kilbil | neon
   ============================================================================= */

/* —— Theme picker chrome —— */
.ui-theme-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) + 20);
  background: rgba(24, 32, 32, 0.5);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.ui-theme-overlay[hidden],
.ui-theme-dialog[hidden] {
  display: none !important;
}

.ui-theme-dialog {
  position: fixed;
  z-index: calc(var(--z-drawer) + 21);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  max-height: min(90vh, 680px);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel, 12px);
  box-shadow: 0 18px 48px rgba(24, 32, 32, 0.28);
}

body.ui-theme-dialog-open { overflow: hidden; }

.ui-theme-dialog-chrome {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ui-theme-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ui-theme-dialog-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.ui-theme-dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-control, 6px);
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ui-theme-dialog-close:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.ui-theme-dialog-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.ui-theme-options {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-theme-option {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control, 8px);
  background: var(--surface);
  cursor: pointer;
}

.ui-theme-option:has(input:checked) {
  border-color: var(--hop);
  background: var(--hop-wash);
  box-shadow: inset 3px 0 0 var(--hop);
}

.ui-theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ui-theme-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ui-theme-option-copy strong { font-size: 14px; font-weight: 700; }
.ui-theme-option-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }

.ui-theme-swatch {
  width: 52px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background:
    linear-gradient(90deg, var(--swatch-side, #304040) 34%, transparent 34%),
    linear-gradient(180deg, var(--swatch-top, #fff) 38%, var(--swatch-canvas, #f5f3ee) 38%);
}

.ui-theme-swatch-default {
  --swatch-side: #f8f6f1;
  --swatch-top: #fff;
  --swatch-canvas: #f5f3ee;
  box-shadow: inset 0 0 0 2px #e8a830;
}

.ui-theme-swatch-light {
  --swatch-side: #efeee9;
  --swatch-top: #fff;
  --swatch-canvas: #f6f5f2;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 0 0 2px #eaa52b;
}

.ui-theme-swatch-dark {
  --swatch-side: #16181e;
  --swatch-top: #1c1f27;
  --swatch-canvas: #12141a;
  border-radius: 9px;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px #eaa52b;
}

.ui-theme-swatch-glass {
  --swatch-side: rgba(255, 255, 255, 0.45);
  --swatch-top: rgba(255, 255, 255, 0.7);
  --swatch-canvas: #cfdcf0;
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.2) 55%, transparent 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 34%, transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(90, 170, 255, 0.55), transparent 48%),
    radial-gradient(circle at 12% 88%, rgba(140, 120, 255, 0.4), transparent 50%),
    linear-gradient(180deg, #eaf1fb 0%, #c5d4eb 100%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(40, 60, 100, 0.12),
    inset 0 0 0 2px #007aff;
}

.ui-theme-swatch-enterprise {
  --swatch-side: #0b1220;
  --swatch-top: #fff;
  --swatch-canvas: #eef2f7;
  box-shadow: inset 0 0 0 2px #2065d1;
  border-radius: 2px;
}

.ui-theme-swatch-charcoal {
  --swatch-side: #121818;
  --swatch-top: #1e2a2a;
  --swatch-canvas: #161e1e;
  box-shadow: inset 0 0 0 2px #e8a830;
}

.ui-theme-swatch-kilbil {
  --swatch-side: #fff;
  --swatch-top: #fff;
  --swatch-canvas: #f4f5f5;
  box-shadow: inset 0 0 0 2px #e8a830;
  border-radius: 10px;
}

.ui-theme-swatch-neon {
  --swatch-side: #070a12;
  --swatch-top: #0e1522;
  --swatch-canvas: #0a101c;
  box-shadow: inset 0 0 0 2px #2ee6ff, 0 0 10px rgba(46, 230, 255, 0.45);
  border-radius: 8px;
  border-color: rgba(46, 230, 255, 0.35);
}

.ui-theme-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.ui-theme-dialog-actions .button-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

/* Kilbil KPI strip (injected) */
.theme-kpi-strip {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

html[data-ui="kilbil"] .theme-kpi-strip {
  display: grid;
}

.theme-kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 118px;
  padding: 16px 16px 12px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(48, 64, 64, 0.08);
  border: 0;
  overflow: hidden;
}

.theme-kpi-card .kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.theme-kpi-card .kpi-value {
  font-family: var(--font-brand);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.theme-kpi-card.is-neg .kpi-value { color: var(--danger); }

.theme-kpi-card .kpi-sub {
  font-size: 11px;
  color: var(--muted);
}

.theme-kpi-card .kpi-spark {
  margin-top: auto;
  width: 100%;
  height: 34px;
}

.theme-kpi-card .kpi-spark .fill { fill: color-mix(in srgb, var(--hop) 22%, transparent); }
.theme-kpi-card .kpi-spark .line { fill: none; stroke: var(--hop-dark); stroke-width: 2; }
.theme-kpi-card.is-neg .kpi-spark .fill { fill: color-mix(in srgb, var(--danger) 16%, transparent); }
.theme-kpi-card.is-neg .kpi-spark .line { stroke: var(--danger); }

@media (max-width: 1100px) {
  .theme-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .theme-kpi-strip { grid-template-columns: 1fr; }
}

/* =============================================================================
   ENTERPRISE — dense BI / sharp / blue
   ============================================================================= */

html[data-ui="enterprise"] {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --canvas: #eef2f7;
  --canvas-deep: #e2e8f0;
  --charcoal: #0b1220;
  --charcoal-elevated: #020617;
  --charcoal-hover: #1e293b;
  --hop: #2563eb;
  --hop-dark: #1d4ed8;
  --hop-deeper: #1e3a8a;
  --hop-soft: #bfdbfe;
  --hop-wash: #eff6ff;
  --on-hop: #ffffff;
  --success: #047857;
  --success-bg: #ecfdf5;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --focus: #2563eb;
  --link: #1d4ed8;
  --table-header-bg: #f8fafc;
  --table-header-fg: #475569;
  --accent: #2563eb;
  --bg: #eef2f7;
  --panel: #f1f5f9;
  --radius: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-control: 0;
  --radius-panel: 0;
  --radius-avatar: 0;
  --shadow: none;
  --shadow-panel: none;
  --control-min-height: 32px;
  --density-pad: 5px 10px;
  --text-title: 1.35rem;
  --text-section: 0.95rem;
  --text-body: 0.875rem;
  --text-body-compact: 0.8125rem;
  --dur-enter: 100ms;
  --dur-ui: 90ms;
  --dur-fast: 70ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  /* Type: один гротеск — плотный BI, без «брендового» Manrope */
  --font-brand: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --leading-copy: 1.45;
  --leading-compact: 1.35;
  --leading-tight: 1.25;
}

html[data-ui="enterprise"] body,
html[data-ui="enterprise"] .main-content {
  background: #eef2f7;
  color: #0f172a;
  letter-spacing: 0;
}

html[data-ui="enterprise"] .sidebar {
  width: 200px !important;
  background: #0b1220 !important;
  color: #e2e8f0 !important;
  border-right: 1px solid #1e293b !important;
}

html[data-ui="enterprise"] .app-column {
  margin-left: 200px;
  background: #eef2f7;
}

html[data-ui="enterprise"] .sidebar .brand {
  background: #020617 !important;
  border-bottom-color: #1e293b !important;
  min-height: 48px;
  padding-top: 10px;
  padding-bottom: 10px;
}

html[data-ui="enterprise"] .sidebar .brand-logo {
  filter: brightness(0) invert(1);
  height: 14px;
  opacity: 0.92;
}

html[data-ui="enterprise"] .nav-label {
  color: #64748b;
  font-size: 10px;
  letter-spacing: 0.14em;
}

html[data-ui="enterprise"] .side-nav a {
  border-radius: 0 !important;
  font-size: 13px;
  padding: 7px 10px;
  color: #cbd5e1;
}

html[data-ui="enterprise"] .side-nav a[aria-current="page"] {
  color: #93c5fd !important;
  background: #1e293b !important;
  box-shadow: inset 2px 0 0 #2563eb !important;
  font-weight: 700;
}

html[data-ui="enterprise"] .nav-group + .nav-group {
  border-top-color: #1e293b;
}

html[data-ui="enterprise"] .sidebar-footer,
html[data-ui="enterprise"] .sidebar .role-badge {
  color: #64748b;
  border-color: #1e293b;
  border-radius: 0 !important;
}

html[data-ui="enterprise"] .topbar {
  height: 48px;
  background: #ffffff !important;
  border-bottom: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

html[data-ui="enterprise"] .main-content {
  padding-top: 16px;
  max-width: none;
}

html[data-ui="enterprise"] h1,
html[data-ui="enterprise"] .page-heading h1 {
  font-size: 1.35rem !important;
  letter-spacing: -0.01em;
  text-transform: none;
}

html[data-ui="enterprise"] h2 {
  font-size: 0.95rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html[data-ui="enterprise"] .button,
html[data-ui="enterprise"] .button-export,
html[data-ui="enterprise"] .filter-trigger,
html[data-ui="enterprise"] .icon-button,
html[data-ui="enterprise"] .field input:not([type="checkbox"]),
html[data-ui="enterprise"] .field select,
html[data-ui="enterprise"] .alert,
html[data-ui="enterprise"] .avatar,
html[data-ui="enterprise"] .ui-theme-option,
html[data-ui="enterprise"] .ui-theme-dialog,
html[data-ui="enterprise"] .filter-dialog,
html[data-ui="enterprise"] .count-badge,
html[data-ui="enterprise"] .filter-period-preset {
  border-radius: 0 !important;
}

html[data-ui="enterprise"] .button,
html[data-ui="enterprise"] .button-primary,
html[data-ui="enterprise"] .button-export {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
  min-height: 32px;
  font-size: 13px;
}

html[data-ui="enterprise"] .ui-theme-dialog-actions .button-secondary,
html[data-ui="enterprise"] .button-quiet,
html[data-ui="enterprise"] .button-ghost {
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-ui="enterprise"] .filter-panel,
html[data-ui="enterprise"] .form-panel,
html[data-ui="enterprise"] .data-section,
html[data-ui="enterprise"] .dash-chart-panel,
html[data-ui="enterprise"] .dash-rank-panel {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-ui="enterprise"] .data-table {
  font-size: 12px;
}

html[data-ui="enterprise"] .data-table th,
html[data-ui="enterprise"] .data-table td {
  padding: 5px 8px !important;
  border-color: #e2e8f0 !important;
}

html[data-ui="enterprise"] .data-table th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  background: #f8fafc !important;
}

html[data-ui="enterprise"] .data-table tbody tr:hover td,
html[data-ui="enterprise"] .data-table tbody tr:focus-within td {
  background: #eff6ff !important;
}

html[data-ui="enterprise"] .dash-plot {
  background: #f8fafc;
  border-radius: 0;
  border: 1px solid #e2e8f0;
  height: 140px;
}

html[data-ui="enterprise"] .dash-bar { fill: #2563eb; }
html[data-ui="enterprise"] .dash-bar.is-highlight { fill: #1e3a8a; }
html[data-ui="enterprise"] .dash-bar-checks { fill: #94a3b8; }
html[data-ui="enterprise"] .dash-rank-fill { fill: #2563eb; }
html[data-ui="enterprise"] .dash-rank-fill.is-muted { fill: #94a3b8; }

html[data-ui="enterprise"] .app-body .main-content.is-ready > *:not(.filter-shell) {
  animation-name: ui-enterprise-enter;
  animation-duration: 100ms;
}

@keyframes ui-enterprise-enter {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  html[data-ui="enterprise"] .app-column { margin-left: 0; }
}

/* =============================================================================
   CHARCOAL — full dark ops shell
   ============================================================================= */

html[data-ui="charcoal"] {
  color-scheme: dark;
  --ink: #eef2f2;
  --ink-soft: #c5d0d0;
  --muted: #8a9a9a;
  --muted-soft: #6b7c7c;
  --line: #2c3a3a;
  --line-strong: #3d4e4e;
  --surface: #1c2626;
  --surface-subtle: #243030;
  --canvas: #121818;
  --canvas-deep: #0c1010;
  --charcoal: #0c1010;
  --charcoal-elevated: #080c0c;
  --charcoal-hover: #2a3838;
  --hop: #e8a830;
  --hop-dark: #f0b545;
  --hop-deeper: #b87916;
  --hop-soft: #5a4520;
  --hop-wash: #2a2418;
  --on-hop: #121818;
  --success: #34d399;
  --success-bg: #0f2a22;
  --danger: #f87171;
  --danger-bg: #3a1818;
  --warning: #fbbf24;
  --warning-bg: #2a2410;
  --focus: #e8a830;
  --link: #f0b545;
  --table-header-bg: #243030;
  --table-header-fg: #c5d0d0;
  --accent: #e8a830;
  --bg: #121818;
  --panel: #1c2626;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-control: 10px;
  --radius-panel: 16px;
  --radius-avatar: 10px;
  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.35);
  --control-min-height: 40px;
  --density-pad: 8px 16px;
  --dur-enter: 360ms;
  --dur-ui: 220ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Type: Manrope для заголовков/цифр, Source — тело и таблицы */
  --font-brand: "Manrope", "Source Sans 3", system-ui, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --text-title: 1.75rem;
  --text-section: 1.05rem;
  --text-body: 0.9375rem;
  --leading-copy: 1.55;
  --leading-compact: 1.45;
  --leading-tight: 1.28;
}

html[data-ui="charcoal"] body,
html[data-ui="charcoal"] .main-content,
html[data-ui="charcoal"] .app-column {
  background: #121818 !important;
  color: #eef2f2;
}

html[data-ui="charcoal"] .sidebar {
  width: 248px !important;
  background: #0c1010 !important;
  color: #eef2f2 !important;
  border-right: 1px solid #1a2222 !important;
}

html[data-ui="charcoal"] .app-column { margin-left: 248px; }

html[data-ui="charcoal"] .sidebar .brand {
  background: radial-gradient(120% 80% at 0% 0%, #3a2e14 0%, #0c1010 55%) !important;
  border-bottom-color: #1a2222 !important;
}

html[data-ui="charcoal"] .brand-logo {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

html[data-ui="charcoal"] .nav-label { color: #6b7c7c; }

html[data-ui="charcoal"] .side-nav a {
  color: #c5d0d0;
  border-radius: 10px !important;
}

html[data-ui="charcoal"] .side-nav a:hover {
  background: rgba(232, 168, 48, 0.1);
  color: #fff;
}

html[data-ui="charcoal"] .side-nav a[aria-current="page"] {
  color: #e8a830 !important;
  background: rgba(232, 168, 48, 0.14) !important;
  box-shadow: inset 3px 0 0 #e8a830 !important;
}

html[data-ui="charcoal"] .nav-group + .nav-group { border-top-color: #1a2222; }

html[data-ui="charcoal"] .sidebar-footer,
html[data-ui="charcoal"] .sidebar .role-badge {
  color: #6b7c7c;
  border-color: #1a2222;
}

html[data-ui="charcoal"] .topbar {
  background: #1c2626 !important;
  border-bottom: 1px solid #2c3a3a !important;
  color: #eef2f2;
}

html[data-ui="charcoal"] .profile-name { color: #eef2f2; }

html[data-ui="charcoal"] .icon-button { color: #8a9a9a; }
html[data-ui="charcoal"] .icon-button:hover {
  color: #eef2f2;
  background: #243030;
}

html[data-ui="charcoal"] .filter-panel,
html[data-ui="charcoal"] .form-panel,
html[data-ui="charcoal"] .data-section,
html[data-ui="charcoal"] .dash-chart-panel,
html[data-ui="charcoal"] .dash-rank-panel,
html[data-ui="charcoal"] .dash-plan-hero,
html[data-ui="charcoal"] .ui-theme-dialog,
html[data-ui="charcoal"] .filter-dialog {
  background: #1c2626 !important;
  border: 1px solid #2c3a3a !important;
  border-radius: 0 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

html[data-ui="charcoal"] .button,
html[data-ui="charcoal"] .button-export,
html[data-ui="charcoal"] .filter-trigger,
html[data-ui="charcoal"] .field input:not([type="checkbox"]),
html[data-ui="charcoal"] .field select,
html[data-ui="charcoal"] .side-nav a,
html[data-ui="charcoal"] .avatar,
html[data-ui="charcoal"] .alert,
html[data-ui="charcoal"] .count-badge,
html[data-ui="charcoal"] .filter-period-preset {
  border-radius: 10px !important;
}

html[data-ui="charcoal"] .field input:not([type="checkbox"]),
html[data-ui="charcoal"] .field select {
  background: #121818 !important;
  color: #eef2f2 !important;
  border-color: #3d4e4e !important;
}

html[data-ui="charcoal"] .data-table th {
  background: #243030 !important;
  color: #c5d0d0 !important;
}

html[data-ui="charcoal"] .data-table td {
  border-color: #2c3a3a !important;
  color: #eef2f2;
}

html[data-ui="charcoal"] .data-table tbody tr:hover td,
html[data-ui="charcoal"] .data-table tbody tr:focus-within td {
  background: #243030 !important;
}

html[data-ui="charcoal"] .report-table-oos tbody tr.oos-row-abc-a td,
html[data-ui="charcoal"] .report-table-oos tbody tr.oos-row-abc-a td.value-strong {
  background: color-mix(in srgb, #e8a830 20%, #1a2222) !important;
  color: #eef2f2 !important;
}

html[data-ui="charcoal"] .report-table-oos tbody tr.oos-row-abc-a:hover td,
html[data-ui="charcoal"] .report-table-oos tbody tr.oos-row-abc-a:focus-within td {
  background: color-mix(in srgb, #e8a830 28%, #1a2222) !important;
}

html[data-ui="charcoal"] .oos-loss-banner {
  background: linear-gradient(180deg, #3a1c1c 0%, #1a2222 100%) !important;
  border-color: #5c2e2e !important;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.55);
}

html[data-ui="charcoal"] .oos-loss-label {
  color: #f0a8a8 !important;
}

html[data-ui="charcoal"] .oos-loss-value,
html[data-ui="charcoal"] .oos-loss-metric-margin .oos-loss-value {
  color: #fecaca !important;
}

html[data-ui="charcoal"] .oos-loss-hint {
  color: #d4a8a8 !important;
  border-top-color: #5c2e2e !important;
}

html[data-ui="charcoal"] .pf-dev-pos,
html[data-ui="charcoal"] .pos { color: #34d399 !important; }
html[data-ui="charcoal"] .pf-dev-neg,
html[data-ui="charcoal"] .neg { color: #f87171 !important; }

html[data-ui="charcoal"] .dash-plot {
  background: #121818;
  border-radius: 12px;
}

html[data-ui="charcoal"] .dash-bar { fill: #e8a830; }
html[data-ui="charcoal"] .dash-bar.is-highlight { fill: #f0b545; }
html[data-ui="charcoal"] .dash-bar-checks { fill: #5a6a6a; }
html[data-ui="charcoal"] .dash-rank-fill { fill: #e8a830; }
html[data-ui="charcoal"] .dash-rank-track {
  background: #121818;
  border-radius: 999px;
}

html[data-ui="charcoal"] .app-body .main-content.is-ready > *:not(.filter-shell) {
  animation-name: ui-charcoal-enter;
  animation-duration: 360ms;
}

@keyframes ui-charcoal-enter {
  from { opacity: 0; transform: translateY(24px) scale(0.98); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 900px) {
  html[data-ui="charcoal"] .app-column { margin-left: 0; }
}

/* =============================================================================
   KILBIL — soft cards, big KPI, float motion
   ============================================================================= */

html[data-ui="kilbil"] {
  --ink: #2a3333;
  --ink-soft: #3d4a4a;
  --muted: #6b7878;
  --muted-soft: #8a9696;
  --line: #e6eaea;
  --line-strong: #d2d8d8;
  --surface: #ffffff;
  --surface-subtle: #f7f8f8;
  --canvas: #f0f2f2;
  --canvas-deep: #e6eaea;
  --hop: #e8a830;
  --hop-dark: #c48a1a;
  --hop-deeper: #8f5c10;
  --hop-soft: #f3d89a;
  --hop-wash: #fbf6ea;
  --on-hop: #2a3333;
  --focus: #c48a1a;
  --link: #8f5c10;
  --table-header-bg: #fafbfb;
  --table-header-fg: #6b7878;
  --bg: #f0f2f2;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-control: 8px;
  --radius-panel: 18px;
  --radius-avatar: 10px;
  --shadow-panel: 0 12px 32px rgba(48, 64, 64, 0.08);
  --control-min-height: 42px;
  --density-pad: 10px 18px;
  --text-title: 2rem;
  --text-section: 1.1rem;
  --text-body: 1rem;
  --text-body-compact: 0.9375rem;
  --dur-enter: 420ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Type: мягкий Manrope в UI, Source в данных */
  --font-brand: "Manrope", "Source Sans 3", system-ui, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --leading-copy: 1.6;
  --leading-compact: 1.45;
  --leading-tight: 1.25;
}

html[data-ui="kilbil"] body,
html[data-ui="kilbil"] .main-content,
html[data-ui="kilbil"] .app-column {
  background: #f0f2f2 !important;
  color: #2a3333;
}

html[data-ui="kilbil"] .sidebar {
  width: 232px !important;
  background: #ffffff !important;
  border-right: 0 !important;
  box-shadow: 8px 0 32px rgba(48, 64, 64, 0.06);
}

html[data-ui="kilbil"] .app-column { margin-left: 232px; }

html[data-ui="kilbil"] .sidebar .brand {
  background: #fff !important;
  border-bottom: 0 !important;
  padding-bottom: 4px;
}

html[data-ui="kilbil"] .nav-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #8a9696;
}

html[data-ui="kilbil"] .side-nav a {
  border-radius: 10px !important;
  padding: 10px 12px;
  font-weight: 600;
}

html[data-ui="kilbil"] .side-nav a[aria-current="page"] {
  background: #f4f5f5 !important;
  box-shadow: none !important;
  color: #2a3333 !important;
  position: relative;
}

html[data-ui="kilbil"] .side-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8a830;
  transform: translateY(-50%);
}

html[data-ui="kilbil"] .nav-group + .nav-group { border-top: 0; margin-top: 12px; }

html[data-ui="kilbil"] .topbar {
  background: transparent !important;
  border-bottom: 0 !important;
  height: 64px;
}

html[data-ui="kilbil"] .main-content {
  padding-top: 8px;
}
@media (max-width: 900px) {
  html[data-ui="kilbil"] body:has(.app-dock) .main-content {
    padding-top: calc(max(env(safe-area-inset-top, 0px), 47px) + 12px);
  }
}

html[data-ui="kilbil"] h1,
html[data-ui="kilbil"] .page-heading h1 {
  font-size: 2rem !important;
  letter-spacing: -0.04em;
}

html[data-ui="kilbil"] .button,
html[data-ui="kilbil"] .button-export,
html[data-ui="kilbil"] .filter-trigger,
html[data-ui="kilbil"] .icon-button,
html[data-ui="kilbil"] .field input:not([type="checkbox"]),
html[data-ui="kilbil"] .field select,
html[data-ui="kilbil"] .alert,
html[data-ui="kilbil"] .avatar,
html[data-ui="kilbil"] .count-badge,
html[data-ui="kilbil"] .filter-period-preset {
  border-radius: 8px !important;
}

html[data-ui="kilbil"] .filter-panel,
html[data-ui="kilbil"] .form-panel,
html[data-ui="kilbil"] .data-section,
html[data-ui="kilbil"] .dash-chart-panel,
html[data-ui="kilbil"] .dash-rank-panel,
html[data-ui="kilbil"] .dash-plan-hero,
html[data-ui="kilbil"] .ui-theme-dialog,
html[data-ui="kilbil"] .filter-dialog {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 12px 32px rgba(48, 64, 64, 0.08) !important;
  background: #fff !important;
  overflow: hidden;
}

/* Оформление / фильтры: не клипать — иначе длинный список тем не скроллится */
html[data-ui="kilbil"] .ui-theme-dialog,
html[data-ui="kilbil"] .filter-dialog {
  overflow: auto;
}

/* Таблицы отчётов: overflow:hidden ломает sticky thead к странице.
   IPR-карточки скроллят внутри .table-wrap — им нужен clip по радиусу. */
html[data-ui="kilbil"] .data-section:has(.report-table) {
  overflow: visible;
}

html[data-ui="kilbil"] .data-section.ipr-panel {
  overflow: hidden;
}

html[data-ui="kilbil"] .report-summary-strip {
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  gap: 10px;
  background: transparent;
  overflow: visible;
}

html[data-ui="kilbil"] .report-stat {
  border: 0;
  border-right: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(48, 64, 64, 0.07);
  background: #fff;
}

html[data-ui="kilbil"] .report-stat.is-lead {
  background: color-mix(in srgb, #fff 82%, #e8a830);
}

html[data-ui="kilbil"] .report-stat-value {
  font-family: var(--font-brand);
}

html[data-ui="kilbil"] .data-section > .section-heading {
  border-bottom: 0;
  background: transparent;
  padding-bottom: 4px;
}

html[data-ui="kilbil"] .data-table th {
  background: #fff !important;
  font-size: 12px;
  color: #5c6a6a;
  border-bottom: 1px solid #e8ecec !important;
}

html[data-ui="kilbil"] .data-table.report-table thead th,
html[data-ui="kilbil"] .data-table.ipr-table thead th {
  background: #fff !important;
  color: #3d4a4a !important;
  font-weight: 700;
  box-shadow:
    inset 0 -1px 0 #e8ecec,
    0 12px 20px -14px rgba(48, 64, 64, 0.35) !important;
}

html[data-ui="kilbil"] .data-table.report-table thead th a,
html[data-ui="kilbil"] .data-table.ipr-table thead th a {
  color: inherit;
}

html[data-ui="kilbil"] .data-table td {
  border-bottom: 1px solid #f3f5f5 !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

html[data-ui="kilbil"] .data-table tbody tr:hover td,
html[data-ui="kilbil"] .data-table tbody tr:focus-within td {
  background: #fafbfb !important;
}

html[data-ui="kilbil"] .report-total-row td {
  background: #fafbfb !important;
  font-size: 1.02em;
}

html[data-ui="kilbil"] .dash-plan-hero-main,
html[data-ui="kilbil"] .pulse-net-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

html[data-ui="kilbil"] .dash-plan-fact-block,
html[data-ui="kilbil"] .dash-plan-pct-block {
  background: #f7f8f8;
  border-radius: 14px;
  padding: 14px 16px;
  border: 0;
}

html[data-ui="kilbil"] .dash-plan-fact-value,
html[data-ui="kilbil"] .dash-plan-pct-value {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
}

html[data-ui="kilbil"] .dash-plot {
  background: linear-gradient(180deg, #fafbfb 0%, #f3f5f5 100%);
  border-radius: 14px;
  height: 200px;
}

html[data-ui="kilbil"] .dash-bar { fill: #c48a1a; }
html[data-ui="kilbil"] .dash-bar.is-highlight { fill: #e8a830; }
html[data-ui="kilbil"] .dash-bar-checks { fill: #b8c0c0; }
html[data-ui="kilbil"] .dash-rank-fill { fill: #e8a830; }
html[data-ui="kilbil"] .dash-rank-track {
  height: 10px;
  border-radius: 999px;
  background: #eef1f1;
}

html[data-ui="kilbil"] .app-body .main-content.is-ready > *:not(.filter-shell) {
  animation-name: ui-kilbil-enter;
  animation-duration: 420ms;
}

@keyframes ui-kilbil-enter {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

html[data-ui="kilbil"] .theme-kpi-card {
  animation: ui-kilbil-kpi 480ms var(--ease-out) both;
}

html[data-ui="kilbil"] .theme-kpi-card:nth-child(1) { animation-delay: 40ms; }
html[data-ui="kilbil"] .theme-kpi-card:nth-child(2) { animation-delay: 90ms; }
html[data-ui="kilbil"] .theme-kpi-card:nth-child(3) { animation-delay: 140ms; }
html[data-ui="kilbil"] .theme-kpi-card:nth-child(4) { animation-delay: 190ms; }

@keyframes ui-kilbil-kpi {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  html[data-ui="kilbil"] .dash-plan-hero-main,
  html[data-ui="kilbil"] .pulse-net-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  html[data-ui="kilbil"] .app-column { margin-left: 0; }
}

/* Default avatar stays circle */
html[data-ui="default"] .avatar { border-radius: 50%; }

/* =============================================================================
   PULSE («Пульс сети») — тема меняет и этот экран
   ============================================================================= */

/* —— Enterprise pulse —— */
html[data-ui="enterprise"] .dash-pulse {
  display: grid;
  gap: 10px;
}

html[data-ui="enterprise"] .dash-pulse .dash-heading h1 {
  font-size: 1.25rem !important;
  letter-spacing: 0;
  text-transform: uppercase;
}

html[data-ui="enterprise"] .dash-heading-meta {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[data-ui="enterprise"] .dash-period-btn {
  border-radius: 0 !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  min-height: 40px;
  box-shadow: none !important;
}

html[data-ui="enterprise"] .dash-period-btn-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #64748b;
}

html[data-ui="enterprise"] .pulse-attention {
  border-radius: 0 !important;
  border: 1px solid #fecaca !important;
  border-left: 3px solid #dc2626 !important;
  background: #fff !important;
  padding: 10px 12px;
}

html[data-ui="enterprise"] .pulse-attention-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b91c1c;
}

html[data-ui="enterprise"] .pulse-attention-list {
  gap: 2px;
}

html[data-ui="enterprise"] .pulse-attention-list a {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}

html[data-ui="enterprise"] .pulse-attention-list a:hover {
  background: #f8fafc;
}

html[data-ui="enterprise"] .dash-plan-hero {
  border-radius: 0 !important;
  border: 1px solid #cbd5e1 !important;
  border-left: 3px solid #2563eb !important;
  padding: 14px 16px;
  gap: 12px;
  box-shadow: none !important;
}

html[data-ui="enterprise"] .dash-plan-hero.is-good { border-left-color: #047857 !important; }
html[data-ui="enterprise"] .dash-plan-hero.is-warn { border-left-color: #d97706 !important; }
html[data-ui="enterprise"] .dash-plan-hero.is-bad { border-left-color: #dc2626 !important; }

html[data-ui="enterprise"] .dash-plan-title {
  font-size: 1rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[data-ui="enterprise"] .dash-plan-hero-main.pulse-net-grid {
  gap: 6px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

html[data-ui="enterprise"] .pulse-net-grid .dash-plan-fact-block,
html[data-ui="enterprise"] .pulse-net-grid .dash-plan-pct-block {
  border-radius: 0 !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  padding: 10px 12px;
}

html[data-ui="enterprise"] .dash-plan-pct-block {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}

html[data-ui="enterprise"] .pulse-net-grid .dash-plan-fact-value,
html[data-ui="enterprise"] .pulse-net-grid .dash-plan-pct-value {
  font-size: 1.15rem !important;
  font-family: "Source Sans 3", system-ui, sans-serif;
}

html[data-ui="enterprise"] .dash-plan-pct-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

html[data-ui="enterprise"] .pulse-cities,
html[data-ui="enterprise"] .pulse-rank-panel,
html[data-ui="enterprise"] .pulse-trend-section {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-ui="enterprise"] .dash-pulse .pulse-cities-table thead th {
  background: #f1f5f9 !important;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html[data-ui="enterprise"] .pulse-rr-pill {
  border-radius: 0 !important;
  min-width: 3.75rem;
  padding: 0.08rem 0.35rem;
  font-size: 12px;
  border: 1px solid transparent;
}

html[data-ui="enterprise"] .pulse-rr-pill.is-good {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

html[data-ui="enterprise"] .pulse-rr-pill.is-warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

html[data-ui="enterprise"] .pulse-rr-pill.is-bad {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

html[data-ui="enterprise"] .pulse-city-row td:first-child {
  border-left-width: 2px;
}

html[data-ui="enterprise"] .pulse-empty {
  border-radius: 0 !important;
  border-style: solid;
}

/* —— Charcoal pulse (dark) —— */
html[data-ui="charcoal"] .dash-pulse {
  display: grid;
  gap: 14px;
}

html[data-ui="charcoal"] .dash-heading-meta {
  color: #8a9a9a;
}

html[data-ui="charcoal"] .dash-period-btn {
  border-radius: 12px !important;
  background: #1c2626 !important;
  border: 1px solid #3d4e4e !important;
  color: #eef2f2 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

html[data-ui="charcoal"] .dash-period-btn-label {
  color: #8a9a9a;
}

html[data-ui="charcoal"] .dash-period-btn-range {
  color: #eef2f2;
}

html[data-ui="charcoal"] .dash-sync-note {
  color: #6b7c7c;
}

html[data-ui="charcoal"] .pulse-attention {
  border-radius: 14px !important;
  background: #241818 !important;
  border: 1px solid #4a2828 !important;
  border-left: 4px solid #f87171 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

html[data-ui="charcoal"] .pulse-attention-title {
  color: #f87171;
}

html[data-ui="charcoal"] .pulse-attention-list a {
  padding: 8px 10px;
  border-radius: 10px;
}

html[data-ui="charcoal"] .pulse-attention-list a:hover {
  background: rgba(248, 113, 113, 0.08);
}

html[data-ui="charcoal"] .pulse-attention-city {
  color: #8a9a9a;
}

html[data-ui="charcoal"] .dash-plan-hero {
  border-radius: 16px !important;
  background: #1c2626 !important;
  border: 1px solid #2c3a3a !important;
  border-left: 4px solid #e8a830 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) !important;
}

html[data-ui="charcoal"] .dash-plan-hero.is-good { border-left-color: #34d399 !important; }
html[data-ui="charcoal"] .dash-plan-hero.is-warn { border-left-color: #fbbf24 !important; }
html[data-ui="charcoal"] .dash-plan-hero.is-bad { border-left-color: #f87171 !important; }

html[data-ui="charcoal"] .dash-plan-title {
  color: #eef2f2;
}

html[data-ui="charcoal"] .pulse-net-grid .dash-plan-fact-block,
html[data-ui="charcoal"] .pulse-net-grid .dash-plan-pct-block {
  border-radius: 12px !important;
  background: #121818 !important;
  border: 1px solid #2c3a3a !important;
}

html[data-ui="charcoal"] .dash-plan-pct-block {
  background: #2a2418 !important;
  border-color: #5a4520 !important;
}

html[data-ui="charcoal"] .dash-plan-pct-label,
html[data-ui="charcoal"] .dash-plan-fact-block .dash-plan-pct-label {
  color: #8a9a9a;
}

html[data-ui="charcoal"] .dash-plan-fact-value,
html[data-ui="charcoal"] .dash-plan-pct-value {
  color: #eef2f2;
}

html[data-ui="charcoal"] .dash-plan-hero.is-good .dash-plan-pct-value { color: #34d399 !important; }
html[data-ui="charcoal"] .dash-plan-hero.is-warn .dash-plan-pct-value { color: #fbbf24 !important; }
html[data-ui="charcoal"] .dash-plan-hero.is-bad .dash-plan-pct-value { color: #f87171 !important; }

html[data-ui="charcoal"] .dash-pulse .pulse-cities-table thead th {
  background: #243030 !important;
  color: #c5d0d0 !important;
}

html[data-ui="charcoal"] .pulse-rr-pill {
  border-radius: 8px !important;
}

html[data-ui="charcoal"] .pulse-rr-pill.is-good {
  color: #6ee7b7;
  background: #0f2a22;
}

html[data-ui="charcoal"] .pulse-rr-pill.is-warn {
  color: #fcd34d;
  background: #2a2410;
}

html[data-ui="charcoal"] .pulse-rr-pill.is-bad {
  color: #fca5a5;
  background: #3a1818;
}

html[data-ui="charcoal"] .pulse-city-link {
  color: #eef2f2;
}

html[data-ui="charcoal"] .pulse-city-link:hover {
  color: #e8a830;
}

html[data-ui="charcoal"] .pulse-empty {
  background: #121818;
  border-color: #3d4e4e;
  color: #8a9a9a;
  border-radius: 12px;
}

html[data-ui="charcoal"] .pulse-section-hint,
html[data-ui="charcoal"] .pulse-trend-lead {
  color: #8a9a9a;
}

html[data-ui="charcoal"] .button-ghost {
  color: #e8a830 !important;
  border-color: #5a4520 !important;
  background: transparent !important;
}

/* —— Kilbil pulse —— */
html[data-ui="kilbil"] .dash-pulse {
  display: grid;
  gap: 18px;
}

html[data-ui="kilbil"] .dash-pulse .dash-heading h1 {
  font-size: 2rem !important;
  letter-spacing: -0.04em;
}

html[data-ui="kilbil"] .dash-heading-meta {
  font-size: 14px;
  color: #8a9696;
}

html[data-ui="kilbil"] .dash-period-btn {
  border-radius: 14px !important;
  border: 0 !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(48, 64, 64, 0.08) !important;
  padding: 12px 16px;
  min-width: 14rem;
}

html[data-ui="kilbil"] .dash-period-btn-label {
  font-size: 11px;
  color: #8a9696;
  letter-spacing: 0.02em;
  text-transform: none;
}

html[data-ui="kilbil"] .dash-period-btn-range {
  font-size: 15px;
  font-weight: 700;
}

html[data-ui="kilbil"] .pulse-attention {
  border: 0 !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(48, 64, 64, 0.08);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

html[data-ui="kilbil"] .pulse-attention::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #ef4444, #f97316);
}

html[data-ui="kilbil"] .pulse-attention-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

html[data-ui="kilbil"] .pulse-attention-list {
  gap: 8px;
}

html[data-ui="kilbil"] .pulse-attention-list a {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f8f8;
  grid-template-columns: minmax(7rem, 1.2fr) minmax(4rem, 0.7fr) 1.5fr;
}

html[data-ui="kilbil"] .pulse-attention-list a:hover {
  background: #f0f2f2;
}

html[data-ui="kilbil"] .dash-plan-hero {
  border: 0 !important;
  border-radius: 20px !important;
  box-shadow: 0 14px 36px rgba(48, 64, 64, 0.09) !important;
  padding: 22px 22px 20px;
  background: #fff !important;
}

html[data-ui="kilbil"] .dash-plan-title {
  font-size: clamp(1.35rem, 1.2vw + 1rem, 1.85rem) !important;
  letter-spacing: -0.03em;
}

html[data-ui="kilbil"] .dash-plan-hero-main.pulse-net-grid {
  gap: 12px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

html[data-ui="kilbil"] .pulse-net-grid .dash-plan-fact-block,
html[data-ui="kilbil"] .pulse-net-grid .dash-plan-pct-block {
  border: 0 !important;
  border-radius: 16px !important;
  background: #f4f5f5 !important;
  padding: 16px 16px 14px;
  box-shadow: inset 0 0 0 1px rgba(48, 64, 64, 0.04);
}

html[data-ui="kilbil"] .dash-plan-pct-block {
  background: linear-gradient(160deg, #fbf6ea 0%, #f4f5f5 100%) !important;
}

html[data-ui="kilbil"] .pulse-net-grid .dash-plan-fact-value,
html[data-ui="kilbil"] .pulse-net-grid .dash-plan-pct-value {
  font-size: clamp(1.35rem, 1.1vw + 1rem, 1.85rem) !important;
  letter-spacing: -0.035em;
}

html[data-ui="kilbil"] .dash-plan-pct-label {
  font-size: 12px;
  font-weight: 600;
  color: #8a9696;
}

html[data-ui="kilbil"] .pulse-cities .dash-section-title,
html[data-ui="kilbil"] .pulse-rank-panel .dash-section-title {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

html[data-ui="kilbil"] .pulse-cities-wrap {
  border: 0;
  background: transparent;
  border-radius: 0;
  margin: 0 -4px;
  padding: 0 4px;
}

html[data-ui="kilbil"] .pulse-cities-table th:first-child,
html[data-ui="kilbil"] .pulse-cities-table td:first-child {
  padding-left: 4px;
}

html[data-ui="kilbil"] .dash-pulse .pulse-cities-table thead th {
  background: transparent !important;
  color: #8a9696 !important;
  font-size: 11px;
  border-bottom: 1px solid #eef1f1 !important;
}

html[data-ui="kilbil"] .pulse-rr-pill {
  border-radius: 999px !important;
  min-width: 4.5rem;
  padding: 0.2rem 0.65rem;
  font-size: 13px;
}

html[data-ui="kilbil"] .pulse-rr-pill.is-good {
  color: #0f766e;
  background: #ccfbf1;
}

html[data-ui="kilbil"] .pulse-rr-pill.is-warn {
  color: #a16207;
  background: #fef3c7;
}

html[data-ui="kilbil"] .pulse-rr-pill.is-bad {
  color: #b91c1c;
  background: #fee2e2;
}

html[data-ui="kilbil"] .pulse-city-row td:first-child {
  border-left: 0 !important;
}

html[data-ui="kilbil"] .pulse-city-row.is-good td:first-child .pulse-city-link::before,
html[data-ui="kilbil"] .pulse-city-row.is-warn td:first-child .pulse-city-link::before,
html[data-ui="kilbil"] .pulse-city-row.is-bad td:first-child .pulse-city-link::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

html[data-ui="kilbil"] .pulse-city-row.is-good td:first-child .pulse-city-link::before {
  background: #14b8a6;
}

html[data-ui="kilbil"] .pulse-city-row.is-warn td:first-child .pulse-city-link::before {
  background: #e8a830;
}

html[data-ui="kilbil"] .pulse-city-row.is-bad td:first-child .pulse-city-link::before {
  background: #ef4444;
}

html[data-ui="kilbil"] .pulse-empty {
  border: 0;
  border-radius: 16px;
  background: #f7f8f8;
  box-shadow: inset 0 0 0 1px rgba(48, 64, 64, 0.05);
}

/* =============================================================================
   TYPE SYSTEMS — гармония Manrope / Source Sans по скинам
   ============================================================================= */

html[data-ui="default"] {
  --font-brand: "Manrope", "Source Sans 3", system-ui, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

html[data-ui="default"] body {
  font-family: var(--font-sans);
  letter-spacing: 0.005em;
}

html[data-ui="default"] h1,
html[data-ui="default"] .page-heading h1,
html[data-ui="default"] .dash-section-title,
html[data-ui="default"] .dash-plan-title,
html[data-ui="default"] .avatar {
  font-family: var(--font-brand);
  letter-spacing: -0.025em;
}

html[data-ui="default"] .dash-plan-fact-value,
html[data-ui="default"] .dash-plan-pct-value,
html[data-ui="default"] .theme-kpi-value,
html[data-ui="default"] .dash-rank-value,
html[data-ui="default"] .dash-rank-pos {
  font-family: var(--font-brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* —— Enterprise: единый Source, caps-метки, плотные цифры —— */
html[data-ui="enterprise"] body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  letter-spacing: 0.01em;
  font-feature-settings: "kern" 1, "liga" 1;
}

html[data-ui="enterprise"] h1,
html[data-ui="enterprise"] h2,
html[data-ui="enterprise"] h3,
html[data-ui="enterprise"] .page-heading h1,
html[data-ui="enterprise"] .dash-section-title,
html[data-ui="enterprise"] .dash-plan-title,
html[data-ui="enterprise"] .section-heading h2,
html[data-ui="enterprise"] .avatar,
html[data-ui="enterprise"] .nav-label,
html[data-ui="enterprise"] .button,
html[data-ui="enterprise"] .button-export,
html[data-ui="enterprise"] .filter-trigger {
  font-family: var(--font-brand);
}

html[data-ui="enterprise"] .dash-section-title {
  font-size: 0.8125rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

html[data-ui="enterprise"] .dash-plan-fact-value,
html[data-ui="enterprise"] .dash-plan-pct-value,
html[data-ui="enterprise"] .theme-kpi-value,
html[data-ui="enterprise"] .dash-rank-value,
html[data-ui="enterprise"] .dash-rank-pos,
html[data-ui="enterprise"] .pulse-rr-pill,
html[data-ui="enterprise"] .data-table .numeric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
  font-weight: 600;
}

html[data-ui="enterprise"] .data-table,
html[data-ui="enterprise"] .side-nav a,
html[data-ui="enterprise"] .field-hint,
html[data-ui="enterprise"] .pulse-section-hint {
  font-family: var(--font-sans);
  letter-spacing: 0.005em;
}

html[data-ui="enterprise"] .dash-rank-name,
html[data-ui="enterprise"] .pulse-city-link {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0;
}

/* —— Charcoal: Manrope-акцент на тёмном, Source для чтения —— */
html[data-ui="charcoal"] body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
}

html[data-ui="charcoal"] h1,
html[data-ui="charcoal"] .page-heading h1,
html[data-ui="charcoal"] .dash-heading h1 {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

html[data-ui="charcoal"] h2,
html[data-ui="charcoal"] .dash-section-title,
html[data-ui="charcoal"] .dash-plan-title,
html[data-ui="charcoal"] .pulse-attention-title,
html[data-ui="charcoal"] .section-heading h2 {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: -0.02em;
}

html[data-ui="charcoal"] .nav-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html[data-ui="charcoal"] .side-nav a {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.01em;
}

html[data-ui="charcoal"] .dash-plan-fact-value,
html[data-ui="charcoal"] .dash-plan-pct-value,
html[data-ui="charcoal"] .theme-kpi-value,
html[data-ui="charcoal"] .dash-rank-value,
html[data-ui="charcoal"] .dash-rank-pos,
html[data-ui="charcoal"] .pulse-rr-pill,
html[data-ui="charcoal"] .avatar {
  font-family: var(--font-brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

html[data-ui="charcoal"] .data-table,
html[data-ui="charcoal"] .data-table th,
html[data-ui="charcoal"] .data-table td {
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

html[data-ui="charcoal"] .dash-rank-name,
html[data-ui="charcoal"] .dash-rank-name a,
html[data-ui="charcoal"] .pulse-city-link {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.005em;
}

html[data-ui="charcoal"] .field-hint,
html[data-ui="charcoal"] .pulse-section-hint,
html[data-ui="charcoal"] .dash-heading-meta {
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

/* —— Kilbil: мягкий Manrope в заголовках/KPI, Source в таблицах —— */
html[data-ui="kilbil"] body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

html[data-ui="kilbil"] h1,
html[data-ui="kilbil"] .page-heading h1,
html[data-ui="kilbil"] .dash-heading h1 {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

html[data-ui="kilbil"] h2,
html[data-ui="kilbil"] .dash-section-title,
html[data-ui="kilbil"] .dash-plan-title,
html[data-ui="kilbil"] .pulse-attention-title,
html[data-ui="kilbil"] .section-heading h2,
html[data-ui="kilbil"] .ui-theme-dialog-header h2 {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.025em;
}

html[data-ui="kilbil"] .nav-label {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

html[data-ui="kilbil"] .side-nav a {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: -0.01em;
}

html[data-ui="kilbil"] .button,
html[data-ui="kilbil"] .button-export,
html[data-ui="kilbil"] .filter-trigger {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: -0.01em;
}

html[data-ui="kilbil"] .dash-plan-fact-value,
html[data-ui="kilbil"] .dash-plan-pct-value,
html[data-ui="kilbil"] .theme-kpi-value,
html[data-ui="kilbil"] .dash-rank-value,
html[data-ui="kilbil"] .dash-rank-pos,
html[data-ui="kilbil"] .pulse-rr-pill,
html[data-ui="kilbil"] .dash-period-btn-range,
html[data-ui="kilbil"] .avatar {
  font-family: var(--font-brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

html[data-ui="kilbil"] .dash-plan-pct-label,
html[data-ui="kilbil"] .theme-kpi-label,
html[data-ui="kilbil"] .dash-period-btn-label {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.02em;
}

html[data-ui="kilbil"] .data-table,
html[data-ui="kilbil"] .data-table th,
html[data-ui="kilbil"] .data-table td {
  font-family: var(--font-sans);
  letter-spacing: 0.005em;
}

html[data-ui="kilbil"] .data-table th {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

html[data-ui="kilbil"] .dash-rank-name,
html[data-ui="kilbil"] .dash-rank-name a,
html[data-ui="kilbil"] .pulse-city-link {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: -0.015em;
}

html[data-ui="kilbil"] .field-hint,
html[data-ui="kilbil"] .pulse-section-hint,
html[data-ui="kilbil"] .dash-heading-meta,
html[data-ui="kilbil"] .ui-theme-dialog-lead {
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  line-height: var(--leading-copy);
}

@media (max-width: 1100px) {
  html[data-ui="enterprise"] .dash-plan-hero-main.pulse-net-grid,
  html[data-ui="kilbil"] .dash-plan-hero-main.pulse-net-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* =============================================================================
   NEON — dark ops with electric cyan (readable, not Twitch cyberpunk)
   Refs: designlib edit-bold-002 Electric Blue Dark; glow accents cyan+hop
   ============================================================================= */

html[data-ui="neon"] {
  color-scheme: dark;
  --ink: #e8f7ff;
  --ink-soft: #b7d4e6;
  --muted: #7a94a8;
  --muted-soft: #5a7388;
  --line: #1a2a3c;
  --line-strong: #2a4258;
  --surface: #0e1522;
  --surface-subtle: #121c2c;
  --canvas: #070a12;
  --canvas-deep: #05070d;
  --charcoal: #05070d;
  --charcoal-elevated: #03050a;
  --charcoal-hover: #1a2838;
  --hop: #2ee6ff;
  --hop-dark: #67f0ff;
  --hop-deeper: #1499b0;
  --hop-soft: #13485a;
  --hop-wash: #0c2430;
  --on-hop: #041018;
  --success: #39ff88;
  --success-bg: #0a2a1a;
  --danger: #ff3d7a;
  --danger-bg: #2a1020;
  --warning: #e8a830;
  --warning-bg: #2a2410;
  --focus: #2ee6ff;
  --link: #67f0ff;
  --table-header-bg: #121c2c;
  --table-header-fg: #9ec9e0;
  --accent: #2ee6ff;
  --bg: #070a12;
  --panel: #0e1522;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-control: 10px;
  --radius-panel: 14px;
  --radius-avatar: 10px;
  --shadow-panel: 0 0 0 1px rgba(46, 230, 255, 0.12), 0 12px 36px rgba(0, 0, 0, 0.45);
  --control-min-height: 40px;
  --density-pad: 8px 16px;
  --dur-enter: 320ms;
  --dur-ui: 200ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-brand: "Manrope", "Source Sans 3", system-ui, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --text-title: 1.75rem;
  --text-section: 1.05rem;
  --text-body: 0.9375rem;
  --leading-copy: 1.55;
  --leading-compact: 1.45;
  --leading-tight: 1.28;
}

html[data-ui="neon"] body,
html[data-ui="neon"] .main-content,
html[data-ui="neon"] .app-column {
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(46, 230, 255, 0.08), transparent 55%),
    radial-gradient(70% 50% at 0% 100%, rgba(232, 168, 48, 0.05), transparent 50%),
    #070a12 !important;
  color: #e8f7ff;
}

html[data-ui="neon"] .sidebar {
  width: 248px !important;
  background: #05070d !important;
  color: #e8f7ff !important;
  border-right: 1px solid #1a2a3c !important;
  box-shadow: 4px 0 24px rgba(46, 230, 255, 0.06);
}

html[data-ui="neon"] .app-column { margin-left: 248px; }

html[data-ui="neon"] .sidebar .brand {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(46, 230, 255, 0.22) 0%, transparent 50%),
    #05070d !important;
  border-bottom-color: #1a2a3c !important;
}

html[data-ui="neon"] .brand-logo {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

html[data-ui="neon"] .nav-label { color: #5a7388; }

html[data-ui="neon"] .side-nav a {
  color: #b7d4e6;
  border-radius: 10px !important;
}

html[data-ui="neon"] .side-nav a:hover {
  background: rgba(46, 230, 255, 0.1);
  color: #fff;
}

html[data-ui="neon"] .side-nav a[aria-current="page"] {
  color: #2ee6ff !important;
  background: rgba(46, 230, 255, 0.12) !important;
  box-shadow: inset 3px 0 0 #2ee6ff, 0 0 18px rgba(46, 230, 255, 0.15) !important;
}

html[data-ui="neon"] .nav-group + .nav-group { border-top-color: #1a2a3c; }

html[data-ui="neon"] .sidebar-footer,
html[data-ui="neon"] .sidebar .role-badge {
  color: #5a7388;
  border-color: #1a2a3c;
}

html[data-ui="neon"] .topbar {
  background: rgba(14, 21, 34, 0.92) !important;
  border-bottom: 1px solid #1a2a3c !important;
  color: #e8f7ff;
  backdrop-filter: blur(10px);
}

html[data-ui="neon"] .profile-name { color: #e8f7ff; }

html[data-ui="neon"] .icon-button { color: #7a94a8; }
html[data-ui="neon"] .icon-button:hover {
  color: #e8f7ff;
  background: #121c2c;
  box-shadow: 0 0 12px rgba(46, 230, 255, 0.2);
}

html[data-ui="neon"] .filter-panel,
html[data-ui="neon"] .form-panel,
html[data-ui="neon"] .data-section,
html[data-ui="neon"] .dash-chart-panel,
html[data-ui="neon"] .dash-rank-panel,
html[data-ui="neon"] .dash-plan-hero,
html[data-ui="neon"] .ui-theme-dialog,
html[data-ui="neon"] .filter-dialog {
  background: #0e1522 !important;
  border: 1px solid rgba(46, 230, 255, 0.18) !important;
  border-radius: 0 !important;
  box-shadow: 0 0 0 1px rgba(46, 230, 255, 0.06), 0 12px 36px rgba(0, 0, 0, 0.45) !important;
}

html[data-ui="neon"] .button,
html[data-ui="neon"] .button-export,
html[data-ui="neon"] .filter-trigger,
html[data-ui="neon"] .field input:not([type="checkbox"]),
html[data-ui="neon"] .field select,
html[data-ui="neon"] .side-nav a,
html[data-ui="neon"] .avatar,
html[data-ui="neon"] .alert,
html[data-ui="neon"] .count-badge,
html[data-ui="neon"] .filter-period-preset {
  border-radius: 10px !important;
}

html[data-ui="neon"] .button:not(.button-secondary),
html[data-ui="neon"] .button-export {
  background: #2ee6ff !important;
  color: #041018 !important;
  border-color: #2ee6ff !important;
  box-shadow: 0 0 20px rgba(46, 230, 255, 0.35);
}

html[data-ui="neon"] .button:not(.button-secondary):hover,
html[data-ui="neon"] .button-export:hover {
  background: #67f0ff !important;
  box-shadow: 0 0 28px rgba(46, 230, 255, 0.5);
}

html[data-ui="neon"] .field input:not([type="checkbox"]),
html[data-ui="neon"] .field select {
  background: #070a12 !important;
  color: #e8f7ff !important;
  border-color: #2a4258 !important;
}

html[data-ui="neon"] .field input:not([type="checkbox"]):focus,
html[data-ui="neon"] .field select:focus {
  border-color: #2ee6ff !important;
  box-shadow: 0 0 0 3px rgba(46, 230, 255, 0.2);
}

html[data-ui="neon"] .data-table th {
  background: #121c2c !important;
  color: #9ec9e0 !important;
}

html[data-ui="neon"] .data-table td {
  border-color: #1a2a3c !important;
  color: #e8f7ff;
}

html[data-ui="neon"] .data-table tbody tr:hover td,
html[data-ui="neon"] .data-table tbody tr:focus-within td {
  background: #121c2c !important;
}

html[data-ui="neon"] .report-table-oos tbody tr.oos-row-abc-a td,
html[data-ui="neon"] .report-table-oos tbody tr.oos-row-abc-a td.value-strong {
  background: color-mix(in srgb, #2ee6ff 16%, #0e1522) !important;
  color: #e8f7ff !important;
}

html[data-ui="neon"] .report-table-oos tbody tr.oos-row-abc-a:hover td,
html[data-ui="neon"] .report-table-oos tbody tr.oos-row-abc-a:focus-within td {
  background: color-mix(in srgb, #2ee6ff 24%, #0e1522) !important;
}

html[data-ui="neon"] .oos-loss-banner {
  background: linear-gradient(180deg, #2a1020 0%, #0e1522 100%) !important;
  border-color: #5c2a40 !important;
  box-shadow: 0 0 24px rgba(255, 61, 122, 0.2);
}

html[data-ui="neon"] .oos-loss-label { color: #ff9ec0 !important; }
html[data-ui="neon"] .oos-loss-value,
html[data-ui="neon"] .oos-loss-metric-margin .oos-loss-value {
  color: #ff3d7a !important;
  text-shadow: 0 0 12px rgba(255, 61, 122, 0.45);
}

html[data-ui="neon"] .oos-loss-hint {
  color: #d4a0b4 !important;
  border-top-color: #5c2a40 !important;
}

html[data-ui="neon"] .pf-dev-pos,
html[data-ui="neon"] .pos { color: #39ff88 !important; text-shadow: 0 0 10px rgba(57, 255, 136, 0.35); }
html[data-ui="neon"] .pf-dev-neg,
html[data-ui="neon"] .neg { color: #ff3d7a !important; text-shadow: 0 0 10px rgba(255, 61, 122, 0.35); }

html[data-ui="neon"] .dash-plot {
  background: #070a12;
  border-radius: 12px;
  border: 1px solid rgba(46, 230, 255, 0.12);
}

html[data-ui="neon"] .dash-bar { fill: #2ee6ff; }
html[data-ui="neon"] .dash-bar.is-highlight { fill: #e8a830; }
html[data-ui="neon"] .dash-bar-checks { fill: #3a556e; }
html[data-ui="neon"] .dash-rank-fill { fill: #2ee6ff; }
html[data-ui="neon"] .dash-rank-track {
  background: #070a12;
  border-radius: 999px;
}

html[data-ui="neon"] .app-body .main-content.is-ready > *:not(.filter-shell) {
  animation-name: ui-neon-enter;
  animation-duration: 320ms;
}

@keyframes ui-neon-enter {
  from { opacity: 0; transform: translateY(16px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 900px) {
  html[data-ui="neon"] .app-column { margin-left: 0; }
}

/* =============================================================================
   LIGHT — calm Notion canvas, Apple-tactile controls, hop amber as the one accent
   Refs: Campsite (Refero 5d8ad116), Things (Refero ec0f5bca), Apple HIG controls
   ============================================================================= */

html[data-ui="light"] {
  color-scheme: light;
  --ink: #1d1d1f;
  --ink-soft: #3a3a3c;
  --muted: #6a6a6f;
  --muted-soft: #6e6e73;
  --line: #e9e7e2;
  --line-strong: #d9d6cf;
  --surface: #ffffff;
  --surface-subtle: #faf9f7;
  --fill: #e6e4de;
  --canvas: #f6f5f2;
  --canvas-deep: #efeee9;
  --hop: #eaa52b;
  --hop-dark: #c98712;
  --hop-deeper: #8a560b;
  --hop-soft: #f7dfab;
  --hop-wash: #fdf7ea;
  --on-hop: #2b1d04;
  --success: #1b7a43;
  --success-bg: #ebf6ef;
  /* Retail paints status with its own green; in this skin status green is the only green. */
  --rt-green: var(--success);
  --rt-green-deep: #14612f;
  --rt-green-soft: #2f8f57;
  --rt-green-wash: var(--success-bg);
  --rt-green-line: #cfe6d7;
  --warning: #996100;
  --warning-bg: #fdf4dc;
  --danger: #cc3a30;
  --danger-bg: #fef4f3;
  --rt-ok: var(--success);
  --rt-ok-bg: var(--success-bg);
  --rt-on-green: #f5f5f7;
  --rt-on-green-muted: #c7c7cc;
  --info: #8a560b;
  --info-bg: #fdf7ea;
  --focus: var(--hop-deeper);
  --link: #8a560b;
  --table-header-bg: transparent;
  --table-header-fg: #6e6e73;
  --accent: var(--hop);
  --bg: var(--canvas);
  --panel: var(--surface-subtle);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-control: 10px;
  --radius-panel: 16px;
  --control-min-height: 40px;
  --density-pad: 8px 14px;
  --shadow: 0 1px 2px rgba(20, 18, 12, 0.05), 0 2px 8px -2px rgba(20, 18, 12, 0.06);
  --shadow-panel: 0 0 0 1px rgba(20, 18, 12, 0.05), 0 1px 2px rgba(20, 18, 12, 0.04), 0 8px 20px -10px rgba(20, 18, 12, 0.08);
  --lt-raise: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(20, 18, 12, 0.05), 0 0 0 1px rgba(20, 18, 12, 0.12), 0 1px 1px rgba(20, 18, 12, 0.07), 0 2px 4px -1px rgba(20, 18, 12, 0.10);
  --lt-raise-hover: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(20, 18, 12, 0.05), 0 0 0 1px rgba(20, 18, 12, 0.14), 0 2px 3px rgba(20, 18, 12, 0.08), 0 6px 12px -6px rgba(20, 18, 12, 0.14);
  --lt-press: inset 0 1px 2px rgba(20, 18, 12, 0.12), 0 0 0 1px rgba(20, 18, 12, 0.12);
  --lt-ring: 0 0 0 3px rgba(234, 165, 43, 0.32);
  --lt-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='7' cy='7' r='5.6' fill='none' stroke='%236a6a6f' stroke-width='1.4'/%3E%3Cpath d='M7 4.2V7l1.9 1.2' fill='none' stroke='%236a6a6f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --lt-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%236a6a6f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ui-chevron: var(--lt-chevron);
  --ui-ring: var(--lt-ring);
  --lt-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --lt-gutter: 18px;
}

html[data-ui="light"] body,
html[data-ui="light"] .app-column,
html[data-ui="light"] .main-content {
  background: var(--canvas);
  color: var(--ink);
}

/* —— Sidebar: macOS source list —— */
html[data-ui="light"] .sidebar {
  color: var(--ink);
  background: #efeee9;
  border-right: 1px solid #e3e1db;
}
html[data-ui="light"] .sidebar .brand {
  background: transparent;
  border-bottom-color: transparent;
}
html[data-ui="light"] .sidebar .brand-logo { filter: none; opacity: 1; }
html[data-ui="light"] .nav-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}
html[data-ui="light"] .nav-group + .nav-group { border-top-color: transparent; }
html[data-ui="light"] .side-nav a {
  color: var(--ink-soft);
  border-radius: 12px;
  font-size: 14.5px;
  padding: 7px 10px;
  transition: color 120ms var(--lt-ease);
}
html[data-ui="light"] .side-nav a .nav-ic { color: var(--muted); opacity: 1; }
html[data-ui="light"] .side-nav a:hover { color: var(--ink); background: transparent; }
html[data-ui="light"] .side-nav.has-liquid a:hover:not([aria-current="page"]) {
  background: rgba(20, 18, 12, 0.05);
}
html[data-ui="light"] .side-nav a[aria-current="page"] {
  color: var(--hop);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}
html[data-ui="light"] .side-nav a[aria-current="page"] .nav-ic { color: var(--hop-dark); }
html[data-ui="light"] .side-nav .side-liquid {
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(20, 18, 12, 0.06),
    0 1px 2px rgba(20, 18, 12, 0.08),
    0 2px 6px -2px rgba(20, 18, 12, 0.08);
}
html[data-ui="light"] .sidebar-footer { border-top-color: #e3e1db; }
html[data-ui="light"] .sidebar .role-badge {
  color: var(--muted);
  background: #fff;
  border-color: transparent;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(20, 18, 12, 0.07);
}

/* —— Top bar: translucent like a macOS toolbar —— */
html[data-ui="light"] .topbar {
  background: rgba(246, 245, 242, 0.82);
  border-bottom: 1px solid rgba(20, 18, 12, 0.06);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

/* Letter-avatar: soft chip like role-badge, not a solid hop blob */
html[data-ui="light"] span.avatar {
  color: var(--hop-deeper);
  background: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(20, 18, 12, 0.08);
}
html[data-ui="light"] .profile.is-open .profile-trigger span.avatar,
html[data-ui="light"] .profile-trigger:hover span.avatar {
  background: var(--hop-wash);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(20, 18, 12, 0.1);
}

/* —— Type —— */
html[data-ui="light"] h1,
html[data-ui="light"] .page-heading h1 {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ink);
}
html[data-ui="light"] h2 {
  font-family: var(--font-brand);
  letter-spacing: -0.012em;
}
html[data-ui="light"] .page-lead { color: var(--muted); }

/* —— Buttons: raised, with a top highlight; press sinks 1px —— */
html[data-ui="light"] .button,
html[data-ui="light"] .button-quiet,
html[data-ui="light"] .button-ghost,
html[data-ui="light"] .button-secondary,
html[data-ui="light"] .button-export,
html[data-ui="light"] .filter-trigger,
html[data-ui="light"] .icon-button {
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f1f0ec 100%);
  border: 0;
  border-radius: 10px;
  box-shadow: var(--lt-raise);
  font-weight: 600;
  transition: box-shadow 160ms var(--lt-ease), transform 120ms var(--lt-ease), background 160ms var(--lt-ease);
}
html[data-ui="light"] .button-primary,
html[data-ui="light"] .button.button-primary {
  color: var(--on-hop);
  background: linear-gradient(180deg, #f4b847 0%, #eaa52b 100%);
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 1px rgba(150, 95, 10, 0.32),
    0 1px 2px rgba(120, 70, 0, 0.22),
    0 4px 10px -4px rgba(201, 135, 18, 0.4);
}
html[data-ui="light"] .button.button-danger,
html[data-ui="light"] .button.button-danger:is(:hover, :active:not(:disabled)) {
  color: #fff;
  background: linear-gradient(180deg, #cc3a30 0%, #b3302a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 1px #9e2a24, 0 1px 2px rgba(120, 20, 15, 0.25);
}
@media (hover: hover) and (pointer: fine) {
  html[data-ui="light"] .button:hover,
  html[data-ui="light"] .button-quiet:hover,
  html[data-ui="light"] .button-ghost:hover,
  html[data-ui="light"] .button-export:hover,
  html[data-ui="light"] .filter-trigger:hover,
  html[data-ui="light"] .icon-button:hover {
    color: var(--ink);
    background: linear-gradient(180deg, #ffffff 0%, #fbfaf8 100%);
    box-shadow: var(--lt-raise-hover);
  }
  html[data-ui="light"] .button-primary:hover,
  html[data-ui="light"] .button.button-primary:hover {
    color: var(--on-hop);
    background: linear-gradient(180deg, #f6c05a 0%, #eeab34 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.45),
      0 0 0 1px rgba(150, 95, 10, 0.36),
      0 2px 4px rgba(120, 70, 0, 0.22),
      0 8px 16px -6px rgba(201, 135, 18, 0.45);
  }
}
html[data-ui="light"] .button:active:not(:disabled),
html[data-ui="light"] .filter-trigger:active,
html[data-ui="light"] .icon-button:active {
  transform: translateY(1px);
  background: #f3f2ef;
  box-shadow: var(--lt-press);
}
html[data-ui="light"] .button-primary:active:not(:disabled) {
  background: linear-gradient(180deg, #e7a027 0%, #e09a1c 100%);
  box-shadow: inset 0 1px 3px rgba(110, 66, 5, 0.35), 0 0 0 1px rgba(150, 95, 10, 0.4);
}
html[data-ui="light"] .button:disabled,
html[data-ui="light"] .button[aria-disabled="true"] {
  opacity: 0.5;
  box-shadow: 0 0 0 1px rgba(20, 18, 12, 0.08);
  transform: none;
}
/* Destructive secondary actions keep their red text on the raised white body. */
html[data-ui="light"] .button.retail-btn-rework,
html[data-ui="light"] .button.retail-btn-rework:hover { color: #b3302a; }
@media (hover: hover) and (pointer: fine) {
  html[data-ui="light"] .button.retail-btn-rework:hover { background: linear-gradient(180deg, #fff 0%, #fdf1f0 100%); }
}
/* Outline, not box-shadow: keeps each control's own depth and passes 3:1 on every surface. */
html[data-ui="light"] :focus-visible,
html[data-ui="light"] :is(.button, .filter-trigger, .icon-button, .page-tab, .retail-tabs a, .sync-tabs a, .admin-subtabs a, .filter-period-preset):focus-visible {
  outline: 2px solid var(--hop-deeper);
  outline-offset: 2px;
}

/* —— Segmented controls: recessed track, raised white thumb —— */
html[data-ui="light"] .page-tabs,
html[data-ui="light"] .retail-tabs,
html[data-ui="light"] .sync-tabs,
html[data-ui="light"] .admin-subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  background: #e6e4de;
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(20, 18, 12, 0.08), inset 0 0 0 1px rgba(20, 18, 12, 0.04);
}
html[data-ui="light"] .filter-period-presets {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 4px;
  background: #e6e4de;
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(20, 18, 12, 0.08), inset 0 0 0 1px rgba(20, 18, 12, 0.04);
  overflow: visible;
}
html[data-ui="light"] .page-tab,
html[data-ui="light"] .retail-tabs a,
html[data-ui="light"] .sync-tabs a,
html[data-ui="light"] .admin-subtabs a,
html[data-ui="light"] .filter-period-preset {
  padding: 6px 14px;
  color: #5c5c61;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
  text-decoration: none;
  transition: background 180ms var(--lt-ease), box-shadow 180ms var(--lt-ease), color 120ms var(--lt-ease);
}
html[data-ui="light"] .page-tab:hover,
html[data-ui="light"] .retail-tabs a:hover,
html[data-ui="light"] .sync-tabs a:hover,
html[data-ui="light"] .admin-subtabs a:hover,
html[data-ui="light"] .filter-period-preset:hover { color: var(--ink); background: rgba(255, 255, 255, 0.5); }
html[data-ui="light"] .page-tab.is-active,
html[data-ui="light"] .retail-tabs a[aria-current="page"],
html[data-ui="light"] .sync-tabs a[aria-current="page"],
html[data-ui="light"] .admin-subtabs a[aria-current="page"],
html[data-ui="light"] .filter-period-preset.is-active,
html[data-ui="light"] .filter-period-preset:has(input:checked) {
  color: var(--ink);
  background: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 0.5px rgba(20, 18, 12, 0.08), 0 1px 2px rgba(20, 18, 12, 0.12), 0 2px 6px -2px rgba(20, 18, 12, 0.10);
}
html[data-ui="light"] .filter-period-preset:has(input:focus-visible) { outline: 2px solid var(--hop-deeper); outline-offset: 2px; }

/* —— Switches: iOS track with a lifted knob —— */
html[data-ui="light"] .pm-switch-track {
  width: 44px;
  height: 26px;
  background: #e2e0da;
  box-shadow: inset 0 1px 2px rgba(20, 18, 12, 0.14), inset 0 0 0 1px rgba(20, 18, 12, 0.04);
  transition: background 200ms var(--lt-ease);
}
html[data-ui="light"] .pm-switch-track::after {
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f6f3 100%);
  box-shadow: 0 0 0 0.5px rgba(20, 18, 12, 0.06), 0 1px 1px rgba(20, 18, 12, 0.08), 0 3px 8px rgba(20, 18, 12, 0.18);
  transition: transform 220ms var(--lt-ease);
}
html[data-ui="light"] .pm-switch input:checked + .pm-switch-track {
  background: linear-gradient(180deg, #e7a027 0%, #f0b23e 100%);
  box-shadow: inset 0 1px 2px rgba(110, 66, 5, 0.25);
}
html[data-ui="light"] .pm-switch input:checked + .pm-switch-track::after { transform: translateX(18px); }
html[data-ui="light"] .pm-switch input:focus-visible + .pm-switch-track { outline: 2px solid var(--hop-deeper); outline-offset: 2px; }
html[data-ui="light"] .switch.is-on { background: linear-gradient(180deg, #e7a027 0%, #f0b23e 100%); }
html[data-ui="light"] input[type="checkbox"],
html[data-ui="light"] input[type="radio"] { accent-color: var(--hop-dark); }

/* —— Inputs: white well with a soft inner edge —— */
/* Compact in-table inputs and icon/chevron wrappers keep their own geometry. */
html[data-ui="light"] :is(input, select, textarea):not(:where([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"])):not(.cell-input, .pf-plan-input, .admin-search *, .partner-task-person-select-wrap *) {
  min-height: var(--control-min-height);
  padding-inline: 12px;
  color: var(--ink);
  background-color: #fff;
  border: 1px solid #dedbd4;
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(20, 18, 12, 0.04);
  transition: border-color 140ms var(--lt-ease), box-shadow 140ms var(--lt-ease);
}
html[data-ui="light"] :is(select, .admin-select):not([multiple]):not(.partner-task-person-select-wrap *) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background: #fff var(--lt-chevron) no-repeat right 12px center / 12px 12px;
}
html[data-ui="light"] select.cell-input:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 18px;
  background: #fff var(--lt-chevron) no-repeat right 4px center / 10px 10px;
}
html[data-ui="light"] textarea { padding-block: 10px; }
html[data-ui="light"] input[type="time"] {
  padding-right: 34px;
  background: #fff var(--lt-clock) no-repeat right 12px center / 14px 14px;
}
/* Native picker stays clickable, only its icon is hidden behind ours. */
html[data-ui="light"] input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0; }
html[data-ui="light"] input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.45; }
html[data-ui="light"] :is(input, select, textarea):not(:where([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"])):not(.cell-input, .pf-plan-input, .admin-search *, .partner-task-person-select-wrap *):focus {
  outline: none;
  border-color: var(--hop-dark);
  box-shadow: inset 0 1px 2px rgba(20, 18, 12, 0.04), var(--lt-ring);
}
html[data-ui="light"] :is(.field-invalid, .has-error) :is(input, select, textarea) { border-color: var(--danger) !important; }

/* —— Surfaces: one level of cards, no card-in-card borders —— */
html[data-ui="light"] .data-section,
html[data-ui="light"] .filter-panel,
html[data-ui="light"] .form-panel,
html[data-ui="light"] .dash-chart-panel,
html[data-ui="light"] .dash-rank-panel,
html[data-ui="light"] .pulse-rank-panel,
html[data-ui="light"] .admin-card,
html[data-ui="light"] .pm-card,
html[data-ui="light"] .auth-card,
html[data-ui="light"] .retail-progress,
html[data-ui="light"] .ipr-panel {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
}
html[data-ui="light"] .data-section > .section-heading {
  background: transparent;
  border-bottom: 0;
  padding: 18px var(--lt-gutter) 6px;
}
html[data-ui="light"] .data-section > :is(.table-wrap, .report-table-wrap) :is(th, td):first-child { padding-left: var(--lt-gutter); }
html[data-ui="light"] .data-section > :is(.table-wrap, .report-table-wrap) :is(th, td):last-child { padding-right: var(--lt-gutter); }
html[data-ui="light"] .data-section > .empty-state { padding: 12px var(--lt-gutter) 20px; }
html[data-ui="light"] .data-section > :is(.retail-quiz-task, .retail-step-body, .retail-quiz-final),
html[data-ui="light"] .retail-quiz-modules > li { padding-inline: var(--lt-gutter); }
/* Leftover side stripes and boxed sub-panels from older screens. */
html[data-ui="light"] .retail-disclosure { border: 0; border-top: 1px solid #f0eeea; border-radius: 0; background: transparent; }
html[data-ui="light"] :is(.retail-review-card, .pulse-attention) { border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-panel); }
html[data-ui="light"] :is(.retail-reference, .ipr-goal-callout) { border-left: 0; border-radius: 12px; background: var(--surface-subtle); }
html[data-ui="light"] .ipr-pulse-cards li,
html[data-ui="light"] :is(.data-table, .report-table) tbody tr:is(:hover, :focus-within) td:first-child { box-shadow: none; }
html[data-ui="light"] .retail-store-card .retail-store-card-cta { color: var(--hop-deeper); }
/* Sections keep overflow visible for sticky table heads, so filled children round themselves. */
html[data-ui="light"] .data-section > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
html[data-ui="light"] .data-section > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
/* Status already colours the % value, so the hero drops its side stripe. */
html[data-ui="light"] .dash-plan-hero {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
}
html[data-ui="light"] .dash-plan-title {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}
/* Metrics sit on the card itself, split by hairlines: no tiles inside the card. */
html[data-ui="light"] .dash-plan-hero-main.pulse-net-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 24px;
}
html[data-ui="light"] .pulse-net-grid > :first-child { grid-column: span 2; }
html[data-ui="light"] :is(.dash-plan-fact-block, .dash-plan-pct-block) {
  padding: 14px 0 12px;
  background: transparent;
  border: 0;
  border-top: 1px solid #f0eeea;
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="light"] .pulse-net-grid > :first-child .dash-plan-fact-value { font-size: 2rem; }
html[data-ui="light"] .pulse-net-grid :is(.dash-plan-fact-value, .dash-plan-pct-value) { font-weight: 650; }
@media (max-width: 900px) {
  html[data-ui="light"] .dash-plan-hero-main.pulse-net-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html[data-ui="light"] :is(.dash-plan-fact-block, .dash-plan-pct-block) { justify-content: flex-start; }
html[data-ui="light"] .dash-pulse > .partner-tasks { margin-bottom: 0; }
html[data-ui="light"] .dash-period-btn-label { text-transform: none; letter-spacing: 0; }
html[data-ui="light"] .pulse-rr-pill { border-radius: 999px; padding-inline: 10px; }
html[data-ui="light"] .pulse-rr-pill:not(.is-good, .is-warn, .is-bad) { min-width: 0; padding-inline: 0; background: transparent; color: var(--muted); }
html[data-ui="light"] :is(.pulse-empty, .empty-state) {
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 14px;
}
html[data-ui="light"] :is(.data-section, .dash-plan-hero, .form-panel) :is(.table-wrap, .report-table-wrap) {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="light"] :is(.data-section, .form-panel) > :is(.table-wrap, .report-table-wrap):first-child { border-top-left-radius: 16px; border-top-right-radius: 16px; }
html[data-ui="light"] :is(.data-section, .form-panel) > :is(.table-wrap, .report-table-wrap):last-child { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
html[data-ui="light"] :is(.data-table, .report-table) thead th { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
html[data-ui="light"] .kpi-grid.dash-kpi-grid {
  gap: 8px;
  padding: 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
html[data-ui="light"] .dash-kpi-grid .kpi,
html[data-ui="light"] .report-stat {
  background: var(--surface-subtle);
  border: 0;
  border-radius: 12px;
}
html[data-ui="light"] .retail-store-card {
  background: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--lt-raise);
  transition: box-shadow 160ms var(--lt-ease), transform 120ms var(--lt-ease);
}
html[data-ui="light"] .retail-store-card:hover { box-shadow: var(--lt-raise-hover); }
html[data-ui="light"] .retail-store-card:active { transform: translateY(1px); box-shadow: var(--lt-press); }

/* —— Retail: status green only for «done», one dark widget for the live shift —— */
html[data-ui="light"] .retail-progress-head strong { color: var(--ink); }
html[data-ui="light"] .retail-meter.is-light { height: 4px; background: #ebe9e4; }
html[data-ui="light"] .retail-meter.is-light > span { background: var(--hop); }
html[data-ui="light"] .retail-stepper a {
  border: 0;
  border-radius: 12px;
  background: transparent;
}
html[data-ui="light"] .retail-stepper a:hover { background: var(--surface-subtle); }
html[data-ui="light"] .retail-step-num {
  width: 26px;
  height: 26px;
  color: var(--muted);
  border: 1.5px solid currentColor;
  font-size: 0.8rem;
}
html[data-ui="light"] :is(.is-done > a, .retail-step.is-done) .retail-step-num {
  color: var(--success);
  background: var(--success-bg);
  border-color: transparent;
}
html[data-ui="light"] .retail-current {
  border-left: 0;
  border-radius: 12px;
  background: var(--surface-subtle);
}
html[data-ui="light"] .retail-hero {
  background: linear-gradient(180deg, #2c2c2e 0%, #1d1d1f 100%);
  box-shadow: 0 1px 2px rgba(20, 18, 12, 0.18), 0 10px 24px -12px rgba(20, 18, 12, 0.45);
}
html[data-ui="light"] .app-dock {
  background: color-mix(in srgb, #fff 78%, transparent);
  border-color: rgba(20, 18, 12, 0.08);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    0 0 0 0.5px rgba(20, 18, 12, 0.04),
    0 12px 36px -14px rgba(20, 18, 12, 0.38);
  -webkit-backdrop-filter: saturate(200%) blur(36px);
  backdrop-filter: saturate(200%) blur(36px);
}
html[data-ui="light"] .app-dock a[aria-current="page"],
html[data-ui="light"] .app-dock button.is-current {
  color: var(--hop);
  background: transparent;
}
html[data-ui="light"] .app-dock .dock-liquid {
  background: rgba(60, 60, 67, 0.1);
}

/* —— Phone: thumb-sized targets, 16px gutters —— */
html[data-ui="light"] .retail-filters .button { min-height: var(--control-min-height); }
@media (max-width: 640px) {
  html[data-ui="light"] { --control-min-height: 44px; --lt-gutter: 16px; }
  html[data-ui="light"] .main-content { padding-inline: 16px; }
  html[data-ui="light"] :is(.menu-button, .profile-trigger) { min-width: 44px; min-height: 44px; }
  /* A segmented control scrolls sideways instead of breaking onto a second row. */
  html[data-ui="light"] :is(.page-tabs, .retail-tabs, .sync-tabs, .admin-subtabs) {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html[data-ui="light"] :is(.page-tabs, .retail-tabs, .sync-tabs, .admin-subtabs)::-webkit-scrollbar { display: none; }
  html[data-ui="light"] :is(.page-tab, .retail-tabs a, .sync-tabs a, .admin-subtabs a) {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  html[data-ui="light"] .retail-quiz-modules li > form { flex: 1 1 100%; }
  html[data-ui="light"] .retail-quiz-modules .button-primary { width: 100%; min-height: 48px; }
}

/* —— Tables: hairlines only —— */
html[data-ui="light"] .data-table th,
html[data-ui="light"] .report-table th {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
}
html[data-ui="light"] .data-table td,
html[data-ui="light"] .report-table td { border-color: #f0eeea; }
html[data-ui="light"] :is(.data-table, .report-table) :is(th, td) { border-left: 0; border-right: 0; }
html[data-ui="light"] .data-table tbody tr:hover td,
html[data-ui="light"] .report-table tbody tr:hover td { background: #faf9f6; }

/* —— Status —— */
html[data-ui="light"] .alert {
  border: 0;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: inset 0 0 0 1px rgba(20, 18, 12, 0.05);
}
html[data-ui="light"] .retail-pill,
html[data-ui="light"] .retail-chip,
html[data-ui="light"] .count-badge {
  border-radius: 999px;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(20, 18, 12, 0.06);
}

/* —— Charts follow the accent —— */
html[data-ui="light"] .dash-bar { fill: #eaa52b; }
html[data-ui="light"] .dash-bar.is-highlight { fill: #c98712; }
html[data-ui="light"] .dash-bar-checks { fill: #c9c6bf; }
html[data-ui="light"] .dash-rank-fill { fill: #eaa52b; }

/* —— Motion: only the page title settles in; blocks appear at once —— */
html[data-ui="light"] .app-body .main-content.is-ready > *:not(.filter-shell) { animation: none; }
html[data-ui="light"] .app-body .main-content.is-ready > .page-heading {
  animation: ui-light-enter 220ms var(--lt-ease) both;
}
@keyframes ui-light-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-ui="light"] *,
  html[data-ui="light"] *::before,
  html[data-ui="light"] *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  html[data-ui="light"] .app-body .main-content.is-ready > .page-heading { animation: none; }
}

/* =============================================================================
   Тёмная — та же светлая, только ночью. Плотные поверхности, без размытия.
   ============================================================================= */
html[data-ui="dark"] {
  color-scheme: dark;
  --ink: #f2f2f4;
  --ink-soft: #d6d6dc;
  --muted: #9b9ba6;
  --muted-soft: #6e6e78;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --surface: #1c1f27;
  --surface-subtle: #252833;
  --fill: #12141a;
  --canvas: #12141a;
  --canvas-deep: #0d0f14;
  --charcoal: #f2f2f4;
  --charcoal-elevated: #16181e;
  --charcoal-hover: #2a2e38;
  --hop: #eaa52b;
  --hop-dark: #f0b545;
  --hop-deeper: #ffd78a;
  --hop-soft: rgba(234, 165, 43, 0.28);
  --hop-wash: rgba(234, 165, 43, 0.12);
  --on-hop: #2b1d04;
  --success: #3dd68c;
  --success-bg: rgba(61, 214, 140, 0.14);
  --rt-green: var(--success);
  --rt-green-deep: #8ef0bc;
  --rt-green-soft: #5ee0a0;
  --rt-green-wash: var(--success-bg);
  --rt-green-line: rgba(61, 214, 140, 0.32);
  --warning: #f5c451;
  --warning-bg: rgba(245, 196, 81, 0.14);
  --danger: #ff6b63;
  --danger-bg: rgba(255, 107, 99, 0.14);
  --rt-ok: var(--success);
  --rt-ok-bg: var(--success-bg);
  --rt-on-green: #f5f5f7;
  --rt-on-green-muted: #aeaeb2;
  --info: #f0b545;
  --info-bg: rgba(234, 165, 43, 0.12);
  --focus: #eaa52b;
  --link: #f0b545;
  --table-header-bg: transparent;
  --table-header-fg: #9b9ba6;
  --accent: var(--hop);
  --bg: var(--canvas);
  --panel: var(--surface-subtle);
  --radius-panel: 16px;
  --radius-control: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-panel: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
  --ui-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%239b9ba6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ui-ring: 0 0 0 3px rgba(234, 165, 43, 0.32);
}

html[data-ui="dark"] body,
html[data-ui="dark"] .app-column,
html[data-ui="dark"] .main-content {
  background: var(--canvas);
  color: var(--ink);
}

/* —— Sidebar: тот же source list, что у светлой, только ночью —— */
html[data-ui="dark"] .sidebar {
  color: var(--ink);
  background: #16181e;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
html[data-ui="dark"] .sidebar .brand {
  background: transparent;
  border-bottom-color: transparent;
}
html[data-ui="dark"] .sidebar .brand-logo {
  filter: invert(1) hue-rotate(180deg);
  opacity: 1;
}
html[data-ui="dark"] .nav-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}
html[data-ui="dark"] .nav-group + .nav-group { border-top-color: transparent; }
html[data-ui="dark"] .side-nav a {
  color: var(--ink-soft);
  border-radius: 12px;
  font-size: 14.5px;
  padding: 7px 10px;
  box-shadow: none;
  transition: color 120ms ease;
}
html[data-ui="dark"] .side-nav a .nav-ic { color: var(--muted); opacity: 1; }
html[data-ui="dark"] .side-nav a:hover {
  color: var(--ink);
  background: transparent;
}
html[data-ui="dark"] .side-nav.has-liquid a:hover:not([aria-current="page"]) {
  background: rgba(255, 255, 255, 0.05);
}
html[data-ui="dark"] .side-nav a[aria-current="page"] {
  color: var(--hop);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}
html[data-ui="dark"] .side-nav a[aria-current="page"] .nav-ic { color: var(--hop); }
html[data-ui="dark"] .side-nav .side-liquid {
  background: #252833;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 2px 8px -2px rgba(0, 0, 0, 0.45);
}
html[data-ui="dark"] .sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.07);
}
html[data-ui="dark"] .sidebar .role-badge {
  color: var(--muted);
  background: #252833;
  border-color: transparent;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html[data-ui="dark"] .topbar {
  background: rgba(22, 24, 30, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
html[data-ui="dark"] h1,
html[data-ui="dark"] .page-heading h1,
html[data-ui="dark"] h2 { color: var(--ink); }
html[data-ui="dark"] a { color: var(--link); }
html[data-ui="dark"] .side-nav a,
html[data-ui="dark"] .topbar a,
html[data-ui="dark"] .retail-menu-row,
html[data-ui="dark"] .button,
html[data-ui="dark"] :is(.data-table, .report-table) th a,
html[data-ui="dark"] .pulse-city-link { color: inherit; }
html[data-ui="dark"] :is(.data-table, .report-table) th a:hover { color: var(--hop); }
html[data-ui="dark"] .button,
html[data-ui="dark"] .button-quiet,
html[data-ui="dark"] .button-ghost,
html[data-ui="dark"] .button-secondary,
html[data-ui="dark"] .button-export,
html[data-ui="dark"] .filter-trigger,
html[data-ui="dark"] .icon-button {
  color: var(--ink);
  background: #2a2e38;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: none;
}
html[data-ui="dark"] .button-primary,
html[data-ui="dark"] .button.button-primary {
  color: var(--on-hop);
  background: linear-gradient(180deg, #f4b847 0%, #eaa52b 100%);
  border-color: transparent;
}
html[data-ui="dark"] .button.button-danger,
html[data-ui="dark"] .button.button-danger:is(:hover, :active:not(:disabled)) {
  color: #fff;
  background: linear-gradient(180deg, #ff6b63 0%, #e24b44 100%);
  border-color: transparent;
}
html[data-ui="dark"] span.avatar {
  color: var(--hop-deeper);
  background: #252833;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
html[data-ui="dark"] .profile.is-open .profile-trigger span.avatar,
html[data-ui="dark"] .profile-trigger:hover span.avatar {
  background: var(--hop-wash);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(255, 255, 255, 0.12);
}

/* Segmented tabs — как у светлой, ночной трек */
html[data-ui="dark"] .page-tabs,
html[data-ui="dark"] .retail-tabs,
html[data-ui="dark"] .sync-tabs,
html[data-ui="dark"] .admin-subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  background: #12141a;
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
html[data-ui="dark"] .filter-period-presets {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 4px;
  background: #12141a;
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: visible;
}
html[data-ui="dark"] .page-tab,
html[data-ui="dark"] .retail-tabs a,
html[data-ui="dark"] .sync-tabs a,
html[data-ui="dark"] .admin-subtabs a,
html[data-ui="dark"] .filter-period-preset {
  padding: 6px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
  text-decoration: none;
}
html[data-ui="dark"] .page-tab.is-active,
html[data-ui="dark"] .retail-tabs a[aria-current="page"],
html[data-ui="dark"] .sync-tabs a[aria-current="page"],
html[data-ui="dark"] .admin-subtabs a[aria-current="page"],
html[data-ui="dark"] .filter-period-preset.is-active,
html[data-ui="dark"] .filter-period-preset:has(input:checked) {
  color: var(--ink);
  background: #2a2e38;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-ui="dark"] .data-section,
html[data-ui="dark"] .filter-panel,
html[data-ui="dark"] .form-panel,
html[data-ui="dark"] .dash-chart-panel,
html[data-ui="dark"] .dash-rank-panel,
html[data-ui="dark"] .pulse-rank-panel,
html[data-ui="dark"] .dash-plan-hero,
html[data-ui="dark"] .pulse-attention,
html[data-ui="dark"] .admin-card,
html[data-ui="dark"] .profile-menu,
html[data-ui="dark"] .filter-dialog-chrome,
html[data-ui="dark"] .auth-card,
html[data-ui="dark"] .retail-review-card,
html[data-ui="dark"] .ipr-panel,
html[data-ui="dark"] .pm-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
}
html[data-ui="dark"] .filter-dialog {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="dark"] .data-section > .section-heading {
  background: transparent;
  border-bottom: 0;
  padding: 18px 18px 6px;
}
/* Круглые карточки: дети с фоном не торчат квадратными углами */
html[data-ui="dark"] :is(.data-section, .form-panel, .admin-card, .dash-plan-hero, .ipr-panel) > :first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
html[data-ui="dark"] :is(.data-section, .form-panel, .admin-card, .dash-plan-hero, .ipr-panel) > :last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
html[data-ui="dark"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):first-child,
html[data-ui="dark"] :is(.data-section, .admin-card) .admin-table :is(th, td):first-child { padding-left: 18px; }
html[data-ui="dark"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):last-child,
html[data-ui="dark"] :is(.data-section, .admin-card) .admin-table :is(th, td):last-child { padding-right: 18px; }
html[data-ui="dark"] .data-section > .empty-state { padding: 12px 18px 20px; }
html[data-ui="dark"] .admin-main .data-section,
html[data-ui="dark"] .admin-card { overflow: hidden; }
html[data-ui="dark"] .admin-table .table-actions .button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
}
html[data-ui="dark"] .table-icon-btn {
  color: var(--ink-soft);
  background: #2a2e38;
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-ui="dark"] .table-icon-btn:hover {
  color: var(--ink);
  background: #343945;
  border-color: rgba(255, 255, 255, 0.16);
}
html[data-ui="dark"] .retail-task-list {
  background: transparent;
}
html[data-ui="dark"] .retail-task-item {
  background: transparent;
}
html[data-ui="dark"] .retail-task-list > li:last-child .retail-task-item,
html[data-ui="dark"] .retail-task-list > li:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
html[data-ui="dark"] dialog.user-drawer .user-dialog-panel {
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  background: var(--surface);
  border: 0;
  box-shadow: none;
}
html[data-ui="dark"] dialog.user-drawer .form-actions {
  border-bottom-left-radius: inherit;
}
html[data-ui="dark"] .dash-plan-hero { border-left: 0; }
html[data-ui="dark"] :is(.dash-plan-fact-block, .dash-plan-pct-block) {
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="dark"] .data-table th,
html[data-ui="dark"] .report-table th {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
html[data-ui="dark"] .data-table td,
html[data-ui="dark"] .report-table td { border-color: rgba(255, 255, 255, 0.06); color: var(--ink); }
html[data-ui="dark"] .data-table tbody tr:hover td,
html[data-ui="dark"] .report-table tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
html[data-ui="dark"] :is(.data-section, .dash-plan-hero, .form-panel) :is(.table-wrap, .report-table-wrap) {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="dark"] .report-summary-strip,
html[data-ui="dark"] .report-stat {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.06);
}
html[data-ui="dark"] .report-stat.is-lead {
  background: color-mix(in srgb, var(--hop-wash) 55%, var(--surface));
}
html[data-ui="dark"] .dash-kpi-grid .kpi,
html[data-ui="dark"] .report-stat:not(.is-lead) {
  background: var(--surface-subtle);
}
html[data-ui="dark"] .partner-task-person {
  background: color-mix(in srgb, var(--surface-subtle) 80%, transparent);
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-ui="dark"] .partner-task-person.is-editable:hover {
  background: rgba(255, 255, 255, 0.06);
}
html[data-ui="dark"] .partner-task-person-select-wrap select {
  min-height: 0;
  padding: 0 14px 0 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
/* Инпуты / селекты — тот же язык, что у светлой, ночной колодец */
html[data-ui="dark"] :is(input, select, textarea):not(:where([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"])):not(.cell-input, .pf-plan-input, .admin-search *, .partner-task-person-select-wrap *) {
  min-height: var(--control-min-height);
  padding-inline: 12px;
  color: var(--ink);
  background-color: #12141a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
html[data-ui="dark"] :is(select, .admin-select, .field select):not([multiple]):not(.partner-task-person-select-wrap *):not(.cell-input) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  color: var(--ink);
  background: #12141a var(--ui-chevron) no-repeat right 12px center / 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
html[data-ui="dark"] :is(select, .admin-select, .field select):not([multiple]):not(.partner-task-person-select-wrap *):not(.cell-input):focus {
  outline: none;
  border-color: var(--hop);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), var(--ui-ring);
}
html[data-ui="dark"] select option,
html[data-ui="dark"] select optgroup {
  color: var(--ink);
  background: #1c1f27;
}
html[data-ui="dark"] :is(.cell-input, .pf-plan-input) {
  color: var(--ink);
  background: #12141a;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
html[data-ui="dark"] select.cell-input:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 18px;
  background: #12141a var(--ui-chevron) no-repeat right 4px center / 10px 10px;
}
html[data-ui="dark"] .ms-dropdown-toggle,
html[data-ui="dark"] .filter-fold > summary {
  color: var(--ink);
  background: #12141a;
  border-color: rgba(255, 255, 255, 0.12);
}
html[data-ui="dark"] .ms-dropdown-panel {
  color: var(--ink);
  background: #1c1f27;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
html[data-ui="dark"] .ms-dropdown-panel li label:hover {
  background: rgba(255, 255, 255, 0.06);
}
html[data-ui="dark"] .filter-fold[open] > summary {
  border-color: var(--hop);
  box-shadow: var(--ui-ring);
}
html[data-ui="dark"] .filter-dialog .filter-fold-panel,
html[data-ui="dark"] .filter-fold-panel {
  background: #16181e;
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-ui="dark"] .alert {
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
html[data-ui="dark"] .alert-error { color: #ffb4ae; }
html[data-ui="dark"] .alert-warning { color: #f5d08a; }
html[data-ui="dark"] .alert-info { color: #f0c878; }
html[data-ui="dark"] .alert-success { color: #8ef0bc; }
html[data-ui="dark"] .retail-pill,
html[data-ui="dark"] .retail-chip,
html[data-ui="dark"] .count-badge,
html[data-ui="dark"] .status-badge {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
html[data-ui="dark"] .count-badge {
  color: var(--ink);
  background: #2a2e38;
}
html[data-ui="dark"] :is(.data-table, .report-table) thead th {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}
html[data-ui="dark"] .data-table.report-table thead th,
html[data-ui="dark"] .data-table.ipr-table thead th {
  background: #1c1f27;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}
html[data-ui="dark"] .kpi-grid.dash-kpi-grid {
  gap: 8px;
  padding: 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
html[data-ui="dark"] .dash-kpi-grid .kpi {
  background: var(--surface-subtle);
  border: 0;
  border-radius: 12px;
}
html[data-ui="dark"] .filter-overlay {
  background: rgba(0, 0, 0, 0.55);
}
html[data-ui="dark"] .pm-switch-track {
  background: #3a3e48;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}
html[data-ui="dark"] .pm-switch-track::after {
  background: #f2f2f4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
html[data-ui="dark"] .pm-switch input:checked + .pm-switch-track {
  background: linear-gradient(180deg, #e7a027 0%, #f0b23e 100%);
}
html[data-ui="dark"] .retail-meter.is-light { background: #2a2e38; }
html[data-ui="dark"] .retail-meter.is-light > span { background: var(--hop); }

/* ИПР «Инструменты роста»: карточки отделяются от canvas, текст читаемый. */
html[data-ui="dark"] .growth-ref-card {
  background: var(--surface-subtle);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 28px -16px rgba(0, 0, 0, 0.55);
}
html[data-ui="dark"] .growth-ref-how {
  background: rgba(0, 122, 255, 0.14);
}
html[data-ui="dark"] .growth-ref--green .growth-ref-how {
  background: rgba(61, 214, 140, 0.14);
}
html[data-ui="dark"] .growth-ref--orange .growth-ref-how {
  background: rgba(245, 196, 81, 0.14);
}
/* Живая смена — тот же «тёмный виджет», что в light; не заливка success. */
html[data-ui="dark"] .retail-hero {
  color: #f2f2f4;
  background: linear-gradient(180deg, #2a2e38 0%, #1c1f27 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 28px -14px rgba(0, 0, 0, 0.7);
}
html[data-ui="dark"] .retail-hero-eyebrow,
html[data-ui="dark"] .retail-hero-sub,
html[data-ui="dark"] .retail-hero-money-label,
html[data-ui="dark"] .retail-hero-money small {
  color: #9b9ba6;
}
html[data-ui="dark"] .retail-timer { color: #fff; }
html[data-ui="dark"] .retail-hero-sub strong { color: #f2f2f4; }
html[data-ui="dark"] .retail-hero-money {
  border-top-color: rgba(255, 255, 255, 0.1);
}
html[data-ui="dark"] .retail-hero-money-value { color: var(--hop); }
html[data-ui="dark"] .retail-meter {
  background: rgba(255, 255, 255, 0.1);
}
html[data-ui="dark"] .retail-meter > span { background: var(--hop); }
html[data-ui="dark"] .retail-live-dot {
  background: var(--hop);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--hop) 55%, transparent);
}
html[data-ui="dark"] .retail-hero .button-ghost {
  color: #f2f2f4;
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
}
html[data-ui="dark"] .retail-plan-card {
  background: var(--surface-subtle);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-ui="dark"] .retail-day-plan .retail-hint { color: var(--muted); }
html[data-ui="dark"] .kitchen-abc-badge.kitchen-abc-a {
  background: rgba(61, 214, 140, 0.16);
  color: #8ef0bc;
}
html[data-ui="dark"] .kitchen-abc-badge.kitchen-abc-b {
  background: rgba(245, 196, 81, 0.16);
  color: #f5d08a;
}
html[data-ui="dark"] .kitchen-abc-badge.kitchen-abc-c {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
html[data-ui="dark"] .ipr-kpi-weekly tbody tr:is(:hover, :focus-within) td:first-child {
  background: rgba(255, 255, 255, 0.04);
}
html[data-ui="dark"] :is(.pulse-empty, .empty-state) {
  background: transparent;
  border: 0;
  color: var(--muted);
}
html[data-ui="dark"] .dash-bar,
html[data-ui="dark"] .dash-rank-fill { fill: #eaa52b; }
html[data-ui="dark"] .dash-bar.is-highlight { fill: #f0b545; }
html[data-ui="dark"] .dash-bar-checks { fill: #3a3e48; }
html[data-ui="dark"] .app-body .main-content.is-ready > *:not(.filter-shell) { animation: none; }

/* =============================================================================
   Liquid Glass по HIG Apple: стекло только у навигации, которая парит над контентом
   (сайдбар, кнопки шапки, меню, листы). Контент — плотные белые карточки.
   ============================================================================= */
html[data-ui="glass"] {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-brand: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ink: #1d1d1f;
  --ink-soft: #3a3a3c;
  --muted: #6e6e73;
  --muted-soft: #8e8e93;
  --line: rgba(60, 60, 67, 0.12);
  --line-strong: rgba(60, 60, 67, 0.2);
  --surface: #ffffff;
  --surface-subtle: #f5f5f7;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-hover: rgba(118, 118, 128, 0.18);
  --canvas: #eef1f6;
  --canvas-deep: #e4e8ef;
  --charcoal: #1d1d1f;
  --charcoal-elevated: rgba(255, 255, 255, 0.62);
  --charcoal-hover: rgba(255, 255, 255, 0.48);
  --hop: #007aff;
  --hop-dark: #0066d6;
  --hop-deeper: #0040dd;
  --hop-soft: #b3d7ff;
  --hop-wash: rgba(0, 122, 255, 0.12);
  --on-hop: #ffffff;
  --success: #34c759;
  --success-bg: rgba(52, 199, 89, 0.14);
  --rt-green: var(--success);
  --rt-green-deep: #248a3d;
  --rt-green-soft: #30d158;
  --rt-green-wash: var(--success-bg);
  --rt-green-line: rgba(52, 199, 89, 0.3);
  --warning: #ff9f0a;
  --warning-bg: rgba(255, 159, 10, 0.14);
  --danger: #ff3b30;
  --danger-bg: rgba(255, 59, 48, 0.12);
  --rt-ok: var(--success);
  --rt-ok-bg: var(--success-bg);
  --rt-on-green: #f5f5f7;
  --rt-on-green-muted: #6e6e73;
  --info: #007aff;
  --info-bg: rgba(0, 122, 255, 0.12);
  --focus: #007aff;
  --link: #007aff;
  --table-header-bg: transparent;
  --table-header-fg: #6e6e73;
  --accent: var(--hop);
  --bg: transparent;
  --panel: var(--surface-subtle);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-control: 10px;
  --radius-panel: 22px;
  --radius-avatar: 50%;
  --control-min-height: 38px;
  --density-pad: 8px 16px;
  --text-body: 1rem;
  --text-body-compact: 0.9375rem;
  --text-meta: 0.875rem;
  /* Стекло: прозрачное, сильно насыщает то, что под ним; край — блик, а не рамка */
  --lg-blur: blur(18px) saturate(190%) brightness(1.06);
  --lg-bg: linear-gradient(rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.26));
  --lg-bg-strong: linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72));
  --lg-rim: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.2) 30%,
    rgba(255, 255, 255, 0.05) 55%,
    rgba(255, 255, 255, 0.7) 100%
  );
  --lg-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.06),
    0 12px 36px -12px rgba(15, 30, 60, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  --lg-shadow-hover:
    0 0 0 0.5px rgba(0, 0, 0, 0.07),
    0 16px 40px -12px rgba(15, 30, 60, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.4);
  --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-panel:
    0 0 0 0.5px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 10px 30px -16px rgba(15, 30, 60, 0.14);
  --lg-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ui-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ui-ring: 0 0 0 3px rgba(0, 122, 255, 0.32);
}

html[data-ui="glass"] body {
  color: var(--ink);
  /* Цветные «обои» нужны только стеклу навигации; контент лежит на белых карточках */
  background:
    radial-gradient(520px 460px at 0% 6%, rgba(40, 140, 255, 0.75), transparent 70%),
    radial-gradient(480px 440px at 4% 52%, rgba(160, 100, 255, 0.6), transparent 70%),
    radial-gradient(500px 420px at 0% 100%, rgba(255, 130, 100, 0.55), transparent 70%),
    radial-gradient(1100px 700px at 100% 0%, rgba(120, 200, 255, 0.2), transparent 60%),
    var(--canvas);
  background-attachment: fixed;
  font-size: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

html[data-ui="glass"] .app-column,
html[data-ui="glass"] .main-content {
  background: transparent;
  color: var(--ink);
}

/* —— Sidebar: плавающая стеклянная панель с отступом от края окна, как в macOS —— */
html[data-ui="glass"] .sidebar {
  inset: 10px auto 10px 10px;
  width: 240px;
  overflow: hidden;
  color: var(--ink);
  background:
    var(--lg-bg) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  border-radius: 24px;
  box-shadow: var(--lg-shadow);
  -webkit-backdrop-filter: var(--lg-blur);
  backdrop-filter: var(--lg-blur);
}
html[data-ui="glass"] .app-column { margin-left: 260px; }
html[data-ui="glass"] .sidebar .brand {
  min-height: 56px;
  padding: 14px 14px 12px;
  background: transparent;
  border-bottom-color: transparent;
}
html[data-ui="glass"] .sidebar .brand-logo {
  filter: none;
  opacity: 1;
  height: 18px;
}
html[data-ui="glass"] .side-nav {
  padding: 8px 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, 0.25) transparent;
}
html[data-ui="glass"] .side-nav::-webkit-scrollbar { width: 6px; }
html[data-ui="glass"] .side-nav::-webkit-scrollbar-thumb {
  background: rgba(60, 60, 67, 0.25);
  border-radius: 999px;
}
html[data-ui="glass"] .side-nav::-webkit-scrollbar-track { background: transparent; }
html[data-ui="glass"] .nav-group { padding: 4px 0 8px; }
html[data-ui="glass"] .nav-group + .nav-group {
  margin-top: 4px;
  padding-top: 12px;
  border-top-color: transparent;
}
html[data-ui="glass"] .nav-label {
  margin: 0 10px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}
html[data-ui="glass"] .side-nav a {
  margin: 1px 0;
  padding: 7px 10px;
  gap: 10px;
  color: var(--ink-soft);
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: none;
  border: 0;
  background: transparent;
  transition: color 120ms var(--lg-ease);
}
html[data-ui="glass"] .side-nav a .nav-ic {
  width: 18px;
  height: 18px;
  color: var(--muted);
  opacity: 1;
}
html[data-ui="glass"] .side-nav a:hover {
  color: var(--ink);
  background: transparent;
}
html[data-ui="glass"] .side-nav.has-liquid a:hover:not([aria-current="page"]) {
  background: rgba(255, 255, 255, 0.35);
}
html[data-ui="glass"] .side-nav a[aria-current="page"] {
  color: var(--hop);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-weight: 600;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] .side-nav a[aria-current="page"] .nav-ic { color: var(--hop); }
html[data-ui="glass"] .side-nav .side-liquid {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05), 0 2px 8px -3px rgba(15, 30, 60, 0.18);
}
html[data-ui="glass"] .sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 0;
}
html[data-ui="glass"] .sidebar .role-badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

/* Шапка без полосы: крошки на фоне, кнопки — стеклянные капсулы */
html[data-ui="glass"] .topbar {
  min-height: 64px;
  padding-top: 10px;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] .topbar .button,
html[data-ui="glass"] .page-heading .filter-trigger {
  min-height: 38px;
  padding-inline: 16px;
  color: var(--ink);
  background:
    var(--lg-bg-strong) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: var(--lg-shadow);
  -webkit-backdrop-filter: var(--lg-blur);
  backdrop-filter: var(--lg-blur);
}
html[data-ui="glass"] .profile-trigger {
  border-radius: 999px;
  box-shadow: var(--lg-shadow);
}

html[data-ui="glass"] h1,
html[data-ui="glass"] .page-heading h1 {
  color: var(--ink);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
html[data-ui="glass"] h2 { color: var(--ink); font-size: 1.1875rem; font-weight: 650; letter-spacing: -0.015em; }
html[data-ui="glass"] .app-body .main-content.is-ready > *:not(.filter-shell) { animation: none; }
html[data-ui="glass"] a { color: var(--link); }
html[data-ui="glass"] .side-nav a,
html[data-ui="glass"] .topbar a,
html[data-ui="glass"] .retail-menu-row,
html[data-ui="glass"] .pulse-city-link,
html[data-ui="glass"] .button,
html[data-ui="glass"] :is(.data-table, .report-table) th a { color: inherit; }
html[data-ui="glass"] :is(.data-table, .report-table) th a:hover { color: var(--hop); }

html[data-ui="glass"] .admin-nav a[aria-current="page"] {
  color: var(--ink);
  background:
    var(--lg-bg-strong) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  box-shadow: var(--lg-shadow);
}
html[data-ui="glass"] .admin-nav a[aria-current="page"] .nav-ic { color: var(--hop); }

/* Кнопки в контенте — капсулы как в iOS 26: серая заливка или сплошной system blue */
html[data-ui="glass"] .button,
html[data-ui="glass"] .button-quiet,
html[data-ui="glass"] .button-ghost,
html[data-ui="glass"] .button-secondary,
html[data-ui="glass"] .button-export,
html[data-ui="glass"] .filter-trigger,
html[data-ui="glass"] .icon-button {
  min-height: var(--control-min-height);
  color: var(--ink);
  background: var(--fill);
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.2s var(--lg-ease), box-shadow 0.2s var(--lg-ease), transform 0.15s var(--lg-ease);
}
html[data-ui="glass"] .button-primary,
html[data-ui="glass"] .button.button-primary {
  color: #fff;
  background: #007aff;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}
html[data-ui="glass"] .button.button-danger,
html[data-ui="glass"] .button.button-danger:is(:hover, :active:not(:disabled)) {
  color: #fff;
  background: #ff3b30;
  border: 0;
}
html[data-ui="glass"] :is(.button, .filter-trigger, .icon-button):active:not(:disabled) {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  html[data-ui="glass"] .button:hover,
  html[data-ui="glass"] .button-quiet:hover,
  html[data-ui="glass"] .filter-trigger:hover,
  html[data-ui="glass"] .icon-button:hover {
    color: var(--ink);
    background: var(--fill-hover);
  }
  html[data-ui="glass"] .button-primary:hover,
  html[data-ui="glass"] .button.button-primary:hover {
    color: #fff;
    background: #0a84ff;
  }
  html[data-ui="glass"] .topbar .button:hover,
  html[data-ui="glass"] .page-heading .filter-trigger:hover {
    background:
      linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)) padding-box,
      var(--lg-rim) border-box;
    box-shadow: var(--lg-shadow-hover);
  }
}

/* Segmented control: серый трек, белый «бегунок»-капсула (однострочные табы) */
html[data-ui="glass"] .page-tabs,
html[data-ui="glass"] .retail-tabs,
html[data-ui="glass"] .sync-tabs,
html[data-ui="glass"] .admin-subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  background: var(--fill);
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* Пресеты периода — многострочный трек: скругление 12px, не капсула 999px */
html[data-ui="glass"] .filter-period-presets {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 4px;
  background: var(--fill);
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
}
html[data-ui="glass"] .page-tab,
html[data-ui="glass"] .retail-tabs a,
html[data-ui="glass"] .sync-tabs a,
html[data-ui="glass"] .admin-subtabs a {
  padding: 6px 14px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  font-weight: 500;
  text-decoration: none;
}
html[data-ui="glass"] .filter-period-preset {
  padding: 6px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
  text-decoration: none;
}
html[data-ui="glass"] .page-tab.is-active,
html[data-ui="glass"] .retail-tabs a[aria-current="page"],
html[data-ui="glass"] .sync-tabs a[aria-current="page"],
html[data-ui="glass"] .admin-subtabs a[aria-current="page"] {
  color: var(--ink);
  background: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04), 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}
html[data-ui="glass"] .filter-period-preset.is-active,
html[data-ui="glass"] .filter-period-preset:has(input:checked) {
  color: var(--ink);
  background: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.10), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Контент — плотные белые карточки без размытия: читаемость важнее эффекта */
html[data-ui="glass"] .data-section,
html[data-ui="glass"] .filter-panel,
html[data-ui="glass"] .form-panel,
html[data-ui="glass"] .dash-chart-panel,
html[data-ui="glass"] .dash-rank-panel,
html[data-ui="glass"] .pulse-rank-panel,
html[data-ui="glass"] .dash-plan-hero,
html[data-ui="glass"] .pulse-attention,
html[data-ui="glass"] .admin-card,
html[data-ui="glass"] .auth-card,
html[data-ui="glass"] .retail-review-card,
html[data-ui="glass"] .ipr-panel,
html[data-ui="glass"] .retail-progress {
  position: relative;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* Листы фильтров: стекло на chrome, не на fullscreen .filter-dialog */
html[data-ui="glass"] .filter-dialog {
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] .filter-dialog-chrome {
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  border-radius: 26px;
  box-shadow: var(--lg-shadow), 0 30px 80px -24px rgba(15, 30, 60, 0.35);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
}

/* Профиль — крупное стеклянное меню */
html[data-ui="glass"] .profile-menu {
  width: 340px;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid transparent;
  background:
    var(--lg-bg-strong) padding-box,
    var(--lg-rim) border-box;
  box-shadow:
    0 24px 56px -16px rgba(20, 50, 100, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(40, 60, 100, 0.06);
  -webkit-backdrop-filter: blur(56px) saturate(200%);
  backdrop-filter: blur(56px) saturate(200%);
}
html[data-ui="glass"] .pm-card { gap: 14px; }
html[data-ui="glass"] .pm-card .pm-avatar {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  font-size: 20px;
}
html[data-ui="glass"] .pm-name { font-size: 16px; }
html[data-ui="glass"] .pm-job { font-size: 13.5px; }
html[data-ui="glass"] .pm-avatar-actions { gap: 12px; margin-top: 4px; }
html[data-ui="glass"] .pm-link { font-size: 13.5px; }
html[data-ui="glass"] .pm-section {
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}
html[data-ui="glass"] .pm-facts { gap: 10px; }
html[data-ui="glass"] .pm-label { font-size: 12.5px; }
html[data-ui="glass"] .pm-value { font-size: 14.5px; }
html[data-ui="glass"] .pm-field input {
  height: 38px;
  padding: 0 12px;
  font-size: 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-ui="glass"] .pm-themes { gap: 8px; }
html[data-ui="glass"] .pm-theme {
  gap: 6px;
  padding: 8px 4px;
  font-size: 12px;
  border-radius: 14px;
}
html[data-ui="glass"] .pm-theme .ui-theme-swatch { width: 36px; height: 36px; }
html[data-ui="glass"] .pm-theme[aria-checked="true"] {
  color: var(--hop);
  border-color: rgba(0, 122, 255, 0.4);
  background: rgba(0, 122, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
html[data-ui="glass"] .pm-switch { gap: 12px; }
html[data-ui="glass"] .pm-switch-copy strong { font-size: 15px; }
html[data-ui="glass"] .pm-switch-copy small { font-size: 12.5px; line-height: 1.35; }
html[data-ui="glass"] .pm-switch-track {
  width: 42px;
  height: 24px;
}
html[data-ui="glass"] .pm-switch-track::after {
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
}
html[data-ui="glass"] .pm-switch input:checked + .pm-switch-track {
  background: #34c759;
}
html[data-ui="glass"] .pm-switch input:checked + .pm-switch-track::after {
  transform: translateX(18px);
}
html[data-ui="glass"] .pm-logout-form + .pm-logout-form { margin-top: 8px; }
html[data-ui="glass"] .pm-logout {
  height: 42px;
  border-radius: 999px;
  font-size: 15px;
  background:
    var(--lg-bg) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-ui="glass"] .profile-menu .ui-pint-style-option {
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
}
html[data-ui="glass"] .profile-menu .ui-pint-style-preview { width: 44px; height: 44px; }
html[data-ui="glass"] .profile-menu .ui-pint-style-option:has(input:checked) {
  background: rgba(0, 122, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html[data-ui="glass"] .data-section > .section-heading {
  background: transparent;
  border-bottom: 0;
  padding: 18px 18px 6px;
}
html[data-ui="glass"] :is(.data-section, .form-panel, .admin-card, .dash-plan-hero, .ipr-panel, .retail-progress) > :first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
html[data-ui="glass"] :is(.data-section, .form-panel, .admin-card, .dash-plan-hero, .ipr-panel, .retail-progress) > :last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
html[data-ui="glass"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):first-child,
html[data-ui="glass"] :is(.data-section, .admin-card) .admin-table :is(th, td):first-child { padding-left: 18px; }
html[data-ui="glass"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):last-child,
html[data-ui="glass"] :is(.data-section, .admin-card) .admin-table :is(th, td):last-child { padding-right: 18px; }
html[data-ui="glass"] .data-section > .empty-state { padding: 12px 18px 20px; }
html[data-ui="glass"] .admin-main .data-section,
html[data-ui="glass"] .admin-card {
  overflow: hidden;
}
html[data-ui="glass"] .admin-table .table-actions .button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}
html[data-ui="glass"] .table-icon-btn {
  width: 30px;
  height: 30px;
  color: var(--hop);
  background: var(--fill);
  border: 0;
  border-radius: 999px;
}
html[data-ui="glass"] .table-icon-btn:hover {
  color: var(--hop);
  background: var(--fill-hover);
}
html[data-ui="glass"] .retail-task-list,
html[data-ui="glass"] .retail-task-item {
  background: transparent;
}
html[data-ui="glass"] .retail-task-list > li:last-child .retail-task-item,
html[data-ui="glass"] .retail-task-list > li:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
html[data-ui="glass"] dialog.user-drawer,
html[data-ui="glass"] dialog.user-drawer[open] {
  inset: 10px 10px 10px auto;
  width: min(600px, calc(100vw - 20px));
  height: calc(100dvh - 20px);
  max-height: calc(100dvh - 20px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  border-radius: 26px;
  box-shadow: var(--lg-shadow), 0 30px 80px -24px rgba(15, 30, 60, 0.35);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  overflow: hidden;
}
html[data-ui="glass"] dialog.user-drawer .user-dialog-panel,
html[data-ui="glass"] dialog.user-drawer .form-panel.user-dialog-panel {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] dialog.user-drawer .form-actions {
  background: transparent;
  border-top-color: rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] dialog.user-drawer .filter-dialog-header {
  border-bottom-color: rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] :is(input, select, textarea):not(:where([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"])):not(.cell-input, .pf-plan-input, .admin-search *, .partner-task-person-select-wrap *) {
  padding-inline: 14px;
}
html[data-ui="glass"] .dash-plan-hero { border-left: 0; }
html[data-ui="glass"] :is(.dash-plan-fact-block, .dash-plan-pct-block) {
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="glass"] .data-table th,
html[data-ui="glass"] .report-table th {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
html[data-ui="glass"] .data-table td,
html[data-ui="glass"] .report-table td {
  border-color: rgba(60, 60, 67, 0.1);
  color: var(--ink);
  font-size: 14.5px;
}
html[data-ui="glass"] .data-table tbody tr:hover td,
html[data-ui="glass"] .report-table tbody tr:hover td,
html[data-ui="glass"] .admin-table tbody tr:hover td {
  background: #f7f7f9;
}
html[data-ui="glass"] :is(.data-section, .dash-plan-hero, .form-panel) :is(.table-wrap, .report-table-wrap) {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html[data-ui="glass"] .report-summary-strip,
html[data-ui="glass"] .report-stat {
  background: transparent;
  border-color: rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] .report-stat.is-lead {
  background: color-mix(in srgb, var(--hop-wash) 45%, transparent);
}
html[data-ui="glass"] .partner-task-person {
  background: var(--fill);
  border-color: transparent;
  box-shadow: none;
}
html[data-ui="glass"] .partner-task-person.is-editable:hover {
  background: var(--fill-hover);
}
html[data-ui="glass"] .partner-task-person-select-wrap select {
  min-height: 0;
  padding: 0 14px 0 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 13px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] .dash-bar,
html[data-ui="glass"] .dash-rank-fill { fill: #007aff; }
html[data-ui="glass"] .dash-bar.is-highlight { fill: #3b9bff; }
html[data-ui="glass"] .dash-bar-checks { fill: rgba(60, 60, 67, 0.2); }
html[data-ui="glass"] :is(.pulse-empty, .empty-state) {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 14.5px;
}

/* Поля — серая заливка без рамки, как text field в iOS; фокус — синее кольцо */
html[data-ui="glass"] :is(input, select, textarea):not(:where([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"])):not(.cell-input, .pf-plan-input, .partner-task-person-select-wrap *) {
  min-height: 38px;
  padding-inline: 12px;
  color: var(--ink);
  background-color: var(--fill);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  font-size: 14.5px;
}
html[data-ui="glass"] .admin-search input { padding-left: 36px; }
html[data-ui="glass"] :is(input, textarea):not(:where([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"])):focus {
  outline: none;
  background-color: #fff;
  border-color: var(--hop);
  box-shadow: var(--ui-ring);
}
html[data-ui="glass"] :is(select, .admin-select, .field select):not([multiple]):not(.partner-task-person-select-wrap *):not(.cell-input) {
  -webkit-appearance: none;
  appearance: none;
  min-height: 38px;
  padding: 7px 34px 7px 12px;
  color: var(--ink);
  background: var(--fill) var(--ui-chevron) no-repeat right 12px center / 12px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  font-size: 14.5px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] :is(select, .admin-select, .field select):not([multiple]):not(.partner-task-person-select-wrap *):not(.cell-input):focus {
  outline: none;
  border-color: var(--hop);
  box-shadow: var(--ui-ring);
}
html[data-ui="glass"] select option,
html[data-ui="glass"] select optgroup {
  color: var(--ink);
  background: #f5f7fb;
}
html[data-ui="glass"] :is(.cell-input, .pf-plan-input) {
  min-height: 0;
  color: var(--ink);
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  font-size: 13.5px;
}
html[data-ui="glass"] :is(.cell-input, .pf-plan-input):focus {
  outline: none;
  background: #fff;
  border-color: var(--hop);
  box-shadow: var(--ui-ring);
}
html[data-ui="glass"] select.cell-input:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 18px;
  background: var(--fill) var(--ui-chevron) no-repeat right 4px center / 10px 10px;
}
html[data-ui="glass"] .ms-dropdown-toggle,
html[data-ui="glass"] .filter-fold > summary {
  color: var(--ink);
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] .ms-dropdown-panel {
  color: var(--ink);
  background:
    var(--lg-bg-strong) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: var(--lg-shadow);
  -webkit-backdrop-filter: var(--lg-blur);
  backdrop-filter: var(--lg-blur);
}
html[data-ui="glass"] .ms-dropdown-panel li label:hover {
  background: rgba(0, 122, 255, 0.08);
}
html[data-ui="glass"] .filter-fold[open] > summary {
  border-color: var(--hop);
  box-shadow: var(--ui-ring);
}
html[data-ui="glass"] .filter-dialog .filter-fold-panel,
html[data-ui="glass"] .filter-fold-panel {
  background: #fff;
  border-color: rgba(60, 60, 67, 0.12);
  border-radius: 12px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-ui="glass"] :is(input, select, textarea)::placeholder { color: var(--muted-soft); }
html[data-ui="glass"] .alert {
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}
html[data-ui="glass"] .pm-label,
html[data-ui="glass"] .pm-job,
html[data-ui="glass"] .pm-name,
html[data-ui="glass"] .pm-value,
html[data-ui="glass"] .pm-switch-copy { color: var(--ink); }
html[data-ui="glass"] .pm-switch-copy small,
html[data-ui="glass"] .pm-job,
html[data-ui="glass"] .pm-label { color: var(--muted); }

html[data-ui="glass"] span.avatar {
  color: #007aff;
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
html[data-ui="glass"] .admin-table span.avatar,
html[data-ui="glass"] .user-cell span.avatar {
  background: rgba(0, 122, 255, 0.1);
  box-shadow: none;
}
html[data-ui="glass"] .profile.is-open .profile-trigger span.avatar,
html[data-ui="glass"] .profile-trigger:hover span.avatar {
  background: var(--hop-wash);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 4px rgba(0, 122, 255, 0.25);
}
html[data-ui="glass"] .retail-pill,
html[data-ui="glass"] .retail-chip,
html[data-ui="glass"] .count-badge,
html[data-ui="glass"] .status-badge {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.1);
}
html[data-ui="glass"] .count-badge {
  color: #fff;
  background: #007aff;
}
html[data-ui="glass"] :is(.data-table, .report-table) thead th {
  box-shadow: inset 0 -1px 0 rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] .data-table.report-table thead th,
html[data-ui="glass"] .data-table.ipr-table thead th {
  background: #fff;
  box-shadow: inset 0 -1px 0 rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] .kpi-grid.dash-kpi-grid {
  gap: 8px;
  padding: 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
html[data-ui="glass"] .dash-kpi-grid .kpi,
html[data-ui="glass"] .report-stat {
  background: var(--surface-subtle);
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}
html[data-ui="glass"] .filter-overlay {
  background: rgba(0, 0, 0, 0.18);
}
html[data-ui="glass"] .filter-dialog .filter-actions {
  background: transparent;
  border-top-color: rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] .retail-meter.is-light { background: rgba(60, 60, 67, 0.12); }
html[data-ui="glass"] .retail-meter.is-light > span { background: var(--hop); }

/* Glass: плотные белые карточки рычагов, серый muted читается на surface. */
html[data-ui="glass"] .growth-ref-card {
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 1px rgba(60, 60, 67, 0.1), 0 8px 24px -14px rgba(0, 0, 0, 0.18);
}
html[data-ui="glass"] .growth-ref-card h3,
html[data-ui="glass"] .growth-ref-card p,
html[data-ui="glass"] .growth-ref-how {
  color: var(--ink);
}
html[data-ui="glass"] .growth-ref-card b { color: var(--success); }
html[data-ui="glass"] .growth-ref-foot { color: var(--muted); }
/* Glass: живая смена — плотная светлая карточка (не неон-зелёный и не уголь на градиенте). */
html[data-ui="glass"] .retail-hero {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 0.5px solid rgba(60, 60, 67, 0.16);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -16px rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
}
html[data-ui="glass"] .retail-hero-eyebrow,
html[data-ui="glass"] .retail-hero-sub,
html[data-ui="glass"] .retail-hero-money-label,
html[data-ui="glass"] .retail-hero-money small {
  color: var(--muted);
}
html[data-ui="glass"] .retail-timer { color: var(--ink); }
html[data-ui="glass"] .retail-hero-sub strong { color: var(--ink); }
html[data-ui="glass"] .retail-hero-money {
  border-top-color: rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] .retail-hero-money-value { color: var(--hop); }
html[data-ui="glass"] .retail-meter {
  background: rgba(60, 60, 67, 0.12);
}
html[data-ui="glass"] .retail-meter > span { background: var(--hop); }
html[data-ui="glass"] .retail-live-dot {
  background: var(--hop);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--hop) 55%, transparent);
}
html[data-ui="glass"] .retail-hero .button-primary {
  color: #fff;
  background: var(--hop);
  border-color: var(--hop);
}
html[data-ui="glass"] .retail-hero .button-ghost {
  color: var(--ink);
  border-color: rgba(60, 60, 67, 0.22);
  background: rgba(255, 255, 255, 0.55);
}
html[data-ui="glass"] .retail-day-plan.data-section {
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 1px rgba(60, 60, 67, 0.08), 0 8px 24px -16px rgba(0, 0, 0, 0.18);
}
html[data-ui="glass"] .retail-plan-card {
  background: #f5f5f7;
  border: 0;
  box-shadow: none;
}
html[data-ui="glass"] .retail-day-plan .retail-hint { color: var(--muted); }
html[data-ui="glass"] .page-heading h1 { color: var(--ink); }
html[data-ui="glass"] .kitchen-abc-badge.kitchen-abc-a {
  background: rgba(52, 199, 89, 0.16);
  color: #248a3d;
}
html[data-ui="glass"] .kitchen-abc-badge.kitchen-abc-b {
  background: rgba(255, 159, 10, 0.16);
  color: #996100;
}
html[data-ui="glass"] .kitchen-abc-badge.kitchen-abc-c {
  background: rgba(60, 60, 67, 0.08);
  color: var(--muted);
}
html[data-ui="glass"] .ipr-kpi-weekly tbody tr:is(:hover, :focus-within) td:first-child {
  background: #f7f7f9;
}

/* Dark/glass: тот же язык контента, что у light (без боковых полос, hairline-метрики) */
html[data-ui="dark"] .data-section,
html[data-ui="dark"] .filter-panel,
html[data-ui="dark"] .form-panel,
html[data-ui="dark"] .dash-chart-panel,
html[data-ui="dark"] .dash-rank-panel,
html[data-ui="dark"] .pulse-rank-panel,
html[data-ui="dark"] .dash-plan-hero,
html[data-ui="dark"] .pulse-attention,
html[data-ui="dark"] .admin-card,
html[data-ui="dark"] .retail-review-card,
html[data-ui="dark"] .ipr-panel,
html[data-ui="dark"] .pm-card {
  border: 0;
}
html[data-ui="dark"] .dash-plan-title,
html[data-ui="glass"] .dash-plan-title {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
html[data-ui="dark"] .dash-plan-hero-main.pulse-net-grid,
html[data-ui="glass"] .dash-plan-hero-main.pulse-net-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 24px;
}
html[data-ui="dark"] .pulse-net-grid > :first-child,
html[data-ui="glass"] .pulse-net-grid > :first-child {
  grid-column: span 2;
}
html[data-ui="dark"] :is(.dash-plan-fact-block, .dash-plan-pct-block),
html[data-ui="glass"] :is(.dash-plan-fact-block, .dash-plan-pct-block) {
  padding: 14px 0 12px;
  justify-content: flex-start;
}
html[data-ui="dark"] .pulse-net-grid > :first-child .dash-plan-fact-value,
html[data-ui="glass"] .pulse-net-grid > :first-child .dash-plan-fact-value {
  font-size: 2rem;
}
html[data-ui="dark"] .pulse-net-grid :is(.dash-plan-fact-value, .dash-plan-pct-value),
html[data-ui="glass"] .pulse-net-grid :is(.dash-plan-fact-value, .dash-plan-pct-value) {
  font-weight: 650;
}
html[data-ui="dark"] .dash-period-btn-label,
html[data-ui="glass"] .dash-period-btn-label {
  text-transform: none;
  letter-spacing: 0;
}
html[data-ui="dark"] .pulse-rr-pill:not(.is-good, .is-warn, .is-bad),
html[data-ui="glass"] .pulse-rr-pill:not(.is-good, .is-warn, .is-bad) {
  min-width: 0;
  padding-inline: 0;
  background: transparent;
  color: var(--muted);
}
html[data-ui="dark"] :is(.pulse-empty, .empty-state),
html[data-ui="glass"] :is(.pulse-empty, .empty-state) {
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 14px;
}
html[data-ui="dark"] .kpi-grid.dash-kpi-grid,
html[data-ui="glass"] .kpi-grid.dash-kpi-grid {
  gap: 8px;
  padding: 4px;
  background: transparent;
  border: 0;
  overflow: visible;
}
html[data-ui="glass"] .dash-kpi-grid .kpi,
html[data-ui="glass"] .report-stat {
  background: var(--surface-subtle, #f5f5f7);
  border: 0;
  border-radius: 12px;
}

/* Tab bar: Liquid-капсула как у Telegram — frosted pill + soft active blob */
html[data-ui="glass"] .app-dock {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.9),
    0 0 0 0.5px rgba(60, 60, 67, 0.08),
    0 14px 40px -16px rgba(20, 30, 60, 0.35);
  -webkit-backdrop-filter: saturate(220%) blur(40px);
  backdrop-filter: saturate(220%) blur(40px);
}
html[data-ui="glass"] .app-dock a,
html[data-ui="glass"] .app-dock button {
  color: var(--muted);
}
html[data-ui="glass"] .app-dock a[aria-current="page"],
html[data-ui="glass"] .app-dock button.is-current {
  color: var(--hop);
  background: transparent;
}
html[data-ui="glass"] .app-dock .dock-liquid {
  background: rgba(120, 120, 128, 0.16);
}
html[data-ui="dark"] .app-dock {
  background: rgba(44, 44, 46, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.1),
    0 0 0 0.5px rgba(0, 0, 0, 0.35),
    0 14px 40px -14px rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(200%) blur(36px);
  backdrop-filter: saturate(200%) blur(36px);
}
html[data-ui="dark"] .app-dock a,
html[data-ui="dark"] .app-dock button {
  color: var(--muted);
}
html[data-ui="dark"] .app-dock a[aria-current="page"],
html[data-ui="dark"] .app-dock button.is-current {
  color: var(--hop);
  background: transparent;
}
html[data-ui="dark"] .app-dock .dock-liquid {
  background: rgba(255, 255, 255, 0.12);
}
html[data-ui="light"] .app-dock a,
html[data-ui="light"] .app-dock button {
  color: var(--muted);
}
html[data-ui="light"] .phone-coach {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-color: color-mix(in srgb, var(--ink) 8%, transparent);
}
html[data-ui="dark"] .phone-coach {
  background: color-mix(in srgb, #1c1f27 82%, transparent);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.7);
}
html[data-ui="glass"] .phone-coach {
  background: color-mix(in srgb, rgba(255, 255, 255, 0.62) 100%, transparent);
  border-color: rgba(60, 60, 67, 0.14);
}

@media (max-width: 900px) {
  html[data-ui="glass"] .app-column { margin-left: 0; }
  html[data-ui="glass"] .sidebar {
    inset:
      max(8px, env(safe-area-inset-top, 0px))
      auto
      max(8px, env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
    height: auto;
    max-height: none;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateX(calc(-100% - 24px));
  }
  html[data-ui="glass"] .drawer-open .sidebar { transform: none; }

  /* Dark/glass phone: плотность и сегменты как у light */
  html[data-ui="dark"] .dash-plan-hero-main.pulse-net-grid,
  html[data-ui="glass"] .dash-plan-hero-main.pulse-net-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }
  html[data-ui="dark"] .pulse-net-grid > :first-child,
  html[data-ui="glass"] .pulse-net-grid > :first-child {
    grid-column: span 2;
  }
  html[data-ui="dark"] .dash-plan-hero,
  html[data-ui="glass"] .dash-plan-hero {
    gap: 10px;
    padding: 12px 14px;
  }
  html[data-ui="dark"] .dash-plan-title,
  html[data-ui="glass"] .dash-plan-title {
    font-size: 1.05rem;
  }
  html[data-ui="dark"] :is(.dash-plan-fact-block, .dash-plan-pct-block),
  html[data-ui="glass"] :is(.dash-plan-fact-block, .dash-plan-pct-block) {
    padding: 10px 0 8px;
  }
  html[data-ui="dark"] .pulse-net-grid > :first-child .dash-plan-fact-value,
  html[data-ui="glass"] .pulse-net-grid > :first-child .dash-plan-fact-value {
    font-size: 1.45rem;
  }
  html[data-ui="dark"] .data-section > .section-heading,
  html[data-ui="glass"] .data-section > .section-heading {
    padding: 10px 14px 6px;
  }
  html[data-ui="dark"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):first-child,
  html[data-ui="dark"] :is(.data-section, .admin-card) .admin-table :is(th, td):first-child,
  html[data-ui="glass"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):first-child,
  html[data-ui="glass"] :is(.data-section, .admin-card) .admin-table :is(th, td):first-child {
    padding-left: 14px;
  }
  html[data-ui="dark"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):last-child,
  html[data-ui="dark"] :is(.data-section, .admin-card) .admin-table :is(th, td):last-child,
  html[data-ui="glass"] :is(.data-section, .admin-card) > :is(.table-wrap, .report-table-wrap) :is(th, td):last-child,
  html[data-ui="glass"] :is(.data-section, .admin-card) .admin-table :is(th, td):last-child {
    padding-right: 14px;
  }
  html[data-ui="dark"] .data-section > .empty-state,
  html[data-ui="glass"] .data-section > .empty-state {
    padding: 8px 14px 14px;
  }
  html[data-ui="dark"] :is(.page-tabs, .retail-tabs, .sync-tabs, .admin-subtabs),
  html[data-ui="glass"] :is(.page-tabs, .retail-tabs, .sync-tabs, .admin-subtabs) {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html[data-ui="dark"] :is(.page-tabs, .retail-tabs, .sync-tabs, .admin-subtabs)::-webkit-scrollbar,
  html[data-ui="glass"] :is(.page-tabs, .retail-tabs, .sync-tabs, .admin-subtabs)::-webkit-scrollbar {
    display: none;
  }
  html[data-ui="dark"] :is(.page-tab, .retail-tabs a, .sync-tabs a, .admin-subtabs a),
  html[data-ui="glass"] :is(.page-tab, .retail-tabs a, .sync-tabs a, .admin-subtabs a) {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.84rem;
  }
  html[data-ui="dark"] .sync-tabs,
  html[data-ui="glass"] .sync-tabs {
    border-radius: 999px;
    padding: 3px;
  }
  html[data-ui="dark"] .sync-tabs a,
  html[data-ui="glass"] .sync-tabs a {
    border-radius: 999px;
  }
  html[data-ui="glass"] .page-heading .filter-trigger,
  html[data-ui="dark"] .page-heading .filter-trigger,
  html[data-ui="glass"] .dash-period-btn,
  html[data-ui="dark"] .dash-period-btn {
    min-height: 40px;
    border-radius: 999px;
  }
}

@media (max-width: 720px) {
  html[data-ui="glass"] .filter-dialog-chrome,
  html[data-ui="dark"] .filter-dialog-chrome {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 920px);
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  html[data-ui="glass"] .filter-dialog-chrome {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 -12px 40px rgba(15, 30, 60, 0.2);
  }
}

@media (prefers-reduced-transparency: reduce) {
  html[data-ui="glass"] .sidebar,
  html[data-ui="glass"] .profile-menu,
  html[data-ui="glass"] .filter-dialog-chrome,
  html[data-ui="glass"] dialog.user-drawer,
  html[data-ui="glass"] .topbar .button,
  html[data-ui="glass"] .page-heading .filter-trigger {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #f5f5f7;
  }
}

/* =============================================================================
   Phone + dock: safe-area под чёлкой — последний слой (перебивает темы).
   Главная / ИПР / Розница / Маркетинг — один контракт.
   ============================================================================= */
@media (max-width: 900px) {
  html[data-ui] body:has(.app-dock),
  html body:has(.app-dock) {
    --rmkd-safe-top: max(
      env(safe-area-inset-top, 0px),
      47px
    );
  }

  html[data-ui] body:has(.app-dock) .app-shell::before,
  html body:has(.app-dock) .app-shell::before {
    content: "";
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    right: 0;
    height: var(--rmkd-safe-top);
    pointer-events: none;
    background: var(--canvas, var(--bg, #f6f5f2));
  }

  html[data-ui] body:has(.app-dock) #main-content.main-content,
  html body:has(.app-dock) #main-content.main-content {
    padding-top: calc(var(--rmkd-safe-top) + 12px) !important;
  }
}

/* 029: диалог подтверждения и тост — стекло как у filter-dialog, тёмная — своя подложка тоста. */
html[data-ui="glass"] .confirm-dialog {
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) padding-box,
    var(--lg-rim) border-box;
  border: 1px solid transparent;
  border-radius: 26px;
  box-shadow: var(--lg-shadow), 0 30px 80px -24px rgba(15, 30, 60, 0.35);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
}
html[data-ui="dark"] .confirm-dialog {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}
html[data-ui="dark"] .confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
html[data-ui="dark"] .rmkd-toast {
  background: rgba(52, 56, 66, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px -12px rgba(0, 0, 0, 0.7);
}
@media (max-width: 720px) {
  html[data-ui="glass"] .confirm-dialog {
    background: #fff;
    border: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 30, 60, 0.2);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-ui="glass"] .confirm-dialog {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #f5f5f7;
  }
}

