/* Rasd Web design system (Documentation/Rasd-Web/06-design-system-and-ux.md).
   Navy + turquoise, light and dark, logical properties throughout so Arabic (RTL) and English (LTR)
   mirror without separate rules. System fonts only: no font download. */

:root {
  --navy-900: #0b1f3a; --navy-800: #102a4c; --navy-700: #16325c; --navy-500: #2b4f80;
  --turq-600: #0e9fb0; --turq-500: #14b8c9; --turq-300: #7fe0ea; --turq-100: #e6f8fa;
  --surface: #f5f8fc; --card: #ffffff; --line: #e3e9f2;
  --text: #0b1f3a; --muted: #5b6b82;
  --positive: #12a37b; --negative: #d64c4c; --warning: #e8a33c;
  --focus: #14b8c9;
  /* Text colours that meet WCAG AA (4.5:1) on cards and on their own tinted pills. */
  --link: #0a6f7b; --ok-text: #0a6b50; --bad-text: #b0302e; --warn-text: #7a4d0a;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 8px 24px rgba(11, 31, 58, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #08131f; --card: #0f2034; --line: #1d3350;
    --text: #e7eef7; --muted: #9fb0c7; --turq-100: #0e3440; --navy-700: #c7d6ea;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
    --link: #7fe0ea; --ok-text: #4fd1a5; --bad-text: #f19a9a; --warn-text: #f2be6a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
[lang="ar"] body, body:lang(ar) { font-family: var(--font-ar); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 650; color: var(--navy-700); }
a { color: var(--link); }
small { font-size: .78em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.rw-muted { color: var(--muted); }
.rw-inline { display: inline; margin: 0; }

.rw-skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--navy-900); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.rw-skip:focus { inset-inline-start: 8px; }
.rw-preview { background: var(--warning); color: #1d1300; text-align: center; font-weight: 600; padding: 6px 12px; font-size: .9rem; }

/* ---- buttons, fields, alerts ---- */
.rw-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.rw-btn:hover { border-color: var(--turq-500); }
.rw-btn-primary { background: var(--turq-500); border-color: var(--turq-500); color: #04222a; }
.rw-btn-primary:hover { background: var(--turq-600); border-color: var(--turq-600); color: #04222a; }
.rw-btn-ghost { background: transparent; border-color: transparent; }
.rw-btn-ghost:hover { background: var(--turq-100); border-color: transparent; }
.rw-block { width: 100%; justify-content: center; }
.rw-field { display: grid; gap: 6px; margin-block-end: 16px; }
.rw-field > span { font-weight: 600; font-size: .92rem; }
.rw-field input, .rw-field select, .rw-field textarea, .rw-filter, .rw-inline-form input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.rw-field textarea { padding-block: 10px; resize: vertical; min-height: 64px; }
.rw-field input[type="file"] { padding-block: 9px; }
.rw-field input:focus, .rw-field select:focus, .rw-field textarea:focus, .rw-filter:focus, .rw-inline-form input:focus { border-color: var(--turq-500); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--turq-500) 30%, transparent); }
.rw-alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-block-end: 16px; font-weight: 500; }
.rw-alert-error { background: color-mix(in srgb, var(--negative) 12%, var(--card)); color: var(--bad-text); border: 1px solid color-mix(in srgb, var(--negative) 35%, transparent); }

/* ---- public pages (sign-in, maintenance) ---- */
.rw-center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.rw-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.rw-narrow { max-width: 460px; }
.rw-login { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.rw-login-brand {
  background: radial-gradient(120% 120% at 0% 0%, var(--turq-500) 0%, var(--navy-800) 55%, var(--navy-900) 100%);
  color: #fff; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 48px 32px; text-align: center;
}
.rw-login-brand img { background: #fff; border-radius: 22px; padding: 10px; width: 160px; height: auto; }
.rw-login-brand p { font-size: 1.15rem; font-weight: 600; opacity: .95; margin: 0; }
.rw-login-card { border: 0; border-radius: 0; box-shadow: none; padding: 40px 36px; }
.rw-login-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block-end: 4px; }
.rw-login-card .rw-muted { margin-block: 0 22px; }

/* ---- app shell ---- */
.rw-app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rw-sidebar { background: var(--navy-900); color: #dbe7f5; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.rw-brand { display: block; background: #fff; border-radius: 14px; padding: 6px; width: 92px; margin: 4px 6px 22px; }
.rw-brand img { display: block; width: 80px; height: auto; }
.rw-sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rw-sidebar a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.rw-sidebar a:hover { background: rgba(255, 255, 255, .07); }
.rw-sidebar a.is-active { background: color-mix(in srgb, var(--turq-500) 22%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--turq-500); }
[dir="rtl"] .rw-sidebar a.is-active { box-shadow: inset -3px 0 0 var(--turq-500); }
.rw-ico { width: 20px; height: 20px; flex: none; fill: currentColor; }
.rw-shell { min-width: 0; display: flex; flex-direction: column; }
.rw-topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: color-mix(in srgb, var(--card) 88%, transparent); border-block-end: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(8px);
}
.rw-topbar-start, .rw-topbar-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rw-user { font-weight: 600; color: var(--muted); padding-inline: 6px; }
.rw-main { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 1360px; width: 100%; margin-inline: auto; }
.rw-main > *, .rw-compare-form > * { min-width: 0; }
.rw-bottomnav { display: none; }

/* ---- Business Day chip, branch picker ---- */
.rw-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--turq-100); color: var(--text); font-size: .9rem; }
.rw-chip-label { color: var(--muted); }
.rw-chip-state { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--card); }
.rw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.rw-chip.is-open .rw-dot { background: var(--positive); box-shadow: 0 0 0 4px color-mix(in srgb, var(--positive) 25%, transparent); }
.rw-picker { position: relative; }
.rw-picker > summary { list-style: none; }
.rw-picker > summary::-webkit-details-marker { display: none; }
.rw-picker-panel {
  position: absolute; inset-inline-start: 0; top: calc(100% + 6px); min-width: 240px; max-height: 320px; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px; z-index: 6;
}
.rw-options { list-style: none; margin: 0; padding: 0; }
.rw-options a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.rw-options a:hover, .rw-options a.is-active { background: var(--turq-100); }
.rw-options a.is-active { font-weight: 700; }

