﻿/* Doctory shared base — RTL-first utilities */
html {
  direction: rtl;
}

html[dir="rtl"] {
  direction: rtl;
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--surface-page);
}

.ds-navy { color: var(--navy-700); }
.ds-navy-bg { background: var(--navy-700); color: var(--text-on-brand); }
.ds-turq { color: var(--turq-600); }
.ds-turq-bg { background: var(--turq-500); color: var(--action-fg); }

.ds-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ds-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* —— Components (from Design System Direction B) ——
   Sizes, colours and type below are the handoff's own, read off
   components/core/Button.jsx, Badge.jsx and Card.jsx rather than approximated. */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--t-hover);
}

.ds-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The handoff's `sm` — the size every toolbar and row action uses. */
.ds-btn--sm {
  height: var(--control-h-sm);
  padding: 0 14px;
  font-size: var(--fs-xs);
  gap: 6px;
}

.ds-btn--full { width: 100%; }

/* An icon with nothing beside it should be square, not a stretched pill. */
.ds-btn--icon { padding: 0; width: var(--control-h); }
.ds-btn--icon.ds-btn--sm { width: var(--control-h-sm); }

.ds-btn--primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-fg);
}

.ds-btn--primary:hover:not(:disabled) {
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.ds-btn--secondary {
  background: var(--white);
  border-color: var(--border-strong);
  color: var(--navy-700);
}

.ds-btn--secondary:hover:not(:disabled) {
  background: var(--gray-050);
  border-color: var(--navy-400);
}

.ds-btn--brand {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
}

.ds-btn--brand:hover:not(:disabled) {
  background: var(--navy-600);
  border-color: var(--navy-600);
}

.ds-btn--ghost {
  background: transparent;
  color: var(--navy-700);
}

.ds-btn--ghost:hover:not(:disabled) { background: var(--navy-050); }

/* A destructive action reads as danger only on hover, so a row of buttons
   stays calm until you reach for the one that removes something. */
.ds-btn--danger { color: var(--danger-600); }
.ds-btn--danger:hover:not(:disabled) { background: var(--danger-100); }

.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  line-height: 1.4;
}

.ds-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.ds-badge--neutral { background: var(--gray-100); color: var(--text-muted); }
.ds-badge--brand { background: var(--navy-050); color: var(--navy-700); }
.ds-badge--accent { background: var(--turq-100); color: var(--turq-700); }
.ds-badge--success { background: var(--success-100); color: var(--success-600); }
.ds-badge--warning { background: var(--warning-100); color: var(--warning-600); }
.ds-badge--danger { background: var(--danger-100); color: var(--danger-600); }
.ds-badge--on-brand { background: rgba(255, 255, 255, .14); color: var(--white); }

.ds-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ds-card--alt { background: var(--surface-alt); }
.ds-card--accent { background: var(--accent-soft); border-color: var(--turq-100); }
.ds-card--brand { background: var(--surface-brand); border-color: var(--navy-700); color: var(--text-on-brand); }

.ds-card__body {
  padding: 20px;
}

/* A card whose body is a list of rows carries no padding of its own —
   the rows supply it, and their dividers must run edge to edge. */
.ds-card--flush > .ds-card__body { padding: 0; }

/* —— Admin surfaces (Clinic Admin / Platform Admin) —— */
.ds-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.ds-field {
  margin-bottom: 0.85rem;
}

.ds-input,
.ds-select,
.ds-textarea {
  width: 100%;
  height: var(--control-h);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  background: var(--white);
  color: var(--text-strong);
}

.ds-textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  line-height: 1.7;
  resize: vertical;
}

.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
  outline: none;
  border-color: var(--turq-500);
  box-shadow: var(--ring-focus);
}

.ds-input--sm,
.ds-select--sm { height: var(--control-h-sm); font-size: var(--fs-xs); }

.ds-hint {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-2xs);
  color: var(--text-soft);
}

