:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #16181d;
  --muted: #667085;
  --border: #e3e6eb;
  --accent: #0f766e;
  --accent-hover: #0d645d;
  --accent-soft: #e6f4f2;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --warn: #a15c07;
  --warn-soft: #fff4e0;
  --ok: #1a7f37;
  --ok-soft: #e8f5ec;
  --info: #1d5fbf;
  --info-soft: #e8f0fc;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.18);
  --radius: 10px;
  --sidebar: 224px;
  color-scheme: light;
}

/* Dark: follows the device unless the person chose Light or Dark (Settings → Account). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1d2024;
    --surface-2: #262a2f;
    --text: #eceef1;
    --muted: #9aa2ad;
    --border: #30353c;
    --accent: #2bb3a3;
    --accent-hover: #3cc4b4;
    --accent-soft: #173a37;
    --danger: #ff6b6b;
    --danger-soft: #3a1f21;
    --warn: #f0b35a;
    --warn-soft: #3a2d17;
    --ok: #57c77a;
    --ok-soft: #1a3323;
    --info: #7aa7ff;
    --info-soft: #1c2a42;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1d2024;
  --surface-2: #262a2f;
  --text: #eceef1;
  --muted: #9aa2ad;
  --border: #30353c;
  --accent: #2bb3a3;
  --accent-hover: #3cc4b4;
  --accent-soft: #173a37;
  --danger: #ff6b6b;
  --danger-soft: #3a1f21;
  --warn: #f0b35a;
  --warn-soft: #3a2d17;
  --ok: #57c77a;
  --ok-soft: #1a3323;
  --info: #7aa7ff;
  --info-soft: #1c2a42;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
[hidden] { display: none !important; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Buttons & inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 28px; padding: 3px 9px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }
.pill svg { width: 12px; height: 12px; margin-right: 3px; }

input, select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); }
label.field { display: flex; flex-direction: column; gap: 4px; }
label.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
label.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Layout ---------- */

.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; }
.brand img { width: 28px; height: 28px; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .me { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--border); }
.sidebar .me div { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    width: auto;
    height: auto;
    flex-direction: row;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--border);
  }
  .brand, .sidebar .me { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; flex: 1; }
  main { padding: 16px 16px 90px; }
}

/* ---------- Cards, tables, pills ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.card > header h2 { margin-right: auto; }
.card .body { padding: 16px; }
.card .empty { padding: 20px 16px; color: var(--muted); text-align: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.list .item:hover { background: var(--surface-2); text-decoration: none; }
.list .item .main { flex: 1; min-width: 0; }
.list .item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .time { width: 64px; flex: none; font-variant-numeric: tabular-nums; color: var(--muted); }
.swatch-bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--surface-2); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.alert {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 500;
}
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- Dialogs ---------- */

dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.wide { width: min(760px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 12, 16, 0.45); }
/* Sending forms: everything behind is greyed right out, so the focus is on the family's link. */
dialog.black::backdrop { background: #000; }
dialog.dim::backdrop { background: rgba(10, 12, 16, 0.72); backdrop-filter: blur(3px) grayscale(1); -webkit-backdrop-filter: blur(3px) grayscale(1); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 42px); }
dialog header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
dialog header h2 { margin-right: auto; }
dialog .content { padding: 18px; overflow-y: auto; }
dialog footer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.form-error { color: var(--danger); font-weight: 500; }

/* ---------- Combobox ---------- */

.combo { position: relative; }
.combo .options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.combo .options li { padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.combo .options li.active, .combo .options li:hover { background: var(--accent-soft); }

/* ---------- Toasts ---------- */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #1f2328;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.toast.error { background: #9b1c22; }
@media (max-width: 820px) { .toasts { left: 16px; bottom: 80px; } }

/* ---------- Auth ---------- */

.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth .card { width: min(400px, 100%); }
.auth .body { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.auth h1 { display: flex; align-items: center; gap: 10px; }
.auth h1 img { width: 32px; }

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

.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar h1 { font-size: 18px; margin: 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { padding: 6px 12px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent-soft); color: var(--accent); }

.cal {
  --hour: 64px;
  display: grid;
  grid-template-columns: 56px repeat(var(--days), minmax(110px, 1fr));
  overflow: auto;
  max-height: calc(100vh - 150px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  user-select: none;
  -webkit-user-select: none;
}
.cal .corner, .cal .day-head, .cal .staff-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
}
.cal .corner { left: 0; z-index: 4; }
.cal .day-head.today { color: var(--accent); }
.cal .day-head small { display: block; font-weight: 500; color: var(--muted); }
.cal .hours { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--border); }
.cal .hours div { height: var(--hour); padding: 0 6px; font-size: 11px; color: var(--muted); text-align: right; transform: translateY(-7px); }
.cal .col {
  position: relative;
  border-left: 1px solid var(--border);
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2);
  cursor: cell;
}
.cal .col.today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cal .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal .now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.appt {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 6px;
  border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}