/* ---- page content ---- */
.rw-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.rw-page-head p { margin: 4px 0 0; }
.rw-page-actions { display: flex; align-items: center; gap: 12px; }
.rw-section { display: grid; gap: 14px; }
.rw-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.rw-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rw-kpis-hero { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.rw-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.rw-kpi h2, .rw-kpi h3 { margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.rw-kpi-value { margin: 8px 0 0; font-size: 1.55rem; font-weight: 750; letter-spacing: -.01em; overflow-wrap: anywhere; }
.rw-kpi-value small { color: var(--muted); font-weight: 600; }
.rw-kpi-hero { background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); border-color: transparent; color: #fff; }
.rw-kpi-hero h2, .rw-kpi-hero h3, .rw-kpi-hero .rw-kpi-value small { color: var(--turq-300); }
.rw-kpi-hero .rw-kpi-value { font-size: 2rem; }

.rw-meter { display: grid; gap: 6px; padding-block: 6px; }
.rw-meter-head { display: flex; justify-content: space-between; gap: 12px; }
.rw-meter-track svg { display: block; width: 100%; height: 8px; }
[dir="rtl"] .rw-meter-track svg { transform: scaleX(-1); }
.rw-meter-bg { fill: var(--line); }
.rw-meter-fg { fill: var(--turq-500); }
.rw-list { margin: 0; display: grid; }
.rw-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-block-end: 1px solid var(--line); }
.rw-list > div:last-child { border-block-end: 0; }
.rw-list dt { color: var(--muted); }
.rw-list dd { margin: 0; font-weight: 650; }

.rw-state { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.rw-state p { margin: 0; }
.rw-state-denied { border-style: solid; }

/* ---- Phase C: navigation groups ---- */
.rw-sidebar .rw-subnav { list-style: none; margin: 2px 0 8px; padding-inline-start: 34px; display: none; gap: 0; }
.rw-nav-group:has(> a.is-active) .rw-subnav { display: grid; }
.rw-sidebar .rw-subnav a { padding: 7px 10px; font-weight: 500; font-size: .9rem; color: #b9c9de; }
.rw-sidebar .rw-subnav a.is-active { background: transparent; box-shadow: none; color: #fff; font-weight: 700; }
.rw-sidebar .rw-subnav a.is-active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--turq-500); margin-inline-end: 4px; }

/* ---- tabs, segmented filters, chips ---- */
.rw-tabs { display: flex; gap: 4px; overflow-x: auto; border-block-end: 1px solid var(--line); scrollbar-width: none; }
.rw-tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-block-end: 3px solid transparent; }
.rw-tabs a:hover { color: var(--text); }
.rw-tabs a.is-active { color: var(--text); border-block-end-color: var(--turq-500); }
.rw-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rw-segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.rw-segmented a { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.rw-segmented a.is-active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(11, 31, 58, .12); }
.rw-chip-link { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--turq-100); color: var(--text); text-decoration: none; font-weight: 600; font-size: .86rem; }
.rw-chip-link:hover { background: color-mix(in srgb, var(--turq-500) 30%, var(--card)); }
.rw-note { margin: 0; color: var(--muted); font-size: .9rem; border-inline-start: 3px solid var(--turq-500); padding-inline-start: 10px; }
.rw-crumbs { margin: 0; color: var(--muted); font-size: .9rem; }
.rw-crumbs a { color: var(--muted); }
.rw-section-title { margin-block-start: 6px; }

