/* ===========================================================

   Chairside — Coastal Cream theme

   Teal accent on warm cream paper. Shared aesthetic with the

   /index.html landing page (Fraunces + Plus Jakarta + JetBrains

   Mono, cream paper, teal-deep accents).

   =========================================================== */

:root {

  color-scheme: light;



  /* Display + body + mono — pulled from Google Fonts in index.html */

  --font-display: "Fraunces", "Iowan Old Style", "Apple Garamond", "Baskerville", serif;

  --font-sans:    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;



  /* Single accent — teal-deep, matching the landing's section heads */

  --accent: #3F8B95;

  --accent-dim: #2A6A73;

  --accent-glow: rgba(63, 139, 149, 0.20);

  /* Darker teal reserved for the primary button fill so 15px white text

     clears 4.5:1 (plain --accent measured only 3.93:1). */

  --accent-btn: #2A626C;



  /* Semantic colors — tuned for contrast on cream */

  --critical: #C44A4A;

  --warning: #B07F2C;

  /* Darker warm tone for warn micro-labels sitting on the amber tint —

     --warning itself only reaches ~2.8:1 there. Icons keep --warning. */

  --warning-text: #7A5718;

  --critical-text: #9E2F2F;

  --positive: #3F8B62;



  /* Neutrals — cream paper scale aligned with the landing */

  --bg-0: #F0E5D1;        /* deepest page (matches landing body) */

  --bg-1: #F4EBD8;        /* main bg */

  --bg-2: #F8F0E1;        /* surface (matches landing card) */

  --bg-3: #FFFFFF;        /* raised / inputs */



  /* Text — dark ink on cream */

  --label: rgba(26, 34, 48, 0.94);

  --secondary: rgba(26, 34, 48, 0.66);

  /* Strong micro-label tone — a solid slate lifted from the ink family.

     Sits between --secondary and --label; clears 4.6:1 on paper, on the

     glass tints, and on the amber warn tint (the 10.5-11px mono label

     layer measured only 2.8-3.8:1 at --secondary). */

  --label-strong: #465060;

  --tertiary: rgba(26, 34, 48, 0.46);

  --quaternary: rgba(26, 34, 48, 0.30);

  --separator: rgba(26, 34, 48, 0.10);



  /* Glass — dark tint over cream (inverted) */

  --glass-tint: rgba(26, 34, 48, 0.04);

  --glass-tint-2: rgba(26, 34, 48, 0.07);

  --glass-tint-3: rgba(26, 34, 48, 0.10);

  --glass-edge: rgba(26, 34, 48, 0.10);

  --glass-edge-bright: rgba(26, 34, 48, 0.18);



  /* Radii */

  --r-sm: 10px;

  --r-md: 14px;

  --r-lg: 20px;

  --r-xl: 28px;

  --r-pill: 999px;



  /* Spacing */

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;

  --s-5: 20px; --s-6: 24px; --s-8: 32px;



  /* Layout */

  --tab-bar-height: 60px;

  --status-bar-pad: env(safe-area-inset-top, 0px);

  --bottom-pad: env(safe-area-inset-bottom, 0px);

}



*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {

  font-family: var(--font-sans);

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-rendering: optimizeLegibility;

  color: var(--label);

  background: var(--bg-0);

  /* Paper-grain noise + soft accent washes — same recipe as the

     /index.html landing so cream reads as paper, not a flat fill. */

  background-image:

    radial-gradient(ellipse 60% 60% at 0% -10%, rgba(63, 139, 149, 0.08), transparent 70%),

    radial-gradient(ellipse 60% 60% at 110% 100%, rgba(176, 127, 44, 0.06), transparent 70%),

    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.13  0 0 0 0 0.18  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  background-size: auto, auto, 220px 220px;

  background-attachment: fixed;

  min-height: 100dvh;

  overflow-x: hidden;

  user-select: none;

  -webkit-user-select: none;

  overscroll-behavior: none;

}



/* App root fills the viewport when running standalone */

#app {

  position: relative;

  width: 100%;

  min-height: 100dvh;

  padding-top: var(--status-bar-pad);

  padding-bottom: var(--bottom-pad);

}



/* ===========================================================

   GLASS — quiet variant

   =========================================================== */

.glass, .glass-strong {

  position: relative;

  background: var(--glass-tint);

  backdrop-filter: blur(20px) saturate(140%);

  -webkit-backdrop-filter: blur(20px) saturate(140%);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

}

.glass-strong {

  background: var(--glass-tint-2);

  backdrop-filter: blur(28px) saturate(160%);

  -webkit-backdrop-filter: blur(28px) saturate(160%);

}

.glass::before, .glass-strong::before {

  content: "";

  position: absolute; top: 0; left: 8%; right: 8%;

  height: 0.5px;

  background: var(--glass-edge-bright);

  pointer-events: none;

}



/* ===========================================================

   LOCK SCREEN

   =========================================================== */

.lock-screen {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Compact centered cluster instead of space-between: the keypad stays in
     comfortable reach on tall phones and doesn't sink to the bottom of an
     iPad. safe-center + overflow keeps short/landscape screens scrollable
     rather than clipped. */
  justify-content: center;
  justify-content: safe center;
  gap: clamp(14px, 3.2dvh, 32px);
  padding: calc(20px + var(--status-bar-pad)) 24px calc(24px + var(--bottom-pad));
  overflow-y: auto;
  text-align: center;
  background: #F4EEDD;
  z-index: 200;
  /* Keys scale with the screen: big thumbs on phones, capped on tablets. */
  --pin-key-size: clamp(68px, 19vw, 84px);
}

.lock-screen.entering { animation: fadeIn 0.3s ease; }

.lock-screen.shake { animation: shake 0.4s ease; }



@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes shake {

  0%, 100% { transform: translateX(0); }

  20% { transform: translateX(-10px); }

  40% { transform: translateX(10px); }

  60% { transform: translateX(-6px); }

  80% { transform: translateX(6px); }

}



.brand-mark {

  width: 80px; height: 80px;

  border-radius: 22px;

  background: var(--bg-3);

  border: 1px solid var(--glass-edge);

  display: grid; place-items: center;

  margin-bottom: 20px;

}

.brand-mark svg path { fill: var(--accent); }

.brand-name { font-family: var(--font-display); font-size: 28px; font-weight: 450; font-variation-settings: "opsz" 48, "SOFT" 30; letter-spacing: -0.018em; margin: 0 0 4px; }

.brand-sub { font-size: 13px; color: var(--secondary); margin: 0; }

.brand-sub.error { color: var(--critical); }



.pin-cluster {

  display: flex; flex-direction: column;

  align-items: center; gap: 22px;

}

.pin-dots { display: flex; gap: 18px; }

.pin-dot {

  width: 12px; height: 12px;

  border-radius: 50%;

  border: 1.5px solid var(--quaternary);

  transition: all 0.18s ease;

}

.pin-dot.filled {

  background: var(--label);

  border-color: var(--label);

}



.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, var(--pin-key-size, 76px));
  gap: clamp(12px, 3.4vw, 18px);
}
.pin-key {
  width: var(--pin-key-size, 76px); height: var(--pin-key-size, 76px);
  border-radius: 50%;
  background: var(--glass-tint);
  border: 0.5px solid var(--glass-edge);
  color: var(--label);
  font-size: clamp(24px, 6.5vw, 28px);
  font-weight: 300;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  /* No 300ms double-tap-zoom delay or grey tap flash on iOS. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:active { transform: scale(0.92); background: var(--glass-tint-2); }

.pin-key.flat { background: transparent; border: none; }

.pin-key .sub { display: block; font-size: 9px; letter-spacing: 0.18em; color: var(--tertiary); margin-top: -2px; }

/* Short / landscape screens (landscape phones, iPad landscape): shrink the
   keypad + brand so the whole cluster fits without scrolling. */
@media (max-height: 800px) {
  .lock-screen {
    --pin-key-size: clamp(58px, 9.5vh, 74px);
    gap: clamp(10px, 2vh, 20px);
  }
  .lock-screen .brand-mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 10px; }
  .lock-screen .brand-mark svg { width: 30px; height: 30px; }
  .lock-screen .brand-name { font-size: 22px; }
}

.pin-key:disabled { opacity: 0.4; cursor: not-allowed; }



