/* =====================================================================
   QdesignSkill — component classes (vanilla CSS; load after base.css and a flavor-*.css)
   Every rule is RTL-safe (logical properties) and theme-safe (tokens only).
   Tailwind projects can use these as-is for the signature pieces (.orb, .grad-text,
   .spot, .gborder, .skeleton, .page-halo …) and write the rest as utilities —
   references/components.md gives both spellings.
   ===================================================================== */
/* Wrapped in a cascade layer so Tailwind utilities and your own unlayered CSS win over the kit. */
@layer components {


/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.skip-link { position: fixed; inset-block-start: 12px; inset-inline-start: 12px; z-index: 300; padding: 8px 14px; border-radius: var(--r-sm); background: var(--surface-solid); box-shadow: var(--elev-lg); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; overflow-y: auto; z-index: var(--z-sidebar);
  background: var(--glass); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-inline-end: 1px solid var(--line);
}
.app-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; flex: none;
  background: var(--grad); box-shadow: 0 6px 18px -4px var(--cta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand-mark::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.5), transparent 55%); }
/* Context switcher (workspace / portal / product) under the brand. */
.context-switch { display: flex; align-items: center; gap: 10px; width: 100%; margin: 2px 0 8px; padding: 9px 11px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-solid); box-shadow: var(--elev-xs); text-align: start; transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.context-switch:hover { border-color: var(--line-2); box-shadow: var(--elev-sm); }
.context-switch .ico-tile { width: 30px; height: 30px; }
.context-switch small { display: block; font-size: 11px; color: var(--fg-faint); }
.context-switch b { display: block; font-size: 13px; font-weight: 600; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--fg-faint); white-space: nowrap; }
.crumbs b { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.nav-label { padding: 14px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--fg-muted); font-size: 13.8px; font-weight: 500; border: 0; background: transparent; width: 100%; text-align: start;
  transition: background var(--dur-2), color var(--dur-2);
}
.nav-item:hover { background: var(--surface-3); color: var(--fg); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: var(--elev-sm), inset 0 0 0 1px var(--line); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -12px; inset-block: 9px; width: 3px; border-radius: 3px; background: var(--area-accent, var(--brand)); }
.nav-item[aria-current="page"] svg { color: var(--brand); }
.nav-item .count { margin-inline-start: auto; font: 600 11px/1 var(--type-mono); padding: 3px 7px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand); }
.nav-item .count.bad { background: var(--bad-soft); color: var(--bad); }

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky); height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar .actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 38px; width: 100%; max-width: 420px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--fg-faint); font-size: 13.5px; text-align: start;
}
.search-trigger:hover { border-color: var(--line-2); }
/* Placeholder text truncates (Arabic strings run longer); it never wraps the bar. */
.search-trigger > span:not(.kbd) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { margin-inline-start: auto; white-space: nowrap; font: 500 11px/1.6 var(--type-mono); padding: 0 6px; border-radius: var(--r-xs); border: 1px solid var(--line-2); color: var(--fg-faint); }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--fg-muted);
  transition: transform var(--dur-1), box-shadow var(--dur-2), border-color var(--dur-2), color var(--dur-2);
}
.icon-btn:hover { border-color: var(--line-2); box-shadow: var(--elev-sm); color: var(--fg); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn .pip { position: absolute; top: 8px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad-fill); box-shadow: 0 0 0 2px var(--surface-solid); }
.menu-btn { display: none; }
.nav-scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 28px 32px 64px; width: 100%; overflow-x: clip; }  /* decorative halos and glows may bleed; the page never scrolls sideways */
.page-col { width: 100%; max-width: var(--page-max); margin-inline: auto; }
.page-col.wide { max-width: var(--page-max-wide); }
.read-col { width: 100%; max-width: 1000px; }   /* narrows inside the column, stays start-aligned */
.page-stack { display: grid; gap: 32px; }
/* Grid/flex children default to min-width:auto, so one wide child (a board, a table) widens the whole
   page on phones. Zero it on every layout container. */
.page-stack > *, .grid > *, .row > .grow, .main, .content { min-width: 0; }

/* ---------- Section accents (decoration only) ---------- */
.area-root { --area-accent: var(--accent-brand); transition: --area-accent var(--dur-5) var(--motion-ease); }
.area-root[data-area="health"]   { --area-accent: var(--accent-good); }
.area-root[data-area="ideas"]    { --area-accent: var(--accent-brass); }
.area-root[data-area="reports"]  { --area-accent: var(--accent-cyan); }
.area-root[data-area="people"]   { --area-accent: var(--accent-rose); }
.area-root[data-area="admin"]    { --area-accent: var(--accent-rose); }

