/* Eyada — one stylesheet for the public site, the app, patient pages and printouts.
   Flat: solid fills, hairline borders, no gradients, glows or coloured shadows.
   Colourful by department: each one has a full colour (icons, buttons), a soft
   one (fills) and an ink one (text on the soft fill), always the same everywhere.
   RTL: logical properties only (inline-start / inline-end).
   A clinic's colour arrives as --th-* on <html>; everything reads --brand*. */

@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/alexandria-arabic-wght-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/alexandria-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font-body: 'IBM Plex Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Alexandria', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --brand: var(--th-brand, #0a7c70);
  --brand-ink: var(--th-brand-ink, #08584f);
  --brand-soft: var(--th-brand-soft, #ddf2ee);
  --on-brand: #ffffff;
  --bg: #f4f2fa;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --line: #e6e2f2;
  --line-strong: #d6d0e8;
  --ink: #1d1a33;
  --ink-2: #48436a;
  --muted: #6b6688;
  --nav-bg: #1b1640;
  --nav-2: #262055;
  --nav-3: #332c6e;
  --nav-ink: #d4d0ec;
  --nav-muted: #9d97c6;
  --ok: #237a36;
  --ok-soft: #e2f4e5;
  --warn: #8f5600;
  --warn-soft: #fff4d1;
  --danger: #b42318;
  --danger-soft: #ffe3e3;
  --info: #1b5fd9;
  --info-soft: #e2ecff;
  --violet: #6741d9;
  --violet-soft: #ece5ff;
  --wa: #157a42;
  --wa-soft: #e1f5e9;
  --star: #b7791f;
  /* Departments: full (icons, buttons), soft (fills), ink (text on the soft fill). */
  --clinic: #0a7c70;
  --clinic-soft: #ddf2ee;
  --clinic-ink: #08584f;
  --lab: #6741d9;
  --lab-soft: #ece5ff;
  --lab-ink: #3b1f99;
  --rad: #1b5fd9;
  --rad-soft: #e2ecff;
  --rad-ink: #123f91;
  --pharm: #237a36;
  --pharm-soft: #e2f4e5;
  --pharm-ink: #1a5c29;
  --ward: #c2410c;
  --ward-soft: #ffe8da;
  --ward-ink: #8a2d08;
  --pat: #c2255c;
  --pat-soft: #ffe3ee;
  --pat-ink: #a61e4d;
  --money: #e0a100;
  --money-soft: #fff4d1;
  --money-ink: #8f5600;
  --cyan: #0c8599;
  --cyan-soft: #ddf4f8;
  --cyan-ink: #0b5d6b;
  --indigo: #4c5fd5;
  --indigo-soft: #e6e9ff;
  --indigo-ink: #2f3c9e;
  --on-tone: #ffffff;
  --radius: 14px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --radius-xl: 26px;
  --side-w: 272px;
  --top-h: 70px;
  --tab-h: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: var(--th-brand-dk, #45c2b3);
    --brand-ink: var(--th-brand-dk, #45c2b3);
    --brand-soft: var(--th-brand-soft-dk, #10332f);
    --on-brand: #0c0a1c;
    --bg: #100e1f;
    --surface: #18152c;
    --surface-2: #1e1a36;
    --line: #2c2747;
    --line-strong: #3a345c;
    --ink: #ece9f8;
    --ink-2: #c3bedf;
    --muted: #9a94bb;
    --nav-bg: #0c0a1c;
    --nav-2: #1a1638;
    --nav-3: #241f4a;
    --ok: #69db7c;
    --ok-soft: #13311f;
    --warn: #ffc94d;
    --warn-soft: #3a2c0b;
    --danger: #ff8a80;
    --danger-soft: #3d1716;
    --info: #74a9ff;
    --info-soft: #152a52;
    --violet: #b197fc;
    --violet-soft: #2a1f4f;
    --wa: #69db7c;
    --wa-soft: #13311f;
    --star: #ffd43b;
    --clinic: #45c2b3;
    --clinic-soft: #10332f;
    --clinic-ink: #8de0d4;
    --lab: #b197fc;
    --lab-soft: #2a1f4f;
    --lab-ink: #d0bfff;
    --rad: #74a9ff;
    --rad-soft: #152a52;
    --rad-ink: #a5c8ff;
    --pharm: #69db7c;
    --pharm-soft: #13311f;
    --pharm-ink: #a6e9b0;
    --ward: #ffa374;
    --ward-soft: #3d2012;
    --ward-ink: #ffc6a5;
    --pat: #ff8fb8;
    --pat-soft: #3d1428;
    --pat-ink: #ffbfd6;
    --money: #ffd43b;
    --money-soft: #3a2c0b;
    --money-ink: #ffe08a;
    --cyan: #66d9e8;
    --cyan-soft: #0f3238;
    --cyan-ink: #a5ecf5;
    --indigo: #91a7ff;
    --indigo-soft: #1d2250;
    --indigo-ink: #c0ccff;
    --on-tone: #0c0a1c;
    color-scheme: dark;
  }
}

/* A tone puts one department's colours on --t (full), --t-soft and --t-ink. */
[data-tone='clinic'] { --t: var(--clinic); --t-soft: var(--clinic-soft); --t-ink: var(--clinic-ink); --on-t: var(--on-tone); }
[data-tone='lab'] { --t: var(--lab); --t-soft: var(--lab-soft); --t-ink: var(--lab-ink); --on-t: var(--on-tone); }
[data-tone='rad'] { --t: var(--rad); --t-soft: var(--rad-soft); --t-ink: var(--rad-ink); --on-t: var(--on-tone); }
[data-tone='pharm'] { --t: var(--pharm); --t-soft: var(--pharm-soft); --t-ink: var(--pharm-ink); --on-t: var(--on-tone); }
[data-tone='ward'] { --t: var(--ward); --t-soft: var(--ward-soft); --t-ink: var(--ward-ink); --on-t: var(--on-tone); }
[data-tone='pat'] { --t: var(--pat); --t-soft: var(--pat-soft); --t-ink: var(--pat-ink); --on-t: var(--on-tone); }
[data-tone='money'] { --t: var(--money); --t-soft: var(--money-soft); --t-ink: var(--money-ink); --on-t: #2b1e00; }
[data-tone='cyan'] { --t: var(--cyan); --t-soft: var(--cyan-soft); --t-ink: var(--cyan-ink); --on-t: var(--on-tone); }
[data-tone='indigo'] { --t: var(--indigo); --t-soft: var(--indigo-soft); --t-ink: var(--indigo-ink); --on-t: var(--on-tone); }
[data-tone='brand'] { --t: var(--brand); --t-soft: var(--brand-soft); --t-ink: var(--brand-ink); --on-t: var(--on-tone); }

/* Inside a department's pages its colour stands in for the clinic's. */
.main-wrap[data-tone] {
  --brand: var(--t);
  --brand-ink: var(--t-ink);
  --brand-soft: var(--t-soft);
  --on-brand: var(--on-t);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.35;
  margin: 0 0 0.4em;
}
h1 {
  font-size: 1.75rem;
  font-weight: 700;
}
h2 {
  font-size: 1.1rem;
  font-weight: 650;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.8em;
}
p {
  margin: 0 0 0.6em;
}
img {
  max-width: 100%;
}
code,
pre,
kbd {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
pre {
  padding: 0.7em;
  white-space: pre-wrap;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.center {
  text-align: center;
}
.num {
  font-variant-numeric: tabular-nums;
}
/* Big numbers (KPIs, totals) in the display face. */
.big-num,
.stat-value,
.hero-nums strong {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.end {
  text-align: end;
}
.pre {
  white-space: pre-line;
}
.text-danger {
  color: var(--danger);
}
.text-ok {
  color: var(--ok);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.sr-only:focus {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.ic {
  flex: none;
  vertical-align: -0.2em;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.btn-primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
}
.btn-soft {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand-ink);
}
.btn-soft:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.btn-wa {
  background: var(--wa-soft);
  border-color: transparent;
  color: var(--wa);
}
.btn-wa:hover {
  background: var(--wa-soft);
  border-color: var(--wa);
}
.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}
.btn-lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1.04rem;
  border-radius: 14px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn[data-armed] {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-block: 8px;
}
.inline-form {
  display: inline;
}

/* A form already sent: its button waits instead of sending again. */
.is-busy {
  opacity: 0.6;
  pointer-events: none;
  cursor: progress;
}

/* ------------------------------------------------------------------ forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-block-end: 14px;
  min-width: 0;
}
.field label,
.field-row label,
legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.req {
  color: var(--danger);
}
.hint {
  color: var(--muted);
  font-size: 0.8rem;
  display: block;
}
input:not([type='checkbox']):not([type='radio']):not([type='file']),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}
input[readonly] {
  background: var(--surface-2);
}
input[type='file'] {
  font: inherit;
  max-width: 100%;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px 4px;
  margin: 0 0 14px;
}
.check,
.radio {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-block: 6px 10px;
  cursor: pointer;
}
.check input,
.radio input {
  margin-block-start: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex: none;
}
.radio span {
  display: flex;
  flex-direction: column;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.stack > * + * {
  margin-block-start: 4px;
}
.form-cols {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}
/* A wide table inside a column scrolls in its card instead of widening the page. */
.form-cols > * {
  min-width: 0;
}
@media (min-width: 900px) {
  .form-cols {
    grid-template-columns: 1fr 1fr;
  }
}
.form-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 18px;
}
.sticky-foot {
  position: sticky;
  inset-block-end: 0;
  background: var(--bg);
  border-block-start: 1px solid var(--line);
  padding-block: 12px;
  margin-block-end: 0;
  z-index: 5;
}
.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 10px;
}
.field-row input {
  max-width: 190px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-block-end: 16px;
}
.filters .field {
  margin: 0;
  min-width: 150px;
}
.filters .chips {
  flex-basis: 100%;
  margin: 0;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  padding-inline-start: 14px;
  margin-block-end: 16px;
  color: var(--muted);
}
.search-bar input {
  border: 0 !important;
  outline: 0 !important;
  min-height: 40px !important;
  padding: 0 !important;
}
.copy-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.copy-row input {
  flex: 1 1 240px;
}
.hp {
  position: absolute;
  inset-inline-start: -9999px;
}

/* ----------------------------------------------------------------- flash */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 500;
  max-width: 1200px;
}
.main .flash,
.auth .flash,
form > .flash {
  margin-inline: 0;
}
.flash-err {
  background: var(--danger-soft);
  color: var(--danger);
}
.flash span {
  flex: 1;
}
.flash-x {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 4px;
}
.app .main-wrap > .flash {
  margin: 14px 24px 0;
}
.alerts {
  display: grid;
  gap: 8px;
  margin-block-end: 16px;
}
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--info-soft);
  color: var(--info);
  margin-block: 10px;
}
.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.alert-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* ------------------------------------------------------------- avatars */

.av {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  font-weight: 700;
  letter-spacing: 0;
  /* A full line box: at line-height 1 the Arabic letters sat above the middle. */
  line-height: 1.7;
  overflow: hidden;
}
.av-sm {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}
.av-md {
  width: 40px;
  height: 40px;
  font-size: 0.92rem;
}
.av-lg {
  width: 64px;
  height: 64px;
  font-size: 1.35rem;
}
.av-0 {
  background: var(--rad-soft);
  color: var(--rad-ink);
}
.av-1 {
  background: var(--pharm-soft);
  color: var(--pharm-ink);
}
.av-2 {
  background: var(--money-soft);
  color: var(--money-ink);
}
.av-3 {
  background: var(--lab-soft);
  color: var(--lab-ink);
}
.av-4 {
  background: var(--pat-soft);
  color: var(--pat-ink);
}
.av-5 {
  background: var(--cyan-soft);
  color: var(--cyan-ink);
}

/* --------------------------------------------------------------- app shell */

.app {
  min-height: 100vh;
}
.side {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--side-w);
  background: var(--nav-bg);
  color: var(--nav-ink);
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
}
.brand-inv {
  color: #fff;
}
.logo-mark {
  width: 40px;
  height: 40px;
  flex: none;
}
.brand span {
  font-family: var(--font-display);
}
.side-close {
  display: none;
  color: var(--nav-ink);
}
.side-close:hover {
  background: var(--nav-2);
  color: #fff;
}
.side-clinic {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 14px 14px;
  padding: 12px;
  border-radius: 16px;
  background: var(--nav-2);
  border: 1px solid var(--nav-3);
}
.side-clinic > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.side-clinic strong {
  color: #fff;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-badge {
  font-size: 0.76rem;
  color: #ffc94d;
}
.switch {
  flex-basis: 100%;
}
.switch select {
  min-height: 34px;
  padding-block: 4px;
  font-size: 0.85rem;
  background: var(--nav-bg);
  color: var(--nav-ink);
  border-color: #2a3d52;
}
.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: #2a3d52 transparent;
}
.side-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-block-end: 12px;
}
.side-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nav-muted);
  padding: 8px 10px 4px;
}
.side-nav a {
  --n-bg: #2e2a4f;
  --n-fg: #c9c4e6;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 8px;
  border-radius: 12px;
  color: var(--nav-ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.side-nav a > .ic {
  width: 34px;
  height: 34px;
  padding: 7.5px;
  border-radius: 10px;
  background: var(--n-bg);
  color: var(--n-fg);
}
.side-nav a:hover {
  background: var(--nav-2);
  color: #fff;
  text-decoration: none;
}
.side-nav a[aria-current='page'] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
.side-nav a[aria-current='page'] > .ic {
  background: var(--t, var(--brand));
  color: var(--on-t, var(--on-brand));
}
/* Chip colours on the dark menu: a dark tint and a light icon per section. */
.side-nav a[data-tone='brand'] { --n-bg: #17403f; --n-fg: #63e6be; }
.side-nav a[data-tone='clinic'] { --n-bg: #17403f; --n-fg: #63e6be; }
.side-nav a[data-tone='pat'] { --n-bg: #4a2142; --n-fg: #ff8fb8; }
.side-nav a[data-tone='indigo'] { --n-bg: #2a2e66; --n-fg: #91a7ff; }
.side-nav a[data-tone='lab'] { --n-bg: #3b2a78; --n-fg: #b197fc; }
.side-nav a[data-tone='rad'] { --n-bg: #1e3a70; --n-fg: #74a9ff; }
.side-nav a[data-tone='pharm'] { --n-bg: #1f4a33; --n-fg: #69db7c; }
.side-nav a[data-tone='ward'] { --n-bg: #5a2a1c; --n-fg: #ffa374; }
.side-nav a[data-tone='money'] { --n-bg: #4d3b12; --n-fg: #ffd43b; }
.side-nav a[data-tone='cyan'] { --n-bg: #1d4545; --n-fg: #66d9e8; }
.side-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 14px 14px;
  padding: 10px;
  border-radius: 16px;
  background: var(--nav-2);
}
.side-foot .icon-btn {
  color: var(--nav-ink);
}
.side-foot .icon-btn:hover {
  background: var(--nav-2);
  color: #fff;
}
.side-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  min-width: 0;
}
.side-user:hover {
  text-decoration: none;
}
.side-user span {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  font-size: 0.9rem;
}
.side-user small {
  color: var(--nav-muted);
}
.side-scrim {
  display: none;
}
.main-wrap {
  margin-inline-start: var(--side-w);
  min-height: 100vh;
}
.top {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--top-h);
  padding: 0 32px;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.menu-btn {
  display: none;
}
.top-search {
  position: relative;
  flex: 1;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding-inline: 16px 8px;
  color: var(--muted);
}
.top-search:focus-within {
  border-color: var(--brand);
  background: var(--surface);
}
.top-search input {
  border: 0 !important;
  background: transparent !important;
  min-height: 46px !important;
  padding: 0 !important;
  outline: 0 !important;
}
.top-search kbd {
  color: var(--muted);
}
.top-search-spacer {
  flex: 1;
}
.main {
  padding: 28px 32px 40px;
  max-width: 1320px;
}
.tabbar {
  display: none;
}

@media (max-width: 1023px) {
  .side {
    transform: translateX(100%);
    transition: transform 0.18s ease;
    width: min(86vw, 300px);
  }
  [dir='ltr'] .side {
    transform: translateX(-100%);
  }
  .side-open .side {
    transform: none;
  }
  .side-open .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
    z-index: 35;
  }
  .side-close,
  .menu-btn {
    display: inline-grid;
  }
  .main-wrap {
    margin-inline-start: 0;
    padding-block-end: calc(var(--tab-h) + env(safe-area-inset-bottom));
  }
  .top {
    padding: 0 10px;
  }
  .main {
    padding: 16px 14px;
  }
  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-block-end: env(safe-area-inset-bottom);
    background: var(--surface);
    border-block-start: 1px solid var(--line);
    z-index: 30;
  }
  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font: inherit;
    font-size: 0.72rem;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
  }
  .tabbar a:hover {
    text-decoration: none;
  }
  .tabbar a[aria-current='page'] {
    color: var(--brand);
  }
  .tabbar .tab-main .ic {
    background: var(--brand);
    color: var(--on-brand);
    border-radius: 50%;
    padding: 7px;
    width: 38px;
    height: 38px;
  }
  .has-sticky .sticky-foot {
    inset-block-end: calc(var(--tab-h) + env(safe-area-inset-bottom));
  }
  .hide-sm {
    display: none;
  }
  .ai-btn span {
    display: none;
  }
}
@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .top-search {
    padding-inline: 10px 6px;
  }
  h1 {
    font-size: 1.3rem;
  }
}

/* ---------------------------------------------------------------- blocks */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 20px;
}
.page-head h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.page-head p {
  margin: 4px 0 0;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-block-end: 6px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-block-end: 18px;
  min-width: 0;
}
.form-cols > .card,
.form-cols > .stack > .card {
  margin-block-end: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 14px;
}
.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.card-head h2 > .ic:first-child {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 10px;
  background: var(--t-soft, var(--brand-soft));
  color: var(--t, var(--brand-ink));
}
/* A department's card: its soft colour across the head, the icon on its full colour. */
.card[data-tone] > .card-head {
  margin: -20px -22px 16px;
  padding: 14px 22px;
  background: var(--t-soft);
  border-start-start-radius: calc(var(--radius-lg) - 1px);
  border-start-end-radius: calc(var(--radius-lg) - 1px);
}
.card[data-tone] > .card-head h2 {
  color: var(--t-ink);
}
.card[data-tone] > .card-head h2 > .ic:first-child {
  background: var(--t);
  color: var(--on-t);
}
.card[data-tone] > .card-head .btn:not(.btn-primary) {
  background: var(--surface);
  border-color: transparent;
  color: var(--t-ink);
}
.card[data-tone] > .card-head .btn-primary {
  background: var(--t);
  border-color: var(--t);
  color: var(--on-t);
}
.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 600;
}
.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
details.more {
  margin-block: 10px;
}
details.more > summary,
details.card > summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.card[open] > summary {
  margin-block-end: 14px;
}

/* KPI tiles: each tile in a row takes the next tint. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-block-end: 18px;
}
.stat {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
}
a.stat:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--clinic-soft);
  color: var(--clinic);
  flex: none;
}
.stats > .stat:nth-child(5n + 2) .stat-icon {
  background: var(--lab-soft);
  color: var(--lab);
}
.stats > .stat:nth-child(5n + 3) .stat-icon {
  background: var(--pat-soft);
  color: var(--pat);
}
.stats > .stat:nth-child(5n + 4) .stat-icon {
  background: var(--money-soft);
  color: var(--money-ink);
}
.stats > .stat:nth-child(5n + 5) .stat-icon {
  background: var(--rad-soft);
  color: var(--rad);
}
.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.stat-sub .delta {
  white-space: nowrap;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}
.delta-up {
  color: var(--ok);
}
.delta-down {
  color: var(--danger);
}
.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty > .ic {
  width: 64px;
  height: 64px;
  padding: 16px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.empty p {
  max-width: 460px;
  margin: 0;
}
.chips,
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-block-end: 16px;
}
.chips a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  background: var(--surface);
  font-size: 0.87rem;
  font-weight: 500;
}
.chips a:hover {
  text-decoration: none;
  border-color: var(--brand);
}
.chips a[aria-current='page'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.tabs {
  border-block-end: 1px solid var(--line);
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  scrollbar-width: none;
}
.tabs a {
  padding: 10px 14px;
  color: var(--ink-2);
  border-block-end: 2px solid transparent;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.92rem;
}
.tabs a:hover {
  text-decoration: none;
  color: var(--ink);
}
.tabs a[aria-current='page'] {
  color: var(--t-ink, var(--brand-ink));
  border-color: var(--t, var(--brand));
}
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
  line-height: 1.6;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.pill-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}
.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}
.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.pill-brand {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: transparent;
}
.st-booked {
  background: var(--indigo-soft);
  color: var(--indigo-ink);
  border-color: transparent;
}
.st-confirmed {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}
.st-arrived {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.st-session {
  background: var(--violet-soft);
  color: var(--violet);
  border-color: transparent;
}
.st-done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}
.st-noshow {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.st-cancelled {
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: line-through;
}
.st-arrived-t {
  color: var(--warn);
}
.st-session-t {
  color: var(--violet);
}
.st-done-t {
  color: var(--ok);
}

/* lists & tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.card .table-wrap {
  border: 0;
  border-radius: 0;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 12px 14px;
  text-align: start;
  border-block-end: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  white-space: nowrap;
}
.table tr:last-child td {
  border-block-end: 0;
}
.table tr[data-href] {
  cursor: pointer;
}
.table tr[data-href]:hover td {
  background: var(--surface-2);
}
.table.compact td,
.table.compact th {
  padding: 8px 10px;
}
.total-row td {
  font-weight: 700;
  border-block-start: 2px solid var(--line-strong);
}
.due-row td {
  color: var(--danger);
  font-weight: 600;
}
.is-void,
.is-void td {
  opacity: 0.55;
  text-decoration: line-through;
}
.cell-person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cell-person small {
  display: block;
  color: var(--muted);
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
  border-block-end: 1px solid var(--line);
}
.list li:last-child {
  border-block-end: 0;
}
.list li > :first-child {
  flex: 1;
  min-width: 0;
}
.row-actions {
  display: flex;
  gap: 6px;
}
.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 12px;
}
.dl dt {
  color: var(--muted);
}
.dl dd {
  margin: 0;
}
.log {
  list-style: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-block: 16px;
}
.picked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
  margin-block-end: 14px;
}
.picked span {
  flex: 1;
}

/* autocomplete */
.ac,
.top-search,
.field.ac {
  position: relative;
}
.ac-list {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 100%;
  z-index: 50;
  margin-block-start: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  max-height: 340px;
  overflow-y: auto;
  padding: 4px;
}
.ac-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.ac-item:hover,
.ac-item[aria-selected='true'] {
  background: var(--brand-soft);
  text-decoration: none;
}
.ac-item small {
  color: var(--muted);
}

/* ------------------------------------------------------------ dashboard */

.dash-hero {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 30px 32px;
  margin-block-end: 20px;
  border-radius: var(--radius-xl);
  background: var(--brand);
  color: var(--on-brand);
}
@media (min-width: 1000px) {
  .dash-hero {
    grid-template-columns: 1.2fr 1fr;
  }
}
.dash-hero h1 {
  font-size: 2.3rem;
  margin: 0 0 8px;
}
.dash-hero p {
  margin: 0;
  opacity: 0.9;
}
.dash-hero .btn {
  background: var(--on-brand);
  border-color: var(--on-brand);
  color: var(--brand);
}
.dash-hero .btn-ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--on-brand) 45%, transparent);
  color: var(--on-brand);
}
.hero-nums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
@media (max-width: 560px) {
  .dash-hero {
    padding: 22px 18px;
  }
  .dash-hero h1 {
    font-size: 1.7rem;
  }
  .hero-nums {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
  }
  .hero-nums div {
    padding: 12px;
    border-radius: 14px;
  }
  .hero-nums strong {
    font-size: 1.4rem;
  }
  .qa a {
    min-height: 0;
    gap: 10px;
    padding: 14px;
  }
}
.hero-nums div {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink-2);
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
}
.hero-nums div:nth-child(1):not([data-tone]) strong {
  color: var(--brand);
}
/* Tiles without a tone of their own take the next colour. */
.hero-nums div:nth-child(2):not([data-tone]) {
  background: var(--money-soft);
  color: var(--money-ink);
}
.hero-nums div:nth-child(3):not([data-tone]) {
  background: var(--pharm-soft);
  color: var(--pharm-ink);
}
.hero-nums div:nth-child(4):not([data-tone]) {
  background: var(--pat-soft);
  color: var(--pat-ink);
}
.hero-nums div[data-tone] {
  background: var(--t-soft);
  color: var(--t-ink);
}
.hero-nums strong {
  white-space: nowrap;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}