.lock-action {
  background: none; border: none;
  color: var(--accent-btn, var(--accent));
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 12px 18px; min-height: 44px; cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lock-action:active { opacity: 0.6; }



/* PIN-loss warning shown only on the Create-PIN screen. */

.lock-warn {

  margin: 28px auto 0;

  max-width: 32ch;

  padding: 14px 18px;

  border-radius: var(--r-md);

  background: rgba(176, 127, 44, 0.08);

  border: 0.5px solid rgba(176, 127, 44, 0.32);

  color: var(--label);

  font-size: 12.5px;

  line-height: 1.5;

  text-align: left;

}



/* Backup-nudge banner shown on Patients tab when no recent export. */

.nudge-banner {

  display: grid;

  grid-template-columns: auto 1fr;

  grid-template-areas:

    "icon body"

    ".    actions";

  column-gap: 12px;

  row-gap: 12px;

  padding: 14px 16px;

  margin: 0 0 16px;

  border-radius: var(--r-md);

  background: rgba(176, 127, 44, 0.07);

  border: 0.5px solid rgba(176, 127, 44, 0.32);

}

.nudge-icon {

  grid-area: icon;

  width: 32px; height: 32px;

  border-radius: 9px;

  display: grid; place-items: center;

  background: rgba(176, 127, 44, 0.14);

  color: var(--warning);

}

.nudge-icon svg { stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.nudge-body { grid-area: body; min-width: 0; }

.nudge-title {

  font-family: var(--font-display);

  font-weight: 450;

  font-variation-settings: "opsz" 24, "SOFT" 30;

  font-size: 16px;

  letter-spacing: -0.01em;

  margin-bottom: 4px;

}

.nudge-sub {

  font-size: 12.5px;

  color: var(--secondary);

  line-height: 1.5;

}

.nudge-actions {

  grid-area: actions;

  display: flex; gap: 8px;

}

.nudge-action {

  font: inherit; font-family: var(--font-sans);

  font-size: 12.5px; font-weight: 600;

  min-height: 40px;

  display: inline-flex; align-items: center; justify-content: center;

  padding: 8px 16px;

  border-radius: 999px;

  cursor: pointer;

  transition: background 0.15s, border-color 0.15s;

}

.nudge-action.primary {

  background: var(--ink, var(--label));

  color: var(--bg-2);

  border: 0.5px solid var(--label);

}

.nudge-action.primary:hover { background: var(--label); }

.nudge-action.ghost {

  background: transparent;

  color: var(--secondary);

  border: 0.5px solid var(--separator);

}

.nudge-action.ghost:hover { color: var(--label); border-color: var(--glass-edge-bright); }



/* About card — Settings → About. Editorial layout that reuses the

   doc-table primitive for the privacy facts, plus two coloured

   attention notes for PIN-loss and backup discipline. */

.about-card {

  padding: 18px 18px 16px;

  border-radius: var(--r-md);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

}

.about-head {

  display: flex; align-items: baseline; justify-content: space-between;

  gap: 12px;

  padding-bottom: 4px;

}

.about-name {

  font-family: var(--font-display);

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-size: 22px;

  letter-spacing: -0.014em;

}

.about-ver {

  font-family: var(--font-mono);

  font-size: 10.5px;

  letter-spacing: 0.10em;

  text-transform: uppercase;

  color: var(--label-strong);

}

.about-tagline {

  font-size: 13.5px;

  color: var(--secondary);

  margin: 2px 0 14px;

  line-height: 1.45;

}

.about-facts {

  margin: 0 -2px 14px;

  padding: 0 2px;

}

.about-facts .doc-row {

  padding: 9px 0;

}

.about-note {

  margin-top: 10px;

  padding: 12px 14px;

  border-radius: var(--r-md);

  border: 0.5px solid var(--glass-edge);

  background: rgba(255, 255, 255, 0.40);

}

.about-note.warn {

  border-color: rgba(176, 127, 44, 0.32);

  background: rgba(176, 127, 44, 0.07);

}

.about-note-title {

  font-family: var(--font-mono);

  font-size: 10.5px;

  letter-spacing: 0.10em;

  text-transform: uppercase;

  color: var(--label-strong);

  margin-bottom: 5px;

  font-weight: 500;

}

.about-note.warn .about-note-title { color: var(--warning-text); }

.about-note-body {

  font-size: 13px;

  line-height: 1.55;

  color: var(--label);

}

.about-last-backup {

  margin-top: 14px;

  padding-top: 12px;

  border-top: 0.5px dashed var(--separator);

  font-family: var(--font-mono);

  font-size: 11px;

  letter-spacing: 0.06em;

  text-transform: uppercase;

  color: var(--label-strong);

}

.about-last-backup.empty { color: var(--warning); }



/* ===========================================================

   ONBOARDING — first-time setup (doctor profile)

   =========================================================== */

.onboarding-screen {

  min-height: 100dvh;

  padding: calc(48px + var(--status-bar-pad)) 20px calc(48px + var(--bottom-pad));

  animation: fadeIn 0.3s ease;

}

.onboarding-header {

  display: flex; flex-direction: column;

  align-items: center; text-align: center;

  gap: 4px;

  margin-bottom: var(--s-6);

}

.onboarding-header .brand-mark { margin-bottom: var(--s-3); }

.onboarding-title {

  font-family: var(--font-display);

  font-size: 30px; font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  letter-spacing: -0.020em;

  margin: 0;

}

.onboarding-sub {

  font-size: 14px; line-height: 1.5;

  color: var(--secondary);

  max-width: 360px;

  margin: var(--s-2) 0 0;

}

.onboarding-skip {

  background: none; border: none;

  color: var(--secondary);

  font: inherit; font-size: 14px; font-weight: 500;

  padding: 14px 16px;

  margin-top: var(--s-2);

  cursor: pointer;

  width: 100%;

  text-align: center;

  font-family: inherit;

}

.onboarding-skip:active { color: var(--label); }



/* ===========================================================

   APP CHROME — nav bar + tab bar

   =========================================================== */

.app-screen {

  display: none;

  flex-direction: column;

  min-height: 100dvh;

  padding: calc(60px + var(--status-bar-pad)) 16px calc(var(--tab-bar-height) + 32px + var(--bottom-pad));

}

.app-screen.active { display: flex; }



.nav-bar {

  display: flex; align-items: center; justify-content: space-between;

  padding: 0 4px;

  margin-bottom: var(--s-2);

}

.nav-bar h1 {

  margin: 0;

  font-family: var(--font-display);

  font-size: 28px;

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  letter-spacing: -0.020em;

}



.icon-btn {

  width: 40px; height: 40px;

  border-radius: 12px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  color: var(--label);

  display: grid; place-items: center;

  cursor: pointer;

  transition: background 0.15s;

  font-family: inherit;

}

.icon-btn:active { background: var(--glass-tint-2); }

.icon-btn.primary {

  background: var(--accent);

  color: var(--bg-0);

  border-color: transparent;

}

.icon-btn.primary:active { background: var(--accent-dim); }



/* Tab bar — fixed, glass */

.tab-bar {

  position: fixed;

  bottom: calc(16px + var(--bottom-pad));

  left: 16px; right: 16px;

  height: var(--tab-bar-height);

  border-radius: 22px;

  padding: 4px;

  display: flex;

  /* Scroll horizontally when the tabs don't all fit (e.g. 7 tabs on a
     narrow phone) instead of squeezing every label. Scrollbar hidden. */
  overflow-x: auto;

  overflow-y: hidden;

  scrollbar-width: none;

  -ms-overflow-style: none;

  background: rgba(247, 241, 226, 0.85);

  backdrop-filter: blur(32px) saturate(160%);

  -webkit-backdrop-filter: blur(32px) saturate(160%);

  border: 0.5px solid var(--glass-edge);

  z-index: 60;

}

.tab-bar::-webkit-scrollbar { display: none; }

.tab {

  /* Grow to fill when there's room, but never shrink below a legible
     width — that floor is what makes the bar scroll when tabs overflow. */
  flex: 1 0 auto;

  min-width: 54px;

  display: flex; flex-direction: column;

  align-items: center; justify-content: center;

  gap: 3px;

  color: var(--tertiary);

  /* 10px with letter-spacing tightened to 0 still fits the longest labels

     (Patients / Calendar, ~44px) inside the ~55px slot when the bar

     carries six tabs on a 375px viewport. */

  font-size: 10px; font-weight: 600;

  letter-spacing: 0;

  cursor: pointer;

  border-radius: 18px;

  background: none; border: none;

  font-family: var(--font-sans);

  transition: color 0.18s;

}

.tab svg {

  width: 22px; height: 22px;

  stroke: currentColor; fill: none;

  stroke-width: 1.6;

  stroke-linecap: round; stroke-linejoin: round;

}

.tab.active { color: var(--accent); }

.tab.active svg { stroke-width: 2; }



/* ===========================================================

   COMMON UI BLOCKS

   =========================================================== */

.section-label {

  margin: var(--s-4) var(--s-1) var(--s-2);

  font-family: var(--font-mono);

  font-size: 11px; color: var(--secondary);

  text-transform: uppercase; letter-spacing: 0.10em; font-weight: 500;

  display: flex; justify-content: space-between; align-items: center;

}

.section-label .more {

  color: var(--accent);

  font-family: var(--font-sans);

  text-transform: none; letter-spacing: 0;

  font-weight: 500; font-size: 13px;

  cursor: pointer;

}



.empty-state {

  margin: var(--s-8) 0;

  text-align: center;

  color: var(--secondary);

  display: flex; flex-direction: column;

  align-items: center; gap: 12px;

  padding: 40px 24px;

}

.empty-state svg {

  width: 48px; height: 48px;

  color: var(--tertiary);

}

.empty-state .title { font-size: 17px; font-weight: 600; color: var(--label); margin: 8px 0 4px; }

.empty-state .desc { font-size: 13px; line-height: 1.5; max-width: 280px; }



.primary-btn {

  background: var(--accent-btn);

  color: var(--bg-0);

  border: none;

  height: 48px;

  padding: 0 20px;

  border-radius: var(--r-md);

  font: inherit; font-size: 15px; font-weight: 600;

  cursor: pointer;

  letter-spacing: -0.005em;

  transition: background 0.15s;

  font-family: inherit;

}

.primary-btn:active { background: var(--accent-dim); }

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



.secondary-btn {

  background: var(--glass-tint);

  color: var(--label);

  border: 0.5px solid var(--glass-edge);

  height: 44px;

  padding: 0 16px;

  border-radius: var(--r-md);

  font: inherit; font-size: 14px; font-weight: 500;

  cursor: pointer;

  font-family: inherit;

}

.secondary-btn:active { background: var(--glass-tint-2); }



.search {

  height: 40px;

  border-radius: var(--r-md);

  padding: 0 var(--s-3);

  display: flex; align-items: center; gap: 8px;

  color: var(--secondary);

  font-size: 14px;

  margin-top: var(--s-3);

}



.stats-grid {

  display: grid; grid-template-columns: repeat(3, 1fr);

  gap: var(--s-2); margin-top: var(--s-3);

}

.stat {

  padding: var(--s-3) var(--s-2);

  border-radius: var(--r-md);

  text-align: center;

}

.stat .num {

  font-size: 24px; font-weight: 600;

  letter-spacing: -0.022em; line-height: 1.1;

  display: block;

  font-variant-numeric: tabular-nums;

  color: var(--label);

}

.stat .num.tone-warn { color: var(--warning); }

.stat .num.tone-crit { color: var(--critical); }

.stat .lbl {

  font-size: 11px; color: var(--secondary);

  text-transform: uppercase; letter-spacing: 0.06em;

  font-weight: 500; margin-top: 4px; display: block;

}



/* ===========================================================

   MORE — navigation list

   =========================================================== */

.more-list {

  display: flex;

  flex-direction: column;

  gap: var(--s-2);

  margin-top: var(--s-3);

}

.more-row {

  display: flex; align-items: center; gap: var(--s-3);

  padding: var(--s-3);

  border-radius: var(--r-md);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  color: var(--label);

  font-family: inherit;

  text-align: left;

  cursor: pointer;

  transition: background 0.15s;

}

.more-row:active { background: var(--glass-tint-2); }



/* ===========================================================

   FORM LAYOUT — Clinics + Patients + Treatments + Forms

   =========================================================== */

.form {

  display: flex; flex-direction: column;

  gap: var(--s-3);

  margin-top: var(--s-3);

}

.form-section {

  margin-top: var(--s-3);

  padding-bottom: var(--s-1);

}

.form-section-title {

  font-size: 11px; color: var(--secondary);

  text-transform: uppercase; letter-spacing: 0.08em;

  font-weight: 600;

}

.form-section-sub {

  font-size: 12px; color: var(--tertiary);

  margin-top: 2px;

  font-weight: 400;

}

.field {

  display: flex; flex-direction: column;

  gap: 6px;

}

.field label {

  font-size: 12px; color: var(--secondary);

  font-weight: 500;

}

.field input,

.field textarea,

.field select {

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  padding: 11px 12px;

  font: inherit;

  font-family: inherit;

  font-size: 15px;

  color: var(--label);

  outline: none;

  transition: border-color 0.15s, box-shadow 0.15s;

  color-scheme: light;

  -webkit-appearance: none;

  -moz-appearance: none;

  appearance: none;

  width: 100%;

}

.field input:focus,

.field textarea:focus,

.field select:focus {

  border-color: var(--accent);

  box-shadow: 0 0 0 3px var(--accent-glow);

}

.field textarea {

  resize: vertical;

  min-height: 72px;

}

.field input::placeholder,

.field textarea::placeholder {

  color: var(--tertiary);

}

.field input[type="number"]::-webkit-outer-spin-button,

.field input[type="number"]::-webkit-inner-spin-button {

  -webkit-appearance: none; margin: 0;

}

.field input[type="number"] { -moz-appearance: textfield; }



/* Date / time inputs — strip the default Material-style picker icons

   and overlay a typographically consistent indicator instead. */

.field input[type="date"],

.field input[type="time"],

.field input[type="datetime-local"] {

  font-family: var(--font-mono);

  font-variant-numeric: tabular-nums;

  letter-spacing: 0.02em;

  background-repeat: no-repeat;

  background-position: right 12px center;

  background-size: 16px;

  padding-right: 38px;

}

.field input[type="date"] {

  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A2230' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><line x1='3' y1='10' x2='21' y2='10'/><line x1='8' y1='3' x2='8' y2='7'/><line x1='16' y1='3' x2='16' y2='7'/></svg>");

}

.field input[type="time"] {

  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A2230' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><polyline points='12 7 12 12 15 14'/></svg>");

}

/* Webkit picker indicators — make them invisible overlays so the

   click area remains but the Material glyph is hidden behind ours. */

.field input[type="date"]::-webkit-calendar-picker-indicator,

.field input[type="time"]::-webkit-calendar-picker-indicator {

  position: absolute;

  right: 0; top: 0; bottom: 0;

  width: 38px;

  cursor: pointer;

  opacity: 0;

  background: transparent;

}

.field input[type="date"],

.field input[type="time"] {

  position: relative;

}

.field select {

  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a202aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");

  background-repeat: no-repeat;

  background-position: right 10px center;

  background-size: 18px;

  padding-right: 36px;

}



/* Currency / unit prefix-suffix */

.input-with-prefix {

  display: flex; align-items: stretch;

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  overflow: hidden;

  transition: border-color 0.15s, box-shadow 0.15s;

}

.input-with-prefix:focus-within {

  border-color: var(--accent);

  box-shadow: 0 0 0 3px var(--accent-glow);

}

.input-with-prefix .prefix,

.input-with-prefix .suffix {

  display: flex; align-items: center;

  padding: 0 12px;

  color: var(--secondary);

  font-size: 14px; font-weight: 500;

  background: var(--glass-tint);

  flex-shrink: 0;

}

.input-with-prefix input {

  flex: 1;

  background: transparent !important;

  border: none !important;

  padding: 11px 12px;

  font: inherit; font-family: inherit;

  font-size: 15px;

  color: var(--label);

  outline: none;

  min-width: 0;

  -webkit-appearance: none; appearance: none;

}



/* Segmented control */

.seg {

  display: flex; padding: 3px;

  border-radius: 11px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  gap: 2px;

}

/* Wrapping segmented control — for option sets too long for one row on a
   phone (used by the ortho appliance / prescription / phase / photo-view
   pickers). Items keep a legible min width and wrap into rows. */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap .seg-item { flex: 1 0 auto; min-width: 72px; }

.seg-item {

  flex: 1; text-align: center;

  min-height: 40px;

  display: flex; align-items: center; justify-content: center;

  padding: 0 8px;

  font-size: 13px; font-weight: 600;

  color: var(--secondary);

  border-radius: 8px;

  cursor: pointer;

  background: none; border: none;

  font-family: inherit;

  transition: background 0.15s, color 0.15s;

}

.seg-item.active {

  background: var(--bg-3);

  color: var(--label);

  box-shadow: 0 1px 2px rgba(26,32,42,0.08);

}



/* Colour-tag picker */

.color-row {

  display: flex; gap: 10px; flex-wrap: wrap;

}

.color-swatch {

  width: 32px; height: 32px;

  border-radius: 50%;

  border: 2px solid transparent;

  cursor: pointer;

  padding: 0;

  transition: transform 0.15s;

  box-shadow: 0 1px 2px rgba(26,32,42,0.08);

}

.color-swatch:active { transform: scale(0.92); }

.color-swatch.active {

  border-color: var(--label);

  box-shadow: 0 0 0 1.5px var(--bg-1) inset, 0 1px 2px rgba(26,32,42,0.12);

}



/* Schedule editor (clinic form) */

.schedule-editor {

  display: flex; flex-direction: column;

  gap: var(--s-2);

}

.shift-list {

  display: flex; flex-direction: column;

  gap: 6px;

  margin-top: 4px;

}

.shift-empty {

  padding: 10px 12px;

  font-size: 12px;

  color: var(--tertiary);

  font-style: italic;

}

.shift-row {

  display: flex; align-items: center;

  gap: 6px;

  padding: 8px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

}

.shift-day, .shift-date, .shift-time {

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  border-radius: 8px;

  padding: 7px 8px;

  font: inherit; font-family: inherit;

  font-size: 13px;

  color: var(--label);

  outline: none;

  min-width: 0;

  font-variant-numeric: tabular-nums;

  color-scheme: light;

  -webkit-appearance: none; appearance: none;

}

.shift-day {

  flex: 1.2; font-weight: 500;

  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a202aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");

  background-repeat: no-repeat;

  background-position: right 6px center;

  background-size: 14px;

  padding-right: 26px;

}

.shift-date { flex: 1.4; font-weight: 500; }

.shift-time { width: 80px; text-align: center; }

.time-sep { color: var(--tertiary); font-size: 14px; flex-shrink: 0; }

.shift-del {

  width: 40px; height: 40px;

  flex-shrink: 0;

  background: none; border: none;

  border-radius: 8px;

  color: var(--tertiary);

  display: grid; place-items: center;

  cursor: pointer;

}

.shift-del:active {

  background: rgba(196, 74, 74, 0.10);

  color: var(--critical);

}

.add-shift-btn {

  display: inline-flex; align-items: center;

  gap: 4px;

  min-height: 40px;

  padding: 8px 14px;

  background: rgba(79, 148, 200, 0.10);

  color: var(--accent-btn);

  border: 0.5px dashed rgba(79, 148, 200, 0.40);

  border-radius: var(--r-md);

  font: inherit; font-family: inherit;

  font-size: 13px; font-weight: 600;

  cursor: pointer;

  align-self: flex-start;

}

.add-shift-btn:active { background: rgba(79, 148, 200, 0.18); }



/* Clinic list rows */

.clinic-list { display: flex; flex-direction: column; gap: var(--s-2); }

.clinic-row {

  display: flex; align-items: center; gap: var(--s-3);

  padding: var(--s-3);

  border-radius: var(--r-md);

  color: var(--label);

  font-family: inherit;

  text-align: left;

  cursor: pointer;

  background: var(--glass-tint) !important;

  border: 0.5px solid var(--glass-edge) !important;

}

.clinic-row:active { background: var(--glass-tint-2) !important; }

.clinic-color-dot {

  width: 36px; height: 36px;

  border-radius: 9px;

  flex-shrink: 0;

  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 2px rgba(26,32,42,0.1);

}

.clinic-info { flex: 1; min-width: 0; }

.clinic-name {

  font-size: 15px; font-weight: 600;

  letter-spacing: -0.005em;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.clinic-meta {

  font-size: 12px; color: var(--secondary);

  margin-top: 2px;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.clinic-shifts { font-size: 12px; color: var(--secondary); margin-top: 2px; }

.clinic-amt {

  font-family: var(--font-display);

  font-size: 17px;

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-variant-numeric: tabular-nums oldstyle-nums;

  letter-spacing: -0.01em;

}



/* Inline two-column field group */

.inline-fields {

  display: grid; grid-template-columns: 1fr 1fr;

  gap: var(--s-2);

}

/* Three-column variant (e.g. Start / End / Break) */

.inline-fields.thirds { grid-template-columns: 1fr 1fr 0.9fr; }

/* Let grid cells shrink below their intrinsic min-width so time/number

   inputs can't blow the row out sideways on narrow (375px) viewports. */

.inline-fields > .field { min-width: 0; }

.inline-fields > .field input { min-width: 0; }



/* Generic info card */

.info-card {

  padding: 12px 14px;

  border-radius: var(--r-md);

  font-size: 14px;

  line-height: 1.5;

  color: var(--label);

  white-space: pre-wrap;

  margin-bottom: 4px;

}



/* Buttons */

.primary-btn {

  background: var(--accent-btn);

  color: white;

  border: none;

  height: 48px;

  padding: 0 20px;

  border-radius: var(--r-md);

  font: inherit; font-family: inherit;

  font-size: 15px; font-weight: 600;

  cursor: pointer;

  letter-spacing: -0.005em;

  transition: background 0.15s;

}

.primary-btn:active { background: var(--accent-dim); }

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

.primary-btn:disabled {

  background: var(--quaternary);

  cursor: not-allowed;

}

.secondary-btn {

  background: var(--glass-tint);

  color: var(--label);

  border: 0.5px solid var(--glass-edge);

  height: 44px;

  padding: 0 16px;

  border-radius: var(--r-md);

  font: inherit; font-family: inherit;

  font-size: 14px; font-weight: 500;

  cursor: pointer;

}

.secondary-btn:active { background: var(--glass-tint-2); }



/* Empty states */

.empty-state {

  margin: var(--s-8) 0;

  text-align: center;

  color: var(--secondary);

  display: flex; flex-direction: column;

  align-items: center; gap: 12px;

  padding: 40px 24px;

}

.empty-state svg { width: 48px; height: 48px; color: var(--tertiary); }

.empty-state .title { font-size: 17px; font-weight: 600; color: var(--label); margin: 8px 0 4px; }

.empty-state .desc { font-size: 13px; line-height: 1.5; max-width: 280px; }



/* Dev banner */

.dev-banner {

  position: fixed;

  top: var(--status-bar-pad);

  left: 0; right: 0;

  height: 22px;

  display: flex; align-items: center; justify-content: center;

  background: rgba(176, 127, 44, 0.18);

  color: var(--warning);

  border-bottom: 0.5px solid rgba(176, 127, 44, 0.32);

  font-size: 10px; font-weight: 600;

  letter-spacing: 0.08em; text-transform: uppercase;

  z-index: 70;

}

.dev-banner ~ .app-screen { padding-top: calc(60px + var(--status-bar-pad) + 22px); }



/* Action sheet modal */

.sheet-overlay {

  position: fixed; inset: 0;

  background: rgba(26, 32, 42, 0.45);

  display: flex; align-items: flex-end; justify-content: center;

  z-index: 300;

  animation: sheet-fade 0.18s ease;

}

@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {

  width: 100%;

  max-width: 480px;

  margin: 0 16px calc(16px + var(--bottom-pad));

  padding: var(--s-4);

  border-radius: var(--r-lg);

  background: var(--bg-2) !important;

  border: 0.5px solid var(--glass-edge);

  box-shadow: 0 20px 50px -10px rgba(26,32,42,0.25);

}

.sheet-title { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; }

.sheet-sub { font-size: 13px; color: var(--secondary); margin-top: 4px; margin-bottom: 14px; line-height: 1.45; }

.sheet-list { display: flex; flex-direction: column; gap: 8px; }

.sheet-row {

  text-align: left;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  padding: 12px 14px;

  color: var(--label);

  font: inherit; font-family: inherit;

  cursor: pointer;

}

.sheet-row:active { background: var(--glass-tint-2); }

.sheet-row-label { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }

.sheet-row-desc { font-size: 12px; color: var(--secondary); margin-top: 2px; }



/* Pay breakdown */

.pay-breakdown { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }

.pay-line {

  display: flex; align-items: baseline; justify-content: space-between;

  gap: 12px; padding: 8px 10px;

  border-radius: var(--r-sm);

  background: var(--glass-tint);

  border: 0.5px solid var(--separator);

}

.pay-line.wins {

  background: rgba(79, 148, 200, 0.12);

  border-color: rgba(79, 148, 200, 0.32);

}

.pay-line-label { font-size: 12px; color: var(--label-strong); }

.pay-line.wins .pay-line-label { color: var(--accent-btn); font-weight: 600; }

.pay-line-amt { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; font-variant-numeric: tabular-nums; flex-shrink: 0; }

.pay-total {

  display: flex; align-items: baseline; justify-content: space-between;

  margin-top: 4px;

  padding-top: 12px;

  border-top: 1px solid var(--separator);

  font-size: 15px; font-weight: 600;

}

.pay-total-amt {

  font-size: 22px; font-weight: 700;

  letter-spacing: -0.018em; color: var(--accent);

  font-variant-numeric: tabular-nums;

}

.pay-hint { font-size: 11px; color: var(--tertiary); margin-top: 2px; font-style: italic; }



/* Filter bar (Income) */

.filter-bar {

  width: 100%;

  display: flex; align-items: center; justify-content: space-between;

  gap: 10px; padding: 12px 14px;

  margin-top: var(--s-3);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  color: var(--label);

  font: inherit; font-family: inherit;

  cursor: pointer; text-align: left;

}

.filter-bar:active { background: var(--glass-tint-2); }

.filter-bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.filter-bar-left svg { color: var(--accent); flex-shrink: 0; }

.filter-bar-text { min-width: 0; }

.filter-bar-primary {

  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.filter-bar-secondary { font-size: 12px; color: var(--secondary); margin-top: 2px; }

.preset-chip {

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-pill);

  color: var(--label);

  font: inherit; font-family: inherit;

  font-size: 12px; font-weight: 500;

  padding: 6px 12px;

  cursor: pointer;

}

.preset-chip:active { background: var(--glass-tint-2); }



/* Treatment catalog grid */

.tx-catalog { display: flex; flex-direction: column; gap: 14px; }

.tx-cat-search {

  -webkit-appearance: none; appearance: none;

  width: 100%;

  padding: 10px 12px;

  border-radius: var(--r-md);

  border: 0.5px solid var(--glass-edge);

  background: var(--glass-tint);

  color: var(--label);

  font: inherit; font-family: inherit;

  font-size: 14px;

  outline: none;

}

.tx-cat-search::placeholder { color: var(--quaternary); }

.tx-cat-search:focus {

  border-color: var(--accent);

  background: var(--glass-tint-2);

}

.tx-cat-search::-webkit-search-cancel-button {

  -webkit-appearance: none;

  width: 14px; height: 14px;

  background: var(--secondary);

  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") no-repeat center / contain;

          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") no-repeat center / contain;

  cursor: pointer;

}

.tx-cat-block { display: flex; flex-direction: column; gap: 4px; }

.tx-cat-empty {

  font-size: 13px; color: var(--secondary);

  padding: 12px; text-align: center;

  border-radius: var(--r-md);

  border: 0.5px dashed var(--glass-edge);

  background: var(--glass-tint);

}

.tx-cat-label {

  font-size: 11px; color: var(--secondary);

  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;

}

.tx-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }

.tx-cat-btn {

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  padding: 10px 12px;

  text-align: left;

  color: var(--label);

  font-family: inherit; font: inherit;

  cursor: pointer;

  display: flex; flex-direction: column; gap: 4px;

}

.tx-cat-btn:active { background: var(--glass-tint-2); border-color: var(--accent); }

.tx-cat-name { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }

.tx-cat-price { font-size: 11px; color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }

.tx-cart { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }



/* Patient-treatment picker (consent form) */

.tx-pick-wrap { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

.tx-pick-list { display: flex; flex-direction: column; gap: 6px; }

.tx-pick-row {

  display: flex; align-items: center; gap: 12px;

  padding: 12px 14px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  color: var(--label);

  font: inherit; font-family: inherit;

  cursor: pointer; text-align: left;

  width: 100%;

}

.tx-pick-row:active { background: var(--glass-tint-2); }

.tx-pick-row.on {

  background: rgba(79, 148, 200, 0.10);

  border-color: rgba(79, 148, 200, 0.32);

}

.tx-pick-text { flex: 1; min-width: 0; }

.tx-pick-name { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }

.tx-pick-sub { font-size: 12px; color: var(--secondary); margin-top: 2px; }



/* Per-clinic price list editor */

.price-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

.price-row {

  display: flex; align-items: center; gap: 12px;

  padding: 10px 12px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

}

.price-row.overridden {

  border-color: rgba(79, 148, 200, 0.32);

  background: rgba(79, 148, 200, 0.06);

}

.price-row-text { flex: 1; min-width: 0; }

.price-row-name {

  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.price-row-default { font-size: 11px; color: var(--tertiary); margin-top: 2px; }

.price-row-input { width: 130px; flex-shrink: 0; }

.price-row-input input { text-align: right; font-variant-numeric: tabular-nums; }

.tx-cat-price-override { color: var(--accent) !important; font-weight: 600 !important; }



/* Today card / shift block (Calendar) */

.today-card {

  padding: var(--s-4);

  border-radius: var(--r-lg);

  margin-top: var(--s-3);

  margin-bottom: var(--s-3);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

}

.today-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s-3); }

.today-label {

  font-size: 11px; font-weight: 600;

  text-transform: uppercase; letter-spacing: 0.08em;

  color: var(--accent-btn);

}

.today-date { font-size: 13px; color: var(--secondary); font-variant-numeric: tabular-nums; }

.today-empty { padding: 12px 0; color: var(--secondary); font-size: 14px; }

.today-shift-list { display: flex; flex-direction: column; gap: 8px; }

.upcoming-list { display: flex; flex-direction: column; gap: var(--s-2); }

.day-group {

  padding: var(--s-3);

  border-radius: var(--r-md);

  display: flex; flex-direction: column; gap: 8px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

}

.day-group-header { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--secondary); font-weight: 500; margin-bottom: 2px; }

.day-group-dow { text-transform: uppercase; letter-spacing: 0.05em; color: var(--label); font-weight: 600; font-size: 12px; }

.day-group-date { color: var(--secondary); font-variant-numeric: tabular-nums; }

.shift-block {

  display: flex; align-items: stretch; gap: 10px;

  padding: 10px 12px;

  border-radius: var(--r-md);

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

}

.shift-block.hero {

  background: rgba(79, 148, 200, 0.08);

  border-color: rgba(79, 148, 200, 0.22);

}

.shift-block-bar { width: 3px; border-radius: 2px; flex-shrink: 0; align-self: stretch; opacity: 0.85; }

.shift-block-time { flex-shrink: 0; text-align: center; display: flex; flex-direction: column; justify-content: center; width: 56px; font-variant-numeric: tabular-nums; }

.shift-block-start { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.shift-block-end { font-size: 11px; color: var(--secondary); margin-top: 2px; }

.shift-block-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.shift-block-clinic { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shift-block-addr { font-size: 11px; color: var(--secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }



/* Patients */

.patient-list { display: flex; flex-direction: column; gap: var(--s-2); }

.patient-card {

  display: flex; align-items: center; gap: var(--s-3);

  padding: var(--s-3);

  border-radius: var(--r-md);

  position: relative;

  color: var(--label); font-family: inherit;

  text-align: left; cursor: pointer;

  background: var(--glass-tint) !important;

  border: 0.5px solid var(--glass-edge) !important;

}

.patient-card:active { background: var(--glass-tint-2) !important; }

.patient-card.has-alert { padding-left: calc(var(--s-3) + 4px); }

.patient-card.has-alert::after,

.appt.has-alert::after {

  content: "";

  position: absolute; left: 0; top: 8px; bottom: 8px;

  width: 3px; background: var(--critical);

  border-radius: 0 3px 3px 0;

}

.appt.has-alert { padding-left: calc(var(--s-3) + 4px); position: relative; }

.avatar {

  width: 40px; height: 40px;

  border-radius: 50%;

  display: grid; place-items: center;

  color: var(--label);

  font-weight: 600; font-size: 13px;

  flex-shrink: 0;

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  letter-spacing: 0.02em;

}

.pinfo { flex: 1; min-width: 0; }

.pname { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pmeta { color: var(--secondary); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Allergy line in the list: clamp to one line; full text shows in profile. */

.pmeta.allergy-clamp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-flex { display: flex; align-items: center; }

.alert-glyph { color: var(--critical); flex-shrink: 0; }



/* Allergy alert banner on profile */

.allergy-alert {

  display: flex; align-items: flex-start; gap: 12px;

  padding: 14px 16px;

  border-radius: var(--r-md);

  background: rgba(196, 74, 74, 0.08);

  border: 0.5px solid rgba(196, 74, 74, 0.30);

  margin-bottom: var(--s-3);

}

.allergy-alert .allergy-glyph { color: var(--critical); flex-shrink: 0; margin-top: 2px; }

.allergy-body { flex: 1; min-width: 0; }

.allergy-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--critical-text); }

.allergy-text { font-size: 14px; color: var(--label); margin-top: 4px; line-height: 1.4; white-space: pre-wrap; }



/* Profile actions grid */

/* Horizontal scroll row so the action tiles (now including Ortho) don't
   cram or wrap awkwardly on a narrow phone; scrollbar hidden. */
.profile-actions {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: var(--s-3);
  padding-bottom: 2px;
}
.profile-actions::-webkit-scrollbar { display: none; }

.profile-action {

  flex: 0 0 96px;

  display: flex; flex-direction: column; align-items: center; justify-content: center;

  gap: 6px;

  padding: 16px 12px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  color: var(--label);

  font: inherit; font-family: inherit;

  font-size: 13px; font-weight: 500;

  cursor: pointer;

}

.profile-action:active { background: var(--glass-tint-2); }

.profile-action svg { color: var(--accent); }



/* Doctor card / portfolio */

.dr-card { padding: var(--s-4); border-radius: var(--r-lg); margin-bottom: var(--s-3); background: var(--glass-tint); border: 0.5px solid var(--glass-edge); }

.dr-row { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s-4); }

.dr-avatar {

  width: 56px; height: 56px;

  border-radius: 50%;

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  display: grid; place-items: center;

  color: var(--label); font-size: 18px; font-weight: 600;

  flex-shrink: 0;

}

.dr-info { flex: 1; min-width: 0; }

.dr-name { font-family: var(--font-display); font-size: 20px; font-weight: 450; font-variation-settings: "opsz" 24, "SOFT" 30; letter-spacing: -0.014em; }

.dr-id { font-size: 12px; color: var(--secondary); margin-top: 2px; }

.dr-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.dr-stat {

  background: var(--bg-3);

  border: 0.5px solid var(--separator);

  border-radius: var(--r-sm);

  padding: 10px 6px;

  text-align: center;

}

.dr-stat .num { font-size: 20px; font-weight: 600; letter-spacing: -0.014em; line-height: 1.1; font-variant-numeric: tabular-nums; }

.dr-stat .lbl { font-size: 10px; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-top: 4px; }



/* Privacy chip (portfolio + others) */

.privacy-chip {

  display: inline-flex; align-items: center; gap: 5px;

  background: rgba(63, 139, 98, 0.12);

  color: var(--positive);

  border: 0.5px solid rgba(63, 139, 98, 0.32);

  padding: 4px 10px;

  border-radius: var(--r-pill);

  font-size: 11px; font-weight: 600;

  margin-bottom: var(--s-3);

}



/* Hero (Income) */

.hero-card {

  padding: var(--s-4);

  border-radius: var(--r-lg);

  margin-bottom: var(--s-3);

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

}

.hi-lbl { font-family: var(--font-mono); font-size: 11px; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.10em; font-weight: 500; }

.hi-val {

  font-family: var(--font-display);

  font-size: 42px;

  font-weight: 380;

  font-variation-settings: "opsz" 96, "SOFT" 30;

  letter-spacing: -0.020em;

  margin-top: 6px;

  font-variant-numeric: tabular-nums oldstyle-nums;

}

.hi-val .small {

  font-family: var(--font-display);

  font-size: 18px;

  color: var(--secondary);

  font-weight: 380;

  letter-spacing: 0;

}

.hi-trend { margin-top: 8px; font-size: 12px; color: var(--positive); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }



/* Hero card paid/pending split */

.hi-pay-split {

  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;

  margin-top: 14px;

}

.pay-chip {

  display: flex; flex-direction: column; gap: 2px;

  padding: 10px 12px;

  border-radius: var(--r-md);

  border: 0.5px solid var(--glass-edge);

  background: var(--glass-tint);

}

.pay-chip-amt {

  font-family: var(--font-display);

  font-size: 18px;

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-variant-numeric: tabular-nums oldstyle-nums;

  letter-spacing: -0.01em;

}

.pay-chip-lbl {

  font-family: var(--font-mono);

  font-size: 10.5px;

  color: var(--label-strong);

  text-transform: uppercase;

  letter-spacing: 0.10em;

  font-weight: 500;

}

.pay-chip.paid    { border-color: rgba(82, 144, 100, 0.32); background: rgba(82, 144, 100, 0.06); }

.pay-chip.paid    .pay-chip-amt { color: #33714F; }

.pay-chip.pending { border-color: rgba(176, 127, 44, 0.30); background: rgba(176, 127, 44, 0.05); }

.pay-chip.pending .pay-chip-amt { color: var(--warning-text); }

.pay-chip.overdue { border-color: rgba(199, 77, 77, 0.34); background: rgba(199, 77, 77, 0.06); }

.pay-chip.overdue .pay-chip-amt { color: var(--critical-text); }



/* Payment status pill on the shift row */

.pay-pill {

  flex-shrink: 0;

  font-family: var(--font-mono);

  font-size: 10.5px; font-weight: 600;

  letter-spacing: 0.10em; text-transform: uppercase;

  padding: 4px 11px;

  border-radius: 999px;

  border: 0.5px solid transparent;

  color: #fff;

}

/* Solid status fills — deep enough that white text clears 4.5:1

   (green ~5.8:1, amber-brown ~5.7:1, brick red ~5.9:1). */

.pay-pill.paid    { background: #33714F; border-color: #33714F; }

.pay-pill.pending { background: #8A5E1E; border-color: #8A5E1E; }

.pay-pill.overdue { background: #B23B3B; border-color: #B23B3B; }



/* Section label */

.section-label {

  margin: var(--s-4) var(--s-1) var(--s-2);

  font-family: var(--font-mono);

  font-size: 11px; color: var(--secondary);

  text-transform: uppercase; letter-spacing: 0.10em; font-weight: 500;

  display: flex; justify-content: space-between; align-items: center;

}

.section-label .more { font-family: var(--font-sans); color: var(--accent); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; cursor: pointer; }



/* ===========================================================

   DOC TABLE — used by the signed-form view to render parties

   and the treatment list as a labelled hairline document.

   =========================================================== */

.doc-table {

  padding: 4px 14px;

  border-radius: var(--r-md);

}

.doc-row {

  display: flex; align-items: baseline;

  gap: 14px;

  padding: 11px 0;

  border-bottom: 0.5px dashed var(--separator);

}

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

.doc-row-key {

  font-family: var(--font-mono);

  font-size: 10.5px;

  letter-spacing: 0.10em;

  text-transform: uppercase;

  color: var(--label-strong);

  flex: 0 0 96px;

  font-weight: 500;

}

.doc-row-val {

  flex: 1; min-width: 0;

  font-size: 14px;

  color: var(--label);

  line-height: 1.45;

  word-break: break-word;

}

.doc-row.alert .doc-row-val {

  color: var(--critical);

  font-weight: 500;

}

.doc-row.tx { padding: 12px 0; }

.doc-row.tx .tx-name {

  flex: 1; font-family: var(--font-sans); font-size: 14px;

  text-transform: none; letter-spacing: 0; color: var(--label);

  font-weight: 500;

}

.doc-row.tx .tx-price {

  flex: 0 0 auto;

  font-family: var(--font-display);

  font-size: 16px;

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-variant-numeric: tabular-nums oldstyle-nums;

  color: var(--label);

}



/* Search field */

.search {

  height: 40px;

  border-radius: var(--r-md);

  padding: 0 var(--s-3);

  display: flex; align-items: center; gap: 8px;

  color: var(--secondary);

  font-size: 14px;

  margin-top: var(--s-3);

}



/* Stats grid */

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); margin-top: var(--s-3); }

.stat { padding: var(--s-3) var(--s-2); border-radius: var(--r-md); text-align: center; background: var(--glass-tint); border: 0.5px solid var(--glass-edge); }



/* More-row chev */

.more-row-chev { color: var(--tertiary); flex-shrink: 0; }

.more-row-chev svg { width: 14px; height: 14px; }



/* Forms checklist (consent) */

.checklist { display: flex; flex-direction: column; gap: 8px; margin: var(--s-2) 0; }

.check-row {

  display: flex; align-items: flex-start; gap: 10px;

  padding: 10px 12px;

  border-radius: var(--r-md);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  color: var(--label);

  font-size: 13px; line-height: 1.5;

  text-align: left;

}

button.check-row { width: 100%; cursor: pointer; font-family: inherit; }

button.check-row:active { background: var(--glass-tint-2); }

.check-box {

  width: 22px; height: 22px;

  border-radius: 6px;

  flex-shrink: 0;

  display: grid; place-items: center;

  margin-top: 1px;

}

.check-box.on { background: var(--accent); color: white; }

.check-box.off { border: 1.5px solid var(--quaternary); background: var(--bg-3); }



.form-view-card { padding: var(--s-4); border-radius: var(--r-lg); margin-bottom: var(--s-3); background: var(--glass-tint); border: 0.5px solid var(--glass-edge); }

.form-view-title { font-size: 18px; font-weight: 600; letter-spacing: -0.018em; }

.form-view-sub { font-size: 12px; color: var(--secondary); margin-top: 4px; }

.signature-wrap {

  margin: var(--s-2) 0;

  border-radius: var(--r-md);

  border: 1px solid var(--glass-edge);

  background: #ffffff;

  overflow: hidden;

  position: relative;

  height: 180px;

  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);

}

.signature-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; background: #ffffff; }

.sig-actions { display: flex; gap: 8px; margin-top: 4px; }

.sig-actions .secondary-btn { flex: 0 0 auto; }

.sign-meta { text-align: center; color: var(--secondary); font-size: 11px; margin-top: var(--s-2); margin-bottom: var(--s-3); }



/* Status bar (in-app, no longer needed but keep style) */

.status-bar { font-variant-numeric: tabular-nums; }



/* Reduced motion / transparency */

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }

@media (prefers-reduced-transparency: reduce) {

  .glass, .glass-strong, .tab-bar, .pin-key, .icon-btn { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--bg-2) !important; }

}

@media all and (display-mode: standalone) { body { -webkit-touch-callout: none; } }



/* ===========================================================

   ODONTOGRAM — interactive tooth chart

   =========================================================== */

.odontogram-card {

  padding: 16px 12px 14px;

  border-radius: var(--r-lg);

  margin-bottom: var(--s-3);

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  display: flex; flex-direction: column;

  gap: 14px;

  align-items: center;

}

.arch-wrap {

  display: flex; flex-direction: column;

  gap: 6px;

  width: 100%;

  align-items: center;

}

.arch-label {

  font-size: 10px; color: var(--secondary);

  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;

}

.num-row {

  display: flex; gap: 2px; justify-content: center; width: 100%;

}

.num-row span {

  flex: 1; max-width: 22px;

  text-align: center;

  font-size: 10px; color: var(--secondary);

  font-variant-numeric: tabular-nums;

  font-weight: 500;

}

.tooth-row {

  display: flex; gap: 2px; justify-content: center; width: 100%;

}

.tooth {

  flex: 1; max-width: 24px;

  cursor: pointer;

  position: relative;

  transition: transform 0.12s ease;

  display: flex; align-items: center; justify-content: center;

}

.tooth-svg {

  width: 100%;

  height: auto;

  display: block;

  border-radius: 3px;

}

.tooth.selected {

  transform: translateY(-2px) scale(1.20);

  z-index: 2;

}

.tooth.selected .tooth-svg {

  outline: 2px solid var(--accent);

  outline-offset: 1px;

  border-radius: 3px;

  box-shadow: 0 4px 8px -2px rgba(79, 148, 200, 0.4);

}



/* Big interactive tooth in the detail panel */

.odontogram-detail {

  margin-top: auto;

  padding: var(--s-4);

  border-radius: var(--r-lg);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

}

.odontogram-detail h4 {

  margin: 0 0 4px;

  font-size: 13px; font-weight: 600;

  text-align: center;

  color: var(--label);

}

.odontogram-detail h4 .meta {

  color: var(--secondary); font-weight: 400; margin-left: 4px;

}

.action-hint {

  text-align: center;

  color: var(--secondary);

  font-size: 13px;

  padding: 12px 0;

}



.big-tooth-wrap {

  display: flex; justify-content: center;

  margin: 4px 0 12px;

}

.big-tooth {

  width: 140px; height: 140px;

  display: block;

  filter: drop-shadow(0 4px 10px rgba(26, 32, 42, 0.12));

}

.big-surface {

  transition: stroke 0.12s, filter 0.12s, opacity 0.12s;

}

.big-surface.selected {

  stroke: var(--accent) !important;

  stroke-width: 3 !important;

  filter: brightness(1.06);

}



.surface-caption {

  text-align: center;

  font-size: 13px;

  font-weight: 600;

  color: var(--label);

  margin: 4px 0 8px;

  letter-spacing: -0.005em;

}

.surface-caption-state {

  color: var(--secondary);

  font-weight: 500;

}

.whole-pill {

  display: inline-block;

  padding: 4px 12px;

  border-radius: 999px;

  background: rgba(79, 148, 200, 0.16);

  color: var(--accent);

  font-size: 11px;

  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: 0.06em;

}



/* Legend — colour swatches under the chart */

.legend {

  display: flex; flex-wrap: wrap;

  gap: 6px 14px; justify-content: center;

  margin-top: 6px;

  font-size: 10px; color: var(--secondary);

  font-weight: 500;

}

.legend-item {

  display: inline-flex; align-items: center; gap: 5px;

}

.legend-swatch {

  width: 11px; height: 11px;

  border-radius: 3px;

  border: 1px solid rgba(26, 32, 42, 0.14);

}



/* Action grid (state pickers) */

.action-grid {

  display: grid;

  gap: 6px;

}

.action-grid-7 {

  grid-template-columns: repeat(4, 1fr);

}

.action-btn {

  padding: 10px 4px;

  border-radius: 10px;

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  text-align: center;

  color: var(--label);

  cursor: pointer;

  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;

  font-family: inherit;

  font-size: 11px;

  font-weight: 500;

  display: flex; flex-direction: column; align-items: center; gap: 4px;

}

.action-btn:active {

  background: var(--glass-tint-2);

}

.action-btn.active {

  border-color: var(--accent);

  background: rgba(79, 148, 200, 0.10);

  box-shadow: 0 0 0 2px var(--accent-glow);

}

.action-dot {

  width: 16px; height: 16px;

  border-radius: 4px;

  display: block;

  border: 1px solid rgba(26, 32, 42, 0.10);

}



/* Tooth tag (used inside the small selected glyph if needed) */

.tooth-tag {

  position: absolute;

  top: -34px;

  left: 50%;

  transform: translateX(-50%) scale(0.85);

  padding: 4px 8px;

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge-bright);

  border-radius: 8px;

  color: var(--label);

  font-size: 11px;

  font-weight: 500;

  white-space: nowrap;

  z-index: 5;

  pointer-events: none;

  box-shadow: 0 4px 10px -2px rgba(26,32,42,0.15);

}



/* ===========================================================

   PORTFOLIO — featured-case star toggle

   =========================================================== */

button.tx-row-main,

.tx-row-main {

  -webkit-appearance: none !important;

  appearance: none !important;

  display: flex !important;

  align-items: center;

  gap: var(--s-3);

  flex: 1 1 auto;

  width: 100%;

  background: none !important;

  border: none !important;

  padding: 0;

  margin: 0;

  font: inherit; font-family: inherit;

  text-align: left;

  cursor: pointer;

  color: var(--label);

  min-width: 0;

}

.patient-card.featured {

  border-color: rgba(176, 127, 44, 0.32) !important;

  background: rgba(176, 127, 44, 0.05) !important;

}

.star-btn {

  flex-shrink: 0;

  width: 36px; height: 36px;

  border-radius: 50%;

  border: none;

  background: none;

  color: var(--quaternary);

  display: grid; place-items: center;

  cursor: pointer;

  transition: color 0.15s, background 0.15s, transform 0.1s;

}

.star-btn:active { transform: scale(0.92); }

.star-btn:hover { background: var(--glass-tint); color: var(--secondary); }

.star-btn.on {

  color: var(--warning);

}

.star-btn.on svg { fill: var(--warning); }



/* ===========================================================

   HOME DASHBOARD — greeting, today, month stats, shortcuts

   =========================================================== */

.dash-date {

  font-family: var(--font-mono);

  font-size: 11px;

  letter-spacing: 0.06em;

  text-transform: uppercase;

  color: var(--secondary);

  margin: 0 var(--s-1) var(--s-3);

  text-align: center;

}



/* Today card — a tappable variant of the calendar's today-card. */

.dash-today {

  width: 100%;

  text-align: left;

  color: var(--label);

  font-family: inherit;

  cursor: pointer;

}

.dash-today:active { background: var(--glass-tint-2); }

/* Chevron in the Today header — mirrors the Outstanding card so both

   tappable cards read as tappable. */

.dash-today .today-header { align-items: center; }

.dash-today-chev { color: var(--tertiary); flex-shrink: 0; display: grid; place-items: center; }

.dash-shift-row {

  display: flex; align-items: center; gap: 10px;

  padding: 4px 0;

}

.dash-shift-dot {

  width: 10px; height: 10px;

  border-radius: 50%;

  flex-shrink: 0;

  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 2px rgba(26,32,42,0.1);

}

.dash-shift-name {

  flex: 1; min-width: 0;

  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.dash-shift-time {

  flex-shrink: 0;

  font-family: var(--font-mono);

  font-size: 12px;

  color: var(--secondary);

  font-variant-numeric: tabular-nums;

}

.dash-shift-amt {

  flex-shrink: 0;

  min-width: 72px;

  text-align: right;

  font-family: var(--font-mono);

  font-size: 12px;

  font-weight: 600;

  color: var(--label-strong);

  font-variant-numeric: tabular-nums;

}

.dash-today-total {

  display: flex; align-items: baseline; justify-content: space-between;

  margin-top: 10px;

  padding-top: 10px;

  border-top: 0.5px dashed var(--separator);

}

.dash-today-total-label {

  font-family: var(--font-mono);

  font-size: 10.5px;

  font-weight: 600;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  color: var(--label-strong);

}

.dash-today-total-amt {

  font-family: var(--font-display);

  font-weight: 500;

  font-variation-settings: "opsz" 24, "SOFT" 30;

  font-size: 17px;

  letter-spacing: -0.01em;

  color: var(--label);

  font-variant-numeric: tabular-nums;

}



/* This-month stat tiles — 2×2 grid, editorial mono label + display number. */

.dash-tiles {

  display: grid; grid-template-columns: 1fr 1fr;

  gap: var(--s-2);

}

.dash-tile {

  padding: 14px 14px 12px;

  border-radius: var(--r-md);

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  min-width: 0;

}

.dash-tile-label {

  font-family: var(--font-mono);

  font-size: 10.5px;

  letter-spacing: 0.10em;

  text-transform: uppercase;

  color: var(--label-strong);

  font-weight: 500;

}

.dash-tile-num {

  font-family: var(--font-display);

  font-size: 26px;

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-variant-numeric: tabular-nums oldstyle-nums;

  letter-spacing: -0.014em;

  line-height: 1.15;

  margin-top: 6px;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.dash-tile-sub {

  font-size: 11.5px;

  color: var(--secondary);

  margin-top: 4px;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}



/* Outstanding card — warning-accented, taps through to Income. */

.dash-outstanding {

  width: 100%;

  display: flex; align-items: center; gap: 12px;

  margin-top: var(--s-3);

  padding: 14px 16px;

  border-radius: var(--r-md);

  background: rgba(176, 127, 44, 0.07);

  border: 0.5px solid rgba(176, 127, 44, 0.32);

  color: var(--label);

  font-family: inherit;

  text-align: left;

  cursor: pointer;

}

.dash-outstanding:active { background: rgba(176, 127, 44, 0.12); }

/* Ortho reviews card — accent-teal, to distinguish from the amber money card */
.dash-ortho {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  margin-top: var(--s-3);
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--accent-glow);
  border: 0.5px solid rgba(63, 139, 149, 0.32);
  color: var(--label);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.dash-ortho:active { background: rgba(63, 139, 149, 0.16); }
.dash-ortho-ico {
  flex: none;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(63, 139, 149, 0.14);
  color: var(--accent-dim);
}

.dash-out-body { flex: 1; min-width: 0; }

.dash-out-label {

  font-family: var(--font-mono);

  font-size: 10.5px;

  letter-spacing: 0.10em;

  text-transform: uppercase;

  color: var(--warning-text);

  font-weight: 500;

}

.dash-out-amt {

  font-family: var(--font-display);

  font-size: 22px;

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-variant-numeric: tabular-nums oldstyle-nums;

  letter-spacing: -0.012em;

  margin-top: 3px;

}

.dash-out-sub { font-size: 12px; color: var(--secondary); margin-top: 2px; }

.dash-out-chev { color: var(--tertiary); flex-shrink: 0; }



/* Shortcuts — four icon buttons into the busiest flows. */

.dash-shortcuts {

  display: grid; grid-template-columns: repeat(4, 1fr);

  gap: var(--s-2);

  margin-top: var(--s-4);

}

.dash-shortcut {

  display: flex; flex-direction: column; align-items: center; justify-content: center;

  gap: 7px;

  padding: 14px 6px;

  background: var(--glass-tint);

  border: 0.5px solid var(--glass-edge);

  border-radius: var(--r-md);

  color: var(--label);

  font: inherit; font-family: inherit;

  font-size: 11px; font-weight: 500;

  letter-spacing: -0.005em;

  cursor: pointer;

}

.dash-shortcut:active { background: var(--glass-tint-2); }

.dash-shortcut-icon {

  width: 38px; height: 38px;

  border-radius: 11px;

  display: grid; place-items: center;

  background: var(--bg-3);

  border: 0.5px solid var(--glass-edge);

  color: var(--accent);

}





/* ===========================================================

   MONTH CALENDAR — month grid + selected-day agenda

   (Calendar tab; classes consumed by scripts/calendar.js)

   =========================================================== */

.cal-screen { margin-top: var(--s-3); }



/* Month header: prev/next chevrons flank the display-font title. */

.cal-month-head {

  display: flex; align-items: center; justify-content: space-between;

  gap: var(--s-2);

  margin-bottom: var(--s-3);

}

.cal-month-title {

  margin: 0;

  font-family: var(--font-display);

  font-size: 21px; font-weight: 600;

  letter-spacing: -0.01em;

  color: var(--label);

  font-variant-numeric: tabular-nums;

}



/* Weekday header — mono micro-labels on the strong slate tone. */

.cal-weekdays {

  display: grid; grid-template-columns: repeat(7, 1fr);

  gap: 5px;

  margin-bottom: 6px;

}

.cal-weekday {

  text-align: center;

  font-family: var(--font-mono);

  font-size: 10.5px; font-weight: 600;

  letter-spacing: 0.06em; text-transform: uppercase;

  color: var(--label-strong);

}



/* Day grid — 7 columns, compact ~44px cells so grid + agenda fit 375×812. */

.cal-grid {

  display: grid; grid-template-columns: repeat(7, 1fr);

  gap: 5px;

}

.cal-cell {

  min-height: 44px;

  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;

  gap: 3px;

  padding: 5px 2px 4px;

  border-radius: var(--r-md);

  background: var(--glass-tint);

  border: 0.5px solid var(--separator);

  color: var(--label);

  font: inherit; font-family: inherit;

  cursor: pointer;

  transition: background 0.15s, border-color 0.15s;

}

.cal-cell:active { background: var(--glass-tint-2); }

.cal-cell-blank {

  background: transparent;

  border-color: transparent;

  cursor: default;

  pointer-events: none;

}

.cal-cell-num {

  font-size: 13px; font-weight: 500;

  line-height: 1;

  font-variant-numeric: tabular-nums;

}

/* Today — filled outline in the button-accent tone. */

.cal-cell.is-today {

  background: var(--accent-glow);

  border-color: var(--accent-btn);

}

.cal-cell.is-today .cal-cell-num { color: var(--accent-btn); font-weight: 700; }

/* Selected — accent ring. Wins over today when both apply. */

.cal-cell.is-selected {

  border-color: var(--accent-btn);

  box-shadow: 0 0 0 1.5px var(--accent-btn);

}



/* Clinic dots — one per clinic with a shift that day, up to 3. */

.cal-cell-dots {

  display: flex; align-items: center; justify-content: center;

  gap: 3px;

  min-height: 6px;

}

.cal-dot {

  width: 5px; height: 5px;

  border-radius: 50%;

  flex-shrink: 0;

}



/* Agenda pay line + status pill inside the reused .shift-block rows. */

.cal-shift-amt {

  font-size: 12px; font-weight: 600;

  color: var(--accent-btn);

  margin-top: 2px;

  font-variant-numeric: tabular-nums;

}

.cal-agenda-pill { align-self: center; }



/* Treatments delivered at a clinic on the selected day */

.cal-tx-list {

  margin-top: 6px;

  padding-top: 6px;

  border-top: 0.5px dashed var(--separator);

  display: flex; flex-direction: column; gap: 3px;

}

.cal-tx-row {

  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;

  font-size: 12px;

  color: var(--secondary);

}

.cal-tx-name {

  min-width: 0;

  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;

}

.cal-tx-amt {

  flex-shrink: 0;

  font-family: var(--font-mono);

  font-size: 11.5px;

  color: var(--label-strong);

  font-variant-numeric: tabular-nums;

}

.cal-tx-total {

  margin-top: 2px;

  padding-top: 4px;

  border-top: 0.5px solid var(--separator);

  color: var(--label-strong);

  font-weight: 600;

}



/* ===========================================================

   RESPONSIVE — tablet + desktop (ADDITIVE ONLY)

   ------------------------------------------------------------

   Everything below lives inside `@media (min-width: …)` blocks

   so the <700px phone baseline above is never altered. Two

   breakpoints only:

     • 700px  — tablet portrait: centre each screen's column,

                centre the floating tab pill, cap the PIN pad.

     • 1024px — iPad landscape / desktop: convert the bottom

                tab pill into a fixed left rail, widen the

                content column, and give Home / Calendar /

                Patients / Income multi-column layouts.

   Stable hooks used: `.app-screen[data-tab="…"]` (set in

   app.js buildScreen) and existing component classes. No JS

   was modified.

   =========================================================== */



/* ---------- Breakpoint 1 · tablet portrait (≥700px) ---------- */

@media (min-width: 700px) {

  /* Centre every screen's content column. Only max-width + auto

     margins are set here — the .active/display:none switching in

     app.js is left untouched so buildScreen's assumptions hold. */

  .app-screen {

    max-width: 640px;

    margin-inline: auto;

  }



  /* Tab bar: stop stretching edge-to-edge, float it as a centred

     pill. No existing transform/transition on .tab-bar, so this is

     the sole transform and safe with position: fixed. */

  .tab-bar {

    left: 50%;

    right: auto;

    transform: translateX(-50%);

    width: min(560px, calc(100% - 32px));

  }



  /* Lock screen: cap the PIN cluster to its natural phone width so

     the keypad never stretches on a wide viewport. */

  .pin-cluster {

    max-width: 420px;

  }

}



/* ---------- Breakpoint 2 · iPad landscape / desktop (≥1024px) ---------- */

@media (min-width: 1024px) {

  /* Content clears the left rail; the bottom bar is gone so its

     reserved padding shrinks. --status-bar-pad/--bottom-pad resolve

     to 0 on desktop but are kept for correctness. */

  #app {

    padding-left: 124px;   /* rail (92) + gutters */

  }

  .app-screen {

    max-width: 840px;

    padding-bottom: calc(32px + var(--bottom-pad));

  }



  /* --- Tab bar → fixed vertical left rail (keeps the glass pill) --- */

  .tab-bar {

    top: calc(16px + var(--status-bar-pad));

    bottom: calc(16px + var(--bottom-pad));

    left: 16px;

    right: auto;

    transform: none;

    width: 92px;

    height: auto;

    flex-direction: column;

    justify-content: flex-start;

    gap: 4px;

    /* Vertical rail: scroll vertically (not horizontally) if the tabs
       ever exceed the rail height. */
    overflow-x: hidden;

    overflow-y: auto;

    /* border-radius: 22px, padding, glass background + blur all

       inherit from the base .tab-bar rule. */

  }

  /* Equal fixed-height tabs instead of stretching to fill the rail. */

  .tab {

    flex: 0 0 64px;

  }



  /* --- Home dashboard: 4-up stat tiles (shortcuts already 4-up) --- */

  .app-screen[data-tab="home"] .dash-tiles {

    grid-template-columns: repeat(4, 1fr);

  }

  /* Today card + Outstanding card are intentionally left stacked:

     they are not adjacent siblings in dashboard.js (a section-label

     and .dash-tiles sit between them), so a pure-CSS two-column

     pairing isn't achievable without restructuring the JS. */



  /* --- Calendar: month grid (left) + agenda (right) --- */

  .app-screen[data-tab="calendar"] .cal-screen {

    display: grid;

    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);

    grid-template-areas:

      "head     head"

      "weekdays agenda"

      "grid     agenda";

    column-gap: 24px;

    align-items: start;

  }

  .app-screen[data-tab="calendar"] .cal-month-head { grid-area: head; }

  .app-screen[data-tab="calendar"] .cal-weekdays   { grid-area: weekdays; min-width: 0; }

  .app-screen[data-tab="calendar"] .cal-grid       { grid-area: grid; min-width: 0; }

  /* The agenda card is the only direct .today-card child of .cal-screen. */

  .app-screen[data-tab="calendar"] .cal-screen > .today-card {

    grid-area: agenda;

    align-self: start;

    margin-top: 0;

  }



  /* --- Patients: 2-column card grid ---

     .patient-list is a list-of-cards primitive reused in a few

     places; a two-up flow reads well everywhere on wide screens.

     Non-card direct children (the "Recent"/count section label, and

     the empty / no-match states) span the full width. */

  .patient-list {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: var(--s-2);

    align-content: start;

  }

  .patient-list > .section-label,

  .patient-list > .empty-state,

  .patient-list > .shift-empty {

    grid-column: 1 / -1;

  }



  /* --- Forms: cap the editorial form column, centred --- */

  .form {

    max-width: 640px;

    margin-inline: auto;

  }



  /* --- Income: narrower reading column for chips + lists --- */

  .app-screen[data-tab="income"] {

    max-width: 720px;

  }

}



/* ===========================================================

   MONTHLY pay model

   Monthly clinics settle once per clinic-month (higher of monthly

   rate or whole-month commission). Reuses the glass / pay-line /

   pay-total language; adds the settlement card + a muted "monthly"

   tag used across Income, Calendar and Home.

   =========================================================== */



/* Muted tag shown wherever a monthly shift would otherwise print an

   amount (Income rows, Calendar agenda, Home Today card). Mono like

   the pay-pill, but a quiet neutral fill so it reads as a label. */

.monthly-tag {

  display: inline-block;

  flex-shrink: 0;

  font-family: var(--font-mono);

  font-size: 10.5px;

  font-weight: 600;

  letter-spacing: 0.10em;

  text-transform: uppercase;

  padding: 3px 9px;

  border-radius: 999px;

  color: var(--label-strong);

  background: var(--glass-tint-2);

  border: 0.5px solid var(--glass-edge);

}



/* Settlement list + card */

.monthly-list { display: flex; flex-direction: column; gap: var(--s-2); }

.monthly-card {

  padding: 14px 16px;

  border-radius: var(--r-md);

  display: flex;

  flex-direction: column;

  gap: 10px;

}

.monthly-head { display: flex; align-items: center; gap: 10px; }

.monthly-head .clinic-color-dot { flex-shrink: 0; }

.monthly-head-text { min-width: 0; }

.monthly-title {

  font-family: var(--font-display);

  font-size: 17px;

  font-weight: 500;

  letter-spacing: -0.01em;

  color: var(--label);

}

.monthly-clinic {

  font-size: 12px;

  color: var(--secondary);

  margin-top: 1px;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.monthly-meta {

  font-family: var(--font-mono);

  font-size: 11px;

  color: var(--label-strong);

  letter-spacing: 0.04em;

}

/* Reuse pay-breakdown, but it sits inside the card already — drop its

   own padding so the card owns the spacing. */

.monthly-breakdown { padding: 0; }

.monthly-caption {

  font-size: 11.5px;

  color: var(--secondary);

  font-style: italic;

}

.monthly-foot {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 12px;

  flex-wrap: wrap;

  margin-top: 2px;

}

.monthly-status { display: flex; align-items: center; min-width: 0; }

.monthly-due {

  font-family: var(--font-mono);

  font-size: 11px;

  font-weight: 500;

  letter-spacing: 0.04em;

  color: var(--label-strong);

}

.monthly-due.overdue { color: var(--critical-text); font-weight: 600; }

/* Settle action — ≥40px touch target, teal like the primary button. */

.monthly-pay-btn {

  min-height: 40px;

  padding: 0 16px;

  border: none;

  border-radius: var(--r-sm);

  background: var(--accent-btn);

  color: #fff;

  font-family: var(--font-sans);

  font-size: 13px;

  font-weight: 600;

  cursor: pointer;

  flex-shrink: 0;

}

.monthly-pay-btn:active { opacity: 0.9; }



/* ===========================================================

   CLINIC TAGS — type-of-clinic chips (form editor + list)

   =========================================================== */

.tag-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.tag-chip-row.list { margin: 4px 0 0; }

.tag-chip {

  display: inline-flex; align-items: center; gap: 5px;

  font: inherit; font-family: var(--font-mono);

  font-size: 10.5px; font-weight: 600;

  letter-spacing: 0.06em; text-transform: uppercase;

  color: var(--label-strong);

  background: transparent;

  border: 0.5px solid var(--separator);

  border-radius: 999px;

  padding: 10px 14px;

  min-height: 40px;

  cursor: pointer;

}

.tag-chip.active {

  background: rgba(42, 98, 108, 0.08);

  border-color: var(--accent-btn);

  color: var(--accent-btn);

}

.tag-chip-x { font-size: 13px; line-height: 1; }

.tag-chip.static {

  padding: 3px 9px;

  min-height: 0;

  cursor: default;

  color: var(--label-strong);

}



/* ===========================================================

   TAX REPORT — printable income summary (Income → Export →

   "Tax report"). On screen it reads as a document on the glass

   card language; the @media print block at the end strips app

   chrome so the browser's print dialog saves a clean PDF.

   =========================================================== */

.tax-controls { margin-bottom: var(--s-3); }

.tax-year-seg { flex-wrap: wrap; }



.tax-report {

  padding: 22px 20px 20px;

  border-radius: var(--r-md);

}

.tax-head { margin-bottom: 4px; }

.tax-title {

  font-family: var(--font-display);

  font-weight: 450;

  font-variation-settings: "opsz" 48, "SOFT" 30;

  font-size: 24px;

  letter-spacing: -0.016em;

  color: var(--label);

}

.tax-doc { font-size: 14px; color: var(--label); margin-top: 6px; }

.tax-doc-reg {

  font-family: var(--font-mono);

  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;

  color: var(--label-strong); margin-top: 3px;

}

.tax-gen {

  font-size: 12px; color: var(--secondary);

  margin-top: 8px; line-height: 1.5;

}



.tax-section-label {

  font-family: var(--font-mono);

  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;

  color: var(--label-strong); font-weight: 500;

  margin: 22px 0 6px;

}



.tax-table { width: 100%; border-collapse: collapse; font-size: 13px; }

/* Phones: the financial tables scroll inside their own box rather than

   widening the page. Print (and wider screens) keep true table layout. */

@media (max-width: 699px) {

  .tax-table { display: block; overflow-x: auto; }

  .tax-table th, .tax-table td { white-space: nowrap; }

}

.tax-table th {

  font-family: var(--font-mono);

  font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase;

  color: var(--label-strong); font-weight: 500;

  text-align: left; padding: 8px 6px;

  border-bottom: 0.5px solid var(--separator);

  white-space: nowrap;

}

.tax-table td {

  padding: 9px 6px;

  border-bottom: 0.5px dashed var(--separator);

  color: var(--label); vertical-align: baseline;

}

.tax-table th.num, .tax-table td.num {

  text-align: right;

  font-variant-numeric: tabular-nums;

  white-space: nowrap;

}

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

.tax-table tr.tax-total td {

  border-top: 0.5px solid var(--separator);

  border-bottom: 0;

  font-weight: 600;

  color: var(--label-strong);

}



.tax-summary {

  margin-top: 22px;

  padding-top: 16px;

  border-top: 0.5px solid var(--separator);

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 14px 18px;

}

.tax-sum-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.tax-sum-key {

  font-family: var(--font-mono);

  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;

  color: var(--label-strong);

}

.tax-sum-val {

  font-family: var(--font-display);

  font-size: 20px; font-weight: 450;

  font-variation-settings: "opsz" 40, "SOFT" 30;

  font-variant-numeric: tabular-nums oldstyle-nums;

  color: var(--label);

}



.tax-foot {

  margin-top: 20px;

  padding-top: 12px;

  border-top: 0.5px dashed var(--separator);

  font-size: 11.5px; line-height: 1.55;

  color: var(--secondary);

}

.tax-empty {

  padding: 28px 12px; text-align: center;

  color: var(--secondary); font-size: 14px;

}



.tax-print-actions { margin-top: 18px; }

.tax-print-caption { text-align: center; margin-top: 8px; }



/* ---------- Print — strip chrome, plain black on white ---------- */

/* Only the active .app-screen is display:flex (inactive screens are

   already display:none), so hiding .nav-bar / app chrome here scopes

   to the visible report screen. */

/* Printing renders a standalone document in a hidden iframe (see
   income.js buildPrintHTML) — no in-app @media print rules needed. */


/* === Orthodontics module === */

/* Case summary card on the patient profile — matches .patient-card / .glass */
.ortho-preview {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--glass-tint);
  border: 0.5px solid var(--glass-edge);
  color: var(--label);
}

.ortho-preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }

.ortho-preview-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.ortho-preview-meta { color: var(--secondary); font-size: 12px; }

/* Small inline status badge — takes a tone-* modifier */
.ortho-phase-pill {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ortho-phase-pill.tone-secondary { color: var(--secondary); background: var(--glass-tint-2); }

.ortho-phase-pill.tone-accent { color: var(--accent-dim); background: var(--accent-glow); }

.ortho-phase-pill.tone-positive { color: var(--positive); background: rgba(63, 139, 98, 0.14); }

/* Payment progress bar */
.ortho-progress {
  width: 100%; height: 8px;
  border-radius: var(--r-pill);
  background: var(--glass-tint-2);
  overflow: hidden;
}

.ortho-progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  transition: width .3s ease;
}

/* Stage progress on an ortho list row: a slim bar plus the next stage.
   Only rendered for cases that have a treatment plan (see orthoCaseRow). */
.ortho-row-plan {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: 5px;
}

.ortho-row-bar {
  flex: 1; min-width: 40px; height: 4px;
  border-radius: var(--r-pill);
  background: var(--glass-tint-2);
  overflow: hidden;
}

.ortho-row-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
}

