/* DataQHub UI – tokens first; dark mode is a selected palette, not an automatic flip. */
:root {
  color-scheme: light;
  --plane: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  /* brand = the logo's blue, darkened so white button text stays readable; logo-ink = the logo's navy */
  --brand: #1f6f9f;
  --brand-ink: #ffffff;
  --brand-soft: #e6f1f8;
  --logo-ink: #1b2559;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --info: #898781;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 4px 16px rgba(11, 11, 11, .04);
  --radius: 14px;
  --seq-100: #cde2fb; --seq-200: #9ec5f4; --seq-300: #6da7ec; --seq-400: #3987e5;
  --seq-500: #256abf; --seq-600: #184f95; --seq-700: #0d366b;
  /* small text on the surface: errors and warnings readable in both themes */
  --err-ink: #b42323; --warn-ink: #7a4f00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #f0efec; --ink-2: #c3c2b7;
    --muted: #898781; --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
    --brand: #5ab0de; --brand-ink: #0b0b0b; --brand-soft: #15303f; --logo-ink: #eef1f8;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --good-ink: #0ca30c;
    --err-ink: #f28b8b; --warn-ink: #f7c75a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #f0efec; --ink-2: #c3c2b7;
  --muted: #898781; --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
  --brand: #5ab0de; --brand-ink: #0b0b0b; --brand-soft: #15303f; --logo-ink: #eef1f8;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --good-ink: #0ca30c;
  --err-ink: #f28b8b; --warn-ink: #f7c75a;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--plane); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[x-cloak] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
}
.brand-logo { display: block; width: 132px; height: auto; margin: 0 8px 18px; flex: none; }
.brand-logo text { font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif; }
.brand-logo .ink { fill: var(--logo-ink); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); cursor: pointer; border: 0; background: none; font: inherit; text-align: start; width: 100%;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-sep { margin: 12px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); }
.main { padding: 22px 28px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.topbar .plan-line { display: none; }  /* the sidebar shows the plan; phones have no sidebar */
.mobile-nav { display: none; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-dash { grid-template-columns: 300px minmax(0, 1fr); }
.g-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- stat tiles & hero ---------- */
.tile { padding: 14px 16px; }
.tile .label { color: var(--ink-2); font-size: 12.5px; }
.tile .value { font-size: 26px; font-weight: 650; margin-top: 2px; }
.tile .sub { color: var(--muted); font-size: 12px; }
.hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.gauge { position: relative; width: 184px; height: 184px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.gauge .big { font-size: 52px; font-weight: 680; line-height: 1; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* severity: shape + label + color, never color alone */
.sev { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; text-transform: capitalize; }
.sev i { width: 10px; height: 10px; display: inline-block; flex: none; }
.sev.critical i { background: var(--critical); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sev.high i { background: var(--serious); transform: rotate(45deg) scale(.85); }
.sev.medium i { background: var(--warning); border-radius: 50%; }
.sev.low i { border: 2px solid var(--info); border-radius: 50%; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th {
  text-align: start; font-weight: 600; font-size: 12px; color: var(--ink-2); padding: 8px 10px;
  border-bottom: 1px solid var(--grid); white-space: nowrap; background: var(--surface);
}
.t td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.clickable { cursor: pointer; }
.t tr.clickable:hover td { background: var(--surface-2); }
.t td.r, .t th.r { text-align: end; }

/* heatmap */
.heat { border-collapse: separate !important; border-spacing: 2px; }
.heat td { border-bottom: 0 !important; padding: 6px 4px; }
.heat td.cell { text-align: center; font-size: 12px; font-weight: 600; border-radius: 4px; min-width: 42px; vertical-align: middle; }
.heat td.empty { color: var(--muted); font-weight: 400; }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch-line { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.ramp { display: inline-flex; border-radius: 4px; overflow: hidden; }
.ramp span { width: 18px; height: 10px; display: inline-block; }

/* ---------- forms ---------- */
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font: inherit; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { min-height: 90px; resize: vertical; }
.field { margin-bottom: 12px; }
.help { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.off { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }  /* feature switched off */
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 11px; flex-wrap: wrap; }
.tab { padding: 6px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; font: inherit; font-weight: 600; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--axis); border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; inset-inline-start: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.checkbox-card {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
}
.checkbox-card.on { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: min(720px, 100%); max-height: 92vh; overflow: auto; padding: 22px; border: 1px solid var(--border); }
.modal.wide { width: min(1000px, 100%); }
.modal:focus { outline: none; }  /* (focused when it opens: the dialog itself, its fields next on Tab) */
.toasts { position: fixed; inset-inline-end: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; max-width: 380px; box-shadow: var(--shadow); font-size: 13px; }
.toast.err { background: var(--critical); color: #fff; }

/* meter */
.meter { height: 8px; background: var(--seq-100); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }

/* ---------- auth ---------- */
.auth { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }  /* (the language switcher sits at its top) */
.auth-hero {
  background: radial-gradient(700px 420px at 110% 110%, rgba(18, 158, 134, .30), transparent 70%),
    radial-gradient(1200px 600px at -10% -10%, #2d4b8c 0%, #1b2559 45%, #0d1230 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero .brand-logo { --logo-ink: #ffffff; width: 190px; margin: 0; }
.auth-hero h1 { font-size: 40px; line-height: 1.1; max-width: 520px; }
.auth-hero p { color: rgba(255, 255, 255, .82); max-width: 520px; font-size: 15px; }
.auth-hero .feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; max-width: 560px; }
.auth-hero .feat div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(440px, 100%); }
/* messages on the sign-in / sign-up forms (e.g. account pending or deactivated) */
.form-alert {
  padding: 10px 12px; margin-bottom: 14px; border-radius: 9px; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 3px solid var(--critical);
}
.form-alert.info { background: var(--brand-soft); border-inline-start-color: var(--brand); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.code-chip { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--ink-2); }
.samples { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.chart-box { position: relative; height: 260px; }

/* ---------- rule library (portal): pack cards, filters, rule list, bulk bar ---------- */
.rl-page, .rl-drawer { accent-color: var(--brand); }
.rl-page .btn:focus-visible, .rl-page .switch input:focus-visible + span, .rl-pack:focus-visible,
.rl-drawer .btn:focus-visible, .rl-drawer .switch input:focus-visible + span, .rl-sevbtn:focus-visible,
.rl-restore:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* one row of pack cards sharing the width (at most 260px each); scrolls sideways when they would get too narrow */
.rl-packs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 260px); gap: 12px;
  overflow-x: auto; padding: 3px 3px 6px; margin: -3px -3px -6px;
}
.rl-pack {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 14px 16px; min-width: 0;
  font: inherit; color: inherit; text-align: start; cursor: pointer;
}
.rl-pack:hover { border-color: var(--axis); }
.rl-pack[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rl-pack-ind { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-pack-name { font-weight: 620; line-height: 1.3; margin-bottom: auto; }
.rl-pack .meter { display: block; margin: 8px 0 2px; }
.rl-ink { color: var(--brand); font-weight: 600; }

.rl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rl-toolbar .rl-search { flex: 1 1 240px; max-width: 360px; }
.rl-toolbar select.input { width: auto; flex: 0 1 auto; max-width: 220px; }
.rl-result { display: flex; align-items: center; gap: 14px; margin: 12px 0 2px; font-size: 12.5px; color: var(--ink-2); }
.rl-selall-m { display: none; align-items: center; gap: 6px; }
.rl-packdesc { margin: 2px 0 6px; }

.rl-bulk {
  position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 8px 0 4px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--brand);
  background: var(--brand-soft); color: var(--ink); box-shadow: var(--shadow);
}
.rl-bulk > b { margin-inline-end: 4px; font-size: 13px; }
.rl-bulk select.input { width: auto; padding: 5px 8px; font-size: 12.5px; font-weight: 600; }
.rl-bulk-clear { margin-inline-start: auto; }

.rl-table { table-layout: fixed; }
.rl-table th.rl-c-sel { width: 38px; }
.rl-table th.rl-c-on { width: 56px; }
.rl-table th.rl-c-target { width: 30%; }
.rl-table th.rl-c-sev { width: 104px; }
.rl-table th.rl-c-max { width: 92px; }
.rl-table th.rl-c-act { width: 76px; }
.rl-table td { vertical-align: top; }
.rl-table .rl-c-sel input, .rl-table th.rl-c-sel input { width: 16px; height: 16px; margin: 3px 0 0; cursor: pointer; }
.rl-table .rl-c-act { text-align: end; }
.rl-table tr.sel td, .rl-table tr.sel.clickable:hover td { background: var(--brand-soft); }
.rl-table tr.off .rl-c-rule, .rl-table tr.off .rl-c-target, .rl-table tr.off .rl-c-sev, .rl-table tr.off .rl-c-max { opacity: .55; }
.rl-name b { font-weight: 620; }
.rl-desc { margin-top: 3px; }
.rl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.rl-chips .chip { font-size: 11.5px; padding: 2px 8px; }
.rl-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 600; vertical-align: 1px; cursor: default;
}
.rl-badge.rl-unsaved { background: var(--surface-2); color: var(--warn-ink); }
.rl-lbl { display: none; }

/* ---------- rule library: the "Edit rule" drawer (a full-screen sheet on phones) ---------- */
.rl-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; justify-content: flex-end; }
.rl-drawer {
  width: min(600px, 100%); height: 100%; display: flex; flex-direction: column; margin: 0;
  background: var(--surface); border-inline-start: 1px solid var(--border); outline: none; animation: rl-in .18s ease-out;
}
@keyframes rl-in { from { transform: translateX(28px); opacity: .5; } }
.rl-dh { display: flex; align-items: flex-start; gap: 12px; padding: 16px 22px 14px; border-bottom: 1px solid var(--grid); }
.rl-d-title { margin-top: 3px; line-height: 1.35; }
.rl-d-title .code-chip { vertical-align: 2px; }
.rl-dh .rl-chips { margin-top: 8px; }
.rl-db { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 22px 16px; }
.rl-banner { margin: 14px 0 0; }
.rl-banner-err { margin: 12px 22px 0; flex: none; }
.rl-sec { padding: 16px 0; border-bottom: 1px solid var(--grid); }
.rl-sec > h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 2px; }
.rl-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.rl-p { margin: 0 0 8px; }
/* a field with an unsaved change gets a bar in the gutter (always reserved, so nothing moves) */
.rl-field { margin: 0 0 14px; margin-inline-start: -14px; padding-inline-start: 11px; border-inline-start: 3px solid transparent; }
.rl-field:last-child { margin-bottom: 0; }
.rl-field.changed { border-inline-start-color: var(--brand); }
.rl-tag { margin-inline-start: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.rl-switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.rl-switch-row > .switch { margin-top: 1px; }
.rl-switch-row > span:not(.switch) { min-width: 0; }
.rl-fs:disabled .rl-switch-row { cursor: default; }
.rl-fs:disabled .input { background: var(--surface-2); color: var(--ink-2); }
.rl-def { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--ink-2); min-width: 0; }
.rl-restore {
  flex: none; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: 13px; line-height: 20px; cursor: pointer;
}
.rl-restore:hover { background: var(--surface-2); color: var(--ink); }
.rl-err { margin-top: 5px; font-size: 12px; color: var(--err-ink); }
.rl-err-ink { color: var(--err-ink); }
.rl-warn { color: var(--warn-ink); }
.rl-drawer .input[aria-invalid="true"] { border-color: var(--critical); }
.rl-sevs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rl-sevbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 12px; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: inherit; text-align: start; cursor: pointer;
}
.rl-sevbtn:hover:not(:disabled) { background: var(--surface-2); }
.rl-sevbtn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rl-sevbtn:disabled { cursor: default; }
.rl-sevbtn:disabled:not([aria-pressed="true"]) { opacity: .6; }
.rl-sevmean { font-size: 11.5px; color: var(--ink-2); }
.rl-tol { display: flex; align-items: center; gap: 14px; }
.rl-tol input[type="range"] { flex: 1; min-width: 0; margin: 0; }
.rl-num { display: flex; align-items: center; gap: 6px; flex: none; }
.rl-num .input { width: 84px; }
.rl-sentence { margin: 8px 0 0; font-size: 13px; }
.rl-last { margin: 14px 0 0; }
.rl-df { padding: 12px 22px; border-top: 1px solid var(--grid); background: var(--surface); }
.rl-df-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body:has(.rl-overlay) .toasts { bottom: 84px; }  /* above the drawer's Save button */
@media (prefers-reduced-motion: reduce) { .rl-drawer { animation: none; } }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-dash, .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; margin: -6px 0 14px; padding-bottom: 4px; }
  .mobile-nav .nav-item { width: auto; white-space: nowrap; }
  .topbar .plan-line { display: block; margin-top: 2px; }
  .main { padding: 16px 16px 40px; }
  .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 28px 16px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero .brand-logo { width: 150px; margin-bottom: 18px; }
  .auth-hero .feat { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .hide-mobile { display: none !important; }
  .topbar .row { flex-wrap: wrap; }
}

/* rule library: the table becomes one card per rule; on phones the drawer is a full-screen sheet */
@media (max-width: 1100px) {
  .rl-table, .rl-table tbody { display: block; }
  .rl-table thead { display: none; }
  .rl-table tr {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center;
    grid-template-areas: "sel on . act" "rule rule rule rule" "target target target target" "sev sev sev max";
    padding: 12px 2px; border-bottom: 1px solid var(--grid);
  }
  .rl-table tr:last-child { border-bottom: 0; }
  .rl-table td { display: block; padding: 0; border: 0 !important; min-width: 0; }
  .rl-table tr.sel { background: var(--brand-soft); border-radius: 10px; }
  .rl-table tr.sel td, .rl-table tr.clickable:hover td { background: none; }
  .rl-table .rl-c-sel { grid-area: sel; margin-inline-end: 12px; }  /* margins, not column-gap: viewers have no checkbox */
  .rl-table .rl-c-on { grid-area: on; }
  .rl-table .rl-c-rule { grid-area: rule; margin-top: 8px; }
  .rl-table .rl-c-target { grid-area: target; margin-top: 8px; }
  .rl-table .rl-c-sev { grid-area: sev; margin-top: 8px; }
  .rl-table .rl-c-max { grid-area: max; margin: 8px 0 0; margin-inline-start: 12px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
  .rl-table .rl-c-act { grid-area: act; margin-inline-start: 12px; }
  .rl-table .rl-c-sel input { margin: 0; display: block; }
  .rl-lbl { display: inline; }
  .rl-selall-m { display: inline-flex; }
}
@media (max-width: 820px) {
  .rl-packs { grid-auto-columns: minmax(200px, 72%); scroll-snap-type: x mandatory; }
  .rl-pack { scroll-snap-align: start; }
  .rl-toolbar .rl-search { flex-basis: 100%; max-width: none; }
  .rl-toolbar select.input { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; }
  .rl-result { flex-wrap: wrap; gap: 6px 14px; }
  .rl-bulk > b { flex: 1 0 calc(100% - 100px); }  /* "n selected … Clear" on the first line, the actions below */
  .rl-bulk-clear { order: -1; }
  .rl-bulk > b { order: -2; }
  .rl-drawer { width: 100%; border-inline-start: 0; animation-name: rl-up; }
  .rl-dh { padding: 12px 16px; }
  .rl-db { padding: 0 16px 16px; }
  .rl-banner-err { margin: 10px 16px 0; }
  .rl-df { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .rl-field { margin-inline-start: -12px; padding-inline-start: 9px; }
  .rl-tol { flex-wrap: wrap; }
  .rl-tol input[type="range"] { flex-basis: 100%; }
  .rl-df-in .rl-reset { order: -1; width: 100%; justify-content: center; }
  .rl-df-in .grow { display: none; }
  .rl-df-in > .btn:not(.rl-reset) { flex: 1; justify-content: center; }
  body:has(.rl-overlay) .toasts { bottom: 128px; left: 16px; right: 16px; }
}
@keyframes rl-up { from { transform: translateY(24px); opacity: .5; } }

/* ---------- rule library: business information in the drawer, "Pending approval" ---------- */
.rl-badge.rl-pending, .ap-status.st-pending {
  background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: var(--warn-ink);
}
.rl-badge.rl-pending::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.rl-bulk-note { margin-inline-end: 4px; }
.rl-about h3 {
  margin-bottom: 3px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.rl-info + .rl-info { margin-top: 14px; }
.rl-about .rl-p { margin: 0; }
.rl-ex { display: flex; align-items: baseline; gap: 6px 10px; margin-top: 6px; }
.rl-ex-l { flex: none; width: 76px; font-size: 12px; font-weight: 650; }
.rl-ex-l i { font-style: normal; }
.rl-ex-l.ok { color: var(--good-ink); }
.rl-ex-l.bad { color: var(--err-ink); }
.rl-ex-v { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.rl-ex-chip {
  padding: 2px 8px; border-radius: 6px; border: 1px solid; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5;
}
.rl-ex-chip.ok { background: color-mix(in srgb, var(--good) 9%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.rl-ex-chip.bad { background: color-mix(in srgb, var(--critical) 8%, var(--surface)); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
.rl-ex-hint { margin-top: 8px; }
.rl-note {
  margin: 14px 0 0; padding: 8px 10px; padding-inline-start: 12px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2);
  border-inline-start: 3px solid var(--warning);
}
.rl-reason textarea.input { min-height: 0; }
.rl-wait { margin-top: 14px; }

/* ---------- business approval: "waiting" banners, the Approvals page, the Team card ---------- */
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-inline-start: auto; padding: 0 6px;
  border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 11.5px; font-weight: 700; line-height: 1;
}
.mobile-nav .nav-badge { margin-inline-start: 6px; }
.ap-wait {
  padding: 12px 14px; border-radius: 10px; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--warning) 50%, transparent); background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}
.card.ap-wait { padding: 14px 16px; }
.ap-wait-h { display: flex; align-items: flex-start; gap: 8px; }
.ap-wait-h::before { content: ""; width: 8px; height: 8px; margin-top: .45em; border-radius: 50%; background: var(--warning); flex: none; }
.ap-wait-list { margin: 6px 0; padding-inline-start: 18px; }
.ap-wait-a { gap: 8px; margin-top: 8px; }
.ap-wait-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0 0; margin-top: 8px; border-top: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); }
.cr-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.cr-fs:disabled .input { background: var(--surface-2); color: var(--ink-2); }

.ap-page { max-width: 1040px; }
.ap-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ap-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; margin-inline-start: 4px; padding: 0 6px;
  border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 700;
}
.ap-card { display: flex; flex-direction: column; gap: 12px; border-inline-start: 3px solid var(--axis); }
.ap-card.st-pending { border-inline-start-color: var(--warning); }
.ap-card.st-approved { border-inline-start-color: var(--good); }
.ap-card.st-rejected, .ap-card.st-failed { border-inline-start-color: var(--critical); }
.ap-h { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.ap-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; background: var(--brand-soft); color: var(--brand); }
.ap-icon svg { width: 19px; height: 19px; fill: currentColor; }
.ap-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.ap-meta .chip { font-size: 11.5px; padding: 2px 8px; }
.ap-status {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 650;
}
.ap-status.st-approved { background: color-mix(in srgb, var(--good) 13%, var(--surface)); color: var(--good-ink); }
.ap-status.st-rejected, .ap-status.st-failed { background: color-mix(in srgb, var(--critical) 11%, var(--surface)); color: var(--err-ink); }
.ap-title { font-size: 15px; line-height: 1.35; margin-bottom: 2px; overflow-wrap: anywhere; }
.ap-link { margin-inline-start: auto; }
.ap-reason {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 9px;
  background: var(--surface-2); border-inline-start: 3px solid var(--brand); overflow-wrap: anywhere;
}
/* the changes: What | Before → After (plain information: What | value), one grid so the columns line up */
.ap-changes {
  display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, max-content) 28px minmax(0, 1fr);
  border: 1px solid var(--grid); border-radius: 10px; overflow: hidden;
}
.ap-changes.info { grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); }
.ap-chg { display: contents; }
.ap-chg > span { padding: 8px 12px; border-top: 1px solid var(--grid); overflow-wrap: anywhere; }
.ap-chg:first-child > span, .ap-changes.info .ap-chg-h + .ap-chg > span { border-top: 0; }  /* (info: no header row) */
.ap-chg > .ap-chg-arrow { padding-inline: 0; }
.ap-chg-h > span { background: var(--surface-2); padding-top: 6px; padding-bottom: 6px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ap-chg-l { color: var(--ink-2); font-size: 13px; }
.ap-chg-from { color: var(--ink-2); }
.ap-chg-arrow { color: var(--muted); text-align: center; }
.ap-info-row .ap-chg-arrow { color: transparent; }  /* (keeps the row line) */
.ap-chg-to { font-weight: 620; }
.ap-decided { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere; }
.ap-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.ap-decide { flex: 1 1 100%; }
.ap-decide textarea.input { min-height: 0; }
.ap-decide .input[aria-invalid="true"] { border-color: var(--critical); }
.ap-btns { gap: 8px; margin-top: 10px; }
.ap-more { display: flex; justify-content: center; }
.ap-hist { list-style: none; margin: 0; padding: 0; }
.ap-hist li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--grid); }
.ap-hist li:first-of-type { border-top: 0; }  /* (the x-for template comes first) */
.ap-hist .grow { display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.ap-page .btn:focus-visible, .ap-page .tab:focus-visible, .ap-wait .btn:focus-visible, .tm-appr .switch input:focus-visible + span,
.nav-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.tm-appr .card-h { flex-wrap: wrap; align-items: flex-start; }
.tm-appr .card-h > .chip { flex: none; white-space: nowrap; }
.tm-appr-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-appr-s { padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; }
.tm-appr-h { display: block; margin-top: 2px; }
.tm-appr-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.tm-table .switch { margin-top: 4px; }
@media (max-width: 820px) {
  .tm-appr-g { grid-template-columns: minmax(0, 1fr); }
  /* team: one card per user (name and action, e-mail, then the settings side by side) */
  .tm-table, .tm-table tbody { display: block; }
  .tm-table thead { display: none; }
  .tm-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px 0;
    grid-template-areas: "name act" "mail mail" "role appr" "status since"; border-bottom: 1px solid var(--grid);
  }
  .tm-table tr:last-child { border-bottom: 0; }
  .tm-table td { display: block; padding: 0; border: 0 !important; min-width: 0; overflow-wrap: anywhere; }
  .tm-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 11.5px; color: var(--muted); }
  .tm-name { grid-area: name; font-weight: 620; align-self: center; }
  .tm-mail { grid-area: mail; color: var(--ink-2); margin-top: -6px; }
  .tm-role { grid-area: role; } .tm-appr-c { grid-area: appr; } .tm-status { grid-area: status; } .tm-since { grid-area: since; }
  .tm-act { grid-area: act; justify-self: end; }
  .tm-table .switch { margin-top: 2px; }
  /* custom rules: one card per rule (switch and actions, the rule, its check, data source and target) */
  .cr-table, .cr-table tbody { display: block; }
  .cr-table thead { display: none; }
  .cr-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 0;
    grid-template-areas: "on act" "rule rule" "check sev" "src src" "target target"; border-bottom: 1px solid var(--grid);
  }
  .cr-table tr:last-child { border-bottom: 0; }
  .cr-table td { display: block; padding: 0; border: 0 !important; min-width: 0; max-width: none !important; }
  .cr-on { grid-area: on; } .cr-rule { grid-area: rule; } .cr-check { grid-area: check; } .cr-sev { grid-area: sev; }
  .cr-src { grid-area: src; color: var(--ink-2); } .cr-target { grid-area: target; } .cr-act { grid-area: act; }
  .ap-card { padding: 14px; }
  /* one small block per change: the label above "before → after" */
  .ap-changes, .ap-changes.info { display: block; }
  .ap-chg-h { display: none !important; }
  .ap-chg { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); gap: 2px 8px; padding: 8px 10px; border-top: 1px solid var(--grid); }
  .ap-chg:first-child, .ap-chg-h + .ap-chg { border-top: 0; }
  .ap-changes.info .ap-chg, .ap-chg.ap-info-row { grid-template-columns: minmax(0, 1fr); }
  .ap-info-row .ap-chg-from, .ap-info-row .ap-chg-arrow { display: none; }
  .ap-chg > span { padding: 0; border: 0; }
  .ap-chg-l { grid-column: 1 / -1; font-size: 12px; }
  .ap-h > .grow { flex: 1 1 calc(100% - 50px); }  /* the title gets the width, the link goes below it */
  .ap-link { margin-inline-start: 50px; }
  .ap-btns > .btn { flex: 1; justify-content: center; }
  .rl-ex { flex-direction: column; gap: 4px; }
}

