/* ============================================================
   Tourist Health Hub — shared design system
   Petrol teal + role hues · Georgia display / Segoe UI body
   RTL-safe (logical properties) · light & dark themes
   ============================================================ */

:root {
  --ground: #f5f8f7;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #1b2624;
  --ink-soft: #4c5a57;
  --ink-faint: #677270;
  --line: #d8e0dd;
  --line-soft: #e5ebe9;

  --teal: #0f6e66;
  --teal-deep: #0b524c;
  --sand: #96691f;
  --amber: #946811;
  --red: #b5443b;
  --ok: #2f7d4f;

  --r-patient: #0f6e66;
  --r-hospital: #34719a;
  --r-ministry: #96691f;
  --r-admin: #4c599b;
  --r-partners: #7b5aa6;
  --r-payments: #9a4f6e;

  /* categorical chart palette — validator-passed for light surface */
  --ch1: #00856d;
  --ch2: #a06a10;
  --ch3: #7b56b3;
  --ch4: #a34b6e;
  --ch5: #2e6fce;

  --shadow: 0 1px 2px rgba(27, 38, 36, 0.05), 0 4px 14px rgba(27, 38, 36, 0.06);
  --shadow-lg: 0 4px 10px rgba(27, 38, 36, 0.08), 0 18px 44px rgba(27, 38, 36, 0.14);
  --radius: 12px;

  /* gradient companions per role hue */
  --teal-2: #159a80;
  --r-patient-2: #159a80;
  --r-hospital-2: #4f93c4;
  --r-ministry-2: #b98428;
  --r-admin-2: #6d7cc9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #101716;
    --surface: #182120;
    --surface-2: #1f2b29;
    --ink: #dde6e3;
    --ink-soft: #a6b3af;
    --ink-faint: #7c8985;
    --line: #2c3937;
    --line-soft: #24302e;
    --teal: #3ba398;
    --teal-deep: #6cc2b8;
    --sand: #c99b4a;
    --amber: #d0a03c;
    --red: #d47a70;
    --ok: #5cb083;
    --r-patient: #3ba398;
    --r-hospital: #6fa8cf;
    --r-ministry: #c99b4a;
    --r-admin: #8b96d6;
    --r-partners: #ab8dd6;
    --r-payments: #cc84a3;
    /* categorical chart palette — validator-passed for dark surface */
    --ch1: #25a389;
    --ch2: #bd8526;
    --ch3: #9678d4;
    --ch4: #cf7397;
    --ch5: #5f8ede;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.5);
    --teal-2: #5cc4b6;
    --r-patient-2: #5cc4b6;
    --r-hospital-2: #8fc2e2;
    --r-ministry-2: #dbb46d;
    --r-admin-2: #a9b3e8;
    --r-partners-2: #c3aade;
    --r-payments-2: #dda2bb;
  }
}
:root[data-theme="dark"] {
  --ground: #101716;
  --surface: #182120;
  --surface-2: #1f2b29;
  --ink: #dde6e3;
  --ink-soft: #a6b3af;
  --ink-faint: #7c8985;
  --line: #2c3937;
  --line-soft: #24302e;
  --teal: #3ba398;
  --teal-deep: #6cc2b8;
  --sand: #c99b4a;
  --amber: #d0a03c;
  --red: #d47a70;
  --ok: #5cb083;
  --r-patient: #3ba398;
  --r-hospital: #6fa8cf;
  --r-ministry: #c99b4a;
  --r-admin: #8b96d6;
  --r-partners: #ab8dd6;
  --r-payments: #cc84a3;
  --ch1: #25a389;
  --ch2: #bd8526;
  --ch3: #9678d4;
  --ch4: #cf7397;
  --ch5: #5f8ede;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.5);
  --teal-2: #5cc4b6;
  --r-patient-2: #5cc4b6;
  --r-hospital-2: #8fc2e2;
  --r-ministry-2: #dbb46d;
  --r-admin-2: #a9b3e8;
  --r-partners-2: #c3aade;
  --r-payments-2: #dda2bb;
}
:root[data-theme="light"] {
  --ground: #f5f8f7;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #1b2624;
  --ink-soft: #4c5a57;
  --ink-faint: #677270;
  --line: #d8e0dd;
  --line-soft: #e5ebe9;
  --teal: #0f6e66;
  --teal-deep: #0b524c;
  --sand: #96691f;
  --amber: #946811;
  --red: #b5443b;
  --ok: #2f7d4f;
  --r-patient: #0f6e66;
  --r-hospital: #34719a;
  --r-ministry: #96691f;
  --r-admin: #4c599b;
  --r-partners: #7b5aa6;
  --r-payments: #9a4f6e;
  --ch1: #00856d;
  --ch2: #a06a10;
  --ch3: #7b56b3;
  --ch4: #a34b6e;
  --ch5: #2e6fce;
  --shadow: 0 1px 2px rgba(27, 38, 36, 0.05), 0 4px 14px rgba(27, 38, 36, 0.06);
  --shadow-lg: 0 4px 10px rgba(27, 38, 36, 0.08), 0 18px 44px rgba(27, 38, 36, 0.14);
  --teal-2: #159a80;
  --r-patient-2: #159a80;
  --r-hospital-2: #4f93c4;
  --r-ministry-2: #b98428;
  --r-admin-2: #6d7cc9;
  --r-partners-2: #9b7cc4;
  --r-payments-2: #b56f8c;
}
:root[data-theme="light"] { --r-partners-2: #9b7cc4; --r-payments-2: #b56f8c; }

/* role accent per page: <body data-role="patient|hospital|ministry|admin|ops"> */
body[data-role="ops"] { --accent: var(--r-partners); --accent-2: var(--r-partners-2); }
body[data-role="partner"] { --accent: var(--r-payments); --accent-2: var(--r-payments-2); }
body[data-role="patient"] { --accent: var(--r-patient); --accent-2: var(--r-patient-2); }
body[data-role="hospital"] { --accent: var(--r-hospital); --accent-2: var(--r-hospital-2); }
body[data-role="ministry"] { --accent: var(--r-ministry); --accent-2: var(--r-ministry-2); }
body[data-role="admin"] { --accent: var(--r-admin); --accent-2: var(--r-admin-2); }
body { --accent: var(--teal); --accent-2: var(--teal-2); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, .mono { font-family: Consolas, "SF Mono", monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-faint); }
.soft { color: var(--ink-soft); }

.eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 10px;
}
[dir="rtl"] .eyebrow { letter-spacing: 0; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.side nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  color: var(--ink-soft); font-weight: 500; font-size: 13.5px;
  text-decoration: none;
}
.side nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side nav a.on {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent); font-weight: 650;
}
.side nav a svg { width: 17px; height: 17px; flex: 0 0 17px; }
.side .foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-faint); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.brand .mark svg { width: 18px; height: 18px; }
.brand b { font-family: Georgia, serif; font-size: 15.5px; line-height: 1.15; display: block; }
.brand small { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; display: block; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.top .search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: 8px; padding: 7px 12px; color: var(--ink-faint);
}
.top .search input { flex: 1; border: 0; background: transparent; outline: none; }
.top .spacer { flex: 1; }
.content { padding: 26px; display: flex; flex-direction: column; gap: 20px; max-width: 1280px; width: 100%; margin: 0 auto; }

.icon-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft);
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--surface);
}
.lang-btn { width: auto; padding: 0 12px; font-weight: 650; font-size: 13px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent); font-weight: 700; font-size: 12.5px;
  display: grid; place-items: center; letter-spacing: 0.02em;
}
.avatar.lg { width: 46px; height: 46px; flex-basis: 46px; font-size: 15px; }