/* ---------- Page header ---------- */
.page-head { position: relative; isolation: isolate; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 8px; }
.page-halo {
  position: absolute; z-index: -1; inset-block-start: -96px; inset-inline-start: -96px; width: min(560px, 90vw); height: 288px; pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--area-accent) 30%, transparent), transparent 72%),
    radial-gradient(closest-side at 70% 60%, color-mix(in srgb, var(--area-accent) 16%, transparent), transparent 100%);
  filter: blur(14px);
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-muted); }
.eyebrow > svg { width: 15px; height: 15px; color: var(--brand); }
.eyebrow.bar::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--brand); }
.eyebrow-chip {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: color-mix(in srgb, var(--area-accent) 12%, var(--glass));
  border: 1px solid color-mix(in srgb, var(--area-accent) 26%, var(--line));
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 14%, transparent), 0 6px 18px -8px color-mix(in srgb, var(--area-accent) 60%, transparent);
  backdrop-filter: blur(10px);
}
.eyebrow-chip svg { width: 14px; height: 14px; color: var(--brand); }
.page-title {
  font-family: var(--type-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
  line-height: var(--display-leading); font-size: clamp(38px, 5vw, 64px);
}
.page-title.compact { font-size: clamp(30px, 3.6vw, 46px); line-height: 1; }
.page-lead { margin-top: 12px; max-width: 42rem; color: var(--fg-muted); font-size: 15px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.head-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--fg-muted); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.section-title { font-family: var(--type-display); font-weight: var(--display-weight); letter-spacing: -0.01em; line-height: 1.05; font-size: clamp(24px, 2.6vw, 34px); }
.section-sub { color: var(--fg-muted); font-size: 13px; margin-top: 4px; }

/* Gradient-clipped italic emphasis: the last phrase of a headline. */
.grad-text { background: var(--grad-text, var(--grad)); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: var(--grad-text-style, italic); padding-inline-end: 0.06em; }
html[lang="ar"] .grad-text { font-style: normal; }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.mono { font-family: var(--type-mono); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }

/* ---------- Cards ---------- */
.card {
  position: relative; min-width: 0; padding: 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--elev-lg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  transition: translate var(--dur-2) var(--motion-ease), box-shadow var(--dur-3) var(--motion-ease), border-color var(--dur-2);
}
.card.hover:hover, a.card:hover { translate: 0 -2px; border-color: var(--line-2); box-shadow: var(--elev-xl); }
.card.flush { padding: 0; overflow: hidden; }
.card.solid { background: var(--surface-solid); }
.card.tint { background: linear-gradient(180deg, var(--brand-soft), transparent 70%), var(--surface); }
.card.ink { background: linear-gradient(160deg, #0b2540, #071322); color: #eef2f6; border-color: rgba(255, 255, 255, 0.06); }
.card.ink .muted { color: #8fa0b4; }
/* Quiet: nothing to show yet. Dashed, no surface, never a fake zero. */
.card.quiet { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--line-2); backdrop-filter: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { margin-top: 2px; font-size: 12.5px; color: var(--fg-muted); }
.card-link { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: var(--r-xs); font-size: 12px; font-weight: 500; color: var(--brand); white-space: nowrap; }
.card-link:hover { background: var(--brand-soft); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-muted); }
/* Decorative glow in a card corner. */
.card:has(> .corner-glow) { overflow: hidden; }
.corner-glow { position: absolute; inset-block-start: -80px; inset-inline-end: -80px; width: 224px; height: 224px; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, var(--brand-glow), transparent); }
/* Whole-card link: the title link stretches over the card; secondary controls sit above with z-index. */
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
button.stretch { all: unset; cursor: pointer; font: inherit; color: inherit; }
.stretch:focus-visible { outline: none; }
.stretch:focus-visible::after { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--r-lg); }
.above { position: relative; z-index: 2; }

.ico-tile { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-glow); }
.ico-tile svg { width: 17px; height: 17px; }
.ico-tile.lg { width: 48px; height: 48px; border-radius: var(--r-md); }
.ico-tile.lg svg { width: 22px; height: 22px; }
.ico-tile.solid { background: var(--grad-cta); color: var(--brand-ink); box-shadow: 0 8px 20px -6px var(--cta-glow); }
.ico-tile.neutral { background: var(--surface-2); color: var(--fg-muted); box-shadow: inset 0 0 0 1px var(--line); }
.ico-tile.good { background: var(--good-soft); color: var(--good); box-shadow: none; }
.ico-tile.warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.ico-tile.serious { background: var(--serious-soft); color: var(--serious); box-shadow: none; }
.ico-tile.bad { background: var(--bad-soft); color: var(--bad); box-shadow: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--fg);
  background: var(--surface-solid); border: 1px solid var(--line-2);
  transition: translate var(--dur-2) var(--motion-ease), box-shadow var(--dur-2), background var(--dur-2), border-color var(--dur-2);
}
.btn:hover { border-color: var(--field-line); box-shadow: var(--elev-sm); }
.btn:active { translate: 0 1px; }
.btn svg { width: 16px; height: 16px; }
/* The one primary per area: gradient + coloured glow + 1px lift. */
.btn.cta {
  background: var(--grad-cta); color: var(--brand-ink); border-color: transparent;
  box-shadow: 0 14px 36px -16px var(--cta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn.cta:hover { translate: 0 -1px; box-shadow: 0 20px 44px -14px var(--cta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--fg); box-shadow: none; }
.btn.solid { background: var(--fg); color: var(--fg-inverse); border-color: transparent; }
.btn.danger { background: var(--bad-fill); color: #fff; border-color: transparent; }
.btn.glass { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.22); backdrop-filter: blur(10px); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 14px; }
.btn.xl { height: 50px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); border-color: transparent; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
/* Pending ("Saving…"): stays fully visible, shows a spinner, ignores clicks. */
.btn[aria-busy="true"] { opacity: 1; pointer-events: none; cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .kbd { margin-inline-start: 4px; border: 0; background: rgba(0, 0, 0, 0.1); color: inherit; }

/* ---------- Chips, status, pills ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--fg-muted); border: 1px solid transparent;
}
.chip svg { width: 14px; height: 14px; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.outline { background: transparent; border-color: var(--line-2); }
.chip.on-glass { background: var(--glass); border-color: var(--line); backdrop-filter: blur(10px); color: var(--fg); }   /* over the canvas */
.chip.on-photo { background: rgba(7, 19, 34, 0.45); border-color: rgba(255, 255, 255, 0.18); backdrop-filter: blur(10px); color: #fff; } /* over photos & dark heroes, any theme */
button.chip { cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1); }
button.chip:hover { border-color: var(--line-2); }
button.chip[aria-pressed="true"] { background: var(--brand-soft); color: var(--fg); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.chip .n { font: 600 10px/1 var(--type-mono); padding: 3px 6px; border-radius: var(--r-pill); background: var(--brand); color: var(--brand-ink); }

/* Status pill: soft wash + text-safe ink + icon + WORD. Never colour alone. */
.status { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding-block: 0; padding-inline: 7px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status svg { width: 13px; height: 13px; stroke-width: 2.2; }
.status.good { background: var(--good-soft); color: var(--good); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.serious { background: var(--serious-soft); color: var(--serious); }
.status.bad { background: var(--bad-soft); color: var(--bad); }
.status.neutral { background: var(--neutral-soft); color: var(--neutral); }   /* none / not applicable: circle-dashed */
.status.info { background: var(--brand-soft); color: var(--brand); }            /* pending / waiting / scheduled: clock or hourglass */
.status.sm { height: 20px; padding-block: 0; padding-inline: 5px 7px; font-size: 11px; }

/* Category pill coloured by a local --st (stage, type, domain). */
.tone-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--st, var(--brand));
  background: color-mix(in srgb, var(--st, var(--brand)) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st, var(--brand)) 18%, transparent);
}
.tone-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st, var(--brand)); flex: none; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--neutral-fill); }
.dot.good { background: var(--good-fill); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.warn { background: var(--warn-fill); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--bad-fill); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.live { background: var(--good-fill); color: var(--good-fill); animation: pulse 2s infinite; }

/* Trend: coloured by good/bad direction, not by up/down. */
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend svg { width: 14px; height: 14px; stroke-width: 2.2; }
.trend.good { color: var(--good); } .trend.bad { color: var(--bad); } .trend.flat { color: var(--fg-faint); }

/* ---------- KPI tiles & numerals ---------- */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); line-height: 1.35; min-height: 34px; }
.kpi-value { display: flex; align-items: baseline; gap: 4px; font-family: var(--type-display); font-weight: var(--display-weight); font-size: var(--kpi-size, 48px); line-height: 1; letter-spacing: var(--display-tracking); font-variant-numeric: tabular-nums; }
.kpi-value small { font-family: var(--type-sans); font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--fg-faint); }
.kpi-value.good { color: var(--good); } .kpi-value.warn { color: var(--warn); } .kpi-value.bad { color: var(--bad); }
.kpi-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; font-size: 12px; color: var(--fg-muted); }
.kpi-spark { height: 34px; }
.hero-num { font-family: var(--type-display); font-weight: var(--display-weight); font-size: clamp(56px, 7vw, 92px); line-height: 0.92; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }

