/* ====================================================================
   NOORVEST INSTITUTIONAL ADVISOR PLATFORM — STYLES
   Follows the NoorVest Design System (https://claude.ai/artifact/BP674Y4zgQ3eVtqmWM4kNM).
   Tokens live in css/tokens.css (transcribed from the system's tokens.json);
   this file maps the advisor app's existing classes onto them.

   Rules kept here (see DESIGN.md):
   - Manrope only. Product body 500, tabular figures.
   - Porcelain page, white cards with a Cloud hairline, 16px card radius, no resting shadow.
   - Pill buttons. One lime (.btn-accent) button per screen: the single next step.
     .btn-primary is black; row actions are secondary.
   - Inputs 12px radius. Status pills: the word carries the meaning, colour supports it.
   ==================================================================== */

@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

/* ---- Legacy aliases ------------------------------------------------
   The screens are built by JS with inline styles that read these names.
   They now resolve to design-system tokens, so every screen picks up the
   system without rewriting its markup. New code should use the
   design-system names directly. */
:root{
  --nv-green:        var(--noor-lime);              /* marks, fills, checked controls */
  --nv-green-deep:   var(--status-positive-ink);    /* positive TEXT on light (lime-deep fails 4.5:1) */
  --nv-green-bright: var(--noor-lime-deep);
  /* The old green tint was used for panels, notes, icon tiles and zebra rows. The system never
     tints sections, so these are porcelain now; selected states use --surface-accent-wash directly. */
  --nv-green-pale:   var(--surface-page);
  --nv-green-tint:   var(--surface-page);
  --nv-green-border: var(--gray-smoke);
  --nv-black:        var(--noor-black);
  --nv-dark:         var(--gray-phantom);
  --nv-charcoal:     var(--gray-arsenic);
  --nv-white:        var(--surface-card);
  --nv-off-white:    var(--surface-page);
  --nv-gray-light:   var(--surface-sunken);
  --nv-gray:         var(--gray-graphite);
  --nv-gray-border:  var(--border-subtle);
  --nv-border-strong:var(--border-strong);
  --nv-text:         var(--text-primary);
  --nv-text-muted:   var(--text-muted);
  --nv-primary-deep: var(--text-primary);
  --nv-amber:        var(--status-warning-ink);
  --nv-amber-pale:   var(--status-warning-surface);
  --nv-red:          var(--status-negative-ink);
  --nv-red-pale:     var(--status-negative-surface);
  --nv-teal:         var(--gray-arsenic);
  --nv-teal-pale:    var(--surface-sunken);
  /* Manrope only: the old monospace labels now use Manrope with tabular figures. */
  --sans: var(--font-sans);
  --mono: var(--font-sans);
  --control-height: 44px;
  --control-height-compact: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin:0; padding:0; height:100%;
  background:var(--surface-page); color:var(--text-primary);
  font-family:var(--font-sans);
}
body {
  display:flex; flex-direction:column; min-height:100vh;
  font-size:var(--ui-text-body); font-weight:var(--ui-weight-body); line-height:1.5;
  letter-spacing:var(--tracking-body); font-variant-numeric:tabular-nums;
  -webkit-font-smoothing:antialiased;
}
h1, h2, h3, h4 { letter-spacing:-.02em; font-weight:600; }
b, strong { font-weight:700; }
a { color:var(--text-link); }
a:hover { color:var(--text-link-hover); }
::selection { background:var(--noor-lime); color:var(--noor-black); }
button, input, select, textarea { font-family:inherit; }
:focus-visible { outline:2px solid var(--border-focus); outline-offset:2px; }
.muted { color:var(--text-muted); }

/* ====== LAYOUT ====== */
.app-shell { display:flex; height:100vh; overflow:hidden; background:var(--surface-page); }
.sidebar {
  width:var(--rail-width); flex:0 0 var(--rail-width);
  background:var(--surface-card); color:var(--text-primary);
  display:flex; flex-direction:column; overflow-y:auto;
  border-right:1px solid var(--border-subtle);
  /* Firm co-branding: the active item takes the firm colour (set by renderBrand). */
  --firm-brand: var(--noor-black); --on-firm-brand: var(--noor-porcelain);
}
.main-content {
  flex:1; min-width:0;              /* required: allows the flex item to shrink */
  overflow-y:auto; overflow-x:hidden;
  display:flex; flex-direction:column;
}

