/* Virtual Smile Consult v2 — dashboard styles.
   Tokens here are the shared design system for every dashboard screen; the
   login page is the first consumer, Practice Settings (screen 1) is next. */

:root {
  /* Product chrome. Fixed — the dashboard looks the same for every practice.
     Practice colours belong in the patient-facing consult, not the admin UI. */
  --ui-accent: #525ef5;
  --ui-accent-strong: #3f4ae3;
  --ui-accent-soft: #e7e9fe;

  /* Per-practice branding. Set at runtime from practices.branding; used by the
     patient-facing surfaces, deliberately not by the dashboard chrome. */
  --brand: #2563eb;

  /* Ink & surfaces */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e8ef;
  --surface: #fff;
  --app-bg: #f9f9ff;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;

  /* Shape — 1.5rem card radius per the locked container spec */
  --r-card: 1.5rem;
  --r-field: 0.75rem;

  --shadow-card: 0 24px 60px -24px rgba(15, 23, 42, 0.28),
                 0 2px 6px rgba(15, 23, 42, 0.04);

  --max-w: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;          /* locked base size */
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Soft mesh background — pale blue → lavender → blush, with two blurred blobs. */
body {
  min-height: 100%;
  background:
    radial-gradient(60rem 40rem at 12% 8%, #dceaf9 0%, transparent 60%),
    radial-gradient(55rem 42rem at 88% 78%, #fadfe4 0%, transparent 62%),
    linear-gradient(135deg, #dfe9f8 0%, #dedcf3 48%, #f7dee2 100%);
  background-attachment: fixed;
}

.app { min-height: 100vh; display: grid; }
/* The gradient belongs to the sign-in screen; the dashboard sits on flat grey. */
.app.is-dash { background: var(--app-bg); }
/* Hide both views until the session check resolves. */
.app.is-booting .view { display: none !important; }
.view[hidden] { display: none; }
.view { width: 100%; min-width: 0; }

.view-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.card {
  width: 100%;
  /* Guard: no child's intrinsic size may push a card past its container. */
  max-width: 100%;
  min-width: 0;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------- login -- */
.login { max-width: 32.5rem; padding: 3rem 3rem 2.75rem; }

.login__title {
  margin: 0;
  font-size: 2.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.login__sub {
  margin: 0.5rem 0 2.25rem;
  text-align: center;
  font-size: 1.0625rem;
  color: var(--muted);
}

.field { margin-bottom: 1.25rem; }

.field__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
}

.input {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus-within {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 4px rgba(82, 94, 245, 0.14);
}

.input__icon,
.input__reveal svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.input__icon { margin-left: 1rem; }

.input input {
  flex: 1 1 auto;
  /* width + min-width:0 together stop the input's default ~20ch intrinsic size
     from setting a min-content floor that overflows the card on narrow screens. */
  width: 100%;
  min-width: 0;
  padding: 1rem 0.875rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.input input::placeholder { color: #9aa6b8; }
.input input:focus { outline: none; }

.input__reveal {
  display: grid;
  place-items: center;
  margin-right: 0.75rem;
  padding: 0.375rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
}

.input__reveal:hover svg { stroke: var(--ink-2); }
.input__reveal:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.input__reveal[aria-pressed="true"] svg { stroke: var(--ui-accent); }

.login__row { display: flex; justify-content: flex-end; margin-bottom: 1.5rem; }

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ui-accent);
  cursor: pointer;
}

.linkbtn:hover { color: var(--ui-accent-strong); text-decoration: underline; }
.linkbtn:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; border-radius: 4px; }

/* --------------------------------------------------------------- buttons -- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-field);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.06s;
}

.btn--block { width: 100%; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }

.btn--primary { background: var(--ui-accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--ui-accent-strong); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.btn--ghost:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }

.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { filter: brightness(0.94); }

/* Shared "are you sure?" confirmation popup (VSC.confirmDelete). */
.confirm { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.45); }
.confirm__panel { width: min(26rem, 100%); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 1.5rem; }
.confirm__title { margin: 0 0 0.5rem; font-size: 1.0625rem; font-weight: 700; }
.confirm__msg { margin: 0 0 1.375rem; font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }
.confirm__actions { display: flex; justify-content: flex-end; gap: 0.625rem; }
.confirm__actions .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }

/* Spinner shows only while the button is in its loading state. */
.spinner {
  display: none;
  width: 1.0625rem;
  height: 1.0625rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn__label { opacity: 0.85; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.6s; }
  .btn:active:not(:disabled) { transform: none; }
}

/* ------------------------------------------------------ notes and alerts -- */
.note {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.9375rem;
  border-radius: 0.625rem;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.875rem;
}

.alert {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.9375rem;
  border: 1px solid var(--danger-line);
  border-radius: 0.625rem;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ================================================================ shell == */
.svg-defs { position: absolute; width: 0; height: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* minmax(0, 1fr): without the 0 minimum, a wide child (the editor's video grid,
   a long filename) makes the track grow past the viewport → sideways scroll. */
.shell { display: grid; grid-template-columns: 16.25rem minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0.5rem 1.75rem; }

.brand__mark {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--ui-accent-soft);
}

.brand__mark svg { width: 1.65rem; height: 1.65rem; fill: none; stroke: var(--ui-accent); stroke-width: 1.5; }
.brand__text { display: grid; min-width: 0; }
.brand__text strong { font-size: 0.9375rem; font-weight: 700; color: var(--ui-accent); }
.brand__text small { font-size: 0.75rem; color: var(--muted); }

.nav { display: grid; gap: 0.125rem; }

.nav__item {
  position: relative;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6875rem 0.875rem;
  border-radius: 0.75rem;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}

.nav__item svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: #94a3b8; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav__item:hover { background: #f8fafc; }
/* Red count of new submissions awaiting grading. */
.nav__badge { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); min-width: 1rem; height: 1rem; padding: 0 0.28rem; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.62rem; font-weight: 700; line-height: 1; text-align: center; box-shadow: 0 1px 2px rgba(239, 68, 68, 0.4); }
.nav__badge[hidden] { display: none; }

/* ============================================================ booking requests == */
.brq-count { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.brq-list { display: grid; gap: 0.875rem; }
.brq { border: 1px solid var(--line); border-radius: 1rem; padding: 1rem 1.125rem; background: var(--surface); display: grid; gap: 0.75rem; }
.brq__top { display: flex; align-items: center; gap: 0.75rem; }
.brq__id { flex: 1; min-width: 0; }
.brq__name { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--ink); }
.brq__when { font-size: 0.75rem; color: var(--muted); }
.brq__pill { flex: none; padding: 0.2rem 0.65rem; border-radius: 999px; background: #fef3c7; color: #b45309; font-size: 0.72rem; font-weight: 700; }
.brq__contact { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.brq__link { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--ui-accent); text-decoration: none; }
.brq__link svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brq__link:hover { text-decoration: underline; }
.brq__metas { display: grid; gap: 0.3rem; }
.brq__meta { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.brq__meta b { color: var(--ink); font-weight: 600; }
.brq__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nav__item.is-active { background: var(--ui-accent-soft); color: var(--ui-accent); font-weight: 600; }
.nav__item.is-active svg { stroke: var(--ui-accent); }

.nav__item.is-active::before {
  content: "";
  position: absolute; left: -1rem; top: 0.5rem; bottom: 0.5rem;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--ui-accent);
}

.sidebar__foot { margin-top: auto; }

.help {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.875rem;
  text-decoration: none;
}
.help:hover { background: #f8fafc; }
.help__icon {
  display: grid; place-items: center; flex: none;
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.75rem; background: var(--ui-accent-soft);
}
.help__icon svg {
  width: 1.375rem; height: 1.375rem;
  fill: none; stroke: var(--ui-accent); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.help__text { display: grid; line-height: 1.35; }
.help__text strong { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.help__text small { font-size: 0.8125rem; font-weight: 600; color: var(--ui-accent); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
  width: 100%; max-width: var(--max-w);
  margin: 0; padding: 2rem 2rem 1.25rem;   /* left-aligned; spare space on the right */
}

.topbar__title { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.topbar__sub { margin: 0.25rem 0 0; color: var(--muted); }

.topbar__user { display: flex; align-items: center; gap: 0.75rem; flex: none; }

.avatar {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--ui-accent-soft); color: var(--ui-accent);
  font-weight: 700; font-size: 0.8125rem;
}

.topbar__who { display: grid; line-height: 1.3; }
.topbar__who strong { font-weight: 600; }
.topbar__who small { color: var(--muted); }
/* Extra breathing room before the sign-out control. */
.topbar__user .btn { margin-left: 0.625rem; }

.content { width: 100%; max-width: var(--max-w); margin: 0; padding: 0 2rem 2.5rem; }

/* ============================================================== settings == */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.125rem;              /* 18px */
}

.card.pad { padding: 1.5rem; border: 1px solid var(--line); box-shadow: none; }

/* Brief highlight when a card is deep-linked to (e.g. #settings?focus=team). */
@keyframes card-flash {
  0% { box-shadow: 0 0 0 0 var(--ui-accent-soft); border-color: var(--ui-accent); }
  100% { box-shadow: 0 0 0 6px transparent; border-color: var(--line); }
}
@media (prefers-reduced-motion: no-preference) {
  .card--flash { animation: card-flash 1.6s var(--ease); }
}

.cardhead { display: flex; gap: 0.875rem; margin-bottom: 1.5rem; }

/* Team members */
.team-add { margin-left: auto; align-self: flex-start; flex: none; }
.team-head { padding: 0 0.25rem 0.5rem; border-bottom: 1px solid var(--line); }
.team-head span { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.team-list { display: grid; }
.team-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.25rem; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row__name { flex: 1; min-width: 0; font-size: 0.875rem; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-edit { flex: 1; min-width: 0; }
.team-edit__input { width: 100%; padding: 0.4375rem 0.625rem; border: 1.5px solid var(--ui-accent); border-radius: 0.5rem; font: inherit; font-size: 0.875rem; outline: none; }
.team-badge { flex: none; display: inline-flex; align-items: center; padding: 0.1875rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #dcfce7; color: #16a34a; }
.team-badge.is-off { background: #f1f5f9; color: var(--muted); }
.team-row__btn { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
.team-row__btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.team-row__btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.team-row__del { color: var(--danger); }
.team-row__del:hover { border-color: var(--danger); background: #fef2f2; }
.team-empty { margin: 0; padding: 0.75rem 0.25rem; font-size: 0.8125rem; color: var(--muted); }

/* Photo avatar (member with an uploaded headshot). */
.avatar--photo { background: #eef2f7; padding: 0; overflow: hidden; }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; }

.team-badge--ready { gap: 0.25rem; background: #dcfce7; color: #16a34a; }
.team-badge--ready svg { width: 0.8125rem; height: 0.8125rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.team-badge--warn { background: #fef3c7; color: #b45309; }

/* -------------------------------------------------------- team members -- */
/* Team list rows (mirror the services list). */
.tm { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.875rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.tm:hover { border-color: #cbd5e1; }
.tm.is-editing { border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-soft); }
.tm.is-inactive { opacity: 0.72; }
.tm__body { min-width: 0; display: flex; align-items: center; gap: 0.625rem; }
.tm__name { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Team editor: profile photo + welcome video, stacked vertically in ed-cards. */
.tm-photorow { display: flex; align-items: center; gap: 1rem; }
.tm-photo { flex: none; width: 5rem; height: 5rem; border-radius: 50%; overflow: hidden; background: #f1f5f9; border: 1px solid var(--line); display: grid; place-items: center; }
.tm-photo img { width: 100%; height: 100%; object-fit: cover; }
.tm-photo__empty svg { width: 1.9rem; height: 1.9rem; fill: none; stroke: #94a3b8; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tm-video { width: 100%; aspect-ratio: 16 / 10; border-radius: 0.75rem; overflow: hidden; background: #0f172a; display: grid; place-items: center; margin-bottom: 0.75rem; }
.tm-video video { width: 100%; height: 100%; object-fit: contain; background: #0f172a; }
.tm-video__empty { display: inline-flex; align-items: center; gap: 0.4375rem; color: #94a3b8; font-size: 0.8125rem; }
.tm-video__empty svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Custom player: big play button + a control bar that fades in on hover. */
.tm-video--player { position: relative; }
.tm-player__vid { width: 100%; height: 100%; object-fit: contain; background: #0f172a; cursor: pointer; }
.tm-player__big { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 3.25rem; height: 3.25rem; border: 0; border-radius: 50%; background: rgba(15, 23, 42, 0.55); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color 0.12s; }
.tm-player__big:hover { background: rgba(15, 23, 42, 0.72); }
.tm-player__big svg { width: 1.5rem; height: 1.5rem; margin-left: 2px; }
.tm-player__big[hidden] { display: none; }
.tm-player__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.625rem; background: linear-gradient(transparent, rgba(15, 23, 42, 0.72)); opacity: 0; transition: opacity 0.15s; }
.tm-video--player:hover .tm-player__bar, .tm-video--player:focus-within .tm-player__bar { opacity: 1; }
.tm-player__pp { flex: none; width: 1.6rem; height: 1.6rem; border: 0; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.tm-player__pp svg { width: 1.05rem; height: 1.05rem; }
.tm-player__track { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); cursor: pointer; position: relative; }
.tm-player__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #fff; border-radius: 3px; }
.tm-player__time { flex: none; font-size: 0.7rem; color: #fff; font-variant-numeric: tabular-nums; }

.tm-thumbrow { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.tm-thumbrow:empty { display: none; }
.tm-thumbrow__hint { font-size: 0.75rem; color: var(--muted); line-height: 1.4; flex: 1; min-width: 8rem; }

.tm-vidbtns { display: flex; gap: 0.5rem; }
.tm-photobtns { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }

/* "Add member" / "Add service" — keep the label on one line. */
.svc-panel__head .btn { white-space: nowrap; flex: none; }

/* Webcam photo-capture overlay (Take photo). */
.capshot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.6); }
.capshot__panel { width: min(30rem, 100%); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.capshot__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.capshot__head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.capshot__stage { position: relative; background: #0f172a; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.capshot__video, .capshot__shot { width: 100%; height: 100%; object-fit: cover; }
.capshot__foot { display: flex; justify-content: flex-end; gap: 0.625rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); background: #fafbfc; }
.capshot__foot .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }

/* Circular crop/zoom framing for a profile photo. */
.cropm { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.6); overflow: auto; }
.cropm__panel { width: min(28rem, 100%); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.cropm__head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.125rem 1.25rem; border-bottom: 1px solid var(--line); }
.cropm__head h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; font-weight: 700; }
.cropm__sub { margin: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.cropm__head .editor__close { margin-left: auto; flex: none; }
.cropm__stage { position: relative; width: min(20rem, 72vw); aspect-ratio: 1; margin: 1.25rem auto 0; overflow: hidden; border-radius: 0.75rem; background: #fff; touch-action: none; cursor: grab; }
.cropm__stage:active { cursor: grabbing; }
.cropm__img { position: absolute; top: 0; left: 0; user-select: none; -webkit-user-drag: none; will-change: transform; }
.cropm__mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2000px rgba(15, 23, 42, 0.55); border: 2px solid rgba(255, 255, 255, 0.85); pointer-events: none; }
.cropm__zoom { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem 0; }
.cropm__zoom span { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.cropm__zoom input { flex: 1; accent-color: var(--ui-accent); }
.cropm__foot { display: flex; justify-content: flex-end; gap: 0.625rem; padding: 1.25rem; }
.cropm__foot .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }

/* Standalone thumbnail picker for an existing welcome video. */
.thumbpick { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.6); overflow: auto; }
.thumbpick__panel { width: min(40rem, 100%); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.thumbpick__head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.125rem 1.375rem; border-bottom: 1px solid var(--line); }
.thumbpick__head h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; font-weight: 700; }
.thumbpick__sub { margin: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.thumbpick__head .editor__close { margin-left: auto; flex: none; }
.thumbpick__stage { position: relative; background: #0f172a; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; }
/* The picker's controls stay visible (not hover-gated) so scrubbing is easy. */
.thumbpick__stage .tm-player__bar { opacity: 1; }
.thumbpick__foot { display: flex; justify-content: flex-end; gap: 0.625rem; padding: 1rem 1.375rem; border-top: 1px solid var(--line); }
.thumbpick__foot .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }

/* "Filming tips" link in the video ed-card (name kept from the old modal). */
.memed__tips { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0; border: 0; background: none; color: var(--ui-accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; flex: none; }
.memed__tips:hover { text-decoration: underline; }
.memed__tips svg { width: 0.9375rem; height: 0.9375rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------- filming tips modal -- */
.tips { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.5); overflow: auto; }
.tips__panel { width: min(46rem, 100%); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.tips__head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.375rem; border-bottom: 1px solid var(--line); }
.tips__head h3 { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.tips__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.75rem; padding: 1.375rem; }
/* 25px more breathing room between the text column and the example video. */
.tips__col:first-child { padding-right: 25px; }
.tips__lead { margin: 0 0 1.1875rem; font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }
.tips__list { margin: 0 0 0.875rem; padding-left: 1.125rem; display: grid; gap: 0.5rem; }
.tips__list li { font-size: 0.875rem; color: var(--ink); line-height: 1.45; }
.tips__hint { margin: 0.625rem 0 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }
.tips__vlabel { margin: 0 0 0.5rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
/* Shorter (matches the text height); 10px clear on its right + bottom. */
.tips__video { width: auto; height: 17rem; margin: 0 10px 10px 0; border-radius: 0.75rem; overflow: hidden; background: #0f172a; aspect-ratio: 9 / 16; display: grid; place-items: center; }
.tips__video video { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 640px) {
  .tips__body { grid-template-columns: minmax(0, 1fr); }
}
.cardhead__icon {
  display: grid; place-items: center; flex: none;
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.75rem; background: var(--ui-accent-soft);
}
/* Glyph is 15% then a further 10% up from the original 1.125rem; tile stays 2.25rem. */
/* `color` is set so filled icon parts can use fill="currentColor" — that
   inherits into the <use> shadow tree, which a CSS selector cannot reach. */
.cardhead__icon svg { width: 1.423125rem; height: 1.423125rem; color: var(--ui-accent); fill: none; stroke: var(--ui-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Branding (paint brush) reads slightly small and low-right in its tile — 5%
   larger and nudged up-left so it sits more centred. */
.cardhead__icon.is-brush svg { width: 1.494281rem; height: 1.494281rem; transform: translate(-0.5px, -0.5px); }
.cardhead h2 { margin: 0; font-size: 0.9375rem; font-weight: 700; }   /* 15px */
.cardhead p { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--muted); }  /* 13px */

.field__hint { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.8125rem; }
.field__err { margin: 0.375rem 0 0; color: var(--danger); font-size: 0.8125rem; font-weight: 500; }

.input select {
  flex: 1; min-width: 0; width: 100%;
  padding: 0.8125rem 0.875rem;
  border: 0; background: transparent; font: inherit; color: var(--ink);
  appearance: none; cursor: pointer;
}
.input select:focus { outline: none; }
.input:has(select)::after {
  content: ""; margin-right: 1rem; flex: none;
  width: 0.5rem; height: 0.5rem;
  border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: translateY(-2px) rotate(45deg);
}

.input input:not([type="color"]) { padding: 0.8125rem 0.875rem; font-size: 0.9375rem; }
.input > input:first-child { padding-left: 1rem; }
/* Dashboard fields only — the sign-in form keeps its larger, roomier inputs.
   Covers selects and the colour hex box too, so all field text matches. */
.content .input input:not([type="color"]),
.content .input select,
.content .colour input[type="text"] { font-size: 0.84375rem; }   /* 13.5px */

/* branding */
.brandgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.colstack { display: grid; gap: 1rem; align-content: start; }

.dropzone {
  display: grid; justify-items: center; gap: 0.625rem;
  padding: 1rem;
  border: 1.5px dashed #cbd5e1; border-radius: 1rem;
  text-align: center;
}
.dropzone__preview { position: relative; display: grid; place-items: center; min-height: 4.5rem; width: 100%; }
.dropzone__preview img { max-width: 100%; max-height: 4.5rem; object-fit: contain; }
.logo-clear { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 0.4rem; background: rgba(15, 23, 42, 0.55); color: #fff; cursor: pointer; }
.logo-clear:hover { background: rgba(15, 23, 42, 0.78); }
.logo-clear svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dropzone__empty { color: var(--muted); font-size: 0.8125rem; }
.dropzone .field__hint { margin: 0; }

.colour { display: flex; align-items: center; gap: 0.625rem; border: 1px solid var(--line); border-radius: var(--r-field); padding: 0.375rem 0.5rem 0.375rem 0.375rem; }
.colour input[type="color"] {
  flex: none; width: 2rem; height: 2rem; padding: 0;
  border: 1px solid var(--line); border-radius: 0.5rem; background: none; cursor: pointer;
}
.colour input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.colour input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 0.375rem; }
.colour input[type="text"] {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; font: inherit; font-weight: 600; text-transform: uppercase;
}
.colour input[type="text"]:focus { outline: none; }

/* welcome video */
.videorow { display: grid; grid-template-columns: minmax(0, 13.5rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.videorow__player { position: relative; border-radius: 0.875rem; overflow: hidden; background: #0f172a; aspect-ratio: 16 / 10; display: grid; place-items: center; }
.videorow__player video { width: 100%; height: 100%; object-fit: cover; }
.videorow__empty { color: #94a3b8; font-size: 0.8125rem; padding: 0.5rem; text-align: center; }
.videorow__dur {
  position: absolute; right: 0.5rem; bottom: 0.5rem;
  padding: 0.125rem 0.375rem; border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 0.75rem; font-weight: 600;
}
.videorow__meta { display: grid; gap: 0.375rem; justify-items: start; }
/* Stack the label, filename and date rather than letting them run together. */
.videorow__meta > div { display: grid; gap: 0.125rem; justify-items: start; }
.videorow__meta strong { font-weight: 600; }
.videorow__file { color: var(--ink-2); word-break: break-all; }
.videorow__date { color: var(--muted); font-size: 0.8125rem; }
.videorow__meta .btn { margin-top: 0.375rem; }
.videorow__actions { display: flex; gap: 0.5rem; }
.videorow__meta .field__hint { margin: 0; }

.tworow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

/* checkbox row */
.check { display: flex; align-items: center; gap: 0.625rem; cursor: pointer; font-size: 0.78125rem; font-weight: 500; color: var(--ink-2); }
.check input[type="checkbox"] {
  flex: none; width: 1.125rem; height: 1.125rem; margin: 0;
  accent-color: var(--ui-accent); cursor: pointer;
}
.check + .note { margin: 0.75rem 0 0; }

/* a disabled field should read as switched off, not merely unresponsive */
.input.is-disabled { background: #f8fafc; border-color: var(--line); }
.input.is-disabled input { color: var(--muted); cursor: not-allowed; }

/* save bar */
.savebar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  margin-top: 1.125rem; padding: 1.0625rem 1.25rem;
  border: 1px solid var(--line); box-shadow: none;
}
/* Compact controls so the bar stays low-profile. */
.savebar .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }
.savebar__state { display: flex; align-items: center; gap: 0.75rem; }
.savebar__state span { display: grid; line-height: 1.35; }
.savebar__state strong { font-weight: 600; }
.savebar__state small { color: var(--muted); }
.savebar__tick {
  display: grid !important; place-items: center; flex: none;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--ui-accent-soft);
}
.savebar__tick svg { width: 1.155rem; height: 1.155rem; fill: none; stroke: var(--ui-accent); stroke-width: 2.9; stroke-linecap: round; stroke-linejoin: round; }
.savebar__dot { flex: none; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: #f59e0b; }
.savebar__dot--bad { background: var(--danger); }
.savebar__actions { display: flex; gap: 0.75rem; flex: none; }

.btn--sm { padding: 0.5rem 0.875rem; font-size: 0.875rem; }
.btn__icon { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--ghost .spinner { border-color: rgba(100, 116, 139, 0.35); border-top-color: var(--ink-2); }

.empty { padding: 3rem 2rem; text-align: center; border: 1px solid var(--line); box-shadow: none; }
.empty__title { margin: 0 0 0.375rem; font-size: 1.125rem; font-weight: 700; }
.empty__text { margin: 0; color: var(--muted); }

/* ============================================================== services == */
.services { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
/* Base split is 1.05 : 1.1; the ∓20px shifts that much width from the list
   pane to the editor pane (1.25rem = the column gap). */
.services:has(.svc-editor.is-open) {
  grid-template-columns:
    minmax(0, calc((100% - 1.25rem) * 1.05 / 2.15 - 20px))
    minmax(0, calc((100% - 1.25rem) * 1.10 / 2.15 + 20px));
}

/* --- toggle switch (shared by list + editor) --- */
.toggle {
  flex: none; width: 2.5rem; height: 1.375rem; padding: 0;
  border: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer;
  position: relative; transition: background-color 0.15s;
}
/* Knob centred vertically via top:50%/translateY; symmetric 2px ends. */
.toggle > span {
  position: absolute; top: 50%; left: 2px;
  width: 1.125rem; height: 1.125rem; border-radius: 50%; background: #fff;
  transform: translateY(-50%);
  transition: left 0.15s; box-shadow: 0 1px 2px rgba(15,23,42,0.3);
}
.toggle[aria-checked="true"] { background: var(--ui-accent); }
.toggle[aria-checked="true"] > span { left: calc(100% - 1.125rem - 2px); }
.toggle:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

/* --- left panel --- */
.svc-panel { padding: 1.5rem; border: 1px solid var(--line); box-shadow: none; }
.svc-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.svc-panel__head h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.svc-panel__head p { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--muted); }

.svc-list { display: grid; gap: 0.75rem; }
.svc-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 1rem; }

.svc {
  display: grid;
  grid-template-columns: auto 3.25rem 1fr auto auto auto;
  align-items: center; gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line); border-radius: 1rem;
  background: var(--surface); cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.svc:hover { border-color: #cbd5e1; }
.svc.is-editing { border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-soft); }
.svc.is-inactive { opacity: 0.72; }
.svc.is-dragging { opacity: 0.4; }

.svc__grip { display: grid; place-items: center; cursor: grab; color: #cbd5e1; }
.svc__grip svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.svc__grip:active { cursor: grabbing; }

.svc__thumb {
  display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem; border-radius: 0.75rem;
  background: var(--ui-accent-soft); color: var(--ui-accent);
  font-weight: 700; font-size: 1.125rem;
}
/* Canva icon tiles already include their own rounded background, so the img
   fills the thumb and the surrounding tile bg is hidden. */
.svc__thumb--icon { background: none; padding: 0; overflow: hidden; }
.svc__thumb--icon img { width: 100%; height: 100%; object-fit: contain; }
.svc__body { min-width: 0; }
.svc__name { margin: 0; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc__fee { margin: 0.125rem 0 0.375rem; font-size: 0.75rem; color: var(--muted); }
.svc__tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.tag { display: inline-flex; align-items: center; padding: 0.1875rem 0.5rem; border-radius: 0.5rem; font-size: 0.6875rem; font-weight: 600; }
.tag--intro { background: #dcfce7; color: #15803d; }
.tag--explainer { background: var(--ui-accent-soft); color: var(--ui-accent-strong); }
.tag--faq { background: #eef2f7; color: var(--ink-2); }

.svc__state { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.svc.is-inactive .svc__state { color: #94a3b8; }
.svc__open { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 0; background: none; cursor: pointer; color: #94a3b8; }
.svc__open svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.svc:hover .svc__open { color: var(--ui-accent); }

.svc-foot { display: flex; align-items: center; gap: 0.375rem; margin: 1rem 0 0; font-size: 0.75rem; color: var(--muted); }
.svc-foot__icon { width: 0.875rem; height: 0.875rem; fill: currentColor; }

/* --- right editor panel --- */
.svc-editor { position: sticky; top: 1rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.svc-editor:not(.is-open) { display: none; }
/* When closed, let the list use the full width. */
.services:not(:has(.svc-editor.is-open)) { grid-template-columns: minmax(0, 1fr); }
.services:not(:has(.svc-editor.is-open)) .svc-panel { max-width: 46rem; }

.editor__head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.editor__head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.editor__head-actions { display: flex; align-items: center; gap: 0.25rem; }
.editor__close, .editor__delete { display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 0.5rem; background: none; cursor: pointer; color: var(--muted); }
.editor__close:hover { background: #f1f5f9; }
.editor__delete:hover { background: var(--danger-soft); color: var(--danger); }
.editor__close svg, .editor__delete svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.editor__body { padding: 1.25rem; display: grid; gap: 1rem; max-height: calc(100vh - 12rem); overflow-y: auto; background: var(--app-bg); }

/* Each settings category is its own card. */
.ed-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
/* A field that IS the card's content shouldn't add its margin under the card padding. */
.ed-card > .field { margin-bottom: 0; }
.ed-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ed-card__head h3 { margin: 0; font-size: 0.9375rem; font-weight: 700; }
.ed-card__sub { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--muted); }

.ed-row { display: flex; gap: 1rem; align-items: flex-start; }
.ed-grow { flex: 1; margin: 0; }
.ed-active { display: grid; gap: 0.5rem; justify-items: start; }
/* grid gap already spaces the label; drop its margin so the tile top aligns
   with the adjacent input (which only has the 0.5rem label margin). */
.ed-icon .field__label, .ed-active .field__label { margin-bottom: 0; }
.ed-custom { margin-top: 1rem; }

/* Service-type selector grid */
.typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr)); gap: 0.625rem; }
.typecard {
  position: relative; display: grid; justify-items: center; gap: 0.5rem;
  padding: 0.875rem 0.5rem; border: 1.5px solid var(--line); border-radius: 0.875rem;
  background: var(--surface); cursor: pointer; transition: border-color 0.12s, background-color 0.12s;
}
.typecard:hover { border-color: #cbd5e1; }
.typecard.is-selected { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.typecard__icon { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; }
.typecard__icon img { width: 100%; height: 100%; object-fit: contain; }
.typecard__plus { width: 1.4rem; height: 1.4rem; fill: none; stroke: var(--ui-accent); stroke-width: 2; stroke-linecap: round; }
.typecard__label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.2; }
.typecard.is-selected .typecard__label { color: var(--ui-accent); }
.typecard--custom { border-style: dashed; }
.typecard__check {
  position: absolute; top: 0.375rem; right: 0.375rem;
  display: grid; place-items: center; width: 1.15rem; height: 1.15rem;
  background: var(--ui-accent); border-radius: 50%;
}
.typecard__check svg { width: 0.7rem; height: 0.7rem; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.typecard.is-used { opacity: 0.5; cursor: not-allowed; background: #f8fafc; }
.typecard.is-used:hover { border-color: var(--line); }
.ed-icon { display: grid; gap: 0.5rem; justify-items: start; }
.iconpick {
  display: grid; place-items: center;
  width: 2.9rem; height: 2.9rem;
  border: 1.5px dashed #cbd5e1; border-radius: 0.75rem;
  background: none; cursor: pointer; color: #94a3b8;
}
.iconpick.has-icon { border-style: solid; border-color: var(--line); padding: 0; overflow: hidden; }
.iconpick:hover { border-color: var(--ui-accent); color: var(--ui-accent); }
.iconpick img { width: 100%; height: 100%; object-fit: contain; }
.iconpick .iconpick__plus { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* icon picker modal */
.iconmodal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.5rem; background: rgba(15,23,42,0.4); }
.iconmodal__panel { width: min(40rem, 100%); max-height: 82vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.iconmodal__head { display: flex; align-items: center; justify-content: space-between; padding: 1.125rem 1.5rem; border-bottom: 1px solid var(--line); }
.iconmodal__head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.iconmodal__search { padding: 1rem 1.5rem 0.5rem; }
.iconmodal__search input { width: 100%; padding: 0.6875rem 0.875rem; border: 1px solid var(--line); border-radius: var(--r-field); font: inherit; font-size: 0.875rem; }
.iconmodal__search input:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.14); }
.iconmodal__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.625rem; padding: 1rem 1.5rem; overflow-y: auto; }
.iconmodal__foot { padding: 0.75rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }

.iconopt { padding: 0.25rem; border: 2px solid transparent; border-radius: 0.875rem; background: none; cursor: pointer; aspect-ratio: 1; }
.iconopt img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 0.625rem; }
.iconopt:hover { border-color: var(--line); }
.iconopt.is-selected { border-color: var(--ui-accent); }

@media (max-width: 32rem) { .iconmodal__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.editor__body textarea {
  width: 100%; padding: 0.75rem 0.875rem;
  border: 1px solid var(--line); border-radius: var(--r-field);
  font: inherit; font-size: 0.84375rem; color: var(--ink); resize: vertical;
}
.editor__body textarea:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.14); }
/* settings free-text (financing) */
.set-ta { width: 100%; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--r-field); background: var(--surface); font: inherit; font-size: 0.875rem; line-height: 1.5; color: var(--ink); resize: vertical; min-height: 6.5rem; }
.set-ta:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.14); }
.counter { margin-top: 0.25rem; text-align: right; font-size: 0.75rem; color: #94a3b8; }

.ed-videos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.vid__slot { margin-top: 0.25rem; }
.vid__slot.is-busy { opacity: 0.5; pointer-events: none; }
.vid__upload {
  display: grid; place-items: center; gap: 0.25rem; width: 100%;
  padding: 1rem; border: 1.5px dashed #cbd5e1; border-radius: 0.875rem;
  background: none; cursor: pointer; color: var(--muted);
}
.vid__upload:hover { border-color: var(--ui-accent); color: var(--ui-accent); }
.vid__upload svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vid__upload small { font-size: 0.6875rem; }
.vid__slot:has(.vid__thumb) { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: 0.875rem; }
.vid__thumb { width: 3.25rem; height: 2.5rem; border-radius: 0.5rem; object-fit: cover; background: #0f172a; flex: none; }
.vid__meta { display: grid; min-width: 0; flex: 1; }
.vid__name { font-size: 0.78125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid__size { font-size: 0.6875rem; color: var(--muted); }
.vid__del { flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 0; background: none; cursor: pointer; color: #94a3b8; }
.vid__del:hover { color: var(--danger); }
.vid__del svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vid__slot--wide { max-width: 22rem; }

/* ---- Explainer video card (AI vs upload) ---- */
.badge-rec {
  display: inline-block; margin-left: 0.375rem; vertical-align: 2px;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  background: var(--ui-accent-soft); color: var(--ui-accent);
  font-size: 0.6875rem; font-weight: 700;
}
.exp-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.exp-opt {
  position: relative; padding: 1.125rem; border: 1.5px solid var(--line);
  border-radius: 1rem; background: var(--surface); cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.exp-opt:hover { border-color: #cbd5e1; }
.exp-opt.is-selected { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.exp-opt.is-unavailable { opacity: 0.5; cursor: not-allowed; }
.exp-opt.is-unavailable:hover { border-color: var(--line); }

.exp-opt__radio {
  position: absolute; top: 1rem; right: 1rem;
  display: grid; place-items: center; width: 1.375rem; height: 1.375rem;
  border: 2px solid #cbd5e1; border-radius: 50%; background: var(--surface);
}
.exp-opt__radio svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.exp-opt.is-selected .exp-opt__radio { background: var(--ui-accent); border-color: var(--ui-accent); }
.exp-opt.is-selected .exp-opt__radio svg { opacity: 1; }

.exp-opt__head { display: flex; gap: 0.75rem; padding-right: 2rem; }
.exp-opt__icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; background: #f1f5f9; color: var(--muted); }
.exp-opt__icon--ai { background: var(--ui-accent-soft); color: var(--ui-accent); }
.exp-opt__icon svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* AI sparkle is a filled glyph and reads bigger. */
.exp-opt__icon--ai svg { width: 1.8rem; height: 1.8rem; }
.exp-opt__head strong { font-size: 0.875rem; font-weight: 700; }
.exp-opt__sub { margin: 0.125rem 0 0; font-size: 0.75rem; color: var(--muted); }

.exp-ai__body { display: grid; gap: 0.625rem; margin-top: 1rem; }
.exp-ai__thumb { position: relative; width: 100%; aspect-ratio: 16 / 8; border-radius: 0.75rem; background: linear-gradient(135deg, #cfd6ef, #e7e9fe); display: grid; place-items: center; overflow: hidden; }
.exp-ai__thumb::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(transparent, rgba(15, 23, 42, 0.5)); }
.exp-ai__play { position: relative; z-index: 1; width: 2.5rem; height: 2.5rem; fill: none; stroke: #fff; stroke-width: 1.5; opacity: 0.95; }
.exp-ai__thumbtitle { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0.5rem; z-index: 1; color: #fff; font-size: 0.75rem; font-weight: 500; text-align: center; white-space: nowrap; }
.exp-ai__preview { display: inline-flex; align-items: center; gap: 0.3125rem; justify-self: start; font-size: 0.75rem; font-weight: 600; color: var(--ui-accent); cursor: pointer; }
.exp-ai__preview:hover { text-decoration: underline; }
.exp-ai__preview svg { width: 0.875rem; height: 0.875rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.exp-upload__body { margin-top: 1rem; }
.exp-upload__body .vid__slot { margin-top: 0; }


@media (max-width: 60rem) { .exp-options { grid-template-columns: minmax(0, 1fr); } }

/* Service-specific intro override — collapsible, at the bottom of the card */
.intro-override { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.intro-override__toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.intro-override__toggle strong { font-size: 0.875rem; font-weight: 500; }
.intro-override__toggle .ed-chevron svg { transform: rotate(0deg); transition: transform 0.15s; }
.intro-override.is-open .ed-chevron svg { transform: rotate(90deg); }
.intro-override__body { margin-top: 1rem; }

/* Instant-simulation card: label left, toggle right */
/* Instant simulation is mandatory for presets, unavailable for custom — an
   informational panel, not a toggle. */
.ed-siminfo { display: flex; align-items: flex-start; gap: 0.75rem; }
.ed-siminfo strong { font-size: 0.9375rem; font-weight: 700; }
.ed-siminfo .ed-card__sub { margin-top: 0.125rem; }
.ed-siminfo__ic { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.5rem; background: #dcfce7; color: #16a34a; }
.ed-siminfo__ic svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed-siminfo.is-off .ed-siminfo__ic { background: #f1f5f9; color: var(--muted); }
.ed-siminfo.is-off strong { color: var(--muted); }
.toggle:disabled > span { box-shadow: none; }

.ed-currency { flex: none; font-size: 0.78125rem; font-weight: 600; color: var(--muted); padding: 0.375rem 0.625rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 0.5rem; }

/* Pricing: tabbed mode selector, info banner, then the fee grid */
.feetabs { display: flex; gap: 0.375rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.feetab { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.625rem 0.875rem; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0.5rem 0.5rem 0 0; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.feetab__icon { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feetab:hover { color: var(--ink-2); }
.feetab.is-active { color: var(--ui-accent); border-bottom-color: var(--ui-accent); background: var(--ui-accent-soft); }

/* Monthly column is a touch wider so its longer label stays on one line and
   its input lines up with the Low/High inputs (align-items:start keeps the
   input row consistent even if a label does wrap). */
.ed-fees__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.45fr); gap: 0.75rem; align-items: start; }
.ed-fees.is-single .ed-fees__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.ed-fees__grid .field { margin: 0; }
.ed-fees.is-single #ff-high { display: none; }
.input--fee .input__suffix { flex: none; padding-right: 0.875rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }

/* monthly field: number input + inline 12/24-month toggle (no currency suffix) */
.termtoggle { display: inline-flex; flex: none; gap: 0.125rem; margin-right: 0.3125rem; padding: 0.125rem; background: #f1f5f9; border-radius: 0.5rem; }
.termtoggle__opt { padding: 0.25rem 0.4375rem; border: 0; border-radius: 0.375rem; background: none; font: inherit; font-size: 0.6875rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.termtoggle__opt:hover { color: var(--ink-2); }
.termtoggle__opt.is-active { background: var(--surface); color: var(--ui-accent); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.field__cap { margin: 0.375rem 0 0; font-size: 0.6875rem; color: var(--muted); }
/* fee field labels 2px smaller than the standard 14px label */
.ed-fees__grid .field__label { font-size: 0.75rem; }

/* Collapsible card (special offer) */
.ed-collapse { cursor: pointer; margin-bottom: 0; }
.ed-chevron { display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border: 0; background: none; cursor: pointer; color: var(--muted); }
.ed-chevron svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); transition: transform 0.15s; }
.ed-card.is-collapsed .ed-chevron svg { transform: rotate(0deg); }
.ed-collapse__body { margin-top: 1rem; }
.ed-card.is-collapsed .ed-collapse__body { display: none; }
.ed-card.is-collapsed .ed-collapse { margin-bottom: 0; }
.ed-card__note { display: flex; align-items: center; gap: 0.4375rem; margin: 0.625rem 0 0; font-size: 0.75rem; color: var(--muted); }
.ed-card__note-icon { flex: none; width: 0.9375rem; height: 0.9375rem; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* --- FAQ builder --- */
.faq { display: grid; gap: 0.75rem; }
.faq__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq__title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; }
.faq__icon { width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--ui-accent); stroke-width: 1.7; }
.faq__note { margin: 0; padding: 0.75rem 0.875rem; background: var(--ui-accent-soft); border-radius: 0.75rem; font-size: 0.78125rem; color: var(--ink-2); }
.faq__empty { margin: 0; color: var(--muted); font-size: 0.8125rem; }
.faq__list { display: grid; gap: 0.625rem; }

.faqrow { display: grid; grid-template-columns: auto auto 1fr auto; align-items: start; gap: 0.625rem; padding: 0.625rem; border: 1px solid var(--line); border-radius: 0.875rem; background: var(--surface); }
.faqrow.is-dragging { opacity: 0.4; }
.faqrow__grip { display: grid; place-items: center; padding-top: 0.5rem; color: #cbd5e1; cursor: grab; }
.faqrow__grip svg { width: 1rem; height: 1rem; fill: currentColor; }
.faqrow__num { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-top: 0.375rem; border-radius: 0.5rem; background: #f1f5f9; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.faqrow__main { display: grid; gap: 0.375rem; min-width: 0; }
/* Tint the question and answer inputs so they read as distinct. */
.faqrow__main .input { background: #f0f3fd; }
.faqrow__main .faq-a { background: #f5f9f5; }
/* Collapsible answer: question bar always visible, answer opens on the chevron. */
.faqrow__qbar { display: flex; align-items: center; gap: 0.375rem; }
.faqrow__qbar .input { flex: 1; min-width: 0; }
.faqrow__toggle { flex: none; display: grid; place-items: center; width: 1.875rem; height: 1.875rem; border: 0; border-radius: 0.5rem; background: none; color: #94a3b8; cursor: pointer; transition: background-color 0.12s, color 0.12s; }
.faqrow__toggle:hover { background: var(--ui-accent-soft); color: var(--ui-accent); }
.faqrow__toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.faqrow.is-open .faqrow__toggle svg { transform: rotate(180deg); }
.faqrow .faq-a { display: none; }
.faqrow.is-open .faq-a { display: block; }
.faqrow__del { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: 0.25rem; border: 0; background: none; cursor: pointer; color: #94a3b8; }
.faqrow__del:hover { color: var(--danger); }
.faqrow__del svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Treatment plans (service editor) — collapsible accordion */
.plans-list { display: grid; gap: 0.625rem; }
.plans-add { margin-top: 0.875rem; }
.planrow { border: 1px solid var(--line); border-radius: 0.875rem; background: var(--surface); overflow: hidden; }
.planrow__header { display: flex; align-items: center; gap: 0.5rem; padding: 0.6875rem 0.875rem; cursor: pointer; transition: background-color 0.12s; }
.planrow__header:hover { background: #f8fafc; }
.planrow__name { font-size: 0.875rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.planrow__name.is-empty { font-weight: 500; color: var(--muted); }
.planrow__summary { flex: 1; min-width: 0; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.planrow.is-open .planrow__summary { display: none; }
.planrow__del { flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 0; background: none; cursor: pointer; color: #94a3b8; }
.planrow__del:hover { color: var(--danger); }
.planrow__del svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.planrow__chev { flex: none; width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.planrow.is-open .planrow__chev { transform: rotate(180deg); }
.planrow__body { display: none; }
.planrow.is-open .planrow__body { display: grid; gap: 0.75rem; padding: 0.25rem 0.875rem 0.875rem; }
.planrow__done { justify-self: start; margin-top: 0.25rem; }
.plan-block__label { font-size: 0.8125rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.plan-block .feetabs { margin-bottom: 0.75rem; }
.plan-block .durval { font-size: 0.875rem; }
.plan-fees { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: start; }
.plan-fees.is-single { grid-template-columns: minmax(0, 1fr); }
.plan-fees.is-single .plan-fee-highwrap { display: none; }

/* Before & after result photos */
.ba-list { display: grid; gap: 0.875rem; margin-bottom: 0.875rem; }
.ba-list .faq__empty { font-size: 0.75rem; }   /* "No before/after photos yet." — 1px smaller */
.ba-add-more { width: 100%; justify-content: center; margin-bottom: 0.875rem; border-style: dashed; }
.barow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: stretch; }
.baslot { display: grid; grid-template-rows: auto 1fr; gap: 0.375rem; }
.baslot__label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.baslot__upload { display: grid; place-content: center; justify-items: center; gap: 0.25rem; aspect-ratio: 4 / 3; border: 1.5px dashed var(--line); border-radius: 0.625rem; background: #f8fafc; color: var(--muted); font: inherit; font-size: 0.75rem; cursor: pointer; transition: border-color 0.12s, background-color 0.12s; }
.baslot__upload:hover { border-color: #cbd5e1; background: #f1f5f9; }
.baslot__upload svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.baslot.is-busy { opacity: 0.55; pointer-events: none; }
.bathumb { position: relative; aspect-ratio: 4 / 3; border-radius: 0.625rem; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9; }
.bathumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bathumb__del { position: absolute; top: 0.375rem; right: 0.375rem; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 0; border-radius: 0.4rem; background: rgba(15, 23, 42, 0.6); color: #fff; cursor: pointer; }
.bathumb__del:hover { background: rgba(15, 23, 42, 0.8); }
.bathumb__del svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.barow__del { align-self: center; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 0; background: none; cursor: pointer; color: #94a3b8; }
.barow__del:hover { color: var(--danger); }
.barow__del svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.editor__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface); }
/* Match the Practice Settings save-bar button size. */
.editor__bar .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }

@media (max-width: 68rem) {
  .services, .services:has(.svc-editor.is-open) { grid-template-columns: minmax(0, 1fr); }
  .svc-editor { position: static; }
}

/* ----------------------------------------------------------------- mobile -- */
@media (max-width: 60rem) {
  .grid, .brandgrid { grid-template-columns: minmax(0, 1fr); }
  .videorow { grid-template-columns: minmax(0, 1fr); }
  .videorow__player { max-width: 20rem; }
}

@media (max-width: 48rem) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; align-items: center; gap: 0.75rem;
    overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 0.75rem 19px;
  }
  .brand { padding: 0; }
  .nav { grid-auto-flow: column; gap: 0.25rem; }
  .nav__item.is-active::before { display: none; }
  .nav__item span { display: none; }
  .sidebar__foot { display: none; }   /* no room for it in the horizontal bar */
  .topbar { flex-direction: column; padding: 1.5rem 19px 1rem; }
  .topbar__user { align-self: flex-start; }
  .content { padding: 0 19px 2rem; }
  .savebar { flex-direction: column; align-items: stretch; }
  .savebar__actions .btn { flex: 1; }
}

@media (max-width: 32rem) {
  .view-login { padding: 1.5rem 19px; }   /* 19px inset, per the container spec */
  .login { padding: 2.25rem 1.5rem; }
  .login__title { font-size: 1.75rem; }
  .login__sub { font-size: 1rem; margin-bottom: 1.75rem; }
  .tworow { grid-template-columns: minmax(0, 1fr); }
}

/* ==================================================== screen 3: submissions == */
/* Shared date-range filter (Submissions + Outcomes). */
.drange { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.drange__opt { padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
.drange__opt:hover { background: #f8fafc; }
.drange__opt.is-active { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.drange__custom { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 0.25rem; }
.drange__custom[hidden] { display: none; }
.drange__date { padding: 0.35rem 0.55rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface); font: inherit; font-size: 0.8125rem; color: var(--ink); cursor: pointer; }
.drange__dash { color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-bottom: 1.25rem; }
.stat { flex: 1 1 12rem; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.125rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.stat__icon { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 0.875rem; }
.stat__icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.t-blue { background: #e7e9fe; color: #525ef5; } .t-violet { background: #ede9fe; color: #7c3aed; }
.t-green { background: #dcfce7; color: #16a34a; } .t-orange { background: #ffedd5; color: #ea580c; }
.t-teal { background: #f5e8fc; color: #9b58cd; }   /* Viewed */
.t-slate { background: #f1f5f9; color: #64748b; }
.t-pink { background: #fce7f3; color: #db2777; }
.t-treated { background: #16a34a; color: #dcfce7; }   /* inverted green */
.stat__body { display: grid; line-height: 1.25; }
.stat__body strong { font-size: 1.5rem; font-weight: 700; }
.stat__label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.stat__body small { font-size: 0.6875rem; color: var(--muted); }
.stat--period { flex: 0 0 auto; }
.stat--period strong { display: block; font-size: 0.875rem; }
.stat--period small { font-size: 0.75rem; color: var(--muted); }
.stat__cal, .stat__caret { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.subs-card { padding: 0.5rem 0.5rem 0; border: 1px solid var(--line); box-shadow: none; }
.subs-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; padding: 0.75rem 0.875rem; }
.subtab { padding: 0.4375rem 0.75rem; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.subtab:hover { color: var(--ink-2); }
.subtab.is-active { color: var(--ui-accent); border: 1px solid var(--ui-accent); }
.subtab__n { color: inherit; opacity: 0.7; }
.subs-tools { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.subs-search { display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.625rem; border: 1px solid var(--line); border-radius: 0.625rem; }
.subs-search svg { width: 1rem; height: 1rem; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.subs-search input { border: 0; background: none; font: inherit; font-size: 0.8125rem; outline: none; width: 11rem; }

.subs-head, .subrow { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr 1fr 1fr 0.9fr; align-items: center; gap: 0.75rem; }
.subs-head { padding: 0.625rem 1rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.subs-list { display: grid; }
.subrow { width: 100%; padding: 0.75rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; font: inherit; }
.subrow:hover { background: #f8fafc; }
.subrow__patient { display: flex; align-items: center; gap: 0.625rem; }
.subrow__name { font-size: 0.875rem; font-weight: 600; }
.subrow__mobile { font-size: 0.8125rem; color: var(--ink-2); }
.subrow__concern { font-size: 0.8125rem; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-right: 0.5rem; }
.subrow__photos { display: flex; gap: 0.25rem; padding-left: 0.625rem; }
/* centre Status in its column, then nudge 15px left off Submitted */
.subrow__status, .subs-head span:nth-child(5) { justify-self: center; transform: translateX(-5px); }
.subrow__status .badge { white-space: nowrap; }
.subs-head span:nth-child(4) { padding-left: 0.625rem; }
.subrow__time, .subs-head span:nth-child(6) { transform: translateX(20px); }
.subrow__time { display: flex; align-items: center; justify-content: space-between; gap: 0.375rem; font-size: 0.8125rem; color: var(--muted); }
.subrow__chev { width: 1rem; height: 1rem; fill: none; stroke: #cbd5e1; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.avatar--a { background: #e7e9fe; color: #525ef5; } .avatar--b { background: #dcfce7; color: #16a34a; }
.avatar--c { background: #fef3c7; color: #d97706; } .avatar--d { background: #dbeafe; color: #2563eb; }
.avatar--e { background: #fce7f3; color: #db2777; }
.avatar--lg { width: 3.25rem; height: 3.25rem; font-size: 1rem; }

.badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: currentColor; }
/* Submission statuses. Automatic: new → sent → consult → booking. Manual:
   booked, treated (solid = the win), not interested (grey). */
.s-new { background: #e7e9fe; color: #525ef5; }
.s-sent { background: #dcfce7; color: #16a34a; }
.s-consult { background: #f5e8fc; color: #9b58cd; }   /* Viewed */
.s-booking { background: #ffedd5; color: #ea580c; }
.s-booked { background: #fce7f3; color: #db2777; }
.s-noshow { background: #fee2e2; color: #dc2626; }
.s-treated { background: #16a34a; color: #fff; }
.s-not { background: #f1f5f9; color: #64748b; }

/* Inline status control on each submission row. */
.subrow__status { position: relative; }
.status-pill { border: 0; cursor: pointer; font: inherit; }
.status-pill__caret { width: 0.85rem; height: 0.85rem; margin-left: 0.0625rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.subrow__status.is-open .status-pill__caret { transform: rotate(180deg); }
.status-menu { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); z-index: 30; min-width: 12.5rem; padding: 0.375rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.625rem; box-shadow: var(--shadow-card); }
.status-menu__label { margin: 0.125rem 0.375rem 0.3125rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.status-opt { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.4375rem 0.5rem; border: 0; border-radius: 0.4375rem; background: none; font: inherit; font-size: 0.8125rem; text-align: left; color: var(--ink); cursor: pointer; }
.status-opt:hover { background: #f8fafc; }
.status-opt.is-current { font-weight: 600; background: #f8fafc; }
.status-opt__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; }
.status-opt__dot.s-booked { background: #db2777; }
.status-opt__dot.s-noshow { background: #dc2626; }
.status-opt__dot.s-treated { background: #16a34a; }
.status-opt__dot.s-not { background: #64748b; }
.status-opt--clear { color: var(--muted); border-top: 1px solid var(--line); margin-top: 0.25rem; padding-top: 0.5rem; border-radius: 0; }
.status-pill--empty { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border: 1px dashed var(--line); border-radius: 999px; background: none; font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.status-pill--empty:hover { border-color: #cbd5e1; color: var(--ink-2); }

/* Segmented toggle (worklist filter) */
.seg { display: inline-flex; gap: 0.125rem; padding: 0.1875rem; background: #f1f5f9; border-radius: 0.625rem; }
.seg__opt { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border: 0; border-radius: 0.5rem; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg__opt.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.seg__n { font-size: 0.75rem; color: var(--muted); }
.seg__opt.is-active .seg__n { color: var(--ui-accent); }

/* Outcomes page worklist */
.olist-bar { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--line); }
.olist-head, .orow { display: grid; grid-template-columns: 1.5fr 1.1fr 1fr 1.2fr 0.55fr; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; }
.olist-head span:last-child { white-space: nowrap; }
.olist-head { font-size: 0.75rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.olist { display: grid; }
.olist-empty { margin: 0; padding: 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.orow { border-bottom: 1px solid var(--line); }
.orow:last-child { border-bottom: 0; }
.orow__patient { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.orow__name { font-size: 0.875rem; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow__mobile { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--ink-2); text-decoration: none; min-width: 0; }
.orow__mobile:hover { color: var(--ui-accent); }
.orow__mobile svg { flex: none; width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.orow__outcome { position: relative; }
.orow__outcome .status-menu { left: 0; transform: none; }
.orow__outcome.is-open .status-pill__caret { transform: rotate(180deg); }
.orow__age { font-size: 0.8125rem; color: var(--muted); }

/* Grade screen Actions menu */
.grade-actions { position: relative; }
.grade-actions .btn__icon { transition: transform 0.15s; }
.grade-actions.is-open .btn__icon { transform: rotate(180deg); }
.grade-actions .status-menu { left: auto; right: 0; transform: none; }

.ph { width: 2.25rem; height: 1.75rem; border-radius: 0.375rem; flex: none; background: linear-gradient(135deg, #f1d6c4, #e7b9a3); }
.ph--a { background: linear-gradient(135deg, #f3d9c8, #e6b39c); } .ph--b { background: linear-gradient(135deg, #f4dbc9, #e8bda6); }
.ph--c { background: linear-gradient(135deg, #f1d6c4, #e2ad95); } .ph--d { background: linear-gradient(135deg, #f5ddca, #ebc0a9); }
.ph--e { background: linear-gradient(135deg, #f2d7c5, #e4b19a); }
/* Real submission photo thumbnails + empty slot (queue rows). */
.ph--img { object-fit: cover; background: #efe7de; }
.ph--empty { background: #f1ece6; border: 1px dashed #e0d6ca; }
.subs-loading { padding: 2.5rem 1rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.subs-empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.subs-empty svg { width: 2.5rem; height: 2.5rem; stroke: currentColor; fill: none; opacity: 0.5; }
.subs-empty p { margin: 0; max-width: 24rem; font-size: 0.9rem; line-height: 1.5; }

.subs-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 1rem; font-size: 0.8125rem; color: var(--muted); }
.subs-foot__right { display: flex; align-items: center; gap: 1rem; }
.subs-perpage { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.subs-perpage select { padding: 0.3125rem 0.5rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface); font: inherit; font-size: 0.8125rem; color: var(--ink); cursor: pointer; }
.pager { display: flex; align-items: center; gap: 0.25rem; }
.pager__pg, .pager__nav { min-width: 1.75rem; height: 1.75rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.pager__pg.is-active { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.pager__gap { padding: 0 0.25rem; color: var(--muted); }

/* ==================================================== screen 4: grade == */
.backlink { display: inline-flex; align-items: center; gap: 0.4375rem; font-size: 0.875rem; font-weight: 600; color: var(--ui-accent); text-decoration: none; margin-bottom: 0.5rem; }
.backlink svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Header on the left; meta pulled out of flow to the bottom-right so it sits
   just above the cards without pushing the header text up. */
.grade-top { position: relative; margin-bottom: 45px; }
.grade-header { margin: 0; }
.grade-title { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.grade-subtitle { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); }
.grade-meta { position: absolute; right: 0; bottom: -31px; display: flex; align-items: center; gap: 0.875rem; }
.grade-meta__info { padding: 0.4375rem 0.875rem; border: 1px solid var(--line); border-radius: 0.625rem; font-size: 0.8125rem; color: var(--muted); }
.grade-delete { color: var(--ink); }

.grade { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr); gap: 1.25rem; align-items: start; }
.grade-patient, .grade-form { padding: 1.5rem; border: 1px solid var(--line); box-shadow: none; }
/* The panel scrolls with the page, then its bottom (the Download button) pins to the bottom of
   the screen once reached — driven by updateStickyPanel() in grade.js (CSS sticky proved
   unreliable inside this grid). The column holds the reserved space; the aside is translated. */
.grade-patient-col { align-self: stretch; }
.grade-patient { will-change: transform; }
.grade-h { margin: 0 0 1.25rem; font-size: 1.0625rem; font-weight: 700; }
.patient-id { display: flex; gap: 0.875rem; align-items: center; }
.patient-id > div { display: grid; gap: 0.25rem; }
.patient-id strong { font-size: 1.0625rem; font-weight: 700; }
.patient-phone { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--ink); font-weight: 500; font-size: calc(0.875rem - 1px); margin-top: 5px; }
.patient-phone svg, .patient-sms svg { width: 0.9375rem; height: 0.9375rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.patient-sms { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--muted); font-size: 0.8125rem; }
.grade-sep { height: 1px; background: var(--line); margin: 1.25rem 0; }
.grade-sub { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 700; }
.grade-hint { margin: 0 0 0.75rem; font-size: 0.8125rem; color: var(--muted); }
.grade-aside { display: flex; align-items: center; gap: 0.375rem; margin: -0.375rem 0 0.75rem; font-size: 0.75rem; color: var(--muted); }
.grade-aside svg { flex: none; width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.concern-box { margin: 0 0 1.25rem; padding: 0.875rem 1rem; background: var(--ui-accent-soft); border-radius: 0.75rem; font-size: 0.875rem; color: var(--ink-2); }
/* grade screen — all submitted photos in a labelled grid, click to enlarge */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.ph-cell { position: relative; padding: 0; border: 0; background: #eef1f6; border-radius: 0.625rem; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; }
.ph-cell__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.12s; }
.ph-cell:hover .ph-cell__img { opacity: 0.88; }
.ph-cell.is-active { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
/* large preview of the selected shot */
.photo-main { position: relative; height: 13rem; border-radius: 0.875rem; margin-bottom: 1rem; cursor: zoom-in; }
.photo-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: rgba(255,255,255,0.9); cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; }
.photo-nav:hover { background: #fff; }
.photo-nav--l { left: 0.625rem; } .photo-nav--r { right: 0.625rem; }

.gstep { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.gstep:first-of-type { border-top: 0; padding-top: 0; }
.gstep h3 { margin: 0 0 0.25rem; font-size: 0.9375rem; font-weight: 700; }
.gstep h3 span { color: var(--ink); }
.gstep h3 em { font-weight: 400; font-style: normal; color: var(--muted); font-size: 0.8125rem; }

.gselect { position: relative; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.875rem; border: 1px solid var(--line); border-radius: var(--r-field); cursor: pointer; min-height: 3rem; }
.gselect.is-open { border-color: var(--ui-accent); }
.gselect__chips { display: flex; flex-wrap: wrap; gap: 0.375rem; flex: 1; }
.gselect__ph { color: var(--muted); font-size: 0.875rem; }
.gselect__caret { width: 1.1rem; height: 1.1rem; margin-left: auto; fill: none; stroke: var(--muted); stroke-width: 1.7; transition: transform 0.15s; }
.gselect.is-open .gselect__caret { transform: rotate(180deg); }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.625rem; background: #f1f5f9; border-radius: 0.5rem; font-size: 0.8125rem; font-weight: 600; }
.chip b { color: var(--muted); cursor: pointer; }
/* payment options (financing settings) */
#pay-list { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 0.75rem; }
#pay-list:empty { margin: 0; }
.planadd { margin-top: 0.25rem; }
.payicon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 0.625rem; }
.payrow__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.payrow__sum { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planrow.is-open .payrow__sum { display: none; }
.payrow.is-off .payicon, .payrow.is-off .payrow__txt { opacity: 0.5; }
.pay-ta { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-field); background: var(--surface); font: inherit; font-size: 0.875rem; line-height: 1.45; color: var(--ink); resize: none; }
.pay-ta:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.14); }
.payrow__actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.payrow__actions .btn { flex: none; padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }
/* per-plan payment-option picker (services) */
.paydrop { border: 1px solid var(--line); border-radius: var(--r-field); overflow: hidden; background: var(--surface); }
.paydrop__trigger { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; cursor: pointer; list-style: none; font-size: 0.875rem; color: var(--ink); }
.paydrop__trigger::-webkit-details-marker { display: none; }
.paydrop__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paydrop__chev { flex: none; width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.paydrop[open] .paydrop__chev { transform: rotate(180deg); }
.paydrop__panel { border-top: 1px solid var(--line); padding: 0.35rem; display: flex; flex-direction: column; }
.paychk { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: 0.5rem; cursor: pointer; font-size: 0.875rem; color: var(--ink); }
.paychk:hover { background: #f8fafc; }
.paychk input { width: 1rem; height: 1rem; accent-color: var(--ui-accent); }
.payterm { position: relative; }
.pay-term-input.is-hinting { padding-right: 9rem; }
.payterm__hint { position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 0.68rem; font-weight: 600; color: var(--ui-accent); background: #fff; padding: 0.12rem 0.4rem; border-radius: 0.35rem; box-shadow: 0 0 0 1px rgba(82, 94, 245, 0.25); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.chips:empty { display: none; }
.chip__x { color: var(--muted); cursor: pointer; font-size: 1.05rem; line-height: 1; font-style: normal; font-weight: 700; }
.chip__x:hover { color: var(--ink); }
.paypv { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; margin-top: 0.75rem; padding: 0.75rem 1rem; border-radius: var(--r-field); background: var(--ui-accent-soft); }
.paypv__cap { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; color: var(--muted); text-transform: uppercase; }
.paypv__amt { font-size: 1.35rem; font-weight: 700; color: var(--ui-accent); }
.paypv__term { font-size: 0.8125rem; color: var(--ink-2); }
.paypv__hint { font-size: 0.8125rem; color: var(--muted); }

.gselect__menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; max-height: 15rem; overflow-y: auto; padding: 0.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem; box-shadow: var(--shadow-card); }
.gopt { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.5rem 0.625rem; border: 0; border-radius: 0.5rem; background: none; font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.gopt:hover { background: #f8fafc; }
.gopt__icon { width: 1.75rem; height: 1.75rem; border-radius: 0.4375rem; flex: none; object-fit: contain; }
.gopt span { flex: 1; }
.gopt__check { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: var(--ui-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.gopt.is-selected { background: var(--ui-accent-soft); }
.gopt.is-selected .gopt__check { opacity: 1; }
.gopt--empty { color: var(--muted); font-size: 0.8125rem; cursor: default; }
.gopt--empty:hover { background: none; }
.gopt__link { color: var(--ui-accent); font-weight: 600; text-decoration: none; cursor: pointer; }
.gopt__link:hover { text-decoration: underline; }

/* Staff selector (grade step 1) — reuses .gselect/.gopt, adds a small avatar. */
#gstaff-label { align-items: center; }
.gstaff__av { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ui-accent-soft); color: var(--ui-accent); font-size: 0.6875rem; font-weight: 700; }
.gopt .gstaff__av { flex: none; }
.gstaff__av--photo { padding: 0; overflow: hidden; background: #eef2f7; }
.gstaff__av--photo img { width: 100%; height: 100%; object-fit: cover; }
.gstaff__name { font-size: 0.875rem; color: var(--ink); }

.plan-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.plantab { padding: 0.625rem 0.875rem; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.plantab.is-active { color: var(--ui-accent); border-bottom-color: var(--ui-accent); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.plans-empty { margin: 0; padding: 0.75rem 0.25rem; font-size: 0.8125rem; color: var(--muted); }
.plan { position: relative; display: grid; gap: 0.375rem; padding: 0.875rem; border: 1.5px solid var(--line); border-radius: 0.875rem; cursor: pointer; }
.plan input { position: absolute; opacity: 0; }
.plan.is-selected { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.plan__radio { position: absolute; top: 0.875rem; left: 0.875rem; width: 1.1rem; height: 1.1rem; border: 2px solid #cbd5e1; border-radius: 50%; }
.plan.is-selected .plan__radio { border-color: var(--ui-accent); box-shadow: inset 0 0 0 3px var(--ui-accent); }
.plan__head { padding-left: 1.75rem; display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.plan__head strong { font-size: 0.875rem; font-weight: 700; }
.plan__desc { padding-left: 1.75rem; font-size: 0.75rem; color: var(--muted); }
.plan__row { display: flex; align-items: center; gap: 0.375rem; padding-left: 1.75rem; font-size: 0.8125rem; color: var(--ink-2); }
.plan__row svg { width: 0.9375rem; height: 0.9375rem; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.pill { padding: 0.0625rem 0.4375rem; border-radius: 999px; font-size: 0.625rem; font-weight: 700; }
.pill--rec { background: var(--ui-accent-soft); color: var(--ui-accent); }
.grade-note { display: flex; align-items: center; gap: 0.4375rem; margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--muted); }
.grade-note svg { width: 0.9375rem; height: 0.9375rem; fill: none; stroke: var(--muted); stroke-width: 1.7; }

.gstep .counter { margin-top: 0.375rem; text-align: right; font-size: 0.75rem; color: var(--muted); }

/* Finding notes — AI-drafted, editable chips, colour-coded + divided by category. */
.notes { display: grid; gap: 0.6rem; }
.notes__grp { border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.7rem 0.8rem; transition: opacity 0.12s; }
.notes__grp--concern { background: #eff6ff; border-color: #dbeafe; }
.notes__grp--positive { background: #ecfdf5; border-color: #d1fae5; }
.notes__grp--reason { background: #fefce8; border-color: #fde68a; }
.notes__grp.is-muted { opacity: 0.55; }
.notes__head { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; margin-bottom: 0.55rem; }
.notes__grp--concern .notes__head { color: #2563eb; }
.notes__grp--positive .notes__head { color: #059669; }
.notes__grp--reason .notes__head { color: #b45309; }
.notes__svc { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-2); }
.notes__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.notes__hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.notes__chips:not(:empty) { margin-bottom: 9px; }
.fchip { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; padding: 0.28rem 0.3rem 0.28rem 0.62rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem; color: var(--ink); }
.fchip b { cursor: pointer; width: 1.15rem; height: 1.15rem; display: grid; place-items: center; border-radius: 50%; color: var(--muted); font-weight: 600; font-size: 0.95rem; line-height: 1; }
.fchip b:hover { background: #fee2e2; color: #dc2626; }
/* the reason the AI tied to the patient's stated concern */
.fchip--match { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; background: #fffbeb; }
.fchip__mark { color: #d97706; font-weight: 700; margin-right: 0.15rem; }
.notes__matchhint { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 0.7rem; color: #b45309; margin-left: 0.5rem; }
/* inline custom-treatment chip + menu option */
.chip--custom { padding-left: 0.45rem; }
.chip__customname { border: 0; background: transparent; font: inherit; font-size: inherit; color: inherit; min-width: 8.5rem; outline: none; }
.gopt--custom { color: var(--ui-accent); font-weight: 600; }
.gopt__plus { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; margin-right: 0.1rem; }
.notes__add { width: 100%; padding: 0.42rem 0.6rem; border: 1px dashed rgba(100,116,139,0.4); border-radius: 0.5rem; background: rgba(255,255,255,0.55); font: inherit; font-size: 0.82rem; color: var(--ink); }
.notes__add::placeholder { color: #94a3b8; }
.notes__add:focus { outline: none; border-style: solid; border-color: var(--ui-accent); background: #fff; }
.notes__add:disabled { opacity: 0.5; cursor: not-allowed; }
/* One-time "Press enter to submit" nudge, sitting at the input's right edge. */
.notes__addwrap { position: relative; display: block; }
.notes__add--hinting { padding-right: 9rem; }
.notes__enterhint { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 0.68rem; font-weight: 600; color: var(--ui-accent); background: #fff; padding: 0.12rem 0.4rem; border-radius: 0.35rem; box-shadow: 0 0 0 1px rgba(82, 94, 245, 0.25); white-space: nowrap; }

/* Video script preview modal (timestamped segments). */
.vsp { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.5); overflow: auto; }
.vsp__panel { width: min(40rem, 100%); max-height: 85vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.vsp__head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.125rem 1.375rem; border-bottom: 1px solid var(--line); }
.vsp__head h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; font-weight: 700; }
.vsp__sub { margin: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.vsp__head .editor__close { margin-left: auto; flex: none; }
.vsp__body { padding: 1rem 1.375rem 1.375rem; overflow-y: auto; display: grid; gap: 0.875rem; }
.vsp__seg { display: grid; gap: 0.35rem; padding-bottom: 0.875rem; border-bottom: 1px solid var(--line); }
.vsp__seg:last-child { border-bottom: 0; padding-bottom: 0; }
.vsp__meta { display: flex; align-items: center; gap: 0.6rem; }
.vsp__time { font-variant-numeric: tabular-nums; font-size: 0.72rem; font-weight: 700; color: var(--ui-accent); background: var(--ui-accent-soft); padding: 0.12rem 0.45rem; border-radius: 0.35rem; }
.vsp__label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-2); }
.vsp__label--muted { color: var(--muted); }
.vsp__kind { margin-left: auto; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 0.35rem; }
.vsp__kind--tts { color: #204fad; background: rgba(32, 79, 173, 0.1); }
.vsp__kind--clip { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
.vsp__seg--clip .vsp__text { color: var(--ink-2); }
.vsp__text { margin: 0; font-size: 0.875rem; color: var(--ink); line-height: 1.5; }
.vsp__seg--clip .vsp__text { color: var(--muted); }   /* fixed clip lines read quieter */
.vsp__text--gen { color: #204fad; font-weight: 500; background: rgba(32, 79, 173, 0.08); border-radius: 0.3rem; padding: 0.1rem 0.35rem; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.vsp__genkey { color: #204fad; background: rgba(32, 79, 173, 0.12); border-radius: 0.3rem; padding: 0.02rem 0.3rem; font-weight: 700; }
.vsp__body > h4 { margin: 0.1rem 0 -0.15rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.vsp__screens { margin-top: 0.35rem; padding-top: 0.875rem; border-top: 1px solid var(--line); display: grid; gap: 0.75rem; }
.vsp__screens h4 { margin: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.vsp__screens .vsp__sub { margin: -0.35rem 0 0.15rem; }
.vsp__group { display: grid; gap: 0.4rem; }
.vsp__glabel { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; color: var(--ui-accent); }
.vsp__phrase { display: grid; gap: 0.1rem; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 0.55rem; background: #f8fafc; }
.vsp__phrase b { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.vsp__phrase span { font-size: 0.82rem; color: var(--ink-2); line-height: 1.4; }
.notes-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.notes-tools .btn.is-busy { opacity: 0.6; pointer-events: none; }
.notes-preview { margin-top: 0.75rem; padding: 0.85rem; border: 1px solid var(--line); border-radius: 0.75rem; background: #f8fafc; }
.notes-preview__label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.5rem; }
.notes-preview__label em { font-weight: 400; font-style: normal; color: var(--muted); }
.notes-preview__ta { width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 0.625rem; background: var(--surface); font: inherit; font-size: 0.875rem; line-height: 1.55; color: var(--ink); resize: vertical; min-height: 6rem; }
.notes-preview__ta:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.14); }
.notes-preview__bar { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }
.notes-preview__stale { margin-right: auto; font-size: 0.78rem; font-weight: 600; color: #b45309; }

/* custom-controls panel inside step 2 */
.custom-block + .custom-block { margin-top: 1.25rem; }
.custom-block h4 { margin: 0 0 0.75rem; font-size: 0.9375rem; font-weight: 700; }
.custom-block h4 em.muted { font-weight: 400; font-style: normal; color: var(--muted); font-size: 0.8125rem; }
.custom-block__hint { margin: -0.4rem 0 calc(0.75rem + 5px); font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }

.custom-block .feetabs { margin-bottom: 0.875rem; }
.price-row { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr 1.3fr; }
/* single mode: drop the upper-bound field, keep the rest aligned */
.price-row.is-single { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.price-row.is-single #fee-high { display: none; }

/* Duration slider (One off treatment → 3 years) */
.durval { font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin-bottom: 0.75rem; }
.durslider { position: relative; height: 1.5rem; }
.durslider__track, .durslider__fill { position: absolute; top: 50%; transform: translateY(-50%); height: 0.375rem; border-radius: 999px; pointer-events: none; }
.durslider__track { left: 0; right: 0; background: #e2e8f0; }
.durslider__fill { background: var(--ui-accent); }
.durslider__input { -webkit-appearance: none; appearance: none; position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; background: transparent; pointer-events: none; }
.durslider__input::-webkit-slider-runnable-track { height: 1.5rem; background: transparent; border: 0; }
.durslider__input::-moz-range-track { height: 1.5rem; background: transparent; border: 0; }
.durslider__input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.15rem; height: 1.15rem; margin-top: 0.175rem; border-radius: 50%; background: #fff; border: 2px solid var(--ui-accent); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); cursor: pointer; pointer-events: auto; }
.durslider__input::-moz-range-thumb { width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fff; border: 2px solid var(--ui-accent); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); cursor: pointer; pointer-events: auto; }
.durslider.is-single .durslider__input--from { display: none; }
.durslider.is-single .durslider__input--to { pointer-events: auto; }
.durslider__ends { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.75rem; color: var(--muted); }
.gfield { display: grid; gap: 0.375rem; }
.gfield label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.gdrop { display: flex; align-items: center; justify-content: space-between; padding: 0.625rem 0.875rem; border: 1px solid var(--line); border-radius: var(--r-field); font-size: 0.875rem; }
.gdrop svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.ginput { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-field); overflow: hidden; }
.ginput__pre { padding: 0 0.625rem; background: #f1f5f9; color: var(--muted); font-size: 0.75rem; font-weight: 600; align-self: stretch; display: flex; align-items: center; }
.ginput input { flex: 1; min-width: 0; padding: 0.625rem 0.75rem; border: 0; background: none; font: inherit; font-size: 0.875rem; outline: none; }
.ginput select { flex: 1; min-width: 0; padding: 0.625rem 1.9rem 0.625rem 0.75rem; border: 0; font: inherit; font-size: 0.875rem; outline: none; color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.6rem center / 0.7rem; }
/* Featured payment example: option 50%, term + monthly 25% each, on one row */
.payexrow { display: grid; gap: 0.75rem; grid-template-columns: 4fr 3fr 3fr; align-items: end; }
@media (max-width: 60rem) { .payexrow { grid-template-columns: 1fr; } }
/* Payment options + featured example, grouped in one tinted container with icon-badged headers */
.paysec { margin-top: 0.25rem; padding: 1.25rem; border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  border-radius: var(--r-field); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); display: grid; gap: 1.5rem; }
.paysec__block { display: grid; gap: 0.75rem; }
.paysec__head { display: flex; align-items: flex-start; gap: 0.75rem; }
.paysec__badge { flex: none; width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); }
.paysec__badge--sq { border-radius: 0.6rem; }
.paysec__badge--circle { border-radius: 50%; }
.paysec__ico { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.paysec__titles { display: grid; gap: 0.15rem; padding-top: 0.1rem; }
.paysec__titles h4 { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--ink); }
.paysec__opt { font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.paysec__sub { margin: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.paysec__label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.ginput__count { flex: none; padding-right: 0.875rem; font-size: 0.75rem; color: var(--muted); }
/* subtle 12M/24M financing-term toggle tucked into the right of the monthly input */
.termmini { flex: none; align-self: center; display: inline-flex; gap: 2px; margin: 0 0.375rem; padding: 2px; border-radius: 7px; background: var(--ui-accent-soft); }
.termmini__opt { border: 0; background: none; font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; color: var(--muted); line-height: 1; padding: 3px 7px; border-radius: 5px; cursor: pointer; }
.termmini__opt.is-active { background: #fff; color: var(--ui-accent); box-shadow: 0 1px 2px rgba(30, 40, 90, 0.14); }
.termmini__opt:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 1px; }

.delivery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.875rem; margin-bottom: 1rem; }
@media (max-width: 860px) { .delivery { grid-template-columns: 1fr; } }
.dopt { position: relative; display: flex; gap: 0.75rem; padding: 1rem; border: 1.5px solid var(--line); border-radius: 0.875rem; cursor: pointer; }
.dopt input { position: absolute; opacity: 0; }
.dopt.is-selected { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.dopt__icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; background: #f1f5f9; color: var(--muted); }
.dopt__icon--ai { background: var(--ui-accent); color: #fff; }
.dopt__icon svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dopt strong { display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; font-weight: 700; }
.dopt small { display: block; margin-top: 0.25rem; font-size: 0.78125rem; color: var(--muted); }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; }
.pv-row strong { font-size: 0.8125rem; } .pv-row small { display: block; font-size: 0.75rem; color: var(--muted); }

/* Personal-video panel (record / upload) */
.pv-panel { margin-bottom: 1rem; }
.pv-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pv-choice__btn { display: grid; justify-items: center; gap: 0.25rem; padding: 1.25rem 1rem; border: 1.5px dashed var(--line); border-radius: 0.75rem; background: #f8fafc; color: var(--ink-2); font: inherit; cursor: pointer; transition: border-color 0.12s, background-color 0.12s; }
.pv-choice__btn:hover { border-color: #cbd5e1; background: #f1f5f9; }
.pv-choice__btn svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--ui-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv-choice__btn strong { font-size: 0.875rem; }
.pv-choice__btn small { font-size: 0.75rem; color: var(--muted); }
.pv-preview { display: grid; gap: 0.5rem; }
.pv-preview video { width: 100%; max-height: 15rem; border-radius: 0.75rem; background: #000; }
.pv-preview__meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.8125rem; }
.pv-preview__name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-preview__actions { display: flex; gap: 0.875rem; flex: none; }
.linkbtn--danger { color: var(--danger); }

/* Webcam recorder modal (premium) */
.pvrec { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.6); }
.pvrec__panel { width: min(42rem, 100%); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
/* Grade-screen variant: patient photos float to the left of the recorder,
   directly over the dark backdrop (no panel) at grade-screen sizes. */
.pvrec__layout { display: flex; align-items: flex-start; gap: 1.25rem; max-width: 100%; }
.pvrec__layout .pvrec__panel { flex: none; width: 42rem; }   /* keep the recorder at its full width beside the photos */
.pvrec__photos { flex: none; width: 19rem; }
.pvrec__photoslabel { margin: 0 0 0.6rem; font-size: 0.8125rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.pvrec__photos .photo-grid { margin-bottom: 0.75rem; }
.pvrec__photos .photo-main { margin-bottom: 0; cursor: default; }
.pvrec__photos .ph-cell { cursor: pointer; }
.pvrec__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.125rem 1.375rem; }
.pvrec__head h3 { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.pvrec__sub { margin: 0.1875rem 0 0; font-size: 0.8125rem; color: var(--muted); }

.pvrec__stage { position: relative; aspect-ratio: 4 / 3; background: #0a0e17; overflow: hidden; }
.pvrec__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pvrec__video.is-mirror { transform: scaleX(-1); }
.pvrec__panel.is-review .pvrec__video { object-fit: contain; }
.pvrec__panel.is-review .pvrec__status,
.pvrec__panel.is-review .pvrec__flip,
.pvrec__panel.is-review .pvrec__bar { display: none; }

.pvrec__status { position: absolute; top: 0.875rem; left: 0.875rem; display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.25rem 0.625rem; border-radius: 999px; background: rgba(10, 14, 23, 0.55); backdrop-filter: blur(6px); color: #fff; font-size: 0.75rem; font-weight: 600; }
.pvrec__hd { font-size: 0.625rem; font-weight: 800; letter-spacing: 0.03em; background: rgba(255, 255, 255, 0.2); padding: 0.03125rem 0.3125rem; border-radius: 0.25rem; }
.pvrec__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #22c55e; }
.pvrec__status.is-rec .pvrec__dot { background: #ef4444; animation: pvpulse 1s infinite; }
@keyframes pvpulse { 50% { opacity: 0.25; } }

.pvrec__flip { position: absolute; top: 0.875rem; right: 0.875rem; display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.3125rem 0.75rem; border: 0; border-radius: 999px; background: rgba(10, 14, 23, 0.55); backdrop-filter: blur(6px); color: #fff; font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.pvrec__flip:hover { background: rgba(10, 14, 23, 0.8); }
.pvrec__flip svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pvrec__bar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0.75rem; padding: 2.5rem 1rem 1rem; background: linear-gradient(transparent, rgba(5, 8, 15, 0.9) 55%); }
.pvrec__dev { position: relative; display: flex; align-items: center; gap: 0.5rem; }
.pvrec__dev--mic { justify-content: flex-end; }
.pvrec__pill { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 11rem; padding: 0.4375rem 0.625rem; border: 0; border-radius: 0.625rem; background: rgba(15, 23, 42, 0.7); color: #fff; font: inherit; cursor: pointer; }
.pvrec__pill:hover { background: rgba(15, 23, 42, 0.9); }
.pvrec__pill > svg:first-child { flex: none; width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pvrec__pilltext { display: grid; min-width: 0; text-align: left; line-height: 1.2; }
.pvrec__pilltext small { font-size: 0.625rem; color: rgba(255, 255, 255, 0.6); }
.pvrec__pilltext b { font-size: 0.75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvrec__chev { flex: none; width: 0.85rem; height: 0.85rem; fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 2; }

.pvrec__center { display: grid; justify-items: center; gap: 0.4375rem; }
.pvrec__caption { margin: 0; font-size: 0.75rem; font-weight: 500; color: rgba(255, 255, 255, 0.9); }
.pvrec__rec { display: grid; place-items: center; width: 4rem; height: 4rem; padding: 0; border: 2px dashed rgba(255, 255, 255, 0.75); border-radius: 50%; background: rgba(255, 255, 255, 0.08); cursor: pointer; }
.pvrec__rec:hover { background: rgba(255, 255, 255, 0.16); }
.pvrec__rec span { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #ef4444; transition: width 0.15s, height 0.15s, border-radius 0.15s; }
.pvrec__rec.is-recording span { width: 1.5rem; height: 1.5rem; border-radius: 0.375rem; }

.pvrec__meter { display: inline-flex; align-items: flex-end; gap: 0.1875rem; height: 1.25rem; }
.pvrec__meter i { width: 0.25rem; border-radius: 0.125rem; background: rgba(255, 255, 255, 0.28); transition: background-color 0.08s; }
.pvrec__meter i:nth-child(1) { height: 0.375rem; } .pvrec__meter i:nth-child(2) { height: 0.5625rem; }
.pvrec__meter i:nth-child(3) { height: 0.75rem; } .pvrec__meter i:nth-child(4) { height: 0.9375rem; }
.pvrec__meter i:nth-child(5) { height: 1.1875rem; }
.pvrec__meter i.is-on { background: #22c55e; }

.pvrec__menu { position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 12rem; max-height: 12rem; overflow-y: auto; padding: 0.25rem; background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0.625rem; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); z-index: 5; }
.pvrec__dev--mic .pvrec__menu { left: auto; right: 0; }
.pvrec__opt { display: block; width: 100%; padding: 0.4375rem 0.5rem; border: 0; border-radius: 0.4375rem; background: none; color: #e2e8f0; font: inherit; font-size: 0.8125rem; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvrec__opt:hover { background: rgba(255, 255, 255, 0.08); }
.pvrec__opt.is-active { background: var(--ui-accent); color: #fff; }

.pvrec__foot { display: none; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.375rem; }
.pvrec__panel.is-review .pvrec__foot { display: flex; }
.pvrec__foot .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }
/* Stepped foot: review buttons, then a separate thumbnail-chooser step. */
.pvrec__foot-review, .pvrec__foot-thumb { display: none; flex: 1; align-items: center; gap: 0.75rem; }
.pvrec__panel.is-review:not(.is-thumb) .pvrec__foot-review { display: flex; justify-content: flex-end; }
.pvrec__panel.is-thumb .pvrec__foot-thumb { display: flex; justify-content: space-between; }
.pvrec__footright { display: flex; align-items: center; gap: 0.75rem; }
.pvrec__foothint { font-size: 0.75rem; color: var(--muted); line-height: 1.35; max-width: 16rem; }

.grade-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.grade-bar__left { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.linkbtn--icon { display: inline-flex; align-items: center; gap: 0.4375rem; }
.linkbtn--icon svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.grade-bar__send .btn { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }
.grade-bar__send { display: flex; flex-direction: row; align-items: center; gap: 0.625rem; }
.grade-bar__send small { font-size: 0.75rem; color: var(--muted); }

@media (max-width: 68rem) { .grade { grid-template-columns: minmax(0, 1fr); } .grade-patient { position: static; } .delivery { grid-template-columns: 1fr; } }
@media (max-width: 60rem) { .plans { grid-template-columns: 1fr; } .price-row { grid-template-columns: 1fr; } }

/* Demo: real smile photo fills every submission/grading thumbnail. */
.ph { background: #eef1f6 center/cover no-repeat; }
.photo-main { background: #eef1f6; overflow: hidden; }
.photo-main__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-main__none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.patient-phone--email { display: flex; font-weight: 500; margin-top: 0.25rem; word-break: break-all; }

/* Submitted-photo lightbox (grade screen) */
.gm-lb { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.86); display: flex; align-items: center; justify-content: center; padding: 3rem; animation: gm-lb-in 0.12s ease-out; }
@keyframes gm-lb-in { from { opacity: 0; } to { opacity: 1; } }
.gm-lb__img { max-width: 90vw; max-height: 88vh; object-fit: contain; border-radius: 0.75rem; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); }
.gm-lb__close, .gm-lb__nav { position: absolute; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; cursor: pointer; display: grid; place-items: center; }
.gm-lb__close:hover, .gm-lb__nav:hover { background: rgba(255, 255, 255, 0.28); }
.gm-lb__close { top: 1.25rem; right: 1.25rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.gm-lb__close svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; }
.gm-lb__nav { top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.75rem; line-height: 1; padding-bottom: 0.2rem; }
.gm-lb__nav--l { left: 1.25rem; } .gm-lb__nav--r { right: 1.25rem; }
.gm-lb__count { position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.85); font-size: 0.85rem; letter-spacing: 0.02em; }
.gm-lb__img { transform-origin: center center; user-select: none; -webkit-user-drag: none; }
.gm-lb__zoom { position: absolute; bottom: 1.05rem; right: 1.25rem; display: flex; align-items: center; gap: 0.35rem; background: rgba(255,255,255,0.14); border-radius: 999px; padding: 0.3rem 0.4rem; }
.gm-lb__zbtn { border: 0; background: rgba(255,255,255,0.16); color: #fff; width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; font-size: 1.15rem; line-height: 1; display: grid; place-items: center; }
.gm-lb__zbtn:hover { background: rgba(255,255,255,0.32); }
.gm-lb__zbtn--reset { width: auto; padding: 0 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; }
.gm-lb__zlevel { color: #fff; font-size: 0.75rem; min-width: 2.9rem; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Teeth map (grade step 4) ─────────────────────────────────────── */
.teethmap { border: 1px solid var(--line); border-radius: var(--r-field); background: var(--surface); padding: 1rem 1.15rem 1.15rem; margin-bottom: 1.1rem; }
.teethmap__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.teethmap__title { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-accent); }
.teethmap__sub { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }
.teethmap__stage { max-width: 520px; margin: 0.9rem auto 0.2rem; padding: 15px 0 5px; }
.teethmap__frame { position: relative; }
.teethmap__img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
/* Overlay tracks the image exactly (its own tight frame), so padding or size changes on the
   stage never shift the teeth — coordinates live in the 600x230 viewBox regardless. */
.teethmap__svg { position: absolute; inset: 0; overflow: visible; }
.teethmap__selall { position: absolute; right: 0.35rem; bottom: 0.15rem; z-index: 3; font: inherit; font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 0.45rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); transition: color 0.15s, border-color 0.15s, background 0.15s; }
.teethmap__selall:hover:not(:disabled) { border-color: var(--ui-accent); color: var(--ui-accent); }
.teethmap__selall:disabled { opacity: 0.4; cursor: default; }
.teethmap__selall.is-on { color: var(--ui-accent); border-color: var(--ui-accent); background: var(--ui-accent-soft); }
/* Per-tooth hit regions — added when we map the teeth. Multiply keeps the enamel
   shading visible under the periwinkle fill, so a selected tooth reads as rendered. */
.tm-tooth { fill: var(--ui-accent); fill-opacity: 0; stroke: transparent; cursor: pointer; transition: fill-opacity 0.15s; mix-blend-mode: multiply; }
.tm-tooth:hover { fill-opacity: 0.28; }
.tm-tooth.is-on { fill-opacity: 0.72; }
/* Number shown on hover, centred on the tooth — dark with a white halo so it reads on any fill. */
.tm-toothnum { fill: var(--ink); font-size: 9px; font-weight: 700; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 2.4px; stroke-linejoin: round; }
/* Gums are big, so soften the hover so it isn't an overpowering flash. */
.tm-gum:hover { fill-opacity: 0.18; }
/* The active-finding line above the map. */
.teethmap__active { margin: 0.35rem 0 0; font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.teethmap__active--empty { font-weight: 500; color: var(--muted); }
.teethmap__active--flash { color: var(--ui-accent); animation: tm-flash 0.7s ease; }
@keyframes tm-flash { 0%, 60% { opacity: 0.35; } 100% { opacity: 1; } }
/* The finding chip the teeth map is currently mapping. */
.fchip--active { box-shadow: 0 0 0 2px var(--ui-accent); }
/* Count of mapped teeth/gums on a finding chip. */
.fchip__teeth { display: inline-flex; align-items: center; justify-content: center; min-width: 1.05rem; height: 1.05rem; padding: 0 0.28rem; margin-left: 0.1rem; border-radius: 999px; background: var(--ui-accent); color: #fff; font-size: 0.66rem; font-weight: 700; }
/* Concern & positive chips are clickable (they select the finding the map edits), so the
   whole chip shows the hand cursor rather than a text caret. */
.notes__grp--concern .fchip, .notes__grp--positive .fchip { cursor: pointer; }
