/* Rovanta — a phone-first working tool for reception, therapists and the owner.
   Layout: one column of task cards, top bar + bottom tab bar on phones, side rail on wide screens. */
/* v8 · Rovanta — navy from the logo for actions, the pulse (cyan → teal) only for the brand's moments, cool neutral surfaces. */
:root {
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #edf1f5;
  --line: #dce3ea;
  --line-strong: #c7d1dc;
  --ink: #0f1c2e;
  --ink-2: #33445a;
  --muted: #5b6b7c;
  --accent: #0e2340;
  --accent-hover: #1a3a63;
  --accent-ink: #ffffff;
  --accent-soft: #e2f4f2;
  --accent-text: #0b6b67;
  --pulse: #16b9a6;
  --pulse-2: #2fd4e8;
  --ring: rgba(22, 185, 166, .26);
  --rail: #0e2340;
  --ok: #12784a;
  --ok-soft: #ddf3e8;
  --warn: #965706;
  --warn-soft: #fcefd8;
  --bad: #bd2a2a;
  --bad-soft: #fbe4e4;
  --info: #1c5ea5;
  --info-soft: #e3edf9;
  --shadow: 0 1px 2px rgba(14, 35, 64, .05);
  --shadow-lg: 0 18px 44px -18px rgba(14, 35, 64, .38), 0 2px 8px rgba(14, 35, 64, .07);
  --font-ui: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, "Segoe UI", sans-serif;
  --font-num: "Readex Pro", "IBM Plex Sans Arabic", system-ui, "Segoe UI", sans-serif;
  --r: 16px;
  --r-sm: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07111d; --surface: #0d1b2a; --surface-2: #132538; --line: #1f3448; --line-strong: #2b4560; --ink: #e6eef6; --ink-2: #c3d1df; --muted: #91a3b6;
    --accent: #3ccfc3; --accent-hover: #63ddd3; --accent-ink: #04211f; --accent-soft: #0f3237; --accent-text: #6fe0d6; --ring: rgba(60, 207, 195, .3); --rail: #081422;
    --ok: #5fd394; --ok-soft: #0f2e21; --warn: #f2b65b; --warn-soft: #33260f; --bad: #ff8a84; --bad-soft: #3a1a1c; --info: #8cb8f0; --info-soft: #152a44;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 44px -18px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07111d; --surface: #0d1b2a; --surface-2: #132538; --line: #1f3448; --line-strong: #2b4560; --ink: #e6eef6; --ink-2: #c3d1df; --muted: #91a3b6;
  --accent: #3ccfc3; --accent-hover: #63ddd3; --accent-ink: #04211f; --accent-soft: #0f3237; --accent-text: #6fe0d6; --ring: rgba(60, 207, 195, .3); --rail: #081422;
  --ok: #5fd394; --ok-soft: #0f2e21; --warn: #f2b65b; --warn-soft: #33260f; --bad: #ff8a84; --bad-soft: #3a1a1c; --info: #8cb8f0; --info-soft: #152a44;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 44px -18px rgba(0, 0, 0, .7); color-scheme: dark;
}
/* the patients' pages (booking, rating, intake, programme) keep the clinic's own colour */
:root[data-surface="public"] { --accent: #007a35; --accent-hover: #006a2e; --accent-ink: #ffffff; --accent-soft: #dcefe3; --accent-text: #00692e; --pulse: #007a35; --ring: rgba(0, 122, 53, .22); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-ui); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: .98rem; }
a { color: var(--accent); }
.num, .code { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.code { font-size: .85em; letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* shell */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; }
.brand-home { background: none; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 10px; color: inherit; font-size: inherit; cursor: pointer; }
.brand-home:hover, .brand-home:focus-visible { background: var(--accent-soft, #e2f3e8); }
.brand-mark { width: 30px; height: 30px; object-fit: contain; display: block; flex: none; }
.login .brand-mark, .pub-head .brand-mark { width: 56px; height: 56px; }
.login .brand { flex-direction: column; text-align: center; gap: 6px; }
.topbar .spacer { flex: 1; }
.who { font: inherit; font-size: .82rem; color: var(--muted); text-align: end; line-height: 1.2; background: none; border: 0; padding: 4px; cursor: pointer; border-radius: 8px; }
.who:hover { background: var(--surface-2); }
.main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 14px; }
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .72rem; color: var(--muted); cursor: pointer; position: relative; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 600; }
.badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 6px); background: var(--bad); color: #fff; border-radius: 9px; font-size: .66rem;
  min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; font-family: var(--font-num); }
@media (min-width: 900px) {
  .shell { flex-direction: row; flex-wrap: wrap; }
  .topbar { width: 100%; }
  .tabs { position: sticky; top: 60px; align-self: flex-start; flex-direction: column; width: 190px; border: 0; background: none; padding: 16px 8px; gap: 2px; }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
  .tabs button[aria-current="page"] { background: var(--accent-soft); }
  .badge { position: static; margin-inline-start: auto; }
  .main { padding-bottom: 32px; }
}