/* ---------- cards & grids ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card > h3, .card .card-h {
  font-size: 14.5px; font-weight: 650;
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
}
.card .card-h .pill { margin-inline-start: auto; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .side { display: none; }
  .content { padding: 16px; }
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .k { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
[dir="rtl"] .stat .k { letter-spacing: 0; }
.stat .d { font-size: 12px; font-weight: 600; }
.stat .d.up { color: var(--ok); }
.stat .d.down { color: var(--red); }

/* ---------- pills / badges / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-soft);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.pill.bad { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.pill.info { background: color-mix(in srgb, var(--r-hospital) 13%, transparent); color: var(--r-hospital); }
.pill.acc { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.pill.plain::before { display: none; }
/* surgery classification */
.pill.emg { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.pill.elc { background: color-mix(in srgb, var(--r-hospital) 12%, transparent); color: var(--r-hospital); }

/* pathway banner (emergency / elective, driven by procedure choice) */
.pathway {
  display: flex; gap: 13px; align-items: flex-start;
  border-radius: 12px; padding: 14px 16px;
  font-size: 13px; margin-top: 16px;
}
.pathway .pw-ico { font-size: 20px; line-height: 1.2; }
.pathway b { display: block; margin-bottom: 3px; font-size: 13.5px; }
.pathway span { color: var(--ink-soft); line-height: 1.6; }
.pathway.emergency {
  background: color-mix(in srgb, var(--red) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
}
.pathway.emergency b { color: var(--red); }
.pathway.elective {
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
}
.pathway.elective b { color: var(--ok); }
/* classification badge inside treatment choice cards */
.choice .cls { position: absolute; top: 10px; inset-inline-end: 10px; }
.choice:has(.cls) { padding-inline-end: 96px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent); color: #fff;
  font-weight: 650; font-size: 13.5px;
  text-decoration: none;
}
:root[data-theme="dark"] .btn { color: #10201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #10201d; } }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost {
  background: transparent; color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); filter: none; }
.btn.quiet { background: var(--surface-2); color: var(--ink-soft); }
.btn.quiet:hover { color: var(--ink); filter: none; }
.btn.danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 9%, transparent); filter: none; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); }
.field .hint { font-size: 11.5px; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  width: 100%;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); }
.check input { margin-top: 3px; accent-color: var(--accent); }

/* ---------- choice cards (radio-style pick) ---------- */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.choice {
  position: relative; display: block;
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 14px 16px; cursor: pointer;
  background: var(--surface);
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice input { position: absolute; opacity: 0; }
.choice b { display: block; font-size: 13.5px; }
.choice small { color: var(--ink-faint); font-size: 12px; }
.choice:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ---------- wizard stepper ---------- */
.steps { display: flex; gap: 0; counter-reset: step; margin: 0 0 26px; }
.steps .st {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 8px; position: relative;
  color: var(--ink-faint); font-size: 12.5px; font-weight: 600;
}
.steps .st::before {
  counter-increment: step; content: counter(step);
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  display: grid; place-items: center;
  font-family: Consolas, monospace; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-faint);
  border: 1.5px solid var(--line);
}
.steps .st.done { color: var(--ink-soft); }
.steps .st.done::before { content: "✓"; background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--accent); }
.steps .st.now { color: var(--accent); }
.steps .st.now::before { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps .st:not(:last-child)::after {
  content: ""; flex: 1; height: 2px; margin-inline-start: 4px;
  background: var(--line);
}
.steps .st.done:not(:last-child)::after { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
@media (max-width: 700px) { .steps .st span { display: none; } }

.step-panel { display: none; }
.step-panel.on { display: block; }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ---------- case phase track (9 phases) ---------- */
.phase-track { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 2px; }
.phase-track .ph {
  flex: 1; min-width: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; position: relative;
  font-size: 11px; line-height: 1.3; color: var(--ink-faint); font-weight: 600;
}
.phase-track .ph i {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line);
  display: grid; place-items: center; font-style: normal; font-size: 10px;
  position: relative; z-index: 2;
}
.phase-track .ph:not(:last-child)::after {
  content: ""; position: absolute;
  top: 10px; inset-inline-start: calc(50% + 13px); inset-inline-end: calc(-50% + 13px);
  height: 2px; background: var(--line); z-index: 1;
}
.phase-track .ph.done { color: var(--ink-soft); }
.phase-track .ph.done i { border-color: var(--accent); background: var(--accent); color: #fff; }
.phase-track .ph.done i::before { content: "✓"; }
.phase-track .ph.done:not(:last-child)::after { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.phase-track .ph.now { color: var(--accent); }
.phase-track .ph.now i {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---------- vertical timeline ---------- */
.tl { display: flex; flex-direction: column; gap: 0; }
.tl .ev { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl .ev::before {
  content: ""; position: absolute; top: 18px; bottom: 0;
  inset-inline-start: 7px; width: 2px; background: var(--line-soft);
}
.tl .ev:last-child::before { display: none; }
.tl .ev i {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px;
  margin-top: 3px; background: var(--surface);
  border: 2px solid var(--accent); position: relative; z-index: 1; font-style: normal;
}
.tl .ev.dim i { border-color: var(--line); }
.tl .ev b { display: block; font-size: 13px; font-weight: 650; }
.tl .ev small { color: var(--ink-faint); font-size: 12px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13px; }
.tbl thead th {
  text-align: start; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
[dir="rtl"] .tbl thead th { letter-spacing: 0; }
.tbl tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tbl .who { display: flex; align-items: center; gap: 10px; }
.tbl .who b { display: block; font-size: 13px; }
.tbl .who small { color: var(--ink-faint); font-size: 11.5px; display: block; }

/* ---------- files ---------- */
.drop {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  padding: 26px; text-align: center; color: var(--ink-soft);
  cursor: pointer;
}
.drop b { color: var(--accent); }
.filerow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft);
}
.filerow:last-child { border-bottom: none; }
.filerow .fico {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 34px;
  background: var(--surface-2); color: var(--accent);
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}
.filerow b { display: block; font-size: 13px; font-weight: 600; }
.filerow small { color: var(--ink-faint); font-size: 11.5px; }
.filerow .end { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; padding: 4px 2px; }
.bubble {
  max-width: 78%;
  padding: 9px 13px; border-radius: 12px;
  background: var(--surface-2); font-size: 13px;
  align-self: flex-start;
  border-start-start-radius: 4px;
}
.bubble.me {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-start-start-radius: 12px; border-start-end-radius: 4px;
}
.bubble small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-faint); }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--surface); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(10, 18, 16, 0.55); padding: 20px;
}
.modal.open { display: flex; }
.modal .box {
  background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  padding: 24px;
}
.modal .box h3 { font-size: 17px; margin: 0 0 4px; }
.modal .box .sub { color: var(--ink-faint); font-size: 13px; margin: 0 0 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
[dir="rtl"] #toast { transform: translateX(50%); }
#toast .t {
  background: var(--ink); color: var(--ground);
  padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #toast .t { animation: none; } }

/* ---------- charts ---------- */
.chart { direction: ltr; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-lbl { fill: var(--ink-faint); font-size: 10.5px; font-family: "Segoe UI", sans-serif; }
.chart .dir-lbl { fill: var(--ink-soft); font-size: 11px; font-weight: 600; font-family: "Segoe UI", sans-serif; }
.chart .val-lbl { fill: var(--ink-soft); font-size: 10.5px; font-family: Consolas, monospace; }
.chart .s1 { stroke: var(--ch1); } .chart .f1 { fill: var(--ch1); }
.chart .s2 { stroke: var(--ch2); } .chart .f2 { fill: var(--ch2); }
.chart .s3 { stroke: var(--ch3); } .chart .f3 { fill: var(--ch3); }
.chart .s4 { stroke: var(--ch4); } .chart .f4 { fill: var(--ch4); }
.chart .s5 { stroke: var(--ch5); } .chart .f5 { fill: var(--ch5); }
.chart .ring { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.lgd { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-soft); margin-top: 10px; }
.lgd span { display: inline-flex; align-items: center; gap: 7px; }
.lgd i { width: 10px; height: 10px; border-radius: 3px; font-style: normal; }
details.data-tbl { margin-top: 10px; font-size: 12.5px; }
details.data-tbl summary { cursor: pointer; color: var(--ink-faint); font-weight: 600; }
details.data-tbl table { margin-top: 8px; }

#tip {
  position: fixed; z-index: 300; pointer-events: none;
  background: var(--ink); color: var(--ground);
  font-size: 12px; font-weight: 600; line-height: 1.4;
  padding: 6px 10px; border-radius: 6px;
  box-shadow: var(--shadow-lg);
  display: none; max-width: 240px;
}

/* ---------- kanban (operations portal) ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kcol {
  flex: 0 0 250px; min-height: 220px;
  background: var(--surface-2); border-radius: 14px; padding: 12px;
}
.kcol > h4 {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 12px; font-weight: 700;
}
[dir="rtl"] .kcol > h4 { letter-spacing: 0; }
.kcol .cnt {
  background: var(--surface); border-radius: 999px; padding: 1px 9px;
  font-family: Consolas, monospace; font-size: 11px; color: var(--ink-soft);
}
.kcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: grab;
}
.kcard:active { cursor: grabbing; }
.kcard b { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kcard small { color: var(--ink-faint); font-size: 11.5px; display: block; margin: 3px 0 9px; line-height: 1.5; }
.kcard .krow { display: flex; gap: 6px; flex-wrap: wrap; }
.kcard.dragging { opacity: 0.45; }
.kcol.dropover { outline: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: -2px; }

/* ---------- letter preview / QR ---------- */
.letter {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
  padding: 22px 24px; font-size: 13px; line-height: 1.7;
}
.letter .lh { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border-bottom: 2px solid var(--accent); padding-bottom: 12px; margin-bottom: 14px; }
.letter .lh b { font-family: Georgia, serif; font-size: 16px; }
.letter .sig { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-top: 20px; }
.letter .sig .line { border-top: 1px solid var(--ink-soft); padding-top: 6px; font-size: 11.5px; color: var(--ink-faint); min-width: 150px; }

/* ---------- progress ---------- */
.prog { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* ---------- checklist ---------- */
.cklist { display: flex; flex-direction: column; gap: 0; }
.cklist .ck {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.cklist .ck:last-child { border-bottom: none; }
.cklist .ck i {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px;
  display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-faint); border: 1.5px solid var(--line);
}
.cklist .ck.done i { background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: var(--ok); color: var(--ok); }
.cklist .ck.done i::before { content: "✓"; }
.cklist .ck .end { margin-inline-start: auto; }

/* ---------- landing ---------- */
.land-top {
  display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(20px, 5vw, 56px);
  position: sticky; top: 0; z-index: 50;
  background: var(--ground);
  border-bottom: 1px solid var(--line-soft);
}
.land-top nav { display: flex; gap: 22px; font-size: 13.5px; font-weight: 600; }
.land-top nav a { color: var(--ink-soft); }
.land-top nav a:hover { color: var(--accent); text-decoration: none; }
.land-top .end { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
@media (max-width: 860px) { .land-top nav { display: none; } }

.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(40px, 7vw, 90px) clamp(20px, 5vw, 56px);
  max-width: 1220px; margin: 0 auto;
}
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.12; margin: 0 0 18px; }
.hero .lede { font-size: 16.5px; color: var(--ink-soft); max-width: 54ch; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .proof { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }

.section { padding: clamp(36px, 6vw, 70px) clamp(20px, 5vw, 56px); max-width: 1220px; margin: 0 auto; }
.section > h2 { font-family: Georgia, serif; font-size: clamp(22px, 3vw, 30px); margin: 0 0 8px; }
.section > .sub { color: var(--ink-soft); max-width: 60ch; margin: 0 0 28px; }

.journey { display: grid; grid-template-columns: repeat(9, 1fr); gap: 10px; }
@media (max-width: 1100px) { .journey { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .journey { grid-template-columns: repeat(2, 1fr); } }
.jcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 14px 13px; font-size: 12px; line-height: 1.4;
}
.jcard .n { font-family: Consolas, monospace; font-size: 11px; font-weight: 700; color: var(--accent); display: block; margin-bottom: 6px; }
.jcard b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.jcard span { color: var(--ink-faint); }

.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .portal-grid { grid-template-columns: 1fr; } }
.portal {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; border-top: 3px solid var(--pc, var(--accent));
  box-shadow: var(--shadow);
}
.portal:hover { text-decoration: none; box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--pc) 40%, var(--line)); }
.portal .pico {
  width: 40px; height: 40px; border-radius: 10px;
  background: color-mix(in srgb, var(--pc) 14%, transparent); color: var(--pc);
  display: grid; place-items: center; margin-bottom: 14px;
}
.portal .pico svg { width: 20px; height: 20px; }
.portal b { display: block; font-size: 15.5px; margin-bottom: 5px; }
.portal p { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.portal .go { font-size: 13px; font-weight: 650; color: var(--pc); }

.land-foot {
  border-top: 1px solid var(--line);
  padding: 30px clamp(20px, 5vw, 56px);
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between;
  color: var(--ink-faint); font-size: 12.5px;
}

/* ============================================================
   Arab-world theme layer
   ============================================================ */

/* Arabic typography — Sakkal Majalla / Traditional Arabic for display,
   Segoe UI (full Arabic coverage) for body; no letter-spacing in Arabic */
html[lang="ar"] body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] .brand b, html[lang="ar"] .letter .lh b {
  font-family: "Sakkal Majalla", "Traditional Arabic", "Segoe UI", serif;
}
html[lang="ar"] h1 { line-height: 1.35; }
html[lang="ar"] .hero h1 { font-size: clamp(32px, 5vw, 54px); }
html[lang="ar"] .eyebrow, html[lang="ar"] .stat .k, html[lang="ar"] .tbl thead th,
html[lang="ar"] .pill, html[lang="ar"] .steps .st { letter-spacing: 0; }
html[lang="ar"] .card > h3, html[lang="ar"] .card .card-h { font-size: 15.5px; }