/* Wide tables scroll inside their own container rather than pushing the page sideways. */
.ds-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #D5DEE8);
  border-radius: 10px;
  background: #fff;
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ds-table th,
.ds-table td {
  padding: 0.6rem 0.75rem;
  text-align: start;
  border-bottom: 1px solid var(--border, #D5DEE8);
  white-space: nowrap;
}

.ds-table th {
  background: var(--gray-050, #F5F8FB);
  font-family: var(--font-display, "Cairo", sans-serif);
  color: var(--navy-700, #12336B);
  font-weight: 700;
}

.ds-table tbody tr:last-child td {
  border-bottom: 0;
}

.ds-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 1rem;
}

.ds-alert--error { background: #FDE2E1; color: #9B1C1C; }
.ds-alert--success { background: #D8F5E5; color: #0B6B3A; }
.ds-alert--info { background: var(--gray-100, #E8EEF5); color: var(--navy-700, #12336B); }

.ds-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* The queue token, shown large enough to read across a waiting room. */
.ds-token {
  font-family: var(--font-display, "Cairo", sans-serif);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy-700, #12336B);
}

.ds-token--lg { font-size: 2.25rem; }
.ds-token--xl { font-size: clamp(3rem, 12vw, 8rem); }

.ds-kpi {
  background: #fff;
  border: 1px solid var(--border, #D5DEE8);
  border-radius: 10px;
  padding: 1rem 1.125rem;
}

.ds-kpi__value {
  font-family: var(--font-display, "Cairo", sans-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy-700, #12336B);
  font-variant-numeric: tabular-nums;
}

.ds-kpi__label {
  color: var(--text-soft, #6B7C93);
  font-size: 0.9rem;
}

.ds-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-soft, #6B7C93);
}

/* A row of headline figures that reflows to one column on a phone. Used by the
   platform overview and revenue screens. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
}

/* ── Admin shell ───────────────────────────────────────────────────────────
   The frame both panels sit in, ported from the handoff's PlatformShell.jsx
   and clinic_admin/Shell.jsx — they are the same shell with a different nav.
   Values are the handoff's own: a 232px deep-navy rail, a white header, and a
   28px content well. */

.ds-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  background: var(--surface-alt);
}

.ds-shell__aside {
  background: var(--surface-brand-deep);
  color: var(--white);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ds-shell__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  text-decoration: none;
}

.ds-shell__mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--navy-700);
  font: var(--fw-black) 16px var(--font-display);
  flex: 0 0 auto;
}

.ds-shell__brand-name {
  font: var(--fw-black) 18px var(--font-display);
  color: #fff;
}

.ds-shell__brand-sub,
.ds-shell__card-label {
  font-size: var(--fs-2xs);
  color: #7E93B8;
}

.ds-shell__nav {
  display: grid;
  gap: 3px;
}

.ds-shell__nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: start;
  text-decoration: none;
  background: transparent;
  color: #9CB0D0;
  font: var(--fw-semibold) var(--fs-sm) var(--font-display);
  transition: var(--t-hover);
}

.ds-shell__nav a:hover { background: rgba(255, 255, 255, .06); }

/* NavLink stamps `active` on the current route. */
.ds-shell__nav a.active {
  background: rgba(70, 200, 210, .16);
  color: var(--accent);
}

.ds-shell__foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.ds-shell__card {
  padding: 14px;
  background: rgba(255, 255, 255, .06);
  border-radius: var(--radius-sm);
}

.ds-shell__card-value {
  font: var(--fw-bold) var(--fs-xs) var(--font-display);
  color: #fff;
  margin-top: 4px;
}

.ds-shell__ghost {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #9CB0D0;
  font: var(--fw-semibold) var(--fs-2xs) var(--font-display);
  text-decoration: none;
  width: 100%;
}

.ds-shell__ghost:hover { background: rgba(255, 255, 255, .12); }

.ds-shell__header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.ds-shell__heading { flex: 1; min-width: 0; }

.ds-shell__heading h1 {
  font: var(--fw-black) var(--fs-h1) var(--font-display);
  margin: 0;
}

.ds-shell__heading p {
  font-size: var(--fs-xs);
  color: var(--text-soft);
  margin: 3px 0 0;
}

.ds-shell__body { padding: 28px; }

/* Search box in the header (SearchField.jsx). */
.ds-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.ds-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: var(--fw-medium) var(--fs-sm) var(--font-display);
}

/* Avatar.jsx: initials on a soft navy chip. */
.ds-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--navy-050);
  color: var(--navy-500);
  font: var(--fw-bold) 15px var(--font-display);
}

.ds-avatar--square { border-radius: var(--radius-sm); }

.ds-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ds-avatar-wrap { position: relative; display: inline-block; flex: 0 0 auto; }

.ds-avatar-wrap__dot {
  position: absolute;
  bottom: -1px;
  inset-inline-end: -1px;
  border-radius: 50%;
  background: var(--success-500);
  border: 2px solid var(--white);
}

/* ── Page vocabulary ───────────────────────────────────────────────────────
   The pieces the handoff's screens are actually built from — a grid row in
   place of a <table>, a side drawer, chips, a switch, a column chart. Ported
   from ui_kits/platform_admin/PlatformShell.jsx and components/core. */

/* Row.jsx — a table row that is a grid, so a cell can hold an avatar, two
   lines of text and a badge without a table's alignment fighting it. The
   column template comes from the page, since only the page knows its columns. */
.ds-trow {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
}

.ds-trow--head {
  padding: 10px 18px;
  background: var(--surface-alt);
  border-top: none;
  border-bottom: 1px solid var(--border);
  font: var(--fw-semibold) var(--fs-2xs) var(--font-display);
  color: var(--text-soft);
}

.ds-trow--clickable { cursor: pointer; }
.ds-trow--clickable:hover { background: var(--gray-050); }

/* Long tables scroll inside the card rather than pushing the page sideways.
   The row template has a minimum width, so the grid keeps its shape instead of
   crushing a name into an ellipsis when the card sits in a narrow column. */
.ds-trows { overflow-x: auto; }
.ds-trows > .ds-trow { min-width: 860px; }

/* A cell that must not blow the grid open when its text is long. */
.ds-cell { min-width: 0; }

.ds-cell__title {
  display: block;
  font: var(--fw-bold) var(--fs-xs) var(--font-display);
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A button that opens a record but reads as the row's title, so a clickable name in a
   table does not have to be a real anchor to somewhere. */
.ds-linkish {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  text-align: inherit;
  font: var(--fw-bold) var(--fs-xs) var(--font-display);
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-linkish:hover { color: var(--navy-700); text-decoration: underline; }

/* A cell's second line. Single line by default, like the title above it, so a
   long clinic name cannot make one row twice the height of its neighbours.
   A page that genuinely needs the text to wrap says so with `white-space`. */
.ds-cell__sub {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-cell__num {
  font: var(--fw-bold) var(--fs-xs) var(--font-display);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}

/* Chip.jsx — a filter pill. */
.ds-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: var(--t-hover);
}

.ds-chip--sm { height: 32px; padding: 0 12px; }

.ds-chip:hover:not(:disabled) { border-color: var(--navy-400); }

.ds-chip--on {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
}

.ds-chip:disabled { opacity: 0.45; cursor: not-allowed; }

.ds-chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* PToggle — the switch that turns a clinic's booking on and off. */
.ds-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.ds-toggle__track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--gray-300);
  transition: background 0.15s;
}

.ds-toggle__knob {
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: 0 1px 3px rgba(11, 31, 58, .25);
  transition: inset-inline-end 0.15s;
}

.ds-toggle__label {
  font: var(--fw-semibold) var(--fs-2xs) var(--font-display);
  color: var(--text-soft);
}

.ds-toggle--on .ds-toggle__track { background: var(--turq-500); }
.ds-toggle--on .ds-toggle__knob { inset-inline-end: 19px; }
.ds-toggle--on .ds-toggle__label { color: var(--text-strong); }

.ds-toggle:disabled { opacity: 0.5; cursor: not-allowed; }

/* Checkbox.jsx / SelBox — a square that fills with the action colour. */
.ds-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font: var(--fw-medium) var(--fs-sm) var(--font-display);
  color: var(--text-body);
}