/* blocks */
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head h1, .head h2 { flex: 1; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.stat .value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 600; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .grow { flex: 1; min-width: 0; }
.item .time { font-family: var(--font-num); font-weight: 600; min-width: 52px; }
.item.clickable { cursor: pointer; }
.title { font-weight: 600; overflow-wrap: anywhere; }
.meta { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: .9rem; display: flex; gap: 8px; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--info-soft); }
.sev { border-inline-start: 4px solid var(--line); padding-inline-start: 10px; }
.sev.alert-sev { border-color: var(--bad); } .sev.warn-sev { border-color: var(--warn); } .sev.info-sev { border-color: var(--accent); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.booked { background: var(--info-soft); color: var(--ink); }
.chip.arrived { background: var(--warn-soft); color: var(--warn); }
.chip.done, .chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.no_show, .chip.cancelled, .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn.wa { color: var(--ok); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; min-height: 42px; }
textarea.input { min-height: 80px; resize: vertical; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form .full { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: 8px 12px; cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .85rem; }
.chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
td.n, th.n { unicode-bidi: plaintext; text-align: end; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.void td { color: var(--muted); text-decoration: line-through; }
.total-row td { font-weight: 700; border-bottom: 0; }

/* sheet (modal) */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 20, 22, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92%; overflow-y: auto; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
/* a long sheet scrolls; nothing inside it is squeezed (a bill's table used to collapse to nothing on a phone) */
.sheet > * { flex-shrink: 0; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 16px; } }
.toast { position: fixed; inset-inline: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 420px; margin: 0 auto;
  background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); pointer-events: none; }
.toast.bad { background: var(--bad); color: #fff; }

/* bars chart */
.bars { direction: ltr; display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; background: var(--accent); opacity: .85; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div.below { background: var(--warn); }
.target-line { position: relative; direction: ltr; }
.target-line .line { position: absolute; inset-inline: 0; border-top: 1px dashed var(--bad); }
.target-line .line span { position: absolute; inset-inline-end: 0; top: -18px; font-size: .7rem; color: var(--bad); background: var(--surface); padding: 0 4px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); }

/* stars */
.stars { display: flex; gap: 6px; justify-content: center; direction: ltr; }
.stars button { border: 0; background: none; font-size: 40px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; }
.stars button.on { color: #e3a008; }

/* login */
.center { min-height: 100%; display: grid; place-items: center; padding-block: 24px; padding-inline: 16px; }
.login { width: 100%; max-width: 380px; }
.demo-pick { display: grid; gap: 8px; }
.demo-pick button { text-align: start; justify-content: flex-start; padding: 12px 14px; min-height: 56px; }
.demo-banner { background: var(--warn-soft); color: var(--warn); font-size: .78rem; text-align: center; padding: 4px 16px; }

@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .18s ease-out; } @keyframes up { from { transform: translateY(24px); opacity: .6; } } }

/* ── v2: booking, pricing, patient file, report, public booking ── */
.linkbtn { border: 0; padding: 0; background: none; cursor: pointer; text-align: start; color: inherit; min-width: 0; }
.linkbtn .title { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.item.pick { border-inline: 0; border-bottom: 0; background: none; text-align: start; width: 100%; }
.alert.clickable { cursor: pointer; font: inherit; color: inherit; }
.daychips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.daychips button { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 54px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.daychips button span { font-size: .72rem; color: var(--muted); }
.daychips button strong { font-family: var(--font-num); font-size: 1.05rem; }
.daychips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.daychips button[aria-pressed="true"] span { color: var(--accent-ink); }
.slotgroup { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.slots button { border: 1px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 10px; min-height: 42px;
  font-family: var(--font-num); font-variant-numeric: tabular-nums; cursor: pointer; font-weight: 600; }
.slots button:disabled { border-color: var(--line); color: var(--muted); background: var(--surface-2); text-decoration: line-through; cursor: not-allowed; font-weight: 400; }
.slots button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.quotes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quote { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.quote .value { font-family: var(--font-num); font-size: 1.3rem; font-weight: 600; }
.quote.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.quote .save { color: var(--ok); font-weight: 600; font-size: .85rem; }
.quote .btn { margin-top: 6px; }
.casecard { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.casecard:first-of-type { border-top: 0; padding-top: 0; }
.casecard.closed { opacity: .7; }
.kvgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; }
.kv { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kv > span:first-child { font-size: .76rem; color: var(--muted); }
.kv > span:last-child { overflow-wrap: anywhere; white-space: pre-wrap; }
.modgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.hoursrow { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.hoursrow select { min-height: 38px; padding: 4px 8px; }
.codebox { background: var(--surface-2); border-radius: 10px; padding: 10px; font-family: var(--font-num); font-size: .78rem; white-space: pre-wrap; word-break: break-all; margin: 0; }
.stepn { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-size: .8rem; margin-inline-end: 8px; font-family: var(--font-num); vertical-align: 2px; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.choice button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px; text-align: start; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.choice button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pub { max-width: 640px; margin: 0 auto; padding-block: 16px 40px; padding-inline: 16px; display: flex; flex-direction: column; gap: 12px; }
.pub-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-head h1 { font-size: 1.15rem; }

/* printable medical report (A4 look) */
.paper { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 4px; padding: 28px 26px; display: flex; flex-direction: column; gap: 12px;
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; line-height: 1.8; max-width: 760px; margin: 0 auto; width: 100%; }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 10px; gap: 12px; }
.paper-brand { display: flex; flex-direction: column; direction: ltr; text-align: left; }
.paper-brand strong { font-family: "Readex Pro", sans-serif; letter-spacing: .12em; font-size: 1.2rem; }
.paper-brand span { font-size: .8rem; }
.paper-tax { font-size: .82rem; text-align: right; }
.paper-title { text-align: center; font-size: 1.15rem; margin: 6px 0; font-family: "Readex Pro", sans-serif; }
.paper p { margin: 0; }
.paper-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.paper-table th, .paper-table td { border: 1px solid #999; padding: 4px 8px; text-align: center; color: #111; }
.paper-table th { background: #f1f1f1; color: #111; font-size: .85rem; }
.paper-sign { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sigline { font-size: .82rem; color: #1f5f3a; }
.paper-foot { display: flex; justify-content: space-between; border-top: 1px solid #999; padding-top: 8px; font-size: .78rem; gap: 10px; flex-wrap: wrap; }
@media print {
  .topbar, .tabs, .demo-banner, .no-print, .toast { display: none !important; }
  body, .main { background: #fff !important; padding: 0 !important; }
  .paper { border: 0; padding: 0; max-width: none; }
}
.alert svg { width: 20px; height: 20px; flex: none; }
.pricetable td { vertical-align: top; }
.pricetable tr.clickable { cursor: pointer; }
.pricetable tr.clickable:hover td { background: var(--surface-2); }
.pricetable tr.selrow td { background: var(--accent-soft); }
.pricetable .grouprow td { font-family: var(--font-display); font-weight: 600; color: var(--accent); padding-top: 14px; border-bottom: 2px solid var(--accent-soft); }
@media (max-width: 600px) {
  .pricetable thead { display: none; }
  .pricetable tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .pricetable td { border: 0; padding: 2px 0; }
  .pricetable td:first-child, .pricetable .grouprow td { grid-column: 1 / -1; }
  .pricetable td.n { text-align: start; font-weight: 600; }
  .pricetable td.n::before { content: attr(data-label); display: block; font-family: var(--font-ui); font-weight: 400; font-size: .72rem; color: var(--muted); }
}

/* v3.2 quick price check */
.qq-areas button { min-height: 40px; font-size: .92rem; }
.qq-selected { display: flex; flex-direction: column; gap: 8px; }
.qq-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); }
.qq-pick strong { flex: 1; min-width: 90px; }
.qq-pick .seg button { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.qq-why { font-size: 1rem; }
.qq-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.qq-card { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); text-align: center; }
.qq-card.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.qq-flag { position: absolute; top: -10px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 10px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
[dir="rtl"] .qq-flag { transform: translateX(50%); }
.qq-title { font-weight: 600; }
.qq-per { font-family: var(--font-num); font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1.2; margin-top: 4px; }
.qq-total { font-size: .9rem; }
.qq-card .save { color: var(--ok); font-weight: 700; font-size: .9rem; }
.qq-say { border-inline-start: 3px solid var(--accent); padding: 6px 12px; background: var(--surface-2, var(--bg)); border-radius: 8px; }
.qq-say p { margin: 4px 0 0; line-height: 1.7; }
.qq-extras summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.qq-extras .chips { margin-block: 8px; }
.qq-actions { gap: 8px; flex-wrap: wrap; }
.qq-actions > * { flex: 1; }
.qq-svcs { display: flex; flex-direction: column; gap: 8px; }
.qq-svc { text-align: start; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; color: inherit; }
.qq-svc[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 600px) {
  .qq-cards { grid-template-columns: 1fr; }
  .qq-card { text-align: start; padding-inline-end: 130px; min-height: 92px; justify-content: center; }
  .qq-card .qq-per { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-70%); margin: 0; font-size: 1.45rem; }
  .qq-card .qq-per + .meta { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(45%); }
  .qq-flag { inset-inline-start: auto; inset-inline-end: 10px; transform: none; }
  [dir="rtl"] .qq-flag { transform: none; }
}

/* logo + credit */
.credit { text-align: center; font-size: .75rem; color: var(--muted); margin: 6px 0 0; letter-spacing: .02em; }
.paper-head { align-items: center; }
.paper-id { display: flex; align-items: center; gap: 10px; direction: ltr; }
.paper-logo { width: 54px; height: 54px; object-fit: contain; }
.paper-tax .num { white-space: nowrap; }

/* v3.4 permissions & void requests */
.perms { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.perms legend { padding: 0 6px; }
.perms .check { align-items: flex-start; }
.perms .check input { margin-top: 3px; flex: none; }
.perms .check > span { display: flex; flex-direction: column; }
.vr { border-color: var(--bad); }
.vr-item { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.vr-item:first-of-type { border-top: 0; padding-top: 0; }
.warn-t { color: var(--warn); font-weight: 700; }
@media (max-width: 600px) {
  .teamtable thead { display: none; }
  .teamtable tr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .teamtable td { border: 0; padding: 0; text-align: start; }
  .teamtable td:first-child { grid-column: 1 / -1; }
  .teamtable td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); font-weight: 400; font-family: var(--font-ui); }
}
/* Arabic letters must stay joined: no letter spacing, and headers never use the number font */
[dir="rtl"] th, [dir="rtl"] .stat .label, [dir="rtl"] .credit, [dir="rtl"] .code { letter-spacing: 0; }
th, th.n { font-family: var(--font-ui); }
.bk-tips { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.pf summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.pf-grid .row .input { min-width: 0; flex: 1; }
.prog-kv { display: grid; grid-template-columns: 9.5em 1fr; gap: 8px; font-size: .86rem; margin-top: 2px; }
.prog-kv > span:first-child { color: var(--muted); }
@media (max-width: 600px) { .prog-kv { grid-template-columns: 1fr; gap: 0; } }
.rf-table td { padding: 8px 6px; } .rf-table .total-row td { border-top: 2px solid var(--line); }
/* v5: split payments, money reports */
.paysplit { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; }
#pay-left { margin-top: 6px; }
button.stat { background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; }
button.stat:hover .label { color: var(--accent); }
.hbar { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar > div { height: 100%; background: var(--accent); }
.reptable td:nth-child(2) { min-width: 140px; }
.item.void .title, .item.void .num { text-decoration: line-through; opacity: .6; }
/* v6: progress signal, pain chart, score buttons */
.sig { font-size: 1rem; line-height: 1; display: inline-block; }
.sig-red { color: var(--bad); } .sig-yellow { color: #d4a017; } .sig-green { color: var(--ok); } .sig-grey { color: #8a8f98; } .sig-new { color: var(--muted); } .sig-closed { color: var(--muted); }
.chip.sigchip.sig-red { background: var(--bad-soft); } .chip.sigchip.sig-yellow { background: var(--warn-soft); color: var(--warn); }
.chip.sigchip.sig-green { background: var(--ok-soft); } .chip.sigchip.sig-grey { background: var(--surface-2); }
.reasons { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.reason { font-size: .75rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink); }
.painbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.painchart { max-width: 100%; height: auto; background: var(--surface-2); border-radius: 8px; }
.painchart .mid { stroke: var(--line); stroke-dasharray: 3 3; }
.painchart .dr { fill: none; stroke: var(--accent); stroke-width: 2; }
.painchart .drd { fill: var(--accent); }
.painchart .pt { fill: #d97706; stroke: var(--surface); stroke-width: 1; }
.legend { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.lg-dr { background: var(--accent); } .lg-pt { background: #d97706; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); }
.painpick { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.painpick button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-family: var(--font-num); font-weight: 600; cursor: pointer; color: var(--ink); padding: 0; }
.painpick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.painpick .p0, .painpick .p1, .painpick .p2, .painpick .p3 { border-bottom: 3px solid var(--ok); }
.painpick .p4, .painpick .p5, .painpick .p6 { border-bottom: 3px solid #d4a017; }
.painpick .p7, .painpick .p8, .painpick .p9, .painpick .p10 { border-bottom: 3px solid var(--bad); }
.incident { border-inline-start: 4px solid var(--bad); }
.incident.closed { border-inline-start-color: var(--ok); opacity: .85; }

/* brand: the Rovanta logo */
.splash { flex-direction: column; gap: 12px; }
.splash img { max-width: 50vw; height: auto; }
.logo-full { width: 150px; max-width: 60%; height: auto; display: block; margin: 0 auto 4px; }
.logo-full.dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-full.light { display: none; } :root:not([data-theme="light"]) .logo-full.dark { display: block; } }
:root[data-theme="dark"] .logo-full.light { display: none; } :root[data-theme="dark"] .logo-full.dark { display: block; }
.brand-mark { width: 34px; height: 34px; }
.credit img { width: 18px; height: 18px; vertical-align: middle; margin-inline-end: 4px; }
.watermark-empty { display: block; width: 64px; opacity: .18; margin: 12px auto; }
/* body map */
:root { --body-fill: #f1f4f2; --bm-line: #7f938a; --bm-zone: #d9e1dd; --bm-skin: #eef2f0; --bm-skin-light: #fbfcfb; --bm-skin-edge: #cdd8d2; --bm-hair: #8a9690; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --body-fill: #26302c; --bm-line: #8a9c94; --bm-zone: #34403b; --bm-skin: #2c3733; --bm-skin-light: #36433e; --bm-skin-edge: #1f2825; --bm-hair: #56645e; } }
:root[data-theme="dark"] { --body-fill: #26302c; --bm-line: #8a9c94; --bm-zone: #34403b; --bm-skin: #2c3733; --bm-skin-light: #36433e; --bm-skin-edge: #1f2825; --bm-hair: #56645e; }
.bodymap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 420px; margin: 0 auto; }
.bm-fig { margin: 0; text-align: center; }
.bm-fig svg { width: 100%; height: auto; max-height: 470px; direction: ltr; display: block; margin: 0 auto; }
.bm-fig figcaption { font-size: .8rem; color: var(--muted); }
.bm-outline { fill: none; stroke: var(--bm-line); stroke-width: 1.6; stroke-linejoin: round; }
.bm-body { stroke: none; }
.bm-sides { display: flex; justify-content: space-between; direction: ltr; padding: 0 6%; font-size: .72rem; font-weight: 600; color: var(--muted); margin-bottom: -4px; }
.bm-part { fill: transparent; stroke: none; transition: fill .15s; }
.bm-part.on { fill: var(--mc); fill-opacity: .85; stroke: none; }
.bm-part[data-act] { cursor: pointer; }
.bm-part[data-act]:hover, .bm-part[data-act]:focus { fill: #ffffff; fill-opacity: .28; outline: none; }
.bm-part.on[data-act]:hover, .bm-part.on[data-act]:focus { fill: var(--mc); fill-opacity: .95; }
.bm-guide { pointer-events: none; fill: none; stroke: var(--bm-line); stroke-width: .5; stroke-linecap: round; opacity: .6; }
.bm-guide .bm-dot { fill: var(--bm-line); stroke: none; }
.bm-guide .bm-hair { fill: var(--bm-hair); stroke: none; opacity: .9; }
.bm-badge { pointer-events: none; }
.bm-badge circle { stroke: #fff; stroke-width: 5; }
.bm-badge text { font: 700 28px var(--font-num, monospace); fill: #fff; text-anchor: middle; }
.bm-num { font: 700 7px var(--font-num, monospace); fill: #1b1b1b; text-anchor: middle; pointer-events: none; }
.bm-side { font: 600 9px var(--font-ui, sans-serif); fill: var(--muted); }
.bm-legend { display: flex; justify-content: center; gap: 12px; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.bm-legend i, .bm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; vertical-align: middle; }
.bm-list { margin: 6px 0 0; padding-inline-start: 18px; font-size: .9rem; }
.bm-editor { position: relative; }
.bm-pop { position: sticky; bottom: 8px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.intake { max-width: 560px; margin: 0 auto; padding: 16px; }
.intake h2 { font-size: 1rem; margin: 8px 0; }
.chipcheck { display: inline-flex; }
.chipcheck input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipcheck span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .85rem; background: var(--surface); }
.chipcheck input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chipcheck input:focus-visible + span { outline: 2px solid var(--accent); }
.segopt { display: inline-flex; }
.segopt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segopt span { padding: 8px 12px; cursor: pointer; display: inline-block; }
.segopt input:checked + span { background: var(--accent); color: var(--accent-ink); }
.segopt input:focus-visible + span { outline: 2px solid var(--accent); }
.msgprev { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: .9rem; margin: 0; }
.bday { border-inline-start: 4px solid #e3a008; }
/* body map: clearer front / back and the 1–10 scale */
.bm-cap { font-size: .9rem !important; font-weight: 600; color: var(--ink) !important; background: var(--surface-2); border-radius: 999px; padding: 4px 10px; display: inline-block; margin-bottom: 4px; }
.bm-side { font: 600 6px var(--font-ui, sans-serif); fill: var(--muted); letter-spacing: .3px; }
.bm-scale { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.bm-grad { flex: 0 1 180px; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #f2c94c, #f08c2e 50%, #d64545); }
.painpick.ten { grid-template-columns: repeat(10, 1fr); }
.painpick.ten button { border-bottom: 4px solid var(--c); }
.painpick.ten button[aria-pressed="true"] { background: var(--c); color: #1b1b1b; border-color: var(--c); }
/* v6.4: simple percentage bar (how patients heard about us) */
.bar { height: 8px; border-radius: 4px; background: var(--line, #e3e8e5); overflow: hidden; margin-top: 3px; }
.bar > span { display: block; height: 100%; background: var(--accent, #007a35); border-radius: 4px; }

/* v6.7: treated-areas picker (new case) */
.ncgrid { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 6px; }
@media (min-width: 640px) { .ncgrid { grid-template-columns: 1fr 1fr; column-gap: 18px; } }
.ncrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ncchip { min-width: 54px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); }
.ncchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); font-weight: 600; }
.dob { display: grid; grid-template-columns: 1fr 1.6fr 1.3fr; gap: 6px; }

/* v7.0: visit type cards (booking) */
.vtgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .vtgrid { grid-template-columns: 1fr 1fr; } }
.vt { text-align: start; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.vt.on { border-color: var(--accent); background: var(--accent-soft, #e2f3e8); box-shadow: 0 0 0 1px var(--accent) inset; }
.vt .vt-price { font-weight: 600; color: var(--accent); font-size: .9rem; }
.ppopt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.ppopt.on { border-color: var(--accent); background: var(--accent-soft, #e2f3e8); }
.ppopt .grow { display: flex; flex-direction: column; }
/* v7.1 booking menu by group */
.bkcats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.bkcats button { font: inherit; padding: 10px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; }
.bkcats button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vt.svc { gap: 4px; }
.vt-incl { display: flex; flex-wrap: wrap; gap: 4px; }
.vt-incl span { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--bg, #f1f4f3); border: 1px solid var(--line); color: var(--ink); }
.vt-incl.strong span { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.vt-pk { font-size: .78rem; }
.vt-free { color: var(--accent); }
.slots button.gap { border-style: dashed; }
.item.appt-off { opacity: .75; }
.item.appt-off .title { text-decoration: line-through; text-decoration-color: var(--muted, #8a9590); }
@media (min-width: 560px) { .bkcats { grid-template-columns: repeat(4, 1fr); } }
/* v7.3 day board */
.board-card h2 { margin: 0; }
.board-next { margin: 4px 0 8px; }
.freechip { border: 1.5px dashed var(--accent) !important; color: var(--accent); font-weight: 600; }
.freechip .meta { font-weight: 400; }
.board-wrap { overflow-x: auto; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; }
.board { display: grid; position: relative; min-width: fit-content; background: var(--surface); }
.board .bh { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 4px 6px; display: flex; flex-direction: column; justify-content: center; font-size: .82rem; line-height: 1.2; }
.board .bh.off { opacity: .6; }
.board .bh .chip { align-self: flex-start; font-size: .7rem; padding: 0 6px; }
.board .bt { font-size: .7rem; color: var(--muted, #6b7671); padding: 0 4px; border-top: 1px solid var(--line); position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 2; }
.board .bl { border-top: 1px solid var(--line); height: 0; align-self: start; pointer-events: none; }
.board .boff { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.05) 6px 12px); }
.board .bappt { margin: 1px 3px; border-radius: 8px; border: 0; border-inline-start: 4px solid var(--accent); background: #e7f2ec; color: var(--ink); font: inherit; font-size: .75rem; text-align: start; padding: 2px 6px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; line-height: 1.25; z-index: 1; }
.board .bappt .bwhat { color: var(--muted, #6b7671); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .bappt.g-assess { border-color: #c47a12; background: #fbf0dc; }
.board .bappt.g-rec { border-color: #3a6fb0; background: #e3edf8; }
.board .bappt.g-lym { border-color: #8a4fb3; background: #f1e7f8; }
.board .bappt.g-dev { border-color: #b03a5b; background: #f8e3ea; }
.board .bappt.st-done { opacity: .6; }
.board .bappt.st-arrived { box-shadow: inset 0 0 0 2px var(--accent); }
.board .bfree { margin: 2px 4px; border-radius: 8px; border: 1.5px dashed var(--accent); background: rgba(40,140,90,.06); color: var(--accent); font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; z-index: 1; }
.board .bfree:hover { background: rgba(40,140,90,.14); }
.board .bnow { border-top: 2px solid #d64545; height: 0; align-self: start; z-index: 2; pointer-events: none; }
.board-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 8px; }
.board-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #e7f2ec; border-inline-start: 3px solid var(--accent); }
.board-legend .lg.g-assess { background: #fbf0dc; border-color: #c47a12; } .board-legend .lg.g-rec { background: #e3edf8; border-color: #3a6fb0; }
.board-legend .lg.g-lym { background: #f1e7f8; border-color: #8a4fb3; } .board-legend .lg.g-dev { background: #f8e3ea; border-color: #b03a5b; }
.board-legend .lg.free { background: transparent; border: 1.5px dashed var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .board .bappt { background: #1f3329; } :root:not([data-theme="light"]) .board .bappt.g-assess { background: #3a2e17; }
  :root:not([data-theme="light"]) .board .bappt.g-rec { background: #1c2a3b; } :root:not([data-theme="light"]) .board .bappt.g-lym { background: #2d2238; }
  :root:not([data-theme="light"]) .board .bappt.g-dev { background: #3a1f28; }
}
/* v7.4 hubs, header buttons, payment success */
.hubgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .hubgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .hubgrid { grid-template-columns: 1fr 1fr 1fr; } }
.hubtile { display: flex; gap: 12px; align-items: flex-start; text-align: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.hubtile:hover { border-color: var(--accent); background: var(--accent-soft); }
.hubtile svg { width: 26px; height: 26px; flex: none; color: var(--accent); margin-top: 2px; }
.hubtile .grow { display: flex; flex-direction: column; gap: 2px; }
.topbar .bell { position: relative; padding-inline: 8px; }
.topbar .bell svg { width: 18px; height: 18px; }
.topbar .bell .badge { position: absolute; top: -6px; inset-inline-end: -6px; }
.themebtn { min-width: 36px; }
.condlist { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.condres { text-align: start; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 6px 10px; font: inherit; cursor: pointer; display: flex; flex-direction: column; }
.condres:hover { border-color: var(--accent); }
.condpick { margin-top: 6px; }
.paid-ok { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 10px 0 4px; }
.paid-ok svg { width: 92px; height: 92px; }
.paid-ok .ring { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 260; stroke-dashoffset: 260; animation: paidRing .55s ease-out forwards; }
.paid-ok .disc { fill: var(--accent); opacity: 0; transform-origin: 50% 50%; animation: paidDisc .35s .45s ease-out forwards; }
.paid-ok .tick { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: paidTick .35s .7s ease-out forwards; }
.paid-ok .amt { font-size: 1.9rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.paid-ok .ttl { font-weight: 600; }
@keyframes paidRing { to { stroke-dashoffset: 0; } }
@keyframes paidDisc { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes paidTick { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .paid-ok .ring, .paid-ok .disc, .paid-ok .tick { animation-duration: .01s; animation-delay: 0s; } }
/* v7.5 reasons, activity log, cash guide */
.whylist { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.whyrow { border-inline-start: 4px solid #c47a12; background: #fbf3e2; border-radius: 8px; padding: 6px 10px; font-size: .88rem; }
.whyrow.red { border-color: var(--bad); background: #fbe9e9; }
.whyrow .todo { color: var(--muted, #5d6965); margin-top: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .whyrow { background: #33291a; } :root:not([data-theme="light"]) .whyrow.red { background: #3a2222; } }
:root[data-theme="dark"] .whyrow { background: #33291a; } :root[data-theme="dark"] .whyrow.red { background: #3a2222; }
.acdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; background: #8a9590; vertical-align: middle; }
.acdot.ac-money { background: #1f8a4c; } .acdot.ac-bookings { background: #3a6fb0; } .acdot.ac-clinical { background: #8a4fb3; } .acdot.ac-team { background: #c47a12; } .acdot.ac-system { background: #6b7671; } .acdot.ac-all { background: transparent; border: 1.5px solid #8a9590; }
.actfilters .input[type=date] { width: auto; display: inline-block; }
.cdguide .cdstep { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.cdguide .cdn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cdguide.done { opacity: .85; }

/* ───────── v7.6 ───────── */
.public-prog { max-width: 640px; margin: 0 auto; padding-block: 16px 40px; padding-inline: 16px; display: flex; flex-direction: column; gap: 12px; }
.pp-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pp-head .pp-logo { width: 110px; }
.pp-head h1 { font-size: 1.25rem; margin: 6px 0 0; }
.pp-ex h2 { font-size: 1.05rem; margin: 0; }
.pp-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.pp-steps { margin: 10px 0 6px; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.6; }
[data-since] { font-variant-numeric: tabular-nums; }

/* ═════════ v7.7: internal chat · rating on the clinic's tablet · repeat in booking ═════════ */
.topbar .chatbtn { position: relative; padding-inline: 8px; }
.topbar .chatbtn svg { width: 18px; height: 18px; }
.topbar .chatbtn .badge { position: absolute; top: -6px; inset-inline-end: -6px; inset-inline-start: auto; }
.chatav { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft, #e6f2f1); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.chatav.team { background: var(--surface); border: 1px solid var(--line); }
.chatbox { display: flex; flex-direction: column; gap: 6px; max-height: calc(100dvh - 270px); min-height: 240px; overflow-y: auto; padding: 12px; }
.msg { align-self: flex-start; max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.msg .meta { font-size: .72rem; }
.chatday { align-self: center; padding: 2px 10px; border-radius: 10px; background: var(--surface); margin: 6px 0; }
/* v7.9.5: the owner reads colleagues' conversations — both sides neutral, nobody is "you" */
.msg.mon.mine .bubble { background: var(--accent-soft, #e6f2f1); color: var(--ink); border-color: transparent; }
.chatnote { text-align: center; max-width: 92%; }
.chatav.pair { color: var(--accent); }
.chatform { position: sticky; bottom: 0; gap: 8px; align-items: flex-end; padding: 8px 0; background: var(--bg); }
.kiosk-bg { align-items: stretch !important; }
.kiosk-bg .sheet { max-width: 760px; max-height: 100%; height: 100%; border-radius: 0; padding: 20px; }
@media (min-width: 700px) { .kiosk-bg .sheet { height: auto; max-height: 96%; border-radius: 16px; margin: auto; } }
.kiosk h2 { font-size: 1.5rem; }
.painpick.big button { min-height: 52px; font-size: 1.1rem; }
.stars.big button { font-size: 52px; }
.kiosk .seg button { min-height: 52px; font-size: 1.05rem; }
#chat-in { min-height: 44px; max-height: 120px; }
/* phone width: the chat button needs room — logo without the word, a narrower name, tighter buttons */
@media (max-width: 430px) {
  .topbar { gap: 6px; }
  .topbar .brand-home > span { display: none; }
  .topbar .btn.small { padding-inline: 7px; }
  .topbar .who { max-width: 78px; min-width: 0; padding-inline: 2px; }
  .topbar .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
}

/* touch screens: 16px text in fields so iPhone does not zoom in when a field is tapped */
@media (pointer: coarse) { input, select, textarea, .input { font-size: 16px; } }

/* ═════════ v7.9: the booking assistant — conversations, channel marks ═════════ */
.aich { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; margin-inline-end: 4px; }
.aich.whatsapp { background: #25d366; } .aich.instagram { background: #d6249f; } .aich.messenger { background: #0084ff; } .aich.web { background: #397b4d; } .aich.test { background: #9aa5a0; }
.msg.mine.ai .bubble { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.msg.mine.staff .bubble { background: var(--accent); color: var(--accent-ink); }
.aibook { border-color: var(--accent); }

/* ═════════════════════════ v8 · Rovanta look ═════════════════════════
   One memorable thing — the pulse (logo, start screen, the trace while data loads, the open tab).
   Everything else quiet: navy actions, flat cards, clear inputs. Same classes, same screens, same steps. */
html { background: var(--bg); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1 { font-size: 1.42rem; letter-spacing: -.005em; }
h2 { font-size: 1.06rem; }
a { color: var(--accent-text); text-underline-offset: 3px; }
.num, .code, .item .time, .stat .value, .daychips button strong, .badge { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; }
:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--pulse) 28%, transparent); }

/* ── brand ── */
.rv-mark { width: 32px; height: 32px; flex: none; display: block; }
.rv-mark svg { width: 100%; height: 100%; display: block; }
.rv-names { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; text-align: start; }
.rv-word { font-family: var(--font-display); font-weight: 600; font-size: 1.04rem; letter-spacing: .01em; color: var(--ink); }
.rv-clinic { font-family: var(--font-ui); font-weight: 500; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

/* ── top bar ── */
.topbar { gap: 6px; padding: 9px 14px; min-height: 60px; border-bottom-color: var(--line); }
.brand-home { gap: 10px; padding: 4px 6px; border-radius: 12px; }
.brand-home:hover, .brand-home:focus-visible { background: var(--surface-2); }
.topbar .btn.small { min-width: 38px; min-height: 38px; padding: 0 9px; border-radius: 11px; border-color: var(--line); color: var(--ink-2); font-weight: 600; }
.topbar .btn.small:hover { background: var(--surface-2); border-color: var(--line-strong); }
.topbar .btn.small svg { width: 19px; height: 19px; }
.iconbtn span.lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 8px; padding: 3px; border-radius: 999px; color: var(--ink); }
.who .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink);
  font: 600 .9rem/1 var(--font-display); }
.who .who-t { display: flex; flex-direction: column; text-align: start; line-height: 1.2; padding-inline-end: 6px; }
.who .who-t span:first-child { font-weight: 600; font-size: .84rem; }
.who .who-t span:last-child { font-size: .74rem; color: var(--muted); }
@media (max-width: 560px) { .who .who-t { display: none; } .rv-clinic { max-width: 110px; } .topbar { padding-inline: 10px; } }
.topbar .brand-home > .rv-mark { display: block; }
.topbar .brand-home > .rv-names { display: flex; }
@media (max-width: 430px) {
  .topbar { gap: 5px; }
  .topbar .btn.small { min-width: 35px; min-height: 35px; padding: 0 7px; border-radius: 10px; }
  .who .av { width: 32px; height: 32px; }
  /* the owner's bar has one more button (alerts): the mark alone, without the words */
  .topbar:has(.bell) .brand-home > .rv-names { display: none; }
}
@media (max-width: 380px) { .topbar .brand-home > .rv-names { display: none; } }

/* the data trace: a thin pulse runs under the top bar while the clinic's data is on its way */
.topbar::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--pulse-2), var(--pulse), transparent) no-repeat; background-size: 38% 100%; transition: opacity .2s; }
html.is-busy .topbar::after { opacity: 1; animation: rvTrace 1.05s linear infinite; }
@keyframes rvTrace { from { background-position: -62% 0; } to { background-position: 162% 0; } }

/* ── tabs: bottom bar on phones, navy rail on wide screens ── */
.tabs { border-top-color: var(--line); box-shadow: 0 -6px 20px -16px rgba(14, 35, 64, .4); }
.tabs button { gap: 3px; padding: 9px 2px 10px; font-size: .7rem; font-weight: 500; transition: color .15s; }
.tabs button svg { width: 23px; height: 23px; }
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabs button[aria-current="page"] svg { stroke-width: 2.1; }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; top: 0; inset-inline: 30%; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--pulse-2), var(--pulse)); }
.tabs .rail-brand { display: none; }
:root[data-theme="dark"] .tabs button[aria-current="page"] { color: var(--accent); }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; }
  .topbar { grid-column: 2; grid-row: 1; width: auto; top: 0; }
  .topbar .brand-home { display: none; }
  .tabs { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 0; height: 100vh; align-self: start; width: auto; overflow-y: auto;
    background: var(--rail); padding: 14px 12px 20px; gap: 3px; box-shadow: none; border: 0; }
  .tabs button { flex: 0 0 auto; }
  .tabs .rail-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: none; border-top: 0; border-inline: 0; cursor: pointer; font: inherit; text-align: start; }
  .rail-brand .rv-mark { width: 36px; height: 36px; }
  .rail-brand .rv-mark rect { fill: #183a63; }
  .rail-brand .rv-word { color: #fff; font-size: 1.1rem; }
  .rail-brand .rv-clinic { color: rgba(232, 241, 248, .6); max-width: 160px; }
  .tabs button { color: rgba(232, 241, 248, .7); padding: 10px 12px; border-radius: 11px; font-size: .9rem; font-weight: 500; }
  .tabs button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .tabs button[aria-current="page"] { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600; }
  :root[data-theme="dark"] .tabs button[aria-current="page"] { color: #fff; }
  .tabs button[aria-current="page"]::before { top: 9px; bottom: 9px; inset-inline-start: 0; inset-inline-end: auto; width: 3px; height: auto; border-radius: 3px;
    background: linear-gradient(180deg, var(--pulse-2), var(--pulse)); }
  .tabs .badge { background: var(--pulse); color: #04211f; }
  .main { max-width: 1060px; padding: 22px 28px 40px; gap: 16px; }
}

/* ── blocks ── */
.card { border-radius: var(--r); box-shadow: none; padding: 16px; gap: 12px; border-color: var(--line); }
.stat { gap: 3px; }
.stat .label { font-size: .78rem; font-weight: 500; letter-spacing: 0; }
.stat .value { font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.item { padding: 13px 0; border-top-color: var(--line); }
.item.pick, .item.clickable { transition: background-color .15s; }
.item.pick:hover .title, .item.clickable:hover .title { color: var(--accent-text); }
.title { font-weight: 600; }
.alert { border-radius: var(--r-sm); padding: 11px 14px; border: 1px solid transparent; line-height: 1.5; }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert.ok { border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert.info { color: var(--ink); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.alert.info svg { color: var(--info); }
.chip { padding: 3px 10px; gap: 6px; font-size: .74rem; letter-spacing: 0; }
.chip.booked, .chip.arrived, .chip.done, .chip.no_show, .chip.cancelled { padding-inline-start: 8px; }
.chip.booked::before, .chip.arrived::before, .chip.done::before, .chip.no_show::before, .chip.cancelled::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.booked { background: var(--info-soft); color: var(--info); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge { box-shadow: 0 0 0 2px var(--surface); }
.hubtile { border-radius: var(--r); padding: 14px; transition: border-color .15s, background-color .15s; }
.hubtile:hover { border-color: var(--line-strong); background: var(--surface-2); }
.hubtile svg { color: var(--accent-text); }
.demo-banner { font-size: .76rem; padding: 5px 16px; }

/* ── buttons ── */
.btn { min-height: 42px; padding: 8px 16px; border-radius: var(--r-sm); border-color: var(--line-strong); font-weight: 600; font-size: .92rem; color: var(--ink);
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:hover { border-color: var(--ink-2); background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 18px -12px rgba(14, 35, 64, .7); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.small { min-height: 34px; padding: 4px 12px; border-radius: 10px; font-size: .84rem; }
.btn.wa { color: #12804a; }
.btn:disabled { opacity: .55; }
/* a button that is working: after a short moment its text gives way to a small spinner (quick actions never flicker) */
.btn[aria-busy="true"] { position: relative; pointer-events: none; animation: rvHideText 0s .25s forwards; }
.btn[aria-busy="true"]:disabled { opacity: 1; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ink) 22%, transparent); border-top-color: var(--ink); opacity: 0;
  animation: rvSpin .7s linear infinite, rvShow 0s .25s forwards; }
.btn.primary[aria-busy="true"]::after { border-color: rgba(255, 255, 255, .35); border-top-color: var(--accent-ink); }
@keyframes rvHideText { to { color: transparent; } }
@keyframes rvShow { to { opacity: 1; } }
@keyframes rvSpin { to { transform: rotate(360deg); } }

/* ── inputs ── */
.field { gap: 6px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background-color .15s; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 28%, var(--line-strong)); }
.input:focus, .input:focus-visible { outline: none; border-color: var(--pulse); box-shadow: 0 0 0 4px var(--ring); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--muted); }
.input:user-invalid { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 14%, transparent); }
select.input { appearance: none; -webkit-appearance: none; padding-inline-end: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 13px center; }
[dir="rtl"] select.input { background-position: left 13px center; }
input[type="search"].input { padding-inline-start: 38px; background-repeat: no-repeat; background-size: 17px; background-position: left 13px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
[dir="rtl"] input[type="search"].input { background-position: right 13px center; }
input[type="number"].input { font-variant-numeric: tabular-nums; }
input[type="number"].input::-webkit-inner-spin-button, input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"].input { -moz-appearance: textfield; }
textarea.input { line-height: 1.55; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--pulse); }
:root:not([data-theme="dark"]) input[type="checkbox"], :root:not([data-theme="dark"]) input[type="radio"] { accent-color: #0f8f82; }
.check { gap: 10px; }

/* segmented choices: a soft track with the chosen option lifted on it */
.seg { border: 0; background: var(--surface-2); padding: 3px; border-radius: var(--r-sm); gap: 2px; overflow: visible; }
.seg button { background: transparent; border-radius: 9px; min-height: 36px; padding: 6px 14px; font-weight: 500; color: var(--ink-2); transition: background-color .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(14, 35, 64, .14), 0 0 0 1px var(--line); }
.chips { gap: 7px; }
.chips button { border-color: var(--line-strong); padding: 6px 14px; font-weight: 500; transition: background-color .15s, border-color .15s; }
.chips button:hover { border-color: var(--ink-2); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chipcheck span { border-color: var(--line-strong); padding: 7px 14px; transition: background-color .15s; }
.chipcheck input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.segopt span { border-radius: 9px; }
.daychips button { border-radius: var(--r-sm); border-color: var(--line); min-width: 56px; padding: 7px 8px; }
.daychips button[aria-pressed="true"] { box-shadow: 0 8px 16px -12px rgba(14, 35, 64, .8); }
.slots { gap: 8px; }
.slots button { border: 1px solid var(--line-strong); color: var(--ink); border-radius: var(--r-sm); font-family: var(--font-num); font-weight: 600; transition: background-color .15s, border-color .15s; }
.slots button:hover:not(:disabled) { border-color: var(--pulse); background: var(--accent-soft); }
.slots button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ── tables ── */
th { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: 0; background: var(--surface-2); }
th:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
th:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
th, td { padding: 9px 8px; }
th { border-bottom: 0; }

/* ── sheets and messages ── */
.sheet-bg { background: rgba(7, 17, 29, .5); animation: rvFade .18s ease-out; }
.sheet { border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); padding-top: 12px; animation: rvSheet .24s cubic-bezier(.2, .8, .2, 1); }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 2px; flex: none; }
@media (min-width: 700px) { .sheet { border-radius: 20px; padding-top: 18px; } .sheet::before { display: none; } }
@keyframes rvFade { from { opacity: 0; } }
@keyframes rvSheet { from { transform: translateY(24px); opacity: .6; } }
.toast { background: #0e2340; color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-weight: 500; animation: rvToast .22s cubic-bezier(.2, .8, .2, 1); }
:root[data-theme="dark"] .toast { background: #e6eef6; color: #07111d; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rvToast { from { transform: translateY(10px); opacity: 0; } }

/* ── waiting for a screen: its shape shows at once instead of a blank page ── */
.skel { display: flex; flex-direction: column; gap: 14px; animation: rvFade .2s .12s both; }
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 220% 100%; animation: rvShine 1.25s ease-in-out infinite; }
.sk-h { height: 26px; width: 44%; border-radius: 9px; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sk-row { display: flex; align-items: center; gap: 12px; }
.sk-av { width: 38px; height: 38px; border-radius: 12px; flex: none; }
.sk-l { height: 12px; }
.sk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.sk-stat { height: 64px; border-radius: var(--r-sm); }
@keyframes rvShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ── the payment-received moment: in the pulse colours ── */
.paid-ok .ring { stroke: var(--pulse); }
.paid-ok .disc { fill: var(--pulse); }
.paid-ok .amt { color: var(--ink); font-family: var(--font-num); }

/* ── sign-in ── */
.login-page { min-height: 100vh; background: radial-gradient(1100px 520px at 85% -10%, #1b3d66 0%, transparent 60%), #0e2340; position: relative; overflow: hidden; }
.login-page::before { content: ""; position: absolute; inset: auto -10% 6% -10%; height: 220px; opacity: .14; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'%3E%3Cpath d='M0 120h420l26-60 40 120 34-170 30 110h650' fill='none' stroke='%232fd4e8' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.login-page .login { position: relative; max-width: 400px; padding: 26px 22px 22px; border-radius: 22px; border: 0; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6); gap: 14px; }
.login-page .demo-pick button { text-align: start; justify-content: flex-start; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 4px; }
.login-brand .rv-mark { width: 56px; height: 56px; }
.login-brand .rv-word { font-size: 1.5rem; }
.login-brand .meta { text-align: center; }
.credit.sig { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); margin-top: 8px; letter-spacing: 0; }
.lift-sig { height: 18px; width: auto; display: inline-block; }
.lift-sig.dark { display: none; }
:root[data-theme="dark"] .lift-sig.light { display: none; } :root[data-theme="dark"] .lift-sig.dark { display: inline-block; }
.login-page > .stack, .login-page .login-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.login-page .muted, .login-page .meta { color: var(--muted); }
.login-page .row .btn.small { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  html.is-busy .topbar::after, .sk, .sheet, .sheet-bg, .toast, .skel { animation: none; }
  .btn:active { transform: none; }
}
@media print {
  html, body { background: #fff !important; }
  .shell { display: block !important; }
  .topbar::after { display: none; }
}

/* ═════════════════ v8 · second layer — the signature on the screens people look at all day ═════════════════
   Same markup and steps; only a few class hooks (kpis / hero / daynav / appt status) so each screen gets its own weight. */

/* depth instead of hard outlines; a faint pulse-coloured light at the top of every page */
:root:not([data-theme="dark"]) .card { border-color: color-mix(in srgb, var(--line) 65%, transparent);
  box-shadow: 0 1px 2px rgba(14, 35, 64, .04), 0 8px 22px -14px rgba(14, 35, 64, .18); }
:root:not([data-theme="dark"]) .card.flat { box-shadow: 0 1px 2px rgba(14, 35, 64, .04); }
body { background: radial-gradient(1100px 380px at 100% -140px, color-mix(in srgb, var(--pulse-2) 10%, transparent), transparent 72%) no-repeat, var(--bg); }

/* glass bars: the page slides under the top bar and the phone tab bar */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: saturate(170%) blur(14px); backdrop-filter: saturate(170%) blur(14px); }
  @media (max-width: 899px) {
    .tabs { background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: saturate(170%) blur(14px); backdrop-filter: saturate(170%) blur(14px); }
  }
}
.who .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--pulse) 70%, transparent); }

/* the day at a glance: four status tiles, each with its own colour */
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 330px) { .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpis .stat { background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 14px; padding: 10px 11px 12px;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--k) 85%, transparent), 0 6px 16px -14px rgba(14, 35, 64, .5); min-width: 0; }
.kpis .stat .label { display: flex; align-items: center; gap: 6px; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis .stat .label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--k); flex: none; }
.kpis .stat .value { font-size: 1.65rem; line-height: 1.1; margin-top: 4px; }
.k-booked { --k: var(--info); } .k-arrived { --k: var(--pulse); } .k-done { --k: var(--ok); } .k-no_show { --k: var(--bad); }

/* hero: the money of the day on navy, with the pulse running behind it */
.card.hero { background: linear-gradient(135deg, #0e2340 0%, #163e68 100%); color: #e8f1f8; border: 0; position: relative; overflow: hidden; isolation: isolate;
  box-shadow: 0 20px 40px -26px rgba(14, 35, 64, .85), 0 2px 6px rgba(14, 35, 64, .12); }
.card.hero::before { content: ""; position: absolute; inset: auto 0 8px 0; height: 44px; z-index: -1; opacity: .42; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 60' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%232fd4e8' stop-opacity='0'/%3E%3Cstop offset='.55' stop-color='%232fd4e8' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%2316b9a6' stop-opacity='.15'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 38h262l9-14 13 28 13-46 11 32h292' fill='none' stroke='url(%23g)' stroke-width='2' vector-effect='non-scaling-stroke' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center bottom / 100% 100%; }
.card.hero::after { content: ""; position: absolute; width: 260px; height: 260px; inset-inline-end: -90px; top: -120px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(47, 212, 232, .22), transparent); }
.card.hero h2, .card.hero .value, .card.hero strong { color: #fff; }
.card.hero .label, .card.hero .sub, .card.hero .meta { color: rgba(232, 241, 248, .7); }
.card.hero .stat .value { font-size: 1.7rem; }
.card.hero .meter { background: rgba(255, 255, 255, .13); height: 6px; }
.card.hero .meter > div { background: linear-gradient(90deg, var(--pulse-2), #16b9a6); border-radius: 6px; box-shadow: 0 0 12px rgba(47, 212, 232, .55); }
.card.hero .alert.warn { background: rgba(242, 182, 91, .13); color: #ffd99c; border-color: rgba(242, 182, 91, .28); }
.card.hero .alert.bad { background: rgba(255, 138, 132, .12); color: #ffc0bc; border-color: rgba(255, 138, 132, .28); }
button.card.hero { cursor: pointer; transition: transform .12s, box-shadow .15s; }
button.card.hero:hover { background: linear-gradient(135deg, #10284a 0%, #1a4774 100%); }
button.card.hero:active { transform: scale(.99); }
:root[data-theme="dark"] .card.hero { background: linear-gradient(135deg, #0f2c4b 0%, #0b2036 100%); box-shadow: 0 0 0 1px rgba(111, 224, 214, .14), 0 20px 40px -26px #000; }

/* the day / month switcher: one quiet control instead of three loose buttons */
.row.daynav { gap: 2px; align-self: flex-start; flex-wrap: nowrap; background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px; padding: 3px; box-shadow: 0 1px 2px rgba(14, 35, 64, .05); max-width: 100%; }
.daynav .btn.small { border: 0; border-radius: 999px; min-height: 34px; min-width: 34px; padding: 0 10px; background: transparent; box-shadow: none; }
.daynav .btn.small:hover { background: var(--surface-2); }
.daynav .btn.small[data-d="0"] { background: var(--accent-soft); color: var(--accent-text); margin-inline-start: 4px; }
.daynav strong { padding: 0 8px; font-family: var(--font-display); font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* appointments: a status strip on the start edge, the time set like a clock */
.item.appt { position: relative; padding-inline-start: 14px; }
.item.appt::before { content: ""; position: absolute; inset-inline-start: 0; top: 15px; bottom: 15px; width: 3px; border-radius: 3px; background: var(--k, var(--line-strong)); }
.item.st-booked { --k: var(--info); } .item.st-arrived { --k: var(--pulse); } .item.st-done { --k: var(--ok); }
.item.st-no_show { --k: var(--bad); } .item.st-cancelled { --k: var(--line-strong); }
.item.appt .time { font-family: var(--font-display); font-size: 1.04rem; letter-spacing: -.01em; }
.item.appt .time .meta { font-size: .74rem; font-weight: 500; }
.item.appt .row .btn.small { min-height: 32px; }

/* the main action of the desk floats within thumb reach on phones */
@media (max-width: 699px) {
  .head .btn.primary[data-act="newBooking"] { position: fixed; z-index: 21; inset-inline-end: 16px; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    min-height: 52px; padding: 0 22px; border-radius: 999px; font-size: 1rem;
    box-shadow: 0 16px 30px -14px rgba(14, 35, 64, .75), 0 0 0 4px color-mix(in srgb, var(--pulse) 20%, transparent); animation: rvRise .35s .15s cubic-bezier(.2, .8, .2, 1) both; }
  .main:has(.head .btn.primary[data-act="newBooking"]) { padding-bottom: 160px; }
}
@keyframes rvRise { from { transform: translateY(18px); opacity: 0; } }

/* an empty list: a flat line, waiting for the first beat */
.list > p.muted:only-child { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px 10px; text-align: center; }
.list > p.muted:only-child::before { content: ""; width: 132px; height: 30px; opacity: .8;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 30'%3E%3Cpath d='M2 16h52l6-9 8 16 6-7h56' fill='none' stroke='%2316b9a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' stroke-opacity='.75'/%3E%3C/svg%3E") no-repeat center / contain; }

@media (prefers-reduced-motion: reduce) { .head .btn.primary[data-act="newBooking"] { animation: none; } button.card.hero:active { transform: none; } }
@media print { .card.hero { background: #fff !important; color: #111 !important; box-shadow: none !important; } .card.hero::before, .card.hero::after { display: none; } }

/* phones: the page title gets its own line, its buttons sit under it */
@media (max-width: 560px) { .head:has(> .row, > .btn) > h1 { flex-basis: 100%; } }

/* v8.0.2 · each line of a chat message takes its own direction: Arabic lines read right-to-left even on the English screen,
   and an English name inside an Arabic line no longer jumps to the wrong side */
.msg .bubble { unicode-bidi: plaintext; text-align: start; }

/* v8.6 · arrival in two steps, change doctor */
.grid.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 560px) { .grid.kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.k-started { --k: var(--accent); }
.chip.started { background: var(--accent); color: #fff; }
.cdlist { display: flex; flex-direction: column; gap: 6px; }
.cdrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.cdrow:hover:not(:disabled) { border-color: var(--accent); }
.cdrow.off { opacity: .6; cursor: default; }
.cdrow .chip { white-space: nowrap; }

/* v8.9: the front desk — who is signed in, and «Who's at the desk?» */
.topbar .who.desk .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok); }
.deskdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px var(--ok-soft); }
.desk-sign { max-width: 440px; }
.deskpeople { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; width: 100%; align-self: stretch; }
.desk-sign form, .desk-sign > .alert, .desk-sign > p { width: 100%; align-self: stretch; }
.deskperson { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 6px; min-height: 112px; border-radius: 16px; font-size: .98rem; }
.deskperson .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deskperson .nm { font-weight: 600; }
.deskperson .chip { font-size: .72rem; }
.desk-sign .av, .deskperson .av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.15rem; }
.desk-sign .av.big { width: 52px; height: 52px; font-size: 1.3rem; }
.deskpin { font-size: 1.6rem; letter-spacing: .5em; text-align: center; }

/* v9.0: two-factor screens and the password strength bar */
.mfa-page { max-width: 440px; }
.mfa-page > *, .mfa-page form { width: 100%; align-self: stretch; }
.mfa-page .login-brand { align-self: center; width: auto; }
.mfa-h { margin: 0; font-size: 1.3rem; }
.mfacode { font-size: 1.7rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.mfaqr { display: grid; place-items: center; }
.mfaqr img { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.mfasteps { margin: 0; padding-inline-start: 20px; line-height: 1.5; }
.mfakey code { font-size: 1rem; letter-spacing: .04em; word-break: break-all; }
.pwmeter { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pwmeter .bar { flex: 0 0 96px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.pwmeter .bar i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s; }
.pwmeter[data-s="1"] .bar i { width: 25%; background: var(--bad); }
.pwmeter[data-s="2"] .bar i { width: 50%; background: var(--warn); }
.pwmeter[data-s="3"] .bar i { width: 75%; background: var(--ok); }
.pwmeter[data-s="4"] .bar i { width: 100%; background: var(--ok); }
.pwmeter[data-s="0"] .meta { color: var(--bad); }

/* v9.1: tap the date to jump to any day; the day board for clinics with many doctors */
.daypick { position: relative; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border-radius: 999px; padding: 4px 6px; min-width: 0; }
.daypick:hover { background: var(--surface-2); }
.daypick .cal { font-size: .7rem; color: var(--muted, #6b7671); }
.daypick-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.board-wrap { max-height: 78vh; overflow: auto; }
.board .bh { inset-inline-start: auto; }
.board .bh:first-child { position: sticky; inset-inline-start: 0; z-index: 4; }
.board-pick { margin: 6px 0; gap: 6px; flex-wrap: wrap; }
.chip-btn { font: inherit; font-size: .82rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 640px) { .board-pick, .board-next { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; } .board-pick > *, .board-next > * { flex: none; } }

/* v9.2: Back on every inner screen; the smart assistant button */
.backbtn { align-self: flex-start; margin-bottom: 8px; border-radius: 999px; padding-inline: 14px; }
.aibtn svg { color: var(--accent); }

/* Rovanta: sign-up, clinic code, trial banner, paused screen */
.rv-h { font-size: 1.25rem; line-height: 1.35; margin: 0; text-align: center; }
.rv-sub { text-align: center; margin: 0; }
.rv-signup, .rv-locked { max-width: 420px; }
.rv-locked { text-align: center; }
.rv-alt { text-align: center; margin: 0; font-size: .92rem; color: var(--muted); }
.rv-link { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rv-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.rv-legal { text-align: center; margin: 0; }
.rv-legal a { color: inherit; }
.rv-banner { align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rv-banner .btn { flex: none; }
a.btn { text-decoration: none; }