/* ---------- dashboard (portal): hero, key figures, data source cards, insight cards ----------
   Tokens for the page only. Categorical slots 4-8 complete the validated palette (slots 1-3 are global);
   the heatmap ramp is one hue whose step nearest the surface means "no issues", so it flips in dark mode. */
.dash {
  --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #3987e5; --heat-5: #256abf; --heat-6: #184f95; --heat-7: #0d366b;
  --heat-1-ink: #0b0b0b; --heat-2-ink: #0b0b0b; --heat-3-ink: #0b0b0b; --heat-4-ink: #ffffff; --heat-5-ink: #ffffff;
  --heat-6-ink: #ffffff; --heat-7-ink: #ffffff;
  --dash-track: #cde2fb;  /* a bar's unfilled track: a light step of the bar's own ramp */
  --dash-before: #9ec5f4;  /* dumbbells: the earlier value, a lighter shade of the same hue */
  --dash-deemph: #b4b2a9;  /* sparklines in the stat tiles */
  --dash-glow: rgba(42, 120, 214, .10); --dash-glow-2: rgba(18, 158, 134, .08);
  --dash-good-bg: rgba(12, 163, 12, .12); --dash-bad-bg: rgba(208, 59, 59, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dash {
    --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --heat-1: #0d366b; --heat-2: #184f95; --heat-3: #256abf; --heat-4: #3987e5; --heat-5: #6da7ec; --heat-6: #9ec5f4; --heat-7: #cde2fb;
    --heat-1-ink: #ffffff; --heat-2-ink: #ffffff; --heat-3-ink: #ffffff; --heat-4-ink: #ffffff; --heat-5-ink: #0b0b0b;
    --heat-6-ink: #0b0b0b; --heat-7-ink: #0b0b0b;
    --dash-track: #0d366b; --dash-before: #184f95; --dash-deemph: #5d5c58;
    --dash-glow: rgba(90, 176, 222, .10); --dash-glow-2: rgba(18, 158, 134, .09);
    --dash-good-bg: rgba(12, 163, 12, .16); --dash-bad-bg: rgba(242, 139, 139, .14);
  }
}
:root[data-theme="dark"] .dash {
  --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --heat-1: #0d366b; --heat-2: #184f95; --heat-3: #256abf; --heat-4: #3987e5; --heat-5: #6da7ec; --heat-6: #9ec5f4; --heat-7: #cde2fb;
  --heat-1-ink: #ffffff; --heat-2-ink: #ffffff; --heat-3-ink: #ffffff; --heat-4-ink: #ffffff; --heat-5-ink: #0b0b0b;
  --heat-6-ink: #0b0b0b; --heat-7-ink: #0b0b0b;
  --dash-track: #0d366b; --dash-before: #184f95; --dash-deemph: #5d5c58;
  --dash-glow: rgba(90, 176, 222, .10); --dash-glow-2: rgba(18, 158, 134, .09);
  --dash-good-bg: rgba(12, 163, 12, .16); --dash-bad-bg: rgba(242, 139, 139, .14);
}
.dash-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dash .btn:focus-visible, .dash-action:focus-visible, .dash-approve:focus-visible, .dash select:focus-visible,
.dash .clickable:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.dash-body, .dash-approve { transition: opacity .2s; }
.dash.is-loading .dash-body, .dash.is-loading .dash-approve { opacity: .55; }  /* a reload keeps the frame */
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dash-filters select.input { width: auto; min-width: 220px; max-width: 100%; }
.dash-ico { width: 14px; height: 14px; fill: currentColor; flex: none; }
.dash-sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dash-none { padding: 6px 0; }
.dash-warn { color: var(--warn-ink); font-weight: 600; }

/* "Waiting for approval" tile */
.dash-approve {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--ink);
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
  background: linear-gradient(90deg, var(--brand-soft), var(--surface) 75%);
}
.dash-approve:hover { border-color: var(--brand); }
.dash-approve-i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand); color: var(--brand-ink); }
.dash-approve-i svg { width: 20px; height: 20px; fill: currentColor; }
.dash-approve-n { font-size: 30px; font-weight: 680; line-height: 1; }
.dash-approve-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dash-approve-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-approve-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* hero: the score ring, headline, change chips, score sparkline and quick actions */
.dash-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(240px, 300px); gap: 28px; align-items: center;
  padding: 26px 28px;
  background: radial-gradient(640px 320px at 0% 0%, var(--dash-glow), transparent 70%),
    radial-gradient(520px 280px at 100% 100%, var(--dash-glow-2), transparent 70%), var(--surface);
}
.dash-hero.no-actions { grid-template-columns: auto minmax(0, 1fr); }  /* e.g. a viewer without scans */
.dash-ring { position: relative; width: 184px; height: 184px; flex: none; }
.dash-ring svg, .dash-welcome-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.dash-ring-track { fill: none; stroke: color-mix(in srgb, var(--ring, var(--muted)) 16%, var(--surface)); stroke-width: 10; }
.dash-ring-fill {
  fill: none; stroke: var(--ring); stroke-width: 10; stroke-linecap: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ring) 40%, transparent));
}
.dash-ring-c { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.dash-big { font-size: 52px; font-weight: 680; line-height: 1; letter-spacing: -0.02em; }
.dash-hero-main { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.dash-hero-h { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dash-hero-spark { width: 100%; max-width: 540px; margin-top: 4px; }
.dash-spark-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.dash-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dash-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink);
  font: inherit; text-align: start; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.dash-action:hover:not(:disabled) { border-color: var(--axis); box-shadow: var(--shadow); transform: translateY(-1px); }
.dash-action svg { width: 18px; height: 18px; fill: var(--brand); flex: none; }
.dash-action > span { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.dash-action .small { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-action.primary { background: var(--brand); border-color: transparent; color: var(--brand-ink); }
.dash-action.primary svg { fill: currentColor; }
.dash-action.primary .small { color: inherit; opacity: .85; }
.dash-action:disabled { opacity: .6; cursor: not-allowed; }
/* an odd number of actions (e.g. an analyst's three): the first one takes the whole row */
.dash-action:first-of-type:nth-last-of-type(odd) { grid-column: 1 / -1; }

/* change chips: arrow + signed value + color (good / bad news), never color alone */
.dash-delta {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.dash-delta i { font-style: normal; font-size: 9px; }
.dash-delta b { font-weight: 650; }
.dash-delta span { font-weight: 500; }
.dash-delta.good { background: var(--dash-good-bg); color: var(--good-ink); }
.dash-delta.bad { background: var(--dash-bad-bg); color: var(--err-ink); }
.dash-delta.lg { padding: 3px 10px; font-size: 12.5px; }
.dash-delta.sm { padding: 1px 7px; font-size: 11.5px; }
.dash-delta.flat { background: none; color: var(--muted); font-weight: 500; }

/* sparklines: a 100 × 100 SVG stretched by CSS (2px non-scaling line), the last point as an 8px dot */
.dash-spark { position: relative; height: 34px; margin-top: 10px; cursor: crosshair; }
.dash-spark.lg { height: 56px; margin-top: 0; }
.dash-spark.sm { width: 96px; height: 40px; margin: 0; flex: none; }
.dash-spark svg { display: block; width: 100%; height: 100%; overflow: visible; animation: dash-wipe 1s ease-out .1s both; }
.dash-spark path { vector-effect: non-scaling-stroke; }
.dash-spark .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dash-spark .line.muted { stroke: var(--dash-deemph); }
.dash-spark .area { fill: url(#dashFade); }
.dash-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dash-spark-dot, .dash-spark-hover {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none;
  background: var(--series-1); box-shadow: 0 0 0 2px var(--surface);
}
.dash-spark-hover { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--ink); }

/* key figures */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dash-kpi { padding: 14px 16px 12px; }
.dash-kpi .label { color: var(--ink-2); font-size: 12.5px; }
.dash-kpi-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; }
.dash-kpi .value { font-size: 26px; font-weight: 650; }
.dash-kpi .sub { color: var(--muted); font-size: 12px; }

/* data source cards */
.dash-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dash-src { display: flex; flex-direction: column; gap: 12px; }
.dash-src-h { display: flex; align-items: center; gap: 8px; }
.dash-src-h h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }  /* the source's line in the score trend */
.dash-src-b { display: flex; align-items: center; gap: 14px; }
.dash-mini { position: relative; display: grid; place-items: center; width: 64px; height: 64px; flex: none; }
.dash-mini svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-mini .dash-ring-track, .dash-mini .dash-ring-fill { stroke-width: 6; }
.dash-mini .dash-ring-fill { filter: none; animation: dash-ring 1.1s cubic-bezier(.2, .7, .2, 1) .15s both; }
.dash-mini b { font-size: 19px; font-weight: 680; }
.dash-src-s { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.dash-src-f { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.dash-src-f .sev { font-size: inherit; text-transform: none; }
.dash-src-m { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding-top: 10px; border-top: 1px solid var(--grid); }
.dash-src-m dt { font-size: 11.5px; }
.dash-src-m dd { margin: 1px 0 0; color: var(--ink); font-weight: 600; }
.dash-src-a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.dash-running .dot { background: var(--series-1); animation: dash-pulse 1.2s ease-in-out infinite; }
/* a card's sparkline in its data source's colour (--spark), like its line in the score trend */
.dash-src .dash-spark .line { stroke: var(--spark, var(--series-1)); }
.dash-src .dash-spark .area { fill: var(--spark, var(--series-1)); fill-opacity: .1; }
.dash-src .dash-spark-dot { background: var(--spark, var(--series-1)); }

.dash-row-a { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.dash-row-b { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-row-c { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* failed checks by severity: a thin segmented bar (status colors, 2px gaps) over the list that names the parts */
.dash-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.dash-total b { font-size: 30px; font-weight: 650; line-height: 1; }
.dash-segbar { display: flex; gap: 2px; height: 8px; margin-bottom: 8px; border-radius: 99px; overflow: hidden; }
.dash-segbar > span { flex-basis: 0; min-width: 3px; }
.dash-segbar > span:hover { filter: brightness(1.12); }
.dash-segbar .seg-critical { background: var(--critical); }
.dash-segbar .seg-high { background: var(--serious); }
.dash-segbar .seg-medium { background: var(--warning); }
.dash-segbar .seg-low { background: var(--info); }
.dash-sevs { list-style: none; margin: 0; padding: 0; }
.dash-sevs li { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto 62px; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--grid); }
.dash-sevs li:first-child { border-top: 0; }
.dash-sev-m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-sev-n { font-size: 18px; font-weight: 650; text-align: end; }
.dash-sevs .dash-delta { justify-self: end; }

/* quality dimensions: bars on a light track (one hue), score at the end, change chip */
.dash-row-b > .card { display: flex; flex-direction: column; }
.dash-dims { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; flex-direction: column; justify-content: space-around; gap: 12px; }
.dash-dims li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 30px 58px; align-items: center; gap: 12px; }
.dash-dim-l { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dash-dim-l b { font-size: 13px; font-weight: 600; }
.dash-bar { position: relative; height: 12px; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--dash-track); }
.dash-bar > span {
  display: block; height: 100%; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--series-1); transform-origin: left;
  animation: dash-grow .9s cubic-bezier(.2, .7, .2, 1) both; transition: width .5s;
}
.dash-bar:hover > span { filter: brightness(1.12); }
.dash-dim-v { text-align: end; font-size: 14px; }
.dash-dims .dash-delta { justify-self: start; }

/* table heatmap */
.dash .card-h { flex-wrap: wrap; }
.dash-heat-legend { flex-wrap: nowrap; gap: 8px; }
.dash-ramp { display: inline-flex; gap: 2px; }
.dash-ramp span { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.dash-heat thead th.c { text-align: center; padding: 8px 2px; }
.dash-heat tbody th {
  position: sticky; inset-inline-start: 0; z-index: 1; min-width: 124px; padding: 6px 0; padding-inline-end: 8px; border-bottom: 0;
  text-align: start; font-size: 12px; font-weight: 400; color: var(--ink); white-space: nowrap; background: var(--surface);
}
.dash-heat td.cell { height: 34px; border-radius: 6px; }
.dash-heat td.cell:not(.empty):hover { box-shadow: inset 0 0 0 2px var(--ink); }
.dash-heat td.dash-heat-s { padding-inline-start: 10px; vertical-align: middle; font-size: 12.5px; font-weight: 650; }
.dash-more { align-self: flex-start; margin-top: 10px; }

/* biggest movers: dumbbells (before -> now, one hue in two shades) on one shared scale */
.dash-movers + .dash-movers { margin-top: 12px; }
.dash-legend { margin-top: 6px; }
.dash-sub { margin-bottom: 2px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dash-mover { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, 110px) 58px; align-items: center; gap: 12px; padding: 7px 6px; margin: 0 -6px; border-radius: 9px; }
.dash-mover-l { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.dash-mover-l > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bell { position: relative; height: 18px; }
.dash-bell::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid); }
.dash-bell .bar { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--dash-before); }
.dash-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.dash-dot.prev { background: var(--dash-before); }
.dash-dot.now { background: var(--series-1); }
.dash-bell .dash-dot { position: absolute; top: 50%; margin: -5px 0 0 -5px; }
.dash-mover .dash-delta { justify-self: end; }

/* top failing rules and recent activity */
.dash-list, .dash-feed { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; margin: 0 -6px; border-radius: 9px; }
.dash-list .grow, .dash-feed .grow { display: flex; flex-direction: column; min-width: 0; }
.dash-list-t { font-weight: 600; line-height: 1.3; }
.dash-list .grow .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list-n { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.2; }
.dash-list-n b { font-size: 15px; }
.dash-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--grid); }
.dash-feed li { position: relative; display: flex; gap: 12px; padding: 8px 6px; margin: 0 -6px; border-radius: 9px; }
.dash-feed li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 21px; top: 42px; bottom: -6px; width: 1px; background: var(--grid); }
.dash-feed-i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--surface-2); color: var(--ink-2); }
.dash-feed-i svg { width: 15px; height: 15px; fill: currentColor; }
.dash-feed-i.k-scan, .dash-feed-i.k-approval { background: var(--brand-soft); color: var(--brand); }
.dash-feed-i.k-scan_failed { background: var(--dash-bad-bg); color: var(--err-ink); }
.dash-feed .grow { gap: 1px; }
.dash-feed-t { font-weight: 550; line-height: 1.35; }
.dash-feed-d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-mover.clickable, .dash-list li.clickable, .dash-feed li.clickable { cursor: pointer; }
.dash-mover.clickable:hover, .dash-list li.clickable:hover, .dash-feed li.clickable:hover { background: var(--surface-2); }