.ortho-row-plan-label {
  font-size: 11px; color: var(--secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Paid vs outstanding figures row */
.ortho-figures {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3);
  font-size: 12px; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.ortho-figures .ortho-figures-label { color: var(--secondary); }

.ortho-figures .ortho-figures-out { color: var(--label); font-weight: 700; }

/* Horizontal scrolling thumbnail strip (overview) */
.ortho-photo-strip {
  display: flex; gap: var(--s-2);
  overflow-x: auto;
  padding-block: var(--s-1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ortho-photo-strip::-webkit-scrollbar { display: none; }

/* Responsive thumbnail grid (gallery) */
.ortho-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--s-2);
}

/* Square thumbnail */
.ortho-photo-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-edge);
  background: var(--bg-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s ease, opacity .15s ease;
}

img.ortho-photo-thumb { display: block; }

.ortho-photo-thumb:hover { transform: translateY(-2px); opacity: 0.92; }

/* Thumbnails inside the horizontal strip get a fixed width */
.ortho-photo-strip .ortho-photo-thumb { width: 88px; }

/* ── Before / after comparisons ─────────────────────────── */
.ba-list { display: flex; flex-direction: column; gap: var(--s-3); }

.ba-card {
  display: block; width: 100%;
  padding: var(--s-2);
  border-radius: var(--r-md);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.ba-card:active { transform: scale(0.99); opacity: 0.94; }

.ba-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}

.ba-slot {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--glass-edge);
}

