:root {
  --color-primary: #00a8a8;
  --color-primary-dark: #0b2a54;
  --color-primary-light: #e3f7f6;
  --color-accent: #c98a1f;
  --color-accent-light: #fdf3e0;
  --color-danger: #b3261e;
  --color-danger-light: #fbe9e7;
  --color-bg: #f4f6f5;
  --color-card: #ffffff;
  --color-border: #e2e6e3;
  --color-text: #1c2321;
  --color-text-muted: #5c6663;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --spacing: 1rem;
  --shadow-sm: 0 1px 2px rgba(15, 30, 25, 0.06), 0 1px 1px rgba(15, 30, 25, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 30, 25, 0.08), 0 1px 3px rgba(15, 30, 25, 0.06);
  --transition: 150ms ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Sans Arabic", Arial, sans-serif; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ---------- Header / navigation ---------- */

header.site-header {
  background: #ffffff;
  color: var(--color-primary-dark);
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}

header.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  text-decoration: none;
  letter-spacing: 0.01em;
}

header.site-header .brand img {
  height: 2.1rem;
  width: auto;
  display: block;
}

header.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

header.site-header nav a {
  color: var(--color-primary-dark);
  text-decoration: none;
  margin-inline-start: 0.2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}

header.site-header nav a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

header.site-header nav .nav-link-button {
  color: var(--color-primary-dark);
  text-decoration: none;
  margin-inline-start: 0.2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

header.site-header nav .nav-link-button:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.nav-toggle-checkbox {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-primary-dark);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-toggle-label:hover { background: var(--color-primary-light); }

@media (max-width: 768px) {
  .nav-toggle-label {
    display: block;
    order: 2;
  }

  header.site-header .brand {
    order: 1;
  }

  header.site-header nav {
    order: 3;
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin-top: 0.6rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.6rem;
  }

  .nav-toggle-checkbox:checked ~ nav {
    display: flex;
  }

  header.site-header nav a,
  header.site-header nav .nav-link-button {
    margin-inline-start: 0;
    font-size: 1rem;
    padding: 0.55rem 0.7rem;
    text-align: start;
  }
}

.nav-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-inline-start: 0.15rem;
}

header.site-header .lang-switch {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-bg);
  border-radius: 999px;
  padding: 0.2rem;
}

header.site-header .lang-switch a {
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}

header.site-header .lang-switch a:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Cards & sections ---------- */

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-title {
  color: var(--color-primary-dark);
  font-size: 1.4rem;
  margin: 0.25rem 0 1.25rem;
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: var(--color-text);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

input[type="text"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 110, 94, 0.15);
}

textarea { min-height: 5rem; resize: vertical; }

.phone-input-group {
  display: flex;
  align-items: stretch;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--color-border);
  border-inline-end: none;
  border-start-start-radius: var(--radius-sm);
  border-end-start-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  white-space: nowrap;
}

.phone-input-group input[type="tel"] {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.hint-link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--color-primary);
  margin-top: 0.35rem;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.address-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-top: 0.6rem;
}

/* ---------- Smoking product cards (Form 1 calculator) ---------- */

.smoking-products {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.smoking-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.smoking-card:has(.used-checkbox:checked) {
  border-color: var(--color-primary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.smoking-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  background: var(--color-surface, #fff);
  margin: 0;
}

.smoking-card:has(.used-checkbox:checked) .smoking-card-header {
  background: var(--color-primary-light);
}

.smoking-card-header .used-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  accent-color: var(--color-primary);
}

.smoking-card-title {
  flex: 1;
  font-weight: 600;
}

.smoking-pack-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #eef1ee;
  font-size: 0.85rem;
  white-space: nowrap;
}

.smoking-card:has(.used-checkbox:checked) .smoking-pack-chip {
  background: #fff;
  color: var(--color-primary-dark);
  font-weight: 600;
}

.smoking-card-body {
  display: none;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px dashed var(--color-border);
}

.smoking-card-body.open { display: flex; }

.smoking-input {
  flex: 1 1 130px;
  min-width: 130px;
}

.smoking-input label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.smoking-input input { width: 100%; }

.smoking-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.smoking-total strong { font-size: 1.35rem; }

/* ---------- Worklist side menu ---------- */

.worklist-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.worklist-menu {
  flex: 0 0 240px;
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.worklist-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface, #fff);
  cursor: pointer;
  font: inherit;
  text-align: start;
  transition: background 0.15s, border-color 0.15s;
}

.worklist-menu-item:hover { background: var(--color-primary-light); }

.worklist-menu-item.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  font-weight: 600;
}

.worklist-panels { flex: 1; min-width: 0; }

@media (max-width: 800px) {
  /* Stacked on a phone: align-items:flex-start would size the panels to their widest table
     (a 650px row on a 375px screen), so the whole page scrolled sideways. */
  .worklist-layout { flex-direction: column; align-items: stretch; }
  .worklist-panels { width: 100%; min-width: 0; }
  .worklist-menu {
    position: static;
    flex: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.4rem;
  }
  .worklist-menu-item { flex: 0 0 auto; width: auto; white-space: nowrap; }
}

.signature-pad {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 200px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: crosshair;
}

.consent-sheet h3 { margin: 1rem 0 0.35rem; font-size: 1.05rem; }
.consent-sheet p, .consent-sheet li { line-height: 1.7; }
.consent-sheet ol.consent-points { padding-inline-start: 1.25rem; }
.consent-sheet ol.consent-points > li { margin-bottom: 0.6rem; }
.consent-sheet ul { padding-inline-start: 1.25rem; margin: 0.35rem 0; }

.checkbox-row, .radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

@media (min-width: 640px) {
  .checkbox-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.group-label {
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  box-shadow: none;
}

.btn-secondary:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #8f1e18; }

.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.88rem; }

/* ---------- Alerts ---------- */

.alert {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  border-inline-start: 4px solid transparent;
}