/* ---------- Meters, stacked bars ---------- */
.meter { position: relative; height: 8px; border-radius: var(--r-pill); overflow: visible; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }
.meter.thin { height: 5px; }
.meter > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--grad); transition: width var(--dur-5) var(--motion-ease); }
.meter.good > span { background: var(--good-fill); } .meter.warn > span { background: var(--warn-fill); } .meter.bad > span { background: var(--bad-fill); }
.meter .target { position: absolute; inset-block: -3px; width: 2px; border-radius: 2px; background: var(--fg-muted); }
.stackbar { display: flex; gap: 2px; height: 6px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); }
.stackbar > span { height: 100%; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.2px; }
.table th {
  position: sticky; top: 0; padding: 10px 14px; text-align: start; white-space: nowrap; background: var(--surface-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1); }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr[aria-selected="true"] { background: var(--row-selected); box-shadow: inset 2px 0 0 var(--brand); }
[dir="rtl"] .table tbody tr[aria-selected="true"] { box-shadow: inset -2px 0 0 var(--brand); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; font-family: var(--type-mono); font-size: 12.5px; }
.table .key { font-family: var(--type-mono); font-size: 11.5px; color: var(--fg-faint); }
.table .strong { font-weight: 600; color: var(--fg); }
html[lang="ar"] .table th { letter-spacing: 0; text-transform: none; font-size: 12px; }
/* Arabic: no tracking (it breaks letter joining), no uppercase, a touch more size and line-height. */
html[lang="ar"] :is(.eyebrow, .nav-label, .palette-group, .kpi-value, .hero-num, .page-title, .section-title, .hero-title, .empty-title, .locator, .locator-sm, .app-brand, .kv dt) { letter-spacing: 0; }
html[lang="ar"] :is(.eyebrow, .nav-label, .palette-group) { text-transform: none; font-size: calc(1em + 1px); }
html[lang="ar"] :is(.page-title, .hero-title, .section-title, .empty-title) { line-height: 1.25; }

/* ---------- Laptop-fit workspace: the first screen answers, the rest is one tab away ---------- */
.workspace { --fit-h: calc(100dvh - var(--ws-top, 0px) - 170px); /* screen minus tab bar and a card header */ scroll-margin-top: 8px; }
.workspace > .tabs { position: sticky; top: var(--ws-top, 0px); z-index: 6; margin-bottom: 16px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); }
.workspace .tab .tab-n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px var(--type-mono); background: var(--surface-2); color: var(--fg-muted); }
.workspace .tab .tab-n.bad { background: var(--bad-soft); color: var(--bad); }
.workspace .tab kbd { font: 500 10.5px var(--type-mono); color: var(--fg-faint); }
.ws-panel { min-height: min(var(--fit-h), 640px); }
.ws-panel:focus-visible { outline: none; }
.scroll-region { max-height: var(--fit-h, 70vh); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  background: linear-gradient(var(--surface-solid) 30%, transparent) top / 100% 24px no-repeat local, linear-gradient(transparent, var(--surface-solid) 70%) bottom / 100% 24px no-repeat local,
    radial-gradient(farthest-side at 50% 0, color-mix(in srgb, var(--fg) 14%, transparent), transparent) top / 100% 10px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, color-mix(in srgb, var(--fg) 14%, transparent), transparent) bottom / 100% 10px no-repeat scroll; }
.scroll-region .table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-solid); }
.fit-grid { display: grid; gap: 18px; grid-template-columns: repeat(var(--fit-cols, 3), minmax(0, 1fr)); align-items: start; }
@media (max-width: 1100px) { .fit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .fit-grid { grid-template-columns: minmax(0, 1fr); }
  .scroll-region { max-height: none; overflow: visible; background: none; } /* phones: one natural page scroll */
  .workspace .tab kbd { display: none; }
}