.ba-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ba-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary); font-size: 13px;
}

/* Corner tag: Before / After */
.ba-tag {
  position: absolute; left: var(--s-1); top: var(--s-1);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600;
}

.ba-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2);
  margin-top: var(--s-2); padding: 0 var(--s-1);
}
.ba-title { font-weight: 600; font-size: 14px; color: var(--label-strong); }
.ba-date { font-size: 12px; color: var(--secondary); flex-shrink: 0; }

/* Editor variant: taller tappable slots + remove button */
.ba-edit .ba-slot-edit { display: flex; flex-direction: column; gap: 0; }
.ba-slot-edit {
  position: relative;
  border: none; background: none; aspect-ratio: auto;
  overflow: visible;
}
.ba-slot-img {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px dashed var(--glass-edge);
  cursor: pointer;
}
.ba-slot-edit .ba-tag { z-index: 1; }
.ba-remove {
  margin-top: 6px;
  align-self: center;
  background: none; border: none;
  color: var(--critical);
  font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 2px 6px;
}

/* ── In-app camera (camera.js) ───────────────────────────── */
.cam-open { overflow: hidden; }

.cam-root {
  position: fixed; inset: 0;
  z-index: 4000;
  background: #000;
  display: flex; flex-direction: column;
  color: #fff;
  /* Respect notches / home indicator */
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.cam-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}
.cam-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform-origin: center center;
}
.cam-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.7));
  opacity: 0.92;
}