.ds-check__box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--white);
  color: var(--action-fg);
  padding: 0;
  cursor: pointer;
}

.ds-check--on > .ds-check__box,
.ds-check__box.ds-check--on {
  background: var(--action);
  border-color: var(--action);
}

/* Bars — the monthly column chart the overview and revenue screens use. */
.ds-bars { display: flex; align-items: flex-end; gap: 10px; }

.ds-bars__col { flex: 1; display: grid; gap: 6px; justify-items: center; min-width: 0; }

.ds-bars__value {
  font: var(--fw-bold) var(--fs-2xs) var(--font-display);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}

.ds-bars__track { width: 100%; display: flex; align-items: flex-end; height: 118px; }

.ds-bars__fill {
  width: 100%;
  background: var(--turq-500);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}

.ds-bars__label { font-size: var(--fs-2xs); color: var(--text-soft); }

/* Drawer — the side panel every "manage this one thing" flow opens into. */
.ds-drawer { position: fixed; inset: 0; z-index: 50; }

.ds-drawer__scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  width: 100%;
  background: rgba(11, 31, 58, .42);
  cursor: pointer;
}

.ds-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: min(460px, 100vw);
  background: var(--white);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
}

.ds-drawer__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.ds-drawer__title {
  font: var(--fw-black) var(--fs-h2) var(--font-display);
  color: var(--text-strong);
}

