/* ==========================================================================
   Remixly – design system (shared by every page)
   Every colour is a CSS variable: the build maps each one to an admin setting
   (Admin › Appearance: presets + custom pickers). Light is the default theme.
   Palette "Midnight Violet": midnight navy + electric violet + warm amber.
   ========================================================================== */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url("../fonts/onest-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url("../fonts/onest-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url("../fonts/onest-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  /* brand */
  --rx-navy: #0F1535;          /* midnight navy – hero band, dark panels */
  --rx-navy-2: #171E48;
  --rx-navy-3: #232B5E;
  --rx-violet: #7C3AED;        /* electric violet – icons, decoration, large text */
  --rx-violet-2: #8B5CF6;
  --rx-btn: #6D28D9;           /* button fill – white text 7.1:1 (AA) */
  --rx-btn-hover: #5B21B6;     /* hover – white text 8.9:1 */
  --rx-on-btn: #FFFFFF;
  --rx-amber: #F59E0B;         /* warm amber – highlights, selection, badges */
  --rx-amber-btn: #B45309;     /* amber button fill – white text 5.0:1 (AA) */
  --rx-amber-btn-hover: #92400E;
  --rx-amber-soft: #FEF3C7;
  --rx-amber-ink: #92400E;
  --rx-ok: #15803D;
  --rx-ok-soft: #DCFCE7;
  --rx-danger: #DC2626;
  --rx-danger-btn: #C81E1E;
  --rx-danger-soft: #FEE2E2;
  --rx-info: #2563EB;
  --rx-info-soft: #DBEAFE;

  /* surfaces + text (light) */
  --rx-bg: #F6F5FB;
  --rx-bg-2: #EEECF7;
  --rx-surface: #FFFFFF;
  --rx-surface-2: #F9F8FD;
  --rx-surface-3: #F1EFF9;
  --rx-ink: #12142B;
  --rx-ink-2: #474A68;
  --rx-ink-3: #66698A;
  --rx-line: #E4E2F0;
  --rx-line-2: #D3D0E6;
  --rx-link: #6D28D9;
  --rx-tint: #EFE9FE;
  --rx-tint-ink: #5B21B6;
  --rx-code-bg: #11142E;
  --rx-shadow-c: 30, 24, 80;
  --rx-shadow-sm: 0 1px 2px rgba(var(--rx-shadow-c), .06), 0 1px 6px rgba(var(--rx-shadow-c), .05);
  --rx-shadow: 0 2px 6px rgba(var(--rx-shadow-c), .06), 0 10px 28px rgba(var(--rx-shadow-c), .09);
  --rx-shadow-lg: 0 6px 16px rgba(var(--rx-shadow-c), .08), 0 28px 56px rgba(var(--rx-shadow-c), .16);
  --rx-scrim: rgba(10, 12, 31, .55);
  --rx-grid-line: rgba(124, 58, 237, .07);

  /* type + shape */
  --rx-font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rx-display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
  --rx-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --rx-r-xs: 6px;
  --rx-r-sm: 8px;
  --rx-r: 12px;
  --rx-r-lg: 18px;
  --rx-r-xl: 26px;
  --rx-wrap: 1280px;
  --rx-head-h: 68px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --rx-violet: #A78BFA;
  --rx-violet-2: #C4B5FD;
  --rx-amber: #FBBF24;
  --rx-amber-soft: #3A2A0A;
  --rx-amber-ink: #FCD34D;
  --rx-ok: #4ADE80;
  --rx-ok-soft: #0F2E1C;
  --rx-danger: #F87171;
  --rx-danger-soft: #3A1418;
  --rx-info: #60A5FA;
  --rx-info-soft: #13254A;
  --rx-bg: #090B1D;
  --rx-bg-2: #0E1129;
  --rx-surface: #12163A;
  --rx-surface-2: #171C45;
  --rx-surface-3: #1D2350;
  --rx-ink: #EDECFB;
  --rx-ink-2: #B9BADB;
  --rx-ink-3: #9192BA;
  --rx-line: #252B5C;
  --rx-line-2: #323A72;
  --rx-link: #C4B5FD;
  --rx-tint: #261D5A;
  --rx-tint-ink: #D6CBFF;
  --rx-code-bg: #070918;
  --rx-shadow-c: 0, 0, 0;
  --rx-shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --rx-shadow: 0 2px 8px rgba(0,0,0,.35), 0 12px 30px rgba(0,0,0,.35);
  --rx-shadow-lg: 0 8px 24px rgba(0,0,0,.45), 0 30px 60px rgba(0,0,0,.45);
  --rx-scrim: rgba(3, 4, 14, .7);
  --rx-grid-line: rgba(167, 139, 250, .07);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
body { margin: 0; font: 400 15px/1.55 var(--rx-font); color: var(--rx-ink); background: var(--rx-bg); overflow-x: hidden; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--rx-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--rx-display); font-weight: 800; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem); }
h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
h4 { font-size: 1rem; font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--rx-violet); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus { position: fixed !important; left: 12px; top: 12px; width: auto; height: auto; clip: auto; z-index: 999; background: var(--rx-surface); padding: 8px 14px; border-radius: 8px; }
.wrap { width: 100%; max-width: var(--rx-wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }
.ico-fill { fill: currentColor; stroke: none; }
.muted { color: var(--rx-ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--rx-mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--rx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--rx-violet); }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--rx-amber); border-radius: 2px; }
.hl { color: var(--rx-violet); }
.hl-amber { color: var(--rx-amber); }