/* keep case codes, amounts and phone numbers left-to-right inside RTL text */
.mono, .num { direction: ltr; unicode-bidi: embed; }

/* rich-markup translations: paired blocks shown per language */
html[lang="ar"] .en-only { display: none !important; }
html:not([lang="ar"]) .ar-only { display: none !important; }

/* khatam lattice — subtle Islamic-geometry background for hero & accents */
.arab-lattice {
  background-image:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 1px, transparent 1px 28px);
}

/* ornament divider — eight-pointed star between hairlines */
.orna {
  display: flex; align-items: center; gap: 16px;
  color: var(--accent); margin: 0 0 20px;
  font-size: 15px; line-height: 1;
}
.orna::before, .orna::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to var(--orna-dir, right), transparent, color-mix(in srgb, var(--accent) 40%, transparent), transparent);
}

/* mihrab-arch treatment for portal icons */
.portal .pico { border-radius: 999px 999px 10px 10px; }

/* dual-calendar date line */
.dateline { font-size: 13px; color: var(--ink-soft); }
.dateline .hijri { color: var(--accent); font-weight: 600; }

/* ============================================================
   Interaction layer
   ============================================================ */

/* smooth theme switch */
body, .card, .side, .top { transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* hover & press feedback */
.grid .card { transition: box-shadow 0.25s ease, background-color 0.3s ease, border-color 0.3s ease; }
.grid .card:hover { box-shadow: var(--shadow-lg); }
.btn, .icon-btn { transition: transform 0.12s ease, filter 0.15s ease, background-color 0.2s ease; }
.btn:active, .icon-btn:active { transform: scale(0.96); }

/* live pulse on active-state pills */
.pill.acc::before, .pill.warn::before { animation: pill-pulse 2s ease-in-out infinite; }
@keyframes pill-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .pill.acc::before, .pill.warn::before { animation: none; } }

/* sortable tables */
.tbl thead th[data-sort] { cursor: pointer; user-select: none; }
.tbl thead th[data-sort]:hover { color: var(--accent); }
.tbl thead th .arr { font-size: 9px; margin-inline-start: 4px; }

/* chart entrance animations */
.chart.anim rect[class*="f"] {
  transform-box: fill-box; transform-origin: bottom;
  animation: bar-grow 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
@keyframes bar-grow { from { transform: scaleY(0); } }
.chart.anim polyline { transition: stroke-dashoffset 1.1s ease 0.15s; }
@media (prefers-reduced-motion: reduce) {
  .chart.anim rect[class*="f"] { animation: none; }
  .chart.anim polyline { transition: none; }
}

/* progress bars animate */
.prog i { transition: width 0.25s ease; }

/* notification center */
.notif-wrap { position: relative; display: grid; }
.notif-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 90;
  width: 330px; max-width: 86vw;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 8px;
  animation: pop-in 0.18s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .notif-panel { animation: none; } }
.notif-panel .nh { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; font-weight: 650; font-size: 13px; }
.notif-panel .nh button { border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 600; padding: 0; }
.notif-panel .ni { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; }
.notif-panel .ni:hover { background: var(--surface-2); }
.notif-panel .ni i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: 0 0 8px; font-style: normal; }
.notif-panel .ni.read i { background: var(--line); }
.notif-panel .ni small { display: block; color: var(--ink-faint); font-size: 11px; margin-top: 2px; }

/* phase-track popover */
#pop {
  position: fixed; z-index: 300; width: 235px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 12px 14px; font-size: 12.5px;
  animation: pop-in 0.16s ease;
}
#pop b { display: block; margin-bottom: 3px; }
.phase-track .ph { cursor: pointer; }
.phase-track .ph:hover i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }

/* chat typing indicator */
.bubble.typing { display: inline-flex; gap: 4px; align-items: center; padding: 13px 14px; }
.bubble.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint);
  font-style: normal; animation: typing-blink 1.2s infinite;
}
.bubble.typing i:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* modal entrance */
.modal.open .box { animation: pop-in 0.2s ease; }
@media (prefers-reduced-motion: reduce) { .modal.open .box { animation: none; } }