.ds-drawer__sub { font-size: var(--fs-2xs); color: var(--text-soft); margin-top: 3px; }

.ds-drawer__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  color: var(--text-soft);
  padding: 0;
}

.ds-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.ds-drawer__foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

/* A patient's review: avatar, then the whole entry beside it. */
.ds-review {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

/* A 16:9 preview well for a gallery item, so a portrait photo and a video
   placeholder occupy the same footprint in the grid. */
.ds-thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.ds-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* A line inside a side card: an icon or avatar, then two lines of text. The
   dividers come from the stack, so a single note carries none. */
.ds-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
}

.ds-note + .ds-note { border-top: 1px solid var(--border); }

/* A proportion bar — the shape the revenue and support screens use to show a
   share without spending a whole chart on it. */
.ds-meter { display: flex; gap: 10px; align-items: center; padding: 8px 0; }

.ds-meter + .ds-meter { border-top: 1px solid var(--border); }

.ds-meter__label {
  flex: 1;
  min-width: 0;
  font: var(--fw-semibold) var(--fs-xs) var(--font-display);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-meter__track {
  width: 84px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--gray-200);
  overflow: hidden;
}

.ds-meter__fill {
  display: block;
  height: 100%;
  background: var(--turq-500);
  border-radius: var(--radius-pill);
}

.ds-meter__value {
  font: var(--fw-bold) var(--fs-xs) var(--font-display);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
  min-width: 62px;
  text-align: end;
}

/* A label-and-value line, as the drawers' summary cards stack them. */
.ds-fact {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.ds-fact:first-child { border-top: none; }

.ds-fact > span {
  flex: 1;
  font-size: var(--fs-2xs);
  color: var(--text-soft);
}

.ds-fact > b {
  font: var(--fw-semibold) var(--fs-2xs) var(--font-display);
  color: var(--text-strong);
  text-align: end;
}

.ds-drawer__section {
  display: block;
  font: var(--fw-bold) var(--fs-h3) var(--font-display);
  color: var(--text-strong);
  margin-bottom: 10px;
}

.ds-drawer__note {
  font-size: var(--fs-2xs);
  color: var(--text-soft);
  line-height: 1.7;
  margin: -6px 0 10px;
}

/* The radio-card the drawers use where a plain radio would hide the consequence. */
.ds-choice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  width: 100%;
  text-align: start;
  padding: 12px 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--border);
}

.ds-choice:disabled { opacity: 0.6; cursor: not-allowed; }

.ds-choice--on { background: var(--accent-soft); border-color: var(--turq-500); }

.ds-choice__mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 2px;
  flex: 0 0 auto;
  border: 2px solid var(--gray-300);
  background: transparent;
}

.ds-choice__mark--on {
  border-color: var(--turq-600);
  background: var(--turq-600);
  box-shadow: inset 0 0 0 2.5px var(--white);
}

.ds-choice__label {
  display: block;
  font: var(--fw-semibold) var(--fs-xs) var(--font-display);
  color: var(--text-strong);
}

.ds-choice__hint { font-size: var(--fs-2xs); color: var(--text-soft); }

/* SectionHeader.jsx — the heading that opens a block inside a page. */
.ds-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}

.ds-section__kicker {
  font: var(--kicker);
  letter-spacing: var(--ls-kicker);
  color: var(--accent-strong);
  margin-bottom: 12px;
}

.ds-section h2 {
  font: var(--fw-black) var(--fs-h2)/var(--lh-h2) var(--font-display);
  color: var(--text-strong);
  margin: 0;
}

/* A section header that opens a list rather than a whole page needs less air. */
.ds-section--tight { margin-bottom: 0; }

/* A plan's included features: a tick, then what it lets the clinic do. */
.ds-ticks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.ds-ticks li { display: flex; align-items: center; gap: 7px; }

.ds-ticks__off { color: var(--text-soft); font-style: italic; }

.ds-section__lede {
  margin: 10px 0 0;
  max-width: var(--maxw-prose);
  font-size: var(--fs-xs);
  line-height: 1.8;
  color: var(--text-muted);
}