.hero-nums span {
  font-size: 0.86rem;
  font-weight: 600;
}
.qa {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-block-end: 18px;
}
.qa a {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.qa a:hover {
  border-color: var(--t, var(--brand));
  text-decoration: none;
}
.qa .ic {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  background: var(--t-soft, var(--brand-soft));
  color: var(--t, var(--brand-ink));
}
.dash-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1100px) {
  .dash-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}
.status-bar {
  display: flex;
  height: 12px;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  margin-block: 6px 12px;
}
.status-bar span {
  display: block;
  min-width: 4px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.c-booked {
  background: #9aa7b6;
}
.c-confirmed {
  background: var(--info);
}
.c-arrived {
  background: #d99a26;
}
.c-session {
  background: var(--violet);
}
.c-done {
  background: var(--ok);
}
.c-noshow {
  background: var(--danger);
}
.heat {
  display: grid;
  grid-template-columns: 70px repeat(var(--cols), minmax(0, 64px));
  gap: 3px;
  font-size: 0.72rem;
  color: var(--muted);
  align-items: center;
}
.heat-cell {
  /* A fixed height: with few hours on the chart a ratio made giant cells. */
  height: 26px;
  border-radius: 6px;
  background: var(--brand);
  position: relative;
  outline: none;
}
.heat-cell[data-v='0'] {
  background: var(--surface-2);
}
.heat-cell:hover::after,
.heat-cell:focus::after {
  content: attr(data-tip);
  position: absolute;
  inset-block-end: calc(100% + 6px);
  inset-inline-start: 50%;
  transform: translateX(50%);
  background: var(--ink);
  color: var(--surface);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 5;
  font-size: 0.75rem;
}
.heat-h {
  text-align: center;
}
.heat-cell[data-v='1'],
.heat-scale i[data-v='1'] {
  opacity: 0.28;
}
.heat-cell[data-v='2'],
.heat-scale i[data-v='2'] {
  opacity: 0.5;
}
.heat-cell[data-v='3'],
.heat-scale i[data-v='3'] {
  opacity: 0.75;
}
.heat-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-block-start: 12px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.heat-scale {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.heat-scale i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--brand);
}
.stack-lg {
  min-width: 0;
}
a.cell-person {
  color: var(--ink);
  font-weight: 600;
}
a.cell-person small {
  font-weight: 400;
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--star);
  font-weight: 700;
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.checklist li {
  display: flex;
  gap: 10px;
  align-items: center;
}
.checklist .is-done {
  color: var(--ok);
  text-decoration: line-through;
}
.setup {
  border-color: var(--brand);
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
  margin-block: 8px 14px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
}