/* ---------- Tabs & segmented ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; padding-top: 6px; margin-top: -6px; }
.tab { position: relative; padding: 10px 14px; border: 0; background: none; white-space: nowrap; font-size: 13.5px; font-weight: 500; color: var(--fg-muted); display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--fg); }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); }
.tab[aria-selected="true"] svg, .tab[aria-current="page"] svg { color: var(--brand); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.seg :is(button, a) { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); display: inline-flex; align-items: center; gap: 6px; }
.seg :is(button[aria-pressed="true"], a[aria-current]) { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 0 0 1px var(--line); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 500; color: var(--fg); }
.hint { font-size: 12px; color: var(--fg-muted); }
.error-text { font-size: 12px; font-weight: 500; color: var(--bad); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r-sm); outline: 0;
  background: var(--surface-solid); border: 1px solid var(--field-line); font-size: 14px;
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.input::placeholder, .textarea::placeholder { color: var(--fg-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--fg-muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input.sm { height: 36px; font-size: 13px; }
[dir="rtl"] .input[dir="ltr"] { text-align: right; }   /* card numbers, codes, emails stay LTR but line up with RTL fields */
.switch { position: relative; width: 40px; height: 24px; border-radius: var(--r-pill); border: 1px solid var(--field-line); background: var(--surface-3); flex: none; transition: background var(--dur-2); }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--elev-sm); transition: inset-inline-start var(--dur-2) var(--motion-ease); }
.switch[aria-checked="true"] { background: var(--grad-cta); border-color: transparent; }
.switch[aria-checked="true"]::after { inset-inline-start: 18px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 18px; height: 18px; margin-top: 2px; }
/* Choice cards: large, keyboard-numbered options (questionnaires, status pickers). */
.choice { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: var(--surface-solid); text-align: start; transition: border-color var(--dur-2), box-shadow var(--dur-2), background var(--dur-2); }
.choice:hover { border-color: var(--field-line); }
.choice[aria-checked="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface-solid)); box-shadow: 0 10px 24px -14px var(--cta-glow); }

/* ---------- Lists, timeline, kanban ---------- */
.list { display: flex; flex-direction: column; }
.list-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: var(--r-md); border: 1px solid transparent; }
.list-item:hover { background: var(--row-hover); border-color: var(--line); }
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 6px; inset-block: 6px; width: 2px; border-radius: 2px; background: var(--line-2); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-solid); border: 3px solid var(--brand); }
.tl-item.done::before { background: var(--brand); }
.tl-item.pending::before { border-color: var(--line-2); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 14px; overflow-x: auto; padding: 14px; border-radius: var(--r-xl); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); box-shadow: var(--elev-lg); }
.kan-col { display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.kan-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; font-size: 13px; font-weight: 600; }
.kan-card {
  position: relative; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); cursor: grab;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--elev-sm);
  transition: translate var(--dur-2) var(--motion-ease), box-shadow var(--dur-2), border-color var(--dur-2);
}
/* Entity identity: a 2px top hairline + faint corner glow in the entity colour --c. */
.kan-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--c, var(--brand)), transparent 75%); }
.kan-card:hover { translate: 0 -2px; border-color: var(--line-2); box-shadow: var(--elev-lg); }
.kan-card.dragging { rotate: 1.2deg; scale: 1.03; box-shadow: var(--elev-xl); border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.kan-slot { border: 1.5px dashed color-mix(in srgb, var(--brand) 50%, transparent); background: var(--surface-2); border-radius: var(--r-md); }

/* ---------- Callouts, privacy, heatmap ---------- */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); font-size: 13.2px; }
.callout > svg { color: var(--brand); flex: none; margin-top: 1px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); } .callout.warn > svg { color: var(--warn); }
.callout.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); } .callout.bad > svg { color: var(--bad); }
.callout.neutral { background: var(--surface-2); border-color: var(--line); } .callout.neutral > svg { color: var(--fg-muted); }
.callout.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, transparent); } .callout.good > svg { color: var(--good); }
/* Hatching = "hidden on purpose" (privacy suppression, not-applicable). */
.suppressed {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 500; color: var(--fg-muted); border: 1px dashed var(--line-2);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface-3) 8px 16px);
}
.heat { display: grid; gap: 4px; font-size: 12px; }
.heat-cell { height: 44px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums; transition: transform var(--dur-1), box-shadow var(--dur-1); }
.heat-cell:hover { transform: scale(1.05); box-shadow: var(--elev-md); position: relative; z-index: 2; }
.heat-cell.good { background: color-mix(in srgb, var(--good-fill) 22%, var(--surface-solid)); color: var(--good); }
.heat-cell.warn { background: color-mix(in srgb, var(--warn-fill) 30%, var(--surface-solid)); color: var(--warn); }
.heat-cell.bad { background: color-mix(in srgb, var(--bad-fill) 26%, var(--surface-solid)); color: var(--bad); }
/* Sequential magnitude (retention %, volume): one hue, intensity by --v (0–1). Text flips to white past the midpoint. */
.heat-cell.seq { --v: 0.5; background: color-mix(in srgb, var(--brand) calc(var(--v) * 85%), var(--surface-solid)); color: var(--fg); }
.heat-cell.seq.hi { color: var(--brand-ink); }
.heat-cell.sup { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px); color: var(--fg-muted); font-size: 11px; font-weight: 500; }

/* ---------- Legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--fg-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend i.line { width: 14px; height: 2px; border-radius: 2px; }

/* ---------- Avatars ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; object-fit: cover; font-size: 12px; font-weight: 600; color: #fff; background: var(--avatar-grad); box-shadow: 0 0 0 2px var(--surface-solid), inset -2px -3px 6px rgba(0, 0, 0, 0.25); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.empty { background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none; }
.avatar-stack { display: flex; } .avatar-stack > * + * { margin-inline-start: -8px; }

/* ---------- Hero with photography ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 280px; border-radius: var(--r-xl); color: #fff; background: #0b2540; box-shadow: var(--elev-xl); }
.hero > img, .hero > video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 8s var(--motion-ease-soft); }
.hero:hover > img { transform: scale(1.07); }
/* Directional ink scrim: dark where the words are, clear where the photo breathes. Tint it per brand. */
/* Tint per brand with --scrim-ink (an "r g b" triplet: Ghaf navy 7 19 34, Orbit space 10 10 24, teal 4 40 38);
   the angle mirrors in RTL and turns bottom-up on phones. */
.hero { --scrim-ink: 7 19 34; --scrim-angle: 100deg; }
[dir="rtl"] .hero { --scrim-angle: 260deg; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--scrim-angle), rgb(var(--scrim-ink) / 0.92) 0%, rgb(var(--scrim-ink) / 0.7) 45%, rgb(var(--scrim-ink) / 0.12) 100%); }
.hero-body { position: relative; max-width: 640px; padding: 36px; }
.hero-title { font-family: var(--type-display); font-weight: var(--display-weight); font-size: clamp(32px, 4vw, 52px); line-height: 1; letter-spacing: var(--display-tracking); }
.hero-body p { margin-top: 10px; font-size: 15px; color: rgba(255, 255, 255, 0.82); }
.hero-stats { display: flex; gap: 1px; border-radius: var(--r-md); overflow: hidden; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(16px); }
.hero-stats > div { padding: 12px 16px; background: rgba(7, 19, 34, 0.35); }