.appt:hover { box-shadow: var(--shadow); }
.appt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt span { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt.cancelled, .appt.dna { opacity: 0.55; }
.appt.cancelled b { text-decoration: line-through; }
.appt.completed { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.appt.dragging { opacity: 0.85; z-index: 5; box-shadow: var(--shadow-lg); }
.appt .flags { position: absolute; right: 4px; top: 3px; display: flex; gap: 3px; }
.appt .flags i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.appt .flags i.ok { background: var(--ok); }
.appt.short { display: flex; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.appt.short b { flex: 0 1 auto; min-width: 0; }
.appt.short span { flex: 1 1 0; min-width: 0; }

/* ---------- Notes ---------- */

.note-section { display: flex; flex-direction: column; gap: 6px; }
.note-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.note-section textarea { min-height: 110px; font-size: 15px; }
.note-section .text { font-size: 15px; white-space: pre-wrap; }
.addendum { padding: 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 8px 8px 0; }

/* ---------- Invoice document ---------- */

.invoice-doc { padding: 32px; }
.invoice-doc .top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.invoice-doc h1 { font-size: 26px; }
.invoice-doc .meta { display: grid; grid-template-columns: auto auto; gap: 2px 16px; align-content: start; }
/* Numbers stay on one line (INV-1026 never breaks at the hyphen). */
.invoice-doc .meta > * { white-space: nowrap; }
.inv-number { white-space: nowrap; }
.invoice-doc .totals { margin-left: auto; width: min(320px, 100%); margin-top: 12px; }
.invoice-doc .totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.invoice-doc .totals .grand { border-top: 2px solid var(--text); margin-top: 4px; padding-top: 8px; font-weight: 700; font-size: 16px; }
.items-edit td { padding: 6px; }
.items-edit input { padding: 5px 8px; }

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .page-head, .no-print, .toasts { display: none !important; }
  main { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .invoice-doc { padding: 0; }
  :root { --text: #000; --muted: #555; --border: #ccc; --surface: #fff; --surface-2: #f3f3f3; }
}

/* ---------- Notebooks library ---------- */

.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 18px; }
.nb-card { min-width: 0; }
.nb-cover {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1.3;
  border-radius: 4px 12px 12px 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25) 0 7%, rgba(255,255,255,0.12) 7.5%, transparent 9%), var(--cover);
  box-shadow: var(--shadow);
}
.nb-cover:hover { text-decoration: none; filter: brightness(1.05); }
.nb-cover span {
  position: absolute; left: 18%; right: 10%; top: 18%;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.92); color: #1c1c1e;
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nb-meta { display: flex; align-items: flex-start; gap: 4px; margin-top: 8px; }
.nb-meta > div { flex: 1; min-width: 0; }
.nb-meta .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-choice { width: 34px; height: 44px; border: 0; border-radius: 3px 8px 8px 3px; background: var(--cover); cursor: pointer; }
.cover-choice.selected, .paper-choice.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.paper-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.paper-choice {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
}
.paper-choice canvas { width: 52px; height: 72px; border-radius: 3px; box-shadow: 0 0 0 1px var(--border); }

/* ---------- Handwriting editor (full screen) ---------- */

.ink-editor {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.ink-toolbar {
  flex: none;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
}
.ink-row { display: flex; align-items: center; gap: 2px; padding: 4px 8px; }
.ink-icon {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); cursor: pointer;
}
.ink-icon:hover { background: var(--surface-2); text-decoration: none; }
.ink-icon:disabled { opacity: 0.3; background: transparent; cursor: default; }
.ink-icon svg, .ink-tool svg { width: 22px; height: 22px; }
.ink-heading { flex: 1; min-width: 0; margin: 0 6px; }
.ink-title {
  width: 100%; padding: 3px 6px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; font-weight: 600; font-size: 16px;
}
.ink-title:focus { border-color: var(--border); background: var(--bg); outline: none; }
.ink-title:disabled { background: transparent; color: var(--text); }
.ink-sub { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.ink-client { font-weight: 600; }
.ink-alert { color: var(--danger); }
.ink-status.warn { color: var(--warn); font-weight: 600; }
.ink-locked { display: flex; align-items: center; gap: 6px; padding: 6px 16px 10px; color: var(--muted); font-size: 13px; }
.ink-locked svg { width: 14px; height: 14px; }
.ink-tools { justify-content: flex-start; gap: 10px; padding: 2px 8px 8px; overflow-x: auto; scrollbar-width: none; }
.ink-tools::-webkit-scrollbar { display: none; }
.ink-tools > :first-child { margin-left: auto; }
.ink-tools > :last-child { margin-right: auto; }
.ink-group { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 12px; background: var(--bg); flex: none; }
.ink-tool {
  display: grid; place-items: center; width: 38px; height: 36px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer;
}
.ink-tool.active, .ink-size.active { background: var(--accent-soft); color: var(--accent); }
.ink-swatch { position: relative; display: grid; place-items: center; width: 32px; height: 36px; border: 0; background: transparent; cursor: pointer; }
.ink-swatch span { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px var(--border); }
.ink-swatch.active span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.ink-swatch.custom span { background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); }
.ink-swatch.custom.active span { background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.ink-picker { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ink-size { display: grid; place-items: center; width: 34px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; }
.ink-size span { border-radius: 50%; background: currentColor; }

.ink-scroller {
  position: relative;
  flex: 1;
  overflow: auto;
  background: color-mix(in srgb, var(--bg) 70%, #8a8f98 30%);
  touch-action: none;
  overscroll-behavior: contain;
}
.ink-pages {
  --page-w: 800px;
  --gap: 24px;
  display: flex; flex-direction: column; align-items: center; gap: var(--gap);
  width: max-content; min-width: 100%;
  padding: var(--gap) 16px calc(var(--gap) + 60px + env(safe-area-inset-bottom, 0px));
}
.ink-page {
  position: relative;
  width: var(--page-w);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 6px 20px rgba(0, 0, 0, 0.08);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ink-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ink-page canvas.live.multiply { mix-blend-mode: multiply; }
.ink-sel { position: absolute; z-index: 2; outline: 2px solid var(--accent); outline-offset: 1px; pointer-events: none; }
.ink-sel-del, .ink-sel-handle { position: absolute; pointer-events: auto; touch-action: none; }
.ink-sel-del {
  top: -14px; right: -14px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: 18px; line-height: 28px; cursor: pointer;
}
.ink-sel-handle {
  right: -16px; bottom: -16px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); cursor: nwse-resize;
}
.ink-indicator {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  padding: 5px 12px; border-radius: 999px; background: rgba(28, 28, 30, 0.72); color: #fff;
  font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.ink-menu {
  position: fixed; z-index: 60; min-width: 230px; max-width: calc(100vw - 16px); padding: 6px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.ink-menu button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.ink-menu button:hover { background: var(--surface-2); }
.ink-menu button.danger { color: var(--danger); }
.ink-menu .check { color: var(--accent); font-weight: 700; }
.ink-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.ink-menu-heading { padding: 8px 10px 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Finalised handwritten note, shown read-only on the note page */
.hw-pages { display: flex; flex-direction: column; gap: 16px; }
.hw-page { width: 100%; max-width: 820px; background: #fff; box-shadow: 0 0 0 1px var(--border); display: grid; place-items: center; color: #667085; }
.hw-img { width: 100%; height: 100%; display: block; }

#inkPrint { display: none; }
@media print {
  body.ink-printing > *:not(#inkPrint) { display: none !important; }
  body.ink-printing #inkPrint { display: block; }
  #inkPrint img { display: block; width: 100%; break-after: page; page-break-after: always; }
  #inkPrint img:last-child { break-after: auto; page-break-after: auto; }
}

/* ---------- Logos ---------- */

.brand.has-logo { padding: 6px 8px 16px; }
.brand.has-logo img { width: 100%; height: auto; max-height: 64px; object-fit: contain; object-position: left center; padding: 8px 10px; border-radius: 10px; background: #fff; }
.auth-logo { display: block; max-width: 280px; max-height: 110px; width: auto; margin: 0 auto 4px; padding: 10px 14px; border-radius: 12px; background: #fff; }
.logo-preview { display: grid; place-items: center; width: 200px; height: 90px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; flex: none; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.empty { color: #8a8f98; font-size: 13px; }
.brand-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.invoice-doc .issuer { display: flex; flex-direction: column; gap: 2px; }
.invoice-doc .pay-online { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; }
.invoice-doc .pay-qr { flex: none; width: 104px; height: 104px; }
.invoice-doc .pay-qr svg { width: 100%; height: 100%; display: block; }
.invoice-doc .pay-link { word-break: break-all; font-size: 13px; }
.invoice-logo { max-width: 300px; max-height: 110px; object-fit: contain; object-position: left top; margin-bottom: 10px; }
@media (max-width: 820px) { .logo-preview { width: 160px; } }

/* ---------- Enquiries ---------- */
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.lead-row { display: flex; flex-direction: column; gap: 1px; }
.lead-row .muted { font-size: 12px; font-weight: 600; }
@media (max-width: 560px) { .lead-grid { grid-template-columns: 1fr; } }
textarea.code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Xero, phone links ---------- */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps code, .row code { padding: 2px 6px; border-radius: 5px; background: var(--surface-2); font-size: 12px; word-break: break-all; }
.xero-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13px; }
.xero-bar.error { background: var(--danger-soft); color: var(--danger); }
a.tel { white-space: nowrap; }

/* ---------- Previews (mock-ups) ---------- */
.preview-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.cal-views { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-views .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.chip { padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip .star { color: #d9a300; }
.cal.team { grid-template-columns: 56px repeat(var(--days), minmax(170px, 1fr)); }
.cal .staff-head { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; overflow: hidden; }
.cal .staff-head .who { min-width: 0; flex: 1; }
.cal .staff-head b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .staff-head small { display: block; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .staff-head.you { box-shadow: inset 0 -3px 0 var(--accent); }
.you-badge { padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.cal .col.you { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cal .col.sample { cursor: default; }
.appt.sample { cursor: default; }
.appt.travel { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); border-left-color: #94a3b8; color: var(--muted); cursor: default; }
.appt.travel b { font-weight: 600; }
.travel-box { display: flex; flex-direction: column; gap: 6px; }
.travel-line { font-size: 14px; }
.appt.away b, .appt.away span { display: block; white-space: normal; overflow-wrap: normal; text-overflow: clip; }
.appt .appt-car, .appt.away .appt-car, .appt-car { float: left; display: inline-flex; flex: none; width: auto; overflow: visible; margin: 1px 4px 0 0; color: var(--muted); }
.appt.short .appt-car { float: none; margin: 0; flex: none; }
.appt-car svg { width: 16px; height: 16px; }
.travel-line .appt-car { float: none; vertical-align: -2px; margin: 0; }
.appt.short .appt-car svg { width: 14px; height: 14px; }
.appt.clash { outline: 2px solid var(--danger); outline-offset: -1px; z-index: 2; }
.appt.block { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); color: var(--muted); }

.staff-picker { position: relative; }
.staff-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.staff-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.staff-row:hover { background: var(--surface-2); }
.staff-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.staff-row small { display: block; color: var(--muted); font-size: 12px; }
.staff-row.locked { cursor: default; }

.mail { display: grid; grid-template-columns: 180px minmax(240px, 340px) 1fr; min-height: 540px; overflow: hidden; }
.mail-folders { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; border-right: 1px solid var(--border); }
.mail-box { padding: 2px 10px 10px; word-break: break-all; }
.mail-folder { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.mail-folder.active { background: var(--accent-soft); color: var(--accent); }
.mail-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 640px; }
.mail-search { position: sticky; top: 0; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.mail-item { display: block; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.active { background: var(--accent-soft); }
.mail-item .top { display: flex; gap: 8px; align-items: baseline; }
.mail-item .from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item.unread .from { font-weight: 700; }
.mail-item.unread .from::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.mail-filters { gap: 6px; margin: 0 0 12px; align-items: center; flex-wrap: wrap; }
@media (max-width: 500px) { .mail-filters { flex-wrap: nowrap; } .mail-filters-label { display: none; } .mail-filters .chip { white-space: nowrap; } }
.mail-kind { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; vertical-align: 1px; background: var(--surface-2); color: var(--muted); }
.mail-kind.reply { background: var(--accent-soft); color: var(--accent); }
.mail-item .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mail-item .subj { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .snip { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-reader { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; overflow-y: auto; max-height: 640px; }
.mail-reader h2 { font-size: 19px; }
.mail-match { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.mail-body { max-width: 65ch; }
.mail-back { display: none; }
.mail-answering summary, .mail-thread summary, .mail-quoted summary { cursor: pointer; }
.mail-answering { display: block; }
.mail-thread { border-top: 1px solid var(--border); padding-top: 10px; }
.mail-thread-item { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.mail-thread-item.out { margin-left: 24px; background: var(--accent-soft); }
.mail-reply { border-top: 1px solid var(--border); padding-top: 14px; }
.mail-reply .row { flex-wrap: wrap; gap: 8px; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.email-conv > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; }
.email-conv .email-dir { font-size: 12px; color: var(--muted); width: 100%; }
.email-conv.in { border-left: 3px solid var(--accent); }
.email-conv .body { padding: 0 14px 14px; }
.mail-attach { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.mail-attach .pdf { display: grid; place-items: center; width: 32px; height: 38px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-size: 10px; font-weight: 700; }
@media (max-width: 900px) {
  .mail { grid-template-columns: 1fr; min-height: 0; align-content: start; }
  .mail-folders { flex-direction: row; align-items: center; gap: 4px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .mail-folder { flex: none; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 14px; }
  .mail-folder span:empty { display: none; }
  .mail-folder span { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
  .mail-search { padding: 8px; }
  .mail-item { padding: 9px 12px; }
  .mail.reading .mail-folders, .mail.reading .mail-list { display: none; }
  .mail:not(.reading) .mail-reader { display: none; }
  .mail:not(.reading) .mail-list { max-height: none; border-bottom: 0; }
  .mail-back { display: block; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--accent); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
  .mail-box { display: none; }
  .mail-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--border); }
  .mail.reading .mail-list { max-height: 180px; }
  .mail-reader { max-height: none; padding: 16px; }
}
.recip { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.recip > input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.recip .who { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.recip .who > b { display: inline; }
.recip small { color: var(--muted); }
.recip .warn-text { color: var(--warn); }


.invoice-plan { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.invoice-plan.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: var(--ok-soft); }
.invoice-plan small { color: var(--muted); }
.invoice-plan .check { align-items: flex-start; }
.invoice-plan .check input { margin-top: 3px; }
div.field { display: flex; flex-direction: column; gap: 4px; }
div.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- Navigation: phone bottom bar with "More" ---------- */
.nav-more { display: none; }
@media (max-width: 820px) {
  .nav a.secondary { display: none; }
  .nav a, .nav-more { flex: 1; min-width: 0; font-size: 11px; }
  .nav-more {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px;
    border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer;
  }
  .nav-more svg { width: 18px; height: 18px; }
  .nav-more.active { background: var(--accent-soft); color: var(--accent); }
}
.more-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(10, 12, 16, 0.3); }
.more-sheet {
  position: fixed; left: 8px; right: 8px; z-index: 26;
  bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.more-sheet a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text); font-weight: 500; }
.more-sheet a:hover { background: var(--surface-2); text-decoration: none; }
.more-sheet a.active { background: var(--accent-soft); color: var(--accent); }
.more-sheet svg { width: 20px; height: 20px; }
.more-me { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px; margin-top: 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
html { -webkit-tap-highlight-color: transparent; }
.nav-more[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }

/* ---------- Calendar: one scroll area (the calendar grid), not the page as well ---------- */
.cal-page { display: flex; flex-direction: column; height: calc(100vh - 72px); } /* main's top + bottom padding */
.cal-page .cal { flex: 1; min-height: 0; max-height: none; grid-template-rows: max-content max-content; } /* headings never shrink */
@media (max-width: 820px) {
  .cal-page {
    display: flex; flex-direction: column;
    height: calc(100vh - 106px - env(safe-area-inset-bottom, 0px));   /* main's top padding + bottom menu */
    height: calc(100dvh - 106px - env(safe-area-inset-bottom, 0px));
  }
  .cal-page .cal { flex: 1; min-height: 0; max-height: none; }
  .cal-toolbar { gap: 6px; margin-bottom: 8px; }
  .cal-toolbar h1 { order: -1; width: 100%; margin: 0 0 2px; font-size: 16px; }
  .cal-toolbar input[type="date"] { display: none; }
  .cal-toolbar .spacer { display: none; }
  .cal-page .preview-banner { margin-bottom: 8px; padding: 6px 10px; font-size: 12px; }
  .cal-views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
  .cal-views::-webkit-scrollbar { display: none; }
  .cal-views > * { flex: none; }
  .cal-views .spacer { display: none; }
}

/* Phones: every column fits across the screen (no sideways scrolling), and the page doesn't scroll. */
@media (max-width: 820px) {
  body.cal-locked { overflow: hidden; overscroll-behavior: none; }
  .cal-page .cal, .cal-page .cal.team { grid-template-columns: 42px repeat(var(--days), minmax(0, 1fr)); overflow-x: hidden; overscroll-behavior: contain; }
  .cal .hours div { padding: 0 4px; font-size: 10px; }
  .cal .day-head { padding: 6px 2px; font-size: 12px; }
  .cal .day-head small { font-size: 10px; }
  .cal .appt { padding: 2px 4px; font-size: 11px; border-left-width: 2px; }
  .cal .appt .flags { display: none; }
  .cal .staff-head { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px; text-align: center; }
  .cal .staff-head .avatar { width: 26px; height: 26px; font-size: 11px; }
  .cal .staff-head .who { width: 100%; }
  .cal .staff-head b { font-size: 11px; }
  .cal .staff-head small { display: none; }
  .cal .staff-head .you-badge { font-size: 9px; padding: 0 5px; }
}
@media (max-width: 820px) { body.cal-locked main { padding-bottom: 0; } }

/* Calendar full screen (computers) */
body.cal-full .sidebar { display: none; }
body.cal-full main { padding: 12px 16px; }
body.cal-full .cal-page { height: calc(100vh - 24px); }
@media (max-width: 820px) { .desk-only { display: none !important; } }

/* ---------- Mock-ups ---------- */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
/* Icon and title on one row; the description and Preview tag run full width underneath. */
.p-feature { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-items: center; gap: 8px 12px; padding: 16px; color: var(--text); }
.p-feature > :not(.p-icon, b) { grid-column: 1 / -1; }
.p-feature:hover { text-decoration: none; border-color: var(--accent); }
.p-feature .pill { justify-self: start; align-self: end; }
.p-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.p-icon svg { width: 20px; height: 20px; }
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.p-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.p-stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.p-note { color: var(--muted); }
.p-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .p-two { grid-template-columns: 1fr; } }
.p-phone { display: flex; flex-direction: column; gap: 10px; max-width: 360px; width: 100%; margin: 0 auto; padding: 18px 16px; border: 8px solid #1f2328; border-radius: 30px; background: var(--surface); }
.p-phone-head { display: flex; flex-direction: column; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.p-step { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.p-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-choice { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.p-choice span { font-size: 12px; color: var(--muted); }
.p-choice.on { box-shadow: 0 0 0 2px var(--accent); }
.p-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.p-slot { padding: 8px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.p-slot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.p-slot.taken { text-decoration: line-through; opacity: .45; cursor: default; }
.p-rules { display: flex; flex-direction: column; gap: 8px; }
.p-journey { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.p-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.p-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.p-rows { display: flex; flex-direction: column; gap: 10px; }
.p-sigpad { display: grid; place-items: end start; height: 110px; padding: 8px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg); }
.p-sign { display: flex; flex-direction: column; gap: 10px; }
.p-budget { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.p-budget .used { background: var(--accent); }
.p-budget .booked { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.key.used { background: var(--accent); }
.key.booked { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.key.left { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.p-ai { display: flex; flex-direction: column; gap: 14px; }
.p-ai-rec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.p-recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); }
@media (prefers-reduced-motion: no-preference) { .p-recdot { animation: p-pulse 1.4s infinite; } }
@keyframes p-pulse { 50% { opacity: .35; } }
.p-ai-draft { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.p-cardfile { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.p-video { display: flex; flex-direction: column; gap: 10px; }
.p-video-main { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 14px; background: linear-gradient(135deg, #2b3a48, #1d2530); color: #cfd8e3; }
.p-video-self { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 28%; aspect-ratio: 4 / 3; border-radius: 10px; background: #3b4a59; color: #e2e8f0; font-size: 12px; }
/* charts */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .value { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: color-mix(in srgb, var(--accent) 80%, var(--text)); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; cursor: default; }
.chart .target { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); padding: 5px 9px; border-radius: 8px; background: #1f2328; color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; color: var(--text); }
.chart-wrap { max-width: 900px; }
.line-wrap { max-width: 720px; }
.p-group { font-size: 15px; margin: 20px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Speech therapy previews ---------- */
.ts { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .ts { grid-template-columns: 1fr; } }
.ts-tabs { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 820px) { .ts-tabs { flex-direction: row; overflow-x: auto; } .ts-tab { min-width: 200px; } }
.ts-tab { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ts-tab span { font-size: 12px; color: var(--muted); }
.ts-tab.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.ts-panel { display: flex; flex-direction: column; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ts-title { font-size: 17px; }
.ts-big { display: flex; flex-direction: column; gap: 10px; }
.ts-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ts-score b { font-size: 44px; line-height: 1; }
.ts-meter { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); }
.ts-meter span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); transition: width .2s; }
.ts-meter i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .5; }
.ts-dots { display: flex; flex-wrap: wrap; gap: 5px; min-height: 14px; }
.ts-dot { width: 14px; height: 14px; border-radius: 50%; }
.ts-dot.C { background: var(--ok); }
.ts-dot.X { background: var(--danger); }
.ts-dot.P { background: var(--warn); }
.ts-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ts-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 8px; border: 0; border-radius: 16px; font: inherit; font-size: 34px; font-weight: 700; color: #fff; cursor: pointer; touch-action: manipulation; }
.ts-btn span { font-size: 14px; font-weight: 600; }
.ts-btn:active { transform: scale(.97); }
.ts-btn.yes { background: #1a7f37; }
.ts-btn.no { background: #b42318; }
.ts-btn.cue { background: #9a5b0b; }
.sa { display: flex; flex-direction: column; gap: 4px; }
.sa-axis, .sa-row { display: grid; grid-template-columns: 110px 1fr 130px; align-items: center; gap: 10px; }
.sa-axis { position: sticky; top: 0; padding-bottom: 18px; }
.sa-scale { position: relative; height: 20px; border-bottom: 1px solid var(--border); }
.sa-scale > span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.sa-now { position: absolute; top: 20px; transform: translateX(-50%); font-style: normal; }
.sa-now b { display: inline-block; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; white-space: nowrap; }
.sa-row { padding: 3px 0; border-radius: 8px; }
.sa-row.flag { background: var(--warn-soft); }
.sa-sound { padding-left: 6px; font-size: 13px; white-space: nowrap; }
.sa-sound b { display: inline-block; min-width: 22px; }
.sa-track { position: relative; height: 14px; }
.sa-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.sa-now-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); }
.sa-row .pill { justify-self: start; }
@media (max-width: 600px) { .sa-axis, .sa-row { grid-template-columns: 70px 1fr 96px; gap: 6px; } .sa-sound .muted { display: none; } .sa-row .pill { font-size: 11px; padding: 1px 6px; } }
.sa-scale > span { white-space: nowrap; } .sa-scale > span:nth-child(6) { transform: translateX(-100%); }
.wave { display: flex; align-items: center; gap: 2px; height: 70px; padding: 6px 0; }
.wave span { flex: 1; min-width: 2px; border-radius: 2px; background: var(--accent); opacity: .75; }
.rec-timeline { display: flex; flex-direction: column; gap: 8px; }
.rec-step { display: grid; grid-template-columns: 40px 1fr 44px; align-items: center; gap: 10px; }
.rec-bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--accent); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lib-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; min-height: 170px; }
.bingo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 440px; }
.bingo.memory { grid-template-columns: repeat(4, 1fr); }
.bingo-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; aspect-ratio: 1; border: 2px solid var(--border); border-radius: 12px; background: #fff; color: #1c1c1e; font-weight: 600; font-size: 13px; }
.bingo-cell .pic { font-size: 30px; line-height: 1; }
.p-phone.fam { gap: 12px; }
.fam-streak { display: flex; flex-direction: column; gap: 8px; }
.fam-stickers { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.fam-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--surface-2); min-height: 48px; }
.fam-day.done { background: var(--warn-soft); }
.fam-day span { font-size: 18px; line-height: 1.2; min-height: 22px; }
.fam-day small { font-size: 11px; color: var(--muted); }
.fam-stage { display: flex; flex-direction: column; gap: 12px; }
.fam-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.fam-card.today { background: var(--accent-soft); }
.fam-go { margin-top: 6px; padding: 12px; font-size: 16px; }
.fam-list { display: flex; flex-direction: column; gap: 8px; }
.fam-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.fam-list small { font-weight: 400; color: var(--muted); }
.fam-progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fam-progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.fam-flash { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 12px; border-radius: 18px; background: #fff; color: #1c1c1e; box-shadow: inset 0 0 0 2px var(--border); }
.fam-pic { font-size: 84px; line-height: 1; }
.fam-flash b { font-size: 30px; }
.fam-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fam-btns .ts-btn { padding: 16px 8px; font-size: 28px; }
.fam-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; text-align: center; }
.fam-star { font-size: 72px; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .fam-star { animation: fam-pop .5s ease-out; } }
@keyframes fam-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.report { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .report { grid-template-columns: 1fr; } }
.report-doc { display: flex; flex-direction: column; gap: 10px; padding: 32px 36px; border-radius: 6px; background: #fff; color: #1c1c1e; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08); }
.report-doc h2 { font-size: 20px; margin-top: 8px; }
.report-doc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #555; margin-top: 10px; }
.report-doc p { margin: 0; max-width: 70ch; line-height: 1.55; }
.report-doc .muted { color: #666; }
.report-doc table th { background: #f3f4f6; color: #555; }
.report-doc .chart .grid { stroke: #e5e7eb; } .report-doc .chart .axis { fill: #666; } .report-doc .chart .value { fill: #1c1c1e; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid #1c1c1e; }
.report-meta { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 14px; font-size: 13px; }
@media (max-width: 600px) { .report-doc { padding: 20px 16px; } .report-meta { grid-template-columns: auto 1fr; } }
.report-sign { display: flex; flex-direction: column; margin-top: 16px; padding-top: 10px; border-top: 1px solid #ddd; }
.ab { display: flex; flex-direction: column; gap: 14px; }
.ab-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; }
.ab-axis { margin-bottom: -4px; }
.ab-track { position: relative; height: 22px; }
.ab-axis .ab-track { height: 16px; }
.ab-tick { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.ab-band { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--ok-soft); }
.ab-line { position: absolute; top: 10px; height: 2px; background: var(--accent); }
.ab-dot { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; }
.ab-dot.before { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.ab-dot.after { background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.ab-val { position: absolute; top: -14px; transform: translateX(-30%); font-size: 11px; font-weight: 600; white-space: nowrap; }
.ab-key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; }
.ab-key.before { box-shadow: inset 0 0 0 2px var(--accent); }
.ab-key.after { background: var(--accent); }
.ab-key.band { border-radius: 3px; background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--border); }
@media (max-width: 600px) { .ab-row { grid-template-columns: 90px 1fr; } }
.lsa { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.lsa li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; }
.lsa-u { font-size: 15px; }
.lsa-m b { color: var(--accent); }
.grp { display: flex; flex-direction: column; gap: 10px; }
.grp-row { display: grid; grid-template-columns: 140px 180px auto 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.grp-row:last-child { border-bottom: 0; }
@media (max-width: 900px) { .grp-row { grid-template-columns: 1fr 1fr; } .grp-row input:not([type]) , .grp-row input[placeholder] { grid-column: 1 / -1; } }
.grp-summary p { margin: 0 0 8px; max-width: 70ch; }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.plan-bar { align-self: stretch; border-radius: 4px; background: var(--accent); }
.plan-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-mins { display: flex; align-items: center; gap: 6px; }
.plan-mins .num { min-width: 48px; text-align: center; font-weight: 600; }
.plan-target { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.plan-target .pill { align-self: flex-start; }
.home-dots { display: inline-flex; gap: 3px; }
.home-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.home-dots i.on { background: var(--accent); box-shadow: none; }
.celf input { max-width: 90px; padding: 5px 8px; }
.celf-sum td { background: var(--surface-2); }
.celf-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.celf-index { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.celf-index input { padding: 5px 8px; }
.celf-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.celf-norms { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.celf-norms.on { background: var(--ok-soft); }
.celf .from-table { display: inline-block; min-width: 60px; }
.celf-std { font-size: 20px; }

/* Sign-in extras */
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.code-input { font-size: 22px; letter-spacing: .15em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { width: 190px; height: 190px; padding: 8px; border-radius: 10px; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font: 15px ui-monospace, SFMono-Regular, Menlo, monospace; }
.sec-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }

/* "Protect your account" choices after first sign-in */
.two-step-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; white-space: normal; padding: 12px 14px; height: auto; }
.two-step-choice span { font-weight: 400; font-size: 13px; opacity: .85; }

/* Set up this device (Home Screen + notifications) */
.device-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.device-steps li { display: flex; gap: 12px; align-items: flex-start; }
.device-steps .num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--accent-soft, #e6f4f1); color: var(--accent, #0f766e); }
.device-steps li.done .num { background: var(--ok-soft); color: var(--ok); }

/* Settings → Team */
.team-list { border-top: 1px solid var(--border); }
.team-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto; gap: 8px 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.team-row:last-child { border-bottom: 0; }
.team-row.off .who { opacity: .6; }
.team-row .who { min-width: 0; overflow-wrap: anywhere; }
.team-meta, .team-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-meta select { width: auto; }
.team-actions { justify-content: flex-end; }
@media (max-width: 640px) {
  .team-row { grid-template-columns: 1fr; }
  .team-actions { justify-content: flex-start; }
}

/* ---------- Mock-ups: referrals and OT ---------- */
.ref-split { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
@media (max-width: 900px) { .ref-split { grid-template-columns: minmax(0, 1fr); } }
.ot-rate { display: flex; flex-direction: column; gap: 6px; }
.ot-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 460px; }
.ot-dot { aspect-ratio: 1; min-width: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.ot-dot.was { box-shadow: 0 0 0 2px var(--muted); }
.ot-dot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ot-levels { display: flex; gap: 4px; flex-wrap: wrap; }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.hw-cell { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: 600 20px/1 ui-rounded, system-ui, sans-serif; cursor: pointer; }
.hw-cell.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.hw-cell.rev { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.hw-cell.no { background: var(--surface-2); color: var(--muted); border-style: dashed; }
.hw-samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.hw-photo { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; background: repeating-linear-gradient(transparent 0 22px, color-mix(in srgb, var(--info) 30%, transparent) 22px 23px), #fffdf6; color: #34495e; font: italic 22px/1 "Comic Sans MS", "Segoe Print", cursive; }
.ot-letter p { line-height: 1.5; }

/* ---------- Mock-ups: running a clinic ---------- */
.wz-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.wz-step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.wz-step i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); font-style: normal; font-weight: 700; font-size: 12px; }
.wz-step.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.wz-step.on i, .wz-step.done i { background: var(--accent); color: #fff; }
.rb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rb-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rb-item b { min-width: 92px; font-variant-numeric: tabular-nums; }
.rb-item.skip b { color: var(--muted); text-decoration: line-through; }
.lt-page { display: flex; flex-direction: column; gap: 14px; padding: 28px 30px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: #1f2328; box-shadow: 0 2px 10px rgba(0,0,0,.06); line-height: 1.5; }
.lt-head { display: flex; flex-direction: column; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.lt-page .muted { color: #6b7280; }
.md-phone { gap: 8px; }
.md-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.md-item.done { opacity: .6; }
.md-item.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.md-time { min-width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; }
.md-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.md-alert { font-size: 12px; color: var(--warn); }
.off-banner { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.off-banner.on { background: var(--ok-soft); color: var(--ok); }
.ca-banner { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--danger); border-radius: 10px; background: var(--surface); }
.ro-shift { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rm-board { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.rm-row { display: grid; grid-template-columns: 120px minmax(640px, 1fr); align-items: center; gap: 10px; padding-right: 16px; }
.rm-name { font-weight: 600; font-size: 14px; }
.rm-track { position: relative; height: 40px; border-radius: 8px; background: var(--surface-2); }
.rm-hours .rm-track { height: 18px; background: none; }
.rm-hour { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.rm-block { position: absolute; top: 3px; bottom: 3px; display: block; line-height: 34px; padding: 0 6px; overflow: hidden; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.rm-block.speech { background: #1f9e89; }
.rm-block.move { background: #d9772f; }
.rm-block.clash { background: var(--danger); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger); z-index: 1; }
.rm-appts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ci-bubble { max-width: 85%; padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.ci-bubble.in { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.ci-bubble.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.sk-fake { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; cursor: text; }
kbd { padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font: 600 12px/1.5 ui-monospace, monospace; }
.sk-overlay { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; background: rgba(15, 20, 25, .45); }
.sk-overlay[hidden] { display: none; }
.sk-panel { display: flex; flex-direction: column; width: 100%; max-width: 600px; max-height: 70vh; overflow: hidden; border-radius: 14px; background: var(--surface); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sk-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sk-head input { border: 0; box-shadow: none; font-size: 16px; }
.sk-results { overflow-y: auto; padding: 6px; }
.sk-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sk-item.on { background: var(--accent-soft); }
.sk-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); flex: none; }
.sk-text { display: flex; flex-direction: column; min-width: 0; }
.sk-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-foot { padding: 8px 12px; border-top: 1px solid var(--border); }
.wa-phone { background: #efeae2; }
.wa-phone .ci-bubble.in { background: #fff; color: #111; }
.wa-phone .ci-bubble.out { background: #d9fdd3; color: #111; }
.wa-head { display: flex; flex-direction: column; margin: -18px -16px 4px; padding: 12px 16px; border-radius: 22px 22px 0 0; background: #075e54; color: #fff; }
.wa-buttons { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.wa-buttons button { padding: 8px; border: 0; border-radius: 10px; background: #fff; color: #027eb5; font: inherit; font-weight: 600; cursor: pointer; }
.mv-map svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.mv-land { fill: #eef1ea; }
.mv-water { fill: #cfe3f0; }
.mv-road { fill: none; stroke: #fff; stroke-width: 7; }
.mv-main { stroke: #f7d9a6; stroke-width: 10; }
.mv-route { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 10 6; stroke-linejoin: round; }
.mv-pin { fill: #d9772f; stroke: #fff; stroke-width: 3; }
.mv-home { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.mv-num { fill: #fff; font: 700 13px system-ui, sans-serif; }
.mv-label { fill: #1f2328; font: 600 12px system-ui, sans-serif; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.mv-credit { fill: #6b7280; font: 10px system-ui, sans-serif; }
.mv-day { display: flex; flex-direction: column; gap: 6px; }
.mv-travel { padding: 5px 10px; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); font-size: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mv-land { fill: #2a3138; } :root:not([data-theme="light"]) .mv-water { fill: #1f3a4d; } :root:not([data-theme="light"]) .mv-road { stroke: #3a434c; } :root:not([data-theme="light"]) .mv-main { stroke: #5a4a30; } :root:not([data-theme="light"]) .mv-label { fill: #e6e8eb; stroke: #2a3138; } }
:root[data-theme="dark"] .mv-land { fill: #2a3138; } :root[data-theme="dark"] .mv-water { fill: #1f3a4d; } :root[data-theme="dark"] .mv-road { stroke: #3a434c; } :root[data-theme="dark"] .mv-main { stroke: #5a4a30; } :root[data-theme="dark"] .mv-label { fill: #e6e8eb; stroke: #2a3138; }
.tl { display: flex; flex-direction: column; }
.tl-month { position: sticky; top: 0; padding: 12px 4px 6px; background: var(--surface); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tl-item { position: relative; display: grid; grid-template-columns: 56px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tl-item:hover { background: var(--surface-2); }
.tl-item::before { content: ''; position: absolute; left: 87px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-date { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tl-ic { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--surface); }
.tl-item.milestone .tl-ic { background: var(--accent); color: #fff; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-who { white-space: nowrap; }
@media (max-width: 560px) { .tl-item { grid-template-columns: 46px 32px minmax(0, 1fr); } .tl-item::before { left: 77px; } .tl-who { display: none; } }
.tk-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-list { display: flex; flex-direction: column; }
.tk-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--border); }
.tk-item input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.tk-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tk-title { font-weight: 600; }
.tk-item.done .tk-title { color: var(--muted); text-decoration: line-through; font-weight: 400; }

/* Mock-ups sub-menu (sidebar) and category chips (phones) */
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 20px; padding-left: 10px; border-left: 2px solid var(--border); }
.nav-sub[hidden] { display: none; }
.nav .nav-sub a { padding: 5px 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.nav .nav-sub a.active { background: var(--accent-soft); color: var(--accent); }
.p-group a { color: inherit; }
.mk-chips { margin-bottom: 14px; }
.mk-chips a:hover { text-decoration: none; }
@media (min-width: 821px) { .mk-chips { display: none; } }
@media (max-width: 820px) { .nav-sub { display: none; } .mk-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .mk-chips .chip { white-space: nowrap; } }

/* Computers: the menu scrolls when it's taller than the window (e.g. Mock-ups open); the name and Sign out stay at the bottom. */
@media (min-width: 821px) {
  .sidebar { height: 100dvh; }
  .sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; scrollbar-gutter: stable; }
  .sidebar .me { flex: none; }
}

/* Mock-ups: clicking it opens and closes the categories; the arrow shows which */
.nav-caret { display: grid; place-items: center; margin-left: auto; color: var(--muted); }
.nav-caret svg { width: 16px; height: 16px; transition: transform .15s; }
.nav-toggle[aria-expanded="true"] .nav-caret svg { transform: rotate(90deg); }
@media (max-width: 820px) { .nav-caret { display: none; } }

/* Mock-ups: email previews (Automatic reminders). */
.em-frame { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.em-meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; }
.em-meta > * { min-width: 0; overflow-wrap: anywhere; }
.em-body { max-width: 560px; margin: 0 auto; padding: 22px 20px 18px; line-height: 1.55; }
.em-body p { margin: 0 0 12px; }
.em-brand { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.em-when { margin: 0 0 14px; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); }
.em-when b { display: block; }
.em-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.em-btn { padding: 10px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.em-btn.ghost { background: transparent; color: var(--accent); }
.em-small { font-size: 13px; color: var(--muted); }
.em-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.em-body .table-wrap { margin: 0 0 12px; }

/* "A new version is ready" bar (see js/update-check.js). */
.update-bar { position: fixed; left: 50%; bottom: 16px; z-index: 101; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 8px 8px 8px 16px; border-radius: 12px; background: #1f2328; color: #fff; box-shadow: var(--shadow-lg); transform: translateX(-50%); font-size: 14px; }
.update-bar .btn.ghost { color: #fff; }
@media (max-width: 820px) { .update-bar { bottom: 80px; } }
@media print { .update-bar { display: none; } }

/* Mock-ups: payment plan choices on the family's phone. */
.pp-phone textarea { width: 100%; }
.pp-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.pp-option.on { border-color: var(--accent); background: var(--accent-soft); }
.pp-option input { margin-top: 3px; accent-color: var(--accent); }
.pp-option > span { display: flex; flex-direction: column; gap: 2px; }
.pp-facts { border: 1px solid var(--border); border-radius: 10px; }
.pp-option input { width: auto; flex: none; }
.pp-phone .cal-views { flex-wrap: wrap; overflow: visible; }

/* ---------- Online forms ---------- */
dialog .pay-qr, .form-share-qr { flex: none; width: 112px; height: 112px; background: #fff; border-radius: 8px; }
dialog .pay-qr svg { width: 100%; height: 100%; display: block; }
.form-doc-head { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--text); }
.form-doc-head h2 { margin: 0 0 4px; font-size: 22px; }
.form-doc h3 { margin: 22px 0 6px; font-size: 16px; }
.form-answer { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.form-signature { margin-top: 24px; break-inside: avoid; }
.form-signature img { display: block; width: 260px; max-width: 100%; margin-bottom: 4px; border-bottom: 1px solid var(--text); background: #fff; }
.form-q-edit { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }

/* ---------- Group sessions ---------- */
.grp-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.grp-member { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); }
.grp-member:first-child { border-top: 0; }
.grp-who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
@media (max-width: 600px) {
  .grp-member { grid-template-columns: 1fr auto; }
  .grp-member > .row { grid-column: 1 / -1; }
}

/* ---------- Menu colour (Settings → Account) ---------- */
.menu-tinted .sidebar { background: var(--menu-bg); color: var(--menu-fg); border-color: transparent; }
.menu-tinted .nav a, .menu-tinted .nav-more, .menu-tinted .sidebar .me, .menu-tinted .sidebar .me .btn { color: var(--menu-fg); }
.menu-tinted .nav a:hover, .menu-tinted .nav-more:hover { background: color-mix(in srgb, var(--menu-fg) 14%, transparent); }
.menu-tinted .nav a.active { background: color-mix(in srgb, var(--menu-fg) 22%, transparent); color: var(--menu-fg); font-weight: 600; }
.menu-tinted .sidebar .me { border-top-color: color-mix(in srgb, var(--menu-fg) 25%, transparent); }
.menu-tinted .brand img { background: #fff; border-radius: 6px; padding: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.swatch-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.swatch-opt i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
.consent-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.consent-banner > span { flex: 1; min-width: 200px; }
dialog .consent-banner { margin-bottom: 0; }

/* ---------- Send a form ---------- */
.form-pick { display: grid; gap: 8px; }
.form-pick-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.form-pick-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.form-pick-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.form-pick-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-pick-tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--border); border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff; }
.form-pick-card.on .form-pick-tick { border-color: var(--accent); background: var(--accent); }
.form-pick-body { display: grid; gap: 3px; min-width: 0; }
.form-pick-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.form-pick-intro { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ok-text { color: var(--ok); font-weight: 500; }
.warn-text { color: var(--warn); font-weight: 500; }

.share-done { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); }
.share-check { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 700; }
.share-message { width: 100%; resize: vertical; font: inherit; }
.share-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.share-action { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.share-action:hover { border-color: var(--accent); text-decoration: none; }
.share-action b { color: var(--accent); }
.share-action span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-clinic { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; }
.share-qr { flex: none; width: 104px; height: 104px; padding: 4px; background: #fff; border-radius: 8px; }
.share-qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 520px) {
  .share-action { text-align: center; padding: 10px 6px; }
  .share-action span { display: none; }
}
.form-pick-card[role="checkbox"] .form-pick-tick { border-radius: 6px; }

/* ---------- Search everything (Ctrl+K) ---------- */
.sk-ic svg { width: 16px; height: 16px; }
.sk-open-btn { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; }
.sk-open-btn svg { width: 16px; height: 16px; flex: none; }
.sk-open-btn span { flex: 1; text-align: left; }
.sk-open-btn:hover { border-color: var(--accent); color: var(--text); }
.menu-tinted .sk-open-btn { background: color-mix(in srgb, var(--menu-fg) 12%, transparent); border-color: color-mix(in srgb, var(--menu-fg) 25%, transparent); color: var(--menu-fg); }
.menu-tinted .sk-open-btn kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--menu-fg) 35%, transparent); }
.sk-close { display: none; }
.sk-head input { flex: 1; min-width: 0; background: transparent; }
@media (max-width: 820px) {
  .sk-open-btn { display: none; }
  .sk-close { display: inline-flex; }
  .sk-overlay { padding: 12px; }
  .sk-panel { max-height: 80vh; }
}
.new-invoice { display: grid; gap: 10px; }
.new-invoice input { font-size: 16px; padding: 12px 14px; }
.ni-list { display: grid; align-content: start; gap: 2px; height: min(380px, 50vh); overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 10px; }
.ni-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.ni-item:hover, .ni-item.on { background: var(--surface-2); }
.ni-item.chosen { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.appt .flags i.change { background: var(--danger); }
@media (max-width: 820px) { .nav a { position: relative; } .nav a .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 16px; padding: 0 4px; line-height: 16px; font-size: 10px; } }

/* Take payment (invoice) */
.take-pay { align-items: stretch; }
.take-amount { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.take-amount b { font-size: 34px; letter-spacing: -.01em; }
.take-tabs { align-self: center; }
.take-scan { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.take-scan p { margin: 0; max-width: 34ch; color: var(--muted); }
.take-qr { width: min(260px, 70vw); padding: 12px; border-radius: 14px; background: #fff; }
.take-qr svg { display: block; width: 100%; height: auto; }
.take-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; line-height: 1.5; }
.take-steps .btn { margin-left: 6px; }
.take-status { text-align: center; padding: 8px; border-radius: 10px; }
.take-status.paid { background: var(--ok-soft, #e3f5ec); color: var(--ok); font-size: 18px; }
/* Mock-up: Tap to Pay in the app */
.ttp-amount { display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.ttp-amount b { font-size: 30px; }
.ttp-hold { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; border-radius: 16px; background: #111; color: #fff; text-align: center; }
.ttp-hold b { font-size: 28px; }
.ttp-hold .muted { color: #b8bcc2; }
.ttp-wave { font-size: 26px; letter-spacing: -6px; transform: rotate(-90deg); color: #fff; }
.ttp-done { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); }
.ttp-done b { font-size: 22px; }
.take-term { display: flex; flex-direction: column; gap: 12px; }
.take-term-device { display: flex; flex-direction: column; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.take-send { align-self: center; padding: 12px 22px; font-size: 16px; }
.take-term-steps { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.take-term-steps li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.take-term-steps li.on { color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.take-term-steps li.done { color: var(--ok); }
/* Mock-up: in clinic on the Shift4 terminal */
.s4-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: start; }
.s4-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.s4-cap { text-align: center; }
.s4-arrow { align-self: center; font-size: 26px; color: var(--muted); }
.s4-phone { min-height: 470px; }
.s4-app { display: flex; flex-direction: column; gap: 12px; }
.s4-app-head { display: flex; flex-direction: column; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.s4-tabs { align-self: center; }
.s4-tabs button { font-size: 12px; }
.s4-declined { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); text-align: center; }
.s4-declined b { font-size: 20px; }
.s4-term { width: 250px; padding: 14px 14px 22px; border-radius: 26px; background: #22262b; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.s4-screen { display: flex; flex-direction: column; min-height: 330px; border-radius: 12px; background: #fdfdfd; color: #111; overflow: hidden; }
.s4-top { display: flex; justify-content: space-between; padding: 6px 10px; background: #1b1f24; color: #cfd3d8; font-size: 11px; font-weight: 600; }
.s4-screen-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; font-size: 15px; }
.s4-label { font-size: 12px; letter-spacing: .12em; color: #666; }
.s4-amt { font-size: 32px; }
.s4-small { font-size: 12px; color: #666; }
.s4-idle { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.s4-idle b { font-size: 18px; }
.s4-cl { font-size: 30px; letter-spacing: -8px; transform: rotate(-90deg); margin: 6px 0; color: #0f766e; }
.s4-keys { display: flex; gap: 8px; }
.s4-keys button { min-width: 54px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; background: #fff; font: inherit; font-weight: 700; color: #111; }
.s4-keys button.on { border-color: #0f766e; background: #0f766e; color: #fff; }
.s4-pin { font-size: 26px; letter-spacing: .1em; }
.s4-spin { width: 34px; height: 34px; border: 4px solid #ddd; border-top-color: #0f766e; border-radius: 50%; animation: s4spin 0.9s linear infinite; }
@keyframes s4spin { to { transform: rotate(360deg); } }
.s4-ok, .s4-bad { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: #fff; font-size: 30px; font-weight: 700; }
.s4-ok { background: #1a7f37; }
.s4-bad { background: #c62828; }
.s4-slot { height: 6px; margin: 14px 30px 0; border-radius: 3px; background: #0d0f12; }
.s4-receipt { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 190px; margin-top: -4px; padding: 12px 10px 16px; background: #fff; color: #111; font-family: ui-monospace, Menlo, monospace; font-size: 11px; box-shadow: 0 4px 10px rgba(0,0,0,.12); clip-path: polygon(0 0, 100% 0, 100% 96%, 95% 100%, 90% 96%, 85% 100%, 80% 96%, 75% 100%, 70% 96%, 65% 100%, 60% 96%, 55% 100%, 50% 96%, 45% 100%, 40% 96%, 35% 100%, 30% 96%, 25% 100%, 20% 96%, 15% 100%, 10% 96%, 5% 100%, 0 96%); }
@media (max-width: 760px) {
  .s4-stage { grid-template-columns: 1fr; }
  .s4-arrow { display: none; }
  .s4-phone { min-height: 0; }
}
.s4-picker { gap: 6px; flex-wrap: wrap; align-items: center; }
/* Handwriting: favourites, options, lasso, text, counters/timers, pages panel */
.ink-favs { gap: 4px; padding: 2px 6px; }
.ink-fav { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer; }
.ink-fav span { border-radius: 50%; background: var(--c); }
.ink-fav.hi span { border-radius: 3px; opacity: 0.7; }
.ink-fav.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ink-fav.add { border-style: dashed; }
.ink-opt { height: 32px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.ink-opt.active { background: var(--accent-soft); color: var(--accent); }
.ink-opt.ink-sticker { width: 38px; padding: 3px; }
.ink-sticker-icon { width: 30px; height: 30px; display: block; }
.ink-hint { padding: 0 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.ink-size b { font-weight: 700; }
.ink-lasso { position: absolute; z-index: 3; border: 2px dashed var(--accent); border-radius: 6px; background: rgba(15, 118, 110, 0.04); pointer-events: none; }
.ink-lasso .ink-sel-handle { pointer-events: auto; }
.ink-lasso-bar { position: absolute; left: 0; top: -46px; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #1f2328; pointer-events: auto; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.ink-lasso-bar button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; touch-action: none; }
.ink-lasso-bar button:hover { background: rgba(255,255,255,.12); }
.ink-lasso-bar svg { width: 20px; height: 20px; }
.ink-lasso-dot { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(#1c1c1e, #1d4ed8, #dc2626, #15803d, #7c3aed, #1c1c1e); }
.ink-lasso-colours { position: absolute; left: 0; top: -92px; display: flex; gap: 4px; padding: 5px; border-radius: 10px; background: #1f2328; pointer-events: auto; }
.ink-lasso-colours button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.ink-lasso-colours span { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; }
.ink-textedit { position: absolute; z-index: 4; margin: 0; padding: 0; border: 1px dashed var(--accent); border-radius: 4px; background: rgba(255,255,255,.85); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-weight: 500; line-height: 1.3; resize: none; overflow: hidden; outline: none; }
.ink-widget { position: absolute; z-index: 2; display: flex; gap: 4px; }
.ink-widget button { min-width: 38px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; touch-action: manipulation; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.ink-widget button.ok { background: #10b981; border-color: #10b981; color: #fff; }
.ink-widget button.no { background: #fff1f2; border-color: #fda4af; color: #be123c; }
.ink-widget button.play { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.ink-widget button.ghost { font-weight: 500; color: var(--muted); }
.ink-widget button svg { width: 16px; height: 16px; display: block; margin: auto; }
.ink-panel { position: absolute; z-index: 20; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: 230px; border-left: 1px solid var(--border); background: var(--surface); box-shadow: -6px 0 24px rgba(0,0,0,.08); }
.ink-panel-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px 14px; border-bottom: 1px solid var(--border); }
.ink-panel-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.ink-thumb { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.ink-thumb-img { width: 100%; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px var(--border), 0 2px 6px rgba(0,0,0,.08); overflow: hidden; }
.ink-thumb-img canvas { display: block; width: 100%; height: auto; }
.ink-thumb.current .ink-thumb-img { box-shadow: 0 0 0 3px var(--accent); }
.ink-thumb-bar { display: flex; align-items: center; gap: 0; }
.ink-thumb-n { flex: 1; padding-left: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.ink-thumb-bar .ink-icon { width: 30px; height: 30px; }
.ink-thumb-bar .ink-icon svg { width: 17px; height: 17px; }
@media (max-width: 760px) { .ink-panel { width: min(80vw, 260px); } }
.take-term-device select { margin-top: 4px; max-width: 260px; text-align: center; }
.ink-photo-bar { position: absolute; left: 0; top: -46px; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #1f2328; pointer-events: auto; box-shadow: 0 4px 12px rgba(0,0,0,.2); white-space: nowrap; }
.ink-photo-bar button { height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.ink-photo-bar button:hover { background: rgba(255,255,255,.14); }

/* Term bookings: the dates a repeat will book, and what it skips. */
.rb-preview { display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.rb-preview:empty { display: none; }
.rb-skips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* Late cancellations and no-shows to review. */
.fee-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.fee-row:first-child { border-top: 0; }
.fee-row .main { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.fee-row .title { font-weight: 600; }
.fee-panel .fee-row { padding: 8px 0; border: 0; }

/* Who owes what: overdue amounts stand out. */
.stat b.owing { color: var(--danger); }

/* Progress report: typed-in sections that print like the rest of the page. */
.pr-doc h2 { margin: 22px 0 8px; font-size: 16px; }
.pr-edit { min-height: 60px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; white-space: pre-wrap; outline: none; }
.pr-edit.inline { display: inline-block; min-height: 0; min-width: 160px; padding: 0 6px; }
.pr-edit:focus { border-color: var(--accent); }
.pr-edit:empty::before { content: attr(data-placeholder); color: var(--muted); }
.pr-goal { break-inside: avoid; }
.pr-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 8px; }
@media print {
  .pr-edit { border: 0; padding: 0; min-height: 0; }
  .pr-edit:empty { display: none; }
  .pr-doc .chart-wrap { max-width: 520px; }
}

/* The Account heading hides the early access switch (tap it five times). Touch screens only send taps
   to elements that look clickable, and quick taps shouldn't zoom or select the text. */
.secret-tap { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .secret-tap { cursor: default; } }

/* ---------- Early access: finishing touches (only with body.early) ---------- */

.toast.has-action { display: flex; align-items: center; gap: 14px; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.16); color: inherit; font: inherit; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.toast-action:hover { background: rgba(255, 255, 255, 0.26); }

@media (prefers-reduced-motion: no-preference) {
  body.early main > div { animation: early-in .18s ease-out; }
  body.early dialog[open] { animation: early-pop .16s ease-out; }
  body.early .toast { animation: early-toast .2s ease-out; }
  @media (max-width: 820px) { body.early dialog[open] { animation: early-up .22s cubic-bezier(.2, .8, .2, 1); } }
}
@keyframes early-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes early-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes early-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes early-toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Loading placeholder */
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.skeleton .sk-row { display: flex; gap: 10px; }
.skeleton .sk-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sk-bar { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk-shine 1.2s linear infinite; }
@keyframes sk-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Empty states */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 20px; text-align: center; }
.empty-state .es-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty-state .es-icon svg { width: 26px; height: 26px; }
.empty-state b { font-size: 15px; }
.empty-state .muted { max-width: 420px; }
.empty-state .btn { margin-top: 8px; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: confetti 1s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--r)); opacity: 0; } }

/* Keyboard shortcuts */
.kb-list { display: grid; gap: 8px; }
.kb-row { display: flex; align-items: center; gap: 12px; }
.kb-row kbd { min-width: 64px; text-align: center; padding: 3px 8px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* One type scale and a little more air */
body.early h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
body.early h2 { font-size: 15px; line-height: 1.3; }
body.early .card header { padding: 14px 18px; }
body.early .card .body { padding: 16px 18px; }
body.early .btn { transition: background-color .12s, border-color .12s, box-shadow .12s, transform .06s; }
body.early .btn:active { transform: translateY(1px); }
body.early :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.early .num { font-variant-numeric: tabular-nums; }

/* ---------- Early access: calendar ---------- */
.hol-tag { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 10.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hol-tag.public { background: var(--warn-soft); color: var(--warn); }
.cal .col.holiday { background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--warn-soft) 70%, transparent) 10px 20px); }
.cal .col.school-hols { background: color-mix(in srgb, var(--info-soft) 45%, transparent); }
.hover-card { position: fixed; z-index: 150; width: 280px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.hover-card .hc-alert { padding: 4px 8px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; }
.hover-card .hc-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.hover-card .hc-pills:empty, .hover-card .hc-consent:empty { display: none; }
.resize-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.resize-grip::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .12s; }
.appt:hover .resize-grip::after { opacity: .35; }
.mv { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mv-head { padding: 4px 8px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mv-day { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 108px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.mv-day:hover { border-color: var(--accent); }
.mv-day.other { opacity: .5; }
.mv-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.mv-day.holiday { background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.mv-day.school-hols { background: color-mix(in srgb, var(--info-soft) 50%, var(--surface)); }
.mv-date { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.mv-appt { padding: 1px 6px; border-left: 3px solid var(--c); border-radius: 4px; background: color-mix(in srgb, var(--c) 12%, transparent); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-count { position: absolute; top: 8px; right: 8px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-align: center; }
@media (max-width: 820px) { .mv-day { min-height: 70px; padding: 6px; } .mv-appt { display: none; } }
.day-sheet { display: none; }
@media print {
  body.printing-sheet > *:not(#daySheet) { display: none !important; }
  body.printing-sheet #daySheet { display: block; color: #000; font-size: 12px; }
  #daySheet h1 { font-size: 18px; margin-bottom: 12px; }
  #daySheet table { width: 100%; border-collapse: collapse; }
  #daySheet td { padding: 8px 6px; border-bottom: 1px solid #ccc; vertical-align: top; }
  #daySheet .ds-drive td { color: #555; font-style: italic; padding: 4px 6px; }
  #daySheet .ds-foot { margin-top: 16px; color: #555; font-size: 10px; }
}

/* Early access: notes */
.note-tools { gap: 12px; }
.copy-src { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.note-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.nm-tile { position: relative; display: flex; flex-direction: column; gap: 4px; }
.nm-tile img, .nm-tile video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.nm-play { position: absolute; inset: 0 0 22px 0; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .35); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.nm-remove { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.nm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Early access: reports and timeline */
.doc-editor { width: 100%; min-height: 480px; font: 15px/1.6 inherit; }
.doc-print h2 { margin: 20px 0 8px; font-size: 16px; }
.doc-print p { margin: 0 0 12px; line-height: 1.6; }
.ctl { padding: 6px 0; }
.ctl-month { padding: 12px 18px 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ctl-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 18px; color: inherit; }
a.ctl-item:hover { background: var(--surface-2); text-decoration: none; }
.ctl-main { flex: 1; min-width: 0; }
.ctl-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.ctl-dot svg { width: 15px; height: 15px; }
.ctl-dot.ctl-note, .ctl-dot.ctl-document { background: var(--accent-soft); color: var(--accent); }
.ctl-dot.ctl-goal, .ctl-dot.ctl-result, .ctl-dot.ctl-assessment { background: var(--ok-soft); color: var(--ok); }
.ctl-dot.ctl-invoice, .ctl-dot.ctl-payment { background: var(--warn-soft); color: var(--warn); }
.ctl-dot.ctl-email, .ctl-dot.ctl-reply, .ctl-dot.ctl-share, .ctl-dot.ctl-enquiry { background: var(--info-soft); color: var(--info); }

/* Early access: family tab */
.portal-url { padding: 4px 8px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.hp-item { align-items: flex-start; }
.hp-item.archived { opacity: .6; }
.hp-thumb { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.hp-item audio { width: 100%; max-width: 320px; height: 32px; margin-top: 6px; }
.profile-photo { width: 88px; height: 88px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Early access: money */
.fund-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.fund-row:first-child { border-top: 0; padding-top: 0; }
.fund-row.closed { opacity: .55; }
.fund-row .main { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.fund-meter { width: 140px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fund-meter span { display: block; height: 100%; background: var(--accent); }
.me-check { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.me-check:first-child { border-top: 0; }
.me-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.me-check.ok .me-tick { background: var(--ok-soft); color: var(--ok); }
.me-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }

/* Early access: practice */
.item.task { align-items: flex-start; gap: 12px; }
.item.task input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.item.task.done .title { text-decoration: line-through; color: var(--muted); }
.overdue-text { color: var(--danger); font-weight: 600; }
.wiz-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.wiz-step { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.wiz-step.on { background: var(--accent); color: #fff; }
.wiz-step.done { background: var(--ok-soft); color: var(--ok); }
.cal .off-hours { position: absolute; left: 0; right: 0; pointer-events: none; background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--surface-2) 80%, transparent) 8px 16px); }
.cal .off-hours span { position: sticky; top: 4px; display: inline-block; margin: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.cal .off-hours.leave { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--warn-soft) 80%, transparent) 8px 16px); }

/* Early access: screen lock */
.lock-screen { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.lock-card { width: min(380px, 100%); }
.status-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.status-row:first-child { border-top: 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.status-dot.bad { background: var(--danger); }
.status-dot.info { background: var(--border); }
.access-log { margin-top: 16px; }
.access-log summary { padding: 14px 18px; cursor: pointer; }

/* ---------- Practice tools (early access): alerts, consent, letters, My day ---------- */
.ca-banner { margin-bottom: 16px; }
.modal .ca-banner, .md-page .ca-banner { margin-bottom: 0; }
.consent-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.lt-head { flex-direction: row; align-items: center; gap: 14px; margin-bottom: 14px; }
.lt-logo { max-height: 56px; max-width: 160px; object-fit: contain; }
.md-page { display: flex; flex-direction: column; gap: 10px; max-width: 520px; margin: 0 auto; }
a.md-item { text-decoration: none; }
a.md-item:hover { border-color: var(--accent); }
.md-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.md-actions .btn, .md-actions .pill { justify-content: center; }
.md-start { padding: 14px; font-size: 16px; }

/* ---------- Speech tools (early access): library, planner, therapy tab, groups ---------- */
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.pick-item { display: flex; align-items: baseline; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pick-item:hover { border-color: var(--accent); }
.pick-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft, var(--surface-2)); }
.lib-img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.lib-body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card audio { width: 100%; }
.game-print .bingo { max-width: 520px; }
.game-print .bingo-cell { font-size: 15px; }
.therapy-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-name { font-weight: 700; border: 0; padding: 2px 0; background: transparent; color: var(--text); }
.plan-what { border: 0; padding: 2px 0; resize: vertical; background: transparent; color: var(--muted); font-size: 13px; min-height: 0; }
.plan-name:focus, .plan-what:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.plan-row { grid-template-columns: 8px 1fr auto; }
@media (max-width: 640px) { .plan-row { grid-template-columns: 6px 1fr; } .plan-mins { grid-column: 2; flex-wrap: wrap; } }
.lsa-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
@media print {
  body.printing-game * { visibility: hidden; }
  body.printing-game .game-print, body.printing-game .game-print * { visibility: visible; }
  body.printing-game .game-print { position: absolute; left: 0; top: 0; width: 100%; }
}

/* ---------- OT tools (early access) ---------- */
.hw-sample { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.hw-sample img { width: 100%; max-height: 320px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.hw-cell:disabled { cursor: default; opacity: 1; }
.md-drive { display: flex; align-items: center; gap: 4px; padding: 2px 12px; }

/* ---------- More therapy tools (early access) ---------- */
.snd-band { display: flex; flex-direction: column; gap: 6px; }
.snd-age { font-size: 12px; font-weight: 600; color: var(--muted); }
.snd-age.due { color: var(--text); }
.snd-row { display: flex; flex-wrap: wrap; gap: 6px; }
.snd { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.snd b { font-size: 15px; }
.snd small { font-size: 11px; color: var(--muted); }
.snd.yes { background: var(--ok-soft); border-color: var(--ok); }
.snd.emerging { background: var(--info-soft); border-color: var(--info); }
.snd.no { background: var(--surface-2); }
.snd.flag { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.snd:disabled { cursor: default; opacity: 1; }
.proc-list { display: flex; flex-direction: column; gap: 6px; }
.proc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.proc:last-child { border-bottom: 0; }
.proc-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.proc.late .proc-main b { color: var(--warn); }
.rec-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rec-take { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.rec-take audio { width: 100%; }
.vs-row { display: flex; flex-wrap: wrap; gap: 10px; }
.vs-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 118px; min-height: 118px; padding: 10px; border: 2px solid var(--border); border-radius: 14px; background: #fff; color: #1c1c1e; text-align: center; }
.vs-card img, .aac-cell img, .ft-half img, .ss-page img { max-width: 100%; max-height: 72px; object-fit: contain; border-radius: 8px; }
.vs-pic { font-size: 38px; line-height: 1.1; }
.vs-num { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 700; color: #6b7280; }
.vs-edit { display: flex; align-items: center; gap: 6px; }
.vs-edit input:not(.vs-emoji), .vs-edit textarea { flex: 1; min-width: 0; }
.vs-emoji { width: 56px !important; text-align: center; font-size: 18px; }
.vs-preview { padding: 12px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
.aac { display: flex; flex-direction: column; gap: 8px; }
.aac-grid { display: grid; gap: 6px; }
.aac-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; aspect-ratio: 1; min-width: 0; padding: 4px; border: 2px solid rgba(0, 0, 0, .12); border-radius: 12px; color: #1c1c1e; font: inherit; text-align: center; cursor: pointer; }
.aac-cell b { font-size: 13px; line-height: 1.1; overflow-wrap: anywhere; }
.aac-cell .vs-pic { font-size: 28px; }
button.aac-cell:active { transform: scale(.96); }
.aac-bar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.aac-said { flex: 1; font-size: 18px; font-weight: 600; }
.aac-full .aac-cell b { font-size: 15px; }
.ft { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; }
.ft-half { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border: 2px solid var(--border); border-radius: 16px; background: #fff; color: #1c1c1e; text-align: center; }
.ft-half .vs-pic { font-size: 56px; }
.ss { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ss-page { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: #1c1c1e; text-align: center; }
.ss-page p { margin: 0; font-size: 16px; }
.sd { display: flex; flex-direction: column; gap: 12px; }
.sd-time { display: flex; flex-direction: column; gap: 6px; }
.coach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.wl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wl-card { padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: #fff; color: #1c1c1e; font-weight: 600; text-align: center; }
.print-only { display: none; }
.hp-video { width: 100%; max-width: 360px; border-radius: 10px; margin-top: 6px; }
.cnt-page { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.cnt-clock { font-size: 28px; min-width: 80px; text-align: right; }
.cnt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cnt { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.cnt-label { text-align: center; font-weight: 600; border: 0; background: transparent; }
.cnt-tap { min-height: 120px; border: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font: 700 44px/1 inherit; cursor: pointer; touch-action: manipulation; }
.cnt-tap:active { transform: scale(.97); }
.cnt-add { align-items: center; justify-content: center; min-height: 160px; border-style: dashed; color: var(--muted); font: inherit; cursor: pointer; }
.pack h2 svg { width: 18px; height: 18px; vertical-align: -3px; }
.pack-item { align-items: flex-start; }
@media print {
  body.printing-one * { visibility: hidden; }
  body.printing-one .print-this, body.printing-one .print-this * { visibility: visible; }
  body.printing-one .print-this { position: absolute; left: 0; top: 0; width: 100%; }
  body.printing-one .print-this .print-only { display: block; }
}

/* The practice's plan (multi-clinic platform) */
.billing-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 28px; background: var(--accent-soft, #e6f4f1); border-bottom: 1px solid var(--border); font-size: 14px; }
.billing-bar.warn { background: #fdf3dc; color: #7a4a00; }
.billing-bar.bad { background: #fde8e8; color: #8a1c1c; }
.billing-bar .btn { margin-left: auto; }
.plan-lines { display: grid; gap: 6px; max-width: 460px; }
.plan-lines > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.plan-lines .total { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .billing-bar.warn { background: #3a2c14; color: #f0c98a; } .billing-bar.bad { background: #3b1717; color: #f3b1b1; } }

/* What's new: a dot until it's been opened since the latest change. */
.whats-new-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.me a.small { display: block; margin: 4px 0; color: var(--muted); text-decoration: none; }

/* Businesses (Evenday): the roster grid, and buttons that read as links. */
.linklike { padding: 0; border: 0; background: none; color: var(--accent, #0f766e); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
table.roster th.today { color: var(--accent, #0f766e); }
table.roster td.roster-cell { font-size: 13px; white-space: nowrap; }
table.roster td.roster-cell .linklike { font-weight: 500; color: inherit; }
table.roster td.roster-cell.changed { background: color-mix(in srgb, var(--accent, #0f766e) 10%, transparent); }
table.roster td.roster-cell.off { color: var(--muted, #6b7280); }
.voucher-card { display: grid; gap: 6px; justify-items: center; padding: 22px; border: 2px dashed var(--accent, #0f766e); border-radius: 16px; text-align: center; }
.voucher-amount { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.voucher-code { font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; padding: 6px 12px; border-radius: 8px; background: var(--bg-soft, #f4f6f7); }
ul.plain { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
/* The counter (businesses). */
.counter { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .counter { grid-template-columns: 1fr; } }
.counter-total { font-size: 20px; padding-top: 8px; border-top: 1px solid var(--line, #e5e7eb); }
.counter-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.counter-line { padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.counter-line select { width: auto; }
.counter-tick { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: color-mix(in srgb, var(--accent, #0f766e) 14%, transparent); color: var(--accent, #0f766e); font-size: 30px; font-weight: 700; }
.btn.lg { min-height: 48px; font-size: 16px; }
.error-text { color: var(--danger, #b42318); margin: 0; }
.rv-line { color: #b58100; letter-spacing: 2px; }