/* ------------------------------------------------------------ clinic day */

.date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-nav input[type='date'] {
  width: auto;
  min-height: 40px;
}
.day-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-end: 16px;
}
.day-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.88rem;
}
.day-summary strong {
  font-size: 1.2rem;
  color: var(--ink);
}
.day-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}
@media (min-width: 1100px) {
  .day-grid {
    grid-template-columns: 1fr 330px;
  }
  .day-side {
    position: sticky;
    inset-block-start: calc(var(--top-h) + 16px);
  }
}
.queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.q-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.q-row:hover {
  border-color: var(--line-strong);
}
.st-confirmed-row {
  border-inline-start-color: var(--info);
}
.st-arrived-row {
  border-inline-start-color: #d99a26;
}
.st-session-row {
  border-inline-start-color: var(--violet);
  background: var(--violet-soft);
}
.st-done-row {
  border-inline-start-color: var(--ok);
}
.st-noshow-row,
.st-cancelled-row {
  border-inline-start-color: var(--danger);
  opacity: 0.75;
}
.q-no {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 1.05rem;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.st-session-row .q-no {
  background: var(--violet);
  color: #fff;
  border-color: transparent;
}
.st-arrived-row .q-no {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.st-done-row .q-no {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}
.q-row {
  flex-wrap: wrap;
}
.q-main {
  flex: 1 1 240px;
  min-width: 200px;
}
.q-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}
.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  align-items: center;
  margin-block-start: 2px;
}
.q-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-inline-start: auto;
}
@media (max-width: 700px) {
  .q-row {
    flex-wrap: wrap;
  }
  .q-actions {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-inline-start: 56px;
  }
}