/* ---------- Signature: orb, spotlight, gradient border ---------- */
/* A glass sphere in one colour (--c). Scale it from 10px list dots to 160px heroes. Always aria-hidden. */
.orb {
  --c: var(--orb-1); display: inline-block; border-radius: 50%; flex: none; aspect-ratio: 1;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.95) 0 5%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 70% 85%, color-mix(in srgb, var(--c) 40%, white) 0%, transparent 35%),
    radial-gradient(circle at 38% 36%, color-mix(in srgb, var(--c) 58%, white) 0%, var(--c) 46%, color-mix(in srgb, var(--c) 40%, black) 100%);
  box-shadow: inset -3px -5px 10px rgba(0, 0, 0, 0.28), inset 2px 2px 6px rgba(255, 255, 255, 0.25), 0 8px 20px -8px color-mix(in srgb, var(--c) 75%, transparent);
}
.orb-core { display: inline-block; border-radius: 50%; aspect-ratio: 1; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.9) 0 6%, transparent 26%), var(--grad); box-shadow: 0 0 60px -10px var(--brand-glow), inset -6px -10px 22px rgba(0, 0, 0, 0.25); }

/* 3D host: the CSS fallback inside fades out once orb.js has drawn its first frame. */
.orb-host { position: relative; }
.orb-host > :not(canvas) { transition: opacity 700ms ease; }
.orb-host[data-orb-ready] > :not(canvas) { opacity: 0; }

/* Illustration material: matte clay in light (ground shadow), lit glass in dark (glow). */
.art-shadow { opacity: 1; } .art-glow { opacity: 0; }
[data-theme="dark"] .art-shadow { opacity: 0; } [data-theme="dark"] .art-glow { opacity: 1; }

/* Cursor spotlight: JS sets --mx/--my on pointermove (see ui-helpers.js). */
/* The glow sits behind the content (z-index -1 inside an isolated card), so children stay unpositioned
   and a .stretch link can still cover the whole card. */
.spot { position: relative; overflow: hidden; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--brand-glow), transparent 45%); }
.spot:hover::before { opacity: 1; }

/* Gradient hairline for featured / next / focused. */
.gborder { border-color: transparent !important; background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box; }
.gborder.glow { box-shadow: 0 18px 44px -22px var(--brand-glow); }

/* ---------- Lens hero (lens.js): stage behind the copy, CSS fallback, beam labels ---------- */
.lens-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; min-height: min(820px, calc(100svh - 64px)); padding-block: 48px 120px; overflow: clip; }
.lens-stage { position: absolute; inset: 0; z-index: -1; }
.lens-stage::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 160px; pointer-events: none; background: linear-gradient(180deg, transparent, var(--bg)); }
.lens-fallback { position: absolute; inset: 0; }
.lf-cone { position: absolute; inset-block: 18%; inset-inline: 0 39%; background: radial-gradient(60% 50% at 100% 50%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%); }
[dir="rtl"] .lf-cone { background: radial-gradient(60% 50% at 0% 50%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%); }
.lf-lens { position: absolute; inset-inline-start: 61%; top: 50%; width: 120px; height: 300px; border-radius: 50%; translate: -50% -50%; background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.7), transparent 30%), linear-gradient(160deg, color-mix(in srgb, var(--brand) 40%, transparent), color-mix(in srgb, var(--accent-cyan) 30%, transparent)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand-2) 60%, transparent), 0 0 80px -10px var(--brand-glow); }
[dir="rtl"] .lf-lens { translate: 50% -50%; }
.lf-beam { position: absolute; inset-inline-start: 61%; top: 50%; width: 42%; height: 3px; border-radius: 3px; transform-origin: 0 50%; rotate: var(--fan, 0deg); background: linear-gradient(90deg, var(--c), transparent); filter: blur(0.5px); box-shadow: 0 0 18px var(--c); }
[dir="rtl"] .lf-beam { transform-origin: 100% 50%; rotate: calc(var(--fan, 0deg) * -1); background: linear-gradient(270deg, var(--c), transparent); }
/* Labels are placed in screen pixels by lens.js (translate), so they start at the stage origin. */
.beam-label { position: absolute; top: 0; left: 0; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding-block: 0; padding-inline: 10px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; color: var(--fg); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); box-shadow: var(--elev-sm); pointer-events: none; opacity: 0; transition: opacity 900ms var(--motion-ease); } /* physical-ok: screen-positioned */
.beam-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent), 0 0 12px var(--c); }
.lens-hero:has(.lens-stage[data-orb-ready]) .beam-label { opacity: 1; }
@media (max-width: 900px) {
  .lens-hero { min-height: auto; padding-block: 24px 48px; }
  .lens-stage { position: relative; inset: auto; order: 2; height: 340px; z-index: 0; }
  .lf-lens { inset-inline-start: 50%; width: 90px; height: 220px; }
  .lf-beam { inset-inline-start: 50%; width: 50%; }
  .lf-cone { inset-inline: 0 50%; }
}

/* ---------- Empty state ---------- */
.empty-state { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 28px; justify-items: start; padding: 48px 40px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--elev-lg); }
.empty-state::before { content: ""; position: absolute; z-index: -1; inset-block-end: -120px; inset-inline-start: -80px; width: 360px; height: 360px; background: radial-gradient(closest-side, color-mix(in srgb, var(--area-accent, var(--brand)) 18%, transparent), transparent); }
.empty-title { font-family: var(--type-display); font-weight: var(--display-weight); font-size: clamp(28px, 3.6vw, 44px); line-height: 1.05; letter-spacing: var(--display-tracking); }
.empty-body { max-width: 34rem; color: var(--fg-muted); }
.empty-steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); width: 100%; }
.empty-step { padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 60%, transparent); }
.empty-step .n { font: 500 11px var(--type-mono); color: var(--fg-faint); }
.empty-state.panel { padding: 32px 20px; justify-items: center; text-align: center; gap: 10px; border-style: dashed; border-color: var(--line-2); background: transparent; box-shadow: none; }

