/* ============================================================
   theme.css — professional polish layer (2026-11-21)
   ------------------------------------------------------------
   Loaded after style.css and before responsive.css.
   Changes only the LOOK (fonts, spacing, colours, shapes).
   No layout of the therapy steps and no clinical logic is changed.
   Remove the <link> to this file in index.html to go back.
   ============================================================ */

/* ---------- 1. One font on every device (bundled, offline) ---------- */
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.otf") format("opentype");  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Medium.otf") format("opentype");   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-SemiBold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.otf") format("opentype");     font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-ExtraBold.otf") format("opentype"); font-weight: 800 900; font-style: normal; font-display: swap; }

/* ---------- 2. Design tokens (same colours, finer details) ---------- */
:root {
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #f4f5f7;
  --bg-subtle: #f8f9fb;
  --text-primary: #16181d;
  --text-secondary: #5f6470;
  --text-tertiary: #8a8f99;
  --border: #d5d8de;
  --border-light: #e6e8ec;
  --accent: #0b6fd6;
  --accent-hover: #095fb8;
  --accent-soft: #e9f2fd;
  --accent-ring: rgba(11, 111, 214, 0.28);
  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.18), 0 4px 12px rgba(16, 24, 40, 0.08);
}

body, button, input, select, textarea { font-family: var(--font-ui); }
body {
  font-size: 15px;
  letter-spacing: -0.006em;
  font-feature-settings: "cv11", "ss01";      /* Inter: cleaner a/1/l shapes */
  color: var(--text-primary);
  background: var(--bg);
}
h1, h2, h3, h4 { letter-spacing: -0.018em; }
/* Numbers line up in tables, scores and timers */
table, .therapy-tally, [id$="-tally"], .stat, .appdlg { font-variant-numeric: tabular-nums; }

/* Keyboard focus is always visible (accessibility), mouse clicks stay clean */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, .btn:focus-visible, .btn-small:focus-visible, .nav-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring) !important; }

/* ---------- 3. Sidebar ---------- */
.sidebar {
  background: #ffffff;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-right: 1px solid var(--border-light);
  padding: 16px 12px 12px;
}
.sidebar-brand { padding: 2px 8px 14px; margin-bottom: 10px; }
.sidebar-brand img { height: 34px; border-radius: 6px; }

.workspace-switcher { padding: 4px 6px 14px; margin-bottom: 8px; }
.workspace-switcher label { font-size: 10.5px; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: 6px; }
.workspace-switcher select {
  height: 36px; padding: 0 30px 0 10px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  background: var(--bg-subtle) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none;
}
/* "+ New Workspace": quiet secondary button instead of a bright blue block */
.workspace-switcher .btn-small.btn-primary {
  background: transparent; color: var(--accent); border: 1px dashed #b9cfe8; box-shadow: none;
  font-weight: 600; height: 32px; padding: 0 10px;
}
.workspace-switcher .btn-small.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent); }