/* week */
.week {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-block-end: 18px;
}
@media (max-width: 1100px) {
  .week {
    grid-template-columns: 1fr;
  }
}
.week-day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
}
.week-day.is-today {
  border-color: var(--brand);
  border-width: 2px;
}
.week-day.is-off {
  background: var(--surface-2);
}
.week-day header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.88rem;
}
.week-appt {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
  border-inline-start: 3px solid var(--line-strong);
}
.week-appt:hover {
  text-decoration: none;
  background: var(--brand-soft);
}
.week-appt .t {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.week-appt.st-session-row {
  background: var(--violet-soft);
}
.week-appt.st-noshow-row {
  opacity: 0.7;
}
.week-add {
  margin-block-start: auto;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

/* slots */
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-block-end: 14px;
}
.slot {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.slot:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.slot[aria-pressed='true'] {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}
.slot:disabled {
  opacity: 0.35;
  text-decoration: line-through;
  cursor: not-allowed;
}
.slot-note {
  grid-column: 1 / -1;
  font-size: 0.87rem;
  color: var(--ink-2);
}

/* ---------------------------------------------------------- patient file */

.file-grid,
.visit-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}
@media (min-width: 1100px) {
  .file-grid,
  .visit-grid {
    grid-template-columns: 1fr 350px;
  }
}
.person-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  position: relative;
  padding-inline-start: 22px;
  padding-block-end: 16px;
  border-inline-start: 2px solid var(--line);
  margin-inline-start: 6px;
}
.timeline li::before {
  content: '';
  position: absolute;
  inset-inline-start: -7px;
  inset-block-start: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
}
.timeline li:last-child {
  border-color: transparent;
}
.timeline p {
  margin: 2px 0;
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.timeline.compact li {
  padding-block-end: 12px;
  font-size: 0.88rem;
}
.rx-line {
  color: var(--ink-2);
}
.vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vitals span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-width: 78px;
}
.vitals small {
  font-size: 0.7rem;
  color: var(--muted);
}
.vitals strong {
  font-variant-numeric: tabular-nums;
}
.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 8px;
}
.contact a.num {
  font-size: 1.05rem;
  font-weight: 700;
}
.upload {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--line);
}
.ai-summary {
  border-color: var(--violet);
  background: var(--violet-soft);
}
.ai-summary .card-head h2 .ic {
  color: var(--violet);
}
.ai-summary-text {
  white-space: pre-line;
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------- visit */

.vp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  margin-block-end: 12px;
}
.vp-head:hover {
  text-decoration: none;
}
.vp-head span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vp-head strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.vp-head small {
  color: var(--muted);
}
.vp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-end: 8px;
}