/* Stat.jsx — a figure and its caption, used inside cards. */
.ds-stat__value {
  font: var(--fw-black) var(--fs-d3)/1.2 var(--font-display);
  letter-spacing: var(--ls-tight);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}

.ds-stat__label { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }

/* Five stars, of which N are filled — one person's score. */
.ds-stars { display: inline-flex; align-items: center; gap: 1px; flex: 0 0 auto; }

/* The gaps the kits set between the blocks of a page. */
.ds-page-stack { display: grid; gap: 20px; }

/* The kits' two-column band: something wide beside something narrow. */
.ds-split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }

@media (max-width: 1080px) {
  .ds-split { grid-template-columns: 1fr; }
}

/* The strip of figures a chart card carries under its chart: three cells
   divided by hairlines, the label small above a bold h3 figure. */
.ds-card__foot {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-top: 1px solid var(--border);
}

.ds-card__foot > * { padding: 14px 18px; }

.ds-card__foot > * + * { border-inline-start: 1px solid var(--border); }

.ds-card__foot-label { font-size: var(--fs-2xs); color: var(--text-soft); }

.ds-card__foot-value {
  font: var(--fw-bold) var(--fs-h3) var(--font-display);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
  unicode-bidi: plaintext;
}

/* A card's own toolbar: a title on one side, filters and actions on the other. */
.ds-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

.ds-toolbar__title {
  font: var(--fw-bold) var(--fs-h3) var(--font-display);
  color: var(--text-strong);
}

.ds-toolbar__sub { font-size: var(--fs-2xs); color: var(--text-soft); margin-top: 3px; }

/* The rail collapses to a strip of icons before it steals the whole screen. */
@media (max-width: 900px) {
  .ds-shell { grid-template-columns: 64px 1fr; }
  .ds-shell__aside { padding: 16px 8px; }
  .ds-shell__brand-text,
  .ds-shell__nav a span,
  .ds-shell__foot { display: none; }
  .ds-shell__nav a { justify-content: center; padding: 11px 0; }
  .ds-shell__body { padding: 16px; }
  .ds-shell__header { padding: 14px 16px; }
  .ds-search { display: none; }
}

/* ── Colour pickers — platform panel ─────────────────────────────────────────
   A swatch is a button that shows the colour it sets, so the row reads as a
   palette rather than as a list of names. The selected one is marked with a
   ring and a tick that flips to dark on a pale swatch. */
.ds-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.ds-swatch {
    position: relative;
    width: 62px;
    height: 46px;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--surface-alt, #f0f3f8);
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease;
}

.ds-swatch:hover:not(:disabled) { transform: translateY(-1px); }
.ds-swatch:disabled { opacity: .55; cursor: default; }
.ds-swatch--on { border-color: var(--text-strong, #0b1f3f); }

.ds-swatch__fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 9px;
    background: var(--swatch);
}

.ds-swatch__auto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 9px;
    border: 1px dashed var(--border-strong, #d3dae5);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #5b6b8c);
}

/* The tick sits on the swatch itself, so it has to survive both a near-black
   and a near-white fill. */
.ds-swatch--on::after {
    content: "✓";
    position: absolute;
    inset-inline-end: 6px;
    inset-block-start: 3px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, .55);
}

.ds-swatch__hex {
    width: 110px;
    text-transform: uppercase;
}

/* A live sample of the chosen ground, so the dropdown is not just a word. */
.ds-backdrop-preview {
    position: relative;
    overflow: hidden;
    height: 74px;
    margin-top: 14px;
    border-radius: 14px;
    border: 1px solid var(--border, #e4e9f2);
}

.ds-backdrop-preview > span {
    position: absolute;
    inset-inline-start: 14px;
    inset-block-end: 12px;
    width: 96px;
    height: 30px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(12, 53, 39, .14);
}

.ds-backdrop-preview--mint { background: linear-gradient(#c5efd9, #eefaf3); }
.ds-backdrop-preview--ivory { background: linear-gradient(#f1ece1, #fcfaf5); }
.ds-backdrop-preview--warm { background: linear-gradient(#fbe3d2, #fff7f1); }
.ds-backdrop-preview--cool { background: linear-gradient(#dde9fa, #f4f8ff); }

/* Soft mesh picks up the accent, matching what the apps paint. */
.ds-backdrop-preview--softmesh {
    background:
        radial-gradient(60% 90% at 12% 10%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
        radial-gradient(55% 80% at 92% 32%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
        linear-gradient(#efeff4, #fafafc);
}