/* ---------- buttons ---------- */
.btn { --b-bg: var(--rx-surface); --b-ink: var(--rx-ink); --b-line: var(--rx-line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--rx-r-sm);
  border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-ink); font: 600 14px/1 var(--rx-font); white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
.btn:hover { border-color: var(--rx-violet); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { --b-bg: var(--rx-btn); --b-ink: var(--rx-on-btn); --b-line: var(--rx-btn); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 4px 14px rgba(109, 40, 217, .25); }
.btn-primary:hover { --b-bg: var(--rx-btn-hover); --b-line: var(--rx-btn-hover); }
.btn-amber { --b-bg: var(--rx-amber-btn); --b-ink: #fff; --b-line: var(--rx-amber-btn); }
.btn-amber:hover { --b-bg: var(--rx-amber-btn-hover); --b-line: var(--rx-amber-btn-hover); }
.btn-navy { --b-bg: var(--rx-navy); --b-ink: #fff; --b-line: var(--rx-navy); }
:root[data-theme="dark"] .btn-navy { --b-bg: var(--rx-surface-3); --b-line: var(--rx-line-2); }
.btn-danger { --b-bg: var(--rx-danger-btn); --b-ink: #fff; --b-line: var(--rx-danger-btn); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--rx-surface-3); --b-line: transparent; }
.btn-soft { --b-bg: var(--rx-tint); --b-ink: var(--rx-tint-ink); --b-line: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15.5px; border-radius: var(--rx-r); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--rx-r-sm); border: 1px solid transparent; background: transparent; color: var(--rx-ink-2); flex: none; }
.icon-btn:hover { background: var(--rx-surface-3); color: var(--rx-ink); }
.icon-btn[aria-pressed="true"], .icon-btn.is-on { background: var(--rx-tint); color: var(--rx-tint-ink); }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.label, .field > label { font: 600 13px/1.3 var(--rx-font); color: var(--rx-ink); }
.hint { font-size: 12.5px; color: var(--rx-ink-3); }
.input, .select, .textarea { width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--rx-line-2); border-radius: var(--rx-r-sm); background: var(--rx-surface); color: var(--rx-ink); font-size: 14px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--rx-ink-3) 50%), linear-gradient(135deg, var(--rx-ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--rx-violet); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--rx-line-2); border-radius: var(--rx-r-sm); background: var(--rx-surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--rx-violet); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.input-group .input { border: 0; box-shadow: none !important; min-width: 0; flex: 1; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; color: var(--rx-ink-3); background: var(--rx-surface-2); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; min-height: 36px; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--rx-btn); flex: none; }
/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; min-height: 36px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 23px; border-radius: 999px; background: var(--rx-line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--rx-btn); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 3px solid var(--rx-violet); outline-offset: 2px; }
/* segmented */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--rx-surface-3); border: 1px solid var(--rx-line); flex-wrap: wrap; }
.seg button, .seg label { border: 0; background: transparent; min-height: 34px; padding: 0 12px; border-radius: 8px; font: 600 13px/1 var(--rx-font); color: var(--rx-ink-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg button[aria-pressed="true"], .seg .on, .seg input:checked + span { background: var(--rx-surface); color: var(--rx-ink); box-shadow: var(--rx-shadow-sm); }
.seg label { padding: 0; }
.seg label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label span { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 8px; }

/* ---------- cards, badges, tables ---------- */
.card { background: var(--rx-surface); border: 1px solid var(--rx-line); border-radius: var(--rx-r-lg); box-shadow: var(--rx-shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rx-line); flex-wrap: wrap; }
.card-head h3, .card-head h2 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 18px 20px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font: 700 11.5px/1 var(--rx-font); background: var(--rx-surface-3); color: var(--rx-ink-2); white-space: nowrap; }
.badge-violet { background: var(--rx-tint); color: var(--rx-tint-ink); }
.badge-amber { background: var(--rx-amber-soft); color: var(--rx-amber-ink); }
.badge-ok { background: var(--rx-ok-soft); color: var(--rx-ok); }
.badge-danger { background: var(--rx-danger-soft); color: var(--rx-danger); }
.badge-info { background: var(--rx-info-soft); color: var(--rx-info); }
.badge-navy { background: var(--rx-navy); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 700 11.5px/1.2 var(--rx-font); text-transform: uppercase; letter-spacing: .06em; color: var(--rx-ink-3); padding: 10px 14px; border-bottom: 1px solid var(--rx-line); white-space: nowrap; background: var(--rx-surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--rx-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 13px/1 var(--rx-font); color: #fff; flex: none; background: var(--rx-btn); }
.meter { height: 8px; border-radius: 99px; background: var(--rx-surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--rx-btn); }
.meter.amber > i { background: var(--rx-amber); }
.meter.ok > i { background: var(--rx-ok); }
.kbd { font: 600 11.5px/1 var(--rx-mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--rx-line-2); background: var(--rx-surface-2); color: var(--rx-ink-2); }
.divider { height: 1px; background: var(--rx-line); margin: 16px 0; border: 0; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--rx-r); background: var(--rx-tint); color: var(--rx-tint-ink); font-size: 13.5px; }
.note.amber { background: var(--rx-amber-soft); color: var(--rx-amber-ink); }
.note.ok { background: var(--rx-ok-soft); color: var(--rx-ok); }
.note .ico { margin-top: 2px; }

/* ---------- header (public) ---------- */
.hd { position: sticky; top: 0; z-index: 50; background: var(--rx-surface); border-bottom: 1px solid var(--rx-line); }
.hd.scrolled { box-shadow: var(--rx-shadow-sm); }
.hd-in { display: flex; align-items: center; gap: 22px; height: var(--rx-head-h); max-width: 1440px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 21px/1 var(--rx-display); color: var(--rx-ink); letter-spacing: -.03em; text-decoration: none !important; flex: none; }
.logo svg { width: 32px; height: 32px; }
.logo b { color: var(--rx-violet); font-weight: 800; }
.hd-nav { display: flex; align-items: center; gap: 2px; }
.hd-nav > a, .hd-more > button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--rx-ink-2); font: 600 14px/1 var(--rx-font); text-decoration: none; background: none; border: 0; }
.hd-nav > a:hover, .hd-more > button:hover, .hd-nav > a.on { color: var(--rx-ink); background: var(--rx-surface-3); text-decoration: none; }
.hd-more { position: relative; display: none; }
.hd-acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hd-search { display: flex; align-items: center; gap: 8px; height: 38px; width: 230px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--rx-line); background: var(--rx-surface-2); color: var(--rx-ink-3); }
.hd-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13.5px; color: var(--rx-ink); }
.hd-search-btn { display: none; }
.hd-signin { font: 600 14px/1 var(--rx-font); color: var(--rx-ink); padding: 0 10px; height: 38px; display: inline-flex; align-items: center; }
.burger { display: none; }
@media (max-width: 1359px) { .hd-search { display: none; } .hd-search-btn { display: inline-grid; } }
@media (max-width: 1279px) { .hd-in { gap: 14px; } .hd-nav > a, .hd-more > button { padding: 0 9px; font-size: 13.5px; } }
@media (max-width: 1099px) { .hd-more { display: block; } .hd-nav > a.more-item { display: none; } }
@media (max-width: 979px) { .hd-nav { display: none; } .burger { display: inline-grid; } .hd-acts { margin-left: auto; } .hd-signin { display: none; } }
@media (max-width: 640px) { :root { --rx-head-h: 60px; } .hd-in { gap: 8px; } .hd-acts { gap: 2px; } .hd .hd-cta, .hd .lang-btn .lang-name { display: none; } .logo { font-size: 19px; } .logo svg { width: 28px; height: 28px; } }