/* ====== SIDEBAR ====== */
.sb-brand {
  padding:24px 20px 16px;
  display:flex; align-items:center; gap:10px;
}
.sb-brand > div:last-child { min-width:0; flex:1; }
.sb-lockup { display:block; height:30px; width:auto; max-width:100%; }
.sb-logo {
  width:36px; height:36px; border-radius:var(--radius-md);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.sb-logo svg { display:block; }
.sb-title { font-size:15px; font-weight:700; letter-spacing:-.01em; line-height:1.2;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--text-primary); }
.sb-subtitle { font-size:12px; font-weight:500; color:var(--text-muted); margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-section-label {
  font-size:var(--ui-text-label); font-weight:600; letter-spacing:var(--ui-tracking-overline);
  text-transform:uppercase; color:var(--text-muted); padding:20px 24px 6px;
}
#sb-nav { display:flex; flex-direction:column; gap:2px; padding:0 12px 16px; }
.sb-nav { display:flex; flex-direction:column; gap:2px; padding:0 12px; }
.sb-btn {
  display:flex; align-items:center; gap:12px; min-height:40px; padding:8px 12px;
  background:transparent; border:none; color:var(--text-secondary);
  font-family:var(--font-sans); font-size:14px; font-weight:500; line-height:1.3;
  border-radius:var(--radius-md); cursor:pointer; width:100%; text-align:left;
  transition:background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.sb-btn:hover { background:var(--surface-sunken); color:var(--text-primary); }
.sb-btn.active { background:var(--firm-brand); color:var(--on-firm-brand); font-weight:600; }
.sb-btn .sb-dot { width:6px; height:6px; border-radius:50%; background:var(--gray-smoke); flex:0 0 auto; margin:0 7px; }
.sb-btn.active .sb-dot { background:var(--noor-lime); }
.sb-btn .sb-num {
  width:20px; height:20px; border-radius:50%; background:var(--surface-sunken); color:var(--text-secondary);
  font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center;
  flex:0 0 auto;
}
.sb-btn.done .sb-num { background:var(--noor-black); color:var(--noor-porcelain); }
.sb-btn.active .sb-num { background:var(--noor-lime); color:var(--noor-black); }
.sb-btn.avail .sb-num { box-shadow:0 0 0 1.5px var(--noor-lime-deep); }
.sb-tag {
  margin-left:auto; white-space:nowrap; font-size:11px; font-weight:600; letter-spacing:.01em;
  padding:1px 8px; border-radius:var(--radius-pill); background:var(--surface-sunken); color:var(--text-secondary);
}
.sb-btn.active .sb-tag { background:rgba(255,255,255,.16); color:inherit; }
.sb-foot {
  margin-top:auto; padding:16px 24px 20px; border-top:1px solid var(--border-subtle);
  font-size:12px; font-weight:500; color:var(--text-muted); line-height:1.5;
}
.sb-powered { font-weight:600; color:var(--text-secondary); }

/* ====== TOP HEADER BAR ====== */
.top-bar {
  position:sticky; top:0; z-index:20;
  min-height:var(--topbar-height);
  background:rgba(250,251,255,.86);
  -webkit-backdrop-filter:var(--blur-glass); backdrop-filter:var(--blur-glass);
  border-bottom:1px solid var(--border-subtle);
  padding:12px 32px; display:flex; align-items:center; justify-content:space-between;
  flex-shrink:0; gap:16px; min-width:0;
}
.top-bar > * { min-width:0; }
/* The client name and the right-hand group keep their width; the step strip scrolls. */
.top-bar > div:not(.flow-steps) { flex:0 0 auto; }
.top-bar > .nav-toggle + div { max-width:300px; }
.top-bar > .flow-steps { flex:1 1 auto; }
/* Slim notice under the header while the Orion connection is live on the STAGING host. */
.env-banner {
  background:var(--status-warning-surface); color:var(--status-warning-ink); border-bottom:1px solid var(--border-subtle);
  padding:8px 32px; font-size:13px; font-weight:600; letter-spacing:.01em; flex-shrink:0;
}
.top-bar-eyebrow { font-size:var(--ui-text-label); font-weight:600; letter-spacing:var(--ui-tracking-overline); text-transform:uppercase; color:var(--text-muted); }
.top-bar-title { font-size:var(--ui-text-title); font-weight:600; letter-spacing:-.02em; color:var(--text-primary); margin:2px 0 0; }
.top-bar-lede { font-size:var(--ui-text-small); color:var(--text-muted); margin-top:2px; }
.flow-steps {
  display:flex; gap:2px; align-items:center;
  min-width:0; overflow-x:auto; scrollbar-width:none;
}
.flow-steps::-webkit-scrollbar { display:none; }
.flow-step {
  display:flex; align-items:center; gap:8px; height:36px; padding:0 12px 0 6px;
  font-size:13px; font-weight:600; color:var(--text-secondary); white-space:nowrap;
  border-radius:var(--radius-pill); cursor:pointer;
  transition:background-color var(--duration-fast) var(--ease-standard);
}
.flow-step:hover { background:var(--surface-sunken); color:var(--text-primary); }
.flow-step .fs-num {
  width:24px; height:24px; border-radius:50%; background:var(--surface-sunken); color:var(--text-secondary);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700;
}
.flow-step.active { color:var(--noor-porcelain); background:var(--noor-black); }
.flow-step.active .fs-num { background:var(--noor-lime); color:var(--noor-black); }
.flow-step.done { color:var(--text-primary); }
.flow-step.done .fs-num { background:var(--noor-black); color:var(--noor-porcelain); }
.flow-arrow { color:var(--gray-steel); font-size:16px; padding:0 2px; }

/* ====== PAGE BODY ====== */
.page-body { min-width:0; flex:1; padding:32px 32px 56px; max-width:var(--container-max); width:100%; }

/* Entity disclosure at the foot of every screen. */
.nv-disclosure {
  margin:0; padding:20px 32px 28px; max-width:var(--container-max);
  font-size:12px; line-height:1.6; font-weight:500; color:var(--text-muted);
  border-top:1px solid var(--border-subtle);
}

/* ====== CARDS ====== */
.card {
  background:var(--surface-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg); padding:var(--space-6);
  box-shadow:none;
}
.card+.card { margin-top:16px; }
.card-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.card-title { font-size:var(--ui-text-subheading); font-weight:600; letter-spacing:-.01em; }
.card-sub { font-size:var(--ui-text-small); color:var(--text-muted); margin-top:2px; letter-spacing:var(--ui-tracking-small); }

/* ====== FORM ELEMENTS ====== */
label { font-size:13px; font-weight:600; color:var(--text-primary); letter-spacing:0; display:block; margin-bottom:6px; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=password], input[type=search], select, textarea {
  width:100%; min-height:var(--control-height);
  background:var(--surface-card); border:1px solid var(--border-default);
  color:var(--text-primary); font-family:var(--font-sans); font-size:14px; font-weight:500;
  padding:9px 14px; border-radius:var(--radius-md); outline:none;
  transition:border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
input::placeholder, textarea::placeholder { color:var(--text-faint); }
input:focus, select:focus, textarea:focus { border-color:var(--border-focus); box-shadow:var(--shadow-focus); background:var(--surface-card); }
input[disabled], select[disabled], textarea[disabled] { background:var(--surface-sunken); color:var(--text-muted); cursor:not-allowed; }
input[type=checkbox], input[type=radio] { accent-color:var(--noor-black); }
textarea { resize:vertical; min-height:72px; }
.field { margin-bottom:16px; }
.row { display:flex; gap:16px; flex-wrap:wrap; }
.col { flex:1; min-width:180px; }

/* ====== BUTTONS ======
   Pill buttons. .btn-accent (lime) is the one next step on a screen; .btn-primary is black;
   .btn-outline and .btn-ghost are secondary (white, Smoke border). Hover steps darker,
   press scales to .985, disabled is 40%. */
.btn {
  font-family:var(--font-sans); font-weight:600; font-size:14px; line-height:1.2;
  border-radius:var(--radius-pill); min-height:var(--control-height); padding:10px 20px;
  cursor:pointer; border:1px solid transparent; text-decoration:none;
  display:inline-flex; align-items:center; gap:8px;
  background:var(--surface-card); color:var(--text-primary); border-color:var(--border-default);
  transition:background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.btn:hover { background:var(--surface-sunken); }
.btn:active { transform:scale(.985); }
.btn-primary { background:var(--action-primary); color:var(--on-action-primary); border-color:var(--action-primary); }
.btn-primary:hover { background:var(--action-primary-hover); border-color:var(--action-primary-hover); color:var(--on-action-primary); }
.btn-accent { background:var(--surface-accent); color:var(--text-on-accent); border-color:var(--surface-accent); }
.btn-accent:hover { background:var(--noor-lime-deep); border-color:var(--noor-lime-deep); color:var(--text-on-accent); }
.btn-accent svg [stroke] { stroke:currentColor; }
/* A button whose action is still running (core.js UI_BUSY): progress cursor, small spinner. */
.btn.btn-busy { opacity:.75; cursor:progress; position:relative; }
.btn.btn-busy::after { content:''; display:inline-block; width:12px; height:12px; margin-left:8px; vertical-align:-2px;
  border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:nv-spin .7s linear infinite; }
@keyframes nv-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.btn-busy::after { animation:none; } }
.btn-outline, .btn-ghost { background:var(--surface-card); border:1px solid var(--border-default); color:var(--text-primary); }
.btn-outline:hover, .btn-ghost:hover { background:var(--surface-sunken); border-color:var(--border-default); color:var(--text-primary); }
.btn-sm { min-height:var(--control-height-compact); padding:6px 14px; font-size:13px; }
.btn-xs { min-height:28px; padding:4px 12px; font-size:12px; border-radius:var(--radius-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity:.4; cursor:not-allowed; transform:none; }
.btn-group { display:flex; gap:8px; flex-wrap:wrap; }

/* ====== STATUS PILLS (chips) ======
   Five tones. The word carries the meaning; the colour only supports it. */
.chip {
  display:inline-flex; align-items:center; gap:6px; vertical-align:middle;
  font-family:var(--font-sans); font-size:12px; font-weight:600; letter-spacing:.01em; line-height:1.4;
  padding:2px 10px; border-radius:var(--radius-pill); white-space:nowrap;
  background:var(--status-neutral-surface); color:var(--gray-arsenic);
}
.chip-green { background:var(--status-positive-surface); color:var(--status-positive-ink); }
.chip-amber { background:var(--status-warning-surface); color:var(--status-warning-ink); }
.chip-red   { background:var(--status-negative-surface); color:var(--status-negative-ink); }
.chip-gray  { background:var(--status-neutral-surface); color:var(--gray-arsenic); }
/* "active / in progress": outline pill with a lime dot. */
.chip-teal  { background:var(--surface-card); color:var(--text-primary); box-shadow:inset 0 0 0 1px var(--border-default); }
.chip-teal::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--noor-lime); }
/* Source badges (e.g. Eclipse): neutral outline. */
.chip-blue  { background:var(--surface-card); color:var(--gray-arsenic); box-shadow:inset 0 0 0 1px var(--border-default); }

/* ====== TABLES ====== */
.tbl-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:14px; font-variant-numeric:tabular-nums; }
th {
  text-align:left; font-family:var(--font-sans); font-size:12px; font-weight:600; letter-spacing:var(--ui-tracking-overline);
  text-transform:uppercase; color:var(--text-secondary); padding:10px 12px;
  border-bottom:1px solid var(--border-subtle); white-space:nowrap;
  background:var(--surface-sunken);
}
td { padding:13px 12px; border-bottom:1px solid var(--border-subtle); color:var(--text-primary); }
tr:last-child td { border-bottom:none; }
tr:hover td { background:var(--surface-page); }
.num { font-family:var(--font-sans); font-variant-numeric:tabular-nums; }
.empty { padding:48px; text-align:center; color:var(--text-muted); font-size:14px; }

/* ====== KPI BLOCKS ====== */
.kpi-grid { display:flex; gap:16px; flex-wrap:wrap; }
.kpi-card {
  background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg);
  padding:20px; flex:1; min-width:140px;
}
.kpi-val { font-size:var(--ui-text-figure); font-weight:600; letter-spacing:-.02em; color:var(--text-primary); line-height:1.1; font-variant-numeric:tabular-nums; }
.kpi-lbl { font-size:12px; font-weight:600; letter-spacing:var(--ui-tracking-overline); text-transform:uppercase; color:var(--text-muted); margin-top:8px; }
.kpi-green .kpi-val { color:var(--status-positive-ink); }
.kpi-amber .kpi-val { color:var(--status-warning-ink); }
.kpi-red   .kpi-val { color:var(--status-negative-ink); }