/* hero demo message crossfade */
#hero-msg { transition: opacity 0.28s ease; }

/* gradient keyword in the hero headline */
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* hero slider — snap carousel for the hero's right column */
.hslider { position: relative; min-width: 0; }
.hs-track {
  display: flex; gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 6px 2px 16px;
}
.hs-track::-webkit-scrollbar { display: none; }
.hs-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; }
.hs-slide > .card { height: 100%; }
.hs-nav {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 2px;
}
.hs-nav button.hs-arrow {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); cursor: pointer;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.hs-nav button.hs-arrow:hover { border-color: var(--accent); color: var(--accent); }
.hs-dots { display: flex; gap: 7px; align-items: center; }
.hs-dots > * {
  width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0;
  background: color-mix(in srgb, var(--ink-faint) 40%, transparent);
  font-style: normal; cursor: pointer; position: relative;
  transition: width 0.25s ease, background 0.25s ease;
}
.hs-dots > .on {
  width: 22px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.hs-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }

/* ============================================================
   Modern layer — gradients, glass, ambient light, geometry
   ============================================================ */

/* ambient background washes (adapts to role accent + theme) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 420px at 88% -8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    radial-gradient(560px 420px at -8% 34%, color-mix(in srgb, var(--sand) 7%, transparent), transparent 70%);
}

/* gradient primary actions */
.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
}
.btn:hover {
  filter: brightness(1.07);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn.ghost, .btn.quiet, .btn.danger { background: none; box-shadow: none; }
.btn.ghost { background: transparent; }
.btn.quiet { background: var(--surface-2); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: none; }
.btn.quiet:hover { box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 9%, transparent); box-shadow: none; }
.btn.sm { border-radius: 9px; }
.icon-btn { border-radius: 10px; }

/* gradient identity: brand wordmark, stat values, brand mark */
.brand .mark { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand b, .stat .v {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* glass chrome */
.top {
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}
.land-top {
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}
#hero-demo {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* softer, larger geometry */
.top .search { border-radius: 10px; }
.modal .box { border-radius: 16px; }
.choice { border-radius: 12px; }
.portal { border-radius: 16px; }
.jcard { border-radius: 12px; }
.letter { border-radius: 12px; }
.drop { border-radius: 14px; }

/* ---------- discovery layer (landing) ---------- */

/* AI search bar */
.ai-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow); max-width: 560px; margin: 0 0 22px;
}
[dir="rtl"] .ai-search { padding: 6px 16px 6px 6px; }
.ai-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.ai-search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14.5px; min-width: 0; }
.ai-search .icon-btn { border: 0; background: var(--surface-2); flex: 0 0 36px; }

/* comparison tool */
.cmp-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 860px) { .cmp-form { grid-template-columns: 1fr 1fr; } }
.cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
@media (max-width: 700px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.cmp-row:last-child { border-bottom: none; }
.cmp-row .k { color: var(--ink-faint); }
.cmp-row .v { font-weight: 650; text-align: end; }
.cmp-note { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }
.cmp-error { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 12px; }

/* pricing */
.price-strike { text-decoration: line-through; color: var(--ink-faint); font-weight: 500; }
.price-big { font-size: 22px; font-weight: 700; }

/* discovery card rows */
.disc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .disc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .disc-grid { grid-template-columns: 1fr; } }
.disc-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .disc-grid.g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .disc-grid.g3 { grid-template-columns: 1fr; } }
.meta-line { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-faint); }
.meta-line b { color: var(--ink); font-weight: 650; }

/* procedures quick grid */
.proc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.proc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
}
.proc b { font-size: 13.5px; }
.proc small { color: var(--ink-faint); font-size: 11.5px; }
.proc .from { color: var(--accent); font-weight: 700; font-size: 14px; }