.vitals-in {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 0 10px;
}
.vitals-in legend {
  padding: 0 4px;
}
.fu-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fu-row input {
  max-width: 190px;
}
.dictate {
  border-color: var(--violet);
  background: var(--violet-soft);
}
.dictate .card-head h2 .ic {
  color: var(--violet);
}
.dictate textarea {
  background: var(--surface);
}
.cmd-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cmd-row textarea {
  flex: 1;
}
.mic {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  flex: none;
}
.mic:hover {
  background: var(--brand-ink);
  color: var(--on-brand);
}
.mic.recording {
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}
.mic.busy {
  opacity: 0.6;
  cursor: progress;
}
@keyframes pulse {
  50% {
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mic.recording {
    animation: none;
  }
}
.ai-filled {
  outline: 2px solid var(--violet) !important;
  outline-offset: -1px;
}
.rx {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rx-head,
.rx-row {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) 1fr 1.3fr 1fr 1.3fr 38px;
  gap: 6px;
  align-items: center;
}
.rx-head {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.rx-row input {
  min-height: 40px !important;
  padding-block: 4px !important;
}
@media (max-width: 760px) {
  .rx-head {
    display: none;
  }
  .rx-row {
    grid-template-columns: 1fr 1fr 38px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .rx-row .ac {
    grid-column: 1 / -1;
  }
  .rx-row .icon-btn {
    grid-column: 3;
    grid-row: 2;
  }
}
.tpl-save {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tpl-save input {
  max-width: 220px;
}

/* -------------------------------------------------------------- invoices */

.lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.line-head,
.line {
  display: grid;
  grid-template-columns: minmax(200px, 3fr) 70px 110px 110px 38px;
  gap: 6px;
  align-items: center;
}
.line-head {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.line-desc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.line input,
.line select {
  min-height: 40px !important;
  padding-block: 4px !important;
}
.line-total {
  text-align: end;
  font-weight: 600;
}
@media (max-width: 760px) {
  .line-head {
    display: none;
  }
  .line {
    grid-template-columns: 70px 1fr 1fr 38px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .line-desc {
    grid-column: 1 / -1;
  }
}
.totals {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-block: 14px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line);
}
.totals .field {
  max-width: 200px;
  margin: 0;
}
.totals p {
  margin: 0;
  font-size: 1.1rem;
}

/* -------------------------------------------------------------- settings */

.svc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.svc-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) 1.2fr 110px 90px 80px 76px;
  gap: 6px;
  align-items: center;
}
.svc-row .check {
  margin: 0;
  align-items: center;
}
.svc-row .check input {
  margin: 0;
}
.svc-head {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
@media (max-width: 760px) {
  .svc-head {
    display: none;
  }
  .svc-row {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .svc-row > :first-child {
    grid-column: 1 / -1;
  }
}
.hours {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-block-end: 12px;
}
.hours-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hours-row .check {
  width: 110px;
  margin: 0;
}
.hours-row input[type='time'] {
  width: 124px;
  min-height: 38px;
}
.second-shift {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.second-shift[open] {
  display: flex;
}
.second-shift summary {
  font-size: 0.8rem;
  color: var(--brand);
  cursor: pointer;
}
.logo-preview {
  max-height: 80px;
  margin-block-end: 10px;
}
.steps-small {
  padding-inline-start: 18px;
}
.steps-small li {
  margin-block-end: 6px;
}
.wa-log .is-in {
  background: var(--wa-soft);
  padding-inline: 8px;
  border-radius: 6px;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.swatch {
  position: relative;
  cursor: pointer;
}
.swatch input {
  position: absolute;
  opacity: 0;
}
.swatch span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.8rem;
  min-width: 92px;
}
.swatch i {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.swatch input:checked + span {
  border-color: var(--ink);
}
.swatch input:focus-visible + span {
  outline: 2px solid var(--brand);
}

/* ------------------------------------------- org type and module pickers */

.auth-wide {
  max-width: 560px;
}
.org-pick,
.mod-pick {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border: 0;
  padding: 0;
  margin: 0;
}
.org-pick legend {
  font-weight: 600;
  margin-block-end: 8px;
  padding: 0;
}
.org-pick-sm {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 520px) {
  .org-pick-sm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.org-card,
.mod-card {
  position: relative;
  cursor: pointer;
  display: block;
}
.org-card input,
.mod-card input {
  position: absolute;
  opacity: 0;
  inset-inline-start: 12px;
  inset-block-start: 12px;
}
.org-card > span,
.mod-card > span {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  height: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background-color 0.15s;
}
.org-card .ic,
.mod-card .ic {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.org-card small,
.mod-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.org-pick-sm .org-card > span {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  padding: 12px 8px;
  row-gap: 6px;
}
.org-pick-sm .org-card .ic {
  grid-row: auto;
}
.org-card input:checked + span,
.mod-card input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.org-card input:checked + span .ic,
.mod-card input:checked + span .ic {
  background: var(--brand);
  color: var(--on-brand);
}
.org-card input:focus-visible + span,
.mod-card input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Today's takings by department. */
.dept-bar {
  display: flex;
  gap: 3px;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  margin-block: 4px 14px;
}
.dept-bar span {
  background: var(--t);
  min-width: 6px;
}
.dept-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.dept-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dept-list i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--t);
  flex: none;
}
.dept-list span {
  flex: 1;
}

/* A center's home: one card per department (lab, radiology, pharmacy…). */
.mod-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-block-end: 18px;
}
.mod-cards > .card {
  margin: 0;
}

/* --------------------------------------------------------------- charts */

.bars {
  margin: 0;
}
.bars-plot {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  height: 200px;
  border-block-end: 1px solid var(--line-strong);
}
.bar-slot {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  outline: none;
}
.bar {
  width: 100%;
  min-height: 1px;
  background: var(--brand);
  border-radius: 4px 4px 0 0;
}
.bar-slot:hover .bar,
.bar-slot:focus .bar {
  background: var(--brand-ink);
}
.bar-tip {
  display: none;
  position: absolute;
  inset-block-end: calc(100% + 6px);
  inset-inline-start: 50%;
  transform: translateX(50%);
  background: var(--ink);
  color: var(--surface);
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 5;
  font-size: 0.8rem;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.bar-slot:hover .bar-tip,
.bar-slot:focus .bar-tip {
  display: flex;
}
.bars-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-block-start: 6px;
}
.bar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.bar-track {
  flex: none;
  width: 110px;
  display: flex;
}
.inline-bar {
  display: block;
  height: 8px;
  background: var(--brand);
  border-start-end-radius: 4px;
  border-end-end-radius: 4px;
}

/* --------------------------------------------------------- command dialog */

.cmd {
  width: min(580px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
  color: var(--ink);
}
.cmd::backdrop {
  background: rgb(8 15 25 / 0.5);
}
.cmd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 6px;
}
.cmd-head strong {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cmd-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-block: 10px;
}
.cmd-result {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--brand-soft);
}

/* ------------------------------------------------------ branches, stock, sheets */

.branch-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.branch-switch select {
  min-height: 40px;
  width: auto;
  max-width: 170px;
  padding-block: 4px;
}
@media (max-width: 700px) {
  .branch-switch .ic {
    display: none;
  }
  .branch-switch select {
    max-width: 110px;
  }
}
.branch-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 2fr) 1fr 1fr 80px 76px;
  gap: 6px;
  align-items: center;
}
.branch-row .check {
  margin: 0;
  align-items: center;
}
.branch-row .check input {
  margin: 0;
}
@media (max-width: 760px) {
  .branch-row {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .branch-row > :first-child,
  .branch-row > :nth-child(2) {
    grid-column: 1 / -1;
  }
}
.plines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pline {
  display: grid;
  grid-template-columns: minmax(160px, 2.4fr) 80px 100px 1fr 150px 100px 38px;
  gap: 6px;
  align-items: center;
}
.pline-head {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.pline input,
.pline select {
  min-height: 40px !important;
  padding-block: 4px !important;
}
@media (max-width: 900px) {
  .pline-head {
    display: none;
  }
  .pline {
    grid-template-columns: 1fr 1fr 38px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .pline > :first-child {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------------------ insurance */

/* An approval request's lines: service, details, qty, price, total, remove. */
.aline {
  grid-template-columns: minmax(160px, 2fr) minmax(120px, 1.4fr) 76px 100px 100px 38px;
}
@media (max-width: 900px) {
  .aline {
    grid-template-columns: 1fr 1fr 38px;
  }
  .aline > :nth-child(2) {
    grid-column: 1 / -1;
  }
}
.ins-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-block-end: 12px;
}
.ins-card {
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.ins-card.is-void {
  border-inline-start-color: var(--line-strong);
  opacity: 0.7;
}
.ins-card p {
  margin: 4px 0;
}
.ins-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ins-card .more {
  margin-block-start: 6px;
}
.card-sub {
  font-size: 0.9rem;
  margin: 12px 0 6px;
  color: var(--ink-2);
}
.ins-upload,
.note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-block: 8px;
}
.ins-upload select {
  width: auto;
  min-width: 140px;
}
.ins-upload input[type='file'] {
  flex: 1 1 180px;
}
.note-row input {
  flex: 1 1 200px;
  width: auto !important;
}
/* Amounts in a table stay on one line ("810 ج.م", not "810" over "ج.م"). */
.table td.num {
  white-space: nowrap;
}
.contract-prices select {
  min-width: 120px;
}
.contract-prices input {
  min-width: 90px;
}
.block {
  display: block;
}
.sheet h2 {
  font-size: 1rem;
  margin: 14px 0 6px;
}
.sheet-box {
  margin-block-start: 24px;
  padding: 10px 14px;
  border: 1px dashed #888;
}
.sheet-box p {
  margin: 8px 0;
}

/* --------------------------------------------------------- subscription */

.sub-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.sub-banner > span {
  flex: 1 1 220px;
}
.plan-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin: 0 0 10px;
  border: 0;
  padding: 0;
}
.plan-pick-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.plan-pick legend {
  grid-column: 1 / -1;
  margin-block-end: 6px;
}
.plan-card > span {
  grid-template-columns: 1fr;
  row-gap: 4px;
  align-content: start;
}
.plan-card strong {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.plan-card small {
  grid-column: 1;
}
.plan-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
}
.plan-price small {
  font-family: var(--font-body);
  font-size: 0.8rem;
}
.plan-card.is-off {
  cursor: not-allowed;
  opacity: 0.6;
}
.pay-how {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
}
.pay-how p {
  margin: 2px 0;
}
.lp-price {
  margin: 10px 0 0;
}
.lp-price strong {
  font-family: var(--font-display);
  font-size: 1.9rem;
}

/* -------------------------------------------------------------- landing */

.public {
  background: var(--surface);
}
.pub-top {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.pub-top-in {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 24px;
}
.pub-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  justify-content: center;
}
.pub-nav a {
  color: var(--ink-2);
  font-weight: 500;
}
.pub-cta {
  display: flex;
  gap: 8px;
}
@media (max-width: 860px) {
  .pub-nav {
    display: none;
  }
  .pub-top-in {
    justify-content: space-between;
  }
}
.lp-wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}
.lp-hero {
  padding: 64px 0 40px;
}
.lp-hero-in {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 980px) {
  .lp-hero-in {
    grid-template-columns: 1fr 1.15fr;
  }
}
.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
  font-size: 0.86rem;
}
.lp-title {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 18px 0 16px;
}
.lp-title em {
  font-style: normal;
  color: var(--brand);
}
.lp-sub {
  font-size: 1.15rem;
  color: var(--ink-2);
  max-width: 560px;
  margin-block-end: 26px;
}
.lp-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-end: 18px;
}
.lp-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.lp-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lp-trust .ic {
  color: var(--ok);
}
.lp-visual {
  position: relative;
  padding: 26px 26px 0 0;
}
.lp-visual::before {
  content: '';
  position: absolute;
  inset: 0 0 36px 44px;
  border-radius: 28px;
  background: var(--brand-soft);
}
.shot {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.shot-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-block-end: 1px solid var(--line);
  background: var(--surface-2);
}
.shot-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
}
.phone {
  position: absolute;
  inset-inline-start: -10px;
  inset-block-end: -28px;
  width: 31%;
  min-width: 140px;
  border: 7px solid var(--ink);
  border-radius: 26px;
  overflow: hidden;
  background: var(--ink);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
}
.lp-band {
  background: var(--nav-bg);
  color: #fff;
  margin-block: 72px 0;
}
.lp-band-in {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  padding: 34px 24px;
  max-width: 1220px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .lp-band-in {
    grid-template-columns: 1fr 1fr;
  }
}
.lp-band strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.2;
}
.lp-band span {
  color: var(--nav-ink);
  font-size: 0.92rem;
}
.lp-section {
  padding: 84px 0 0;
}
.lp-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
.lp-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  margin: 12px 0;
  letter-spacing: -0.02em;
}
.lp-head p {
  color: var(--ink-2);
  font-size: 1.08rem;
}
.lp-pains {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.lp-pain {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.lp-pain s {
  color: var(--muted);
}
.lp-pain p {
  margin: 8px 0 0;
  font-weight: 600;
}
.lp-feature {
  display: grid;
  gap: 40px;
  align-items: center;
  margin-block-end: 76px;
}
@media (min-width: 940px) {
  .lp-feature {
    grid-template-columns: 1fr 1.2fr;
  }
  .lp-feature.flip > :first-child {
    order: 2;
  }
}
.lp-feature h3 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 700;
  margin: 12px 0;
  letter-spacing: -0.01em;
}
.lp-feature p {
  color: var(--ink-2);
  font-size: 1.05rem;
}
.lp-points {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.lp-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.lp-points .ic {
  color: var(--ok);
  margin-block-start: 3px;
}
.lp-shot {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
}
.lp-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.lp-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.lp-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.lp-card h3 {
  margin: 14px 0 6px;
  font-size: 1.05rem;
}
.lp-card p {
  margin: 0;
  color: var(--ink-2);
}
.lp-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.lp-grid > .lp-card:nth-child(4n + 2) .lp-icon {
  background: var(--info-soft);
  color: var(--info);
}
.lp-grid > .lp-card:nth-child(4n + 3) .lp-icon {
  background: var(--violet-soft);
  color: var(--violet);
}
.lp-grid > .lp-card:nth-child(4n + 4) .lp-icon {
  background: var(--warn-soft);
  color: var(--warn);
}
.lp-orgs {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.lp-org {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 4px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, background-color 0.15s;
}
.lp-org:hover {
  text-decoration: none;
  border-color: var(--brand);
  background: var(--brand-soft);
}
.lp-org .lp-icon {
  grid-row: span 3;
}
.lp-org strong {
  font-size: 1.1rem;
}
.lp-org > span:not(.lp-icon) {
  color: var(--ink-2);
}
.lp-org em {
  font-style: normal;
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-block-start: 6px;
}
.lp-journey {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  counter-reset: j;
}
.lp-journey li {
  position: relative;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  display: grid;
  gap: 8px;
  align-content: start;
}
.lp-journey li strong {
  font-size: 1.05rem;
}
.lp-journey li > span:not(.lp-icon) {
  color: var(--ink-2);
  font-size: 0.94rem;
}
@media (min-width: 1100px) {
  .lp-journey li:not(:last-child)::after {
    content: '';
    position: absolute;
    inset-block-start: 42px;
    inset-inline-end: -12px;
    width: 12px;
    border-block-start: 2px solid var(--line-strong);
  }
}
.lp-patient {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 28px;
  padding: 44px;
  display: grid;
  gap: 32px;
  align-items: center;
}
@media (min-width: 940px) {
  .lp-patient {
    grid-template-columns: 1fr 1fr;
  }
}
.lp-patient h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 12px 0;
}
.lp-patient p,
.lp-patient li {
  opacity: 0.95;
}
.lp-patient .lp-eyebrow {
  background: color-mix(in srgb, var(--on-brand) 16%, transparent);
  color: var(--on-brand);
}
.lp-patient .lp-points .ic {
  color: var(--on-brand);
}
.lp-phones {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.lp-phones img {
  height: auto;
  width: 46%;
  max-width: 250px;
  border: 7px solid var(--nav-bg);
  border-radius: 26px;
  background: var(--nav-bg);
}
.lp-phones .pic:nth-child(2) img {
  margin-block-start: 40px;
}
.lp-compare {
  max-width: 880px;
  margin: 0 auto;
}
.lp-compare table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}
.lp-compare th,
.lp-compare td {
  padding: 13px 16px;
  border-block-end: 1px solid var(--line);
  text-align: start;
}
.lp-compare th {
  font-size: 0.9rem;
}
.lp-compare td + td,
.lp-compare th + th {
  text-align: center;
  width: 150px;
}
.lp-compare .us {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
}
.lp-compare .yes {
  color: var(--ok);
}
.lp-compare .no {
  color: var(--muted);
}
.lp-steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  counter-reset: s;
  list-style: none;
  padding: 0;
}
.lp-steps li {
  counter-increment: s;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.lp-steps li::before {
  content: counter(s);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  margin-block-end: 12px;
}
.lp-steps strong {
  display: block;
  font-size: 1.05rem;
}
.lp-steps span {
  color: var(--ink-2);
}
.lp-plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}
.lp-plan {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lp-plan h3 {
  margin: 0;
  font-size: 1.2rem;
}
.lp-plan-main {
  border: 2px solid var(--brand);
  position: relative;
}
.lp-plan-main::before {
  content: 'الأنسب لأغلب العيادات';
  position: absolute;
  inset-block-start: -13px;
  inset-inline-start: 22px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}
.lp-plan .btn {
  margin-block-start: auto;
}
.lp-faq {
  max-width: 820px;
  margin: 0 auto;
}
.lp-faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-block-end: 10px;
}
.lp-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
}
.lp-faq p {
  color: var(--ink-2);
  margin: 10px 0 0;
}
.lp-final {
  margin: 84px 0 0;
  background: var(--nav-bg);
  color: #fff;
  padding: 64px 24px;
  text-align: center;
}
.lp-final h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  margin: 0 0 12px;
}
.lp-final p {
  color: var(--nav-ink);
  margin-block-end: 26px;
  font-size: 1.08rem;
}
.center-row {
  justify-content: center;
}
.lp-final .btn-ghost {
  color: #fff;
  border-color: rgb(255 255 255 / 0.35);
}
.pub-foot {
  border-block-start: 1px solid var(--line);
}
.pub-foot-in {
  display: grid;
  gap: 24px;
  grid-template-columns: 2fr repeat(4, 1fr);
  max-width: 1220px;
  margin: 0 auto;
  padding: 40px 24px;
}
@media (max-width: 760px) {
  .pub-foot-in {
    grid-template-columns: 1fr 1fr;
  }
}
.pub-foot nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pub-foot nav a {
  color: var(--ink-2);
}