/* dropdown */
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; padding: 6px; background: var(--rx-surface); border: 1px solid var(--rx-line); border-radius: var(--rx-r); box-shadow: var(--rx-shadow-lg); z-index: 80; display: none; max-height: 70vh; overflow: auto; }
.dd-menu.left { right: auto; left: 0; }
.dd.open > .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: var(--rx-ink); font: 500 14px/1.2 var(--rx-font); text-align: left; text-decoration: none; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--rx-surface-3); text-decoration: none; }
.dd-menu .on { background: var(--rx-tint); color: var(--rx-tint-ink); }
.dd-menu hr { border: 0; height: 1px; background: var(--rx-line); margin: 6px 4px; }
.flag { width: 22px; height: 15px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12); overflow: hidden; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: none; font: 600 13.5px/1 var(--rx-font); color: var(--rx-ink-2); }
.lang-btn:hover { background: var(--rx-surface-3); color: var(--rx-ink); }

/* theme toggle icons */
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }

/* drawer (phone menu) */
.scrim { position: fixed; inset: 0; background: var(--rx-scrim); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: var(--rx-surface); z-index: 95; transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 20px; overflow-y: auto; border-left: 1px solid var(--rx-line); }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-bottom: 8px; }
.drawer nav { display: grid; gap: 2px; margin-bottom: 10px; }
.drawer nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--rx-ink); font-weight: 600; text-decoration: none; }
.drawer nav a:hover, .drawer nav a.on { background: var(--rx-surface-3); }
.drawer nav a .ico { color: var(--rx-violet); }
.drawer .btn { margin-top: 6px; }