.sidebar-nav { gap: 2px; }
.nav-item {
  position: relative;
  height: 38px; padding: 0 10px; gap: 11px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.nav-item:hover { background: #f1f3f6; color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: none;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-item.active .nav-icon { filter: none; }

/* Account area (built by theme.js): one compact row instead of five big buttons */
.sidebar-footer { padding-top: 10px; gap: 0; }
.acct-row { display: flex; align-items: center; gap: 6px; position: relative; }
.acct-chip {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border: none; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font: inherit; color: var(--text-primary);
}
.acct-chip:hover, .acct-chip[aria-expanded="true"] { background: #f1f3f6; }
.acct-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0b6fd6, #5aa6f0); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
}
.acct-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.acct-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-role { font-size: 11.5px; color: var(--text-tertiary); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-caret { margin-left: auto; color: var(--text-tertiary); flex-shrink: 0; }
.acct-icon-btn {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); background: #fff; color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.acct-icon-btn:hover { background: #f1f3f6; color: var(--text-primary); }
.acct-icon-btn svg { width: 17px; height: 17px; }
.acct-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
  display: none; flex-direction: column;
}
.acct-menu.open { display: flex; animation: acctIn 0.14s ease; }
@keyframes acctIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.acct-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; padding: 0 10px; border: none; background: transparent; border-radius: 7px;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-primary); cursor: pointer; text-align: left;
}
.acct-menu button:hover { background: #f1f3f6; }
.acct-menu button svg { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }
.acct-menu hr { border: none; border-top: 1px solid var(--border-light); margin: 5px 4px; }
.acct-menu .acct-danger, .acct-menu .acct-danger svg { color: #c62828; }
.acct-menu .acct-danger:hover { background: #fdecec; }
.sidebar-footer .acct-hidden { display: none !important; }

/* ---------- 4. Main area ---------- */
.content { max-width: 1240px; padding-top: clamp(16px, 3vh, 32px); }
.page-header { margin-bottom: clamp(14px, 2.4vh, 28px); align-items: center; }
.page-header h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.page-subtitle { color: var(--text-tertiary); font-size: 13.5px; margin-top: 4px; }

.card {
  border-radius: var(--radius-lg); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm); padding: clamp(18px, 2.4vw, 28px);
}
.card h2, .card h3 { letter-spacing: -0.015em; }

.empty-state {
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  background: #fff; color: var(--text-secondary); padding: 48px 24px;
}

/* ---------- 5. Buttons: same heights and shapes everywhere ---------- */
.btn { height: 40px; padding: 0 18px; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); letter-spacing: -0.005em; }
.btn-primary { background: var(--accent); box-shadow: 0 1px 2px rgba(11,111,214,0.25), inset 0 1px 0 rgba(255,255,255,0.12); }
.btn-primary:hover { background: var(--accent-hover); transform: none; box-shadow: 0 2px 8px rgba(11,111,214,0.28); }
.btn-secondary { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: #b9bec7; }
.btn-ghost { border-color: var(--border-light); }
.btn-danger { background: #c62828; }
.btn-danger:hover { background: #a91f1f; }
.btn-small { min-height: 32px; padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-small:hover { border-color: #b9bec7; background: var(--bg-subtle); }
.btn-small.btn-primary { box-shadow: 0 1px 2px rgba(11,111,214,0.25); }
.btn:disabled, .btn-small:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }
/* Buttons that were given a custom size inline (padding/font-size) keep auto height */
.btn[style*="padding"] { height: auto; min-height: 40px; }

/* ---------- 6. Form fields ---------- */
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.005em; }
.field input, .field select, .field textarea,
.modal-card input[type="text"], .modal-card input[type="email"], .modal-card input[type="password"],
.modal-card input[type="date"], .modal-card input[type="time"], .modal-card input[type="number"], .modal-card select, .modal-card textarea {
  border-radius: var(--radius-sm); border-color: var(--border); background: #fff;
  font-size: 14.5px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input, .field select { min-height: 42px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b9bec7; }
.field input:focus, .field select:focus, .field textarea:focus,
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none;
}
input::placeholder, textarea::placeholder { color: #a3a8b1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ---------- 7. Windows (modals) ---------- */
.modal-overlay { background: rgba(15, 20, 30, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.6); }
.modal-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.modal-actions { gap: 8px; }

/* ---------- 8. Client cards on the home screen ---------- */
/* Text was sized by screen HEIGHT (vh) → unreadable on short windows. Now fixed sizes. */
.child-card { border-radius: var(--radius-lg); padding: 14px 12px; box-shadow: var(--shadow-sm); }
.child-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.child-card strong { font-size: 15px; font-weight: 700; margin-top: 8px; gap: 2px; }
.card-actions { margin-top: 10px; gap: 6px; }
.card-actions .btn-small { padding: 7px 10px; font-size: 12.5px; min-height: 32px; }

/* ---------- 9. Tables ---------- */
table { border-collapse: separate; border-spacing: 0; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 700; }
/* table headers on a coloured header row (reports) keep the row's white text */
tr[style*="color: white"] > th, tr[style*="color:white"] > th, tr[style*="color: #fff"] > th { color: inherit; }

/* ---------- 10. Sign-in screens ---------- */
.login-wrap { background: radial-gradient(1200px 600px at 50% -10%, #e6f0fc 0%, rgba(230,240,252,0) 70%), var(--bg); }
.login-card { border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); }

/* ============================================================
   11. THE DIALOG (dialogs.js) — replaces every browser popup
   ============================================================ */
.appdlg-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: none; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: rgba(15, 20, 30, 0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  transition: background 0.16s ease, backdrop-filter 0.16s ease;
}
.appdlg-overlay.open { background: rgba(15, 20, 30, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.appdlg {
  width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 26px 26px 20px;
  box-shadow: var(--shadow-lg); font-family: var(--font-ui);
  transform: translateY(8px) scale(0.98); opacity: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.appdlg-overlay.open .appdlg { transform: none; opacity: 1; }
.appdlg-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.appdlg-icon svg { width: 24px; height: 24px; }
.appdlg-success .appdlg-icon { background: #e7f6ec; color: #1f8a43; }
.appdlg-warning .appdlg-icon { background: #fff3e0; color: #c26a00; }
.appdlg-danger  .appdlg-icon { background: #fdecec; color: #c62828; }
.appdlg-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); margin: 0 0 6px; line-height: 1.3; }
.appdlg-msg { font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); word-wrap: break-word; }
.appdlg-msg strong { color: var(--text-primary); font-weight: 600; }
.appdlg-list { margin: 8px 0 10px; padding: 10px 12px 10px 28px; background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 10px; }
.appdlg-list li { margin: 2px 0; }
.appdlg-field { margin-top: 16px; }
.appdlg-input {
  width: 100%; height: 44px; padding: 0 12px; font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); background: #fff;
}
.appdlg-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.appdlg-danger .appdlg-input:focus { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.22); }
.appdlg-hint { font-size: 12.5px; color: var(--text-tertiary); margin-top: 7px; }
.appdlg-hint strong { color: var(--text-primary); font-weight: 700; letter-spacing: 0.04em; }
.appdlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.appdlg-btn {
  height: 40px; min-width: 96px; padding: 0 18px; border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.appdlg-cancel { background: #fff; border-color: var(--border); color: var(--text-primary); }
.appdlg-cancel:hover { background: var(--bg-subtle); }
.appdlg-ok { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(11,111,214,0.25); }
.appdlg-ok:hover { background: var(--accent-hover); }
.appdlg-danger .appdlg-ok { background: #c62828; box-shadow: 0 1px 2px rgba(198,40,40,0.3); }
.appdlg-danger .appdlg-ok:hover { background: #a91f1f; }
.appdlg-ok:disabled { opacity: 0.4; cursor: not-allowed; }
.appdlg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.appdlg-danger .appdlg-btn:focus-visible { box-shadow: 0 0 0 3px rgba(198,40,40,0.25); }
@media (max-width: 480px) {
  .appdlg { padding: 22px 18px 16px; border-radius: 16px; }
  .appdlg-actions { flex-direction: column-reverse; }
  .appdlg-btn { width: 100%; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .appdlg, .appdlg-overlay, .acct-menu.open { transition: none; animation: none; }
}

/* ============================================================
   12. COLOUR & ICON TILES (2026-11-21, round 2)
   Same visual language as the "Before we start" window:
   tinted icon tiles + a coloured accent per kind of action.
   ============================================================ */
:root {
  --t-blue: #0b6fd6;   --t-blue-bg: #e8f1fd;
  --t-green: #1f9d55;  --t-green-bg: #e6f6ec;
  --t-orange: #e07b00; --t-orange-bg: #fff1df;
  --t-purple: #8b3fd1; --t-purple-bg: #f3eafd;
  --t-pink: #d63384;   --t-pink-bg: #fde9f3;
  --t-teal: #0f9488;   --t-teal-bg: #e2f6f3;
  --t-indigo: #4f46e5; --t-indigo-bg: #ecebfd;
  --t-red: #d32f2f;    --t-red-bg: #fdecec;
  --t-slate: #475569;  --t-slate-bg: #eef1f5;
}

/* ---- Readable red buttons everywhere (was red text on red) ---- */
.btn-small.btn-danger { background: var(--t-red-bg) !important; color: var(--t-red) !important; border: 1px solid #f5c2c2 !important; box-shadow: none; }
.btn-small.btn-danger:hover { background: var(--t-red) !important; color: #fff !important; border-color: var(--t-red) !important; }

/* ---- Sidebar: each item has its own colour tile ---- */
.nav-item { height: 42px; padding: 0 8px; gap: 12px; }
.nav-icon {
  width: 30px; height: 30px; border-radius: 9px; font-size: 16px; line-height: 1;
  background: var(--tone-bg, var(--t-slate-bg));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-item:hover .nav-icon { transform: scale(1.06); }
.nav-item.active { background: var(--tone-bg, var(--accent-soft)); color: var(--tone, var(--accent)); }
.nav-item.active::before { background: var(--tone, var(--accent)); }
.nav-item.active .nav-icon { background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,0.12), 0 0 0 1.5px var(--tone, var(--accent)); }
.nav-item[data-tone="blue"]   { --tone: var(--t-blue);   --tone-bg: var(--t-blue-bg); }
.nav-item[data-tone="green"]  { --tone: var(--t-green);  --tone-bg: var(--t-green-bg); }
.nav-item[data-tone="orange"] { --tone: var(--t-orange); --tone-bg: var(--t-orange-bg); }
.nav-item[data-tone="purple"] { --tone: var(--t-purple); --tone-bg: var(--t-purple-bg); }
.nav-item[data-tone="pink"]   { --tone: var(--t-pink);   --tone-bg: var(--t-pink-bg); }
.nav-item[data-tone="teal"]   { --tone: var(--t-teal);   --tone-bg: var(--t-teal-bg); }
.nav-item[data-tone="indigo"] { --tone: var(--t-indigo); --tone-bg: var(--t-indigo-bg); }
.nav-item[data-tone="red"]    { --tone: var(--t-red);    --tone-bg: var(--t-red-bg); }
.nav-item[data-tone="slate"]  { --tone: var(--t-slate);  --tone-bg: var(--t-slate-bg); }

/* ---- Client cards ---- */
.child-card { padding: 16px 14px 14px; }
.child-card .card-actions { margin-top: 12px; gap: 8px; display: flex; flex-direction: column; width: 100%; }

.ca-start {
  width: 100%; height: 42px; border: none; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, #1a7ce3 0%, #0b6fd6 100%); color: #fff;
  font: inherit; font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 2px 6px rgba(11,111,214,0.30), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ca-start span { font-size: 12px; }
.ca-start:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(11,111,214,0.32); }
/* 2026-11-30 idea #1: Continue button under Start Session */
.ca-continue { width: 100%; min-height: 36px; margin-top: 6px; border: 1.5px solid #0b6fd6; border-radius: 11px; cursor: pointer; background: #fff; color: #0b6fd6;
  font: inherit; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 10px; text-align: center; }
.ca-continue span { font-size: 12px; }
.ca-continue:hover { background: #eef5fd; }
html[data-theme="navy"] .ca-continue { background: transparent; color: #8cc4ff; border-color: #4a8fe0; }

.ca-list { display: flex; flex-direction: column; gap: 6px; }
.ca-btn {
  --tone: var(--t-blue); --tone-bg: var(--t-blue-bg);
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 5px 10px 5px 5px; min-height: 40px;
  background: #fff; border: 1px solid var(--border-light); border-left: 3px solid var(--tone);
  border-radius: 10px; cursor: pointer; text-align: left;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.25;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.ca-btn:hover { background: var(--tone-bg); border-color: var(--tone); transform: translateX(1px); }
.ca-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tone-bg); font-size: 15px; line-height: 1;
}
.ca-lbl { min-width: 0; }
.ca-guided   { --tone: var(--t-blue);   --tone-bg: var(--t-blue-bg); }
.ca-full     { --tone: var(--t-purple); --tone-bg: var(--t-purple-bg); }
.ca-baseline { --tone: var(--t-orange); --tone-bg: var(--t-orange-bg); }
.ca-reports  { --tone: var(--t-teal);   --tone-bg: var(--t-teal-bg); }
.ca-private  { --tone: var(--t-pink);   --tone-bg: var(--t-pink-bg); }

.ca-manage {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px;
  padding-top: 8px; border-top: 1px dashed var(--border-light);
}
.ca-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 4px 6px; border-radius: 10px; cursor: pointer;
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  font: inherit; font-size: 11px; font-weight: 600; color: var(--text-secondary);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.ca-chip span { font-size: 16px; line-height: 1; }
.ca-chip:hover { background: #fff; color: var(--text-primary); border-color: #c4cad3; box-shadow: var(--shadow-sm); }

.ca-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ca-remove {
  background: none; border: none; cursor: pointer; padding: 6px 4px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--t-red);
}
.ca-remove:hover { text-decoration: underline; }
.ca-delete {
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: var(--t-red-bg); border: 1px solid #f5c2c2; color: var(--t-red);
  font: inherit; font-size: 12px; font-weight: 700;
  transition: background 0.12s ease, color 0.12s ease;
}
.ca-delete:hover { background: var(--t-red); border-color: var(--t-red); color: #fff; }
/* Inactive clients: actions look muted */
.child-card.inactive .ca-btn, .child-card.inactive .ca-start { filter: grayscale(0.6); }
/* The old "short screen" rule (style.css) forced card buttons into 2 columns — not for the new card layout */
.child-card .card-actions { display: flex !important; flex-direction: column !important; grid-template-columns: none !important; gap: 8px !important; }
.ca-manage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ca-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-remove, .ca-delete { white-space: nowrap; display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; }
.ca-remove { font-size: 11.5px; }

/* ---- Round 3: client cards never overflow, at any window size ---- */
/* Cards were allowed to shrink to 200px (too narrow for the action rows) */
#children-list.list-container, .list-container {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 256px), 1fr));
  gap: 16px;
  align-items: start;
}
.child-card { min-width: 0; overflow: hidden; }
.child-card .card-actions, .ca-list, .ca-btn, .ca-manage, .ca-danger-row { min-width: 0; max-width: 100%; }
.ca-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-danger-row { flex-wrap: wrap; row-gap: 4px; }
.ca-danger-row > button { flex: 0 1 auto; min-width: 0; }
/* Header buttons (Export / Restore Backup) wrap under the title on narrow windows instead of running off-screen */
.page-header { flex-wrap: wrap; }
.page-header > div { min-width: 0; }
#admin-backup-tools { flex-wrap: wrap; }

/* ============================================================
   13. LIBRARY PICTURE CARDS (round 4)
   Cards in a row are the same height and the "in plan / child"
   row always sits at the bottom, even when a word has no IPA line.
   ============================================================ */
.picture-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 14px; align-items: stretch; }
.picture-tile { display: flex; flex-direction: column; border-radius: 14px; box-shadow: var(--shadow-sm); }
.picture-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.picture-tile > div:first-child { flex-shrink: 0; height: auto !important; aspect-ratio: 4 / 3; background: #f0f2f5; }
.picture-tile > div:first-child img { height: 100% !important; }
.picture-tile-info { flex: 1; display: flex; flex-direction: column; padding: 10px 12px 10px; min-width: 0; }
.picture-tile-info strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picture-tile-info small { font-size: 11.5px; line-height: 1.45; }
.picture-tile-controls {
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.picture-tile-info > small:last-of-type { margin-bottom: 8px; }
.tile-inline { font-size: 12px; font-weight: 600; }
.tile-vocab-select { height: 26px; font-size: 12px; font-weight: 600; padding: 0 22px 0 8px; border-radius: 7px; -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235f6470' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center; }
/* Round edit / play buttons on the picture: same size and look */
.picture-tile > div:first-child > button { width: 32px !important; height: 32px !important; box-shadow: 0 1px 4px rgba(16,24,40,0.18) !important; }

/* ============================================================
   14. EVERY WINDOW & SCREEN AT ANY SIZE (round 4)
   ============================================================ */
/* Drop-down lists: one modern look everywhere (they used the browser's grey style) */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px !important;
  background-color: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 36px; font: inherit; font-size: 14px; color: var(--text-primary); cursor: pointer;
}
select:not([multiple]):not([size]):hover { border-color: #b9bec7; }
select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }
.tile-vocab-select { min-height: 26px; font-size: 12px; padding-right: 22px !important; background-position: right 7px center; }

/* File pickers ("Choose File / No file chosen") */
input[type="file"] { font: inherit; font-size: 13px; color: var(--text-secondary); max-width: 100%; min-width: 0; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #c9ddf5; border-radius: 8px;
  padding: 7px 12px; margin-right: 10px; cursor: pointer; transition: background 0.12s;
}
input[type="file"]::file-selector-button:hover { background: #dcebfc; }

/* Client Directory rows */
.dir-row { flex-wrap: wrap; gap: 10px; }
.dir-who { min-width: 0; }
.dir-actions { flex-wrap: wrap; }

/* Windows on narrow screens (phones, small tablets) */
@media (max-width: 640px) {
  /* (only ordinary windows — the full-screen therapy games are left alone) */
  .modal-overlay:has(> .modal-card) { padding: 10px !important; align-items: flex-start; padding-top: max(10px, env(safe-area-inset-top, 0px)) !important; }
  .modal-overlay > .modal-card { max-height: calc(100dvh - 20px) !important; }
  .modal-card { padding: 20px 16px !important; border-radius: 16px; }
  /* Any row of buttons/fields inside a window wraps instead of running off the edge */
  .modal-card div[style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]), .modal-card div[style*="display:flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]), .modal-actions { flex-wrap: wrap; }
  .modal-card .btn { white-space: normal; text-align: center; }
  .modal-actions { justify-content: stretch; }
  .modal-actions > .btn, .modal-actions > button { flex: 1 1 auto; }
  /* Client Directory: name on top, buttons underneath full width */
  .dir-actions { width: 100%; }
  .dir-actions > button { flex: 1 1 auto; }
  /* Library: 2 pictures per row on phones */
  .picture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  #screen-library .card { padding: 14px; }
  .picture-tile-info { padding: 8px 9px; }
  .tile-inline span { font-size: 11px; }
}

/* Pre-Therapy Baseline step tabs: compact, scroll sideways on very small screens */
#pre-therapy-baseline-modal [id*="step"], #pre-therapy-baseline-modal [class*="step"] { min-width: 0; }

/* ============================================================
   15. AUDIT LOG (audit.js)
   ============================================================ */
.audit-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.audit-search { flex: 1 1 260px; min-width: 0; }
.audit-search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
}
.audit-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.audit-toolbar select { height: 38px; min-width: 0; max-width: 220px; }
.audit-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.audit-date input { height: 38px; padding: 0 8px; font: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.audit-toolbar .btn-small { height: 38px; }
.audit-summary { font-size: 12.5px; color: var(--text-tertiary); margin: 2px 2px 10px; }
.audit-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.audit-v2 { min-width: 860px; }
.audit-v2 td { padding: 11px 14px; font-size: 13px; }
.audit-v2 th { padding: 11px 14px; white-space: nowrap; }
.aud-strong { font-weight: 600; color: var(--text-primary); line-height: 1.35; }
.aud-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.35; word-break: break-word; }
.aud-details { color: var(--text-secondary); max-width: 280px; }
.aud-empty { text-align: center; color: var(--text-tertiary); padding: 28px !important; }
.aud-badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; white-space: nowrap; }
.aud-access   { background: var(--t-slate-bg);  color: var(--t-slate); }
.aud-view     { background: var(--t-teal-bg);   color: var(--t-teal); }
.aud-clinical { background: var(--t-blue-bg);   color: var(--t-blue); }
.aud-record   { background: var(--t-purple-bg); color: var(--t-purple); }
.aud-schedule { background: var(--t-green-bg);  color: var(--t-green); }
.aud-report   { background: var(--t-orange-bg); color: var(--t-orange); }
.aud-team     { background: var(--t-indigo-bg); color: var(--t-indigo); }
.aud-library  { background: var(--t-pink-bg);   color: var(--t-pink); }
.aud-system   { background: var(--t-red-bg);    color: var(--t-red); }
.audit-more { text-align: center; margin: 12px 0 4px; }
/* Phones: each entry becomes a small card */
@media (max-width: 700px) {
  .audit-toolbar select, .audit-date { flex: 1 1 45%; max-width: none; }
  .audit-date input { flex: 1; min-width: 0; }
  .audit-v2 { min-width: 0; border: none; box-shadow: none; background: transparent; }
  .audit-v2 thead { display: none; }
  .audit-v2, .audit-v2 tbody, .audit-v2 tr, .audit-v2 td { display: block; width: 100%; }
  .audit-v2 tr { background: #fff; border: 1px solid var(--border-light); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; }
  .audit-v2 td { border: none; padding: 5px 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
  .audit-v2 td::before { content: attr(data-l); font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
  .audit-v2 td > * { grid-column: 2; justify-self: start; }
  .audit-v2 td.aud-empty { display: block; }
  .audit-v2 td.aud-empty::before { content: none; }
  .aud-details { max-width: none; }
}

/* ============================================================
   16. PROFESSIONALS & FAMILY LISTS (people.js)
   ============================================================ */
.people-add { margin-left: auto; }
.people-add span { font-size: 16px; line-height: 1; }
.people-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.people-search { flex: 1 1 260px; max-width: 420px; }
.people-search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
}
.people-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.people-count { font-size: 13px; color: var(--text-tertiary); font-weight: 600; }
.people-inactive { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-left: auto; cursor: pointer; }

.people-list { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.people-cols-prof { display: grid; grid-template-columns: minmax(200px, 2.2fr) minmax(160px, 1.8fr) 130px 70px 118px; gap: 14px; align-items: center; }
.people-cols-fam  { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(160px, 1.6fr) minmax(140px, 1.6fr) 84px; gap: 14px; align-items: center; }
.people-head { padding: 10px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-light);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.people-row { padding: 10px 16px; border-bottom: 1px solid var(--border-light); transition: background 0.12s; }
.people-row:last-child { border-bottom: none; }
.people-row:hover { background: #f8fafc; }
.people-row.is-inactive { opacity: 0.6; }
.people-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.people-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em; background: var(--tone-bg); color: var(--tone); }
.people-name { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.people-name strong { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.people-role { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--tone-bg); color: var(--tone); }
.people-meta { font-size: 11.5px; color: var(--text-tertiary); }
.people-email { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.people-muted { color: var(--text-tertiary); font-style: italic; }
.people-status { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.people-status.on { color: var(--t-green); } .people-status.none { color: var(--text-tertiary); } .people-status.off { color: var(--t-red); }
.people-num { display: inline-flex; min-width: 28px; height: 24px; padding: 0 8px; align-items: center; justify-content: center; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border-light); font-size: 12.5px; font-weight: 700; }
.people-kids { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.people-chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--t-green-bg); color: var(--t-green); white-space: nowrap; }
.people-warn { font-size: 12.5px; font-weight: 600; color: var(--t-red); }
.people-actions { display: flex; justify-content: flex-end; gap: 6px; }
.pa { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-light); background: #fff; cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.pa:hover { transform: translateY(-1px); }
.pa-edit:hover { background: var(--t-blue-bg); border-color: #b9d5f5; }
.pa-warn { color: var(--t-orange); font-size: 13px; } .pa-warn:hover { background: var(--t-orange-bg); border-color: #f6d2a3; }
.pa-ok { color: var(--t-green); font-weight: 800; } .pa-ok:hover { background: var(--t-green-bg); border-color: #b5e3c6; }
.pa-key:hover { background: var(--t-indigo-bg); border-color: #cfcdf8; }
.pa-del { background: var(--t-red-bg); border-color: #f5c2c2; } .pa-del:hover { background: var(--t-red); border-color: var(--t-red); }
.people-empty { padding: 36px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.tone-blue { --tone: var(--t-blue); --tone-bg: var(--t-blue-bg); } .tone-teal { --tone: var(--t-teal); --tone-bg: var(--t-teal-bg); }
.tone-purple { --tone: var(--t-purple); --tone-bg: var(--t-purple-bg); } .tone-orange { --tone: var(--t-orange); --tone-bg: var(--t-orange-bg); }
.tone-pink { --tone: var(--t-pink); --tone-bg: var(--t-pink-bg); } .tone-indigo { --tone: var(--t-indigo); --tone-bg: var(--t-indigo-bg); }
.tone-slate { --tone: var(--t-slate); --tone-bg: var(--t-slate-bg); } .tone-green { --tone: var(--t-green); --tone-bg: var(--t-green-bg); }
/* Add-form windows */
.people-modal .modal-card { width: min(520px, 100%); }
.people-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.people-modal-head h2 { margin: 0 !important; }
.people-x { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-light); background: #fff; cursor: pointer; font-size: 14px; color: var(--text-secondary); }
.people-x:hover { background: var(--bg-subtle); color: var(--text-primary); }
.people-modal-body form > .btn[type="submit"] { width: 100%; margin-top: 6px; }
/* Narrow screens: each person becomes a compact 2-line card */
@media (max-width: 860px) {
  .people-head { display: none; }
  .people-cols-prof, .people-cols-fam { grid-template-columns: minmax(0, 1fr) auto; grid-auto-rows: auto; row-gap: 6px; }
  .people-row > .people-who { grid-column: 1; grid-row: 1; }
  .people-row > .people-actions { grid-column: 2; grid-row: 1; }
  .people-row > [data-l] { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding-left: 50px; }
  .people-row > [data-l]::before { content: attr(data-l); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); width: 68px; flex-shrink: 0; }
  .people-inactive { margin-left: 0; }
  .pa { width: 32px; height: 32px; }
}

/* ============================================================
   17. SMS (sms.js)
   ============================================================ */
.sms-modal .modal-card { width: min(520px, 100%); }
.sms-ico { font-size: 18px; }
.sms-to label, .sms-msg label, .sms-tpl label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 6px; }
.sms-who { font-weight: 500; color: var(--text-tertiary); }
.sms-number, .sms-msg textarea, .sms-tpl textarea, .sms-tpl select, .sms-tpl input { width: 100%; font: inherit; font-size: 14.5px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; }
.sms-number { height: 42px; }
.sms-msg textarea, .sms-tpl textarea { resize: vertical; line-height: 1.5; }
.sms-number:focus, .sms-msg textarea:focus, .sms-tpl textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.sms-count { font-size: 11.5px; color: var(--text-tertiary); text-align: right; margin-top: 4px; }
.sms-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; background: var(--t-orange-bg); border: 1px solid #f6d2a3; border-radius: 10px; font-size: 13px; font-weight: 600; color: #8a4b00; cursor: pointer; }
.sms-consent input { margin-top: 2px; }
.sms-note { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.5; margin-top: 12px; }
.sms-tpl p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.sms-tpl code { font-size: 12px; background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 5px; padding: 0 4px; }
.sms-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.sms-fields { margin: 4px 0 8px; padding: 12px 14px; border: 1px dashed #c9ddf5; border-radius: 12px; background: #f7fafe; }
.sms-fields .field { margin-bottom: 8px; }
.sms-consent-field span { font-size: 13px; }
.sms-row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sms-row-btn { background: var(--t-green-bg) !important; color: var(--t-green) !important; border-color: #b5e3c6 !important; }
/* Home: reminders panel */
.sms-box { flex-shrink: 0; margin: 0 0 16px; background: #fff; border: 1px solid #b5e3c6; border-left: 4px solid var(--t-green); border-radius: 0 14px 14px 0; box-shadow: var(--shadow-sm); overflow: hidden; }
.sms-box.all-done { border-color: var(--border-light); border-left-color: #b5e3c6; }
.sms-box-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: none; border: none; cursor: pointer; font: inherit; text-align: left; flex-wrap: wrap; }
.sms-box-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--t-green-bg); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.sms-box-title { font-weight: 700; font-size: 14.5px; color: var(--text-primary); }
.sms-box-title b { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; margin-left: 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--t-green); color: #fff; font-size: 12px; }
.sms-box-sub { font-size: 12.5px; color: var(--text-tertiary); }
.sms-box-caret { margin-left: auto; color: var(--text-tertiary); }
.sms-box-list { border-top: 1px solid var(--border-light); }
.sms-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.sms-item strong { display: block; font-size: 14px; }
.sms-item span { font-size: 12.5px; color: var(--text-secondary); }
.sms-item em { color: var(--t-orange); font-style: normal; font-weight: 600; }
.sms-item.sent { opacity: 0.65; }
.sms-box-foot { padding: 8px 16px; text-align: right; }
.sms-link { background: none; border: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sms-link:hover { text-decoration: underline; }
/* SMS on a computer: QR code to scan with the phone */
.sms-hidden { display: none !important; }
.sms-qr { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 8px; }
.sms-qr-img { width: 260px; height: 260px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--border-light); border-radius: 14px; box-shadow: var(--shadow-sm); }
.sms-qr-img svg { width: 100%; height: 100%; display: block; }
.sms-qr-steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.sms-qr-steps li { margin-bottom: 6px; }
.sms-qr .sms-link { grid-column: 1 / -1; justify-self: start; font-size: 12.5px; }
@media (max-width: 520px) { .sms-qr { grid-template-columns: 1fr; justify-items: center; } }

/* ============================================================
   19. TODAY'S AGENDA — clinic list view (agenda.js, 2026-11-21)
   ============================================================ */
#agenda-bar { margin: 0 0 14px; }
.ag-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ag-tile { background: #fff; border: 1px solid var(--border-light); border-left: 4px solid #0b6fd6; border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.ag-tile span { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); }
.ag-tile b { display: block; font-size: 19px; font-weight: 700; color: var(--text-primary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-tile.ag-done { border-left-color: #16a34a; }
.ag-tile.ag-next { border-left-color: #f59e0b; }
.ag-tile.ag-sms { border-left-color: #8b5cf6; }
.ag-tile.ag-sms.todo b { color: #6d28d9; }
.ag-tile.ag-sms.ok b { color: #166534; }
.ag-tile small { display: block; font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ag-tabs, .ag-view { display: inline-flex; background: #eceef2; border-radius: 10px; padding: 3px; gap: 2px; }
.ag-tabs button, .ag-view button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: 600 13px var(--font-ui); color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.ag-tabs button.on, .ag-view button.on { background: #fff; color: var(--text-primary); box-shadow: var(--shadow-sm); }

#agenda-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ag-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 150px 118px 40px; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--border-light); position: relative; }
.ag-row:first-child { border-top: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.ag-row:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.ag-row:hover { background: var(--bg-subtle); }
.ag-row.is-next { background: #fffbeb; box-shadow: inset 4px 0 0 #f59e0b; }
.ag-row.is-done .ag-name strong { color: var(--text-secondary); }
.ag-row.is-inactive { opacity: .6; }
.ag-time { font-weight: 700; font-size: 14px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ag-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ag-av { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; object-fit: cover; }
.ag-av.child { background: #e0f2fe; color: #0369a1; }
.ag-av.adult { background: #ede9fe; color: #6d28d9; }
.ag-name { min-width: 0; }
.ag-name > div:first-child { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ag-name strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }
.ag-badge.child { background: #e0f2fe; color: #0369a1; }
.ag-badge.adult { background: #ede9fe; color: #6d28d9; }
.ag-sub { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ag-need { color: #b45309; font-weight: 600; }
.ag-st { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.ag-st.next { background: #fef3c7; color: #92400e; }
.ag-st.up { background: #e9f2fd; color: #0b5cb0; }
.ag-st.late { background: #fee2e2; color: #b91c1c; }
.ag-st.done { background: #dcfce7; color: #166534; }
.ag-st.none { background: #f1f2f4; color: var(--text-secondary); }
.ag-btn { width: 100%; border: 0; border-radius: 9px; padding: 8px 10px; font: 700 13.5px var(--font-ui); cursor: pointer; white-space: nowrap; }
.ag-btn.pri { background: var(--accent); color: #fff; }
.ag-btn.pri:hover { background: var(--accent-hover); }
.ag-btn.assess { background: #f59e0b; color: #fff; }
.ag-btn.assess:hover { background: #d97706; }
.ag-btn.sec { background: #fff; color: var(--text-primary); border: 1px solid var(--border); }
.ag-btn.sec:hover { background: var(--bg-subtle); }
.ag-more { position: relative; }
.ag-dots { width: 36px; height: 36px; border: 1px solid var(--border-light); background: #fff; border-radius: 9px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--text-secondary); }
.ag-dots:hover, .ag-dots[aria-expanded="true"] { background: var(--bg-subtle); color: var(--text-primary); }
.ag-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: #fff; border: 1px solid var(--border-light); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.ag-menu.up { top: auto; bottom: calc(100% + 6px); }
.ag-menu.open { display: block; }
.ag-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font: 500 13.5px var(--font-ui); color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.ag-menu button:hover { background: var(--bg-subtle); }
.ag-menu button.warn { color: #b45309; }
.ag-menu button.danger { color: #b91c1c; }
.ag-menu hr { border: 0; border-top: 1px solid var(--border-light); margin: 5px 2px; }
.ag-empty { padding: 26px; text-align: center; color: var(--text-secondary); }

/* tablets: drop the status column into the name line */
@media (max-width: 900px) {
  .ag-row { grid-template-columns: 64px minmax(0, 1fr) auto 108px 38px; gap: 10px; }
}
/* phones: two-line rows */
@media (max-width: 640px) {
  .ag-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ag-tile { padding: 8px 11px; }
  .ag-tile b { font-size: 16px; }
  .ag-controls { flex-wrap: wrap; }
  .ag-row { grid-template-columns: auto minmax(0, 1fr) auto 38px; grid-template-areas: "who who who more" "time status main main"; column-gap: 10px; row-gap: 8px; padding: 11px 12px; }
  .ag-who { grid-area: who; }
  .ag-more { grid-area: more; justify-self: end; }
  .ag-time { grid-area: time; font-size: 13px; }
  .ag-status { grid-area: status; justify-self: start; }
  .ag-main { grid-area: main; }
  .ag-btn { width: auto; padding: 7px 14px; }
}

.sms-qr-help { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 10px; padding: 8px 11px; }
.sms-qr-help .sms-link { display: inline; padding: 0; font-weight: 700; }
.sms-qr-fmt { color: var(--text-tertiary); }
.sms-qr-status { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.sms-qr-status.ok { color: #166534; background: #dcfce7; border-radius: 9px; padding: 7px 10px; }
.sms-qr-status.warn { color: #92400e; background: #fef3c7; border-radius: 9px; padding: 7px 10px; font-weight: 500; }
.sms-qr-wait { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 13px; }

.sms-qr-noapp { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 7px 10px; margin-bottom: 7px; }
/* the QR code is always black on white (every theme) — phones cannot read light codes */
.sms-qr-img, html[data-theme] .sms-qr-img { background: #ffffff !important; border-color: #e6e8ec !important; }

/* "Scan SMS from computer" (phone / tablet app only — smsscan.js) */
.smsscan-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 0 10px; }
.smsscan-btn svg { width: 18px; height: 18px; }
#smsscan-login { display: flex; width: 100%; margin: 14px 0 0; height: 46px; }
@media (max-width: 640px) { #smsscan-home { margin: 10px 0 0; } }

/* ---------- 📲 Send reminders with my phone (smsphone.js, 2026-11-22) ---------- */
.sp-modal .modal-card { width: min(600px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; }
.sp-lead { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 12px; }
.sp-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; background: var(--t-teal-bg); border: 1px solid #b5e6df; border-radius: 10px; font-size: 13px; color: var(--text-secondary); }
.sp-when label { font-weight: 600; color: var(--text-primary); display: inline-flex; align-items: center; gap: 8px; }
.sp-when input { font: inherit; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.sp-list { border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); background: #fff; }
.sp-row:last-child { border-bottom: none; }
label.sp-row { cursor: pointer; }
.sp-row.off { opacity: 0.6; cursor: default; }
.sp-row.warn { background: var(--t-orange-bg); }
.sp-row-main { flex: 1; min-width: 0; }
.sp-row-main strong { display: block; font-size: 14px; }
.sp-row-main span { font-size: 12.5px; color: var(--text-secondary); }
.sp-row-side { font-size: 12.5px; color: var(--text-secondary); text-align: right; }
.sp-row-side em { color: var(--t-orange); font-style: normal; font-weight: 600; }
.sp-row-side em.sp-done { color: var(--t-green); }
.sp-empty { font-size: 13.5px; color: var(--text-tertiary); padding: 10px 0; }
.sp-part { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px; background: var(--t-purple-bg); color: var(--t-purple); font-size: 13px; font-weight: 600; }
.sp-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-paired-line { margin: 10px 0 4px; font-size: 13px; color: var(--text-secondary); }
.sp-h { font-size: 14px; font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.sp-h b { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; align-items: center; justify-content: center; border-radius: 999px; background: var(--t-green); color: #fff; font-size: 12px; }
.sp-checks { display: grid; gap: 6px; }
.sp-check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; }
.sp-check > span:first-child { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.sp-check.ok { background: var(--t-green-bg); }
.sp-check.ok > span:first-child { background: var(--t-green); color: #fff; }
.sp-check.bad { background: var(--t-orange-bg); }
.sp-check.bad > span:first-child { background: var(--t-orange); color: #fff; }
.sp-check-l { flex: 1; }
.sp-hint { background: var(--t-orange-bg); padding: 8px 10px; border-radius: 10px; }
.sp-mini { margin: 10px 0; border: 1px solid var(--border-light); border-radius: 10px; max-height: 40vh; overflow-y: auto; }
.sp-mini div { padding: 8px 10px; border-bottom: 1px solid var(--border-light); }
.sp-mini div:last-child { border-bottom: none; }
.sp-mini strong { display: block; font-size: 13.5px; }
.sp-mini span { font-size: 12.5px; color: var(--text-secondary); }
.sms-box-foot .sp-home-btn { margin-right: auto; float: left; }
.sp-foot { border-top: 1px solid var(--border-light); text-align: left; }
.sp-qr-big { grid-template-columns: 320px minmax(0, 1fr); }
.sp-qr-big .sms-qr-img { width: 320px; height: 320px; }
@media (max-width: 560px) { .sp-qr-big { grid-template-columns: 1fr; } .sp-qr-big .sms-qr-img { width: min(320px, 100%); height: auto; aspect-ratio: 1; } }
/* phone SMS list (2026-11-22, later) */
.sp-lead-strong { font-weight: 600; color: var(--text-primary); background: var(--t-purple-bg); border: 1px solid #dcc6f5; padding: 10px 12px; border-radius: 10px; }
.sp-now { color: var(--t-purple); font-weight: 600; }
.sp-row.sp-confirm { border-left: 4px solid var(--t-green); }
.sp-row.sp-cancel { border-left: 4px solid var(--t-red); }
.sp-drop { background: none; border: 1px solid var(--border-light); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; color: var(--text-tertiary); flex-shrink: 0; }
.sp-drop:hover { color: var(--t-red); border-color: var(--t-red); }
.sp-home-btn b { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; align-items: center; justify-content: center; border-radius: 999px; background: #fff; color: var(--accent); font-size: 11.5px; }
.sp-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9000; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: #13233d; color: #fff; font-size: 14px; line-height: 1.45; box-shadow: var(--shadow-lg); transition: opacity .5s; }
.sp-toast.warn { background: #6b3a00; }
.sp-toast.gone { opacity: 0; }
/* Home: one simple SMS bar (2026-11-22) */
.sms-box.sp-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.sp-bar-text { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.sp-bar-text strong { font-size: 14.5px; color: var(--text-primary); }
.sp-bar-text span { font-size: 12.5px; color: var(--text-secondary); }
.sp-bar-text .sp-bar-warn { display: inline; color: var(--t-orange); font-weight: 600; }
.sp-bar-tpl { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); font-size: 16px; cursor: pointer; }
.sp-bar-tpl:hover { background: var(--bg-subtle); }
/* phone setup guide */
.sp-wiz-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 14px; }
.sp-wiz-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.sp-wiz-dots span.done { background: var(--t-green); }
.sp-wiz-dots span.now { background: var(--accent); width: 22px; border-radius: 4px; }
.sp-wiz-ico, .sp-wiz-done { font-size: 44px; text-align: center; margin: 6px 0; }
.sp-wiz-h { text-align: center; font-size: 19px; margin: 4px 0 12px; }
.sp-wiz-ok { font-size: 13px; color: var(--t-green); font-weight: 700; }
.sp-w-num { margin: 4px 0 6px; }
.sp-setup { display: block; margin-top: 10px; padding: 0; }
/* Terms of use (terms.js): first-time acceptance note in the existing terms window */
.tou-first { float: left; font-size: 13px; font-weight: 600; color: var(--text-secondary); padding-top: 10px; }
/* Login / welcome screens: the app icon (blue bird) instead of the text logo (2026-11-22) */
.login-logo img.login-app-icon { height: clamp(48px, 12.5vh, 112px); width: clamp(48px, 12.5vh, 112px); border-radius: 23%; }
/* Fluid sign-in / welcome screens: everything shrinks smoothly with the window height and width,
   so the card fits without a scroll bar on small windows and is not tiny on big screens (2026-11-22) */
.login-wrap { padding: clamp(8px, 3vh, 32px) 16px; }
.login-card { max-width: clamp(340px, 32vw, 460px); padding: clamp(16px, 4.5vh, 48px) clamp(18px, 4vw, 40px) clamp(14px, 3.5vh, 36px); }
.login-logo { margin-bottom: clamp(6px, 2.4vh, 28px); }
.login-title { font-size: clamp(20px, 3.4vh, 28px); margin-bottom: clamp(2px, 0.6vh, 6px); }
.login-subtitle { margin-bottom: clamp(10px, 3.4vh, 32px); }
.login-card .field { margin-bottom: clamp(8px, 1.8vh, 16px); }
.login-card .field input, .login-card .field select { min-height: clamp(36px, 5.4vh, 44px); }
.login-card .btn-full { min-height: clamp(38px, 5.6vh, 46px); }
.login-footer { margin-top: clamp(10px, 2.4vh, 24px); padding-top: clamp(8px, 2vh, 20px); }
.login-footer > div[style*="margin-bottom"] { margin-bottom: clamp(4px, 1.4vh, 14px) !important; }
/* short windows: Parent / Teacher buttons go side-by-side in one slim row */
@media (max-height: 760px) {
  .login-signup-btn { flex-direction: row; justify-content: center; padding: clamp(6px, 1.2vh, 12px); gap: 8px; }
  .login-signup-btn span { font-size: 18px; }
}
@media (max-height: 620px) {
  .login-footer { font-size: 12px; }
  .login-card .field label { margin-bottom: 3px; }
}
/* Sidebar + phone top bar: the bird app icon with the app name (2026-11-22) */
.sidebar-brand.sb-app { display: flex; align-items: center; gap: 10px; }
.sidebar-brand.sb-app img { height: clamp(34px, 5vh, 42px); width: clamp(34px, 5vh, 42px); border-radius: 23%; flex-shrink: 0; box-shadow: none !important; }
.sb-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sb-name strong { font-size: 14px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-name small { font-size: 11.5px; color: var(--text-tertiary); }
.mt-logo { border-radius: 23%; }
/* Welcome screen (first start): bird icon, fluid, phone-friendly (2026-11-22) */
.welcome-app-icon { width: clamp(56px, 12vh, 96px); height: clamp(56px, 12vh, 96px); border-radius: 23%; margin: 0 auto 12px; display: block; }
#welcome-screen .login-card { max-width: min(760px, 100%) !important; box-sizing: border-box; }
#welcome-screen h1 { font-size: clamp(21px, 3.6vh, 28px) !important; line-height: 1.2; }
@media (max-width: 600px) {
  #welcome-screen.welcome-wrap { padding: 12px !important; justify-content: flex-start !important; }
  #welcome-screen .login-card { padding: 20px 16px !important; }
  #welcome-screen .welcome-features { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; margin-bottom: 18px !important; }
}
/* iPhone slideshow (one SMS code per client) */
.sp-actions { flex-wrap: wrap; }
.sp-timer { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.sp-ring { --p: 1; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--border-light) 0); flex-shrink: 0; }
.sidebar-brand.sb-app { flex-wrap: wrap; row-gap: 6px; }
.sidebar-brand .sb-copy { font-size: 11px; line-height: 1.3; color: var(--text-tertiary); margin-top: 1px; }

/* ============================================================
   CLIENT IDENTITY (2026-11-22) — clientlook.js
   Every client has their own colour (--cc): a bar on the left of
   the card / row, and a ring or tinted tile around the face.
   Children = bright palette, adults = deep palette.
   ============================================================ */
/* cards: white, one coloured bar, no more green/blue washes */
.child-card.cc-on, .child-card.cc-on.is-child, .child-card.cc-on.is-adult {
  background: var(--bg-elevated, #fff); border: 1px solid var(--border-light); border-left: 5px solid var(--cc);
  padding-top: 18px;
}
.child-card.cc-on:hover { border-color: var(--border-light); border-left-color: var(--cc); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); }
.child-card.cc-on::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46px; background: linear-gradient(180deg, var(--cc-soft), rgba(255,255,255,0)); border-radius: 0 var(--radius-lg) 0 0; opacity: .75; pointer-events: none; }
.child-card.cc-on > * { position: relative; }
/* the face: photo or initials, always 58 px, ringed in the client's colour */
.child-card.cc-on > .child-photo-thumb, .child-card.cc-on > .cc-avatar {
  width: 58px; height: 58px; flex: 0 0 58px; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg-elevated, #fff), 0 0 0 5px var(--cc), 0 4px 12px rgba(15, 23, 42, 0.12);
}
.child-card.cc-on > .child-photo-thumb { object-fit: cover; background: var(--cc-soft); }
.cc-avatar {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--cc-soft); color: var(--cc-ink); font-weight: 700; letter-spacing: .02em; user-select: none;
}
.child-card.cc-on > .cc-avatar { font-size: 20px; }
.child-card.cc-on > strong { margin-top: 12px; }
.child-card.cc-on .case-number { margin-left: 0; margin-top: 2px; }

/* Child / Adult label, same everywhere */
.cc-type { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; vertical-align: middle; }
.cc-type.child { background: #e0f2fe; color: #0369a1; }
.cc-type.adult { background: #ede9fe; color: #6d28d9; }
.child-card.cc-on > strong .cc-type { margin-top: 4px; }

/* agenda list: colour bar + tinted initials / ringed photo */
.ag-row.cc-on { box-shadow: inset 4px 0 0 var(--cc); }
.ag-row.cc-on.is-next { box-shadow: inset 4px 0 0 var(--cc), inset 0 0 0 1px #fcd34d; }
.ag-row.cc-on .ag-av { width: 40px; height: 40px; flex: 0 0 40px; }
.ag-row.cc-on .ag-av.cc-initials { background: var(--cc-soft); color: var(--cc-ink); }
.ag-row.cc-on .ag-av.cc-photo { box-shadow: 0 0 0 2px var(--bg-elevated, #fff), 0 0 0 4px var(--cc); background: var(--cc-soft); }
.ag-time.ag-notime { color: var(--text-tertiary); opacity: .6; }

/* Client Directory rows */
#directory-list .dir-row.cc-on { box-shadow: inset 4px 0 0 var(--cc); padding-left: 18px !important; transition: background .12s; }
#directory-list .dir-row.cc-on:hover { background: var(--bg-subtle) !important; }
.cc-dir-face { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; font-size: 15px; }
img.cc-dir-face { object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cc); }
#directory-list .dir-row.cc-on .cc-type { margin-left: 6px; }

/* ---------- SMS: clearer order (2026-11-22) ----------
   Computer: choose the phone once (Android = pair once / iPhone = no pairing), then one main button.
   Phone: ① get the phone ready ② pair once ③ scan reminders. */
.sp-choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 4px 0 10px; }
.sp-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; border: 2px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-elevated); cursor: pointer; font: inherit; color: var(--text-primary); transition: border-color .12s, box-shadow .12s, transform .12s; }
.sp-choice:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.sp-choice.on { border-color: var(--accent); }
.sp-choice .sp-choice-ico { font-size: 30px; line-height: 1; color: inherit; }
.sp-choice strong { font-size: 16px; }
.sp-choice span { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.sp-choice em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; margin-top: 2px; }
.sp-phone-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; margin: 0 0 12px; border-radius: 10px; background: var(--bg-subtle); border: 1px solid var(--border-light); font-size: 13.5px; }
.sp-step { border: 1px solid var(--border-light); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; background: var(--bg-elevated); }
.sp-step.warn { border-left-color: #f59e0b; }
.sp-step p { font-size: 13.5px; color: var(--text-secondary); margin: 6px 0 10px; line-height: 1.5; }
.sp-step-h { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.sp-step-h b { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.sp-step.warn .sp-step-h b { background: #f59e0b; }
.sp-step-h small { font-weight: 500; color: var(--text-tertiary); }
.sp-step .sp-checks { margin: 8px 0 10px; }
.sp-step .sp-setup { width: 100%; }
.sp-big { width: 100%; min-height: 50px; font-size: 16px !important; }
.sp-ok-line { font-size: 13.5px; font-weight: 700; color: #166534; background: #dcfce7; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.sp-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); }

/* ---------- Family accounts: explanation + linking (2026-11-22) ---------- */
.people-intro { position: relative; display: flex; gap: 14px; align-items: flex-start; background: var(--bg-elevated); border: 1px solid var(--border-light); border-left: 4px solid var(--t-pink, #db2777); border-radius: var(--radius-lg); padding: 14px 44px 14px 16px; margin: 0 0 14px; box-shadow: var(--shadow-sm); }
.people-intro .pi-ico { font-size: 28px; line-height: 1; }
.people-intro strong { font-size: 15px; color: var(--text-primary); }
.people-intro p, .people-intro li { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }
.people-intro p { margin: 4px 0; }
.people-intro ul { margin: 2px 0 6px 18px; padding: 0; }
.people-intro .pi-note { font-size: 12.5px; color: var(--text-tertiary); }
.people-intro .pi-x { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-light); background: transparent; color: var(--text-tertiary); cursor: pointer; }
.people-intro.small { cursor: pointer; padding: 10px 44px 10px 14px; align-items: center; }
.people-intro.small p, .people-intro.small ul { display: none; }
.people-intro.small .pi-ico { font-size: 20px; }
.people-intro.small strong::after { content: " — tap to read"; font-weight: 500; color: var(--text-tertiary); font-size: 13px; }
.people-chip { display: inline-flex; align-items: center; gap: 4px; }
.people-chip .chip-x { border: 0; background: transparent; color: inherit; opacity: .55; cursor: pointer; font-size: 11px; padding: 0 0 0 2px; line-height: 1; }
.people-chip .chip-x:hover { opacity: 1; }
.people-modal-lead { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.5; }
.fl-list { display: flex; flex-direction: column; border: 1px solid var(--border-light); border-radius: var(--radius); max-height: 50vh; overflow-y: auto; }
.fl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border-light); }
.fl-row:first-child { border-top: 0; }
.fl-who { display: flex; flex-direction: column; min-width: 0; }
.fl-who strong { font-size: 14.5px; }
.fl-who span { font-size: 12.5px; color: var(--text-tertiary); }
.fl-who em { font-style: normal; color: #b45309; }
.fl-on { font-size: 13px; font-weight: 700; color: #166534; white-space: nowrap; }
/* parent questionnaire: column titles (2026-11-22) */
.survey-row.survey-colhead { border-bottom: 0; padding-bottom: 0; }
.survey-row.survey-colhead > div { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); line-height: 1.15; }
.survey-row.survey-colhead > div small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-tertiary); }

/* ---------- Parent questionnaire for the clinician (2026-11-22) ---------- */
.ca-survey { --tone: var(--t-pink); --tone-bg: var(--t-pink-bg); }
.ag-badge.survey { background: #fce7f3; color: #9d174d; }
.sv-card { max-width: 640px; width: calc(100% - 24px); }
.sv-meta { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.5; }
.sv-box { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--bg-subtle); }
.sv-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: 6px; }
.sv-hard { font-size: 15px; line-height: 1.8; }
.sv-hard small { color: var(--text-secondary); font-size: 12.5px; }
.sv-notes { font-size: 14px; white-space: pre-wrap; margin: 0; color: var(--text-primary); }
.sv-none { font-size: 13.5px; color: var(--text-tertiary); margin: 0; }
.sv-details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; color: var(--accent); }
.sv-table { width: 100%; font-size: 13.5px; margin-top: 6px; }
.sv-table th, .sv-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border-light); }
.sv-table td small { color: var(--text-tertiary); }
.sv-ok { color: #166534; font-weight: 600; } .sv-bad { color: #b91c1c; font-weight: 700; } .sv-na { color: var(--text-tertiary); }
#directory-list .cc-survey.is-new { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; font-weight: 700; }
/* parent note page + clinician window (2026-11-22: notes only, no sound checklist) */
.pn-prev { margin-top: 14px; border-top: 1px solid var(--border-light); padding-top: 10px; }
.pn-prev-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: 6px; }
.pn-prev-n { font-size: 13.5px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px dashed var(--border-light); white-space: pre-wrap; }
.pn-prev-n span { font-weight: 700; color: var(--text-primary); margin-right: 8px; }
#screen-parent-survey #survey-notes { font-size: 16px; line-height: 1.5; }
.sv-scroll { max-height: 60vh; overflow-y: auto; }
.sv-box.is-new { border-color: #f9a8d4; background: #fdf2f8; }
.sv-newtag { background: #db2777; color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; margin-left: 6px; letter-spacing: .04em; }
.pn-keep { font-size: 12.5px; color: var(--text-tertiary); margin: 12px 0 0; }
.sv-keep { font-size: 12.5px; color: var(--text-secondary); background: var(--bg-subtle); border: 1px dashed var(--border); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; line-height: 1.45; }

/* ---------- Therapy setup: the chosen sound and step must be obvious (2026-11-22) ----------
   In Navy Dark the dark colour of the sound buttons covered the "selected" colour → it looked unselected. */
html #therapy-sound-grid .sound-btn.active, html[data-theme] #therapy-sound-grid .sound-btn.active {
  background: var(--accent) !important; color: #fff !important; border: 2px solid var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-ring), 0 4px 12px rgba(0,0,0,0.25) !important; font-weight: 800; transform: scale(1.08); position: relative;
}
html #therapy-sound-grid .sound-btn.active::after { content: "✓"; position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: #16a34a; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg-elevated, #fff); }
html[data-theme="navy"] #therapy-sound-grid .sound-btn.mastered { opacity: .45; border-style: dashed; }
#active-step-btn { box-shadow: 0 0 0 3px currentColor; }
.ts-current { margin-right: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.ts-cur-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
.ts-cur-snd { background: var(--accent); color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 999px; font-size: 15px; }
.ts-cur-step { font-weight: 700; color: var(--text-primary); }
.ts-cur-grp { font-size: 12.5px; color: var(--text-tertiary); }
@media (max-width: 600px) { div:has(> #ts-current) { flex-wrap: wrap; } .ts-current { flex-basis: 100%; margin-bottom: 4px; } .ts-cur-grp { display: none; } }
.sp-row.sp-update { border-left: 4px solid var(--t-purple, #7c3aed); }

/* ============================================================
   SOUND BASELINE (baseline.js) — 2026-11-23
   ============================================================ */
.sb-overlay { z-index: 6500; }
.sb-card { width: min(760px, 96vw); max-width: 96vw; max-height: 94vh; height: auto; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; }
.sb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid #e5e5ea; background: #fff; flex-shrink: 0; }
.sb-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: #1d1d1f; letter-spacing: -0.2px; }
.sb-sub { margin: 2px 0 0; font-size: 13px; color: #6e6e73; }
.sb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 22px; background: #f7f8fb; }
.sb-intro { max-width: 560px; margin: 0 auto 14px; font-size: 15px; line-height: 1.55; color: #3a3a3c; text-align: center; }
.sb-hint { font-size: 13px; color: #6e6e73; margin-top: 6px; }
.sb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ff9500; vertical-align: middle; }
.sb-grid { display: flex; flex-direction: column; gap: 12px; }
.sb-cat-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: #86868b; margin-bottom: 6px; }
.sb-cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-snd { position: relative; min-width: 74px; padding: 10px 12px 8px; border-radius: 12px; border: 1.5px solid #d2d2d7; background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.sb-snd:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: #0071e3; }
.sb-snd-ipa { font-size: 20px; font-weight: 800; color: #1d1d1f; }
.sb-snd-tag { font-size: 10.5px; font-weight: 700; color: #86868b; }
.sb-snd.is-missing { border-color: #ff9500; background: #fff8ee; }
.sb-snd.is-missing .sb-snd-tag { color: #b45309; }
.sb-snd.is-done { border-color: #34c759; background: #effaf2; }
.sb-snd.is-done .sb-snd-tag { color: #1d6b2a; }
.sb-rules { text-align: left; background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 20px 22px; }
.sb-rules h3 { font-size: 18px; font-weight: 800; margin: 0 0 8px; color: #1d1d1f; text-align: center; }
.sb-rules ol { padding-left: 20px; margin: 0 0 16px; }
.sb-rules li { margin: 6px 0; }
.sb-big-ico { font-size: 40px; text-align: center; }
.sb-go { display: block; width: 100%; padding: 14px; font-size: 16px; font-weight: 700; border-radius: 12px; }
/* probe: always fits the window, no scrolling */
.sb-probe { display: flex; flex-direction: column; align-items: stretch; gap: 10px; height: 100%; }
.sb-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #3a3a3c; }
.sb-bar { flex: 1; height: 6px; border-radius: 4px; background: #e5e5ea; overflow: hidden; }
.sb-bar i { display: block; height: 100%; background: linear-gradient(90deg, #0071e3, #34c759); border-radius: 4px; transition: width .25s; }
.sb-pos { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 3px 8px; border-radius: 20px; background: #e8f2fd; color: #0071e3; }
.sb-pic { display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 8px; height: clamp(150px, calc(94vh - 330px), 460px); }
.sb-pic img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; user-select: none; -webkit-user-drag: none; }
.sb-word { text-align: center; font-size: 13px; color: #86868b; letter-spacing: .3px; }
.sb-marks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-ok, .sb-bad { padding: 14px 10px; font-size: 17px; font-weight: 800; border-radius: 14px; border: none; cursor: pointer; color: #fff; transition: transform .1s, filter .1s; }
.sb-ok { background: #34c759; } .sb-bad { background: #ff3b30; }
.sb-ok:hover, .sb-bad:hover { filter: brightness(1.05); transform: translateY(-1px); }
.sb-minor { display: flex; justify-content: space-between; align-items: center; }
.sb-link { background: none; border: none; color: #0071e3; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.sb-err { background: #fff; border: 1.5px solid #ffcdc9; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sb-err-q { font-size: 14px; font-weight: 700; color: #b91c1c; }
.sb-err-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-chip { padding: 10px 14px; border-radius: 10px; border: 1.5px solid #d2d2d7; background: #fafafa; font-size: 15px; font-weight: 700; color: #1d1d1f; cursor: pointer; }
.sb-chip:hover { border-color: #ff3b30; background: #fff1f0; }
.sb-hear { align-self: center; justify-self: center; margin: 4px auto; display: block; }
.sb-syl { text-align: center; font-size: clamp(48px, 11vh, 96px); font-weight: 800; color: #1d1d1f; padding: 18px 0; background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; }
.sb-center { text-align: center; }
.sb-muted { color: #86868b; font-size: 13px; }
/* results */
.sb-results { display: flex; flex-direction: column; gap: 12px; }
.sb-total { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 14px 18px; }
.sb-total-n { font-size: 42px; font-weight: 800; color: #0071e3; line-height: 1; }
.sb-total-n small { font-size: 20px; color: #86868b; }
.sb-total-t { font-size: 15px; color: #3a3a3c; }
.sb-box { background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 12px 16px; }
.sb-box-t { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #86868b; margin-bottom: 6px; }
.sb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 4px 0; font-size: 14px; }
.sb-row-l { color: #3a3a3c; font-weight: 600; }
.sb-row-n { color: #3a3a3c; white-space: nowrap; }
.sb-meter { height: 10px; border-radius: 6px; background: #eef0f3; overflow: hidden; }
.sb-meter i { display: block; height: 100%; border-radius: 6px; }
.sb-meter.ok i { background: #34c759; } .sb-meter.mid i { background: #ff9500; } .sb-meter.low i { background: #ff3b30; }
.sb-note { font-size: 13px; color: #3a3a3c; margin-top: 6px; }
.sb-warn { font-size: 13px; font-weight: 600; color: #b45309; background: #fff4e5; border: 1px solid #ffd699; border-radius: 10px; padding: 8px 12px; }
.sb-phono { font-size: 14px; line-height: 1.5; color: #5b2c00; background: #fff4e5; border: 1.5px solid #ffb340; border-left: 6px solid #ff9500; border-radius: 12px; padding: 12px 14px; }
.sb-rec { background: #fff; border: 1.5px solid #b8d5ec; border-left: 6px solid #0071e3; border-radius: 16px; padding: 14px 16px; }
.sb-rec-t { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #0071e3; margin-bottom: 4px; }
.sb-rec-step { font-size: 20px; font-weight: 800; color: #1d1d1f; margin-bottom: 6px; }
.sb-rec ul { margin: 0 0 12px 18px; font-size: 14px; color: #3a3a3c; line-height: 1.5; }
.sb-rec p { font-size: 14px; color: #3a3a3c; margin-bottom: 10px; }
.sb-rec-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.sb-rec-btns .btn { flex: 1 1 200px; }
/* therapy setup banner */
.sb-banner { display: none; align-items: center; gap: 10px; margin: 12px 32px 0; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; flex-shrink: 0; }
.sb-banner.is-todo { background: #fff4e5; border: 1px solid #ffd699; color: #5b2c00; }
.sb-banner.is-done { background: #eef6ff; border: 1px solid #b8d5ec; color: #1d3d5c; }
.sb-b-ico { font-size: 18px; }
.sb-b-txt { flex: 1; }
.sb-b-btn { padding: 8px 12px; border-radius: 10px; border: none; background: #0071e3; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sb-b-skip { padding: 8px 10px; border-radius: 10px; border: 1px solid #d2d2d7; background: #fff; color: #3a3a3c; font-weight: 600; font-size: 13px; cursor: pointer; }
@media (max-width: 600px) {
  .sb-head { padding: 12px 14px; } .sb-body { padding: 12px 12px 16px; }
  .sb-pic { height: clamp(140px, calc(100dvh - 320px), 420px); }
  .sb-banner { margin: 10px 14px 0; flex-wrap: wrap; }
  .sb-row { grid-template-columns: 1fr 1fr; } .sb-row-n { grid-column: 1 / -1; }
}
.sb-probe.is-err .sb-pic { height: clamp(120px, calc(94vh - 450px), 400px); }
.sb-ctrl { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 600px) { .sb-probe.is-err .sb-pic { height: clamp(110px, calc(100dvh - 470px), 380px); } }
/* short landscape (phones): picture left, buttons right */
@media (max-height: 560px) and (min-width: 600px) {
  .sb-card { max-height: 98vh; border-radius: 16px; }
  .sb-head { padding: 8px 16px; } .sb-head h2 { font-size: 17px; } .sb-sub { display: none; }
  .sb-body { padding: 10px 14px; }
  .sb-probe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 8px; }
  .sb-probe .sb-pic { grid-column: 1; grid-row: 1 / span 3; height: calc(98vh - 90px); }
  .sb-probe.is-err .sb-pic { height: calc(98vh - 90px); }
  .sb-probe .sb-progress { grid-column: 2; grid-row: 1; }
  .sb-probe .sb-word { grid-column: 2; grid-row: 2; }
  .sb-probe .sb-ctrl { grid-column: 2; grid-row: 3; align-self: start; }
  .sb-probe .sb-ok, .sb-probe .sb-bad { padding: 12px 8px; }
  .sb-chip { padding: 8px 10px; font-size: 14px; }
  .sb-stim .sb-syl { grid-column: 1; grid-row: 1 / span 3; display: flex; align-items: center; justify-content: center; }
  .sb-stim > p { grid-column: 2; }
  .sb-stim .sb-hear, .sb-stim .sb-marks { grid-column: 2; }
}
.sb-banner.is-block { background: #ffeceb; border: 1px solid #ffb4ae; color: #7a1c14; }
.sb-banner.is-skip { background: #f2f2f5; border: 1px solid #d2d2d7; color: #3a3a3c; }
#therapy-setup-modal button.sb-locked, #therapy-setup-modal button.sb-locked:hover { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; }
.sb-info { position: relative; align-self: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; border: 1.5px solid #0071e3; background: #fff; color: #0071e3; font: italic 700 14px/1 Georgia, "Times New Roman", serif; cursor: help; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sb-tip { display: none; position: absolute; bottom: calc(100% + 10px); right: -8px; width: min(340px, 86vw); text-align: left; font: 400 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #1d1d1f; background: #fff; border: 1px solid #d2d2d7; border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); z-index: 20; cursor: default; }
.sb-tip strong { display: block; font-size: 14px; margin-bottom: 6px; }
.sb-tip-p { display: block; margin-top: 6px; } .sb-tip b { color: #0071e3; }
.sb-tip small { display: block; margin-top: 8px; color: #6e6e73; font-size: 12px; }
.sb-info:hover .sb-tip, .sb-info:focus .sb-tip, .sb-info.open .sb-tip { display: block; }
@media (max-width: 600px) {
  .sb-banner .sb-b-txt { flex: 1 1 calc(100% - 40px); }
  .sb-banner .sb-b-btn, .sb-banner .sb-b-skip { flex: 1 1 auto; padding: 10px 12px; }
}

/* Sound Baseline — listening check cards + report (2026-11-27) */
.sb-lcards { display: flex; gap: clamp(10px, 3vw, 28px); justify-content: center; align-items: center; margin: 6px 0; }
.sb-listen .mp-card { position: relative; width: min(38vw, 250px, 40vh); height: min(38vw, 250px, 40vh); border-radius: 16px; background: #fff; border: 3px solid #d2d2d7; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; padding: 0; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.sb-listen .mp-card img { width: 100%; height: 100%; object-fit: contain; display: none; }
.sb-listen .mp-card.has-pic img { display: block; }
.sb-listen .mp-card.has-pic .w, .sb-listen .mp-card.has-pic .ipa { display: none; }
.sb-listen .mp-card .w { font-weight: 800; font-size: 28px; color: #1d1d1f; }
.sb-listen .mp-card .ipa { font-size: 12px; color: #86868b; }
.sb-listen .mp-card:active { border-color: #0071e3; }
.sb-rep-pos { margin: 6px 0; line-height: 2; }
.sb-rep-w { display: inline-block; margin: 0 6px 4px 0; padding: 2px 8px; border-radius: 10px; font-size: 13px; background: #f2f2f5; color: #1d1d1f; }
.sb-rep-w em { font-style: normal; font-weight: 700; margin-left: 4px; }
.sb-rep-w.ok { background: #e9f9ee; } .sb-rep-w.ok em { color: #1a7f37; }
.sb-rep-w.bad { background: #fff0ef; } .sb-rep-w.bad em { color: #c62828; }
.sb-rep-w.skip { color: #86868b; }
@media (max-height: 560px) and (min-width: 600px) {
  .sb-listen .sb-lcards { grid-column: 1; grid-row: 1 / span 3; }
  .sb-listen .sb-minor, .sb-listen > p { grid-column: 2; }
}