/* hospital join band */
.join-band {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: 18px;
  padding: 30px clamp(20px, 4vw, 40px);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
:root[data-theme="dark"] .join-band { color: #10201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .join-band { color: #10201d; } }
.join-band h2 { font-family: Georgia, serif; font-size: clamp(19px, 2.4vw, 25px); margin: 0 0 4px; }
html[lang="ar"] .join-band h2 { font-family: "Sakkal Majalla", "Traditional Arabic", serif; }
.join-band p { opacity: 0.85; font-size: 13.5px; max-width: 60ch; }
.join-band .btn { background: var(--surface); color: var(--accent); box-shadow: none; }
.join-band .btn:hover { filter: brightness(0.97); box-shadow: none; }

/* floating AI assistant */
.ai-fab {
  position: fixed; inset-inline-end: 22px; bottom: 22px; z-index: 95;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-lg); cursor: pointer;
}
:root[data-theme="dark"] .ai-fab { color: #10201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-fab { color: #10201d; } }
.ai-fab:hover { filter: brightness(1.06); }
.ai-panel {
  position: fixed; inset-inline-end: 22px; bottom: 86px; z-index: 95;
  width: 370px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
.ai-panel.open { display: flex; animation: pop-in 0.2s ease; }
.ai-panel .head {
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
:root[data-theme="dark"] .ai-panel .head { color: #10201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-panel .head { color: #10201d; } }
.ai-panel .head small { display: block; font-weight: 500; font-size: 11px; opacity: 0.85; }
.ai-panel .head button { border: 0; background: none; color: inherit; font-size: 18px; cursor: pointer; padding: 0 2px; }
.ai-panel .chat { padding: 12px 14px; max-height: 290px; }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 14px 10px; }
.ai-chips button {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 999px; padding: 5px 12px;
  font-size: 12px; color: var(--ink-soft); cursor: pointer;
}
.ai-chips button:hover { border-color: var(--accent); color: var(--accent); }
.ai-panel .chat-input { padding: 0 14px 14px; margin-top: 0; }

/* ---------- photography ---------- */
img { max-width: 100%; }
.card-img {
  width: calc(100% + 40px); margin: -18px -20px 14px;
  height: 150px; object-fit: cover; display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}
.thumb { width: 100%; height: 92px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 8px; }
.portrait { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; flex: 0 0 74px; }
.portrait.sm { width: 46px; height: 46px; flex: 0 0 46px; }
.photo { width: 100%; object-fit: cover; border-radius: 12px; display: block; }

/* landing hero with ambient photo */
.hero-bg { position: relative; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../img/hero.jpg") center/cover no-repeat;
  opacity: 0.13;
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 96%);
  mask-image: linear-gradient(to bottom, black 30%, transparent 96%);
}
.hero-bg > * { position: relative; z-index: 1; }

/* ---------- doctors module ---------- */
.bcrumbs {
  display: flex; gap: 8px; align-items: center;
  font-size: 12.5px; color: var(--ink-faint);
  padding: 14px clamp(20px, 5vw, 56px) 0;
  max-width: 1220px; margin: 0 auto; width: 100%;
}
.bcrumbs a { color: var(--ink-faint); }
.bcrumbs a:hover { color: var(--accent); text-decoration: none; }
.bcrumbs b { color: var(--ink-soft); font-weight: 600; }

/* dark clinical hero panel — deliberately single-look in both themes */
.doc-hero {
  background:
    linear-gradient(120deg, rgba(8, 52, 47, 0.93), rgba(15, 74, 66, 0.86)),
    url("../img/surgeons.jpg") center/cover no-repeat;
  color: #fff; border-radius: 18px;
  padding: clamp(22px, 4vw, 40px);
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(18px, 3vw, 36px); align-items: center;
}
@media (max-width: 900px) { .doc-hero { grid-template-columns: 1fr; } }
.doc-hero h1 { color: #fff; font-size: clamp(25px, 3.4vw, 38px); margin: 0 0 10px; }
.doc-hero > div > p { opacity: 0.82; font-size: 14px; max-width: 52ch; }
.stat-pill {
  display: inline-flex; gap: 7px; align-items: center;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff; border-radius: 999px; padding: 6px 14px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.doc-hero .form-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px; padding: 18px 20px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.doc-hero .form-card h3 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.doc-hero .form-card label { color: rgba(255, 255, 255, 0.85); }
.doc-hero .form-card input, .doc-hero .form-card textarea {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.doc-hero .form-card input::placeholder, .doc-hero .form-card textarea::placeholder { color: rgba(255, 255, 255, 0.55); }
.doc-hero .form-card .hint { color: rgba(255, 255, 255, 0.6); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 16px;
  font-size: 13.5px; font-weight: 650; color: var(--ink-faint);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--ink); }

/* doctor cards */
.doc-card { display: flex; flex-direction: column; gap: 11px; }
.doc-top { display: flex; gap: 12px; align-items: center; }
.doc-top b { font-size: 14.5px; display: block; }
.doc-top small { color: var(--ink-faint); font-size: 12px; display: block; line-height: 1.5; }
.doc-price { display: flex; align-items: baseline; gap: 8px; }
.rating { color: #c8922a; font-weight: 700; font-size: 12.5px; }

/* skeleton shimmer */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel-move 1.1s linear infinite;
  border-radius: 8px; color: transparent;
}
@keyframes skel-move { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* booking slot chips */
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot {
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 9px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.slot:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.slot.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ---------- registration beauty layer ---------- */
.reg-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px; align-items: start;
}
@media (max-width: 980px) {
  .reg-layout { grid-template-columns: 1fr; }
  .reg-layout .reg-rail { display: none; }
}
.reg-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.reg-rail .card { padding: 16px 18px; }
.reg-rail .card > h3 { font-size: 13.5px; }

/* friendlier inputs, compact vertical rhythm — each step should fit the viewport */
.reg-page .field input, .reg-page .field select, .reg-page .field textarea {
  padding: 10px 13px; border-radius: 10px; font-size: 14px;
}
.reg-page .field label { font-size: 12.5px; }
.reg-page .field { gap: 4px; }
.reg-page .field .hint { font-size: 11px; }
.reg-page .form-grid { gap: 12px; }
.reg-page textarea { min-height: 56px; }
.reg-page .steps .st::before { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
.reg-page .steps { margin-bottom: 12px; }
.reg-page .eyebrow { margin-bottom: 6px; }
.reg-page .step-panel.card, .reg-page .step-panel .card { padding: 16px 18px; }
.reg-page .card > h3, .reg-page .card .card-h { margin-bottom: 10px; font-size: 15px; }
.reg-page .choices { grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 9px; }
.reg-page .choice { padding: 10px 12px; }
.reg-page .choice:has(.cls) { padding-inline-end: 82px; }
.reg-page .choice small { font-size: 11px; }
.reg-page .pathway { padding: 10px 14px; margin-top: 12px; font-size: 12.5px; }
.reg-page .pathway span { line-height: 1.5; }
.reg-page .wizard-nav { margin-top: 14px; }
.reg-page .cklist .ck { padding: 7px 4px; font-size: 12.5px; }
.reg-page .check { font-size: 12.5px; }
.reg-page .drop { padding: 18px; }
.reg-chips { margin-bottom: 16px; }
.reg-chips .jperk { padding: 6px 13px; font-size: 12px; }
.reg-progresswrap { margin-bottom: 14px !important; }

/* header row: title left, trust chips right — saves a full row */
.reg-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.reg-head .reg-chips { margin: 0; }

/* tall steps split into two internal columns on desktop */
.s2-grid, .s4-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1020px) {
  .reg-page .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reg-page .form-grid .full { grid-column: 1 / -1; }
  .s2-grid, .s4-grid { grid-template-columns: 1fr 1fr; }
  .s2-grid .form-grid { grid-template-columns: 1fr 1fr; }
  .s4-grid > .card { margin-bottom: 0 !important; }
  /* treatment picker becomes a compact two-across list in the split layout */
  .s2-grid .choices { grid-template-columns: 1fr 1fr; gap: 7px; }
  .s2-grid .choice { padding: 8px 11px; }
  .s2-grid .choice:has(.cls) { padding-inline-end: 11px; }
  .s2-grid .choice b { font-size: 12.5px; margin-bottom: 3px; }
  .s2-grid .choice small { display: none; }
  .s2-grid .choice .cls { position: static; }
  .s2-grid .pathway { margin-top: 10px; padding: 9px 13px; }
  .s2-grid .pathway span {
    font-size: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  /* final chrome trims so steps clear an 800px viewport */
  .reg-page .land-top { padding-block: 10px; }
  .reg-head { margin-bottom: 10px; }
  .reg-page .steps { margin-bottom: 10px; }
}
/* shorter screens: slim the intro chrome so steps fit without scrolling */
@media (min-width: 1020px) and (max-height: 880px) {
  .reg-head .eyebrow, .reg-head .soft { display: none; }
  .reg-page main { padding-top: 14px !important; }
}

/* live progress bar above the wizard */
.reg-progresswrap {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 26px; font-size: 12.5px; font-weight: 650; color: var(--ink-soft);
}
.reg-progress {
  flex: 1; height: 7px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.reg-progress i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* reassurance chips under the intro */
.reg-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 26px; }

/* celebratory success check */
@media (prefers-reduced-motion: no-preference) {
  .check-pop { animation: check-pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1); }
}
@keyframes check-pop { from { transform: scale(0); opacity: 0; } }

/* ---------- landing beauty layer ---------- */
html { overflow-x: clip; }

/* section kickers — small gradient-dash labels above headings */
.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
[dir="rtl"] .kicker { letter-spacing: 0; }
.kicker::before {
  content: ""; width: 24px; height: 2.5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* full-bleed tinted bands for alternating sections */
.band { position: relative; }
.band::before {
  content: ""; position: absolute; inset-block: 0; z-index: -1;
  left: 50%; width: 100vw; transform: translateX(-50%);
  background: color-mix(in srgb, var(--accent) 4%, var(--ground));
  border-block: 1px solid var(--line-soft);
}

/* soft glow behind the hero slider */
.hslider::before {
  content: ""; position: absolute; inset: -36px -30px; z-index: -1;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

/* hero stats: hairline separators */
.proof .stat + .stat { border-inline-start: 1px solid var(--line); padding-inline-start: 26px; }

/* trust cards: gradient icon medallions + hover accent */
.tico {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 999px 999px 11px 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: grid; place-items: center; margin-bottom: 12px;
}
:root[data-theme="dark"] .tico { color: #10201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tico { color: #10201d; } }
.tico svg { width: 19px; height: 19px; }
#trust .card { transition: border-color 0.2s ease, box-shadow 0.25s ease; }
#trust .card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* portal cards: icon fills + arrow slides on hover */
.portal .pico { transition: background 0.25s ease, color 0.25s ease; }
.portal:hover .pico { background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #fff)); color: #fff; }
.portal .go { display: inline-block; transition: transform 0.2s ease; }
.portal:hover .go { transform: translateX(4px); }
[dir="rtl"] .portal:hover .go { transform: translateX(-4px); }

/* procedure tiles: gentle lift */
.proc { transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease; }
.proc:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) { .proc:hover { transform: none; } }

/* join band: faint lattice texture over the gradient */
.join-band {
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 26px),
    linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* anchored sections clear the sticky header */
.section { scroll-margin-top: 84px; }

/* journey acts — itinerary-style three-act layout */
.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
@media (max-width: 980px) { .acts { grid-template-columns: 1fr; gap: 20px; } }
.act { position: relative; padding: 24px 24px 16px; overflow: hidden; }
.act::before {
  content: attr(data-n);
  position: absolute; top: -20px; inset-inline-end: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 120px; font-weight: 700; line-height: 1;
  color: var(--accent); opacity: 0.07; pointer-events: none;
}
.act:not(:last-child)::after {
  content: "❯";
  position: absolute; top: 50%; inset-inline-end: -27px; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--accent); font-size: 12px;
  display: grid; place-items: center; z-index: 2;
}
[dir="rtl"] .act:not(:last-child)::after { content: "❮"; }
@media (max-width: 980px) { .act:not(:last-child)::after { display: none; } }
.act-head { display: flex; gap: 13px; align-items: center; margin-bottom: 18px; }
.act-head .aico {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: grid; place-items: center;
}
.act-head .aico svg { width: 22px; height: 22px; }
.act-head b { font-size: 16.5px; display: block; }
.act-head small { color: var(--ink-faint); font-size: 12px; }
.act-steps { list-style: none; margin: 0; padding: 0; }
.act-steps li { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.act-steps li:last-child { padding-bottom: 4px; }
.act-steps li::before {
  content: ""; position: absolute; top: 32px; bottom: 2px; inset-inline-start: 15px;
  border-inline-start: 2px dotted color-mix(in srgb, var(--accent) 38%, var(--line));
}
.act-steps li:last-child::before { display: none; }
.act-steps i {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  display: grid; place-items: center; font-style: normal;
  font-family: Consolas, "SF Mono", monospace; font-size: 12.5px; font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  position: relative; z-index: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.act-steps li:hover i {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; transform: scale(1.1);
}
:root[data-theme="dark"] .act-head .aico, :root[data-theme="dark"] .act-steps li:hover i { color: #10201d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .act-head .aico,
  :root:not([data-theme="light"]) .act-steps li:hover i { color: #10201d; }
}
.act-steps b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.act-steps li > div > span { font-size: 12.5px; color: var(--ink-faint); line-height: 1.55; display: block; }
.act-steps li.bonus i { border-style: dashed; }

/* journey promise pills */
.jperks { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.jperk {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 17px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

/* custom flag dropdowns — native <option> can't render images */
.fsel { position: relative; }
.fsel > select { display: none; }
.fsel-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 8px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: start; white-space: nowrap;
}
.fsel-btn:hover { background: var(--surface-2); }
.fsel-btn .car { color: var(--ink-faint); font-size: 9px; padding-inline-start: 4px; }
.field .fsel { width: 100%; }
.field .fsel-btn { width: 100%; padding: 9px 12px; border-radius: 7px; font-weight: 500; font-size: 14px; }
.field .fsel-btn .car { margin-inline-start: auto; }
.land-top .fsel-btn { padding: 7px 10px; font-size: 12.5px; }
.fsel-list {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 130;
  width: max-content; min-width: 100%; max-width: min(300px, 88vw);
  max-height: 288px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 45%, var(--line)) transparent;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px;
  animation: pop-in 0.15s ease;
}
.fsel-list::-webkit-scrollbar { width: 8px; height: 8px; display: block; }
.fsel-list::-webkit-scrollbar-track { background: transparent; }
.fsel-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 99px;
  border: 2px solid var(--surface);
}
.fsel-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.field .fsel-list { width: 100%; }
.land-top .fsel-list, .top .fsel-list { inset-inline-start: auto; inset-inline-end: 0; }
@media (prefers-reduced-motion: reduce) { .fsel-list { animation: none; } }
.fsel-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 8px;
  font-size: 13px; color: var(--ink-soft); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fsel-opt > * { flex-shrink: 0; }
.fsel-opt:hover { background: var(--surface-2); color: var(--ink); }
.fsel-opt.on {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent); font-weight: 650;
}

/* flag emoji rendered as real images (Windows has no flag glyphs) */
img.femoji {
  width: 1.3em; height: auto;
  display: inline-block; vertical-align: -0.18em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}

/* country flag chips — click to wear that country's colours */
.flags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.flag-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.flag-chip:hover { border-color: var(--accent); color: var(--accent); }
.flag-chip:active { transform: scale(0.95); }
.flag-chip .fl { font-size: 16px; line-height: 1; }

/* landing footer columns */
.foot-cols {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px;
  padding: 44px clamp(20px, 5vw, 56px) 10px;
  max-width: 1220px; margin: 0 auto;
}
@media (max-width: 860px) { .foot-cols { grid-template-columns: repeat(2, 1fr); } }
.foot-cols h4 {
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 10px; font-weight: 700;
}
[dir="rtl"] .foot-cols h4 { letter-spacing: 0; }
.foot-cols a { display: block; font-size: 13px; color: var(--ink-soft); padding: 3.5px 0; }
.foot-cols a:hover { color: var(--accent); text-decoration: none; }
.foot-cols .num { font-size: 13px; color: var(--ink-soft); padding: 3.5px 0; display: block; }

/* footer affiliation strip (IACCIA) */
.foot-aff {
  max-width: 1220px; margin: 0 auto;
  padding: 10px clamp(20px, 5vw, 56px) 28px;
  display: flex; gap: 16px; align-items: center;
}
.foot-aff img {
  width: 68px; height: auto; flex: 0 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
}
.foot-aff b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.foot-aff small { color: var(--ink-faint); font-size: 12px; line-height: 1.5; }
@media (max-width: 640px) { .foot-aff { flex-direction: column; align-items: flex-start; } }

/* ============================================================
   Motion & cinema layer
   ============================================================ */

/* hero entrance choreography */
@media (prefers-reduced-motion: no-preference) {
  .hero-enter > * { animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; }
  .hero-enter > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-enter > *:nth-child(2) { animation-delay: 0.13s; }
  .hero-enter > *:nth-child(3) { animation-delay: 0.21s; }
  .hero-enter > *:nth-child(4) { animation-delay: 0.29s; }
  .hero-enter > *:nth-child(5) { animation-delay: 0.37s; }
  .hero-enter > *:nth-child(6) { animation-delay: 0.45s; }
  .hero-enter > *:nth-child(7) { animation-delay: 0.53s; }
  .hero-enter-card { animation: rise-in 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.4s backwards; }
  .hero-bg::after { animation: slow-zoom 26s ease-in-out infinite alternate; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes slow-zoom { to { transform: scale(1.07); } }

/* ECG heartbeat trace */
.ecg { width: 230px; max-width: 60%; display: block; margin: 4px 0 14px; opacity: 0.6; }
.ecg polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .ecg polyline { stroke-dasharray: 330; stroke-dashoffset: 330; animation: ecg-run 3.4s linear infinite; }
}
@keyframes ecg-run { to { stroke-dashoffset: -330; } }

/* Murshid FAB ping */
@media (prefers-reduced-motion: no-preference) {
  .ai-fab::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    border: 2px solid var(--accent);
    animation: fab-ping 3.8s ease-out infinite;
  }
}
@keyframes fab-ping {
  0% { opacity: 0.65; transform: scale(1); }
  35%, 100% { opacity: 0; transform: scale(1.4); }
}

/* photo hover life */
.card:has(.card-img) { overflow: hidden; }
.card-img { transition: transform 0.5s ease; }
.card:hover .card-img { transform: scale(1.045); }
@media (prefers-reduced-motion: reduce) { .card:hover .card-img { transform: none; } }

/* accreditation marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line-soft); padding: 15px 0; }
.marquee .track { display: flex; gap: 48px; width: max-content; }
@media (prefers-reduced-motion: no-preference) {
  .marquee .track { animation: marquee 32s linear infinite; }
  [dir="rtl"] .marquee .track { animation-name: marquee-rtl; }
  .marquee:hover .track { animation-play-state: paused; }
}
.marquee span { display: inline-flex; gap: 9px; align-items: center; font-size: 13px; font-weight: 650; color: var(--ink-faint); white-space: nowrap; }
.marquee span i { font-style: normal; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* cinema — video-style guided tour */
.cinema {
  position: relative; border-radius: 18px; overflow: hidden;
  aspect-ratio: 21 / 9; background: #0b1f1c; box-shadow: var(--shadow-lg);
  contain: layout paint; /* keep slide repaints inside the frame */
}
@media (max-width: 700px) { .cinema { aspect-ratio: 4 / 3; } }
.cinema .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; will-change: opacity; }
.cinema .slide.on { opacity: 1; }
.cinema .slide img { width: 100%; height: 100%; object-fit: cover; display: block; backface-visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .cinema .slide.on img { animation: kenburns 6.8s ease-out forwards; }
}
@keyframes kenburns { from { transform: scale(1.12) translate(2%, 1%); } to { transform: scale(1); } }
.cinema .shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(5, 20, 17, 0.78), transparent 55%);
}
.cinema .cap { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding: 22px 26px; color: #fff; }
.cinema .cap b { display: block; font-size: clamp(16px, 2.2vw, 22px); margin-bottom: 3px; }
.cinema .cap small { opacity: 0.85; font-size: 13.5px; }
.cinema .bar { position: absolute; top: 0; inset-inline-start: 0; z-index: 3; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.cinema .ctrl { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3; }
.cinema .ctrl button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35); color: #fff;
  display: grid; place-items: center; cursor: pointer; font-size: 15px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cinema .dots { position: absolute; bottom: 16px; inset-inline-end: 20px; z-index: 3; display: flex; gap: 7px; align-items: center; }
.cinema .dots > * { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, 0.4); font-style: normal; cursor: pointer; position: relative; }
.cinema .dots > .on { background: #fff; }

/* ============================================================
   Responsive layer — mobile navigation & small-screen fixes
   ============================================================ */

/* dashboard sidebar becomes a slide-in drawer on mobile */
.menu-btn, .nav-btn { display: none; }
.side-backdrop {
  display: none; position: fixed; inset: 0; z-index: 199;
  background: rgba(10, 18, 16, 0.45);
}
.side-backdrop.show { display: block; }
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .side {
    display: flex;
    position: fixed; inset-block: 0; inset-inline-start: 0;
    height: 100dvh; width: 268px; max-width: 82vw; z-index: 200;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .side { transform: translateX(105%); }
  .side.open { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* landing header: hamburger + dropdown nav */
@media (max-width: 860px) {
  .nav-btn { display: grid; }
  .land-top nav {
    display: none;
    position: absolute; top: 100%; inset-inline: 0; z-index: 60;
    flex-direction: column; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 6px 20px 12px;
  }
  .land-top nav.open { display: flex; }
  .land-top nav a { padding: 11px 4px; border-bottom: 1px solid var(--line-soft); }
  .land-top nav a:last-child { border-bottom: none; }
}

/* compact headers on small phones */
@media (max-width: 600px) {
  .top { gap: 8px; padding: 10px 14px; }
  .top .search { display: none; }
  .land-top { gap: 10px; padding-block: 12px; }
  .land-top .end { gap: 6px; }
  .land-top .end > a.btn.ghost.sm { display: none; }
  .brand small { display: none; }
  .content { gap: 16px; }
}

/* doctor profile: content + sticky booking sidebar */
.profile-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px; align-items: start;
}
@media (max-width: 980px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-grid > .card { position: static !important; }
}

/* doctors filter row (5 columns) */
.cmp-form.five { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
@media (max-width: 900px) { .cmp-form.five { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cmp-form, .cmp-form.five { grid-template-columns: 1fr; } }

/* bottom tab bar — app-like patient navigation on phones */
.tabbar { display: none; }
@media (max-width: 760px) {
  body[data-role="patient"] .content { padding-bottom: 92px; }
  body[data-role="patient"] #toast { bottom: 102px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 95;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 2px; border-radius: 11px;
    font-size: 10.5px; font-weight: 600; color: var(--ink-faint);
    text-decoration: none; white-space: nowrap;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.on {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
}

/* misc small-screen hardening */
.fsel-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.letter .sig { flex-wrap: wrap; }

/* grid items must be allowed to shrink below their content's intrinsic
   width — otherwise wide tables/charts force page-level overflow */
.grid > *, .disc-grid > *, .acts > *, .profile-grid > * { min-width: 0; }
.content > * { min-width: 0; max-width: 100%; }
.card-h { flex-wrap: wrap; row-gap: 6px; }
.filerow > div { min-width: 0; }
.filerow b { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .land-top { flex-wrap: wrap; }
  .land-top .end { flex-wrap: wrap; justify-content: flex-end; }
  .cklist .ck { flex-wrap: wrap; row-gap: 2px; }
  .filerow { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 430px) {
  .ai-search { flex-wrap: wrap; padding: 8px; }
  .ai-search .btn { flex: 1 1 100%; }
  .doc-hero { padding: 20px 16px; }
  .modal .box { padding: 18px 16px; }
  .cinema .cap { padding: 14px 16px; }
}

/* hidden-scrollbar horizontal strips with edge-fade affordance
   (applied automatically by app.js to .tbl-wrap, .phase-track, .kanban) */
.hscroll {
  scrollbar-width: none;
  --fade-l: 0px; --fade-r: 0px;
  -webkit-mask-image: linear-gradient(to right,
    transparent 0, #000 var(--fade-l),
    #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0, #000 var(--fade-l),
    #000 calc(100% - var(--fade-r)), transparent 100%);
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll.fade-l { --fade-l: 30px; }
.hscroll.fade-r { --fade-r: 30px; }
.chat { scrollbar-width: none; }
.chat::-webkit-scrollbar { display: none; }

/* kanban keyboard move-menu */
.kmenu {
  position: fixed; z-index: 300; min-width: 210px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px;
  animation: pop-in 0.15s ease;
}
.kmenu button {
  display: block; width: 100%; text-align: start;
  border: 0; background: none; font: inherit; cursor: pointer;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-soft);
}
.kmenu button:hover, .kmenu button:focus-visible { background: var(--surface-2); color: var(--ink); }

/* selectable conversation rows (messages) */
.chan { cursor: pointer; padding-inline: 10px; border-radius: 10px; }
.chan.chan-on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.chan:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* comfortable touch targets on touch devices (WCAG 2.5.5-friendly) */
@media (pointer: coarse) {
  .icon-btn { width: 42px; height: 42px; }
  .btn.sm { min-height: 42px; }
  .fsel-btn { min-height: 42px; }
  .slot { padding: 11px 15px; }
  .flag-chip { padding: 10px 15px; }
  .ai-chips button { padding: 9px 14px; }
  .tabbar a { padding-block: 9px; }
  .hs-dots > *::after, .cinema .dots > *::after { content: ""; position: absolute; inset: -13px; }
  .phase-track .ph i { position: relative; }
  .phase-track .ph i::after { content: ""; position: absolute; inset: -10px; }
}

/* modern thin scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-faint) 40%, transparent);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--ink-faint) 65%, transparent); }

/* ============================================================
   P1/P2 layer — validation, badges, empty states, print
   ============================================================ */

/* inline form validation */
.field.err input, .field.err select, .field.err textarea, .field.err .fsel-btn {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent);
}
.check.err { outline: 2px solid color-mix(in srgb, var(--red) 55%, transparent); outline-offset: 4px; border-radius: 6px; }
.err-msg { display: block; color: var(--red); font-size: 12px; font-weight: 600; margin-top: 5px; }
@keyframes thh-shake {
  20% { translate: -5px 0; } 40% { translate: 5px 0; }
  60% { translate: -3px 0; } 80% { translate: 3px 0; }
}
.shake { animation: thh-shake 0.35s ease; }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* unread badge on Messages nav links */
.side nav a, .tabbar a { position: relative; }
.unread-badge {
  display: inline-grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  margin-inline-start: auto;
}
.tabbar a .unread-badge { position: absolute; top: 4px; inset-inline-end: calc(50% - 19px); }

/* empty states */
.no-results { color: var(--ink-faint); font-size: 13px; }
div.no-results { padding: 18px 14px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; margin-top: 8px; }
tr.no-results td { padding: 18px 14px; text-align: center; }
.kempty {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 14px 10px; text-align: center;
  color: var(--ink-faint); font-size: 12px;
}

/* pause decorative animations offscreen (class toggled by app.js) */
.anim-pause, .anim-pause * { animation-play-state: paused !important; }

/* Arabic small-type readability bump (inline-styled sizes keep their value) */
html[lang="ar"] small, html[lang="ar"] .hint, html[lang="ar"] .muted { font-size: 12.5px; line-height: 1.65; }

/* resume-draft notice on the registration wizard */
.resume-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--teal) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--teal) 30%, transparent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.resume-note button { margin-inline-start: auto; }

/* ============================================================
   India-culture accent layer (body.tricolor — landing page)
   Saffron / white / green with chakra navy, blended into the
   platform's petrol-teal identity ("building bridges").
   ============================================================ */
body.tricolor {
  --in-saffron: #d9670b;
  --in-saffron-2: #f0921e;
  --in-green: #178a3c;
  --in-green-2: #2fae57;
  --in-navy: #27419a;
  --in-navy-2: #5d77c9;
  /* Holi gulal palette — deep stops are text-safe, -2 stops decorative */
  --in-saffron-text: #bb5909;
  --in-green-text: #17873b;
  --holi-pink: #c01a70; --holi-pink-2: #ef3fa0;
  --holi-purple: #6a30b8; --holi-purple-2: #9d6be0;
  --holi-blue: #2456d6; --holi-blue-2: #5b86ec;
  --holi-yellow: #f5c518;
  --holi-red: #e8501e;
}
:root[data-theme="dark"] body.tricolor {
  --in-saffron: #f59e2c; --in-saffron-2: #f6bb63;
  --in-saffron-text: #f59e2c;
  --in-green: #37b45f; --in-green-2: #5ecd84;
  --in-green-text: #37b45f;
  --in-navy: #7c95e8; --in-navy-2: #a9b9f0;
  --holi-pink: #ef6db6; --holi-pink-2: #f79ccd;
  --holi-purple: #a37ae0; --holi-purple-2: #c3a4ef;
  --holi-blue: #7c9cf0; --holi-blue-2: #a9bff5;
  --holi-yellow: #f7d045;
  --holi-red: #f37a51;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.tricolor {
    --in-saffron: #f59e2c; --in-saffron-2: #f6bb63;
    --in-saffron-text: #f59e2c;
    --in-green: #37b45f; --in-green-2: #5ecd84;
    --in-green-text: #37b45f;
    --in-navy: #7c95e8; --in-navy-2: #a9b9f0;
    --holi-pink: #ef6db6; --holi-pink-2: #f79ccd;
    --holi-purple: #a37ae0; --holi-purple-2: #c3a4ef;
    --holi-blue: #7c9cf0; --holi-blue-2: #a9bff5;
    --holi-yellow: #f7d045;
    --holi-red: #f37a51;
  }
}

/* gulal ribbon along the very top of the page — Holi powder spectrum */
body.tricolor::after {
  content: ""; position: fixed; top: 0; inset-inline: 0; height: 4px; z-index: 80;
  pointer-events: none;
  background: linear-gradient(90deg,
    var(--in-saffron-2), var(--holi-yellow) 18%, var(--holi-red) 36%,
    var(--holi-pink-2) 54%, var(--holi-purple-2) 72%, var(--holi-blue-2) 86%,
    var(--in-green-2));
  box-shadow: 0 1px 0 var(--line-soft);
}

/* section kickers: the dash becomes a miniature tricolour */
body.tricolor .kicker::before {
  width: 30px;
  background: linear-gradient(90deg,
    var(--in-saffron-2) 0 36%, #fdfdfb 36% 64%, var(--in-green) 64%);
  box-shadow: 0 0 0 1px var(--line-soft);
}

/* hero keyword: saffron through rani pink into the platform teal */
body.tricolor .grad {
  background-image: linear-gradient(105deg,
    var(--in-saffron), var(--holi-pink) 45%, var(--accent) 85%, var(--accent-2));
}

/* hero stats: each value wears a different gulal gradient */
body.tricolor .proof .stat:nth-child(2) .v { background-image: linear-gradient(120deg, var(--in-saffron), var(--in-green)); }
body.tricolor .proof .stat:nth-child(3) .v { background-image: linear-gradient(120deg, var(--holi-pink), var(--holi-purple)); }
body.tricolor .proof .stat:nth-child(4) .v { background-image: linear-gradient(120deg, var(--holi-blue), var(--accent)); }

/* hero slider glow: saffron + rani pink cast */
body.tricolor .hslider::before {
  background:
    radial-gradient(closest-side at 18% 12%,
      color-mix(in srgb, var(--in-saffron) 15%, transparent), transparent 70%),
    radial-gradient(closest-side at 85% 88%,
      color-mix(in srgb, var(--holi-pink) 12%, transparent), transparent 70%),
    radial-gradient(closest-side,
      color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%);
}

/* alternating band tints: royal-blue compare, marigold packages, mehndi portals */
body.tricolor #compare.band::before { background: color-mix(in srgb, var(--holi-blue) 5%, var(--ground)); }
body.tricolor #packages.band::before { background: color-mix(in srgb, var(--in-saffron) 6%, var(--ground)); }
body.tricolor #portals.band::before { background: color-mix(in srgb, var(--in-green) 5%, var(--ground)); }

/* trust medallions cycle saffron → rani pink → green → royal purple */
body.tricolor #trust .card:nth-child(1) .tico { background: linear-gradient(135deg, var(--in-saffron), var(--in-saffron-2)); }
body.tricolor #trust .card:nth-child(2) .tico { background: linear-gradient(135deg, var(--holi-pink), var(--holi-pink-2)); }
body.tricolor #trust .card:nth-child(3) .tico { background: linear-gradient(135deg, var(--in-green), var(--in-green-2)); }
body.tricolor #trust .card:nth-child(4) .tico { background: linear-gradient(135deg, var(--holi-purple), var(--holi-purple-2)); }

/* journey acts: each act wears its own colour (recolours icon, steps, chevron) */
body.tricolor #journey .act:nth-child(1) { --accent: var(--in-saffron-text); --accent-2: var(--in-saffron-2); }
body.tricolor #journey .act:nth-child(2) { --accent: var(--holi-blue); --accent-2: var(--holi-blue-2); }
body.tricolor #journey .act:nth-child(3) { --accent: var(--in-green-text); --accent-2: var(--in-green-2); }

/* journey promise pills cycle the palette */
body.tricolor .jperks .jperk:nth-child(4n+1) { --accent: var(--in-saffron-text); }
body.tricolor .jperks .jperk:nth-child(4n+2) { --accent: var(--holi-blue); }
body.tricolor .jperks .jperk:nth-child(4n+3) { --accent: var(--in-green-text); }
body.tricolor .jperks .jperk:nth-child(4n) { --accent: var(--holi-pink); }

/* procedure tiles: gulal powder line on top, like the bowls */
body.tricolor .proc { border-top: 3px solid var(--in-saffron-2); }
body.tricolor .proc:nth-child(8n+2) { border-top-color: var(--holi-pink-2); }
body.tricolor .proc:nth-child(8n+3) { border-top-color: var(--holi-blue-2); }
body.tricolor .proc:nth-child(8n+4) { border-top-color: var(--in-green-2); }
body.tricolor .proc:nth-child(8n+5) { border-top-color: var(--holi-purple-2); }
body.tricolor .proc:nth-child(8n+6) { border-top-color: var(--holi-yellow); }
body.tricolor .proc:nth-child(8n+7) { border-top-color: var(--holi-red); }
body.tricolor .proc:nth-child(8n) { border-top-color: var(--accent-2); }

/* Murshid button: rani pink → royal purple */
body.tricolor .ai-fab { background: linear-gradient(135deg, var(--holi-pink), var(--holi-purple)); }

/* ---- portal & registration accents (every tricolor page) ---- */

/* dashboard KPI values: first keeps the portal hue, the rest cycle gulal pairs */
body.tricolor .grid > .card.stat:nth-child(4n+2) .v { background-image: linear-gradient(120deg, var(--in-saffron), var(--in-green)); }
body.tricolor .grid > .card.stat:nth-child(4n+3) .v { background-image: linear-gradient(120deg, var(--holi-pink), var(--holi-purple)); }
body.tricolor .grid > .card.stat:nth-child(4n) .v { background-image: linear-gradient(120deg, var(--holi-blue), var(--accent)); }

/* wizard step chips: each step wears its own colour (circle, tick, connector) */
body.tricolor .steps .st:nth-child(4n+1) { --accent: var(--in-saffron-text); --accent-2: var(--in-saffron-2); }
body.tricolor .steps .st:nth-child(4n+2) { --accent: var(--holi-blue); --accent-2: var(--holi-blue-2); }
body.tricolor .steps .st:nth-child(4n+3) { --accent: var(--in-green-text); --accent-2: var(--in-green-2); }
body.tricolor .steps .st:nth-child(4n) { --accent: var(--holi-pink); --accent-2: var(--holi-pink-2); }

/* registration progress bar fills with the gulal spectrum */
body.tricolor .reg-progress i {
  background: linear-gradient(90deg,
    var(--in-saffron-2), var(--holi-pink-2) 40%, var(--holi-purple-2) 70%, var(--holi-blue-2));
}

/* registration trust chips cycle the palette */
body.tricolor .reg-chips .jperk:nth-child(3n+1) { --accent: var(--in-saffron-text); }
body.tricolor .reg-chips .jperk:nth-child(3n+2) { --accent: var(--holi-blue); }
body.tricolor .reg-chips .jperk:nth-child(3n) { --accent: var(--in-green-text); }

/* registration rail: privacy medallion in mehndi green */
body.tricolor .reg-rail .tico { background: linear-gradient(135deg, var(--in-green), var(--in-green-2)); }

/* accreditation marquee stars alternate saffron / green */
body.tricolor .marquee span:nth-child(odd) i { color: var(--in-saffron); }
body.tricolor .marquee span:nth-child(even) i { color: var(--in-green); }

/* India-network cards carry a saffron edge */
body.tricolor .in-accent { border-inline-start: 3px solid var(--in-saffron-2); }

/* IACCIA affiliation strip: tricolour hairline above */
body.tricolor .foot-aff { position: relative; margin-top: 8px; padding-top: 20px; }
body.tricolor .foot-aff::before {
  content: ""; position: absolute; top: 0; inset-inline-start: clamp(20px, 5vw, 56px);
  width: 132px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg,
    var(--in-saffron-2) 0 36%, #fdfdfb 36% 64%, var(--in-green) 64%);
  box-shadow: 0 0 0 1px var(--line-soft);
}

/* print — letters, verification pages, case summaries */
@media print {
  .side, .top, .land-top, .tabbar, .menu-btn, .nav-btn, .side-backdrop,
  .ai-fab, .ai-panel, .marquee, .hs-nav, .hs-dots, .cinema .ctrl, .cinema .dots,
  .btn, button, .toast, .notif-panel, .search, .kmenu, .reg-rail { display: none !important; }
  body, .shell, .content { background: #fff !important; color: #000 !important; }
  body::before { display: none !important; }
  .shell { display: block !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
  .card { border: 1px solid #bbb !important; box-shadow: none !important; break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
}