.alert-error { background: var(--color-danger-light); color: var(--color-danger); border-inline-start-color: var(--color-danger); }
.alert-success { background: var(--color-primary-light); color: var(--color-primary-dark); border-inline-start-color: var(--color-primary); }
.alert-warning { background: var(--color-accent-light); color: #7a5416; border-inline-start-color: var(--color-accent); }
/* 2026-10-08 (task 362): an information box - used for "this upload replaces the current report". */
.alert-info { background: #e8f4fd; color: #0c4a6e; border-inline-start-color: #0284c7; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-eligible, .badge-enrolled, .badge-attended, .badge-completed, .badge-success { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-ineligible, .badge-declined, .badge-no-show { background: var(--color-danger-light); color: var(--color-danger); }
.badge-approached, .badge-booked { background: #eef1ee; color: var(--color-text-muted); }
.badge-warning { background: var(--color-accent-light); color: #7a5416; }

/* ---------- Tables ---------- */

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

table.data-table th, table.data-table td {
  text-align: start;
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--color-border);
}

table.data-table th {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

table.data-table tbody tr { transition: background var(--transition); }
table.data-table tbody tr:hover { background: #fafbfa; }
table.data-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  table.data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.calc-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
}

/* ---------- Calendar ---------- */

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  text-align: center;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.calendar-day:hover { box-shadow: var(--shadow-sm); border-color: var(--color-primary); transform: translateY(-1px); }
.calendar-day .avail { font-weight: 700; font-size: 1.2rem; color: var(--color-primary-dark); }
.calendar-day.full { background: var(--color-danger-light); }
.calendar-day.full .avail { color: var(--color-danger); }
.calendar-day.closed { background: #f0f0ee; color: var(--color-text-muted); }
.calendar-day.closed .avail { color: var(--color-text-muted); }

@media (max-width: 720px) {
  .calendar-week { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 460px) {
  .calendar-week { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Stat tiles ---------- */

.stat-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stat-tile {
  flex: 1 1 160px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.stat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
/* Task 390: count per status on the patient directory, each chip a filter */
.status-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.status-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--color-border, #d7dde3); background: #fff; color: var(--color-text, #1f2937); text-decoration: none; font-size: 0.88rem; }
.status-chip b { font-size: 1rem; color: var(--color-primary-dark, #0d5c63); }
.status-chip:hover, .status-chip.active { border-color: var(--color-primary, #0d5c63); background: #eef8f7; }
.stat-tile .value { font-size: 1.9rem; font-weight: 700; color: var(--color-primary-dark); line-height: 1.2; }
.stat-tile .label { font-size: 0.83rem; color: var(--color-text-muted); margin-top: 0.15rem; }
.stat-tile .sub { font-size: 0.78rem; color: var(--color-primary); margin-top: 0.2rem; font-weight: 600; }
.stat-tile.accent .value { color: var(--color-accent); }
.stat-tile.danger .value { color: var(--color-danger); }

/* ---------- CSS-only bar charts ---------- */

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 25%) 1fr auto;
  align-items: center;
  gap: 0.65rem;
}

.bar-label {
  font-size: 0.86rem;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.bar-track {
  background: var(--color-bg);
  border-radius: 999px;
  height: 0.65rem;
  overflow: hidden;
}

.bar-fill {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  height: 100%;
  border-radius: 999px;
  min-width: 3px;
  transition: width 400ms ease;
}

.bar-value {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  min-width: 1.5rem;
  text-align: end;
}

@media (max-width: 480px) {
  .bar-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .bar-value { text-align: start; }
}

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

/* ---------- Dashboard index tile grid ---------- */

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

.dash-tile {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.dash-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }
.dash-tile .dash-tile-icon { font-size: 1.6rem; margin-bottom: 0.5rem; display: block; }
.dash-tile .dash-tile-title { font-weight: 700; color: var(--color-primary-dark); font-size: 1rem; margin-bottom: 0.3rem; }
.dash-tile .dash-tile-desc { font-size: 0.82rem; color: var(--color-text-muted); }

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.empty-state .empty-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
  opacity: 0.6;
}

/* ---------- Hero (landing page) ---------- */

.hero {
  text-align: center;
  background: linear-gradient(160deg, var(--color-primary-light) 0%, #ffffff 65%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2.75rem 1.5rem;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 1.5rem;
}

.hero .hero-eyebrow {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  color: var(--color-primary-dark);
  font-size: 1.85rem;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1.02rem;
  max-width: 46rem;
  margin: 0 auto 1.5rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Misc ---------- */

.smoking-table th, .smoking-table td { padding: 0.4rem; }
.smoking-table input { width: 6rem; display: inline-block; }

.apply-stepper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.apply-stepper-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 150px;
}

.apply-stepper-list .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.apply-stepper-list .step-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.apply-stepper-list li.step-done .step-index {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.apply-stepper-list li.step-done .step-label {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.apply-stepper-list li.step-active .step-index {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.apply-stepper-list li.step-active .step-label {
  color: var(--color-primary-dark);
  font-weight: 700;
}

.apply-stepper-compact {
  display: none;
}

@media (min-width: 641px) {
  .apply-stepper-compact { display: none !important; }
}

@media (max-width: 640px) {
  .apply-stepper-list {
    display: none;
  }

  .apply-stepper-compact {
    display: block;
    margin-bottom: 1.5rem;
  }

  .stepper-compact-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary-dark);
  }

  .stepper-compact-sections {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
  }
}

footer.site-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  padding: 2.5rem 1rem 1.5rem;
}

.footer-staff-link {
  margin-top: 0.4rem;
}

.footer-staff-link a {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-decoration: underline;
}

/* Staff nav language switch (mirrors the public .lang-switch pill) */
header.site-header nav .nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-start: 0.6rem;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: var(--color-bg);
  font-size: 0.85rem;
}
header.site-header nav .nav-lang a {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--color-text-muted, #555);
}
header.site-header nav .nav-lang a.active {
  background: var(--color-primary);
  color: #fff;
}
header.site-header nav .nav-lang-sep { color: var(--color-border); }

/* ===================== Staff shell: slim top bar + side menu ===================== */
:root { --sidebar-w: 240px; --topbar-h: 60px; }

.staff-shell .staff-topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar-h);
  justify-content: space-between;
}
.staff-shell .topbar-right { display: inline-flex; align-items: center; gap: 0.5rem; }

.staff-sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; inset-inline-start: 0;
  width: var(--sidebar-w);
  background: var(--color-surface, #fff);
  border-inline-end: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow-y: auto; z-index: 25;
  padding: 0.75rem 0.6rem;
}
.staff-sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; }
.staff-sidebar nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; border-radius: 10px;
  color: var(--color-primary-dark); text-decoration: none; font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.staff-sidebar nav a .ico { width: 1.4rem; text-align: center; font-size: 1rem; opacity: 0.85; }
.staff-sidebar nav a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.staff-sidebar nav a.active { background: var(--color-primary); color: #fff; font-weight: 600; }
.staff-sidebar nav a.active .ico { opacity: 1; }

/* Push page content beside the sidebar (the fragment is a sibling of <main>/<footer>). */
.staff-shell ~ main, .staff-shell ~ footer { margin-inline-start: var(--sidebar-w); }
.staff-shell ~ main.container-wide { max-width: calc(100% - var(--sidebar-w) - 2rem); }

/* Mobile: sidebar slides in via the existing hamburger checkbox. */
@media (max-width: 900px) {
  .staff-sidebar { transform: translateX(var(--sidebar-hide, -100%)); transition: transform 0.2s ease; }
  html[dir="rtl"] .staff-sidebar { --sidebar-hide: 100%; }
  .staff-shell:has(.nav-toggle-checkbox:checked) .staff-sidebar { transform: none; }
  .staff-shell ~ main, .staff-shell ~ footer { margin-inline-start: 0; }
  .staff-shell ~ main.container-wide { max-width: 100%; }
  .staff-shell .topbar-right { display: none; }
}
/* Hamburger shows whenever the sidebar is off-canvas (900px, wider than the public nav's 768px). */
@media (max-width: 900px) { .staff-shell .nav-toggle-label { display: block; } }

/* Build identity: version badge on the landing hero, staff top bar and page footers. */
.version-badge {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.footer-version {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.85;
}

.nav-version {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .nav-version { display: none; }
}

/* Drag & drop zone for the scan CD (DICOM) and the report document. */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 110px;
  margin: 0.75rem 0;
  padding: 1rem;
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-alt, #f8fafc);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--color-primary);
  background: rgba(13, 148, 136, 0.06);
}

/*
 * Wide tables (nodule table, permissions matrix, Form 1 view, Form 5C findings) are wrapped in
 * .table-scroll. The class was in the markup but had no rule, so those tables simply spilled out of
 * their card with no way to reach the clipped columns.
 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/*
 * Data-entry cards: a scan date, a kVp value and a Lung-RADS category do not each need a full
 * 780px row. Short controls sit side by side so a reading radiologist sees a section at a glance
 * instead of scrolling a six-thousand-pixel page; anything with free text still spans the card.
 */
.card.form-compact .field {
  display: inline-block;
  width: min(300px, 100%);
  margin-inline-end: 1.25rem;
  vertical-align: top;
}

.card.form-compact .field:has(textarea),
.card.form-compact .field.field-wide {
  display: block;
  width: 100%;
  margin-inline-end: 0;
}

.card.form-compact .field textarea {
  width: 100%;
}

/* One editable row per recruitment site on the admin page. */
.site-row {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}

.site-row:last-child {
  border-bottom: 0;
}

/* Recovered-draft banner: sits above the form it belongs to. */
.draft-banner {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Per-item detail inputs that appear beside the box they belong to (Form 2). */
.fh-relative,
.cm-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fh-age {
  width: 6rem;
}

.cm-detail {
  flex: 1;
  min-width: 140px;
}

/* Per-slot open/close chips on the scheduling day screen. */
/* Tasks 349-351 (2026-10-04): the two clinic sessions - one colour each, everywhere. */
:root { --sess-am: #a16207; --sess-am-bg: #fef3c7; --sess-am-line: #f5c542;
        --sess-pm: #7e22ce; --sess-pm-bg: #f3e8ff; --sess-pm-line: #d8b4fe;
        --sess-out: #475569; --sess-out-bg: #f1f5f9; --sess-out-line: #cbd5e1; }
.sess-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.55rem; border-radius: 999px;
              font-weight: 700; font-size: 0.86rem; line-height: 1.5; white-space: nowrap; border: 1px solid var(--sess-out-line);
              background: var(--sess-out-bg); color: var(--sess-out); font-variant-numeric: tabular-nums; }
.sess-badge .sess-ico { font-size: 0.85em; }
.sess-badge .sess-hours { font-weight: 500; opacity: 0.8; margin-inline-start: 0.2rem; }
.sess-am { background: var(--sess-am-bg); color: var(--sess-am); border-color: var(--sess-am-line); }
.sess-pm { background: var(--sess-pm-bg); color: var(--sess-pm); border-color: var(--sess-pm-line); }
.sess-out { background: var(--sess-out-bg); color: var(--sess-out); border-color: var(--sess-out-line); border-style: dashed; }
/* Task 352: the colour also marks the whole row of an appointment in the worklist. */
tr.sess-row-am > td:first-child { box-shadow: inset -5px 0 0 var(--sess-am-line); }
tr.sess-row-pm > td:first-child { box-shadow: inset -5px 0 0 var(--sess-pm-line); }
[dir="ltr"] tr.sess-row-am > td:first-child { box-shadow: inset 5px 0 0 var(--sess-am-line); }
[dir="ltr"] tr.sess-row-pm > td:first-child { box-shadow: inset 5px 0 0 var(--sess-pm-line); }
tr.sess-row-am > td { background: #fffbeb; }
tr.sess-row-pm > td { background: #faf5ff; }
.sess-legend-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.55rem 0.9rem; margin: 0 0 1rem;
                   border-radius: 12px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); font-size: 0.88rem; color: #334155; }
.sess-legend-bar .sess-legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.sess-legend-bar .sess-legend-title { font-weight: 800; color: #0f172a; }
.patient-list-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.2rem 0 0.6rem; font-size: 0.92rem; }
.patient-list-hint .nat { font-weight: 800; }
/* Session groups on the booking page and the day page. */
.sess-group { border: 1px solid var(--sess-out-line); border-radius: 12px; padding: 0.6rem 0.8rem 0.7rem; margin: 0.5rem 0; background: #fff; }
.sess-group.sess-group-am { border-color: var(--sess-am-line); background: linear-gradient(180deg, #fffbeb, #fff 60%); }
.sess-group.sess-group-pm { border-color: var(--sess-pm-line); background: linear-gradient(180deg, #faf5ff, #fff 60%); }
.sess-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin-bottom: 0.45rem; }
.sess-group-head .sess-count { font-size: 0.85rem; color: #475569; }
.sess-group-head .sess-count b { font-weight: 800; }
.sess-group .slot-chips, .sess-group .slot-toggle-grid { margin: 0; }
/* Task 355: the Upcoming calendar. */
.upc-views { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border-radius: 999px; background: #eef2f6; margin: 0.2rem 0 0.8rem; }
.upc-view-btn { border: 0; background: transparent; padding: 0.35rem 0.95rem; border-radius: 999px; font: inherit; font-weight: 600; color: #475569; cursor: pointer; }
.upc-view-btn.active { background: #fff; color: var(--color-primary-dark, #0b4f55); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
.upc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.upc-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: #0f172a; text-align: center; flex: 1; }
.upc-title .upc-title-count { font-size: 0.85rem; font-weight: 600; color: #64748b; margin-inline-start: 0.4rem; }
.upc-legend { margin: 0.2rem 0 0.7rem; }
.upc-kind-key { font-size: 0.82rem; color: #475569; }
.upc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.upc-wd { text-align: center; font-size: 0.8rem; font-weight: 700; color: #64748b; padding: 0.2rem 0; }
.upc-day { min-height: 6.6rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: 0.3rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.upc-day.out { background: transparent; border-style: dashed; border-color: #eef2f6; }
.upc-day.weekend:not(.out) { background: #f8fafc; }
.upc-day.has { border-color: #cbd5e1; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.upc-day.today { border: 2px solid var(--color-primary, #0d9488); }
.upc-day-head { display: flex; align-items: center; justify-content: space-between; }
.upc-num { font-weight: 800; color: #0f172a; font-size: 0.95rem; }
.upc-day.weekend .upc-num { color: #94a3b8; }
.upc-count { min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--color-primary, #0d9488); color: #fff; font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.upc-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.upc-chip { display: flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.35rem; border-radius: 6px; font-size: 0.74rem; line-height: 1.35; text-decoration: none;
            border-inline-start: 4px solid var(--sess-out-line); background: var(--sess-out-bg); color: #1f2937; min-width: 0; transition: transform 0.1s, box-shadow 0.1s; }
/* 2026-10-08: no transform on hover - the chip holds the patient's name whose info card is pinned to the
   screen (position:fixed), and a transformed ancestor would pull that card out of place. */
.upc-chip:hover { box-shadow: 0 2px 6px rgba(16, 24, 40, 0.15); }
.upc-chip.sess-am { border-inline-start-color: var(--sess-am); background: var(--sess-am-bg); }
.upc-chip.sess-pm { border-inline-start-color: var(--sess-pm); background: var(--sess-pm-bg); }
.upc-chip .upc-time { font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.upc-chip.sess-am .upc-time { color: var(--sess-am); } .upc-chip.sess-pm .upc-time { color: var(--sess-pm); }
.upc-chip .upc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upc-chip .upc-kind, .upc-kind-key .upc-kind { flex: none; font-size: 0.85em; }
.upc-kind.upc-kind-ct { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; padding: 0 0.3rem; border-radius: 4px; background: #0f172a; color: #fff; line-height: 1.5; }
.upc-wdname { display: none; font-weight: 800; color: #0f172a; }
.upcoming-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.upcoming-filter input, .upcoming-filter select { width: auto; flex: 1 1 12rem; max-width: 22rem; margin: 0; }
.upc-chip .upc-ob { flex: none; font-weight: 800; color: #b45309; }
.upc-chip.extra { display: none; }
.upc-day.expanded .upc-chip.extra { display: flex; }
.upc-chip.filtered-out { display: none !important; }
.upc-more { border: 0; background: none; padding: 0; font: inherit; font-size: 0.72rem; font-weight: 700; color: var(--color-primary-dark, #0b4f55); cursor: pointer; text-align: start; }
.upc-empty-month { text-align: center; margin: 0.8rem 0 0; }
/* Phones: the grid becomes an agenda - only the days that have bookings, one under another. */
@media (max-width: 760px) {
  .upc-grid { grid-template-columns: 1fr; }
  .upc-wd, .upc-day.out, .upc-day:not(.has) { display: none; }
  .upc-day { min-height: 0; }
  .upc-num { display: none; } .upc-wdname { display: inline; }
  .upc-chip { font-size: 0.86rem; padding: 0.3rem 0.5rem; }
  .upc-chip.extra { display: flex; } .upc-more { display: none; }
}

/* A chip keeps its session's hue in every state (open, taken, selected). */
.slot-chip.sess-am { border-color: var(--sess-am-line); color: var(--sess-am); }
.slot-chip.sess-pm { border-color: var(--sess-pm-line); color: var(--sess-pm); }
.slot-chip.sess-am.selected, .slot-chip.sess-am.slot-booked { background: var(--sess-am); color: #fff; border-color: var(--sess-am); }
.slot-chip.sess-pm.selected, .slot-chip.sess-pm.slot-booked { background: var(--sess-pm); color: #fff; border-color: var(--sess-pm); }
.slot-chip.sess-am.taken:not(.selected) { background: var(--sess-am-bg); text-decoration: line-through; }
.slot-chip.sess-pm.taken:not(.selected) { background: var(--sess-pm-bg); text-decoration: line-through; }
.slot-chip.slot-closed.sess-am, .slot-chip.slot-closed.sess-pm { background: #f3f4f6; color: var(--color-text-muted); border-style: dashed; }
.sess-legend { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.82rem; color: #475569; align-items: center; }
/* The month calendar: open times per session under the day number. */
.cal-day .avail-sess { display: flex; justify-content: center; gap: 0.35rem; font-size: 0.68rem; margin-top: 0.1rem; }
.cal-day .avail-sess .am { color: var(--sess-am); } .cal-day .avail-sess .pm { color: var(--sess-pm); }
/* The capacity page: a tinted row per session (task 351). */
tr.session-am-row td:first-child { border-inline-start: 4px solid var(--sess-am); }
tr.session-pm-row td:first-child { border-inline-start: 4px solid var(--sess-pm); }
tr.session-am-row { background: #f8fbff; } tr.session-pm-row { background: #fcf9ff; }
/* The overbook's free time wears the session it falls into. */
#overbookTime.sess-am { border-color: var(--sess-am); background: var(--sess-am-bg); }
#overbookTime.sess-pm { border-color: var(--sess-pm); background: var(--sess-pm-bg); }
#overbookTime.sess-out { border-color: #d97706; background: #fffbeb; }
#overbookSession:empty { display: none; }

.slot-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.slot-chip {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--color-surface, #fff);
}

.slot-chip.slot-open {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.slot-chip.slot-closed {
  background: #f3f4f6;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.slot-chip.slot-booked {
  background: rgba(13, 148, 136, 0.12);
  border-color: var(--color-primary);
  cursor: not-allowed;
}

/* Home-vs-work time split, shown beside the workplace location in Form 2. */
.share-meter input[type="range"] {
  width: 100%;
  max-width: 420px;
  accent-color: var(--color-primary);
}

.share-readout {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.share-readout strong {
  color: var(--color-primary-dark);
  font-size: 1.05rem;
}

/* Printing the master timeline: chrome off, content only. */
@media print {
  .no-print, .staff-shell, footer.site-footer { display: none !important; }
  .staff-shell ~ main { margin-inline-start: 0 !important; max-width: 100% !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* Simple horizontal bars for the experience / enrollment dashboards. */
.chart-bar-track {
  background: var(--color-border);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.chart-bar {
  background: var(--color-primary);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Civil-ID live indicator (meeting tasks 157/160): one line under the field whose colour and
   icon carry the verdict - green genuine, amber repeat approach (staff), red invalid/enrolled. */
.civil-id-hint { font-weight: 600; }
.civil-id-hint.ok { color: #1b7f4d; }
.civil-id-hint.warn { color: #9a6700; }
.civil-id-hint.err { color: var(--color-danger); }
input.civil-id-ok { border-color: #1b7f4d; box-shadow: 0 0 0 1px #1b7f4d inset; }
input.civil-id-warn { border-color: #d4a72c; box-shadow: 0 0 0 1px #d4a72c inset; }
input.civil-id-err { border-color: var(--color-danger); box-shadow: 0 0 0 1px var(--color-danger) inset; }

/* Test records (task 161): registered by staff with a made-up civil ID - visually unmistakable. */
.badge-test { background: #4a3b8c; color: #fff; }

/* One-tap day picker (meeting task 172): 0-7 pills instead of a number box. */
.day-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.day-pills label { cursor: pointer; margin: 0; }
.day-pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.day-pills span {
  display: inline-block; min-width: 2.6rem; text-align: center; padding: 0.5rem 0;
  border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-card);
  font-weight: 600; transition: background var(--transition), border-color var(--transition);
}
.day-pills input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.day-pills input:focus-visible + span { outline: 2px solid var(--color-primary-dark); }

/* Conditional follow-ups (meeting task 169/170): indented under the checkbox that reveals them. */
.cond-reveal { margin-inline-start: 1.6rem; padding-inline-start: 0.9rem; border-inline-start: 3px solid var(--color-primary-light); }

/* Locked-visit wrapper (task 177): the fieldset is invisible chrome; disabled styling comes free. */
fieldset.lock-wrap { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.lock-wrap:disabled { opacity: 0.75; }

/* Meeting (task 184): "the font needs to be clearer - easy for the doctor filling it in."
   Larger labels and inputs across every staff/public form, without touching the layout. */
.field label { font-size: 1.05rem; }
.checkbox-row, .radio-row label { font-size: 1.02rem; }
.group-label { font-size: 1.05rem; font-weight: 700; }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea { font-size: 1.05rem; }
.section-title { font-size: 1.25rem; }
.hint { font-size: 0.88rem; }

/* 1-5 scales as coloured tap-pills (meeting task 187): 1 red through 5 green, one tap each.
   The colour is hinted on the rim always and fills the pill when picked. */
.likert-wrap { margin-top: 0.3rem; }
.likert-pills { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.likert-pills label { cursor: pointer; margin: 0; }
.likert-pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.likert-pills .lp {
  display: inline-block; min-width: 2.9rem; text-align: center; padding: 0.55rem 0;
  border: 2px solid var(--color-border); border-radius: 999px; background: var(--color-card);
  font-weight: 700; font-size: 1.05rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.lp-1 { border-color: #d24d43; } .lp-2 { border-color: #e08a3c; } .lp-3 { border-color: #d4b32c; }
.lp-4 { border-color: #7fb95a; } .lp-5 { border-color: #2e9e5b; }
.likert-pills input:checked + .lp-1 { background: #c0392b; border-color: #c0392b; color: #fff; }
.likert-pills input:checked + .lp-2 { background: #d97a26; border-color: #d97a26; color: #fff; }
.likert-pills input:checked + .lp-3 { background: #c7a416; border-color: #c7a416; color: #fff; }
.likert-pills input:checked + .lp-4 { background: #6aa84f; border-color: #6aa84f; color: #fff; }
.likert-pills input:checked + .lp-5 { background: #1e8e4e; border-color: #1e8e4e; color: #fff; }
.likert-pills input:focus-visible + .lp { outline: 2px solid var(--color-primary-dark); }
.likert-ends { display: flex; justify-content: space-between; margin-top: 0.3rem;
  font-size: 0.82rem; color: var(--color-text-muted); max-width: 20rem; }

/* Missing-answer highlight (meeting task 188): the blocked field lights up and the page scrolls to it. */
.field-missing { outline: 2px solid var(--color-danger); outline-offset: 4px;
  border-radius: var(--radius-sm); background: var(--color-danger-light); }

/* ==========================================================================
   Motion design layer (meeting: "professional feel, must not harm the site").
   Rules of the layer: CSS only, opacity/transform only (no layout shift),
   short durations, and everything gated behind prefers-reduced-motion so a
   user who asked their OS for less motion gets a perfectly still site.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* Cross-document view transitions were tried here and REMOVED: mid-navigation the browser
     cross-fades a snapshot of the old page, and on a slow connection that blend can be caught
     on screen as a garbled frame (seen live on the doctor's demo). The entrance animations
     below give the same polish without touching navigation rendering. */

  html { scroll-behavior: smooth; }

  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
  }

  /* Page entrance: the title leads, then the cards follow in a quick stagger.
     `backwards` only holds the hidden state during the delay - once finished
     the elements carry no transform at all (Leaflet et al. stay unaffected). */
  main .page-title, main h1 { animation: rise-in 320ms cubic-bezier(.22,.9,.35,1) backwards; }
  main .alert { animation: rise-in 300ms cubic-bezier(.22,.9,.35,1) backwards; }
  main .card, main .stat-tile {
    animation: rise-in 380ms cubic-bezier(.22,.9,.35,1) backwards;
  }
  main .card:nth-child(2), main .stat-tile:nth-child(2) { animation-delay: 45ms; }
  main .card:nth-child(3), main .stat-tile:nth-child(3) { animation-delay: 90ms; }
  main .card:nth-child(4), main .stat-tile:nth-child(4) { animation-delay: 135ms; }
  main .card:nth-child(5), main .stat-tile:nth-child(5) { animation-delay: 180ms; }
  main .card:nth-child(6), main .stat-tile:nth-child(6) { animation-delay: 220ms; }
  main .card:nth-child(n+7), main .stat-tile:nth-child(n+7) { animation-delay: 250ms; }

  /* Micro-interactions: a light lift on hover, a firm press on click. */
  .btn { transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease; }
  .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .btn:active { transform: translateY(0) scale(0.985); box-shadow: var(--shadow-sm); }
  .stat-tile, .card { transition: box-shadow 160ms ease, transform 160ms ease; }
  .data-table tbody tr { transition: background 120ms ease; }
  .worklist-menu-item { transition: background 140ms ease, transform 140ms ease; }
  .worklist-menu-item:hover { transform: translateX(-2px); }
  html[dir="ltr"] .worklist-menu-item:hover { transform: translateX(2px); }
  .likert-pills .lp, .day-pills span { transition: transform 120ms ease, background var(--transition), border-color var(--transition), color var(--transition); }
  .likert-pills input:checked + .lp, .day-pills input:checked + span { transform: scale(1.08); }
}

/* Keyboard focus ring - clarity for every user, motion or not. */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

/* Submit feedback: the pressed button shows a spinner and refuses double
   submission - both a polish item and a real data-safety guard. */
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: btn-spin 700ms linear infinite;
}
.btn-secondary.btn-loading::after { border-color: rgba(0, 0, 0, 0.2); border-top-color: var(--color-primary-dark); }

/* ==========================================================================
   Data-mode chooser + test-mode banner (meeting: admin picks real vs test
   entry; test mode is unmissable on every staff page).
   ========================================================================== */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
  max-width: 46rem;
  margin: 0 auto;
}
.mode-cards form { display: contents; }
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1.5rem;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mode-card--real:hover { border-color: var(--color-primary); }
.mode-card--test { border-style: dashed; }
.mode-card--test:hover { border-color: #b7791f; }
.mode-card__icon { font-size: 2.4rem; line-height: 1; }
.mode-card__title { font-size: 1.3rem; font-weight: 800; color: var(--color-primary-dark); }
.mode-card__desc { font-size: 0.98rem; color: var(--color-text-muted); line-height: 1.6; max-width: 22rem; }

.test-mode-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: repeating-linear-gradient(45deg, #fff3cd 0 14px, #ffe9a8 14px 28px);
  color: #7a5200;
  border-bottom: 2px solid #d4a72c;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}
.test-mode-banner a {
  color: #7a5200;
  text-decoration: underline;
  font-weight: 700;
  white-space: nowrap;
}

/* Move banner (meeting): says where the patient just went; the worklist opens on that queue. */
.move-banner { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.move-banner::before { content: "\27A4"; }
.queue-hint { margin-top: -0.35rem; margin-bottom: 0.9rem; }

/* Mode chooser layout (task 196): real entry dominant, tester entry deliberately modest. */
.mode-stack { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; max-width: 34rem; margin: 0 auto; }
.mode-stack form { width: 100%; display: flex; justify-content: center; }
.mode-card--big { width: 100%; padding: 2.5rem 1.5rem; border-width: 3px; }
.mode-card--big .mode-card__icon { font-size: 3rem; }
.mode-card--big .mode-card__title { font-size: 1.5rem; }
.mode-card--small {
  flex-direction: row; align-items: center; gap: 0.7rem; text-align: start;
  width: auto; max-width: 26rem; padding: 0.8rem 1.2rem; opacity: 0.85;
}
.mode-card--small .mode-card__icon { font-size: 1.4rem; }
.mode-card--small .mode-card__title { font-size: 1rem; display: block; }
.mode-card--small .mode-card__desc { font-size: 0.82rem; display: block; }

/* Off-schedule attendance (task 200): the warning and its mandatory reason. */
.off-schedule-box {
  background: #fff8e6; border: 1px solid #d4a72c; border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; max-width: 34rem;
}
.off-schedule-warn { margin: 0 0 0.5rem; font-weight: 700; color: #7a5200; }

/* Doctor's request (2026-09-01): filter row above Upcoming appointments. */
.upcoming-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.9rem; }
.upcoming-filter input, .upcoming-filter select { padding: 0.4rem 0.6rem; border: 1px solid var(--color-border, #dde2e8); border-radius: 8px; font: inherit; }

/* Task 218: screen guide - floating "?" + slide-in drawer with tabs. */
.help-fab { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 52px; height: 52px; border-radius: 50%;
            border: none; background: var(--color-primary, #0d5c63); color: #fff; font-size: 1.6rem; font-weight: 800;
            box-shadow: 0 6px 18px rgba(13,92,99,0.35); cursor: pointer; z-index: 950; transition: transform .15s; }
.help-fab:hover { transform: scale(1.08); }
.help-drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 94vw); background: #fff;
               box-shadow: -8px 0 28px rgba(0,0,0,0.18); z-index: 960; display: flex; flex-direction: column;
               padding: 1rem 1.1rem; overflow-y: auto; animation: help-in .2s ease-out; }
[dir="ltr"] .help-drawer { box-shadow: 8px 0 28px rgba(0,0,0,0.18); }
@keyframes help-in { from { transform: translateX(var(--help-dir, 30px)); opacity: 0; } to { transform: none; opacity: 1; } }
.help-head { display: flex; justify-content: space-between; align-items: center; font-size: 1.15rem; margin-bottom: .6rem; }
.help-close { border: none; background: #eef1f4; width: 34px; height: 34px; border-radius: 8px; font-size: 1.3rem; cursor: pointer; }
.help-tabs { display: flex; gap: .3rem; margin-bottom: .9rem; border-bottom: 1px solid var(--color-border, #dde2e8); }
.help-tab { flex: 1; border: none; background: none; padding: .55rem .4rem; font: inherit; font-weight: 700; color: #5b6b76; cursor: pointer;
            border-bottom: 3px solid transparent; }
.help-tab.active { color: var(--color-primary, #0d5c63); border-bottom-color: var(--color-primary, #0d5c63); }
.help-pane h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.help-pane p { line-height: 1.7; }
.help-pane ol, .help-pane ul { padding-inline-start: 1.3rem; line-height: 1.75; }
.help-pane ol li { margin-bottom: .35rem; }
.help-tips { margin-top: 1rem; background: #f3f9f8; border-inline-start: 4px solid var(--color-primary, #0d5c63); padding: .6rem .8rem; border-radius: 8px; }
.help-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 955; }
@media print { .help-fab, .help-drawer, .help-backdrop { display: none !important; } }
.help-drawer[hidden] { display: none; }

/* Field Insert Sheet review badges (admin-only). */
.new-field-badge { display: inline-block; background: #ffe9a8; color: #6b4d00; border: 1px solid #e6c55a; border-radius: 6px;
                   font-size: 0.72rem; font-weight: 800; padding: 1px 7px; margin-inline-start: 0.4rem; vertical-align: middle; letter-spacing: .02em; }
.contact-log-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; align-items: end; }
.contact-log-form label { font-size: 0.8rem; color: var(--color-text-muted, #666); display: block; margin-bottom: 2px; }
.contact-log-form select, .contact-log-form input { width: 100%; }
.deviation-badge { background: #fdeaea; color: #a03030; border-radius: 6px; padding: 1px 7px; font-size: 0.75rem; font-weight: 700; }

/* Task 219: report pages read by AI - filled fields are highlighted for review, never auto-saved */
.ai-read-box { border: 1px dashed var(--color-border); border-radius: 10px; padding: 0.8rem 1rem; margin-bottom: 0.9rem; background: var(--color-surface-alt, #fafafa); }
.ai-filled { background: #fff7c2 !important; outline: 2px solid #f2c94c; outline-offset: 1px; border-radius: 4px; }
label.ai-filled { padding: 0 0.25rem; }

/* v1.18.0 (N) */
/* v1.18.0 (N): WhatsApp channel card on the admin page - the four status badges in one row. */
.whatsapp-counts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.25rem 0 0.5rem; }
.whatsapp-counts .badge { font-variant-numeric: tabular-nums; }

/* v1.18.0 (R1) */
/* ---- R1 (v1.18.0): report upload page + review of an AI-read draft on Form 6 ---- */
/* Append to main.css. Uses .ai-filled (already at ~line 1486) for the read values. */

/* Upload page: bigger drop target than the DICOM box, the file list under it */
.report-drop-zone { min-height: 160px; cursor: pointer; }
.report-drop-main { font-weight: 600; }
.report-file-list { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.report-file-list li { padding: 0.25rem 0; border-bottom: 1px dashed var(--color-border, #ddd); font-size: 0.95rem; }

/* Review card at the top of Form 6 */
.review-card { border-inline-start: 4px solid #f2c94c; }
.review-summary td.review-missing { color: var(--color-danger, #b42318); font-weight: 600; }
.review-doubt-list { margin: 0.4rem 0 0; padding-inline-start: 1.4rem; }
.review-doubt-list li { margin: 0.35rem 0; }
.review-doubt-list .review-jump { font-weight: 600; margin-inline-end: 0.35rem; }
.review-raw { font-size: 0.9rem; margin-top: 0.15rem; }
.review-raw code { background: #fff; padding: 0.1rem 0.35rem; border-radius: 4px; white-space: pre-wrap; word-break: break-word; }

/* A control the reader has a doubt about: red outline until the radiologist decides */
.needs-decision { outline: 2px solid #d92d20 !important; outline-offset: 1px; border-radius: 4px; }
.needs-decision-flash { box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.25); transition: box-shadow 0.3s; }

/* Sticky Approve bar: always visible while scrolling through the review */
.review-approve-bar { position: sticky; bottom: 0; z-index: 20; margin-top: 1rem;
  background: #fffbe6; border-top: 2px solid #f2c94c; padding: 0.6rem 1rem; }
.review-approve-inner { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.review-approve-inner .btn { margin: 0; }
@media print { .review-approve-bar { display: none; } }

/* v1.18.0 (R2) */
/* R2 (v1.18.0) - Form 5C: read-only lung result from the report (results-consultation.html) */
.report-facts { margin: 0 0 1rem; }
.report-facts-table { max-width: 520px; margin: 0.4rem 0 0; }
.report-facts-table td:first-child { color: #555; width: 55%; }
/* The report view page carries its own print CSS inline (templates/staff/report-view.html). */

/* v1.18.0 (W) */
/* W - v1.18.0 Today's list. NOTHING REQUIRED: the new panel styles are embedded in a <style>
   block at the bottom of templates/staff/worklist.html (same pattern as scheduling-book.html) and
   in scheduling-bulk-reschedule.html, so the pages render correctly without touching main.css.
   If you prefer them centralised, move the two <style> blocks here verbatim and delete them from
   the templates; the selectors are: .today-box, .today-box-title, .today-completed, .bulk-bar,
   .col-check, .id-cell, .actions-cell, .inline-details, .inline-reason-form, .bulk-date,
   .bulk-availability. */

/* 2026-09-24 (task 291): WhatsApp inbox (staff/whatsapp-inbox.html, staff/whatsapp-thread.html).
   Logical properties only, so the same rules serve RTL and LTR; nothing is wider than the screen. */
.wa-page { min-width: 0; }
.wa-list { list-style: none; margin: 0; padding: 0; }
.wa-list li { border-bottom: 1px solid var(--color-border); }
.wa-list li:last-child { border-bottom: 0; }
.wa-list a { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.4rem; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.wa-list a:hover { background: var(--color-primary-light); }
.wa-list .wa-unread .wa-list-preview { font-weight: 600; color: var(--color-text); }
.wa-list-top, .wa-list-bottom { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; min-width: 0; }
.wa-list-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; min-width: 0; overflow-wrap: anywhere; }
.wa-list-id { color: var(--color-text-muted); font-size: 0.85rem; }
.wa-list-time { color: var(--color-text-muted); font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }
.wa-list-preview { color: var(--color-text-muted); font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Task 310: WhatsApp-style ticks, the "System" tag, the filter chips and the search box. */
.wa-tick { font-weight: 700; letter-spacing: -0.12em; color: #8696a0; margin-inline-end: 0.2rem; }
.wa-tick-read { color: #53bdeb; }
.wa-tick-failed { color: var(--color-danger); letter-spacing: 0; }
.wa-auto-tag { font-size: 0.72rem; font-weight: 600; color: var(--color-primary-dark); background: var(--color-primary-light);
  border-radius: 999px; padding: 0 0.45rem; margin-inline-end: 0.3rem; }
.wa-filter { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.8rem; }
.wa-search { width: 100%; max-width: 100%; padding: 0.55rem 0.8rem; border: 1px solid var(--color-border); border-radius: 999px; font: inherit; }
.wa-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wa-chip { border: 1px solid var(--color-border); background: var(--color-surface, #fff); color: var(--color-text); border-radius: 999px;
  padding: 0.3rem 0.85rem; font: inherit; font-size: 0.88rem; cursor: pointer; }
.wa-chip.active { background: #d9fdd3; border-color: #25d366; color: #0b5c2e; font-weight: 600; }
.wa-filter-count { margin: 0; }
.wa-list li[hidden] { display: none; }
.wa-head-main { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.wa-head-title { margin: 0; overflow-wrap: anywhere; }
.wa-head-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--color-text-muted); font-size: 0.9rem; }
.wa-thread { max-height: 62vh; overflow-y: auto; background: #efeae2; }
.wa-messages { display: flex; flex-direction: column; gap: 0.5rem; }
.wa-bubble { max-width: min(78%, 34rem); padding: 0.45rem 0.7rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.wa-in { align-self: flex-start; background: #fff; border-start-start-radius: 4px; }
.wa-out { align-self: flex-end; background: #d9fdd3; border-start-end-radius: 4px; }
.wa-auto { background: #eef1ee; border: 1px dashed #b8c2bd; }
.wa-bubble-label { font-size: 0.75rem; font-weight: 600; color: var(--color-primary-dark); margin-bottom: 0.15rem; }
.wa-bubble-body { white-space: pre-wrap; }
.wa-media a { font-size: 0.85rem; }
/* 2026-10-07: voice notes, photos and videos inside the chat bubble. */
.wa-media { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.2rem; }
.wa-media .wa-audio { width: 260px; max-width: 100%; height: 40px; }
.wa-media .wa-img { display: block; max-width: 260px; max-height: 320px; width: auto; height: auto; border-radius: 8px; }
.wa-media .wa-video { max-width: 260px; max-height: 320px; border-radius: 8px; }
.wa-media .wa-media-link { font-size: 0.78rem; opacity: 0.8; }
.wa-bubble-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; font-size: 0.72rem; color: var(--color-text-muted); margin-top: 0.2rem; }
.wa-status { text-transform: none; }
.wa-status-bad { color: var(--color-danger); font-weight: 600; }
.wa-reply textarea { width: 100%; max-width: 100%; resize: vertical; font: inherit; }
.wa-reply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.wa-reply-block { margin: 0.5rem 0 0; }
@media (max-width: 600px) {
  .wa-bubble { max-width: 90%; }
  .wa-thread { max-height: 55vh; }
}

/* ==========================================================================================
   2026-09-29 (phase 1, "exactly like WhatsApp"): the full-screen WhatsApp app layout
   (body.wa-app - staff/whatsapp-inbox.html, staff/whatsapp-thread.html). Phone: one pane at a
   time (list, or chat with a back arrow). Desktop >= 900px: list and chat side by side, like
   WhatsApp Web. Logical properties only, so RTL and LTR share every rule. --wa-vh follows the
   visible viewport (whatsapp-app.js), so the phone keyboard never covers the composer.
   ========================================================================================== */
body.wa-app {
  --wa-green: #008069; --wa-green-2: #00a884; --wa-badge: #25d366; --wa-bg: #efeae2;
  --wa-out: #d9fdd3; --wa-in: #fff; --wa-muted: #667781; --wa-line: #e9edef; --wa-panel: #f0f2f5;
  margin: 0; height: var(--wa-vh, 100dvh); display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: #111b21; font-size: 15px;
}
body.wa-app .wa-testbar { flex: none; background: #f5a524; color: #3b2600; text-align: center; font-size: 0.8rem; font-weight: 600; padding: 0.15rem; }
body.wa-app .wa-shell { flex: 1; min-height: 0; display: flex; }

/* ---- list pane ---- */
body.wa-app .wa-listpane { width: 100%; display: flex; flex-direction: column; min-height: 0; background: #fff; }
body.wa-app .wa-listhead { flex: none; display: flex; align-items: center; gap: 0.5rem; height: 56px; padding: 0 0.6rem;
  background: var(--wa-green); color: #fff; }
body.wa-app .wa-apptitle { margin: 0; font-size: 1.2rem; font-weight: 600; color: #fff; }
body.wa-app .wa-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 50%; color: inherit; text-decoration: none; flex: none; }
body.wa-app .wa-icon-btn:hover, body.wa-app .wa-icon-btn:focus-visible { background: rgba(255, 255, 255, 0.15); }
body.wa-app .wa-listtools { flex: none; padding: 0.5rem 0.75rem 0.4rem; border-bottom: 1px solid var(--wa-line); background: #fff; }
body.wa-app .wa-search { width: 100%; box-sizing: border-box; padding: 0.55rem 1rem; border: 0; border-radius: 8px;
  background: var(--wa-panel); font: inherit; outline: none; }
body.wa-app .wa-search:focus { box-shadow: 0 0 0 2px var(--wa-green-2) inset; }
body.wa-app .wa-chips { display: flex; flex-wrap: nowrap; gap: 0.4rem; overflow-x: auto; padding: 0.5rem 0 0.1rem; scrollbar-width: none; }
body.wa-app .wa-chips::-webkit-scrollbar { display: none; }
body.wa-app .wa-chip { flex: none; border: 0; background: var(--wa-panel); color: #54656f; border-radius: 999px;
  padding: 0.35rem 0.85rem; font: inherit; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
body.wa-app .wa-chip.active { background: #e7fce3; color: #008069; font-weight: 600; }
body.wa-app .wa-listscroll { flex: 1; min-height: 0; overflow-y: auto; }
body.wa-app .wa-empty { color: var(--wa-muted); text-align: center; padding: 2rem 1rem; margin: 0; }
body.wa-app .wa-convs { list-style: none; margin: 0; padding: 0; }
body.wa-app .wa-convs li[hidden] { display: none; }
body.wa-app .wa-convs a { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.9rem; color: inherit; text-decoration: none; }
body.wa-app .wa-convs a:hover { background: #f5f6f6; }
body.wa-app .wa-convs li.wa-active a { background: #f0f2f5; }
body.wa-app .wa-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #dfe5e7; color: #54656f;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; }
body.wa-app .wa-avatar-unknown { background: #fde6c8; color: #8a5a00; }
body.wa-app .wa-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem;
  border-bottom: 1px solid var(--wa-line); padding-bottom: 0.65rem; margin-bottom: -0.65rem; }
body.wa-app .wa-conv-top, body.wa-app .wa-conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-width: 0; }
body.wa-app .wa-conv-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; overflow: hidden; white-space: nowrap; }
body.wa-app .wa-conv-name strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
body.wa-app .wa-conv-id { color: var(--wa-muted); font-size: 0.78rem; flex: none; }
body.wa-app .wa-unknown-tag { font-size: 0.7rem; background: #fde6c8; color: #8a5a00; border-radius: 999px; padding: 0 0.4rem; flex: none; }
body.wa-app .wa-conv-time { flex: none; font-size: 0.75rem; color: var(--wa-muted); }
body.wa-app .wa-unread .wa-conv-time { color: var(--wa-badge); font-weight: 600; }
body.wa-app .wa-conv-preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wa-muted); font-size: 0.88rem; }
body.wa-app .wa-unread .wa-conv-preview { color: #111b21; font-weight: 500; }
body.wa-app .wa-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px;
  background: var(--wa-badge); color: #fff; font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
body.wa-app .wa-auto-tag { font-size: 0.7rem; font-weight: 600; color: #008069; background: #e7fce3; border-radius: 999px; padding: 0 0.4rem; margin-inline-end: 0.25rem; }

/* ---- chat pane ---- */
body.wa-app .wa-chatpane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--wa-bg); }
body.wa-app .wa-chathead { flex: none; display: flex; align-items: center; gap: 0.55rem; height: 56px; padding: 0 0.4rem;
  background: var(--wa-green); color: #fff; }
body.wa-app .wa-chathead .wa-avatar { width: 40px; height: 40px; font-size: 1rem; }
body.wa-app .wa-chathead-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
body.wa-app .wa-chathead-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.wa-app .wa-chathead-text small { opacity: 0.85; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] body.wa-app .wa-back svg { transform: scaleX(-1); }
body.wa-app .wa-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 0.6rem 5% 0.8rem;
  background-color: var(--wa-bg);
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px); background-size: 18px 18px; }
body.wa-app .wa-messages { display: flex; flex-direction: column; gap: 2px; }
body.wa-app .wa-daysep { text-align: center; margin: 0.6rem 0; }
body.wa-app .wa-daysep span { display: inline-block; background: #fff; color: #54656f; font-size: 0.75rem; padding: 0.3rem 0.7rem;
  border-radius: 7.5px; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); }
body.wa-app .wa-bubble { position: relative; max-width: min(75%, 34rem); padding: 0.35rem 0.55rem 0.25rem; margin-top: 0.4rem;
  border-radius: 7.5px; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); overflow-wrap: anywhere; font-size: 0.93rem; line-height: 1.38; border: 0; }
body.wa-app .wa-bubble.wa-cont { margin-top: 2px; }
body.wa-app .wa-in { align-self: flex-start; background: var(--wa-in); }
body.wa-app .wa-out { align-self: flex-end; background: var(--wa-out); }
/* the little tail on the first bubble of a group */
body.wa-app .wa-in:not(.wa-cont) { border-start-start-radius: 0; }
body.wa-app .wa-out:not(.wa-cont) { border-start-end-radius: 0; }
body.wa-app .wa-in:not(.wa-cont)::before, body.wa-app .wa-out:not(.wa-cont)::before {
  content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
body.wa-app .wa-in:not(.wa-cont)::before { inset-inline-start: -8px; background: linear-gradient(to bottom left, var(--wa-in) 50%, transparent 50%); }
body.wa-app .wa-out:not(.wa-cont)::before { inset-inline-end: -8px; background: linear-gradient(to bottom right, var(--wa-out) 50%, transparent 50%); }
html[dir="rtl"] body.wa-app .wa-in:not(.wa-cont)::before { background: linear-gradient(to bottom right, var(--wa-in) 50%, transparent 50%); }
html[dir="rtl"] body.wa-app .wa-out:not(.wa-cont)::before { background: linear-gradient(to bottom left, var(--wa-out) 50%, transparent 50%); }
body.wa-app .wa-auto { background: #fdf6dc; }
body.wa-app .wa-auto.wa-out:not(.wa-cont)::before { background: linear-gradient(to bottom right, #fdf6dc 50%, transparent 50%); }
html[dir="rtl"] body.wa-app .wa-auto.wa-out:not(.wa-cont)::before { background: linear-gradient(to bottom left, #fdf6dc 50%, transparent 50%); }
body.wa-app .wa-bubble-label { font-size: 0.72rem; font-weight: 600; color: #008069; margin-bottom: 0.1rem; }
body.wa-app .wa-bubble-body { white-space: pre-wrap; }
body.wa-app .wa-media a { font-size: 0.85rem; color: #027eb5; }
body.wa-app .wa-bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; font-size: 0.68rem;
  color: var(--wa-muted); margin-top: 0.1rem; margin-inline-start: 1.5rem; }
body.wa-app .wa-tick { font-weight: 700; letter-spacing: -0.14em; color: #8696a0; font-size: 0.78rem; }
body.wa-app .wa-tick-read { color: #53bdeb; }
body.wa-app .wa-tick-failed, body.wa-app .wa-status-bad { color: #d93025; letter-spacing: 0; font-weight: 600; }
body.wa-app .wa-pending { opacity: 0.85; }
body.wa-app .wa-failed { box-shadow: 0 0 0 1px #d93025; }

/* ---- composer ---- */
body.wa-app .wa-composer { flex: none; display: flex; align-items: flex-end; gap: 0.45rem; margin: 0;
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom)); background: var(--wa-panel); }
body.wa-app .wa-composer textarea { flex: 1; min-width: 0; box-sizing: border-box; resize: none; border: 0; outline: none;
  border-radius: 21px; padding: 0.6rem 1rem; font: inherit; font-size: 0.95rem; line-height: 1.35; max-height: 140px; min-height: 0; height: 44px;
  background: #fff; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.1); }
body.wa-app .wa-composer textarea:disabled { background: #f7f8fa; color: var(--wa-muted); }
body.wa-app .wa-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--wa-green-2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
body.wa-app .wa-send:disabled { background: #b7c1c5; cursor: not-allowed; }
html[dir="rtl"] body.wa-app .wa-send svg { transform: scaleX(-1); }
body.wa-app .wa-blocked { flex: none; margin: 0; padding: 0.5rem 0.9rem; background: #fff8e1; color: #6b5200; font-size: 0.82rem; text-align: center; }
body.wa-app .wa-window { flex: none; margin: 0; padding: 0 0.9rem 0.3rem; background: var(--wa-panel); color: var(--wa-muted); font-size: 0.72rem; text-align: center; }
body.wa-app .wa-alert { flex: none; margin: 0; padding: 0.55rem 0.9rem; font-size: 0.85rem; cursor: pointer; }
body.wa-app .wa-alert-bad { background: #fdecea; color: #b3261e; }

/* ---- the empty chat pane (desktop only) ---- */
body.wa-app .wa-chatpane-empty { align-items: center; justify-content: center; background: #f0f2f5; border-bottom: 6px solid var(--wa-badge); }
body.wa-app .wa-pick { text-align: center; color: var(--wa-muted); }
body.wa-app .wa-pick svg { color: #c4cbce; }

/* ---- phone: one pane at a time ---- */
@media (max-width: 899px) {
  body.wa-app .wa-chatpane-empty { display: none; }
  body.wa-app .wa-shell.wa-has-chat .wa-listpane { display: none; }
  body.wa-app .wa-bubble { max-width: 85%; }
}
/* ---- desktop: side by side, like WhatsApp Web ---- */
@media (min-width: 900px) {
  body.wa-app .wa-listpane { width: 380px; flex: none; border-inline-end: 1px solid var(--wa-line); }
  body.wa-app .wa-back { display: none; }
}

/* 2026-09-29 (phase 2): "Download the app" button, notifications bell, toast and the iPhone sheet. */
body.wa-app .wa-listhead .wa-apptitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.wa-app .wa-head-btn { flex: none; display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 999px; padding: 0.3rem 0.75rem; font: inherit; font-size: 0.82rem; cursor: pointer; }
body.wa-app .wa-head-btn:hover { background: rgba(255, 255, 255, 0.22); }
body.wa-app .wa-head-btn[hidden], body.wa-app .wa-icon-btn[hidden] { display: none; }
body.wa-app button.wa-icon-btn { border: 0; background: none; cursor: pointer; padding: 0; }
body.wa-app .wa-toast { position: fixed; inset-inline: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 50; margin-inline: auto; max-width: 26rem;
  background: #111b21; color: #fff; border-radius: 8px; padding: 0.7rem 1rem; font-size: 0.88rem; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
body.wa-app .wa-toast[hidden] { display: none; }
body.wa-app .wa-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(11, 20, 26, 0.45); display: flex; align-items: flex-end; justify-content: center; }
body.wa-app .wa-sheet[hidden] { display: none; }
body.wa-app .wa-sheet-card { background: #fff; width: 100%; max-width: 28rem; border-radius: 16px 16px 0 0; padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); }
body.wa-app .wa-sheet-card h2 { margin: 0 0 0.6rem; font-size: 1.1rem; color: #008069; }
body.wa-app .wa-sheet-card ol { margin: 0 0 1rem; padding-inline-start: 1.3rem; line-height: 1.9; }
body.wa-app .wa-sheet-close { width: 100%; border: 0; border-radius: 22px; background: #00a884; color: #fff; font: inherit; font-weight: 600; padding: 0.7rem; cursor: pointer; }

/* 2026-09-29 (phase 3): contact info panel, approved templates, "jump to latest" button, links. */
body.wa-app .wa-chatpane { position: relative; }
body.wa-app .wa-chathead-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.55rem; border: 0; background: none;
  color: inherit; font: inherit; text-align: start; padding: 0.2rem; border-radius: 8px; cursor: pointer; }
body.wa-app .wa-chathead-who:disabled { cursor: default; }
body.wa-app .wa-chathead-who:not(:disabled):hover { background: rgba(255, 255, 255, 0.1); }
body.wa-app .wa-avatar-xl { width: 96px; height: 96px; font-size: 2.4rem; }

body.wa-app .wa-info { flex: none; display: flex; flex-direction: column; min-height: 0; background: #f0f2f5; }
body.wa-app .wa-info[hidden] { display: none; }
body.wa-app .wa-infohead { flex: none; display: flex; align-items: center; gap: 0.6rem; height: 56px; padding: 0 0.4rem;
  background: var(--wa-green); color: #fff; }
body.wa-app .wa-infohead h2 { margin: 0; font-size: 1.05rem; font-weight: 500; color: #fff; }
body.wa-app .wa-infobody { flex: 1; min-height: 0; overflow-y: auto; }
body.wa-app .wa-info-top { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; background: #fff; padding: 1.4rem 1rem 1.1rem; }
body.wa-app .wa-info-name { font-size: 1.25rem; font-weight: 500; text-align: center; overflow-wrap: anywhere; margin-top: 0.4rem; }
body.wa-app .wa-info-id { color: #008069; font-weight: 600; font-size: 0.9rem; }
body.wa-app .wa-info-phone { color: var(--wa-muted); font-size: 0.95rem; }
body.wa-app .wa-info-sec { background: #fff; margin-top: 0.55rem; padding: 0.8rem 1.1rem; }
body.wa-app .wa-info-sec h3 { margin: 0 0 0.5rem; font-size: 0.85rem; font-weight: 500; color: #008069; }
body.wa-app .wa-info-dl { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
body.wa-app .wa-info-dl dt { font-size: 0.78rem; color: var(--wa-muted); }
body.wa-app .wa-info-dl dd { margin: 0; font-size: 0.95rem; }
html[dir="rtl"] body.wa-app .wa-info-dl dd[dir="ltr"] { text-align: right; }
body.wa-app .wa-info-none, body.wa-app .wa-info-last { margin: 0; color: var(--wa-muted); font-size: 0.88rem; }
body.wa-app .wa-info-last { margin-top: 0.5rem; }
body.wa-app .wa-info-appts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
body.wa-app .wa-info-appts li { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-size: 0.92rem; }
body.wa-app .wa-info-appts strong { font-weight: 500; }
body.wa-app .wa-info-actions { padding: 0.3rem 0; }
body.wa-app .wa-info-action { display: flex; align-items: center; gap: 1rem; width: 100%; box-sizing: border-box; padding: 0.85rem 1.1rem;
  border: 0; background: none; color: #008069; font: inherit; text-align: start; text-decoration: none; cursor: pointer; }
body.wa-app .wa-info-action:hover { background: #f5f6f6; }

body.wa-app .wa-blocked { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
body.wa-app .wa-blocked-btn { border: 0; border-radius: 999px; background: #00a884; color: #fff; font: inherit; font-size: 0.85rem;
  font-weight: 600; padding: 0.45rem 1.1rem; cursor: pointer; }
body.wa-app .wa-tpl-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: #54656f;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
body.wa-app .wa-tpl-btn:hover { background: rgba(0, 0, 0, 0.05); }
body.wa-app .wa-tpl-note { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--wa-muted); line-height: 1.6; }
body.wa-app .wa-tpl-warn { color: #8a5a00; background: #fff8e1; border-radius: 8px; padding: 0.45rem 0.6rem; }
body.wa-app .wa-tpl-list { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.9rem; max-height: 50vh; overflow-y: auto; }
body.wa-app .wa-tpl-form { margin: 0; }
body.wa-app .wa-tpl-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: start;
  border: 1px solid var(--wa-line); background: #fff; border-radius: 10px; padding: 0.65rem 0.8rem; font: inherit; cursor: pointer; }
body.wa-app .wa-tpl-item:hover { background: #f0faf7; border-color: #00a884; }
body.wa-app .wa-tpl-item strong { font-weight: 600; color: #111b21; }
body.wa-app .wa-tpl-item small { color: var(--wa-muted); font-size: 0.8rem; }
body.wa-app .wa-tpl-item:disabled { opacity: 0.6; cursor: wait; }
body.wa-app .wa-tpl-item-free { cursor: default; }
body.wa-app .wa-tpl-item-free textarea { width: 100%; box-sizing: border-box; margin-top: 0.35rem; border: 1px solid #d1d7db; border-radius: 8px; padding: 0.45rem 0.6rem; font: inherit; resize: vertical; }
body.wa-app .wa-tpl-send { align-self: flex-end; margin-top: 0.35rem; background: #00a884; color: #fff; border: 0; border-radius: 999px; padding: 0.35rem 1.1rem; font-weight: 600; cursor: pointer; }
body.wa-app .wa-tpl-send:disabled { opacity: 0.6; cursor: wait; }
body.wa-app .wa-sheet-cancel { background: #e9edef; color: #111b21; }

body.wa-app .wa-jump { position: absolute; inset-inline-end: 14px; bottom: 84px; z-index: 5; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: #fff; color: #54656f; box-shadow: 0 2px 6px rgba(11, 20, 26, 0.25); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; }
body.wa-app .wa-jump[hidden] { display: none; }
body.wa-app .wa-jump-count { position: absolute; top: -6px; inset-inline-start: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  box-sizing: border-box; border-radius: 10px; background: var(--wa-badge); color: #fff; font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
body.wa-app .wa-jump-count[hidden] { display: none; }
body.wa-app .wa-bubble-body a { color: #027eb5; text-decoration: underline; overflow-wrap: anywhere; }

@media (max-width: 899.98px) {
  body.wa-app .wa-info { position: fixed; inset: 0; z-index: 40; height: var(--wa-vh, 100dvh); }
}
@media (min-width: 900px) {
  body.wa-app .wa-info { width: 360px; border-inline-start: 1px solid var(--wa-line); }
}
@media (min-width: 900px) and (max-width: 1199.98px) {
  /* Three columns do not fit: the info panel covers the conversation list instead. */
  body.wa-app .wa-shell.wa-info-open .wa-listpane { display: none; }
}

/* Meeting 2026-10-01 (task 328): live forms - the bar above the form and the mark on a field another user changed. */
.live-bar { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; margin: 0 0 0.8rem; padding: 0.45rem 0.8rem;
            border: 1px solid #b7e0c4; border-radius: 8px; background: #f2faf4; color: #14532d; font-size: 0.92rem; }
.live-bar[hidden] { display: none; }
/* Stays in view while a long form is scrolled: the moment somebody else joins must not be missed. */
.live-bar { position: sticky; top: 0.4rem; z-index: 30; box-shadow: 0 1px 4px rgba(16, 24, 40, 0.08); }
.live-bar .live-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #16a34a; flex: none; }
.live-bar.live-shared { border-color: #f5c56b; background: #fffaeb; color: #7a4a00; }
.live-bar.live-shared .live-dot { background: #f59e0b; }
.live-bar.live-shared .live-people { font-weight: 700; }
.live-bar.live-offline { border-color: #f1a9a0; background: #fff4f2; color: #912018; }
.live-bar.live-offline .live-dot { background: #d92d20; }
.live-bar .live-note { flex-basis: 100%; font-weight: 600; }
.live-bar .live-note:empty { display: none; }
.live-flash { outline: 3px solid #f59e0b !important; outline-offset: 2px; background-color: #fff7e0 !important; transition: outline-color 0.6s; }

/* Tasks 337-339 (2026-10-03): people as coloured chips, the field each one is in, who is in the file, conflicts. */
.live-bar .live-people { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.live-bar .live-people:empty { display: none; }
.live-bar .live-people-lead { font-weight: 600; margin-inline-end: 0.15rem; }
.live-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem 0.15rem 0.2rem; border-radius: 999px;
             background: #fff; border: 1.5px solid var(--live-c, #94a3b8); color: #1f2937; font-size: 0.86rem; line-height: 1.5; white-space: nowrap;
             box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); }
[dir="rtl"] .live-chip { padding: 0.15rem 0.2rem 0.15rem 0.6rem; }
.live-chip .live-avatar { width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--live-c, #94a3b8); color: var(--live-fg, #fff);
                          display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; flex: none; }
.live-chip .live-name { font-weight: 600; }
.live-chip .live-where { color: #475569; font-size: 0.8rem; }
.live-chip .live-where::before { content: "·"; margin-inline-end: 0.35rem; color: #94a3b8; }
.live-bar.live-me .live-dot { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }

/* The field somebody else is in right now: a ring in their colour and their name on its corner. */
.live-host { position: relative; }
.live-cursor { outline: 2px solid var(--live-c, #2563eb) !important; outline-offset: 2px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--live-c, #2563eb) 14%, transparent) !important;
               transition: box-shadow 0.25s, outline-color 0.25s; }
.live-tag { position: absolute; top: -0.55rem; inset-inline-end: 0.4rem; z-index: 5; padding: 0.05rem 0.5rem; border-radius: 999px;
            background: var(--live-c, #2563eb); color: var(--live-fg, #fff); font-size: 0.72rem; font-weight: 700; line-height: 1.5;
            box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25); pointer-events: none; animation: live-tag-in 0.25s ease-out; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.live-tag::before { content: "✎ "; }
@keyframes live-tag-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Who is in this patient's file - under the page title of every page of the file. */
.live-file { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: -0.2rem 0 1rem; padding: 0.45rem 0.8rem;
             border-radius: 10px; background: linear-gradient(90deg, #eef4ff, #f8fafc); border: 1px solid #c7d7fe; color: #1e3a8a; font-size: 0.9rem; }
.live-file[hidden] { display: none; }
.live-file-title { font-weight: 700; }
.live-file-title::before { content: "👥"; margin-inline-end: 0.4rem; }
.live-file-list { display: inline-flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; }

/* Two people typed in one field: the field turns amber and a small card under it offers both values. */
.live-conflict-field { outline: 3px solid #f59e0b !important; outline-offset: 2px; background-color: #fff7e0 !important; }
.live-conflict { grid-column: 1 / -1; margin: 0.4rem 0 0.8rem; padding: 0.6rem 0.8rem; border-radius: 10px; border: 1px solid #f5c56b; background: #fffaeb; color: #7a4a00;
                 box-shadow: 0 2px 6px rgba(122, 74, 0, 0.12); animation: live-tag-in 0.25s ease-out; }
.live-conflict-head { font-weight: 700; margin-bottom: 0.45rem; }
.live-conflict-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.live-conflict-row .btn { max-width: 100%; white-space: normal; text-align: start; }
@media (max-width: 640px) { .live-tag { max-width: 70%; } .live-chip .live-where { display: none; } }

/* Worklist queue sub-menu under "Worklist" in the side menu - the worklist page (worklist.js) and,
   2026-10-08, the visit / form / report pages a queue opens (nav-worklist.js). */
.staff-sidebar .worklist-menu.in-sidebar { display:flex; flex-direction:column; flex-wrap:nowrap; gap:0.1rem; width:auto; flex:none;
    margin:0.15rem 0 0.5rem; margin-inline-start:1.05rem; padding:0.15rem 0; padding-inline-start:0.55rem;
    border-inline-start:2px solid var(--color-primary-light,#d9efef); background:none; box-shadow:none; position:static;
    overflow:hidden; max-height:40rem; transition:max-height 0.25s ease, opacity 0.2s ease; }
.staff-sidebar .worklist-menu.in-sidebar.collapsed { max-height:0; opacity:0; margin-bottom:0; padding:0; border-color:transparent; }
.staff-sidebar .worklist-menu.in-sidebar .worklist-menu-item { display:flex; align-items:center; justify-content:space-between;
    gap:0.4rem; width:100%; max-width:none; flex:none; padding:0.42rem 0.6rem; border:0; border-radius:8px; background:none;
    font-size:0.86rem; line-height:1.3; text-align:start; white-space:normal; color:var(--color-primary-dark,#0d3b5c);
    cursor:pointer; box-shadow:none; transform:none; }
.staff-sidebar .worklist-menu.in-sidebar .worklist-menu-item:hover { background:var(--color-primary-light,#e2f4f4); transform:none; }
.staff-sidebar .worklist-menu.in-sidebar .worklist-menu-item.active { background:var(--color-primary-light,#e2f4f4);
    color:var(--color-primary,#00a8a8); font-weight:700; box-shadow:inset 3px 0 0 var(--color-primary,#00a8a8); }
html[dir="rtl"] .staff-sidebar .worklist-menu.in-sidebar .worklist-menu-item.active { box-shadow:inset -3px 0 0 var(--color-primary,#00a8a8); }
.staff-sidebar .worklist-menu.in-sidebar .badge { flex:none; font-size:0.72rem; min-width:1.5rem; text-align:center; }
.staff-sidebar nav a.has-submenu::after { content:"\25BE"; margin-inline-start:auto; font-size:0.8rem; opacity:0.9; transition:transform 0.2s ease; }
.staff-sidebar nav a.has-submenu[aria-expanded="false"]::after { transform:rotate(90deg); }
html[dir="rtl"] .staff-sidebar nav a.has-submenu[aria-expanded="false"]::after { transform:rotate(-90deg); }

/* 2026-10-08: patient page whose patient is in no worklist queue - a muted line in the queue sub-menu. */
.worklist-menu-item.none { color: var(--color-text-muted, #5c6663); font-style: italic; cursor: default; background: none; }
.worklist-menu-item.none:hover { background: none; transform: none; }