/* Colour. The overview's hero is deep indigo; each kind of place takes its
   department's deep colour, and its page its department's colour. Fixed in
   both themes: white type on a dark fill reads the same in light and dark. */
.lp-hero {
  --hero: #1b1640;
  --hero-2: #2b2560;
  --hero-line: #4a4196;
  --hero-ink: #d4d0ec;
  --hero-accent: #63e6be;
  --hero-cta: #63e6be;
  --hero-cta-ink: #08433c;
  background: var(--hero);
  color: #ffffff;
  padding: 64px 0 76px;
}
.lp-hero[data-tone='clinic'] { --hero: #08584f; --hero-2: #0b6b60; --hero-line: #3f9c90; --hero-ink: #ccf2ec; --hero-accent: #ffd43b; --hero-cta: #ffffff; --hero-cta-ink: #08584f; }
.lp-hero[data-tone='pat'] { --hero: #7a1538; --hero-2: #8f1d45; --hero-line: #c4577f; --hero-ink: #ffd8e6; --hero-accent: #ffd43b; --hero-cta: #ffffff; --hero-cta-ink: #7a1538; }
.lp-hero[data-tone='ward'] { --hero: #7c2a07; --hero-2: #93340b; --hero-line: #c96b3e; --hero-ink: #ffe0cc; --hero-accent: #ffd43b; --hero-cta: #ffffff; --hero-cta-ink: #7c2a07; }
.lp-hero[data-tone='lab'] { --hero: #3b1f99; --hero-2: #4a2db0; --hero-line: #7c62d6; --hero-ink: #e5dcff; --hero-accent: #63e6be; --hero-cta: #ffffff; --hero-cta-ink: #3b1f99; }
.lp-hero[data-tone='rad'] { --hero: #123f91; --hero-2: #1a4ea8; --hero-line: #5585d6; --hero-ink: #d6e4ff; --hero-accent: #ffd43b; --hero-cta: #ffffff; --hero-cta-ink: #123f91; }
.lp-hero[data-tone='pharm'] { --hero: #1a5c29; --hero-2: #216d32; --hero-line: #57a065; --hero-ink: #d3f9d8; --hero-accent: #ffd43b; --hero-cta: #ffffff; --hero-cta-ink: #1a5c29; }
.lp-hero .lp-eyebrow {
  background: var(--hero-2);
  color: var(--hero-accent);
}
.lp-hero .lp-title em {
  color: var(--hero-accent);
}
.lp-hero .lp-sub,
.lp-hero .lp-trust {
  color: var(--hero-ink);
}
.lp-hero .lp-trust .ic {
  color: var(--hero-accent);
}
.lp-hero .btn-primary {
  background: var(--hero-cta);
  border-color: var(--hero-cta);
  color: var(--hero-cta-ink);
}
.lp-hero .btn:not(.btn-primary) {
  background: transparent;
  border-color: var(--hero-line);
  color: #ffffff;
}
.lp-hero .lp-visual::before {
  background: var(--hero-2);
}
.lp-hero .shot {
  border-color: var(--hero-line);
}
.lp-page[data-tone] {
  --brand: var(--t);
  --brand-ink: var(--t-ink);
  --brand-soft: var(--t-soft);
  --on-brand: var(--on-t);
}
.lp-org[data-tone] .lp-icon,
.lp-journey li[data-tone] .lp-icon {
  background: var(--t);
  color: var(--on-t);
}
.lp-org[data-tone]:hover {
  border-color: var(--t);
  background: var(--t-soft);
}
.lp-org[data-tone] em {
  color: var(--t-ink);
}
.lp-journey li[data-tone] {
  background: var(--t-soft);
  border-color: transparent;
}
.lp-journey li[data-tone] strong {
  color: var(--t-ink);
}
.lp-grid > .lp-card[data-tone] .lp-icon {
  background: var(--t-soft);
  color: var(--t);
}
.lp-head h2,
.lp-title,
.lp-feature h3,
.lp-final h2 {
  font-family: var(--font-display);
}

/* auth */
.auth-split {
  display: grid;
  min-height: 100vh;
}
@media (min-width: 940px) {
  .auth-split {
    grid-template-columns: 1fr 1.1fr;
  }
}
.auth-side {
  background: var(--nav-bg);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
@media (max-width: 939px) {
  .auth-side {
    display: none;
  }
}
.auth-side h2 {
  font-size: 1.9rem;
  line-height: 1.3;
  margin: 0;
}
.auth-side ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.auth-side li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--nav-ink);
}
.auth-side li .ic {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  background: var(--nav-2);
  color: #fff;
}
.auth-side li strong {
  display: block;
  color: #fff;
}
.auth-side .shot {
  margin-block-start: auto;
  border-color: #1d3043;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.auth h1 {
  font-size: 1.8rem;
}
.auth .brand {
  margin-block-end: 26px;
}
.narrow {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 16px;
}
.wide {
  max-width: 1300px;
  margin: 24px auto;
  padding: 0 16px;
}
.prose p {
  color: var(--ink-2);
}
.plan-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.plan-form select,
.plan-form input {
  width: auto;
  min-height: 36px;
}

/* ------------------------------------------- booking and patient pages */

.pt-page {
  background: var(--bg);
}
.bk {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.bk-cover {
  height: 120px;
  background: var(--brand);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-inline: -16px;
}
.bk-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: -44px 0 20px;
  padding: 0 4px;
}
.bk-head > div {
  padding-block-start: 50px;
  min-width: 0;
}
.bk-head h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.35;
}
.bk-head p {
  margin: 0;
}
.bk-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: contain;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 4px solid var(--surface);
}
.bk-logo .logo-mark {
  width: 76px;
  height: 76px;
}
.bk-intro {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.bk-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-block-end: 14px;
}
.bk-step h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 14px;
}
/* Each section of a patient's page in its own colour. */
.bk-step h2 > .ic:first-child {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.bk-step:nth-of-type(5n + 2) h2 > .ic:first-child {
  background: var(--lab-soft);
  color: var(--lab);
}
.bk-step:nth-of-type(5n + 3) h2 > .ic:first-child {
  background: var(--pharm-soft);
  color: var(--pharm);
}
.bk-step:nth-of-type(5n + 4) h2 > .ic:first-child {
  background: var(--money-soft);
  color: var(--money-ink);
}
.bk-step:nth-of-type(5n + 5) h2 > .ic:first-child {
  background: var(--rad-soft);
  color: var(--rad);
}
.step-no {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.86rem;
}
.bk-docs {
  display: grid;
  gap: 10px;
}
.bk-doc {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink);
}
.bk-doc:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.bk-doc input {
  accent-color: var(--brand);
  margin-block-start: 12px;
}
.bk-doc span {
  display: flex;
  flex-direction: column;
}
.bk-doc small {
  color: var(--ink-2);
}
a.bk-doc:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.bk-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.bk-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block-end: 6px;
  scrollbar-width: thin;
}
.day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.day-btn:hover {
  border-color: var(--brand);
}
.day-btn small {
  color: var(--muted);
  font-size: 0.75rem;
}
.day-btn[aria-pressed='true'] {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}
.day-btn[aria-pressed='true'] small {
  color: inherit;
}
.day-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.bk-ok {
  text-align: center;
  padding: 32px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}
.bk-ok > .ic {
  color: var(--ok);
}
.bk-ok .big {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--brand-ink);
}
.bk-foot {
  margin-block-start: 26px;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.bk-foot p {
  display: flex;
  gap: 6px;
  align-items: center;
}
.track-now {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-block: 16px;
}
.track-now div {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.track-now strong {
  display: block;
  font-size: 2.6rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.track-now .yours {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.track-ahead {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn);
}
.track-ahead.go {
  background: var(--ok-soft);
  color: var(--ok);
}
.stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-direction: row-reverse;
  margin-block: 16px;
}
.stars input {
  position: absolute;
  opacity: 0;
}
.stars label {
  cursor: pointer;
  color: var(--line-strong);
}
.stars label .ic {
  width: 44px;
  height: 44px;
}
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: var(--star);
}
.stars input:checked ~ label .ic,
.stars label:hover .ic,
.stars label:hover ~ label .ic {
  fill: currentColor;
}
.portal-list .list li {
  align-items: flex-start;
}

/* ------------------------------------------------- waiting-room screen */

.tv {
  background: #0a1118;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1.2rem;
}
.tv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 36px;
  border-block-end: 1px solid #1d2a36;
}
.tv-head h1 {
  font-size: 2rem;
  margin: 0;
}
.tv-clock {
  font-size: 2.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tv-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  padding: 28px 36px;
}
.tv-doc {
  background: #121c26;
  border-radius: 24px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tv-doc h2 {
  font-size: 1.6rem;
  margin: 0;
}
.tv-now {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px;
  border-radius: 20px;
  /* The screen is always dark: keep the clinic's full colour and white text. */
  background: var(--th-brand, #0a7c70);
  color: #fff;
}
.tv-now span {
  font-size: 1.3rem;
  opacity: 0.9;
}
.tv-now strong {
  font-size: 7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tv-now.flash-in {
  animation: tvflash 1s ease-in-out 3;
}
@keyframes tvflash {
  50% {
    background: #fff;
    color: var(--th-brand, #0a7c70);
  }
}
.tv-next {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tv-next b {
  display: grid;
  place-items: center;
  min-width: 70px;
  height: 64px;
  padding: 0 14px;
  border-radius: 14px;
  background: #1c2a37;
  font-size: 2rem;
}
.tv-foot {
  padding: 14px 36px;
  border-block-start: 1px solid #1d2a36;
  color: #8a97a5;
  display: flex;
  justify-content: space-between;
}
.tv-start {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(10 17 24 / 0.85);
  z-index: 10;
}

/* ------------------------------------------------ ratings and packages */

.rating .star-off {
  color: var(--line-strong);
}
.rating .ic {
  fill: currentColor;
}
.rating .star-off .ic {
  fill: none;
}
.review-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.review-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.review-list p {
  margin: 4px 0 0;
}
.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.review-head a {
  font-weight: 600;
  color: var(--ink);
}
.dist-row {
  margin-block-end: 8px;
}
.dist-row > .num:first-child {
  width: 38px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--star);
}
.dist-track {
  flex: 1;
  width: auto;
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}
.dist-track .inline-bar {
  height: 100%;
  background: var(--star);
}
.pkg-row {
  display: grid;
  grid-template-columns: minmax(170px, 2fr) minmax(130px, 1.4fr) 90px 110px 100px 80px 76px;
  gap: 6px;
  align-items: center;
}
.pkg-row .check {
  margin: 0;
  align-items: center;
}
.pkg-row .check input {
  margin: 0;
}
.pkg-meta {
  margin: -2px 0 8px;
}
.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-cell .progress {
  width: 120px;
  margin: 0;
}
.rating-big {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rating-big strong {
  font-size: 2.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.quote {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-inline-start: 3px solid var(--star);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
@media (max-width: 860px) {
  .pkg-row {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .pkg-row.svc-head {
    display: none;
  }
  .pkg-row > :first-child {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------- printing */

.print-page {
  background: var(--bg);
}
.print-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.rx-sheet {
  width: 148mm;
  min-height: 210mm;
  margin: 16px auto;
  padding: 10mm 11mm;
  background: #fff;
  color: #111;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  page: rx;
}
.rx-blank-head {
  padding-block-start: 45mm;
}
.rx-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block-end: 8px;
  border-block-end: 2px solid var(--brand);
}
.rx-top h1 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--brand);
}
.rx-top p {
  margin: 0;
  font-size: 0.82rem;
}
.rx-clinic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  font-size: 0.82rem;
}
.rx-clinic img,
.rx-clinic .logo-mark {
  max-width: 64px;
  max-height: 56px;
  width: auto;
  height: 48px;
}
.rx-patient {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 8px 0;
  border-block-end: 1px solid #ccc;
  font-size: 0.88rem;
}
.rx-body {
  flex: 1;
  padding-block: 10px;
}
.rx-symbol {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: serif;
  color: var(--brand);
}
.rx-items {
  margin: 4px 0 0;
  padding-inline-start: 20px;
}
.rx-items li {
  margin-block-end: 10px;
}
.rx-items strong {
  display: block;
  font-size: 1rem;
  direction: ltr;
  text-align: right;
}
.rx-items span,
.rx-items em {
  display: block;
  font-size: 0.88rem;
}
.rx-items em {
  color: #444;
}
.rx-notes {
  margin-block-start: 10px;
  font-size: 0.88rem;
}
.rx-fu {
  margin-block-start: 10px;
  font-weight: 600;
}
.rx-foot {
  border-block-start: 1px solid #ccc;
  padding-block-start: 6px;
  font-size: 0.78rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rx-qr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  text-align: start;
}
.rx-qr svg {
  width: 20mm;
  height: 20mm;
}
.receipt {
  width: 76mm;
  margin: 16px auto;
  padding: 4mm;
  background: #fff;
  color: #000;
  font-size: 12px;
  text-align: center;
  border: 1px solid var(--line);
  page: receipt;
}
.receipt h1 {
  font-size: 15px;
  margin: 0 0 2px;
}
.receipt p {
  margin: 2px 0;
}
.receipt table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 6px;
  text-align: start;
}
.receipt td {
  padding: 3px 0;
  border-block-end: 1px dashed #999;
}
.sheet {
  max-width: 210mm;
  margin: 16px auto;
  padding: 12mm;
  background: #fff;
  color: #111;
  border: 1px solid var(--line);
}
.sheet .table th {
  background: #f3f3f3;
  color: #333;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block-end: 10px;
  margin-block-end: 12px;
  border-block-end: 2px solid var(--brand);
}
.sheet-head h1 {
  color: var(--brand);
  margin: 0 0 4px;
}
.sheet-head p {
  margin: 0;
}
.sheet-sign {
  margin-block-start: 32px;
}
.slip {
  max-width: 148mm;
}
.eta-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-block: 6px;
}
.eta-qr svg {
  width: 34mm;
  height: 34mm;
}
@media print {
  .no-print,
  .print-bar {
    display: none !important;
  }
  body,
  .print-page {
    background: #fff !important;
    color: #000 !important;
  }
  .rx-sheet,
  .receipt,
  .sheet {
    margin: 0;
    border: 0;
  }
  .rx-sheet {
    width: auto;
    min-height: calc(210mm - 1px);
  }
  .sheet {
    max-width: none;
  }
}
@page rx {
  size: A5;
  margin: 0;
}
@page receipt {
  size: 80mm auto;
  margin: 0;
}

/* ----------------------------------------------------------- the site 2 */

/* The header: kinds of place in a dropdown, a menu sheet on phones. */
.pub-drop,
.pub-menu {
  position: relative;
}
.pub-drop > summary,
.pub-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-weight: 500;
}
.pub-drop > summary::-webkit-details-marker,
.pub-menu > summary::-webkit-details-marker {
  display: none;
}
.pub-drop-list,
.pub-menu-list {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 230px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgb(20 16 60 / 0.14);
}
.pub-drop-list {
  inset-inline-start: 0;
}
.pub-menu-list {
  inset-inline-end: 0;
}
.pub-drop-list a,
.pub-menu-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.pub-drop-list a:hover,
.pub-menu-list a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.pub-menu-list hr {
  border: 0;
  border-block-start: 1px solid var(--line);
  margin: 6px 0;
}
.pub-menu > summary {
  width: 44px;
  height: 44px;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.pub-menu {
  display: none;
}
.pub-lang {
  font-weight: 600;
}
@media (max-width: 860px) {
  .pub-menu {
    display: block;
  }
  .pub-cta {
    gap: 6px;
  }
}
@media (max-width: 520px) {
  .pub-top-in {
    padding: 10px 16px;
    gap: 8px;
  }
  .pub-top .brand span {
    font-size: 1.05rem;
  }
  .pub-top .pub-cta .btn-primary {
    display: none;
  }
}

/* The footer's last line, and links big enough for a thumb. */
.pub-copy {
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 24px 28px;
  color: var(--muted);
  font-size: 0.85rem;
  border-block-start: 1px solid var(--line);
}
.pub-foot nav a {
  min-height: 32px;
  display: flex;
  align-items: center;
}

/* Phones: start and WhatsApp always at hand. */
.pub-mobile-cta {
  display: none;
}
@media (max-width: 700px) {
  .pub-mobile-cta {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 35;
    display: flex;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-block-start: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgb(20 16 60 / 0.08);
  }
  .pub-mobile-cta .btn-primary {
    flex: 1;
  }
  body.site {
    padding-block-end: 72px;
  }
}

/* The hero: the starting price under the buttons; slimmer on inner pages. */
.lp-from {
  margin: 14px 0 0;
  font-weight: 600;
}
.lp-from a {
  color: var(--hero-accent, var(--brand));
}
.lp-hero-slim {
  padding: 48px 0 36px;
}
.lp-hero-slim .lp-title {
  max-width: 900px;
}

/* Before and now, both readable. */
.lp-pain p {
  margin: 0;
}
.lp-before {
  color: var(--ink-2);
  font-weight: 500 !important;
}
.lp-after {
  margin-block-start: 12px !important;
  font-weight: 600;
}
.lp-before span,
.lp-after span {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  margin-inline-end: 6px;
  vertical-align: 1px;
}
.lp-before span {
  background: var(--danger-soft);
  color: var(--danger);
}
.lp-after span {
  background: var(--ok-soft);
  color: var(--ok);
}

/* Pricing: five plans in a row on wide screens, a real badge, notes under. */
.lp-plans {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
@media (min-width: 1180px) {
  .lp-plans {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .lp-plan {
    padding: 22px 18px;
  }
}
.lp-plan-main::before {
  content: none;
}
.lp-badge {
  position: absolute;
  inset-block-start: -13px;
  inset-inline-start: 18px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}
.lp-note {
  max-width: 820px;
  margin: 22px auto 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.92rem;
}
.lp-note p {
  margin: 4px 0;
}

/* Talk to a person. */
.lp-contact-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
}
.lp-contact h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.lp-contact p {
  margin: 0;
  color: var(--ink-2);
}
.lp-contact .btn {
  background: #25d366;
  border-color: #25d366;
  color: #08331a;
  font-weight: 700;
}

.lp-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.center {
  text-align: center;
}

/* The features page: an index of the parts, then one band per part. */
.ft-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 26px;
}
.ft-index a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.2);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.ft-index a:hover {
  background: rgb(255 255 255 / 0.2);
  text-decoration: none;
}
.ft-area {
  scroll-margin-block-start: 80px;
}
.ft-alt {
  background: var(--surface-2);
}
.ft-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-block-end: 22px;
}
.ft-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}
.ft-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.05rem;
  max-width: 760px;
}
.ft-head .lp-icon {
  flex: none;
}
.ft-body {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
}
.ft-noshot {
  grid-template-columns: 1fr;
}
.ft-groups {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.ft-noshot .ft-groups {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.ft-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.ft-group h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.ft-group .lp-points li {
  font-size: 0.94rem;
}
@media (max-width: 900px) {
  .ft-body {
    grid-template-columns: 1fr;
  }
}

/* Sign in / sign up: the brand and the other language on one row. */
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-top .brand {
  margin: 0;
}
.auth-side-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0;
}

/* The legal pages. */
.prose h2 {
  font-size: 1.15rem;
  margin: 26px 0 8px;
}
.prose ul {
  color: var(--ink-2);
  padding-inline-start: 22px;
}
.prose li {
  margin: 6px 0;
}

/* FAQ: the whole question row is the tap target. */
.lp-faq details {
  padding: 0;
}
.lp-faq summary {
  padding: 16px 20px;
}
.lp-faq p {
  margin: 0;
  padding: 0 20px 16px;
}

/* Keyboard focus on the coloured bands. */
.lp-hero :focus-visible,
.lp-patient :focus-visible,
.lp-final :focus-visible,
.ft-index :focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Phones: two cards a row, the patient's journey scrolls sideways. */
@media (max-width: 640px) {
  .lp-orgs,
  .lp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .lp-org,
  .lp-card {
    padding: 14px;
  }
  .lp-org {
    grid-template-columns: 1fr;
  }
  .lp-org .lp-icon {
    grid-row: auto;
  }
  .lp-org > span:not(.lp-icon),
  .lp-card p {
    font-size: 0.86rem;
  }
  .lp-org em {
    display: none;
  }
  .lp-journey {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-block-end: 8px;
  }
  .lp-journey li {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }
}

/* Screenshots: WebP with a JPEG fallback; the <picture> lays out as its image. */
picture.pic {
  display: contents;
}
/* A phone screenshot beside the words stands in its own phone frame. */
.lp-shot-phone {
  justify-self: center;
  width: min(300px, 78%);
  margin-inline: auto;
  border: 8px solid var(--nav-bg);
  border-radius: 30px;
  overflow: hidden;
  background: var(--nav-bg);
}
.lp-shot-phone img {
  display: block;
  width: 100%;
  height: auto;
}
.lp-price {
  white-space: nowrap;
}