/* ====== PROGRESS / STEPS ====== */
.wizard-steps { display:flex; gap:8px; margin-bottom:24px; flex-wrap:wrap; }
.ws {
  flex:1; min-width:100px; text-align:left; padding:10px 12px;
  border-radius:var(--radius-md); border:1px solid var(--border-subtle);
  font-size:12px; font-weight:600; letter-spacing:.01em;
  color:var(--text-muted); background:var(--surface-card);
  box-shadow:inset 0 -3px 0 var(--chart-track);
}
.ws .wsn { font-size:16px; font-weight:700; display:block; margin-bottom:2px; color:var(--text-secondary); }
.ws.active { color:var(--text-primary); border-color:var(--border-default); box-shadow:inset 0 -3px 0 var(--noor-lime); }
.ws.active .wsn { color:var(--text-primary); }
.ws.done { color:var(--text-primary); box-shadow:inset 0 -3px 0 var(--noor-black); }
.ws.done .wsn { color:var(--text-primary); }
/* Completed steps are buttons (jump back): same box as the div, plus pointer + hover/focus. */
button.ws { margin:0; font-family:inherit; font-weight:600; line-height:inherit; cursor:pointer; -webkit-appearance:none; appearance:none; }
button.ws.done:hover { background:var(--surface-sunken); }
button.ws:focus-visible { outline:2px solid var(--border-focus); outline-offset:2px; }

/* ====== HALAL SCREENING SPECIFICS ====== */
.halal-bar { display:flex; height:8px; border-radius:var(--radius-pill); overflow:hidden; background:var(--chart-track); margin:6px 0; }
.halal-seg { height:100%; transition:width var(--duration-base) var(--ease-standard); }
.compliance-meter {
  background:var(--surface-card);
  border:1px solid var(--border-subtle); border-radius:var(--radius-lg);
  padding:20px 24px; text-align:center;
}
.compliance-pct { font-size:var(--text-metric-lg); font-weight:600; letter-spacing:-.02em; color:var(--text-primary); line-height:1; }
.compliance-sub { font-size:13px; color:var(--text-muted); margin-top:6px; }
.screening-row td:first-child { font-weight:700; font-size:13px; }