/* ---- KPI drill-down, grids ---- */
.rw-kpi-link, .rw-tile-link { text-decoration: none; color: inherit; display: block; }
.rw-kpi-link:hover, .rw-tile-link:hover { border-color: var(--turq-500); }
.rw-kpi-hero.rw-kpi-link { color: #fff; }
.rw-kpi-more { display: inline-block; margin-block-start: 10px; font-size: .82rem; font-weight: 600; color: var(--link); }
.rw-kpi-hero .rw-kpi-more { color: var(--turq-300); }
.rw-kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rw-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.rw-explore { display: grid; gap: 6px; align-content: start; }
.rw-explore h2 { margin-block-end: 6px; }
.rw-explore a { padding: 10px 12px; border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.rw-explore a:hover { background: var(--turq-100); }

/* ---- charts (series colours: one palette, readable in both themes) ---- */
.rw-s1 { --c: #14b8c9; } .rw-s2 { --c: #2b4f80; } .rw-s3 { --c: #12a37b; } .rw-s4 { --c: #e8a33c; }
.rw-s5 { --c: #7b61c9; } .rw-s6 { --c: #d64c4c; } .rw-s7 { --c: #5a8f29; } .rw-s8 { --c: #9aa9b3; }
@media (prefers-color-scheme: dark) { .rw-s2 { --c: #6f98d6; } }
.rw-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.rw-donut-wrap { margin: 0; display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 20px; align-items: center; }
.rw-donut-box { position: relative; }
.rw-donut { width: 100%; height: auto; display: block; transform: rotate(0deg); }
.rw-donut-track { fill: none; stroke: var(--line); stroke-width: 5; }
.rw-donut-seg { fill: none; stroke: var(--c); stroke-width: 5; cursor: default; }
.rw-donut-seg:hover, .rw-donut-seg:focus-visible { stroke-width: 6.5; outline: none; }
.rw-donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.rw-donut-center strong { font-size: 1.05rem; }
.rw-donut-center span { font-size: .75rem; color: var(--muted); }
.rw-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rw-legend li { display: flex; align-items: center; gap: 10px; }
.rw-legend-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rw-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rw-bar-row { display: grid; gap: 6px; }
.rw-bar-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rw-bar-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rw-bar-label a { color: var(--text); font-weight: 600; }
/* Channel logos (_ChannelLogo): a fixed box per size; the brand's display size (rw-scale-70…130) only changes
   the inset of the image inside it, so rows never shift. No logo, or a failed image, shows the initial. */
.rw-logo { --box: 28px; --inset: .115; inline-size: var(--box); block-size: var(--box); box-sizing: border-box; padding: calc(2px + var(--box) * var(--inset)); object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); flex: none; }
.rw-logo-sm { --box: 28px; }
.rw-logo-lg { --box: 44px; border-radius: 10px; }
.rw-logo-xl { --box: 72px; border-radius: 14px; }
.rw-scale-70 { --inset: .23; } .rw-scale-80 { --inset: .19; } .rw-scale-90 { --inset: .15; } .rw-scale-100 { --inset: .115; }
.rw-scale-110 { --inset: .077; } .rw-scale-120 { --inset: .04; } .rw-scale-130 { --inset: 0; }
.rw-logo-empty { display: inline-grid; place-items: center; padding: 0; background: var(--surface); border-style: dashed; color: var(--muted); font-weight: 700; font-size: calc(var(--box) * .42); line-height: 1; }
.rw-bar { display: block; width: 100%; height: 8px; }
[dir="rtl"] .rw-bar { transform: scaleX(-1); }
.rw-bar-bg { fill: var(--line); }
.rw-bar-fg { fill: var(--c, var(--turq-500)); }

/* ---- tables ---- */
.rw-table-wrap { overflow-x: auto; margin-inline: -4px; }
.rw-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rw-table th, .rw-table td { padding: 10px 8px; border-block-end: 1px solid var(--line); text-align: start; vertical-align: middle; }
.rw-table thead th { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rw-table thead th a { color: inherit; text-decoration: none; }
.rw-table thead th.is-sorted a { color: var(--text); }
.rw-table thead th.is-sorted a::after { content: " ↓"; }
.rw-table tbody th { font-weight: 600; }
.rw-table tbody th a { color: var(--text); }
.rw-num { text-align: end !important; white-space: nowrap; }
.rw-share-col { min-width: 140px; }
.rw-share-col .rw-bar { margin-block-end: 2px; }

/* ---- comparison ---- */
.rw-compare-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 22px; align-items: end; }
.rw-compare-form select { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.rw-range { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; min-inline-size: 0; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.rw-range legend { font-weight: 700; padding-inline: 4px; }
.rw-compare-actions, .rw-presets { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rw-compare-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rw-delta-card p { margin: 6px 0 0; }
.rw-delta { font-weight: 700; }
.rw-delta.is-up { color: var(--ok-text); }
.rw-delta.is-down { color: var(--bad-text); }
.rw-delta.is-flat { color: var(--muted); }
.rw-delta.is-up::before { content: "▲ "; } .rw-delta.is-down::before { content: "▼ "; }
.rw-ranges { margin: 0; }
.rw-alert-warn { background: color-mix(in srgb, var(--warning) 14%, var(--card)); color: var(--text); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); }
.rw-coverage summary, .rw-lazy-section summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; font-weight: 650; }
.rw-coverage summary::-webkit-details-marker, .rw-lazy-section summary::-webkit-details-marker { display: none; }
.rw-lazy-section summary h2, .rw-lazy-section summary h3 { font-size: 1rem; }
.rw-lazy-section summary::after, .rw-coverage summary::after { content: "+"; font-weight: 700; color: var(--turq-600); }
.rw-lazy-section[open] summary::after, .rw-coverage[open] summary::after { content: "−"; }
.rw-lazy-body { margin-block-start: 16px; }
.rw-lazy-section[open] summary .rw-muted { display: none; }

/* ---- health ---- */
.rw-health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.rw-health header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-block-end: 6px; }
.rw-health h2 { font-size: 1.05rem; color: var(--text); }
.rw-health.is-bad { border-inline-start: 4px solid var(--negative); }
.rw-health.is-warn { border-inline-start: 4px solid var(--warning); }
.rw-health.is-ok { border-inline-start: 4px solid var(--positive); }
.rw-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface); color: var(--muted); }
.rw-pill.is-ok { background: color-mix(in srgb, var(--positive) 16%, var(--card)); color: var(--ok-text); }
.rw-pill.is-warn { background: color-mix(in srgb, var(--warning) 20%, var(--card)); color: var(--warn-text); }
.rw-pill.is-bad { background: color-mix(in srgb, var(--negative) 16%, var(--card)); color: var(--bad-text); }

/* ---- tablet ---- */
/* ---- Phase D: forms, commands, operations, communication, AI ---- */
/* Text from the API (any language) keeps its own direction but follows the page alignment. */
html[dir="rtl"] [dir="auto"] { text-align: right; }
html[dir="ltr"] [dir="auto"] { text-align: left; }
.rw-alert-text strong { display: block; }
.rw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rw-form { display: grid; gap: 4px; margin-block-end: 20px; max-width: 760px; }
.rw-form h2 { margin-block-end: 12px; }
.rw-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0 16px; }
.rw-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 8px; }
.rw-check { display: flex; align-items: flex-start; gap: 10px; margin-block-end: 12px; cursor: pointer; }
.rw-check input, .rw-choice input { inline-size: 18px; block-size: 18px; margin: 2px 0 0; accent-color: var(--turq-600); flex: none; }
.rw-choice { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 12px; margin: 0 0 16px; display: grid; gap: 8px; }
.rw-choice legend { font-weight: 600; font-size: .92rem; padding-inline: 4px; }
.rw-choice label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.rw-choice > p { margin: 6px 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.rw-recipients { max-block-size: 260px; overflow-y: auto; }
.rw-review { background: var(--turq-100); border-inline-start: 4px solid var(--turq-500); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 12px; font-weight: 600; }
.rw-danger-zone { border-color: color-mix(in srgb, var(--negative) 40%, var(--line)); }
.rw-danger-zone .rw-review { background: color-mix(in srgb, var(--negative) 10%, var(--card)); border-inline-start-color: var(--negative); }
.rw-btn-danger { background: #b0302e; border-color: #b0302e; color: #fff; }
.rw-btn-danger:hover { background: #b83c3c; border-color: #b83c3c; }
.rw-btn[disabled], .rw-btn:disabled { opacity: .6; cursor: progress; }
.rw-alert-ok { background: color-mix(in srgb, var(--positive) 12%, var(--card)); color: var(--ok-text); border: 1px solid color-mix(in srgb, var(--positive) 35%, transparent); }
.rw-pill.is-pending { background: color-mix(in srgb, var(--turq-500) 16%, var(--card)); color: var(--link); }
.rw-pill.is-none { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.rw-cmd-error { display: block; margin-block-start: 4px; color: var(--bad-text); }
.rw-warn-text { color: var(--warn-text); }
.rw-status-card { max-width: 760px; display: grid; gap: 14px; }
.rw-status-card h1 { font-size: 1.3rem; }
.rw-status-card p { margin: 0; }
.rw-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 12px; }
.rw-count { display: inline-block; min-width: 26px; padding: 0 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .78rem; text-align: center; vertical-align: middle; }
.rw-filter { min-height: 40px; min-width: 0; inline-size: min(260px, 100%); }
.rw-inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.rw-inline-form input { min-height: 40px; }
.rw-actions { text-align: end; white-space: nowrap; }
.rw-actions > * + * { margin-inline-start: 12px; }
.rw-link { background: none; border: 0; padding: 0; color: var(--turq-600); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; color: var(--link); }
.rw-pager { display: flex; justify-content: center; gap: 10px; margin-block: 16px; }
.rw-table tr.is-highlight > * { background: var(--turq-100); }
.rw-table-branches tbody th { white-space: nowrap; }
.rw-lazy-placeholder { margin: 0; }
.rw-state-empty { border-style: dashed; }
.rw-steps { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 8px; }
.rw-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rw-target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.rw-target { display: grid; gap: 10px; align-content: start; }
.rw-target header, .rw-target footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rw-target footer { font-size: .85rem; }
.rw-target .rw-kpi-value { margin: 0; }
.rw-messages, .rw-alerts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.rw-message { padding: 0; }
.rw-message > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; }
.rw-message > summary::-webkit-details-marker { display: none; }
.rw-message.is-unread { border-inline-start: 4px solid var(--turq-500); }
.rw-message-head { display: grid; gap: 2px; min-width: 0; }
.rw-message-body { padding: 0 18px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rw-message > .rw-form-actions, .rw-message > p { margin: 0; padding: 0 18px 14px; }
.rw-message form { margin: 0; }
.rw-alert-item { display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr auto; align-items: start; gap: 12px; padding: 14px 18px; }
.rw-alert-item.is-unread { border-inline-start: 4px solid var(--turq-500); }
.rw-alert-text p { margin: 2px 0 4px; }
.rw-alert-item > .rw-pill { justify-self: start; }
.rw-alert-item form { margin: 0; }
/* Settings › Channel logos: one row per channel, and the logo picker. */
.rw-channel-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.rw-channel-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0; }
.rw-channel-main { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.rw-channel-row .rw-btn { flex: none; }
.rw-logo-current { display: flex; align-items: center; gap: 18px; }
.rw-logo-current h1 { margin: 2px 0; font-size: 1.4rem; overflow-wrap: anywhere; }
.rw-logo-current p { margin: 0; }
.rw-logo-picker { border: 0; margin: 12px 0; padding: 0; min-inline-size: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.rw-logo-option { position: relative; display: grid; justify-items: center; gap: 8px; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: center; overflow-wrap: anywhere; }
.rw-logo-option input { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; margin: 0; accent-color: var(--turq-500); }
.rw-logo-option:has(input:checked) { border-color: var(--turq-500); box-shadow: 0 0 0 2px color-mix(in srgb, var(--turq-500) 35%, transparent); }
.rw-logo-option:has(input:focus-visible) { outline: 2px solid var(--turq-500); outline-offset: 2px; }
.rw-logo-form .rw-field { display: grid; gap: 6px; max-inline-size: 360px; }
.rw-logo-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-block-end: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); }
.rw-logo-preview > .rw-muted { flex-basis: 100%; font-size: .88rem; }
.rw-ai { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.rw-ai-list { display: grid; gap: 4px; max-block-size: 70vh; overflow-y: auto; }
.rw-ai-list h2 { margin-block-end: 8px; }
.rw-ai-list a { display: grid; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.rw-ai-list a:hover, .rw-ai-list a.is-active { background: var(--turq-100); }
.rw-ai-chat { display: grid; gap: 14px; min-block-size: 320px; align-content: space-between; }
.rw-chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rw-bubble { max-inline-size: 82%; padding: 10px 14px; border-radius: 16px; display: grid; gap: 4px; }
.rw-bubble.is-user { justify-self: end; background: var(--navy-800); color: #fff; border-end-end-radius: 4px; }
.rw-bubble.is-user .rw-muted { color: #c7d6ea; }
.rw-bubble.is-assistant { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 4px; }
.rw-bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.rw-ask { display: flex; gap: 10px; align-items: flex-end; border-block-start: 1px solid var(--line); padding-block-start: 14px; }
.rw-ask .rw-field { flex: 1; margin: 0; }

/* ---- UX refresh: headers, panels, toolbars, settings, menu prices, void flow ---- */
.rw-eyebrow { margin: 0 0 4px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
[lang="ar"] .rw-eyebrow { letter-spacing: 0; text-transform: none; font-size: .82rem; }
.rw-block { display: block; }
.rw-bad-text { color: var(--bad-text); }
.rw-subhead { font-size: 1rem; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.rw-table thead th { background: color-mix(in srgb, var(--surface) 70%, var(--card)); }
.rw-table tbody tr:hover > * { background: color-mix(in srgb, var(--turq-100) 45%, var(--card)); }
.rw-table-sticky thead th { position: sticky; top: 0; z-index: 1; }
.rw-table-wrap:has(.rw-table-sticky) { max-block-size: 70vh; overflow: auto; }

/* Commands switched off: one calm explanation */
.rw-off { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin: 0; padding: 18px 20px;
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--navy-500) 25%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--navy-500) 8%, var(--card)), var(--card)); }
.rw-off-ico { inline-size: 40px; block-size: 40px; padding: 9px; border-radius: 12px; background: var(--navy-800); fill: var(--turq-300); }
.rw-off h2 { font-size: 1.02rem; margin-block-end: 4px; color: var(--text); }
.rw-off p { margin: 0 0 8px; }
.rw-off-list { margin: 0 0 8px; padding-inline-start: 18px; display: grid; gap: 4px; font-weight: 600; }

/* Toolbars and chips over lists already on the page */
.rw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-end: 14px; }
.rw-search { flex: 1 1 240px; display: flex; }
.rw-search input, .rw-select select { min-height: 42px; inline-size: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.rw-search input:focus, .rw-select select:focus { border-color: var(--turq-500); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--turq-500) 30%, transparent); }
.rw-select { flex: 0 1 220px; }
.rw-chipset { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rw-chip-btn { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.rw-chip-btn span { font-size: .76rem; color: var(--muted); }
.rw-chip-btn[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.rw-chip-btn[aria-pressed="true"] span { color: var(--turq-300); }
.rw-shown { margin: 0; margin-inline-start: auto; font-size: .84rem; }
.rw-chip-static { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .86rem; }

/* Menu prices */
.rw-branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.rw-branch-card { display: grid; gap: 4px; text-decoration: none; color: var(--text); padding: 16px 18px; }
.rw-branch-card:hover { border-color: var(--turq-500); }
.rw-table tr.is-zero > th, .rw-table tr.is-zero > td { background: color-mix(in srgb, var(--negative) 7%, var(--card)); }
.rw-table tr.is-check > th, .rw-table tr.is-check > td { background: color-mix(in srgb, var(--warning) 9%, var(--card)); }

/* Void flow */
.rw-steps-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rw-steps-bar li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); }
.rw-steps-bar li small { display: block; color: var(--muted); font-size: .8rem; }
.rw-steps-bar li.is-current { border-color: var(--turq-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--turq-500) 20%, transparent); }
.rw-steps-bar li.is-done .rw-step-no { background: var(--positive); color: #fff; }
.rw-steps-bar.is-off li { background: var(--surface); border-style: dashed; box-shadow: none; }
.rw-steps-bar.is-off .rw-step-no { background: transparent; }
.rw-step-no { flex: none; display: inline-grid; place-items: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .84rem; }
.rw-steps-bar li.is-current .rw-step-no { background: var(--turq-500); border-color: var(--turq-500); color: #04222a; }
.rw-step-card h2 { display: flex; align-items: center; gap: 10px; }

/* Settings */
.rw-settings { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.rw-settings-nav { display: grid; gap: 4px; position: sticky; top: 16px; }
.rw-settings-nav a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.rw-settings-nav a .rw-ico { flex: none; margin-block-start: 2px; fill: var(--muted); }
.rw-settings-nav a strong { display: block; font-size: .95rem; }
.rw-settings-nav a small { display: block; color: var(--muted); font-size: .8rem; }
.rw-settings-nav a:hover { background: var(--card); border-color: var(--line); }
.rw-settings-nav a.is-active { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.rw-settings-nav a.is-active .rw-ico { fill: var(--turq-600); }
.rw-settings-body { display: grid; gap: 16px; align-content: start; min-width: 0; }
.rw-settings-body > * { margin-block: 0; }
.rw-settings-body .rw-section-head { margin-block: 8px 0; }
.rw-settings-body .rw-subhead { margin: 0; }
.rw-settings-body .rw-tiles, .rw-settings-body .rw-modules { margin: 0; }
.rw-settings-head { margin-block-end: 0; }
.rw-settings-head h2 { font-size: 1.25rem; color: var(--text); }
.rw-settings-head p { margin: 4px 0 0; }
.rw-avatar { flex: none; display: inline-grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 50%; background: var(--navy-800); color: var(--turq-300); font-weight: 700; font-size: .9rem; }
.rw-avatar-lg { inline-size: 64px; block-size: 64px; font-size: 1.4rem; }
.rw-profile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-block-end: 16px; }
.rw-profile-main { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.rw-profile-main h2 { font-size: 1.25rem; color: var(--text); }
.rw-profile-main p { margin: 0; }
.rw-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block-end: 16px; }
.rw-legend-inline { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; font-size: .84rem; color: var(--muted); }
.rw-legend-inline li { display: inline-flex; align-items: center; gap: 6px; }
.rw-cap-dot { display: inline-block; inline-size: 9px; block-size: 9px; border-radius: 50%; flex: none; }
.rw-cap-dot.is-view { background: var(--navy-500); }
.rw-cap-dot.is-manage { background: var(--turq-500); }
.rw-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-block-end: 16px; }
.rw-module header { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; }
.rw-module header h3 { flex: 1; font-size: 1rem; }
.rw-module header .rw-ico { fill: var(--turq-600); }
.rw-module ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rw-cap { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; }
.rw-cap .rw-cap-dot { transform: translateY(-1px); }
.rw-where { grid-column: 2; color: var(--muted); font-size: .78rem; }
.rw-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; margin-block-end: 16px; }
.rw-tile { display: grid; gap: 10px; align-content: start; }
.rw-tile header { display: flex; gap: 12px; align-items: center; }
.rw-tile header > div { display: grid; gap: 4px; justify-items: start; }
.rw-tile h3 { font-size: 1rem; }
.rw-tile.is-active { border-color: var(--turq-500); }
.rw-tile-figures { margin: 0; display: flex; gap: 18px; color: var(--muted); font-size: .88rem; }
.rw-tile-figures strong { color: var(--text); font-size: 1.05rem; }
.rw-person { display: flex; align-items: center; gap: 10px; }
.rw-person > span:last-child { display: grid; }

@media (max-width: 1279px) {
  .rw-settings { grid-template-columns: 220px minmax(0, 1fr); }
  .rw-steps-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-app { grid-template-columns: 76px 1fr; }
  .rw-sidebar { padding: 14px 10px; }
  .rw-brand { width: 56px; margin-inline: auto; }
  .rw-brand img { width: 44px; }
  .rw-sidebar a span:not(.rw-ico) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rw-sidebar a { justify-content: center; }
  .rw-kpis-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-sidebar .rw-subnav { display: none !important; }
  .rw-grid-3 { grid-template-columns: 1fr 1fr; }
  .rw-compare-form { grid-template-columns: 1fr 1fr; }
  .rw-compare-form .rw-field-wide { grid-column: 1 / -1; }
  .rw-compare-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- mobile ---- */
@media (max-width: 767px) {
  .rw-settings { grid-template-columns: 1fr; gap: 14px; }
  .rw-settings-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-block-end: 4px; scrollbar-width: none; }
  .rw-settings-nav::-webkit-scrollbar { display: none; }
  .rw-settings-nav a { flex: none; padding: 8px 12px; border-color: var(--line); background: var(--card); }
  .rw-settings-nav a small { display: none; }
  .rw-steps-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-kpis.rw-kpis-3 { grid-template-columns: 1fr; gap: 8px; }
  .rw-kpis-3 .rw-kpi { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
  .rw-kpis-3 .rw-kpi-value { font-size: 1.3rem; margin: 0; }
  .rw-shown { inline-size: 100%; margin-inline-start: 0; }
  .rw-select { flex: 1 1 100%; }
  .rw-ai { grid-template-columns: 1fr; }
  .rw-ai-list { max-block-size: 220px; }
  .rw-bubble { max-inline-size: 94%; }
  .rw-ask { flex-direction: column; align-items: stretch; }
  .rw-alert-item { grid-template-columns: 1fr; }
  .rw-page-actions { flex-wrap: wrap; }
  .rw-filter { inline-size: 100%; }
  body { font-size: 14.5px; }
  .rw-app { display: block; padding-block-end: 72px; }
  .rw-sidebar { display: none; }
  .rw-topbar { padding: 10px 16px; gap: 8px; position: static; }
  .rw-user { display: none; }
  .rw-topbar-end { margin-inline-start: auto; }
  .rw-main { padding: 16px; gap: 16px; }
  .rw-grid-2, .rw-kpis, .rw-kpis-hero { grid-template-columns: 1fr 1fr; }
  .rw-grid-2 { grid-template-columns: 1fr; }
  .rw-kpi-hero { grid-column: 1 / -1; }
  .rw-kpi-value { font-size: 1.25rem; }
  .rw-kpi-hero .rw-kpi-value { font-size: 1.7rem; }
  .rw-login { grid-template-columns: 1fr; border-radius: 16px; }
  .rw-login-brand { padding: 28px 20px; }
  .rw-login-brand img { width: 110px; }
  .rw-login-card { padding: 24px 20px; }
  .rw-bottomnav {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 7; justify-content: space-around;
    background: var(--navy-900); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .rw-bottomnav a { display: grid; justify-items: center; gap: 2px; color: #c7d6ea; text-decoration: none; font-size: .75rem; padding: 6px 12px; border-radius: 10px; min-width: 64px; }
  .rw-bottomnav a.is-active { color: #fff; background: color-mix(in srgb, var(--turq-500) 25%, transparent); }
  .rw-picker-panel { position: fixed; inset-inline: 12px; top: auto; bottom: 84px; }
  .rw-grid-3, .rw-compare-form { grid-template-columns: 1fr; }
  .rw-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .rw-donut-box { width: 200px; }
  .rw-legend { width: 100%; }
  .rw-filters { width: 100%; }
  .rw-segmented { width: 100%; }
  .rw-segmented a { flex: 1; text-align: center; padding-inline: 6px; }
  .rw-table { font-size: .86rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .rw-btn, .rw-sidebar a, .rw-options a { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
}

/* ---- print: content only, no navigation or controls ---- */
@media print {
  :root { --surface: #fff; --card: #fff; --shadow: none; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 12px; }
  .rw-sidebar, .rw-topbar, .rw-bottomnav, .rw-skip, .rw-preview, .rw-page-actions, .rw-filters, .rw-filter,
  .rw-tabs, .rw-btn, form, .rw-pager, .rw-lazy-section:not([open]) { display: none !important; }
  .rw-app { display: block; }
  .rw-main { padding: 0; }
  .rw-card, .rw-kpi { box-shadow: none; break-inside: avoid; }
  .rw-table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

/* =====================================================================================================
   Mobile app shell (phones, < 768 px). Desktop rules above are unchanged.
   App bar + context row + bottom sheets + bottom navigation; tables become cards; sticky form actions.
   ===================================================================================================== */
.rw-appbar, .rw-mobile-only { display: none; }
.rw-sheet > summary { list-style: none; cursor: pointer; }
.rw-sheet > summary::-webkit-details-marker { display: none; }
.rw-icon-btn { display: inline-grid; place-items: center; min-inline-size: 44px; min-block-size: 44px; border-radius: 50%; }
.rw-avatar-sm { inline-size: 34px; block-size: 34px; font-size: .78rem; }
.rw-btn-block { inline-size: 100%; justify-content: center; }
.rw-sheet-grip { inline-size: 40px; block-size: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 14px; }
.rw-sheet-title { font-size: 1.05rem; margin-block-end: 12px; color: var(--text); }
.rw-sheet-label { margin: 14px 0 8px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
[lang="ar"] .rw-sheet-label { text-transform: none; letter-spacing: 0; font-size: .86rem; }
.rw-sheet-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rw-sheet-options a { display: grid; place-items: center; min-height: 46px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; text-align: center; }
.rw-sheet-options a.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.rw-sheet-branches .rw-options a { min-height: 48px; display: flex; align-items: center; }
.rw-sheet-profile { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; border-block-end: 1px solid var(--line); }
.rw-sheet-profile > span:last-child { display: grid; min-width: 0; }
.rw-sheet-list { display: grid; padding-block: 8px; }
.rw-sheet-list a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 6px; color: var(--text); text-decoration: none; font-weight: 600; border-radius: 12px; }
.rw-sheet-list a .rw-ico { fill: var(--muted); }
.rw-sheet-list a:hover { background: var(--surface); }
.rw-sheet-signout { margin: 6px 0 0; }
.rw-filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; color: var(--text); max-inline-size: 100%; }
.rw-filter-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-filter-chip .rw-ico { inline-size: 18px; block-size: 18px; fill: var(--link); flex: none; }
.rw-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rw-quick a { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.rw-quick a .rw-ico { flex: none; inline-size: 34px; block-size: 34px; padding: 7px; border-radius: 10px; background: var(--turq-100); fill: var(--link); }
.rw-comms-tabs { margin-block-end: 0; }
.rw-more-groups { display: grid; gap: 18px; }
.rw-more-group h2 { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 4px 8px; }
[lang="ar"] .rw-more-group h2 { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.rw-more-group ul { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rw-more-group li + li { border-block-start: 1px solid var(--line); }
.rw-more-group a, .rw-more-group button { display: flex; align-items: center; gap: 14px; inline-size: 100%; min-height: 60px; padding: 10px 16px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: start; }
.rw-more-group a > span, .rw-more-group button > span { display: grid; flex: 1; min-width: 0; }
.rw-more-group small { color: var(--muted); font-size: .8rem; }
.rw-more-group .rw-ico { flex: none; inline-size: 36px; block-size: 36px; padding: 8px; border-radius: 10px; background: var(--turq-100); fill: var(--link); }
.rw-chev { color: var(--muted); font-size: 1.2rem; }
.rw-more-group a > span.rw-chev { flex: none; display: inline; }
[dir="rtl"] .rw-chev { transform: scaleX(-1); }
.rw-settings-back { display: none; }

@media (max-width: 767px) {
  .rw-channel-row { flex-wrap: wrap; }
  .rw-channel-row .rw-btn { margin-inline-start: auto; }
  .rw-desktop-only { display: none !important; }
  .rw-mobile-only { display: block; }
  details.rw-mobile-only { display: block; }
  body { background: var(--surface); }

  /* App bar */
  .rw-appbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; min-height: 56px;
    padding: env(safe-area-inset-top) 10px 0 12px; background: var(--card);
    border-block-end: 1px solid var(--line); }   /* no backdrop-filter: it would trap the fixed bottom sheets inside the bar */
  .rw-appbar-mark img { display: block; inline-size: 32px; block-size: 32px; border-radius: 9px; }
  .rw-appbar-title { flex: 1; min-width: 0; margin: 0; font-weight: 700; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Context row (period, branch, Business Day) */
  .rw-topbar { position: static; display: block; min-height: 0; padding: 10px 12px 0; background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; z-index: auto; }
  .rw-topbar:not(:has(.rw-topbar-start > *)) { display: none; }
  .rw-topbar-end { display: none; }
  .rw-topbar-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .rw-topbar-start .rw-chip { min-height: 40px; padding: 4px 12px; font-size: .84rem; }
  .rw-topbar-start .rw-chip-label { display: none; }
  .rw-topbar-start .rw-segmented { inline-size: 100%; overflow-x: auto; scrollbar-width: none; }
  .rw-main { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); gap: 16px; }
  .rw-main > *, .rw-main .rw-card, .rw-main .rw-section, .rw-main .rw-card > *, .rw-main .rw-section > *, .rw-grid-2 > *, .rw-grid-3 > *, .rw-table-wrap { min-width: 0; }
  .rw-table:not(.rw-keep) thead:has(a) { max-inline-size: 100%; overflow: hidden; }
  .rw-table:not(.rw-keep) thead:has(a) tr { max-inline-size: 100%; }   /* grid items may shrink: nothing pushes the page wider than the phone */
  .rw-shell { min-width: 0; }
  .rw-main { grid-template-columns: minmax(0, 1fr); }
  .rw-field, .rw-field > *, .rw-form-grid > *, .rw-compare-form > * { min-width: 0; }
  .rw-field input, .rw-field select, .rw-field textarea { max-inline-size: 100%; inline-size: 100%; }
  .rw-compare-form { grid-template-columns: minmax(0, 1fr); }

  /* Page heads: the app bar carries the title */
  .rw-page-head { align-items: flex-start; gap: 10px; }
  .rw-page-head h1 { font-size: 1.32rem; }
  .rw-page-head .rw-eyebrow { display: none; }
  .rw-page-actions { gap: 8px; inline-size: 100%; }
  .rw-page-actions .rw-btn { min-height: 38px; padding: 0 12px; font-size: .86rem; border-radius: 999px; }
  .rw-crumbs { font-size: .86rem; }

  /* Bottom sheets */
  .rw-sheet[open]::before { content: ""; position: fixed; inset: 0; z-index: 1000; background: rgba(8, 19, 31, .48); }
  .rw-sheet[open] > .rw-sheet-panel, .rw-picker[open] > .rw-picker-panel {
    position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 1001; max-block-size: 82vh; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--card); color: var(--text);
    border-radius: 22px 22px 0 0; border: 0; box-shadow: 0 -10px 40px rgba(8, 19, 31, .28); inline-size: auto; }
  .rw-picker[open]::before { content: ""; position: fixed; inset: 0; z-index: 1000; background: rgba(8, 19, 31, .48); }
  @media (prefers-reduced-motion: no-preference) {
    .rw-sheet[open] > .rw-sheet-panel, .rw-picker[open] > .rw-picker-panel { animation: rw-sheet-in .18s ease-out; }
  }

  /* Bottom navigation */
  .rw-bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .rw-bottomnav a { min-width: 0; min-height: 54px; padding: 6px 2px; gap: 3px; font-size: .7rem; border-radius: 14px; }
  .rw-bottomnav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-inline-size: 100%; }

  /* KPIs: one hero, then two columns */
  .rw-kpis, .rw-kpis-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rw-kpis > .rw-kpi-hero, .rw-kpis-hero > .rw-kpi:first-child { grid-column: 1 / -1; }
  .rw-kpis > .rw-kpi-hero:first-child:nth-last-child(4) + .rw-kpi { grid-column: 1 / -1; }   /* hero + 3: pair the last two */
  .rw-kpi { padding: 14px; border-radius: 16px; }
  .rw-kpi-value { font-size: clamp(1.1rem, 5vw, 1.45rem); overflow-wrap: anywhere; }
  .rw-kpi-hero .rw-kpi-value { font-size: clamp(1.7rem, 8.4vw, 2.3rem); }
  .rw-kpi-value small { font-size: .62em; }

  /* Tables become cards (labels copied from the header by rasd-web.js; no data is dropped) */
  .rw-table-wrap, .rw-table-wrap:has(.rw-table-sticky) { overflow: visible; max-block-size: none; }
  /* Item lists: name and price on one line, category as a subtitle, empty checks hidden */
  .rw-table.rw-cards-compact:not(.rw-keep) tbody tr { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 12px 16px; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody th { grid-column: 1; margin: 0; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td { grid-column: 1 / -1; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-num { grid-column: 2; grid-row: 1; font-weight: 700; font-size: 1.05rem; min-height: 0; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-num::before, .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-cat::before { content: none; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-cat { justify-content: flex-start; color: var(--muted); font-size: .86rem; min-height: 0; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-flagcell:has(> .rw-muted:only-child) { display: none; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-flagcell::before { content: none; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-flagcell { justify-content: flex-start; }
  .rw-table.rw-cards-compact:not(.rw-keep) tbody td.rw-actions { justify-content: flex-start; }
  .rw-card:has(> .rw-table-wrap), .rw-table-wrap.rw-card { padding: 0; background: transparent; border: 0; box-shadow: none; }
  .rw-table:not(.rw-keep) { display: block; font-size: .92rem; }
  .rw-table:not(.rw-keep) thead { display: none; }
  .rw-table:not(.rw-keep) thead:has(a) { display: block; margin-block-end: 8px; }
  .rw-table:not(.rw-keep) thead:has(a) tr { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .rw-table:not(.rw-keep) thead:has(a) th { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--card); }
  .rw-table:not(.rw-keep) thead:has(a) th:not(:has(a)) { display: none; }
  .rw-table:not(.rw-keep) { inline-size: 100%; max-inline-size: 100%; }
  .rw-table:not(.rw-keep) tbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; inline-size: 100%; }
  .rw-table:not(.rw-keep) tbody td > * { min-width: 0; }
  .rw-table:not(.rw-keep) .rw-share-col { min-width: 0; }
  .rw-table:not(.rw-keep) tbody td.rw-share-col { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; }
  .rw-table:not(.rw-keep) tbody td.rw-share-col .rw-bar { grid-column: 2; align-self: center; inline-size: 100%; }
  .rw-table:not(.rw-keep) tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
  .rw-table:not(.rw-keep) tbody tr[hidden] { display: none; }
  .rw-table:not(.rw-keep) tbody tr > * { background: transparent !important; border: 0; padding: 0; }
  .rw-table:not(.rw-keep) tbody th { font-size: 1rem; font-weight: 700; margin-block-end: 4px; white-space: normal; }
  .rw-table:not(.rw-keep) tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 26px; text-align: end; }
  .rw-table:not(.rw-keep) tbody td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 500; text-align: start; flex: none; max-inline-size: 55%; }
  .rw-table:not(.rw-keep) tbody td:not([data-label])::before, .rw-table:not(.rw-keep) tbody td[data-label=""]::before { content: none; }
  .rw-table:not(.rw-keep) tbody td.rw-actions { justify-content: flex-end; }
  .rw-table:not(.rw-keep) tbody td { flex-wrap: wrap; }
  .rw-table:not(.rw-keep) tbody td::before { margin-inline-end: auto; }
  .rw-table:not(.rw-keep) tbody td .rw-block { flex-basis: 100%; text-align: end; }
  .rw-table:not(.rw-keep) tbody td.rw-share-col { display: grid; }
  .rw-table:not(.rw-keep) tbody tr.is-zero { border-color: color-mix(in srgb, var(--negative) 40%, var(--line)); background: color-mix(in srgb, var(--negative) 5%, var(--card)); }
  .rw-table:not(.rw-keep) tbody tr.is-check { border-color: color-mix(in srgb, var(--warning) 50%, var(--line)); background: color-mix(in srgb, var(--warning) 6%, var(--card)); }
  .rw-table:not(.rw-keep) tfoot { display: block; margin-block-start: 8px; }
  .rw-table:not(.rw-keep) tfoot tr { display: flex; justify-content: space-between; padding: 12px 16px; border-radius: 14px; background: var(--navy-800); color: #fff; }
  .rw-table:not(.rw-keep) tfoot :is(th, td) { border: 0; padding: 0; color: inherit; }

  /* Forms: actions stay reachable above the bottom navigation */
  .rw-form { max-inline-size: none; }
  .rw-form .rw-form-actions { position: sticky; inset-block-end: calc(76px + env(safe-area-inset-bottom)); z-index: 6; margin: 8px -20px -20px; padding: 12px 20px; background: color-mix(in srgb, var(--card) 96%, transparent); border-block-start: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .rw-form .rw-form-actions .rw-btn { flex: 1; justify-content: center; min-height: 46px; }
  .rw-form.rw-danger-zone .rw-form-actions { position: static; }   /* a second, short form on the page: only the main action bar sticks */
  .rw-field input, .rw-field select, .rw-field textarea { font-size: 16px; }   /* no iOS zoom on focus */
  .rw-search input, .rw-select select { font-size: 16px; min-height: 46px; }

  /* Toolbars */
  .rw-toolbar { gap: 8px; }
  .rw-search, .rw-select { flex: 1 1 100%; }
  .rw-chipset { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; inline-size: 100%; }
  .rw-chip-btn { min-height: 40px; }

  /* Void steps: a compact progress bar */
  .rw-steps-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .rw-steps-bar li { flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 8px 4px; }
  .rw-steps-bar li strong { font-size: .72rem; line-height: 1.25; }
  .rw-steps-bar li small { display: none; }

  /* Settings: list, then detail */
  .rw-settings.is-root .rw-settings-nav { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 0; }
  .rw-settings.is-root .rw-settings-nav a { min-height: 64px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .rw-settings.is-root .rw-settings-nav a + a { border-block-start: 1px solid var(--line); }
  .rw-settings.is-root .rw-settings-nav a small { display: block; }
  .rw-settings.is-root .rw-settings-nav a.is-active { background: none; }
  .rw-settings.is-root .rw-settings-body > :not(.rw-profile) { display: none; }
  .rw-settings.is-root { display: flex; flex-direction: column-reverse; }
  .rw-settings.is-root > *, .rw-settings-body > .rw-profile { inline-size: 100%; }
  .rw-settings.is-root .rw-settings-nav a { align-items: center; }
  .rw-settings.is-root .rw-settings-nav a::after { content: "›"; margin-inline-start: auto; color: var(--muted); font-size: 1.2rem; }
  [dir="rtl"] .rw-settings.is-root .rw-settings-nav a::after { content: "‹"; }
  .rw-settings.is-detail .rw-settings-nav { display: none; }
  .rw-settings.is-detail .rw-settings-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 600; text-decoration: none; }
  .rw-profile { padding: 16px; }
  .rw-profile-actions { inline-size: 100%; }
  .rw-profile-actions .rw-btn { inline-size: 100%; justify-content: center; }

  /* Charts and lists */
  .rw-donut-wrap { gap: 16px; }
  .rw-legend li { min-height: 36px; }
  .rw-list > div { min-height: 40px; }
  .rw-card { padding: 16px; border-radius: 16px; }
  .rw-off { padding: 14px; gap: 12px; }
  .rw-off-ico { inline-size: 34px; block-size: 34px; padding: 7px; }
}
@media (max-width: 359px) {
  .rw-main { padding-inline: 8px; }
  .rw-kpis, .rw-kpis-hero, .rw-quick { grid-template-columns: minmax(0, 1fr); }
  .rw-bottomnav a span { font-size: .64rem; }
  .rw-sheet-options { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 768px) { .rw-mobile-only { display: none !important; } }
@keyframes rw-sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media print { .rw-appbar, .rw-mobile-only { display: none !important; } }