/* ---------- Skeleton (shape-matched placeholders) ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--fg) 5%, transparent) 50%, transparent 70%) 0 0 / 220% 100%, var(--skeleton); animation: shimmer 1.6s linear infinite; }

/* ---------- Dimmed (archived, cancelled, merged): fade decoration, never text ---------- */
[data-dimmed] { background-color: color-mix(in srgb, var(--surface-2) 70%, transparent); border-style: dashed; }
[data-dimmed] :is(.orb, [data-dim], img) { filter: saturate(0.25); opacity: 0.6; }
[data-dimmed] .faint { color: var(--fg-muted); }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: var(--z-scrim); display: grid; place-items: center; padding: 20px; background: var(--scrim); backdrop-filter: blur(6px); animation: fade var(--dur-2) both; }
.modal { width: min(600px, 100%); max-height: calc(100dvh - 40px); overflow: auto; border-radius: var(--r-xl); background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--elev-xl); animation: pop var(--dur-3) var(--motion-ease) both; }
.modal.wide { width: min(940px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.modal-body { padding: 16px 24px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
/* Side sheet: the default for details. Non-modal where the list behind should stay usable. */
.sheet { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: var(--z-modal); width: min(720px, 92vw); display: flex; flex-direction: column; background: var(--surface-solid); border-inline-start: 1px solid var(--line-2); border-start-start-radius: var(--r-xl); border-end-start-radius: var(--r-xl); box-shadow: var(--elev-xl); animation: sheet-in var(--dur-4) var(--motion-ease) both; }
[dir="rtl"] .sheet { animation-name: sheet-in-rtl; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; }
.toast-region { position: fixed; inset-block-end: calc(20px + var(--toast-offset, 0px)); inset-inline-end: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; width: min(384px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--elev-xl); font-size: 13.5px; animation: rise var(--dur-3) var(--motion-ease) both; }
.toast > svg { flex: none; width: 18px; height: 18px; color: var(--good); }
.toast.info > svg { color: var(--brand); }
.toast.bad > svg { color: var(--bad); }
.toast .toast-action { margin-inline-start: auto; padding: 4px 8px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--brand); font-weight: 600; }
.toast .toast-action:hover { background: var(--brand-soft); }
.tip { position: fixed; z-index: var(--z-tip); pointer-events: none; max-width: 260px; padding: 7px 10px; border-radius: var(--r-sm); background: var(--fg); color: var(--fg-inverse); font-size: 12px; font-weight: 500; box-shadow: var(--elev-md); }
.palette { width: min(620px, 100%); margin-top: 12vh; align-self: start; border-radius: var(--r-xl); background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--elev-xl); overflow: hidden; }
.palette input { width: 100%; height: 56px; padding: 0 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 16px; outline: 0; }
.palette-group { padding: 10px 12px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0 6px; border-radius: var(--r-sm); font-size: 13.5px; }
.palette-item[aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }

/* ---------- Motion ---------- */
.enter { animation: rise 500ms var(--motion-ease) both; }
.stagger > * { animation: rise 550ms var(--motion-ease) both; }
.stagger > :nth-child(2) { animation-delay: 60ms; } .stagger > :nth-child(3) { animation-delay: 120ms; }
.stagger > :nth-child(4) { animation-delay: 180ms; } .stagger > :nth-child(5) { animation-delay: 240ms; }
.stagger > :nth-child(n + 6) { animation-delay: 300ms; }
.float { animation: float 8s ease-in-out infinite; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .rise-on-scroll { animation: scroll-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes scroll-rise { from { opacity: 0.35; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-in-rtl { from { transform: translateX(-32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 120% 0, 0 0; } to { background-position: -120% 0, 0 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -6px, 0); } }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .float, .dot.live, .area-root { animation: none !important; transition: none !important; }
  .card.hover:hover, a.card:hover, .btn.cta:hover, .kan-card:hover { translate: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* Closed: off-canvas AND hidden, so it can't take focus and doesn't sweep across when dir flips. */
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); background: var(--surface-solid); transform: translateX(-105%); visibility: hidden; transition: transform var(--dur-4) var(--motion-ease), visibility 0s linear var(--dur-4); }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--elev-xl); transition: transform var(--dur-4) var(--motion-ease); }
  .menu-btn { display: grid; }
  /* <div class="nav-scrim" onclick="document.body.classList.remove('nav-open')"></div> next to the sidebar */
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: calc(var(--z-sidebar) - 1); background: var(--scrim); backdrop-filter: blur(4px); }
  .g-12 > [class*="span-"] { grid-column: 1 / -1; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search-trigger .label-text, .search-trigger .kbd { display: none; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .g-4.keep-2, .g-3.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-body { padding: 24px 20px; }
  .hero, [dir="rtl"] .hero { --scrim-angle: 0deg; }
  .hero:has(> img, > video) .hero-body { padding-top: 140px; }
  .kpi-value { font-size: calc(var(--kpi-size, 48px) * 0.8); }
  .empty-state { padding: 32px 20px; }
  .modal-head, .modal-body { padding-inline: 18px; }
  .sheet { width: 100vw; border-radius: 0; border-inline-start: 0; }
  .hide-sm { display: none !important; }
}
@media print {
  .sidebar, .topbar, .toast-region { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; break-inside: avoid; backdrop-filter: none; }
}

/* ---------- Public & mobile-first patterns ---------- */
/* Public site header (citizen portals, marketing, sign-in): brand · horizontal nav · actions. Use instead of the sidebar shell. */
.site-header { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 max(16px, calc((100% - var(--page-max)) / 2)); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px) saturate(150%); border-bottom: 1px solid var(--line); }
.site-header .actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--fg-muted); }
.site-nav a:hover { background: var(--surface-3); color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.site-footer { margin-top: 64px; padding: 40px max(16px, calc((100% - var(--page-max)) / 2)) 56px; border-top: 1px solid var(--line); display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); font-size: 13px; color: var(--fg-muted); }
/* Split auth layout: decorative signature panel (start) fading into the form column (end). Stacks on phones. */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-art { position: relative; overflow: hidden; display: grid; place-items: center; -webkit-mask-image: linear-gradient(to right, #000 62%, transparent); mask-image: linear-gradient(to right, #000 62%, transparent); }
[dir="rtl"] .auth-art { -webkit-mask-image: linear-gradient(to left, #000 62%, transparent); mask-image: linear-gradient(to left, #000 62%, transparent); }
.auth-form { display: grid; align-content: center; gap: 20px; width: min(400px, 100%); margin-inline: auto; padding: 40px 20px; }
/* Bottom tab bar (phones): 4–5 destinations, icon + label, safe-area aware. Sets --toast-offset so toasts clear it. */
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-sticky); display: none; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--glass-strong); backdrop-filter: blur(18px) saturate(150%); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: var(--r-sm); font-size: 11px; font-weight: 500; color: var(--fg-muted); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--brand); }
/* Bottom sheet (phones): use instead of .sheet below 720px. */
.bottom-sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-modal); max-height: 88dvh; overflow: auto; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--surface-solid); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--elev-xl); animation: sheet-up var(--dur-4) var(--motion-ease) both; }
.bottom-sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 4px auto 14px; border-radius: 4px; background: var(--line-2); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Sticky action bar for step flows: back (ghost) + next (cta), always reachable by thumb. */
.action-bar { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin-inline: -16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.action-bar .btn.cta { flex: 1; }
/* Stepper: <ol class="stepper"><li data-done><span>Eligibility</span></li><li aria-current="step"><span>Documents</span></li>… */
.stepper { display: flex; gap: 8px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.stepper li { flex: 1; display: grid; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); counter-increment: step; }
.stepper li::before { content: ""; height: 4px; border-radius: 4px; background: var(--surface-3); }
.stepper li[data-done]::before { background: var(--brand); }
.stepper li[aria-current="step"]::before { background: var(--grad); box-shadow: 0 0 10px var(--brand-glow); }
.stepper li[aria-current="step"] { color: var(--fg); font-weight: 600; }
.stepper li > span::before { content: counter(step) " · "; font-family: var(--type-mono); color: var(--fg-faint); }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 220px; -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent); mask-image: linear-gradient(to bottom, #000 62%, transparent); }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  /* Phones: header actions never push the page wider — brand shrinks, secondary actions take .hide-sm */
  .site-header { gap: 10px; padding-inline: 16px; }
  .site-header > * { min-width: 0; }
  .site-header .actions { gap: 6px; flex-shrink: 0; }
  .site-header .app-brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar { display: grid; }
  body:has(.tabbar) { padding-bottom: 72px; --toast-offset: 72px; }
  .stepper li > span { display: none; }
  .stepper li[aria-current="step"] > span { display: block; }
}