/* ====== RISK ASSESSMENT ====== */
.qa-card {
  background:var(--surface-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-xl); padding:32px; text-align:center;
}
.qa-icon { margin:0 auto 12px; }
.qa-title { font-size:var(--ui-text-heading); font-weight:600; letter-spacing:-.02em; margin-bottom:6px; }
.qa-sub { font-size:14px; color:var(--text-secondary); max-width:520px; margin:0 auto 24px; line-height:1.55; }
.choice-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:12px; }
.choice-card {
  background:var(--surface-card); border:1px solid var(--border-default);
  border-radius:var(--radius-lg); padding:18px; cursor:pointer; text-align:left;
  transition:background-color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
.choice-card:hover { box-shadow:var(--shadow-md); }
.choice-card.sel { border-color:var(--noor-lime-deep); background:var(--surface-accent-wash); }
.cc-icon { margin-bottom:8px; }
.cc-title { font-size:14px; font-weight:700; margin-bottom:4px; }
.cc-desc { font-size:13px; color:var(--text-muted); line-height:1.45; }
.pill-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.pill {
  min-height:40px; padding:8px 18px; border-radius:var(--radius-pill); border:1px solid var(--border-default);
  cursor:pointer; font-size:14px; font-weight:500; background:var(--surface-card); color:var(--text-primary);
  transition:background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
.pill:hover { background:var(--surface-sunken); }
.pill.sel { border-color:var(--noor-lime-deep); background:var(--surface-accent-wash); color:var(--text-primary); font-weight:600; }
.progress-dots { display:flex; gap:6px; justify-content:center; margin-bottom:12px; }
.progress-dots span { width:28px; height:4px; border-radius:var(--radius-pill); background:var(--chart-track); }
.progress-dots span.done { background:var(--noor-black); }

/* ====== GAUGE ====== */
.gauge-wrap { text-align:center; }
.gauge-legend { display:flex; gap:16px; justify-content:center; flex-wrap:wrap; margin-top:8px; }
.gauge-leg-item { display:flex; align-items:center; gap:6px; font-size:13px; }
.gauge-dot { width:9px; height:9px; border-radius:50%; }
.breakdown-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.bd-row { display:flex; align-items:center; gap:10px; }
.bd-lbl { width:160px; font-size:13px; color:var(--text-secondary); }
.bd-track { flex:1; height:6px; background:var(--chart-track); border-radius:var(--radius-pill); overflow:hidden; }
.bd-fill { height:100%; border-radius:var(--radius-pill); }
.bd-val { width:32px; text-align:right; font-size:12px; font-weight:600; }

/* ====== SCOREBADGE ====== */
.score-badge {
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:600; padding:4px 12px; border-radius:var(--radius-pill);
  background:var(--surface-card); box-shadow:inset 0 0 0 1px var(--border-default);
}
.score-badge b { color:var(--text-primary); font-size:15px; }

/* ====== STRESS BAR ====== */
.stress-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.stress-lbl { width:50px; text-align:right; font-size:12px; font-weight:600; color:var(--text-muted); }
.stress-track { flex:1; height:16px; background:var(--chart-track); border-radius:var(--radius-xs); position:relative; overflow:hidden; }
.stress-fill { position:absolute; top:0; bottom:0; }
.stress-val { width:90px; font-size:13px; font-weight:600; }

/* ====== TAX TRANSITION ====== */
.tt-lot-editor {
  background:var(--surface-page); border:1px solid var(--border-default);
  border-radius:var(--radius-lg); padding:16px; margin-bottom:16px;
}
.alloc-bar { display:flex; height:8px; border-radius:var(--radius-pill); overflow:hidden; background:var(--chart-track); }

/* ====== PROPOSAL ====== */
.proposal-cover {
  background:var(--noor-black); color:var(--noor-porcelain);
  padding:48px; border-radius:var(--radius-xl); margin-bottom:24px;
  position:relative; overflow:hidden; min-height:240px;
}
/* The emblem as a faint, cropped motif (#1D2C00 olive on black, per the system). */
.proposal-cover::before {
  content:''; position:absolute; right:-60px; bottom:-90px;
  width:300px; height:280px; pointer-events:none;
  background:url('../brand/mark-green.svg') no-repeat center / contain;
  opacity:.14;
}
.proposal-cover-eyebrow { font-size:12px; font-weight:600; letter-spacing:var(--tracking-eyebrow); text-transform:uppercase; color:var(--noor-lime); }
.proposal-cover-title { font-size:var(--text-display-3); font-weight:var(--weight-light); letter-spacing:var(--tracking-display); margin:10px 0 6px; line-height:var(--leading-display); }
.proposal-cover-title b, .proposal-cover-title strong { font-weight:var(--weight-extrabold); }
.proposal-cover-sub { font-size:16px; color:var(--text-inverse-muted); }
.proposal-section-header {
  background:none; color:var(--text-primary); padding:0 0 10px;
  font-size:var(--ui-text-heading); font-weight:600; letter-spacing:-.02em;
  border-bottom:2px solid var(--noor-black); border-radius:0; margin:32px 0 16px;
  display:flex; align-items:center; gap:10px;
}
.report-table { width:100%; border-collapse:collapse; font-size:13px; }
.report-table th {
  background:none; color:var(--gray-graphite); padding:10px 14px;
  font-size:11px; font-weight:600; letter-spacing:.14em; text-transform:uppercase;
  border-bottom:2px solid var(--noor-black);
}
.report-table td { padding:10px 14px; border-bottom:1px solid var(--gray-smoke); }
.report-table tr:nth-child(even) td { background:none; }
.report-note {
  background:var(--surface-sunken); border:none;
  padding:14px 16px; font-size:13px; color:var(--text-secondary); margin:12px 0;
  border-radius:var(--radius-md); line-height:1.6;
}
.metric-box {
  background:var(--surface-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg); padding:16px; text-align:center;
}
.metric-box .mval { font-size:26px; font-weight:800; letter-spacing:-.02em; color:var(--text-primary); }
.metric-box .mlbl { font-size:12px; color:var(--text-muted); margin-top:4px; }
.print-only { display:none; }
.proposal-page { margin-bottom:28px; }

/* ====== RISK RIBBON ====== */
.ribbon-visual { max-width:500px; margin:0 auto 10px; }

/* ====== UPLOAD ZONE ====== */
.upload-zone {
  border:1.5px dashed var(--border-strong); background:var(--surface-page);
  border-radius:var(--radius-lg); padding:36px; text-align:center; cursor:pointer;
  transition:background-color var(--duration-base) var(--ease-standard);
}
.upload-zone:hover { background:var(--surface-sunken); }
/* Statement drop zone: the file input inside is sr-only, so show keyboard focus on the zone itself. */
#stmt-drop:focus-within { outline:2px solid var(--border-focus); outline-offset:2px; box-shadow:var(--shadow-focus); }
.upload-zone-icon { font-size:36px; margin-bottom:10px; }
.upload-zone-title { font-size:15px; font-weight:600; margin-bottom:4px; }
.upload-zone-sub { font-size:13px; color:var(--text-muted); }

/* ====== ALLOCATIONS CHART COMPARE ====== */
.alloc-compare { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
@media(max-width:700px){ .alloc-compare{ grid-template-columns:1fr; } }
.alloc-donut-wrap { text-align:center; }
.alloc-legend { display:flex; flex-direction:column; gap:6px; margin-top:10px; text-align:left; }
.alloc-leg-row { display:flex; align-items:center; gap:8px; font-size:13px; }
.alloc-leg-dot { width:10px; height:10px; border-radius:50%; flex:0 0 auto; }

/* ====== ZAKAT ======
   The one accent card on its screen: black ground, porcelain type, lime figure. */
.zakat-block {
  background:var(--surface-inverse-deep);
  color:var(--noor-porcelain); border-radius:var(--radius-lg); padding:20px 24px; margin-bottom:12px;
}
.zakat-val { font-size:28px; font-weight:700; letter-spacing:-.02em; color:var(--noor-lime); }
.zakat-lbl { font-size:12px; color:var(--text-inverse-muted); margin-top:2px; }

/* ====== HR ====== */
.hr { border:none; border-top:1px solid var(--border-subtle); margin:20px 0; }

/* ====== PRINT STYLES ====== */
@media print {
  /* The app shell pins itself to one viewport (height:100vh + overflow:hidden),
     which clips printing to a single page. Unlock the full document height. */
  html, body { height:auto !important; overflow:visible !important; background:#fff !important; }
  .sidebar, .top-bar, .app-shell { display:block !important; }
  .sidebar, .top-bar { display:none !important; }
  .app-shell { height:auto !important; overflow:visible !important; max-width:none !important; }
  .main-content { display:block !important; height:auto !important; overflow:visible !important; }
  .page-body { padding:0; max-width:100%; }
  .print-only { display:block; }
  .no-print { display:none !important; }
  .proposal-cover { border-radius:0; margin:0 0 20px; }
  * { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
}

/* ============================================================
   AEGIS — ADA COMPLIANT SWITCH  (WCAG 2.1 AA)
   role="switch" + aria-checked is the correct pattern for a
   binary control that takes effect immediately.
   State is carried by knob position AND a text label, never by
   colour alone, so it survives greyscale and colour blindness.
   ============================================================ */
.sw-wrap{display:inline-flex;flex-direction:column;align-items:center;gap:4px;flex-shrink:0}

.sw{
  /* 44x44 minimum touch target achieved with padding around the
     52x30 visual track. WCAG 2.5.5 Target Size. */
  display:inline-flex;align-items:center;gap:9px;
  padding:7px 4px;min-height:44px;min-width:44px;
  background:none;border:none;cursor:pointer;border-radius:var(--radius-md);
  font-family:inherit;
}
.sw-track{
  position:relative;width:52px;height:30px;border-radius:999px;flex-shrink:0;
  background:var(--gray-smoke);
  border:2px solid var(--border-strong);   /* 3:1 boundary, WCAG 1.4.11 */
  transition:background var(--duration-base) var(--ease-standard),border-color var(--duration-base) var(--ease-standard);
}
.sw-knob{
  position:absolute;top:2px;left:2px;width:22px;height:22px;border-radius:50%;
  background:#fff;box-shadow:var(--shadow-sm), 0 0 0 1px rgba(30,30,36,.08);
  transition:transform var(--duration-base) var(--ease-standard);
}
.sw.on .sw-track{background:var(--noor-black);border-color:var(--noor-black)}
.sw.on .sw-knob{transform:translateX(22px);background:var(--noor-lime)}

/* Text label. This is what makes the control readable without colour. */
.sw-state{
  font-size:12px;font-weight:700;letter-spacing:.02em;
  color:var(--text-muted);min-width:22px;text-align:left;
}
.sw.on .sw-state{color:var(--text-primary)}

/* Visible focus ring. :focus-visible so a pointer click does not leave a ring behind. */
.sw:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px;box-shadow:var(--shadow-focus)}
.sw::-moz-focus-inner{border:0}

/* Disabled state is conveyed by opacity AND an adjacent note,
   and the button carries aria-disabled for assistive tech. */
.sw[aria-disabled="true"]{cursor:not-allowed;opacity:.4}
.sw-note{font-size:12px;color:var(--text-muted)}

/* Respect reduced motion: state still changes, it just does not slide. */
@media (prefers-reduced-motion: reduce){
  .sw-track,.sw-knob{transition:none}
}

/* Forced colours (Windows high contrast): borders must survive
   when background colours are stripped out. */
@media (forced-colors: active){
  .sw-track{border:2px solid ButtonText;background:ButtonFace}
  .sw.on .sw-track{background:Highlight}
  .sw-knob{background:ButtonText}
  .sw:focus-visible{outline:3px solid Highlight}
}

/* ---- Master console hierarchy ---- */
.crumbs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.crumb{font-size:13px;font-weight:600;padding:6px 12px;border-radius:var(--radius-pill);
  background:none;border:none;color:var(--text-secondary);cursor:pointer;font-family:inherit;
  text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--gray-steel)}
.crumb:hover{background:var(--surface-sunken);color:var(--text-primary)}
.crumb:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px}
.crumb-here{color:var(--text-primary);cursor:default;font-weight:700;text-decoration:none}
.crumb-here:hover{background:none}

.viewing-as{display:flex;align-items:center;gap:10px;padding:6px 14px;border-radius:999px;
  background:var(--status-warning-surface);border:none}
.va-dot{width:8px;height:8px;border-radius:50%;background:var(--status-warning);flex-shrink:0}
.va-text{font-size:13px;color:var(--status-warning-ink);font-weight:600}


/* ============================================================
   HORIZONTAL OVERFLOW GUARD
   Wide content belongs inside a designated scroll container
   (.tbl-wrap, .flow-steps), never on the page itself.
   ============================================================ */
html, body { max-width:100%; overflow-x:hidden; }
.app-shell { max-width:100vw; overflow-x:hidden; }
.card, .row, .tbl-wrap { min-width:0; max-width:100%; }
.row { flex-wrap:wrap; }
table { max-width:100%; }
pre, code { overflow-x:auto; max-width:100%; }
code, pre { font-family:var(--font-mono); font-size:.92em; }


/* ============================================================
   RESPONSIVE SYSTEM
   Breakpoints, and why each exists:

     >= 1280   Desktop.  Full 248px sidebar alongside content.
     1024-1279 Laptop.   Sidebar narrows, padding tightens.
     768-1023  Tablet.   Sidebar becomes an off-canvas drawer so
                         the content column gets the full width.
     < 768     Phone.    Drawer, stacked layout, larger touch
                         targets, tables scroll inside their wrapper.

   The layout is fluid between breakpoints rather than jumping,
   so intermediate widths are usable too.
   ============================================================ */

/* ---- Drawer toggle. Hidden on desktop, shown once the sidebar
        becomes off-canvas. ---- */
.nav-toggle{
  display:none; align-items:center; justify-content:center;
  width:44px; height:44px; border-radius:var(--radius-pill); flex-shrink:0;
  background:var(--surface-card); border:1px solid var(--border-default);
  cursor:pointer; padding:0;
}
.nav-toggle:hover{ background:var(--surface-sunken); }
.nav-toggle:focus-visible{ outline:2px solid var(--border-focus); outline-offset:2px; }
.nav-toggle span{ display:block; width:18px; height:2px; background:var(--text-primary); position:relative; border-radius:2px; }
.nav-toggle span::before,.nav-toggle span::after{
  content:""; position:absolute; left:0; width:18px; height:2px; background:var(--text-primary); border-radius:2px;
}
.nav-toggle span::before{ top:-6px; } .nav-toggle span::after{ top:6px; }

.nav-scrim{
  display:none; position:fixed; inset:0; z-index:60;
  background:var(--surface-overlay); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
}
.nav-scrim.open{ display:block; }

/* ---- Laptop ---- */
@media (max-width:1279px){
  .sidebar{ width:224px; flex:0 0 224px; }
  .page-body{ padding:24px 24px 48px; }
  .top-bar{ padding:12px 24px; }
  .nv-disclosure{ padding:20px 24px 28px; }
}

/* ---- Tablet and below: sidebar becomes a drawer ---- */
@media (max-width:1023px){
  .nav-toggle{ display:flex; }

  .sidebar{
    position:fixed; top:0; left:0; bottom:0; z-index:70;
    width:280px; flex:0 0 280px;
    transform:translateX(-100%);
    transition:transform var(--duration-base) var(--ease-standard);
    box-shadow:var(--shadow-lg);
  }
  .sidebar.open{ transform:translateX(0); }
  .app-shell{ display:block; }
  .main-content{ height:100vh; }

  .top-bar{
    padding:12px 16px; gap:12px; min-height:64px;
    flex-wrap:wrap; align-items:center;
  }
  /* The 7-step strip is the first thing to go: it is a progress
     indicator, and the numbered sidebar carries the same state. */
  .flow-steps{ display:none !important; }
  .page-body{ padding:20px 16px 40px; }
  .nv-disclosure{ padding:16px 16px 24px; }
}

/* ---- Phone ---- */
@media (max-width:767px){
  .sidebar{ width:min(84vw,300px); flex-basis:min(84vw,300px); }

  .top-bar{ padding:10px 16px; }
  .env-banner{ padding:8px 16px; }
  .page-body{ padding:16px 16px 32px; }

  .card{ padding:16px; border-radius:var(--radius-lg); }
  .card+.card{ margin-top:12px; }

  /* Stack every multi-column row. */
  .row{ flex-direction:column; gap:10px; }
  .col{ min-width:0; width:100%; flex:1 1 auto; }
  .kpi-grid{ flex-direction:column; }
  .kpi-card{ min-width:0; width:100%; }

  /* Comfortable touch targets. WCAG 2.5.5. */
  .btn{ min-height:44px; padding:11px 18px; }
  .btn-sm{ min-height:40px; }
  .btn-xs{ min-height:36px; padding:7px 12px; }
  /* Must match the specificity of the base input rule, otherwise
     the 16px minimum loses and iOS zooms on focus. */
  input[type=text], input[type=number], input[type=date],
  input[type=email], input[type=tel], select, textarea{
    min-height:44px; font-size:16px;
  }

  /* Tables keep their internal scroller and advertise it. */
  .tbl-wrap{
    overflow-x:auto; -webkit-overflow-scrolling:touch;
    background:
      linear-gradient(to right,var(--surface-card) 30%,rgba(255,255,255,0)),
      linear-gradient(to right,rgba(30,30,36,.08),rgba(30,30,36,0) 22px) 100% 0;
    background-repeat:no-repeat; background-size:32px 100%,22px 100%;
    background-attachment:local,scroll;
  }
  table{ font-size:13px; }
  th,td{ white-space:nowrap; }

  h1,.page-title{ font-size:22px; }
  .card-title{ font-size:15px; }
  .proposal-cover{ padding:28px 20px; }
  .proposal-cover-title{ font-size:32px; }

  /* Breadcrumb and the viewing-as banner wrap rather than overflow. */
  .crumbs{ gap:5px; }
  .crumb{ font-size:12px; padding:4px 8px; }
  .viewing-as{ width:100%; justify-content:space-between; }
}

/* ---- Very small phones ---- */
@media (max-width:400px){
  .page-body{ padding:12px 12px 28px; }
  .sb-title{ font-size:14px; }
  .top-bar{ padding:9px 12px; }
}

/* ---- Short viewports: reclaim vertical space ---- */
@media (max-height:560px) and (min-width:1024px){
  .sb-brand{ padding:14px 20px 10px; }
  .sb-section-label{ padding:12px 24px 4px; }
}

/* ---- Coarse pointers get larger hit areas regardless of width ---- */
@media (pointer:coarse){
  .nav-item{ padding-top:11px; padding-bottom:11px; }
  .crumb{ min-height:36px; display:inline-flex; align-items:center; }
}

@media (prefers-reduced-motion: reduce){
  .sidebar{ transition:none; }
}

/* ============================================================
   CHARTS
   Colour order: black, lime, lime-deep, Graphite, Steel, Cloud.
   ============================================================ */
.sr-only{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.ch-wrap{ width:100%; min-width:0; }
.ch-svg{ width:100%; height:auto; display:block; overflow:visible; font-family:var(--font-sans); }
.ch-svg circle[tabindex]:focus-visible{ outline:2px solid var(--border-focus); outline-offset:1px; }
.ch-svg g[tabindex]:focus-visible rect{ stroke:var(--noor-black); stroke-width:3; }

.ch-legend{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom:10px; }
.ch-leg{ display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--text-secondary); font-weight:600; }
.ch-swatch{ width:14px; height:3px; border-radius:2px; flex-shrink:0; }

.ch-bars{ display:flex; flex-direction:column; gap:10px; }
.ch-bar-row{ display:flex; align-items:center; gap:12px; }
.ch-bar-lbl{ flex:0 0 130px; font-size:13px; font-weight:600; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ch-bar-track{ flex:1; height:22px; position:relative; background:var(--chart-track);
  border-radius:var(--radius-xs); min-width:0; }
.ch-bar-zero{ position:absolute; left:50%; top:0; bottom:0; width:1px; background:var(--gray-steel); }
.ch-bar-fill{ position:absolute; top:3px; bottom:3px; border-radius:3px; min-width:2px; }
.ch-bar-val{ flex:0 0 74px; text-align:right; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }

.ch-delta{ font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
.ch-delta.up{ color:var(--status-positive-ink); } .ch-delta.down{ color:var(--status-negative-ink); }

.range-group{ display:inline-flex; gap:2px; background:var(--surface-sunken);
  padding:3px; border-radius:var(--radius-pill); border:none; }
.range-btn{ padding:6px 14px; border-radius:var(--radius-pill); border:none; background:none; cursor:pointer;
  font-family:inherit; font-size:13px; font-weight:600; color:var(--text-secondary); min-height:34px; }
.range-btn:hover{ color:var(--text-primary); }
.range-btn.on{ background:var(--surface-card); color:var(--text-primary); box-shadow:var(--shadow-sm), 0 0 0 1px var(--border-subtle); }
.range-btn:focus-visible{ outline:2px solid var(--border-focus); outline-offset:2px; }

@media (max-width:767px){
  .ch-bar-lbl{ flex-basis:92px; font-size:12px; }
  .ch-bar-val{ flex-basis:62px; font-size:12px; }
  .range-btn{ padding:9px 12px; min-height:40px; }
}

/* ---- Client portal preview ---- */
.portal-frame{ border:1px solid var(--border-subtle); border-radius:var(--radius-lg); overflow:hidden;
  box-shadow:var(--shadow-md); background:var(--surface-card); }
.portal-chrome{ display:flex; align-items:center; gap:6px; padding:10px 14px;
  background:var(--surface-sunken); border-bottom:1px solid var(--border-subtle); }
.portal-dot{ width:9px; height:9px; border-radius:50%; background:var(--gray-smoke); }
.portal-url{ margin-left:10px; font-size:12px; font-weight:500; color:var(--text-muted); }
.portal-body{ padding:20px; background:var(--surface-page); }
.portal-head{ display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.portal-mark{ width:40px; height:40px; border-radius:var(--radius-md); background:var(--brand); color:var(--noor-black);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:14px; flex-shrink:0; }
.portal-firm{ font-size:15px; font-weight:700; }
.portal-greet{ font-size:13px; color:var(--text-muted); }
.portal-hero{ background:var(--brand); border-radius:var(--radius-lg);
  padding:20px; margin-bottom:14px; color:var(--noor-black); }
.portal-hero-lbl{ font-size:12px; font-weight:600; text-transform:uppercase;
  letter-spacing:var(--ui-tracking-overline); opacity:.8; }
.portal-hero-val{ font-size:32px; font-weight:700; letter-spacing:-.02em; line-height:1.1; margin-top:4px; }
.portal-hero-sub{ font-size:13px; font-weight:600; opacity:.85; margin-top:3px; }
.portal-card{ background:var(--surface-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg); padding:16px; margin-bottom:12px; }
.portal-card-t{ font-size:14px; font-weight:700; margin-bottom:9px; }
.portal-note{ font-size:12px; color:var(--text-muted); line-height:1.45; }
.portal-ok{ display:flex; gap:12px; align-items:flex-start;
  background:var(--status-positive-surface); border-color:transparent; }
.portal-gold{ background:var(--status-warning-surface); border-color:transparent; }
.portal-gold-val{ font-size:26px; font-weight:700; letter-spacing:-.02em; color:var(--status-warning-ink); margin:2px 0 4px; }
.portal-doc{ display:flex; align-items:center; gap:9px; padding:8px 0; font-size:13px;
  border-bottom:1px solid var(--border-subtle); }
.portal-doc:last-child{ border-bottom:none; }
.portal-foot{ text-align:center; font-size:12px; color:var(--text-muted); margin-top:16px; }


/* ============================================================
   ACCESSIBILITY INFRASTRUCTURE
   ============================================================ */

/* Skip link. WCAG 2.4.1 Bypass Blocks. Hidden until focused,
   then it must be clearly visible, not merely present. */
.skip-link{
  position:absolute; top:-100px; left:12px; z-index:200;
  background:var(--noor-black); color:var(--noor-porcelain);
  padding:12px 22px; border-radius:0 0 var(--radius-md) var(--radius-md);
  font-weight:700; font-size:14px; text-decoration:none;
  transition:top var(--duration-fast) var(--ease-standard);
}
.skip-link:focus{ top:0; outline:2px solid var(--border-focus); outline-offset:2px; }

/* Visible chart-to-table toggle. The hidden table serves screen
   readers; this serves low-vision and cognitive users who want the
   numbers rather than the picture. */
.ch-toolbar{ display:flex; align-items:center; justify-content:flex-end; gap:8px; margin-bottom:8px; }
.ch-toggle{
  display:inline-flex; align-items:center; gap:7px;
  padding:6px 14px; min-height:32px; border-radius:var(--radius-pill);
  background:var(--surface-card); border:1px solid var(--border-default);
  font-family:inherit; font-size:13px; font-weight:600; color:var(--text-primary);
  cursor:pointer;
}
.ch-toggle:hover{ background:var(--surface-sunken); }
.ch-toggle:focus-visible{ outline:2px solid var(--border-focus); outline-offset:2px; }
.ch-toggle[aria-pressed="true"]{ background:var(--noor-black); border-color:var(--noor-black); color:var(--noor-porcelain); }

.ch-table{ width:100%; margin-top:6px; }
.ch-table table{ width:100%; border-collapse:collapse; font-size:13px; }
.ch-table th{ text-align:left; font-size:12px; font-weight:600; letter-spacing:var(--ui-tracking-overline);
  text-transform:uppercase; color:var(--text-secondary); padding:8px 10px;
  border-bottom:1px solid var(--border-subtle); }
.ch-table td{ padding:8px 10px; border-bottom:1px solid var(--border-subtle); }
.ch-table caption{ text-align:left; font-size:12px; color:var(--text-muted); padding:4px 0 8px; }

/* Session timeout dialog. WCAG 2.2.1 Timing Adjustable. */
.timeout-scrim{ position:fixed; inset:0; z-index:300; background:var(--surface-overlay);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; padding:20px; }
.timeout-box{ background:var(--surface-card); border-radius:var(--radius-lg); padding:28px;
  max-width:440px; width:100%; box-shadow:var(--shadow-lg); }
.timeout-box h2{ font-size:var(--ui-text-heading); font-weight:600; margin:0 0 10px; }
.timeout-box p{ font-size:14px; color:var(--text-secondary); line-height:1.55; margin:0 0 20px; }
.timeout-count{ font-weight:700; color:var(--status-warning-ink); font-variant-numeric:tabular-nums; }

/* Sign-in screen (login.js). The brand voice is allowed here: light display weight, full stop. */
.nv-signin{ max-width:480px; margin:72px auto; padding:0 20px; }
.nv-signin-card{ background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-xl); padding:32px; }
.nv-signin-lockup{ display:block; height:34px; width:auto; margin-bottom:28px; }
.nv-signin h1{ margin:0 0 8px; font-size:var(--text-h1); font-weight:var(--weight-light); letter-spacing:var(--tracking-display); line-height:1.1; }
.nv-signin h1 strong{ font-weight:var(--weight-extrabold); }
.nv-signin p{ margin:0 0 20px; color:var(--text-secondary); line-height:1.55; }
.nv-signin-option{ display:block; width:100%; text-align:left; margin:8px 0; padding:14px 18px;
  border-radius:var(--radius-lg); border:1px solid var(--border-default); background:var(--surface-card);
  font:inherit; color:var(--text-primary); cursor:pointer;
  transition:background-color var(--duration-fast) var(--ease-standard); }
.nv-signin-option:hover{ background:var(--surface-sunken); }
.nv-signin-option b{ font-weight:600; }
.nv-signin-option .muted{ font-size:13px; }
.nv-signin-err{ color:var(--status-negative-ink); margin-top:10px; font-weight:600; }
.nv-signin .nv-disclosure{ border:0; padding:20px 4px 0; }

/* Accessibility preferences. Text scaling must reflow, not clip. */
body.a11y-lg{ font-size:112.5%; }
body.a11y-xl{ font-size:125%; }
body.a11y-contrast{
  --text-muted:var(--gray-arsenic); --text-secondary:var(--noor-black);
  --border-subtle:var(--gray-space); --border-default:var(--gray-graphite); --border-strong:var(--gray-arsenic);
  /* The legacy aliases resolve at :root, so they are overridden here too. */
  --nv-text-muted:var(--gray-arsenic); --nv-gray-border:var(--gray-space); --nv-border-strong:var(--gray-arsenic);
}
body.a11y-nomotion *{ animation:none !important; transition:none !important; }

/* ── Production sign-in (login.js, Cognito). Full-screen split: brand story left, sign-in right.
   Fixed over the app shell so the sidebar/top bar never show behind it. ── */
.nv-auth{ position:fixed; inset:0; z-index:1000; display:grid; grid-template-columns:minmax(0,53fr) minmax(0,47fr);
  background:var(--surface-page); color:var(--text-primary); overflow:auto; font-family:var(--font-sans); }
.nv-auth-hero{ display:flex; flex-direction:column; min-height:100vh; padding:40px 72px 56px;
  background:var(--noor-black); color:var(--white); }
.nv-auth-lockup{ display:block; height:34px; width:auto; align-self:flex-start; }
.nv-auth-hero-body{ margin:auto 0; padding-top:48px; max-width:560px; }
.nv-auth-eyebrow{ font-size:13px; font-weight:600; letter-spacing:.18em; text-transform:uppercase;
  color:var(--text-inverse-muted); margin-bottom:20px; }
.nv-auth-title{ margin:0 0 28px; font-size:clamp(44px,5.6vw,80px); line-height:1.02; font-weight:var(--weight-light);
  letter-spacing:-0.035em; color:var(--white); }
.nv-auth-title strong{ display:block; font-weight:var(--weight-extrabold); }
.nv-auth-lede{ margin:0 0 32px; font-size:18px; line-height:1.5; color:var(--noor-lime); max-width:500px; }
.nv-auth-points{ list-style:none; margin:0; padding:0; display:grid; gap:16px; }
.nv-auth-points li{ display:flex; align-items:center; gap:14px; font-size:15px; color:var(--white); }
.nv-auth-points svg{ width:20px; height:20px; flex:none; fill:none; stroke:var(--text-inverse-muted);
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }

.nv-auth-panel{ display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:100vh; padding:48px 24px 24px; }
.nv-auth-form{ width:100%; max-width:420px; margin:auto 0; }
.nv-auth-lockup-mobile{ display:none; height:30px; width:auto; margin-bottom:28px; }
.nv-auth-intro{ margin:0 0 8px; font-size:15px; line-height:1.55; color:var(--text-primary); }
.nv-auth-link{ color:var(--text-primary); font-size:14px; text-decoration:underline; text-decoration-color:var(--border-strong);
  text-underline-offset:4px; }
.nv-auth-link:hover{ text-decoration-color:currentColor; }
.nv-auth-h2{ margin:36px 0 24px; font-size:28px; font-weight:var(--weight-regular); letter-spacing:-0.01em; }
.nv-auth-label{ display:block; margin-bottom:8px; font-size:14px; font-weight:500; }
.nv-auth-input{ display:block; width:100%; box-sizing:border-box; min-height:48px; padding:0 16px; font:inherit; font-size:15px;
  color:var(--text-primary); background:var(--surface-card); border:1px solid var(--border-default); border-radius:var(--radius-lg);
  transition:border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }
.nv-auth-input:focus{ outline:none; border-color:var(--border-focus); box-shadow:var(--shadow-focus); }
.nv-auth-hint{ margin:10px 0 24px; font-size:13px; color:var(--text-muted); }
.nv-auth-primary, .nv-auth-secondary{ display:flex; align-items:center; justify-content:center; gap:10px; width:100%;
  min-height:52px; border-radius:var(--radius-pill); font:inherit; font-size:16px; font-weight:500; cursor:pointer;
  transition:background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); }
.nv-auth-primary{ border:0; background:var(--noor-lime); color:var(--noor-black); }
.nv-auth-primary:hover{ background:var(--noor-lime-deep); }
.nv-auth-secondary{ border:1px solid var(--border-default); background:var(--surface-card); color:var(--text-primary); }
.nv-auth-secondary:hover{ border-color:var(--border-strong); }
.nv-auth-primary svg, .nv-auth-secondary svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8;
  stroke-linecap:round; stroke-linejoin:round; }
.nv-auth-primary:focus-visible, .nv-auth-secondary:focus-visible, .nv-auth-linkbtn:focus-visible, .nv-auth-link:focus-visible{
  outline:none; box-shadow:var(--shadow-focus); }
.nv-auth-or{ display:flex; align-items:center; gap:12px; margin:20px 0; font-size:13px; color:var(--text-muted); }
.nv-auth-or::before, .nv-auth-or::after{ content:""; flex:1; height:1px; background:var(--border-default); }
.nv-auth-err{ min-height:20px; margin:14px 0 0; font-size:14px; color:var(--status-negative); }
.nv-auth-err:empty{ min-height:0; margin:0; }
.nv-auth-foot{ margin:28px 0 0; font-size:14px; color:var(--text-secondary); }
.nv-auth-linkbtn{ padding:0; border:0; background:none; font:inherit; color:var(--text-primary); cursor:pointer;
  text-decoration:underline; text-decoration-color:var(--border-strong); text-underline-offset:4px; }
.nv-auth-linkbtn:hover{ text-decoration-color:currentColor; }
.nv-auth-disclosure{ max-width:520px; margin:40px 0 0; font-size:11px; line-height:1.5; color:var(--text-faint); text-align:center; }

@media (max-width:900px){
  .nv-auth{ grid-template-columns:1fr; }
  .nv-auth-hero{ min-height:0; padding:28px 20px 36px; }
  .nv-auth-hero-body{ padding-top:32px; }
  .nv-auth-title{ font-size:clamp(36px,10vw,52px); margin-bottom:16px; }
  .nv-auth-lede{ font-size:16px; margin-bottom:20px; }
  .nv-auth-points{ display:none; }
  .nv-auth-panel{ min-height:0; padding:32px 20px 24px; }
  .nv-auth-h2{ margin-top:28px; }
}