/* Rule-of-thirds grid */
.cam-grid { position: absolute; inset: 0; pointer-events: none; }
.cam-grid span { position: absolute; background: rgba(255,255,255,0.28); }
.cam-grid span:nth-child(1) { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.cam-grid span:nth-child(2) { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.cam-grid span:nth-child(3) { top: 33.33%; left: 0; right: 0; height: 1px; }
.cam-grid span:nth-child(4) { top: 66.66%; left: 0; right: 0; height: 1px; }

.cam-hint {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center;
  font-size: 12px; color: #fff;
  padding: 6px 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  pointer-events: none;
}

/* Flash on capture */
.cam-root.cam-flash .cam-stage::after {
  content: ''; position: absolute; inset: 0; background: #fff;
  animation: cam-flash-anim 0.18s ease-out;
}
@keyframes cam-flash-anim { from { opacity: 0.9; } to { opacity: 0; } }

/* Top bar */
.cam-top {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: #000;
}
.cam-icon-btn {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer;
}
.cam-chips {
  display: flex; gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cam-chips::-webkit-scrollbar { display: none; }
.cam-chip {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cam-chip.active {
  background: #fff; color: #111; border-color: #fff;
}

/* Bottom controls */
.cam-bottom { background: #000; padding: 8px 0 14px; }
.cam-zoom {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 14px;
}
.cam-zoom-chip {
  min-width: 40px;
  padding: 5px 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.cam-zoom-chip.active { background: #fff; color: #111; }

.cam-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 26px;
}
.cam-tool {
  width: 44px; height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 18px;
  cursor: pointer;
}
.cam-tool.on { background: #fff; color: #111; }
.cam-shutter {
  width: 72px; height: 72px;
  border-radius: 999px;
  border: 4px solid rgba(255,255,255,0.85);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 2px #000 inset;
}
.cam-shutter:active { transform: scale(0.94); }

/* Permission / error fallback */
.cam-error {
  position: absolute; inset: 0;
  z-index: 5;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 32px;
  text-align: center;
}
.cam-error-msg { font-size: 14px; line-height: 1.5; max-width: 320px; color: #fff; }
.cam-error-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }

/* Chooser sheet (Take photo / Library) */
.cam-sheet {
  position: fixed; inset: 0; z-index: 4001;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.16s ease;
}
.cam-sheet.in { opacity: 1; }
.cam-sheet-panel {
  width: 100%; max-width: 460px;
  background: var(--bg-1, #fff);
  border-radius: var(--r-lg, 18px) var(--r-lg, 18px) 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(12px);
  transition: transform 0.16s ease;
}
.cam-sheet.in .cam-sheet-panel { transform: translateY(0); }
.cam-sheet-title {
  font-size: 13px; color: var(--secondary);
  text-align: center; margin-bottom: 12px;
}
.cam-sheet-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--glass-edge);
  background: var(--glass-tint);
  color: var(--label-strong);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.cam-sheet-glyph { font-size: 20px; }
.cam-sheet-cancel {
  width: 100%;
  padding: 13px;
  margin-top: 4px;
  border: none; background: none;
  color: var(--accent);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}

/* Before / During / After group heading — like .section-label */
.ortho-photo-stagehead {
  margin: var(--s-3) var(--s-1) var(--s-1);
  font-family: var(--font-mono);
  font-size: 11px; color: var(--label-strong);
  text-transform: uppercase; letter-spacing: 0.10em; font-weight: 600;
}

/* Adjustment visit list row — lighter than .patient-card */
.ortho-visit-row {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-sm);
  background: var(--glass-tint);
  border: 0.5px solid var(--glass-edge);
  color: var(--label);
  cursor: pointer;
  transition: background .15s ease;
}

.ortho-visit-row:hover, .ortho-visit-row:active { background: var(--glass-tint-2); }

.ortho-visit-row .ortho-visit-date { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }

.ortho-visit-row .ortho-visit-wires { color: var(--secondary); font-size: 13px; }

.ortho-visit-row .ortho-visit-chips { display: flex; flex-wrap: wrap; gap: var(--s-1); }

/* Tiny inline tag for procedures / elastics */
.ortho-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--glass-tint-2);
  color: var(--label-strong);
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
}

button.ortho-chip { cursor: pointer; border: none; }

.ortho-chip.active {
  background: var(--accent-btn);
  color: #fff;
}

/* Guided records-set capture stepper header */
.ortho-records-stepper {
  display: flex; align-items: center; gap: var(--s-2);
}

.ortho-records-stepper .ortho-stepper-track {
  display: flex; align-items: center; gap: var(--s-1);
  flex: 1; min-width: 0;
}

.ortho-records-stepper .ortho-stepper-dot {
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--glass-tint-3);
}

.ortho-records-stepper .ortho-stepper-dot.done { background: var(--accent); }

.ortho-records-stepper .ortho-stepper-label {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--label-strong);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Round patient portrait — fills its .avatar / .dr-avatar container */
.ortho-portrait {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.ortho-portrait-lg {
  width: 56px; height: 56px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* === Orthodontics v2 === */

/* Themed "Sort [select]" control — shared by the ortho + patients lists.
   Matches the app's field styling with a custom chevron so it doesn't fall
   back to the OS-native dropdown look. */
.sort-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.sort-row-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--secondary);
}
.sort-select {
  flex: 1; min-width: 0; max-width: 220px;
  background-color: var(--bg-3);
  border: 0.5px solid var(--glass-edge);
  border-radius: var(--r-md);
  padding: 9px 34px 9px 12px;
  font: inherit; font-family: inherit; font-size: 14px;
  color: var(--label);
  outline: none; cursor: pointer;
  color-scheme: light;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6472' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sort-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Ortho list header card — review counts + the next patients due. */
.ortho-summary { padding: 14px; border-radius: var(--r-md); margin-bottom: 14px; }
.ortho-summary-stats { display: flex; gap: var(--s-2); }
.ortho-summary-stat {
  flex: 1; text-align: center;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  background: var(--glass-tint);
}
.ortho-summary-stat .n {
  font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--label); line-height: 1.1;
}
.ortho-summary-stat .l {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--secondary); margin-top: 2px;
}
.ortho-summary-stat.is-alert { background: rgba(196, 74, 74, 0.09); }
.ortho-summary-stat.is-alert .n { color: var(--critical); }
.ortho-summary-head {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--label-strong);
  margin: 14px 0 4px;
}
.ortho-nextup {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px;
  border: none; background: none; cursor: pointer;
  font: inherit; font-family: inherit;
  border-radius: var(--r-sm); text-align: left;
}
.ortho-nextup:active { background: var(--glass-tint); }
.ortho-nextup + .ortho-nextup { border-top: 0.5px solid var(--separator); }
.ortho-nextup-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600; color: var(--label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ortho-nextup-date {
  flex: none; font-size: 12px; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.ortho-nextup-badge {
  flex: none; min-width: 62px; text-align: right;
  font-size: 12px; font-weight: 500; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.ortho-nextup-badge.overdue { color: var(--critical); font-weight: 600; }

/* Wire-progression timeline — vertical connected list of archwire changes.
   Each step draws a connector line via a ::before pseudo-element running
   behind the node; :last-child stops the line at the final node. */
.ortho-wire-timeline {
  display: flex; flex-direction: column;
  gap: var(--s-3);
}

.ortho-wire-step {
  position: relative;
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding-left: var(--s-1);
}

/* Connector line: sits under the node column, spanning this step into
   the gap before the next. Anchored at the node centre (14px from top). */
.ortho-wire-step::before {
  content: "";
  position: absolute;
  left: 8px; top: 14px;
  width: 1.5px;
  height: calc(100% + var(--s-3));
  background: var(--accent-glow);
}

/* Last step: no trailing line past the final node. */
.ortho-wire-step:last-child::before { display: none; }

.ortho-wire-node {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 9px; height: 9px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ortho-wire-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}

.ortho-wire-label {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--label);
}

.ortho-wire-date {
  font-size: 11px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* === Ortho treatment plan (ortho-plan.js) === */

/* Arch columns on the plan card — single-column stack on narrow phones,
   two columns from 560px when the case has both arches (.cols-2). */
.ortho-plan-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}

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

.ortho-plan-col {
  min-width: 0;
  display: flex; flex-direction: column;
  gap: var(--s-1);
}

/* UPPER / LOWER column heading — mirrors .ortho-photo-stagehead */
.ortho-plan-arch-title {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--label-strong);
  text-transform: uppercase; letter-spacing: 0.10em; font-weight: 600;
}

/* Objectives free text under the arch title */
.ortho-plan-text {
  font-size: 13px; color: var(--label);
  white-space: pre-wrap;
}

/* Compact extractions/anchorage · mechanics lines */
.ortho-plan-meta {
  font-size: 12px; color: var(--secondary);
}

/* Stage checklist row — tappable button; ticking mutates in place */
.ortho-stage-row {
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%; min-height: 40px;
  padding: 6px 8px;
  margin: 0;
  border: none; background: none;
  border-radius: var(--r-sm);
  color: var(--label);
  font: inherit; font-family: inherit; font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}

.ortho-stage-row:hover, .ortho-stage-row:active { background: var(--glass-tint); }

.ortho-stage-row + .ortho-stage-row { border-top: 0.5px solid var(--separator); }

.ortho-stage-row .ortho-stage-label {
  flex: 1; min-width: 0;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ortho-stage-row .ortho-stage-date {
  flex: none;
  font-size: 11px; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.ortho-stage-row.done .ortho-stage-label { color: var(--secondary); }

/* n/a: dimmed, an em-dash sits where the circle was, not tappable */
.ortho-stage-row.na { opacity: 0.45; cursor: default; }

/* Tick circle — hollow when pending, accent-filled with a tick when done */
.ortho-stage-circle {
  flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--secondary);
  background: transparent;
  color: var(--bg-0);
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}

.ortho-stage-row.done .ortho-stage-circle {
  background: var(--accent);
  border-color: var(--accent);
}

.ortho-stage-row.na .ortho-stage-circle {
  border: none;
  color: var(--secondary);
  font-size: 12px;
}

/* Calendar ortho-review day-dot — hollow accent ring, distinct from the
   solid clinic dots. Keeps .cal-dot's 5px footprint (border-box) so the
   month grid spacing is unchanged; only fill/border are overridden. */
.cal-dot.ortho-appt {
  background: transparent;
  border: 1.5px solid var(--accent);
}

/* Agenda row for an ortho review in the selected-day list. Mirrors the
   .shift-block look but reads as a reminder, not a paid shift: accent
   tint + left accent edge, a leading ring glyph, and a pointer/hover. */
.ortho-appt-row {
  display: flex; align-items: stretch; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--accent-glow);
  border: 0.5px solid var(--glass-edge);
  border-left: 3px solid var(--accent);
  cursor: pointer;
  transition: background .15s ease;
}

.ortho-appt-row:hover, .ortho-appt-row:active { background: rgba(63, 139, 149, 0.28); }

/* Leading ring glyph — echoes the hollow calendar dot. */
.ortho-appt-row::before {
  content: "";
  flex-shrink: 0; align-self: center;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
}

.ortho-appt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.ortho-appt-title {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--accent-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ortho-appt-name {
  font-size: 11px; color: var(--secondary);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Small muted caption under a tax table (e.g. "already included in totals
   above"). No prior .tax-note existed, so it is defined here. */
.tax-note {
  margin-top: var(--s-2);
  font-size: 11px;
  font-style: italic;
  color: var(--secondary);
}