/* =====================================================================
   Operational & sensitive-data patterns
   (screening, case handling, border/travel data, health records, finance ops)
   ===================================================================== */

/* Record header: the entity's locator is the title (mono, spaced), facts as chips beneath. */
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.locator { font: 600 clamp(22px, 2.4vw, 30px)/1 var(--type-mono); letter-spacing: 0.08em; }
.locator-sm { font: 600 13px/1 var(--type-mono); letter-spacing: 0.06em; }

/* Masked personal data. Reveal is a deliberate, logged act: button → reason → value + audit note. */
.mask { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-family: var(--type-mono); font-size: 0.95em; letter-spacing: 0.04em; direction: ltr; unicode-bidi: isolate; }
.mask .dots { color: var(--fg-faint); letter-spacing: 0.12em; }
.mask button { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-xs); border: 0; background: transparent; color: var(--fg-muted); }
.mask button:hover { background: var(--surface-3); color: var(--fg); }
.mask[data-revealed] { background: var(--warn-soft); border-radius: var(--r-xs); padding: 0 6px; }
.audit-note { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--fg-muted); }

/* Risk score: number + band word + mini bar. Bands map to status tokens. */
.risk { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding-block: 0; padding-inline: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--neutral-soft); color: var(--neutral); }
/* The score badge is filled with the band's own text-safe ink and labelled in the card colour,
   so it passes contrast wherever the band's text does (both themes, every flavour). */
.risk { --band: var(--neutral); }
.risk.low { --band: var(--good); background: var(--good-soft); }
.risk.med { --band: var(--warn); background: var(--warn-soft); }
.risk.high { --band: var(--serious); background: var(--serious-soft); }
.risk.critical { --band: var(--bad); background: var(--bad-soft); }
.risk { color: var(--band); }
.risk b { display: grid; place-items: center; min-width: 30px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); font: 700 11.5px/1 var(--type-mono); background: var(--band); color: var(--surface-solid); }

/* Match / hit card: a 4px status edge on the inline-start, reason first, evidence after. */
.hit { position: relative; padding-block: 14px; padding-inline: 20px 16px; border-radius: var(--r-md); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--elev-sm); }
.hit::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 6px; width: 4px; border-radius: 4px; background: var(--hit, var(--bad-fill)); }
.hit.warn { --hit: var(--warn-fill); } .hit.info { --hit: var(--brand); }

/* Live feed: newest first, time in mono, new rows glow in once. */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item time { font: 500 12px var(--type-mono); color: var(--fg-faint); }
.feed-item.new { animation: feed-in 1.6s var(--motion-ease) both; }
@keyframes feed-in { 0% { background: color-mix(in srgb, var(--brand) 14%, transparent); } 100% { background: transparent; } }

/* Route: origin ─ ✈ ─ destination, codes in mono. Keep LTR order for IATA codes inside RTL pages if your domain expects it. */
.route { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--type-mono); letter-spacing: 0.04em; }
.route .leg { position: relative; width: 56px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px); }
.route .leg svg { position: absolute; inset-inline-start: 50%; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%); color: var(--brand); background: var(--surface-solid); }
[dir="rtl"] .route .leg svg { transform: translate(50%, -50%) scaleX(-1); }

/* Data-domain boundary strip: what lives where, with dashed "walls" between domains. */
.boundary { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); }
.boundary > div { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 12.5px; }
.boundary > div + div { border-inline-start: 1.5px dashed var(--line-2); }