/* ---------- footer ---------- */
.ft { background: var(--rx-navy); color: #C9CBEA; margin-top: 0; }
:root[data-theme="dark"] .ft { background: #060816; border-top: 1px solid var(--rx-line); }
.ft a { color: #E3E4F8; }
.ft-top { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 32px; padding: 56px 0 36px; }
.ft .logo { color: #fff; }
.ft .logo b { color: #C4B5FD; }
.ft h4 { color: #fff; font-family: var(--rx-font); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ft ul a { font-size: 14px; display: inline-flex; min-height: 32px; align-items: center; }
.ft-about { font-size: 14px; max-width: 34ch; margin: 14px 0 18px; color: #B3B5D8; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: #fff; }
.socials a:hover { background: var(--rx-btn); border-color: var(--rx-btn); }
.socials .ico { width: 17px; height: 17px; }
.ft-bot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 0 26px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.ft-bot .row { gap: 6px; }
.ft .lang-btn, .ft .icon-btn { color: #E3E4F8; border-color: rgba(255,255,255,.14); }
.ft .lang-btn:hover, .ft .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.ft .dd-menu { bottom: calc(100% + 6px); top: auto; }
@media (max-width: 980px) { .ft-top { grid-template-columns: 1fr 1fr; } .ft-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .ft-top { grid-template-columns: 1fr 1fr; gap: 24px 16px; } }

/* ---------- dialog + toast + install card ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-scrim { position: absolute; inset: 0; background: var(--rx-scrim); }
.modal-box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--rx-surface); border: 1px solid var(--rx-line); border-radius: var(--rx-r-lg); box-shadow: var(--rx-shadow-lg); }
.modal-box.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rx-line); position: sticky; top: 0; background: var(--rx-surface); z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--rx-line); flex-wrap: wrap; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--rx-navy); color: #fff; box-shadow: var(--rx-shadow-lg); font-size: 14px; animation: toastIn .2s ease; pointer-events: auto; }
:root[data-theme="dark"] .toast { background: var(--rx-surface-3); border: 1px solid var(--rx-line-2); }
.toast .ico { color: var(--rx-amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.install-card { position: fixed; left: 16px; bottom: 16px; z-index: 110; width: min(360px, calc(100vw - 32px)); display: none; gap: 12px; padding: 14px; border-radius: var(--rx-r-lg); background: var(--rx-surface); border: 1px solid var(--rx-line); box-shadow: var(--rx-shadow-lg); }
.install-card.show { display: flex; }
.install-card .app-ico { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.install-card h4 { margin: 0 0 2px; }
.install-card p { margin: 0 0 10px; font-size: 13px; color: var(--rx-ink-3); }

/* ---------- app shell (member + admin) ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--rx-surface); border-right: 1px solid var(--rx-line); padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 6px 8px 14px; }
.side-group { font: 700 11px/1 var(--rx-font); letter-spacing: .09em; text-transform: uppercase; color: var(--rx-ink-3); padding: 14px 10px 6px; }
.side a.nav { display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--rx-ink-2); font: 600 14px/1.2 var(--rx-font); text-decoration: none; }
.side a.nav:hover { background: var(--rx-surface-3); color: var(--rx-ink); }
.side a.nav.on { background: var(--rx-tint); color: var(--rx-tint-ink); }
.side a.nav.on .ico { color: var(--rx-violet); }
.side-out { margin: auto 0 0; padding-top: 8px; border-top: 1px solid var(--rx-line); }
.side-plan ~ .side-out, .side-plan ~ .nav ~ .side-out { margin-top: 10px; }
.side-out button.nav { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--rx-ink-2); font: 600 14px/1.2 var(--rx-font); cursor: pointer; text-align: left; }
.side-out button.nav:hover { background: var(--rx-danger-soft); color: var(--rx-danger); }
.side a.nav .count { margin-left: auto; font-size: 11.5px; }
.side-plan { margin-top: auto; padding: 14px; border-radius: var(--rx-r); background: var(--rx-navy); color: #DCDDF5; font-size: 13px; }
:root[data-theme="dark"] .side-plan { background: var(--rx-surface-3); }
.side-plan b { color: #fff; }
.side-plan .meter { background: rgba(255,255,255,.14); margin: 8px 0 10px; }
.side-plan .meter > i { background: var(--rx-amber); }
.top { position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: var(--rx-surface); border-bottom: 1px solid var(--rx-line); }
.top h1 { font-size: 1.15rem; margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .top-acts { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top .hd-search { width: 260px; }
.top .credits { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 999px; background: var(--rx-amber-soft); color: var(--rx-amber-ink); font: 700 13px/1 var(--rx-font); white-space: nowrap; }
.top .top-logo { display: none; }
.main { padding: 24px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.6rem; }
.page-head p { margin: 4px 0 0; color: var(--rx-ink-3); }
.shell .side-close { display: none; }
@media (max-width: 1359px) { .top .hd-search { display: none; } .top .hd-search-btn { display: inline-grid; } }
@media (max-width: 1100px) { .shell { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 979px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 95; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .25s; }
  body.drawer-open .side { transform: none; }
  .shell .side-close { display: inline-grid; position: absolute; right: 10px; top: 12px; }
  .top .burger { display: inline-grid; }
  .top .top-logo { display: inline-flex; }
  .top h1 { display: none; }
}
@media (max-width: 640px) { .top { height: 60px; padding: 0 10px 0 16px; gap: 4px; } .top .top-acts { gap: 0; } .main { padding: 16px; } .top .lang-btn .lang-name, .top .credits .lbl { display: none; } .top .credits { padding: 0 8px; } }
@media (max-width: 640px) { .top .lang-dd, .top [aria-label="Notifications"] { display: none; } }
@media (max-width: 420px) { .top .user-dd { display: none; } }
@media (max-width: 360px) { .top .credits { display: none; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi .k-lbl { display: flex; align-items: center; gap: 8px; font: 600 12.5px/1.2 var(--rx-font); color: var(--rx-ink-3); }
.kpi .k-lbl .ico { width: 16px; height: 16px; color: var(--rx-violet); }
.kpi .k-val { font: 800 26px/1.1 var(--rx-display); margin: 8px 0 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--rx-ink-3); }
.up { color: var(--rx-ok); font-weight: 700; }
.down { color: var(--rx-danger); font-weight: 700; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .kpis { gap: 10px; } .kpi { padding: 14px; } .kpi .k-val { font-size: 22px; } }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rx-line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { flex: none; min-height: 42px; padding: 0 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--rx-ink-3); font: 600 14px/1 var(--rx-font); display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.tabs [aria-selected="true"], .tabs .on { color: var(--rx-ink); border-bottom-color: var(--rx-violet); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rx-line-2); background: var(--rx-surface); color: var(--rx-ink-2); font: 600 13px/1 var(--rx-font); }
.chip[aria-pressed="true"], .chip.on { background: var(--rx-navy); border-color: var(--rx-navy); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"], :root[data-theme="dark"] .chip.on { background: var(--rx-btn); border-color: var(--rx-btn); }

/* simple code highlight colours (code view + docs) */
.tk-tag { color: #F472B6; } .tk-attr { color: #FBBF24; } .tk-str { color: #FDBA74; } .tk-com { color: #7C80A8; font-style: italic; }
.tk-sel { color: #C4B5FD; } .tk-prop { color: #7DD3FC; } .tk-val { color: #FDE68A; } .tk-pun { color: #A5A8D0; }
/* tap targets ≥ 36 px */
.logo { min-height: 40px; }
.ft ul a { min-height: 36px; }
.seg button, .seg label span { min-height: 36px; }
.top .credits { height: 36px; }
/* the hidden attribute always wins over a component's display rule (installer messages, forms, panels) */
[hidden] { display: none !important; }