/* the dashboard's one tooltip: value first, label second */
.dash-tip {
  position: fixed; z-index: 70; display: flex; flex-direction: column; gap: 1px; max-width: 280px; padding: 7px 10px;
  border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18); pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
}
.dash-tip b { font-size: 13.5px; font-weight: 650; }
.dash-tip span { overflow: hidden; text-overflow: ellipsis; opacity: .8; }

/* a new workspace: three steps to the first score */
.dash-welcome {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 32px; align-items: center; padding: 30px 32px;
  background: radial-gradient(640px 320px at 0% 0%, var(--dash-glow), transparent 70%), var(--surface);
}
.dash-welcome-ring { position: relative; width: 150px; height: 150px; --ring: var(--brand); }
.dash-welcome-arc {
  fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 64 263;
  transform-origin: 60px 60px; animation: dash-spin 6s linear infinite;
}
.dash-welcome-ring > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; font-weight: 680; color: var(--muted); }
.dash-welcome-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dash-welcome-main p { margin: 0; }
.dash-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 12px 0 4px; padding: 0; }
.dash-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.dash-steps li.done { background: var(--surface-2); }
.dash-step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.dash-steps li.done .dash-step-n { background: var(--good); color: #fff; }
.dash-step-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* subtle motion, once: cards rise in, bars grow, rings fill, sparklines draw from the left */
@keyframes dash-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes dash-grow { from { transform: scaleX(0); } }
@keyframes dash-ring { from { stroke-dashoffset: var(--c); } }
@keyframes dash-wipe { from { clip-path: inset(-12px 100% -12px -12px); } to { clip-path: inset(-12px -12px -12px -12px); } }
@keyframes dash-pulse { 50% { opacity: .3; } }
@keyframes dash-spin { to { transform: rotate(360deg); } }
.dash-body > *, .dash-welcome, .dash-approve, .dash-kpi, .dash-src { animation: dash-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.dash-body > :nth-child(2), .dash-kpi:nth-child(2), .dash-src:nth-child(2) { animation-delay: .05s; }
.dash-body > :nth-child(3), .dash-kpi:nth-child(3), .dash-src:nth-child(3) { animation-delay: .1s; }
.dash-body > :nth-child(4), .dash-kpi:nth-child(4), .dash-src:nth-child(4) { animation-delay: .15s; }
.dash-body > :nth-child(n+5), .dash-src:nth-child(n+5) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  .dash *, .dash *::before, .dash *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1280px) {
  .dash-hero { grid-template-columns: auto minmax(0, 1fr); }
  .dash-actions { grid-column: 1 / -1; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }  /* one row */
  .dash-action:first-of-type:nth-last-of-type(odd) { grid-column: auto; }
  .dash-row-c { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-row-c > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .dash-row-a, .dash-row-b { grid-template-columns: minmax(0, 1fr); }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .dash-filters select.input { flex: 1; min-width: 0; }
  .dash-hero, .dash-hero.no-actions { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; padding: 20px 16px; text-align: center; }
  .dash-hero-main { align-items: center; width: 100%; }
  .dash-chips { justify-content: center; }
  .dash-ring { width: 164px; height: 164px; }
  .dash-big { font-size: 46px; }
  .dash-hero-h { font-size: 21px; }
  .dash-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; width: 100%; }
  .dash-action:first-of-type:nth-last-of-type(odd) { grid-column: 1 / -1; }
  .dash-mover { grid-template-columns: minmax(0, 1fr) 72px 58px; }
  .dash-kpis { gap: 10px; }
  .dash-kpi { padding: 12px; }
  .dash-kpi .value { font-size: 22px; }
  .dash-sources, .dash-row-c { grid-template-columns: minmax(0, 1fr); }
  .dash-row-c > :last-child { grid-column: auto; }
  .dash-sev-m { display: none; }
  .dash-sevs li { grid-template-columns: minmax(0, 1fr) auto 62px; }
  .dash-dims li { grid-template-columns: minmax(0, 1fr) 30px 58px; grid-template-areas: "l v d" "bar bar bar"; row-gap: 6px; }
  .dash-dim-l { grid-area: l; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
  .dash-bar { grid-area: bar; }
  .dash-dim-v { grid-area: v; }
  .dash-dims .dash-delta { grid-area: d; }
  .dash-approve { flex-wrap: wrap; gap: 10px 12px; padding: 14px; }
  .dash-approve > .btn { margin-inline-start: auto; }
  .dash-approve-t { flex-basis: 100%; order: 1; }  /* icon, count and Review on the first line */
  .dash-approve-line { white-space: normal; }
  .dash-welcome { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; padding: 22px 16px; }
  .dash-welcome-main { align-items: center; text-align: center; }
  .dash-steps li { flex-wrap: wrap; text-align: start; }
  .dash-step-t { flex-basis: calc(100% - 42px); }
  .dash-steps li .btn { margin-inline-start: 42px; }
}

/* ---------- languages: the switcher, Arabic text, right to left ----------
   English | العربية in the top bar and on the sign-in screens: a segmented control the size of a small button (.btn.sm),
   each language named in its own script; phones show "EN | ع". */
.lang-switch {
  display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2);
}
.lang-switch button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 3px 9px;
  border: 0; border-radius: 7px; background: none; color: var(--ink-2); cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.lang-switch button[lang="en"] { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.lang-switch button[lang="ar"] { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif; }
.lang-switch button:hover { background: var(--surface); color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); cursor: default; }
.lang-switch button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.lang-switch .short { display: none; }
@media (max-width: 820px) {
  .lang-switch .full { display: none; }
  .lang-switch .short { display: inline; }
  .lang-switch button { min-width: 34px; }
  /* sign-in (portal): the switcher sits on the dark picture at the top */
  .auth > .auth-lang .lang-switch { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); }
  .auth > .auth-lang .lang-switch button { color: rgba(255, 255, 255, .85); }
  .auth > .auth-lang .lang-switch button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
  .auth > .auth-lang .lang-switch button[aria-pressed="true"] { background: #fff; color: #1b2559; }
  .auth > .auth-lang .lang-switch button:focus-visible { outline-color: #fff; }
}

/* Arabic text: its own typeface, a little more line height (taller letters), no letter-spacing and no capitals (they
   break the joined letters or do nothing); small labels one step larger, as they are not in capitals */
html[lang="ar"] body { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif; line-height: 1.6; }
html[lang="ar"] :is(h1, h2, h3, .dash-hero-h) { letter-spacing: 0; }
html[lang="ar"] :is(.nav-sep, .rl-tag, .rl-about h3, .ap-chg-h > span, .dash-sub, .sev) {
  letter-spacing: 0; text-transform: none;
}
html[lang="ar"] :is(.nav-sep, .rl-about h3, .ap-chg-h > span, .dash-sub) { font-size: 12px; }
html[lang="ar"] .rl-tag { font-size: 11.5px; }
html[lang="ar"] .auth-hero h1 { line-height: 1.35; }
html[lang="ar"] :is(.rl-pack-name, .rl-d-title, .ap-title, .dash-hero-h, .dash-list-t, .dash-feed-t, .dash-mover-l) { line-height: 1.5; }
html[lang="ar"] :is(.dash-dim-l, .dash-list-n) { line-height: 1.45; }
/* code-like text in Arabic pages may hold Arabic words ("(فارغ)", server messages, data): Arabic letters from an
   Arabic font, not from a monospace font without joined forms (e.g. DejaVu Sans Mono on Linux) */
html[lang="ar"] :is(.mono, .code-chip, .rl-ex-chip, .col-letter) {
  /* (Segoe UI, Tahoma, DejaVu Sans: Arabic letters when the web font cannot load, before the generic monospace) */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma,
    'DejaVu Sans', monospace;
}
/* the audit trail's action: words in Arabic (a code in English), on one line */
html[lang="ar"] .code-chip.audit-act { font-family: inherit; direction: rtl; white-space: nowrap; }

/* data inside right-to-left text: codes, patterns, e-mail addresses and values stay left to right (isolated), and
   blocks of it (dir="ltr" / dir="auto", e.g. a table name) line up with the text around them; text areas of code keep
   their own alignment */
[dir="rtl"] :is(.mono, .code-chip, .rl-ex-chip, .col-letter, code, kbd, samp, pre):not([dir]) { direction: ltr; unicode-bidi: isolate; }
:where([dir="rtl"]) :where([dir="auto"], [dir="ltr"], .mono, .code-chip):not(textarea) {
  text-align: -webkit-match-parent; text-align: match-parent;  /* (Chromium and Safari know only the prefixed one) */
}
/* an e-mail address in a line of right-to-left text stays in one piece: wrapped, its halves would land at the two
   ends of consecutive lines */
[dir="rtl"] .modal bdi.muted { white-space: nowrap; }
/* a rule code in a table cell stays in one piece ("ERP-" / "001" on two lines in a narrow column otherwise) */
[dir="rtl"] .t bdi.code-chip { white-space: nowrap; }

/* right to left: what the logical properties above do not cover */
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-16px); }  /* the knob moves to the left */
[dir="rtl"] .rl-restore { transform: scaleX(-1); }  /* ↺ turns the other way */
@media (min-width: 821px) {  /* the drawer comes in from the left (phones: from below, as in English) */
  [dir="rtl"] .rl-drawer { animation-name: rl-in-rtl; }
}
@keyframes rl-in-rtl { from { transform: translateX(-28px); opacity: .5; } }
[dir="rtl"] .dash-bar > span { transform-origin: right; }  /* bars grow from the right */
[dir="rtl"] .dash-delta b { direction: ltr; unicode-bidi: isolate; }  /* "+1.2", not "1.2+" */
[dir="rtl"] .dash-spark svg { animation-name: dash-wipe-rtl; }  /* sparklines draw from the right (time runs right to left) */
@keyframes dash-wipe-rtl { from { clip-path: inset(-12px -12px -12px 100%); } to { clip-path: inset(-12px -12px -12px -12px); } }
[dir="rtl"] .dash-approve { background: linear-gradient(270deg, var(--brand-soft), var(--surface) 75%); }
[dir="rtl"] .dash-hero {
  background: radial-gradient(640px 320px at 100% 0%, var(--dash-glow), transparent 70%),
    radial-gradient(520px 280px at 0% 100%, var(--dash-glow-2), transparent 70%), var(--surface);
}
[dir="rtl"] .dash-welcome { background: radial-gradient(640px 320px at 100% 0%, var(--dash-glow), transparent 70%), var(--surface); }
[dir="rtl"] .auth-hero {
  background: radial-gradient(700px 420px at -10% 110%, rgba(18, 158, 134, .30), transparent 70%),
    radial-gradient(1200px 600px at 110% -10%, #2d4b8c 0%, #1b2559 45%, #0d1230 100%);
}