/* Provenance footer: source, cut-off, version, scope — every data page ends with it. */
.provenance { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--fg-muted); }
.provenance span { display: inline-flex; align-items: center; gap: 5px; }
.provenance svg { width: 13px; height: 13px; }

/* SLA countdown chip. Blinks only in its last stage; frozen under reduced motion. */
.sla { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font: 600 12px var(--type-mono); background: var(--neutral-soft); color: var(--neutral); direction: ltr; }
.sla.warn { background: var(--warn-soft); color: var(--warn); }
.sla.bad { background: var(--bad-soft); color: var(--bad); animation: sla-blink 1.6s steps(2, jump-none) infinite; }
@keyframes sla-blink { 50% { box-shadow: inset 0 0 0 1.5px var(--bad); } }
@media (prefers-reduced-motion: reduce) { .sla.bad, .feed-item.new { animation: none; } }

/* ---------- Short laptop screens (1366×768, 1440×900 with browser chrome): denser, so the work starts higher ---------- */
@media (min-width: 1024px) and (max-height: 860px) {
  .content { padding-block-start: 18px; }
  .page-stack { gap: 18px; }
  .kpi { padding: 14px 16px; gap: 6px; }
  .kpi-value { font-size: calc(var(--kpi-size, 48px) * 0.8); }
}

/* ---------- Landing & briefing patterns: optional options, never the default (see references/variants.md) ---------- */
.announce { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding-inline: 4px 14px; border-radius: var(--r-pill); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--elev-sm); font-size: 13px; color: var(--fg); text-decoration: none; }
.announce .tag { height: 26px; padding-inline: 10px; border-radius: var(--r-pill); display: inline-grid; place-items: center; font: 700 11px var(--type-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-ink); background: var(--grad-cta, var(--grad)); }
.announce svg { width: 15px; height: 15px; color: var(--fg-muted); transition: translate 0.18s var(--motion-ease); }
.announce:hover svg { translate: 3px 0; }
[dir="rtl"] .announce svg { scale: -1 1; }
[dir="rtl"] .announce:hover svg { translate: -3px 0; }
.mark-phrase { position: relative; isolation: isolate; padding-inline: 0.06em; }
.mark-phrase::before { content: ""; position: absolute; z-index: -1; inset: 0.2em -0.04em 0.02em; border-radius: 4px; background: color-mix(in srgb, var(--brand) 16%, transparent); transform-origin: 0 50%; animation: mark-in 0.9s var(--motion-ease) 0.3s both; }
[dir="rtl"] .mark-phrase::before { transform-origin: 100% 50%; }
@keyframes mark-in { from { scale: 0 1; } }
.chart-box { position: relative; height: 240px; } .chart-box.sm { height: 180px; } .chart-box.lg { height: 300px; }
.display-xl { margin: 18px 0 0; font-family: var(--type-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 0.98; font-size: clamp(44px, 6.4vw, 92px); }
.big-num { margin: 0; font-family: var(--type-display); font-weight: var(--display-weight); font-size: clamp(88px, 16vw, 220px); line-height: 0.9; letter-spacing: -0.04em; }
.big-num .grad-text { padding-inline-end: 0.04em; }
html[lang="ar"] .display-xl { letter-spacing: 0; line-height: 1.15; font-size: clamp(38px, 5.4vw, 76px); }
html[lang="ar"] .big-num { letter-spacing: 0; }
.proof-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--fg-muted); }
.proof-row li { display: inline-flex; align-items: center; gap: 7px; }
.proof-row svg { width: 15px; height: 15px; color: var(--good); }
.page-lead b, .page-lead strong { color: var(--fg); font-weight: 600; }
.browser-frame { position: relative; border-radius: var(--r-xl); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--elev-xl); overflow: hidden; }
.browser-frame .bf-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; height: 40px; padding-inline: 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.browser-frame .bf-dots { display: flex; gap: 6px; }
.browser-frame .bf-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.browser-frame .bf-url { height: 24px; padding-inline: 12px; border-radius: var(--r-pill); display: inline-flex; align-items: center; font: 500 11.5px var(--type-mono); color: var(--fg-muted); background: var(--surface-solid); border: 1px solid var(--line); direction: ltr; }
.browser-frame .bf-body { position: relative; }
.float-card { position: absolute; z-index: 3; width: min(300px, 80vw); padding: 14px 16px; border-radius: var(--r-lg); background: var(--glass-strong, var(--surface-solid)); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--elev-lg); animation: float 7s ease-in-out infinite; }
.float-card .fc-eyebrow { display: flex; align-items: center; gap: 6px; font: 600 10.5px var(--type-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.float-card .fc-eyebrow svg { width: 14px; height: 14px; color: var(--brand); }
.float-card p { margin: 6px 0 8px; font-size: 13.5px; line-height: 1.45; }
html[lang="ar"] :is(.announce .tag, .float-card .fc-eyebrow) { letter-spacing: 0; text-transform: none; }
@media (max-width: 760px) { .float-card { position: relative; inset: auto !important; width: auto; margin: -28px 16px 0; animation: none; } }

/* ---------- Prototype variant switch: compare 2–3 options of a section live (QUI.variants) ---------- */
[data-variants] > [data-variant]:not([data-active]) { display: none !important; }
.variant-switch { position: fixed; z-index: 90; inset-block-end: 16px; inset-inline-start: 50%; translate: -50% 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; max-width: calc(100vw - 32px); padding: 8px 10px; border-radius: 18px; background: var(--glass-strong, var(--surface-solid)); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--elev-lg); font-size: 12.5px; }
[dir="rtl"] .variant-switch { translate: 50% 0; }
.variant-switch .vs-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.variant-switch .vs-label { margin-inline-end: 4px; font-weight: 600; color: var(--fg-muted); }
.variant-switch button { height: 28px; padding-inline: 10px; border-radius: var(--r-pill); border: 1px solid transparent; background: none; color: var(--fg-muted); font: inherit; cursor: pointer; }
.variant-switch button:hover { color: var(--fg); }
.variant-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--fg); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.variant-switch .vs-hide { width: 28px; padding: 0; display: inline-grid; place-items: center; }
@media print { .variant-switch { display: none; } }

} /* @layer components */
