/* =====================================================
   DoctorAppointments.in — Design System (2026 Pastel)
   Elegant medical SaaS. Mobile-first. Compact + airy.
   Pastel palette · gentle gradients · hover lifts
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Pastel brand palette */
  --ink:           #1B2A41;     /* primary text */
  --ink-2:         #2A3E5A;
  --ink-3:         #495D78;
  --muted:         #6B7B92;
  --muted-2:       #9CABBE;

  --paper:         #FFFFFF;
  --cream:         #F7F9FC;     /* page bg */
  --cream-2:       #EEF3FA;     /* subtle tint */
  --line:          #E3E9F2;
  --line-2:        #CFD7E6;

  /* Pastel accents */
  --accent:        #5B8DEF;     /* soft blue primary */
  --accent-hover:  #4076DC;
  --accent-soft:   #E4EDFD;
  --accent-tint:   #F0F5FE;

  --mint:          #76CDB5;
  --mint-soft:     #E2F5EF;
  --lavender:      #A89BE0;
  --lavender-soft: #ECE8FA;
  --peach:         #F4A988;
  --peach-soft:    #FCEADF;
  --blush:         #ED88A8;
  --blush-soft:    #FBE3EC;
  --sky:           #7AC3DE;
  --sky-soft:      #DDF0F8;
  --sun:           #F4C460;
  --sun-soft:      #FCEFD3;

  --success:       #2FA37A;
  --success-soft:  #DDF3EA;
  --warning:       #D69A2D;
  --warning-soft:  #FBEFD2;
  --info:          #5B8DEF;
  --info-soft:     #E4EDFD;
  --danger:        #DB6A6A;
  --danger-soft:   #F8DEDE;

  /* Type */
  --f-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-serif:   'Fraunces', Georgia, 'Times New Roman', serif;
  --f-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;

  /* Shadows - layered, soft */
  --sh-1: 0 1px 2px rgba(27,42,65,.04), 0 2px 6px rgba(27,42,65,.05);
  --sh-2: 0 4px 12px rgba(27,42,65,.06), 0 10px 24px rgba(27,42,65,.06);
  --sh-3: 0 12px 32px rgba(27,42,65,.10), 0 24px 60px rgba(27,42,65,.10);
  --sh-glow: 0 0 0 4px rgba(91,141,239,.18);
  --sh-card: 0 6px 18px rgba(76,107,160,.07);

  /* Gradients */
  --g-hero:    linear-gradient(135deg, #E4EDFD 0%, #ECE8FA 45%, #FBE3EC 100%);
  --g-card-1:  linear-gradient(180deg, #FFFFFF 0%, #F7F9FC 100%);
  --g-mint:    linear-gradient(135deg, #E2F5EF 0%, #DDF0F8 100%);
  --g-blush:   linear-gradient(135deg, #FBE3EC 0%, #FCEADF 100%);
  --g-lav:     linear-gradient(135deg, #ECE8FA 0%, #E4EDFD 100%);
  --g-sun:     linear-gradient(135deg, #FCEFD3 0%, #FCEADF 100%);
  --g-cta:     linear-gradient(135deg, #5B8DEF 0%, #A89BE0 100%);
  --g-page:    linear-gradient(180deg, #F7F9FC 0%, #EEF3FA 100%);

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-1: 140ms;
  --t-2: 220ms;
  --t-3: 360ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--f-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration: none; transition: color var(--t-1) var(--ease); }
a:hover { color: var(--accent); }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(24px, 3.6vw, 36px); line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: clamp(20px, 2.4vw, 26px); }
h3 { font-size: clamp(16px, 1.8vw, 18px); }
h4 { font-size: 15px; }

.mono   { font-family: var(--f-mono); }
.micro  { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 28px; }
.p-0 { padding: 0 !important; }

/* =====================================================
   APP LAYOUT — Sidebar + main
   ===================================================== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--g-page);
}
.sidebar {
  background: linear-gradient(180deg, #1B2A41 0%, #243A5A 100%);
  color: #E8EDF6;
  padding: 22px 16px;
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: 18px 0 40px rgba(27,42,65,.06);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 6px; }

.sidebar .brand {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  color: #fff;
}
.sidebar .brand .dot { color: var(--mint); }

/* When .brand is rendered as <a> (clickable site title), keep it visually
   indistinguishable from the previous <div> rendering across all contexts. */
a.brand {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}
a.brand:hover { opacity: .85; }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sidebar .sub {
  font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; opacity: .6;
  margin-bottom: 22px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: #E8EDF6; opacity: .76;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--t-1) var(--ease), opacity var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.sidebar nav a:hover { opacity: 1; background: rgba(255,255,255,.06); transform: translateX(2px); }
.sidebar nav a .nav-bell { display: inline-block; margin-right: 6px; filter: grayscale(.3); }
.sidebar nav a .nav-badge {
  display: inline-block;
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}
.sidebar nav a.active {
  opacity: 1;
  background: rgba(91,141,239,.18);
  box-shadow: inset 3px 0 0 var(--mint);
  color: #fff;
}
.sidebar nav .logout-form { margin: 0; padding: 0; }
.sidebar nav .logout-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 10px;
  color: #E8EDF6; opacity: .76;
  font-size: 13.5px; font-weight: 500; font-family: inherit;
  background: transparent; border: 0; cursor: pointer;
  transition: background var(--t-1) var(--ease), opacity var(--t-1) var(--ease);
}
.sidebar nav .logout-btn:hover { opacity: 1; background: rgba(255,255,255,.06); }
.sidebar .group-label {
  font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; opacity: .42;
  margin: 18px 12px 6px;
  font-weight: 600;
}
.sidebar .userbox {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12.5px;
  opacity: .85;
}
.sidebar .userbox small {
  opacity: .6; display: block; margin-top: 2px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 1001;
  width: 44px; height: 44px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px; padding: 0;
  box-shadow: var(--sh-2);
  transition: transform var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}
.nav-toggle:hover { transform: scale(1.04); box-shadow: var(--sh-3); }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transform-origin: center;
  transition: transform var(--t-2) var(--ease), opacity var(--t-2) var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(27,42,65,.45);
  backdrop-filter: blur(2px);
  animation: fadein var(--t-2) var(--ease);
}
.sidebar-overlay.active { display: block; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.main {
  padding: 28px 36px 44px;
  max-width: 1280px;
  width: 100%;
  min-width: 0;
}
.dash-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted, #6b7280);
}
.dash-footer a { color: inherit; text-decoration: none; }
.dash-footer a:hover { color: var(--accent, #111); text-decoration: underline; }
@media (max-width: 520px) {
  .dash-footer { font-size: 11px; gap: 6px; }
}
.pageheader {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px;
  margin-bottom: 22px;
  padding: 18px 22px;
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  backdrop-filter: blur(8px);
}
.pageheader h1 { font-size: clamp(20px, 2.6vw, 28px); margin: 0; }
.pageheader .eyebrow {
  color: var(--accent); font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 700;
}
.pageheader .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--g-card-1);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--sh-card);
  transition: transform var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease), border-color var(--t-2) var(--ease);
}
.card:hover {
  box-shadow: var(--sh-2);
}
.card h3 { font-size: 16px; margin-bottom: 12px; font-weight: 700; }
.card + .card { margin-top: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-card);
  transition: transform var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease);
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(91,141,239,.04) 100%);
  pointer-events: none;
}
.stat:nth-child(2)::before { background: linear-gradient(135deg, transparent 0%, rgba(168,155,224,.05) 100%); }
.stat:nth-child(3)::before { background: linear-gradient(135deg, transparent 0%, rgba(244,169,136,.05) 100%); }
.stat:nth-child(4)::before { background: linear-gradient(135deg, transparent 0%, rgba(118,205,181,.05) 100%); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

/* Clickable stat tile — used on admin home so each KPI links to its page. */
a.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.stat-link:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
a.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.stat-link.accent { color: #fff; }
.stat .label {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; font-weight: 700;
  position: relative;
}
.stat .value {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 800; letter-spacing: -.03em; line-height: 1;
  position: relative;
}
.stat .delta { margin-top: 6px; font-size: 12px; color: var(--muted); position: relative; }
.stat .delta.up { color: var(--success); }
.stat .delta.down { color: var(--danger); }
.stat.accent {
  background: var(--g-cta);
  color: #fff; border-color: transparent;
}
.stat.accent::before { background: none; }
.stat.accent .label { color: rgba(255,255,255,.7); }
.stat.accent .value { color: #fff; }
.stat.accent .delta { color: rgba(255,255,255,.8); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink); color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: var(--f-body); font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--ink);
  cursor: pointer; text-decoration: none;
  transition: transform var(--t-1) var(--ease),
              background var(--t-1) var(--ease),
              box-shadow var(--t-1) var(--ease),
              border-color var(--t-1) var(--ease);
  white-space: nowrap;
  line-height: 1.3;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); transform: translateY(-1px); box-shadow: var(--sh-2); color: #fff; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--sh-glow); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--cream-2); border-color: var(--accent); color: var(--accent); }

.btn.accent {
  background: var(--g-cta); border-color: transparent; color: #fff;
  box-shadow: 0 6px 14px rgba(91,141,239,.25);
}
.btn.accent:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #9080D8 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(91,141,239,.35);
}

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.lg { padding: 12px 22px; font-size: 14.5px; }
.btn.full { width: 100%; }

/* Share Calendar button — pill shape, soft accent, used on public pages
   and the doctor dashboard. The accompanying toast (.share-toast) is
   shown when the Web Share API is unavailable and we fall back to copy. */
.btn.share {
  background: var(--accent-soft, rgba(91,141,239,.12));
  color: var(--accent);
  border-color: transparent;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(91,141,239,.10);
}
.btn.share:hover {
  background: var(--g-cta);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(91,141,239,.30);
}
.btn.share svg { flex: 0 0 auto; }
.btn.share.icon-only { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.btn.share.icon-only.sm { width: 30px; height: 30px; }

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  background: rgba(20,28,42,.94);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .28s ease, transform .28s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.share-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =====================================================
   TABLES
   ===================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--paper); }
table.t {
  width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px;
}
table.t th {
  text-align: left; font-weight: 700; font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  background: var(--cream-2);
}
table.t td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: var(--accent-tint); }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  background: var(--cream-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warn    { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.danger  { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info    { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* =====================================================
   FORMS
   ===================================================== */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 5px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  border-radius: 10px;
  font-family: var(--f-body); font-size: 14px; color: var(--ink);
  transition: border var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease), background var(--t-1) var(--ease);
  min-height: 40px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,141,239,.15);
  background: var(--paper);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 5px; }

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

input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  font-size: 13.5px;
  border-left: 3px solid;
  background: var(--paper);
  box-shadow: var(--sh-1);
}
.alert.success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.alert.error,
.alert.danger  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert.info    { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.alert.warn    { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }

/* =====================================================
   AUTH PAGES
   ===================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--cream);
}
.auth-panel {
  background:
    radial-gradient(720px 460px at 110% -10%, rgba(168,155,224,.30), transparent 60%),
    radial-gradient(560px 340px at -20% 110%, rgba(118,205,181,.22), transparent 55%),
    linear-gradient(135deg, #1B2A41 0%, #2F4566 100%);
  color: #fff;
  padding: 44px 40px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-panel .brand { font-family: var(--f-display); font-size: 26px; font-weight: 700; position: relative; }
.auth-panel .brand .dot { color: var(--mint); }
.auth-panel .quote {
  font-family: var(--f-serif); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4;
  font-weight: 400; font-style: italic; letter-spacing: -.01em;
  max-width: 460px; position: relative;
  color: #fff;
}
.auth-panel .quote::before {
  content: '"'; position: absolute; left: -22px; top: -16px;
  font-size: 64px; color: var(--mint); opacity: .55;
}
.auth-panel .foot {
  font-size: 11.5px; opacity: .55;
  letter-spacing: .1em; text-transform: uppercase; position: relative;
}
.auth-form {
  padding: 36px 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
}
.auth-form-inner {
  width: 100%; max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  box-shadow: var(--sh-2);
}
.auth-form h1 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.auth-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.auth-heading-row h1 { margin-bottom: 0; flex: 1; min-width: 0; }
.auth-switch-btn { flex: 0 0 auto; white-space: nowrap; margin-top: 4px; }
@media (max-width: 480px) {
  .auth-heading-row { flex-direction: column; align-items: stretch; }
  .auth-switch-btn { align-self: flex-start; }
}

/* ----- Wide signup layout (fits one screen on desktop) -----
   Drops the side brand panel and lets the form span ~960px so we can
   place fields in two columns and plans as horizontal cards. A small
   top header gives the brand a clickable home link in lieu of the
   panel. The narrow single-column flow still applies under 900px. */
.auth-wrap.signup-wide {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
}
.auth-wrap.signup-wide .auth-panel { display: none; }
.auth-wrap.signup-wide .auth-form { padding: 12px 24px 24px; flex: 1; }
/* Pair with .signup-wide when the form is a short single-column one (login)
   so the card doesn't stretch to the wide-form width. */
.auth-wrap.signup-wide.auth-narrow .auth-form-inner { max-width: 420px; padding: 28px 28px; }
.signup-top {
  padding: 14px 28px 0;
  display: flex;
  align-items: center;
}
.signup-top .brand {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
  transition: color var(--t-1) var(--ease);
}
.signup-top .brand:hover { color: var(--accent); }
.signup-top .brand .dot { color: var(--mint); }
@media (max-width: 900px) {
  .signup-top { padding: 10px 14px 0; }
  .signup-top .brand { font-size: 19px; }
}
.auth-wrap.signup-wide .auth-form-inner {
  max-width: 960px;
  padding: 22px 28px 24px;
}
.auth-wrap.signup-wide .auth-form-inner h1 { font-size: clamp(20px, 2vw, 26px); }
.auth-wrap.signup-wide .auth-form-inner .sub { margin-bottom: 12px; font-size: 13.5px; }
.auth-wrap.signup-wide .auth-form-inner .micro { margin-bottom: 2px; }
.auth-wrap.signup-wide .field { margin-bottom: 10px; }
.auth-wrap.signup-wide .field-row,
.auth-wrap.signup-wide .field-row-3 { gap: 10px; }
.auth-wrap.signup-wide .field label {
  font-size: 12.5px;
}
.auth-wrap.signup-wide .field input,
.auth-wrap.signup-wide .field select {
  padding: 8px 10px;
  font-size: 14px;
}
.auth-wrap.signup-wide .field .hint { margin-top: 3px; font-size: 11.5px; }
.auth-wrap.signup-wide .divider { margin: 10px 0; }
.auth-wrap.signup-wide .url-preview { padding: 5px 9px; font-size: 12px; margin-top: 4px; }
.auth-wrap.signup-wide .slug-msg { font-size: 11.5px; min-height: 14px; }

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  align-items: start;
}
.form-section-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin: 0 0 6px;
}
.form-plans-block { margin-top: 6px; }

.billing-note {
  background: var(--mint-soft);
  border: 1px solid var(--mint);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 6px 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}
.billing-note strong { color: var(--ink); }

/* Compact horizontal plan picker for the wide layout */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.plan-grid .plan-option {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin: 0;
}
.plan-grid .plan-option .plan-option-body { flex: 1; min-width: 0; font-size: 12.5px; }
.plan-grid .plan-option .plan-option-body strong { font-size: 13.5px; }
.plan-grid .plan-option .plan-option-body .muted.small { font-size: 11.5px; line-height: 1.35; }
.plan-grid .plan-option .price { font-size: 16px; white-space: nowrap; }
.plan-grid .plan-option .price .price-suffix { font-size: 11px; }

@media (max-width: 900px) {
  .form-grid-2col { grid-template-columns: 1fr; }
  .auth-wrap.signup-wide .auth-form { padding: 16px 12px; }
  .auth-wrap.signup-wide .auth-form-inner { padding: 20px 18px; }
}

/* =====================================================
   CALENDAR (admin views)
   ===================================================== */
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  margin: 16px 0;
}
.cal-day {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px; min-height: 100px;
  font-size: 12px;
}
.cal-day .dow { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.cal-day .date { font-family: var(--f-display); font-size: 20px; margin: 2px 0 6px; font-weight: 700; }
.cal-day .slot { display: block; font-size: 11px; padding: 3px 6px; background: var(--accent-soft); border-radius: 4px; margin-bottom: 3px; color: var(--accent); }
.cal-day .slot.taken { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }

/* Day-of-week availability editor */
.dow-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  align-items: center; padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.dow-row:last-child { border-bottom: 0; }
.dow-row label.day { font-weight: 500; display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* Misc helpers */
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.sp { flex: 1; }
.row-split { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 8px; } .gap-2 { gap: 14px; } .gap-3 { gap: 22px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

code.inline {
  background: var(--accent-tint);
  padding: 2px 7px; border-radius: 5px;
  font-family: var(--f-mono); font-size: 12px;
  color: var(--accent);
}

pre.codeblock {
  background: linear-gradient(135deg, #1B2A41 0%, #243A5A 100%);
  color: #E8EDF6;
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: var(--f-mono); font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0;
}

/* =====================================================
   MARKETING / LANDING
   ===================================================== */
.landing {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(16px, 3vw, 32px) clamp(40px, 6vw, 60px);
}

body.marketing-page {
  background:
    radial-gradient(900px 500px at 90% -5%, rgba(168,155,224,.18), transparent 60%),
    radial-gradient(700px 400px at -5% 30%, rgba(118,205,181,.14), transparent 55%),
    radial-gradient(700px 400px at 100% 100%, rgba(244,169,136,.12), transparent 55%),
    var(--cream);
}

.landing nav {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-bottom: clamp(24px, 4vw, 40px);
  padding: 12px 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: sticky;
  top: 12px;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--sh-card);
}
.landing nav .brand {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}
.landing nav .brand .dot { color: var(--accent); }
.landing nav .links {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 13.5px;
}
.landing nav .links a {
  color: var(--ink-3);
  font-weight: 500;
  transition: color var(--t-1) var(--ease);
}
.landing nav .links a:hover { color: var(--accent); }
.landing nav .links .btn { font-weight: 600; }

.landing .hero {
  text-align: left;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 40px) clamp(28px, 5vw, 48px);
  background:
    radial-gradient(620px 360px at 95% 10%, rgba(168,155,224,.30), transparent 60%),
    radial-gradient(420px 280px at 5% 90%, rgba(118,205,181,.22), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(248,250,253,.5));
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-card);
  margin-bottom: clamp(28px, 5vw, 44px);
  position: relative;
  overflow: hidden;
}
.landing .hero h1 {
  font-size: clamp(28px, 5.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -.03em;
  max-width: 920px;
  font-weight: 800;
  color: var(--ink);
}
.landing .hero h1 em {
  font-style: normal;
  background: var(--g-cta);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing .hero .lede {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--ink-3);
  max-width: 640px;
  margin: 16px 0 24px;
  line-height: 1.6;
}
.landing .hero .cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: clamp(20px, 4vw, 36px);
}
.feat {
  padding: 22px 22px;
  background: var(--g-card-1);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  transition: transform var(--t-2) var(--ease), border-color var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease);
  position: relative;
  overflow: hidden;
}
.feat::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(91,141,239,.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--t-2) var(--ease);
  pointer-events: none;
}
.feat:nth-child(2)::before { background: linear-gradient(135deg, rgba(168,155,224,.06) 0%, transparent 50%); }
.feat:nth-child(3)::before { background: linear-gradient(135deg, rgba(118,205,181,.06) 0%, transparent 50%); }
.feat:nth-child(4)::before { background: linear-gradient(135deg, rgba(244,169,136,.06) 0%, transparent 50%); }
.feat:nth-child(5)::before { background: linear-gradient(135deg, rgba(237,136,168,.06) 0%, transparent 50%); }
.feat:nth-child(6)::before { background: linear-gradient(135deg, rgba(122,195,222,.06) 0%, transparent 50%); }

.feat:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--sh-2);
}
.feat:hover::before { opacity: 1; }

.feat .num {
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: #fff;
  background: var(--g-cta);
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 12px;
  position: relative;
}
.feat:nth-child(2) .num { background: linear-gradient(135deg, var(--lavender), var(--accent)); }
.feat:nth-child(3) .num { background: linear-gradient(135deg, var(--mint), var(--sky)); }
.feat:nth-child(4) .num { background: linear-gradient(135deg, var(--peach), var(--blush)); }
.feat:nth-child(5) .num { background: linear-gradient(135deg, var(--blush), var(--lavender)); }
.feat:nth-child(6) .num { background: linear-gradient(135deg, var(--sky), var(--mint)); }

.feat h3 {
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: 700;
  position: relative;
}
.feat p {
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
  position: relative;
}

.section-head {
  margin: clamp(32px, 5vw, 56px) 0 18px;
  padding-bottom: 12px;
}
.section-head .eyebrow {
  display: inline-block;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 8px;
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
}
.section-head h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -.025em; }

.cta-block {
  margin-top: clamp(32px, 5vw, 56px);
  padding: clamp(28px, 5vw, 44px);
  background:
    radial-gradient(500px 280px at 100% 0%, rgba(168,155,224,.55), transparent 60%),
    radial-gradient(400px 240px at 0% 100%, rgba(118,205,181,.4), transparent 60%),
    linear-gradient(135deg, #5B8DEF 0%, #7C70D4 100%);
  color: #fff;
  border-radius: var(--r-2xl);
  position: relative; overflow: hidden;
  box-shadow: 0 20px 50px rgba(91,141,239,.25);
}
.cta-block h2 { color: #fff; font-size: clamp(22px, 3.4vw, 36px); position: relative; font-weight: 800; }
.cta-block p { color: rgba(255,255,255,.85); position: relative; max-width: 540px; margin: 10px 0 20px; font-size: 14.5px; }
.cta-block .btn { background: #fff; color: var(--accent); border-color: transparent; position: relative; font-weight: 700; }
.cta-block .btn:hover { background: var(--accent-tint); color: var(--accent-hover); border-color: transparent; }
.cta-block .btn.secondary { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.32); backdrop-filter: blur(6px); }
.cta-block .btn.secondary:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.5); color: #fff; }
.cta-block .btn + .btn { margin-left: 8px; }

.landing footer {
  margin-top: clamp(36px, 6vw, 56px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* =====================================================
   PUBLIC CLINIC / DOCTOR PAGES
   ===================================================== */
body.public-page {
  background:
    radial-gradient(700px 380px at 100% 0%, var(--public-hero-glow, rgba(168,155,224,.25)), transparent 55%),
    radial-gradient(520px 280px at 0% 0%, rgba(118,205,181,.18), transparent 48%),
    radial-gradient(600px 320px at 50% 100%, rgba(244,169,136,.12), transparent 55%),
    var(--cream);
  color: var(--ink);
}
body.public-theme-simple   { --public-frame-radius: 22px; }
body.public-theme-elegant  { --public-frame-radius: 28px; --public-card-lift: translateY(-3px); }
body.public-theme-classic  { --public-frame-radius: 18px; }
body.public-theme-funky    { --public-frame-radius: 28px; --public-card-lift: translateY(-4px) rotate(-1deg); }
body.public-theme-modern   { --public-frame-radius: 24px; --public-card-lift: translateY(-3px); }

.public-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) clamp(14px, 3vw, 24px) 64px;
}
.public-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px clamp(14px, 3vw, 24px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.55);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.public-topbar .brand { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.public-topbar .brand .dot { color: var(--accent); }
.public-topbar .site-brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  min-width: 0;
}
.public-topbar .site-logo {
  width: 40px; height: 40px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--cream-2);
}
.public-topbar .site-logo-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--lavender-soft));
  color: var(--accent);
  font-family: var(--f-display); font-size: 20px; font-weight: 700;
}
.public-topbar .site-title {
  font-family: var(--f-display);
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.public-theme-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 12px;
}
.public-section-head { margin-bottom: 16px; }
.public-section-head.compact { margin-bottom: 0; }
.public-section-head h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 800; }

.clinic-hero,
.doctor-hero {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr;
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  margin-bottom: 26px;
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(168,155,224,.20), transparent 60%),
    linear-gradient(135deg, #ffffff 0%, #F7F9FC 100%);
  border: 1px solid var(--line);
  border-radius: var(--public-frame-radius, 22px);
  box-shadow: var(--sh-card);
}
/* Shared sizing for the clinic hero image / initial-letter fallback. */
.clinic-hero-img {
  width: min(100%, 150px); aspect-ratio: 1;
  border-radius: calc(var(--public-frame-radius, 22px) - 4px);
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line);
}
/* Fallback-only: gradient bg + centered initial letter. Targets the <div>
   variant explicitly so the <img> isn't affected by `display: flex` or the
   gradient background (which would hide the actual uploaded photo). */
div.clinic-hero-img {
  background: linear-gradient(135deg, var(--lavender-soft), var(--accent-soft));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: clamp(38px, 4.5vw, 48px);
  font-weight: 700; color: var(--accent);
}
img.clinic-hero-img { display: block; background: transparent; }
.clinic-hero-info h1 { font-size: clamp(26px, 3.8vw, 38px); margin-bottom: 8px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.clinic-hero-info .clinic-city {
  color: var(--muted); font-size: 14px; margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 5px;
}
.clinic-hero-info .clinic-desc { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; max-width: 680px; }

.doctor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.doctor-card {
  background: var(--g-card-1);
  border: 1px solid var(--line);
  border-radius: calc(var(--public-frame-radius, 22px) - 6px);
  padding: 22px 18px; text-align: center;
  transition: box-shadow var(--t-2) var(--ease), transform var(--t-2) var(--ease), border-color var(--t-2) var(--ease);
  box-shadow: var(--sh-card);
  position: relative;
  overflow: hidden;
}
.doctor-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(91,141,239,.04) 100%);
  opacity: 0;
  transition: opacity var(--t-2) var(--ease);
  pointer-events: none;
}
.doctor-card:hover {
  box-shadow: var(--sh-2);
  transform: var(--public-card-lift, translateY(-3px));
  border-color: var(--accent);
}
.doctor-card:hover::before { opacity: 1; }

.doctor-card-avatar {
  width: 78px; height: 78px;
  border-radius: 14px;
  margin: 0 auto 12px;
  object-fit: cover;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(91,141,239,.12);
  position: relative;
}
div.doctor-card-avatar {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--lavender-soft));
  color: var(--accent);
  font-family: var(--f-display); font-size: 28px; font-weight: 700;
}
img.doctor-card-avatar { display: block; background: transparent; }
.doctor-card h3 { font-size: 16px; margin-bottom: 3px; font-weight: 700; position: relative; }
.doctor-card .spec { font-size: 13px; color: var(--accent); margin-bottom: 4px; font-weight: 600; position: relative; }
.doctor-card .qual { font-size: 12px; color: var(--muted); position: relative; }
.doctor-card .book-btn {
  display: inline-block; margin-top: 12px;
  background: var(--g-cta);
  color: #fff;
  padding: 8px 18px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  box-shadow: 0 6px 14px rgba(91,141,239,.22);
  position: relative;
  transition: transform var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}
.doctor-card:hover .book-btn {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(91,141,239,.30);
}

/* Shared sizing for the doctor hero image / initial-letter fallback. */
.doctor-hero-img {
  width: min(100%, 160px); aspect-ratio: 1;
  border-radius: calc(var(--public-frame-radius, 22px) - 4px);
  flex-shrink: 0;
  object-fit: cover;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 8px 22px rgba(91,141,239,.15);
}
div.doctor-hero-img {
  background: linear-gradient(135deg, var(--accent-soft), var(--lavender-soft));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: clamp(40px, 4.5vw, 52px);
  font-weight: 700; color: var(--accent);
}
img.doctor-hero-img { display: block; background: transparent; }
.doctor-hero-info h1 { font-size: clamp(24px, 3.6vw, 36px); margin-bottom: 6px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.doctor-hero-info .spec-tag {
  display: inline-block;
  font-size: 12.5px; color: var(--accent); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 6px;
}
.doctor-hero-info .qual-tag { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.doctor-hero-info .clinic-link { font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.doctor-hero-info .clinic-link a { color: var(--accent); font-weight: 600; }
.doctor-bio-section { margin-bottom: 28px; min-width: 0; }
.doctor-bio-section h2 {
  font-size: 22px; margin-bottom: 12px;
  font-weight: 700; letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.doctor-bio-section p { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); overflow-wrap: anywhere; }

.expertise-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.expertise-tag {
  background: var(--lavender-soft);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .005em;
  transition: background var(--t-1) var(--ease), color var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.expertise-tag:hover { background: var(--accent-soft); color: var(--accent); transform: translateY(-1px); }
.fee-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--mint-soft); color: var(--success);
  border-radius: 999px; padding: 7px 16px;
  font-size: 13.5px; font-weight: 700; margin-top: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

/* Staff login icon */
.staff-login-icon {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.95); color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--sh-2);
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color var(--t-1) var(--ease), transform var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}
.staff-login-icon:hover {
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--sh-3);
}
.staff-login-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hero strip (doctor page): small slider on one side, the doctor's name and
   specialty inline on the other. The full doctor-details card sits below. */
.hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 2.6vw, 32px);
  align-items: center;
  margin-bottom: clamp(20px, 2.5vw, 28px);
}
.hero-strip > .hero-slider {
  aspect-ratio: 4 / 3;
  min-height: 0;
  max-height: 360px;
}
.hero-strip-text { min-width: 0; }
.hero-strip-text h1 {
  font-size: clamp(26px, 4.2vw, 44px);
  font-weight: 800;
  letter-spacing: -.028em;
  line-height: 1.08;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.hero-strip-text .spec-tag {
  display: inline-block;
  font-size: 13px; color: var(--accent); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.hero-strip-text .clinic-city {
  color: var(--muted); font-size: 14.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
@media (max-width: 880px) {
  .hero-strip { grid-template-columns: 1fr; gap: 16px; }
  .hero-strip > .hero-slider { aspect-ratio: 16 / 9; max-height: 320px; }
  .hero-strip-text { text-align: center; }
  .hero-strip-text .clinic-city { justify-content: center; }
}
@media (max-width: 720px) {
  .hero-strip > .hero-slider { aspect-ratio: 4 / 3; max-height: none; }
  .hero-strip-text h1 { font-size: clamp(22px, 7vw, 28px); }
}

/* Hero band: legacy 2-col band still used by the clinic public page. */
.hero-band { margin-bottom: clamp(22px, 3vw, 32px); }
.hero-band > .doctor-hero,
.hero-band > .clinic-hero { margin-bottom: 0; }
.hero-band.has-slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(16px, 2.2vw, 24px);
  align-items: stretch;
}
.hero-band.has-slider > .doctor-hero,
.hero-band.has-slider > .clinic-hero { height: 100%; }

/* Doctor / clinic public page: hero image slider */
.hero-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--public-frame-radius, 22px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), var(--lavender-soft));
  box-shadow: var(--sh-card);
}
.hero-band.has-slider > .hero-slider { aspect-ratio: auto; min-height: 300px; }
.hero-slider-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 600ms cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.hero-slide {
  flex: 0 0 100%;
  height: 100%;
  min-width: 0;
}
.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.14);
  transition: background var(--t-1) var(--ease), transform var(--t-1) var(--ease);
  z-index: 2;
}
.hero-slider-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.hero-slider-prev { left: 14px; }
.hero-slider-next { right: 14px; }
.hero-slider-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,.28);
  border-radius: 999px;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-slider-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: 0; padding: 0;
  cursor: pointer;
  transition: background var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.hero-slider-dot:hover { background: rgba(255,255,255,.85); }
.hero-slider-dot.active { background: #fff; transform: scale(1.25); }
.hero-slider.single .hero-slider-arrow,
.hero-slider.single .hero-slider-dots { display: none; }
@media (max-width: 720px) {
  .hero-slider { aspect-ratio: 4 / 3; }
  .hero-slider-arrow { width: 32px; height: 32px; }
  .hero-slider-prev { left: 8px; }
  .hero-slider-next { right: 8px; }
}

/* Clinic gallery + Google maps embed */
.clinic-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin: 20px 0 28px;
}
.clinic-gallery img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: var(--public-frame-radius, 22px);
  border: 1px solid var(--line);
  background: var(--cream-2);
  transition: transform var(--t-2) var(--ease);
}
.clinic-gallery img:hover { transform: scale(1.01); }
.clinic-map-wrap {
  margin: 20px 0 28px;
  border-radius: var(--public-frame-radius, 22px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream-2);
  box-shadow: var(--sh-card);
}
.clinic-map-wrap iframe { display: block; width: 100%; height: 320px; border: 0; }
.clinic-map-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700; margin-top: 8px;
  transition: background var(--t-1) var(--ease);
}
.clinic-map-link:hover { background: var(--accent); color: #fff; }

/* Doctor edit: location blocks */
.location-block {
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--cream-2);
}
.location-block .dow-row { padding: 4px 0; }

/* Doctor multi-location list */
.doctor-locations { display: grid; gap: 14px; margin: 16px 0 28px; min-width: 0; }
.doctor-location {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  background: var(--g-card-1);
  transition: border-color var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease), transform var(--t-1) var(--ease);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.doctor-location:hover { border-color: var(--accent); box-shadow: var(--sh-card); transform: translateY(-1px); }
.doctor-location h4 { font-size: 15.5px; margin: 0 0 5px; font-family: var(--f-display); font-weight: 700; }
.doctor-location .loc-addr { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; line-height: 1.5; }
.doctor-location .loc-hours { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.doctor-location .loc-hours span {
  display: inline-block; margin-right: 8px; margin-bottom: 4px;
  padding: 2px 8px; background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; font-weight: 600; font-size: 12px;
  max-width: 100%;
}

/* Public theme tweaks */
body.public-theme-elegant .public-topbar,
body.public-theme-elegant .clinic-hero,
body.public-theme-elegant .doctor-hero,
body.public-theme-elegant .doctor-card { box-shadow: 0 14px 36px rgba(34,26,18,.07); }
body.public-theme-elegant .doctor-card .book-btn { border-radius: 12px; }
body.public-theme-classic .public-topbar { box-shadow: var(--sh-card); }
body.public-theme-classic .doctor-card,
body.public-theme-classic .clinic-hero,
body.public-theme-classic .doctor-hero { background: linear-gradient(180deg, #FFFFFF, #F7FAFC); }
body.public-theme-funky .clinic-hero,
body.public-theme-funky .doctor-hero {
  background:
    radial-gradient(260px 130px at 100% 0%, rgba(168,155,224,.30), transparent 60%),
    radial-gradient(220px 110px at 0% 100%, rgba(118,205,181,.25), transparent 60%),
    linear-gradient(135deg, #fff 0%, #F7F9FC 60%);
}
body.public-theme-funky .doctor-card:nth-child(2n) { transform: rotate(.6deg); }
body.public-theme-funky .doctor-card:hover { transform: translateY(-5px) rotate(-.5deg); }
body.public-theme-modern .clinic-hero,
body.public-theme-modern .doctor-hero {
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86)),
    var(--g-hero);
  backdrop-filter: blur(14px);
}

/* Embed code block */
.embed-code-wrap { position: relative; margin-top: 6px; }
.embed-code-wrap pre {
  background: linear-gradient(135deg, #1B2A41 0%, #243A5A 100%);
  color: #E8EDF6;
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-family: var(--f-mono); font-size: 11.5px;
  overflow-x: auto; white-space: pre; margin: 0;
  line-height: 1.55;
  border: 1px solid rgba(255,255,255,.05);
}
.embed-code-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.22); border-radius: var(--r-sm);
  padding: 4px 10px; font-size: 11px; cursor: pointer; font-weight: 600;
  font-family: var(--f-body); transition: background var(--t-1) var(--ease);
}
.embed-code-copy:hover { background: rgba(255,255,255,.22); }
.embed-code-copy.copied { background: var(--success); color: #fff; border-color: var(--success); }

.palette-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.palette-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12.5px; color: var(--ink-2);
  transition: border-color var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.palette-chip:hover { transform: translateY(-1px); }
.palette-chip.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91,141,239,.16); }
.palette-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

/* Embed page (standalone iframe target) */
.embed-page { padding: clamp(8px, 2vw, 16px); background: transparent; min-height: 100vh; }

/* Landing nav mobile toggle */
.landing-nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--line-2); border-radius: 10px;
  width: 42px; height: 42px;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; padding: 0;
  transition: background var(--t-1) var(--ease), border-color var(--t-1) var(--ease);
}
.landing-nav-toggle:hover { background: var(--cream-2); border-color: var(--ink-3, var(--ink)); }
.landing-nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.landing-nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transform-origin: center;
  transition: transform .2s ease, opacity .2s ease;
}
.landing-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.landing-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.landing-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Plan option (signup) */
.plan-option {
  cursor: pointer; padding: 14px; border: 1px solid var(--line-2);
  border-radius: var(--r-md); margin-bottom: 10px;
  display: flex; gap: 12px; align-items: center;
  background: var(--paper);
  transition: border-color var(--t-1) var(--ease), background var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.plan-option:hover { border-color: var(--accent); background: var(--accent-tint); }
.plan-option input { margin: 0; }
.plan-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(91,141,239,.12); }
.plan-option .price { font-family: var(--f-display); font-size: 20px; font-weight: 700; color: var(--ink); }

/* URL preview */
.url-preview {
  background: var(--accent-tint);
  border: 1px dashed var(--accent);
  padding: 8px 12px; border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: 12.5px;
  margin-top: 6px; color: var(--accent);
}
.url-preview .slug-hi {
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Slug input with realtime availability indicator */
.slug-input-wrap { position: relative; }
.slug-input-wrap input { padding-right: 38px; }
.slug-status {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  pointer-events: none;
}
.slug-status.show { display: inline-flex; }
.slug-status.checking { background: var(--line-2); color: var(--muted); animation: slug-pulse 1s ease-in-out infinite; }
.slug-status.ok       { background: var(--success); color: #fff; }
.slug-status.bad      { background: var(--danger);  color: #fff; box-shadow: 0 0 0 3px rgba(219,106,106,.18); }
@keyframes slug-pulse { 50% { opacity: 0.4; } }

.slug-input-wrap input.slug-ok  { border-color: var(--success); box-shadow: 0 0 0 2px rgba(47,163,122,.15); }
.slug-input-wrap input.slug-bad { border-color: var(--danger);  box-shadow: 0 0 0 2px rgba(219,106,106,.15); }

.slug-msg {
  margin-top: 4px;
  font-size: 12px;
  min-height: 16px;
}
.slug-msg.ok  { color: var(--success); }
.slug-msg.bad { color: var(--danger); }
.slug-msg.muted { color: var(--muted); }

/* Tenant control grid (admin) */
.tenant-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tenant-control-grid input,
.tenant-control-grid select {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  border-radius: 8px;
  min-height: 36px;
}
.tenant-control-grid .btn { grid-column: 1 / -1; }

/* Long text in tables */
table.t td a, table.t td code.inline { word-break: break-word; }
.btn { white-space: normal; }

/* Admin tenant control cell — wide form on desktop, stacks on phone via .t-stack */
table.t td.admin-control-cell { min-width: 280px; }
@media (max-width: 720px) {
  table.t.t-stack td.admin-control-cell { min-width: 0; }
}

/* Field images */
.field img, .card img { max-width: 100%; height: auto; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
/* Tablet & under: collapse sidebar to drawer */
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 1000;
    width: 280px; height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--t-3) var(--ease);
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--sh-3); }
  .main { padding: 22px 18px 40px; margin-top: 60px; max-width: 100%; }
  .pageheader { padding: 16px 18px; gap: 12px; align-items: flex-start; }
  .pageheader .actions, .pageheader > div + div { flex-wrap: wrap; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .row-split { flex-wrap: wrap; gap: 8px; }
  .doctor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-band.has-slider { grid-template-columns: 1fr; gap: 18px; }
  .hero-band.has-slider > .hero-slider { min-height: 0; aspect-ratio: 16 / 9; }
  .clinic-hero, .doctor-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .clinic-hero-img, .doctor-hero-img { margin: 0 auto; }
  .clinic-hero-info, .doctor-hero-info { max-width: 760px; }
  .clinic-hero-info .clinic-desc { margin: 0 auto; }
  .clinic-hero-info .clinic-city { justify-content: center; }
  .expertise-tags { justify-content: center; }
  /* Long select option labels (themes/palettes) — let them
     scale down so the closed select doesn't overflow. */
  .field select { font-size: 13.5px; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-form { padding: 24px 16px; }
}

/* Phone (large): tighten further */
@media (max-width: 720px) {
  .main { padding: 16px 14px 36px; margin-top: 56px; }
  .pageheader { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .pageheader .actions { width: 100%; }
  .pageheader > div + div { width: 100%; }
  .pageheader .btn { flex: 1 1 auto; min-width: 0; }
  .public-topbar { gap: 8px; }
  .doctor-grid { grid-template-columns: 1fr; }
  .embed-code-wrap pre { white-space: pre-wrap; word-break: break-all; font-size: 11px; padding: 10px 12px 32px; }
  .embed-code-copy { position: absolute; top: auto; bottom: 6px; right: 6px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: 1fr; gap: 12px; }
  .feat { padding: 18px 18px; }
  .card { padding: 16px 16px; }
  .public-wrap > main.grid-2 { grid-template-columns: 1fr !important; gap: 20px !important; }
  .clinic-gallery { grid-template-columns: 1fr; }
  .clinic-map-wrap iframe { height: 240px; }
  .hero-band.has-slider > .hero-slider { aspect-ratio: 4 / 3; }
  .cta-block { padding: 24px 20px; }
  .cta-block .btn + .btn { margin-left: 0; margin-top: 8px; }
  .landing-nav-toggle { display: inline-flex; }
  .landing nav { gap: 8px; align-items: center; padding: 10px 14px; flex-wrap: wrap; }
  .landing nav .brand { flex: 1 1 auto; }
  .landing nav .links {
    width: 100%; order: 3;
    display: none; flex-direction: column; align-items: stretch;
    overflow: visible; padding: 6px 0 2px;
    gap: 4px;
  }
  .landing nav .links.is-open { display: flex; }
  .landing nav .links a, .landing nav .links .btn {
    width: 100%; text-align: center; padding: 10px 14px;
    border-radius: 10px;
  }
  .landing nav .links a:not(.btn) {
    background: var(--cream-2);
    color: var(--ink-2);
  }
  .landing .hero { padding: 22px 20px 26px; }
  .tenant-control-grid { grid-template-columns: 1fr; }
}

/* Small phones (6-7 inch, ~360-414px) */
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .nav-toggle { top: 10px; left: 10px; width: 40px; height: 40px; }
  .nav-toggle span { width: 20px; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .landing-nav-toggle { width: 40px; height: 40px; }
  .landing-nav-toggle span { width: 20px; }
  .main { padding: 14px 12px 32px; margin-top: 52px; }
  .pageheader { margin-bottom: 18px; padding: 12px 14px; border-radius: var(--r-lg); }
  .pageheader h1 { font-size: 22px; }
  .btn { font-size: 13px; padding: 9px 14px; }
  .btn.sm { font-size: 12px; padding: 6px 11px; }
  .card { padding: 14px 14px; border-radius: var(--r-lg); }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px 14px; }
  .stat .value { font-size: 22px; }
  .feat-grid { grid-template-columns: 1fr; }
  .auth-form { padding: 16px 12px; }
  .auth-form-inner { max-width: 100%; padding: 24px 18px; box-shadow: var(--sh-1); }
  .public-wrap { padding: 14px 12px 48px; }
  .clinic-hero, .doctor-hero { padding: 16px 14px; gap: 14px; }
  .public-section-head h2 { font-size: 20px; }
  .doctor-card { padding: 16px 14px; }
  .palette-swatches { gap: 6px; }
  .palette-chip { font-size: 12px; padding: 5px 10px; }
  table.t { font-size: 12.5px; min-width: 460px; }
  table.t th, table.t td { padding: 9px 11px; }
  .landing { padding: 14px 12px 48px; }
  .landing nav { top: 8px; padding: 8px 12px; border-radius: 12px; }
  .landing .hero {
    padding: 20px 16px 22px;
    border-radius: var(--r-xl);
  }
  .landing .hero h1 { font-size: clamp(24px, 7vw, 32px); line-height: 1.12; }
  .landing .hero .lede { font-size: 14px; margin: 12px 0 18px; }
  .landing .hero .cta-row .btn { flex: 1 1 auto; min-width: 0; }
  .section-head { margin: 24px 0 12px; }
  .section-head h2 { font-size: 22px; }
  .cta-block { padding: 22px 18px; border-radius: var(--r-xl); }
  .cta-block h2 { font-size: 22px; }
  .feat { padding: 16px; }
  .feat h3 { font-size: 16px; }
  .feat p { font-size: 13px; }
  .doctor-hero-info h1, .clinic-hero-info h1 { font-size: 22px; }
  .clinic-hero-img, .doctor-hero-img { width: 110px; font-size: 32px; }
  .dow-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "day day"
      "start end";
    row-gap: 6px;
  }
  .dow-row label.day { grid-area: day; }
  .dow-row > input[type="time"]:nth-of-type(1) { grid-area: start; }
  .dow-row > input[type="time"]:nth-of-type(2) { grid-area: end; }
  .field input[type="time"] { width: 100%; min-width: 0; }
  .field { margin-bottom: 12px; }
}

/* Very small (≤420px) */
@media (max-width: 420px) {
  .grid-4 { grid-template-columns: 1fr; }
  .stat .value { font-size: 20px; }
  .card { padding: 12px 12px; }
  .main { padding: 12px 10px 28px; }
  .pageheader { padding: 12px 12px; }
  .landing { padding: 10px 10px 40px; }
  .landing nav .brand { font-size: 16px; }
}

/* Sidebar widths on smaller mobile */
@media (max-width: 380px) {
  .sidebar { width: 86vw; }
}

/* Calendar grid - smaller squares on phones */
@media (max-width: 520px) {
  .cal-grid, .cal-grid-head { gap: 3px; }
  .cal-cell { min-height: 46px; }
  .cal-grid-head > div { font-size: 9px; padding: 2px; letter-spacing: .04em; }
  .cal-cell-btn { padding: 5px 4px; }
  .cal-num { font-size: 13px; }
  .cal-tag, .cal-tag-faint { font-size: 9px; padding: 1px 4px; }
  .cal-legend { gap: 8px; font-size: 10.5px; }
}

/* Plan option wrap on small */
.plan-option { flex-wrap: wrap; }
.plan-option > div:first-of-type { min-width: 0; flex: 1 1 220px; }
@media (max-width: 480px) {
  .plan-option { gap: 10px; padding: 12px; }
  .plan-option .price { font-size: 18px; width: 100%; text-align: right; }
}

/* Card table overflow */
.card > table.t { min-width: 100%; }
@media (max-width: 720px) {
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card > table.t { display: table; min-width: 520px; }
  .table-wrap { border-radius: var(--r-md); }
}

/* Iframes fluid */
.main iframe { max-width: 100%; }

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

/* =====================================================
   MARKETING SITE THEMES
   ===================================================== */
body.marketing-page .landing nav .brand .dot,
body.marketing-page .landing .hero h1 em {
  color: var(--accent);
}
body.marketing-page .landing .hero h1 em {
  background: linear-gradient(135deg, var(--accent), var(--lavender));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.marketing-page .landing .hero h1 { color: var(--ink); }
body.marketing-page .feat:hover { border-color: var(--accent); }
body.marketing-page .btn.accent,
body.marketing-page .cta-block .btn.accent {
  background: var(--g-cta); border-color: transparent; color: #fff;
}
body.marketing-page .btn.accent:hover,
body.marketing-page .cta-block .btn.accent:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #9080D8 100%);
  border-color: transparent; color: #fff;
}

/* Theme: bold */
body.marketing-theme-bold .landing .hero {
  padding: clamp(36px, 6vw, 60px) clamp(20px, 4vw, 36px);
  background:
    radial-gradient(700px 380px at 95% 8%, var(--marketing-hero-glow, rgba(168,155,224,.30)), transparent 60%),
    radial-gradient(420px 280px at 5% 90%, rgba(118,205,181,.22), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.4), transparent 70%);
  border-radius: var(--r-2xl);
}
body.marketing-theme-bold .landing .hero h1 {
  font-size: clamp(32px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -.035em;
}
body.marketing-theme-bold .feat {
  background: linear-gradient(180deg, #fff, var(--marketing-tint, #F4F8FF));
}
body.marketing-theme-bold .cta-block {
  background:
    radial-gradient(500px 280px at 100% 0%, rgba(168,155,224,.55), transparent 60%),
    linear-gradient(135deg, var(--accent) 0%, var(--marketing-gradient-b, var(--lavender)) 100%);
}

/* Theme: elegant */
body.marketing-theme-elegant { background: var(--marketing-bg, #FAF8F5); }
body.marketing-theme-elegant .landing .hero h1,
body.marketing-theme-elegant .feat h3,
body.marketing-theme-elegant .section-head h2,
body.marketing-theme-elegant .cta-block h2 {
  font-family: var(--f-serif);
  font-weight: 500;
}
body.marketing-theme-elegant .landing .hero h1 em { font-style: italic; font-weight: 500; }
body.marketing-theme-elegant .feat { border-radius: 22px; box-shadow: 0 18px 45px rgba(34,26,18,.06); }
body.marketing-theme-elegant .cta-block { border-radius: 28px; }

/* Theme: minimal */
body.marketing-theme-minimal { background: #FFFFFF; }
body.marketing-theme-minimal .landing nav,
body.marketing-theme-minimal .feat,
body.marketing-theme-minimal .card {
  border-radius: 8px;
  box-shadow: none;
  border-color: var(--line-2);
}
body.marketing-theme-minimal .landing .hero h1 { font-family: var(--f-display); font-weight: 800; }
body.marketing-theme-minimal .cta-block {
  background: var(--ink); color: #fff; border-radius: 8px;
}
body.marketing-theme-minimal .btn { border-radius: 8px; }

/* Theme: warm */
body.marketing-theme-warm { background: var(--marketing-bg, #FFFAF3); }
body.marketing-theme-warm .feat,
body.marketing-theme-warm .landing nav,
body.marketing-theme-warm .card {
  border-radius: 22px;
  background: #FFFDFA;
}
body.marketing-theme-warm .btn,
body.marketing-theme-warm .feat .num { border-radius: 999px; }
body.marketing-theme-warm .cta-block { border-radius: 28px; }

/* Theme: clinical */
body.marketing-theme-clinical .landing nav { border-radius: 16px; }

/* Marketing hero variants */
body.marketing-hero-split .landing .hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center;
}
body.marketing-hero-split .landing .hero::after {
  content: ''; display: block; min-height: 200px;
  background:
    radial-gradient(360px 240px at 50% 40%, var(--marketing-hero-glow, rgba(168,155,224,.30)), transparent 60%),
    linear-gradient(135deg, var(--accent-soft, #E4EDFD), transparent 70%);
  border-radius: 22px;
  border: 1px solid var(--line);
}
@media (max-width: 820px) {
  body.marketing-hero-split .landing .hero { grid-template-columns: 1fr; }
  body.marketing-hero-split .landing .hero::after { min-height: 120px; }
}

body.marketing-hero-banner .landing .hero { text-align: center; }
body.marketing-hero-banner .landing .hero .lede,
body.marketing-hero-banner .landing .hero .cta-row { margin-left: auto; margin-right: auto; }
body.marketing-hero-banner .landing .hero .cta-row { justify-content: center; }

/* =====================================================
   RESPONSIVE UTILITIES — wrapping button groups, image
   thumbnails, large display numbers and stacked tables.
   ===================================================== */

/* Inline action bar: replaces ad-hoc `display:flex;gap:8px;`
   so multi-button groups wrap cleanly on narrow phones. */
.action-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.action-row > .btn { flex: 0 1 auto; }
@media (max-width: 520px) {
  .action-row { gap: 6px; }
  .action-row > .btn { flex: 1 1 auto; min-width: 0; }
}

/* Avatar / preview thumbnails inside forms — replace inline
   width/height styles. Scale below 360px so tiny phones don't
   crowd the form column. */
.thumb-avatar {
  width: 60px; height: 60px;
  border-radius: 50%; object-fit: cover;
  margin: 0 0 8px; border: 2px solid var(--line);
}
.thumb-logo {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: var(--r-md); margin: 0 0 8px;
  border: 1px solid var(--line);
  background: var(--cream-2); padding: 8px;
}
.thumb-cover {
  width: 100%; max-height: 160px;
  object-fit: cover; border-radius: var(--r-md);
  margin: 0 0 8px; border: 1px solid var(--line);
}
.thumb-gallery {
  width: 100%; max-height: 140px;
  object-fit: cover; border-radius: var(--r-md);
  margin: 0 0 8px; border: 1px solid var(--line);
}
@media (max-width: 420px) {
  .thumb-avatar { width: 48px; height: 48px; }
  .thumb-logo   { width: 64px; height: 64px; padding: 6px; }
}

/* Smaller h3 used inside cards as a sub-section heading. */
.subsection-h {
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 700;
}

/* Inline displayed secret token (API page): mono, wraps, soft
   surface so it stands out inside the success alert. */
.token-display {
  background: #fff; padding: 12px;
  border-radius: var(--r-sm);
  word-break: break-all;
  border: 1px solid var(--line-2);
  font-family: var(--f-mono);
  font-size: 13px;
}

/* Text-only destructive link button (used in tables for revoke /
   delete actions where a full btn would be too heavy). */
.btn-link {
  background: none; border: 0; padding: 0;
  cursor: pointer; font: inherit;
  color: var(--danger);
  text-decoration: underline; text-underline-offset: 2px;
  font-weight: 600;
}
.btn-link:hover { color: var(--danger); opacity: .8; }

/* Invoice summary table on pay page — narrow, no min-width
   so it adapts to small cards. */
table.t.invoice-summary {
  width: 100%; min-width: 0;
}
table.t.invoice-summary .total-row td { font-weight: 700; }
table.t.invoice-summary .total-amount {
  font-family: var(--f-display);
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.1;
}

/* Doctor row inside the overview "Your Doctors" panel */
.doctor-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.doctor-row:last-child { border-bottom: 0; }

/* Embed code list inside dashboard overview right card */
.embed-scroll-list {
  max-height: 260px; overflow-y: auto;
  padding-right: 4px;
}
.embed-list-item { margin-bottom: 16px; }
.embed-list-item:last-child { margin-bottom: 0; }
.embed-doctor-name { font-weight: 600; margin-bottom: 6px; }

/* Back-link inside an eyebrow (pageheader) — inherits caps
   styling but keeps the muted color so it doesn't grab focus. */
.eyebrow-link { color: inherit; }
.eyebrow-link:hover { color: var(--accent); }

/* Inline supplementary hint inside a form label */
.label-hint {
  font-weight: 400;
  text-transform: none;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

/* Location block heading inside doctor_edit */
.loc-label { font-size: 14px; }

/* Section divider tag used between sub-sections of a form */
.section-tag {
  margin-top: 8px; margin-bottom: 6px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}

/* Mini-label used inside the embed/calendar card to label
   two side-by-side blocks. */
.field-mini-label {
  font-weight: 600;
  margin-bottom: 6px;
}

/* Calendar key pill — display in monospace, slightly larger */
.calendar-key {
  font-size: 14px; padding: 8px 12px;
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
}

/* Tighter hint, used to follow a divider/section sub-headings */
.hint-tight { margin-top: -4px; }

/* Spacing reset utilities */
.m-0 { margin: 0; }
.align-center { align-items: center; }
.gap-tight { gap: 12px; }

/* Big display numbers (billing usage, plan name) — clamp so
   long currency values don't overflow narrow cards. */
.display-num {
  font-family: var(--f-display);
  font-size: clamp(22px, 6vw, 32px);
  line-height: 1.1;
  font-weight: 700;
  word-break: break-word;
}
.display-num-lg {
  font-family: var(--f-display);
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.1;
  font-weight: 700;
}

/* Card-style header bar inside table card (titled list cards
   that wrap a table) — used by billing/api/sites/etc. */
.card-titlebar {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.card-titlebar h3 { margin: 0; font-size: 16px; }
@media (max-width: 520px) { .card-titlebar { padding: 14px 16px; } }

/* Card empty-state inside a wrapper card */
.card-empty {
  padding: 36px 24px; text-align: center;
}
.card-empty h3 { margin-bottom: 8px; }
@media (max-width: 520px) {
  .card-empty { padding: 28px 16px; }
}

/* Card table wrap (used inside `.card[padding:0]`) */
.card-table-wrap {
  border: 0; border-radius: 0; padding: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}

/* Stat value override when text is long (plan name, etc.) */
.stat .value.value-sm { font-size: clamp(16px, 4vw, 22px); }

/* Embed iframe wrappers (used in dashboard/profile) — keep
   inside parent card with rounded corners. */
.embed-iframe {
  border: 0; border-radius: 16px;
  max-width: 100%; display: block;
  width: 100%;
}

/* =====================================================
   RESPONSIVE TABLES — convert wide admin/dashboard tables
   into stacked card rows on phones.
   Apply `.t-stack` next to `.t`. Each <td> needs `data-label`
   to render its column heading inline on the stacked layout.
   ===================================================== */
@media (max-width: 720px) {
  table.t.t-stack { min-width: 0; }
  table.t.t-stack thead { display: none; }
  table.t.t-stack tr {
    display: block;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  table.t.t-stack tr:hover td { background: transparent; }
  table.t.t-stack td {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 14px;
    padding: 6px 0; border: 0;
    text-align: right;
  }
  table.t.t-stack td:first-child {
    text-align: left;
    padding-bottom: 10px; margin-bottom: 6px;
    border-bottom: 1px dashed var(--line);
  }
  table.t.t-stack td:first-child::before { display: none; }
  table.t.t-stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 10.5px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted);
    font-weight: 700;
    text-align: left;
  }
  table.t.t-stack td > * { text-align: right; }
  table.t.t-stack td.text-right { text-align: right; }
  /* Form cells (admin/hospitals tenant control) take full row */
  table.t.t-stack td.cell-form {
    display: block; text-align: left;
    padding: 10px 0 4px;
    border-top: 1px dashed var(--line);
    margin-top: 6px;
  }
  table.t.t-stack td.cell-form::before {
    display: block; margin-bottom: 8px;
  }
  table.t.t-stack td.cell-form > * { text-align: left; }
  table.t.t-stack td.cell-form .tenant-control-grid { grid-template-columns: 1fr; }
  /* The wrapping div around the stacked table should not
     impose a scrollbar */
  .card > .table-wrap:has(table.t.t-stack),
  .card > .card-table-wrap:has(table.t.t-stack) {
    overflow-x: visible;
  }
}

/* =====================================================
   CALENDAR (admin doctor calendar) — moved out of inline
   <style> so phone rules cascade correctly.
   ===================================================== */
.cal-grid-head, .cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-grid-head { margin: 12px 0 6px; }
.cal-grid-head > div {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 4px 6px;
}
.cal-cell {
  aspect-ratio: 1.05/1;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  padding: 0; margin: 0;
  position: relative;
  display: flex; flex-direction: column;
  min-height: 78px;
}
.cal-cell.empty { border: 1px dashed var(--line); background: transparent; }
.cal-cell.past  { background: var(--cream-2); color: var(--muted); }
.cal-cell.today { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(11,18,32,.06) inset; }
.cal-cell.off   { background: var(--accent-soft); border-color: var(--accent); }
.cal-cell-btn {
  flex: 1; width: 100%;
  background: transparent; border: 0; cursor: pointer;
  text-align: left; padding: 10px 12px;
  font: inherit; color: inherit;
}
.cal-cell-btn:hover { background: var(--cream-2); border-radius: calc(var(--r-md) - 2px); }
.cal-cell.off .cal-cell-btn:hover { background: rgba(255,255,255,.4); }
.cal-num {
  font-family: var(--f-display);
  font-size: 18px; font-weight: 600;
}
.cal-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 600;
}
.cal-tag.book { background: var(--success); }
.cal-tag-faint { margin-top: 6px; font-size: 11px; color: var(--muted); }
.cal-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 16px; font-size: 12px; color: var(--muted);
}
.legend-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 6px; vertical-align: -1px;
}
.legend-dot.avail { background: var(--paper); border: 1px solid var(--line); }
.legend-dot.off   { background: var(--accent); }
.legend-dot.book  { background: var(--success); }
.legend-dot.today { background: var(--ink); }
@media (max-width: 720px) {
  .cal-cell { min-height: 60px; }
  .cal-num { font-size: 14px; }
  .cal-tag, .cal-tag-faint { font-size: 10px; padding: 1px 6px; }
  .cal-cell-btn { padding: 6px 6px; }
  .cal-grid, .cal-grid-head { gap: 4px; }
}
@media (max-width: 380px) {
  .cal-cell { min-height: 44px; }
  .cal-num { font-size: 12px; }
  .cal-tag, .cal-tag-faint { font-size: 9px; padding: 1px 4px; line-height: 1.2; }
  .cal-grid-head > div { font-size: 9px; padding: 2px; letter-spacing: .06em; }
  .cal-grid, .cal-grid-head { gap: 3px; }
  .cal-cell-btn { padding: 4px 4px; }
}

/* Public booking page (doctor): explicit gap on the stacked
   bio/widget layout, and a scroll-to-book anchor on phones. */
.doctor-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 32px;
}
.doctor-main-grid > * { min-width: 0; }
@media (max-width: 980px) {
  .doctor-main-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 520px) {
  .doctor-main-grid { gap: 20px; }
}

.booking-h2 { margin-bottom: 20px; }
@media (max-width: 520px) {
  .booking-h2 { margin-bottom: 14px; }
}

/* Doctor card on clinic page — when wrapping <a>, normalize link styling */
.doctor-card-link { text-decoration: none; color: inherit; display: block; }

/* Centering helper for expertise tags inside a card */
.expertise-tags.center { justify-content: center; margin-top: 10px; }

/* Inline SVG icon that sits next to text */
.icon-inline { vertical-align: -2px; }

/* Clinic phone line */
.phone-line a { color: inherit; }
.phone-line a:hover { color: var(--accent); }

/* Book-btn default margin used inside doctor-card */
.doctor-card .book-btn { margin-top: 14px; }

/* Auth-page helper links */
.link-accent { color: var(--accent); font-weight: 500; }
.link-strong { color: var(--ink); font-weight: 500; }

/* Marketing guide pricing cards */
.pricing-card { display: flex; flex-direction: column; }
.pricing-card .price-h {
  font-size: clamp(24px, 6vw, 32px);
  margin-bottom: 6px;
  line-height: 1.1;
}
.pricing-card .price-suffix-muted {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.pricing-card .feature-list {
  line-height: 1.9;
  font-size: 14px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

/* Accent pill (used in marketing guide intro badge) */
.badge.accent-pill {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  padding: 8px 16px;
}

/* Marketing body text (slightly larger, longer line-height) */
.body-text {
  font-size: 15px;
  line-height: 1.75;
}
.intro-text { max-width: 720px; margin-bottom: 28px; }

/* mt-auto helper */
.mt-auto { margin-top: auto; }

/* Plan-option body (signup pages) — grows to fill available
   space next to the price chip. On phones the price wraps
   under the body via the existing 480px breakpoint. */
.plan-option-body { flex: 1 1 220px; min-width: 0; }
.plan-option .price-suffix {
  font-family: var(--f-body);
  font-size: 12px;
}

/* Public clinic hero: tighten gallery spacing on small phones. */
@media (max-width: 420px) {
  .clinic-gallery { gap: 10px; margin: 14px 0 20px; }
  .clinic-map-wrap iframe { height: 200px; }
}

/* Plan option (signup) — make right-side price chunk respect
   container width and wrap below the description on phones. */
@media (max-width: 480px) {
  .plan-option { padding: 12px; }
  .plan-option > div:first-of-type { flex-basis: 100%; }
  .plan-option .price { width: auto; text-align: left; }
}

/* Long-content cells in stacked-table mode (e.g. address with
   multiple lines, embedded form) should stack vertically. */
@media (max-width: 720px) {
  table.t.t-stack td.cell-block {
    display: block; text-align: left;
  }
  table.t.t-stack td.cell-block::before {
    display: block; margin-bottom: 4px;
  }
}

/* Small-screen-only horizontal padding tightening for the
   embed code area inside cards (admin tokens / dashboard). */
@media (max-width: 420px) {
  .embed-code-wrap pre { font-size: 10.5px; padding: 10px 10px 32px; }
}

/* =====================================================
   NOTIFICATIONS INBOX
   ===================================================== */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item { padding: 18px 20px; }
.notif-item.notif-unread { border-left: 3px solid var(--accent); background: linear-gradient(180deg, var(--accent-tint) 0%, var(--paper) 60%); }
.notif-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.notif-title { font-size: 16px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.notif-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.notif-meta { white-space: nowrap; }
.notif-body { margin: 10px 0 0; color: var(--ink-2); line-height: 1.55; }
.notif-actions { margin-top: 14px; display: flex; gap: 8px; }
@media (max-width: 520px) {
  .notif-meta { white-space: normal; }
  .notif-head { gap: 4px; }
}

/* =====================================================
   RENEWAL CALLOUT (dashboard home)
   ===================================================== */
.renewal-card { border-left: 4px solid var(--accent); }
.renewal-card.status-warn { border-left-color: var(--warning); }
.renewal-card.status-error { border-left-color: var(--danger); }
.renewal-card-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.renewal-card-action { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 220px; }
.renewal-card-action .btn { text-align: center; }
@media (max-width: 720px) {
  .renewal-card-grid { grid-template-columns: 1fr; }
  .renewal-card-action { min-width: 0; }
}

/* CTA button at the bottom of a public pricing card. The card is a flex
   column elsewhere; .pricing-cta pins to the bottom so cards align. */
.pricing-card { display: flex; flex-direction: column; }
.pricing-card .pricing-cta { margin-top: auto; padding-top: 14px; align-self: stretch; text-align: center; }
.pricing-card .pricing-cta + * { margin-top: 0; }

/* =====================================================
   PRINTABLE INVOICE
   Standalone page (no sidebar layout). .no-print is hidden
   in print so the toolbar disappears, leaving just the sheet.
   ===================================================== */
body.invoice-body {
  background: #F6F7FB;
  color: var(--ink);
  font-family: var(--f-body);
  min-height: 100vh;
  padding: 24px 16px 80px;
}
.invoice-toolbar {
  max-width: 880px;
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.invoice-toolbar-actions { display: flex; gap: 8px; align-items: center; }
.invoice-sheet {
  max-width: 880px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(11,18,32,.06);
  padding: 44px clamp(20px, 4vw, 56px);
  position: relative;
}
.invoice-header {
  display: flex; justify-content: space-between; gap: 24px;
  align-items: flex-start; flex-wrap: wrap;
  padding-bottom: 22px; margin-bottom: 28px;
  border-bottom: 2px solid var(--ink);
}
.invoice-issuer-name {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: -.015em;
}
.invoice-issuer-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.invoice-meta { text-align: right; min-width: 220px; }
.invoice-title {
  font-family: var(--f-display);
  font-size: 30px; font-weight: 800; letter-spacing: -.025em;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.invoice-number { font-family: var(--f-mono, monospace); font-size: 13px; color: var(--ink-2); }
.invoice-status {
  display: inline-block; margin-top: 8px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
}
.invoice-status-paid     { background: var(--success-soft, #E3F0E8); color: var(--success, #0F7A4F); }
.invoice-status-issued   { background: #FEF3C7; color: #92400E; }
.invoice-status-overdue  { background: #FEE2E2; color: #991B1B; }
.invoice-status-draft    { background: #E5E7EB; color: #4B5563; }
.invoice-status-refunded { background: #DBEAFE; color: #1D4ED8; }
.invoice-status-failed   { background: #FEE2E2; color: #991B1B; }

.invoice-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-bottom: 28px;
}
.invoice-label {
  text-transform: uppercase; letter-spacing: .08em;
  font-size: 10.5px; font-weight: 700;
  color: var(--muted); margin-bottom: 4px;
}
.invoice-party-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.invoice-party-line { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.invoice-meta-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px; row-gap: 8px;
  font-size: 13px;
}
.invoice-meta-grid .invoice-label { margin-bottom: 0; align-self: center; }

.invoice-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.invoice-table thead th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.invoice-table thead th.text-right { text-align: right; }
.invoice-table tbody td {
  padding: 16px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.invoice-table tfoot td {
  padding: 8px 0;
  border: none;
}
.invoice-table tfoot tr.invoice-subtotal td {
  padding-top: 18px;
}
.invoice-table tfoot tr.invoice-total td {
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: 16px;
}
.invoice-paid-stamp {
  position: absolute;
  top: 38%; right: 8%;
  font-family: var(--f-display);
  font-size: clamp(60px, 9vw, 110px);
  font-weight: 800;
  letter-spacing: .05em;
  color: rgba(15,122,79,.12);
  border: 6px solid rgba(15,122,79,.18);
  padding: 8px 28px;
  border-radius: 12px;
  transform: rotate(-14deg);
  pointer-events: none;
  user-select: none;
}
.invoice-footer { margin-top: 36px; padding-top: 18px; border-top: 1px dashed var(--line); }

@media (max-width: 640px) {
  .invoice-parties { grid-template-columns: 1fr; }
  .invoice-header  { flex-direction: column; align-items: flex-start; }
  .invoice-meta    { text-align: left; }
}

@media print {
  body.invoice-body { background: #fff; padding: 0; color: #000; }
  .no-print { display: none !important; }
  .invoice-sheet {
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin: 0;
    max-width: none;
    padding: 24px;
  }
  .invoice-paid-stamp { color: rgba(15,122,79,.18); border-color: rgba(15,122,79,.28); }
  @page { margin: 14mm; }
}

/* =====================================================
   PLAN SWITCH PICKER  (dashboard billing page)
   ===================================================== */
.plan-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.plan-switch-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 18px;
  background: var(--paper);
  display: flex; flex-direction: column;
  transition: border-color var(--t-1) var(--ease),
              box-shadow var(--t-1) var(--ease),
              transform var(--t-1) var(--ease);
}
.plan-switch-card:hover {
  border-color: var(--accent);
  box-shadow: var(--sh-card);
  transform: translateY(-1px);
}
.plan-switch-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.plan-switch-name {
  font-family: var(--f-display);
  font-size: 17px; font-weight: 700;
  letter-spacing: -.015em;
}
.plan-switch-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}
.plan-switch-tag.upgrade { background: var(--accent-soft, #E6EEFD); color: var(--accent); }
.plan-switch-price {
  font-family: var(--f-display);
  font-size: 24px; font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.plan-switch-price .muted { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-switch-meta {
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 10px;
}
.plan-switch-features {
  list-style: none; padding: 0; margin: 0 0 14px;
  font-size: 12.5px; color: var(--ink-2);
}
.plan-switch-features li {
  padding-left: 18px; position: relative;
  margin-bottom: 4px;
}
.plan-switch-features li::before {
  content: '✓';
  position: absolute; left: 0;
  color: var(--accent);
  font-weight: 700;
}
.plan-switch-form { margin: auto 0 0; }
.plan-switch-form button { margin-top: 4px; }

/* =====================================================================
   Hero — floating device overlays (phone / tablet / PC).
   - Mobile / tablet: device sits as its own block element BELOW the
     hero card, in normal flow inside the .hero-wrap.
   - Desktop (≥1100px): device becomes an absolute-positioned overlay
     on the right of the hero (the .hero-wrap is the positioning
     context); the hero text area gets a matching padding-right so
     the copy never wraps under the device.
   ===================================================================== */
.hero-wrap {
  position: relative;
  margin-bottom: clamp(28px, 5vw, 44px);
}
.hero-wrap > .hero { margin-bottom: 0; }

@media (min-width: 1100px) {
  .landing .hero-wrap-with-phone  > .hero { padding-right: clamp(260px, 22vw, 300px); }
  .landing .hero-wrap-with-pc     > .hero { padding-right: clamp(340px, 28vw, 400px); }
  .landing .hero-wrap-with-tablet > .hero { padding-right: clamp(360px, 29vw, 420px); }
}

.hero-screens {
  display: block;
  width: clamp(192px, 54vw, 230px);
  margin: clamp(28px, 6vw, 44px) auto 4px;
  position: relative;
  pointer-events: none;
  z-index: 1;
}
@media (min-width: 1100px) {
  .hero-screens {
    position: absolute;
    top: 50%;
    right: clamp(24px, 3vw, 40px);
    transform: translateY(-50%);
    width: 210px;
    margin: 0;
    z-index: 2;
  }
}

.hero-phone {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 18.6;
  background: linear-gradient(180deg, #232233 0%, #14131c 100%);
  border-radius: 32px;
  padding: 8px;
  box-shadow:
    0 32px 64px -32px rgba(76, 107, 160, .45),
    0 16px 36px -18px rgba(168, 155, 224, .35),
    0 0 0 1px rgba(255, 255, 255, .8) inset;
  transform: rotate(-2.4deg);
  animation: heroPhoneFloat 7.5s ease-in-out infinite;
}
@keyframes heroPhoneFloat {
  0%, 100% { transform: rotate(-2.4deg) translateY(0); }
  50%      { transform: rotate(-1.6deg) translateY(-12px); }
}
.hero-phone-glow {
  position: absolute;
  inset: -36px;
  background: radial-gradient(closest-side, rgba(168,155,224,.35), transparent 70%);
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
}
.hero-phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 14px;
  background: #14131c;
  border-radius: 0 0 12px 12px;
  z-index: 4;
}
.hero-phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #F7F9FC 0%, #ffffff 100%);
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
}

.hero-slide {
  position: absolute;
  inset: 0;
  padding: 26px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  translate: 0 22px;
}
.hero-slide:nth-child(1) { animation: hsCycle 22.5s ease-in-out infinite 0s; }
.hero-slide:nth-child(2) { animation: hsCycle 22.5s ease-in-out infinite 4.5s; }
.hero-slide:nth-child(3) { animation: hsCycle 22.5s ease-in-out infinite 9s; }
.hero-slide:nth-child(4) { animation: hsCycle 22.5s ease-in-out infinite 13.5s; }
.hero-slide:nth-child(5) { animation: hsCycle 22.5s ease-in-out infinite 18s; }

@keyframes hsCycle {
  0%   { opacity: 0; translate: 0 22px; }
  3%   { opacity: 1; translate: 0 0; }
  17%  { opacity: 1; translate: 0 0; }
  20%  { opacity: 0; translate: 0 -22px; }
  100% { opacity: 0; translate: 0 -22px; }
}

/* Slide content density — tighten the gap for the busier slides */
.hero-slide.hs-signup,
.hero-slide.hs-pubpage,
.hero-slide.hs-cal-page,
.hero-slide.hs-widget-slide,
.hero-slide.hs-booked { gap: 6px; padding: 22px 12px 10px; }

/* ── Shared typography (used across slides) ───────────────────────── */
.hs-h {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.18;
  color: var(--ink);
  letter-spacing: -.01em;
  margin-top: 2px;
}
.hs-h.center,
.hs-meta.center { text-align: center; }

.hs-h2 {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -.01em;
  margin-top: 2px;
}

.hs-meta {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
}

.hs-eyebrow {
  font-size: 8.5px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.hs-cta {
  margin-top: auto;
  padding: 8px 10px;
  background: var(--g-cta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 999px;
  text-align: center;
  letter-spacing: .2px;
  box-shadow: 0 8px 18px -8px rgba(91, 141, 239, .55);
}
.hs-cta.light {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.hs-foot {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--lavender);
  letter-spacing: .5px;
  padding-top: 2px;
}

/* ── SLIDE 1 · Sign up (mirrors auth/signup_doctor.php) ────────────── */
.hs-app-brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  text-align: center;
  margin-top: -4px;
}
.hs-app-brand span { color: var(--mint); padding: 0 1px; }

.hs-tagline {
  font-size: 9px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
  margin-top: -4px;
}

.hs-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.hs-field b {
  font-size: 8px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: .3px;
}
.hs-field i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink);
  font-weight: 600;
}

.hs-slug-prev {
  font-size: 9px;
  color: var(--muted);
  background: var(--accent-tint);
  border: 1px dashed var(--accent-soft);
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  margin-top: -2px;
}
.hs-slug-prev u {
  text-decoration: none;
  color: var(--accent);
  font-weight: 800;
}

/* ── SLIDE 2 · Public doctor page (mirrors public/doctor.php) ──────── */
.hs-pub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 2px 7px;
  border-bottom: 1px solid var(--line);
}
.hs-pub-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.hs-pub-brand strong {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hs-mini-avatar {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--g-cta);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.hs-share-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8.5px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 7px;
  letter-spacing: .2px;
}

.hs-pub-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 0 0;
}
.hs-pub-hero > strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.hs-pub-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--g-cta);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px -6px rgba(91, 141, 239, .55);
}
.hs-pub-spec {
  display: inline-block;
  padding: 2px 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  border-radius: 999px;
  letter-spacing: .2px;
}
.hs-pub-qual {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
}
.hs-pub-fee {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: var(--mint-soft);
  color: var(--success);
  font-size: 9px;
  font-weight: 800;
  border-radius: 999px;
}

.hs-pub-cta {
  margin-top: 2px;
  padding: 6px 8px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hs-pub-cta strong {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}
.hs-pub-cta.tight { padding: 5px 8px; }

/* ── SLIDE 3 · Dashboard calendar (mirrors dashboard/doctor_calendar.php) */
.hs-page-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px 6px;
}
.hs-page-head > strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}
.hs-eyebrow-link {
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .2px;
}

.hs-month-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px 8px;
  box-shadow: 0 4px 12px -8px rgba(76, 107, 160, .15);
}
.hs-month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.hs-month-row > span:first-child {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink);
}
.hs-nav-arrows {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}
.hs-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 7.5px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  letter-spacing: .3px;
}
.hs-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding-top: 3px;
}
.hs-month-grid > i {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--cream);
  border-radius: 4px;
}
.hs-month-grid > i.empty { background: transparent; }
.hs-month-grid > i.today {
  background: var(--g-cta);
  color: #fff;
  box-shadow: 0 3px 8px -3px rgba(91, 141, 239, .55);
}
.hs-month-grid > i.book {
  background: var(--mint-soft);
  color: var(--success);
}
.hs-month-grid > i.off {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ── SLIDE 4 · Patient booking widget (mirrors widget.css day strip + slots) */
.hs-day-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 2px 0;
}
.hs-day-strip span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 0 6px;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  letter-spacing: .2px;
}
.hs-day-strip span i {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
}
.hs-day-strip span.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.hs-day-strip span.active i { color: #fff; }

.hs-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.hs-slots span {
  display: block;
  text-align: center;
  padding: 5px 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  letter-spacing: .2px;
}
.hs-slots span.picked {
  background: var(--g-cta);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(91, 141, 239, .55);
}
.hs-slots span.taken {
  background: var(--cream-2);
  border-color: var(--line);
  color: var(--muted-2);
  text-decoration: line-through;
}

/* ── SLIDE 5 · Booking confirmed ──────────────────────────────────── */
.hs-check {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 2px;
  box-shadow: 0 10px 22px -10px rgba(47, 163, 122, .45);
}
.hs-confirm-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 4px 12px -8px rgba(76, 107, 160, .15);
}
.hs-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  padding: 2px 0;
  border-bottom: 1px dashed var(--line);
}
.hs-confirm-row:last-child { border-bottom: none; }
.hs-confirm-row b {
  font-weight: 700;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.hs-confirm-row span {
  font-weight: 800;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .hero-phone,
  .hero-slide { animation: none !important; }
  .hero-slide:first-child {
    opacity: 1;
    translate: none;
  }
}

/* =====================================================================
   Clinics hero — floating PC / monitor mockup
   - Mobile: monitor sits in normal flow at the bottom of the hero card.
   - Desktop (≥1100px): absolute-positioned overlay on the right.
   Five slides cycle through hospital sign-up → add doctors → embed →
   customise → live overview, mirroring the actual dashboard chrome.
   ===================================================================== */
.hero-pc {
  display: block;
  width: clamp(260px, 78vw, 340px);
  margin: clamp(28px, 6vw, 44px) auto 4px;
  position: relative;
  pointer-events: none;
  z-index: 1;
}
@media (min-width: 1100px) {
  .hero-pc {
    position: absolute;
    top: 50%;
    right: clamp(18px, 2vw, 32px);
    transform: translateY(-50%);
    width: clamp(300px, 24vw, 340px);
    margin: 0;
    z-index: 2;
  }
}

.hero-monitor {
  position: relative;
  width: 100%;
  animation: heroMonitorFloat 8s ease-in-out infinite;
}
@keyframes heroMonitorFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.hero-monitor-glow {
  position: absolute;
  inset: -28px -20px -8px -20px;
  background: radial-gradient(closest-side, rgba(91, 141, 239, .28), transparent 70%);
  filter: blur(6px);
  z-index: -1;
  pointer-events: none;
}

.hero-monitor-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(180deg, #1b1b27 0%, #0e0e16 100%);
  border-radius: 12px;
  padding: 7px;
  box-shadow:
    0 32px 64px -32px rgba(76, 107, 160, .45),
    0 16px 36px -18px rgba(168, 155, 224, .30),
    0 0 0 1px rgba(255, 255, 255, .7) inset;
  overflow: hidden;
  isolation: isolate;
}
.hero-monitor-stand {
  width: 28%;
  height: 8px;
  margin: 0 auto;
  background: linear-gradient(180deg, #2a2a37 0%, #161620 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.hero-monitor-base {
  width: 50%;
  height: 5px;
  margin: 0 auto;
  background: linear-gradient(180deg, #2a2a37 0%, #131320 100%);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 14px -8px rgba(20, 20, 30, .45);
}

/* Each slide fills the screen interior */
.hero-pc-slide {
  position: absolute;
  inset: 7px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  opacity: 0;
  translate: 0 14px;
}
.hero-pc-slide:nth-child(1) { animation: hsCycle 22.5s ease-in-out infinite 0s; }
.hero-pc-slide:nth-child(2) { animation: hsCycle 22.5s ease-in-out infinite 4.5s; }
.hero-pc-slide:nth-child(3) { animation: hsCycle 22.5s ease-in-out infinite 9s; }
.hero-pc-slide:nth-child(4) { animation: hsCycle 22.5s ease-in-out infinite 13.5s; }
.hero-pc-slide:nth-child(5) { animation: hsCycle 22.5s ease-in-out infinite 18s; }

/* Browser chrome — same row on every slide, URL changes */
.hpc-browser {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #e7eaf1;
  border-bottom: 1px solid #d2d8e2;
  font-size: 8px;
  flex: none;
}
.hpc-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  flex: none;
}
.hpc-dot.r { background: #f06464; }
.hpc-dot.y { background: #f3c14a; }
.hpc-dot.g { background: #58c97a; }
.hpc-url {
  flex: 1;
  margin-left: 6px;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #d2d8e2;
  border-radius: 999px;
  font-size: 7.5px;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .1px;
}

/* Bottom step caption (outside the browser content) */
.hpc-foot {
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  color: var(--lavender);
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 4px 0 2px;
  background: rgba(255,255,255,.85);
  border-top: 1px solid var(--line);
}

/* ── Common content area ──────────────────────────────────────────── */
.hpc-content { flex: 1; padding: 9px 11px 6px; display: flex; flex-direction: column; gap: 4px; }

/* ── Dashboard chrome (sidebar + main) ────────────────────────────── */
.hpc-app {
  flex: 1;
  display: grid;
  grid-template-columns: 86px 1fr;
  min-height: 0;
}
.hpc-side {
  background: linear-gradient(180deg, #ffffff 0%, #F7F9FC 100%);
  border-right: 1px solid var(--line);
  padding: 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.hpc-brand-sm {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.1;
}
.hpc-brand-sm i {
  color: var(--mint);
  font-style: normal;
  padding: 0 .5px;
}
.hpc-sub {
  font-size: 7px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
  letter-spacing: .1px;
}
.hpc-group {
  font-size: 6.5px;
  color: var(--muted-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 3px;
}
.hpc-nav {
  font-size: 8px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 3px 6px;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: .1px;
  line-height: 1.2;
}
.hpc-nav.active {
  background: var(--g-cta);
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(91, 141, 239, .45);
}

.hpc-main {
  background: var(--cream);
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow: hidden;
}
.hpc-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.hpc-page-head strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.1;
}
.hpc-eyebrow {
  display: block;
  font-size: 6.5px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1px;
}
.hpc-btn {
  display: inline-block;
  padding: 3px 8px;
  background: var(--ink);
  color: #fff;
  font-size: 7.5px;
  font-weight: 800;
  border-radius: 6px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.hpc-btn.small { padding: 3px 7px; font-size: 7px; }

/* Table — used by Doctors and Embedded Sites slides */
.hpc-table {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.hpc-trow {
  display: grid;
  grid-template-columns: 1.4fr 1fr .8fr;
  padding: 4px 8px;
  font-size: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 4px;
}
.hpc-trow:last-child { border-bottom: none; }
.hpc-trow.head {
  background: var(--cream);
  font-size: 6.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 4px 8px 3px;
}
.hpc-trow b {
  font-weight: 800;
  color: var(--ink);
}
.hpc-pill {
  font-size: 6.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 6px;
  border-radius: 999px;
  text-align: center;
  width: fit-content;
}
.hpc-pill.ok {
  background: var(--success-soft);
  color: var(--success);
}

.hpc-note {
  font-size: 8px;
  color: var(--ink-3);
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
  padding: 4px 8px;
  line-height: 1.4;
}
.hpc-note u {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

/* Customize slide content */
.hpc-section-h {
  font-size: 8px;
  font-weight: 800;
  color: var(--ink-2);
  margin-top: 2px;
}
.hpc-swatches { display: flex; gap: 5px; }
.hpc-sw {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  position: relative;
}
.hpc-sw.blue   { background: linear-gradient(135deg, #5B8DEF, #A89BE0); }
.hpc-sw.mint   { background: linear-gradient(135deg, #76CDB5, #B6E3D6); }
.hpc-sw.peach  { background: linear-gradient(135deg, #F4A988, #F8C9B3); }
.hpc-sw.blush  { background: linear-gradient(135deg, #ED88A8, #F4B3C7); }
.hpc-sw.sun    { background: linear-gradient(135deg, #F4C460, #F7DC9A); }
.hpc-sw.active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.hpc-cover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px dashed var(--accent-soft);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 8px;
}
.hpc-cover span { font-weight: 700; color: var(--ink-2); }
.hpc-cover em {
  font-style: normal;
  color: var(--success);
  font-weight: 800;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Overview slide content */
.hpc-renewal {
  background: linear-gradient(135deg, var(--accent-soft), var(--lavender-soft));
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.hpc-renewal strong {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 1px;
  line-height: 1.2;
}
.hpc-renewal em {
  display: block;
  font-style: normal;
  font-size: 7.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 1px;
}
.hpc-appt {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 6px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 8px;
}
.hpc-appt > span:first-child {
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .2px;
}
.hpc-appt b { color: var(--ink); }

/* ── Auth slide (Sign up) ─────────────────────────────────────────── */
.hpc-auth { gap: 5px; align-items: stretch; }
.hpc-brand-large {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  text-align: center;
  margin-top: 2px;
}
.hpc-brand-large i {
  color: var(--mint);
  font-style: normal;
  padding: 0 1px;
}
.hpc-form-tag {
  font-size: 7.5px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: center;
}
.hpc-form-h {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}
.hpc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.hpc-field {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hpc-field b {
  font-size: 6.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.hpc-field i {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--ink);
}
.hpc-cta {
  margin-top: auto;
  padding: 7px 10px;
  background: var(--g-cta);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 999px;
  text-align: center;
  letter-spacing: .2px;
  box-shadow: 0 8px 16px -8px rgba(91, 141, 239, .55);
}

@media (prefers-reduced-motion: reduce) {
  .hero-monitor,
  .hero-pc-slide { animation: none !important; }
  .hero-pc-slide:first-child {
    opacity: 1;
    translate: none;
  }
}

/* =====================================================================
   Doctors hero — floating tablet mockup (landscape 4:3)
   Reuses the .hpc-* dashboard chrome from the clinics PC mockup, but
   wraps it in a chunkier rounded-bezel tablet body (no stand).
   Mirrors the 5 setup steps the doctors guide lists.
   ===================================================================== */
.hero-tablet {
  display: block;
  width: clamp(280px, 80vw, 360px);
  margin: clamp(28px, 6vw, 44px) auto 4px;
  position: relative;
  pointer-events: none;
  z-index: 1;
}
@media (min-width: 1100px) {
  .hero-tablet {
    position: absolute;
    top: 50%;
    right: clamp(16px, 2vw, 30px);
    transform: translateY(-50%);
    width: clamp(320px, 26vw, 360px);
    margin: 0;
    z-index: 2;
  }
}

.hero-tablet-body {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #1c1c28 0%, #0e0e16 100%);
  border-radius: 18px;
  padding: 13px;
  box-shadow:
    0 32px 64px -32px rgba(76, 107, 160, .45),
    0 16px 36px -18px rgba(168, 155, 224, .30),
    0 0 0 1px rgba(255, 255, 255, .7) inset;
  animation: heroTabletFloat 7s ease-in-out infinite;
}
@keyframes heroTabletFloat {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50%      { transform: rotate(.5deg) translateY(-8px); }
}
.hero-tablet-glow {
  position: absolute;
  inset: -28px;
  background: radial-gradient(closest-side, rgba(118, 205, 181, .30), transparent 70%);
  filter: blur(7px);
  z-index: -1;
  pointer-events: none;
}
.hero-tablet-camera {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #303040;
  box-shadow: 0 0 0 1px #1a1a25;
}
.hero-tablet-home {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}
.hero-tablet-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--cream);
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
}

/* Each tablet slide cycles through hsCycle */
.hero-tablet-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  translate: 0 14px;
}
.hero-tablet-slide:nth-child(1) { animation: hsCycle 22.5s ease-in-out infinite 0s; }
.hero-tablet-slide:nth-child(2) { animation: hsCycle 22.5s ease-in-out infinite 4.5s; }
.hero-tablet-slide:nth-child(3) { animation: hsCycle 22.5s ease-in-out infinite 9s; }
.hero-tablet-slide:nth-child(4) { animation: hsCycle 22.5s ease-in-out infinite 13.5s; }
.hero-tablet-slide:nth-child(5) { animation: hsCycle 22.5s ease-in-out infinite 18s; }

/* CTA "tight" modifier — used inline beneath the hours list */
.hpc-cta.tight {
  margin-top: 4px;
  padding: 5px 10px;
  font-size: 8.5px;
}

/* ── Slide 2 · Work locations ─────────────────────────────────────── */
.ht-loc {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 8.5px;
}
.ht-loc b {
  display: block;
  font-weight: 800;
  color: var(--ink);
  font-size: 9px;
  letter-spacing: -.01em;
}
.ht-loc em {
  display: block;
  font-style: normal;
  font-size: 7.5px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 1px;
}
.ht-pin {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: block;
  flex: none;
}
.ht-pin::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px #fff inset;
}

/* ── Slide 3 · Weekly hours ───────────────────────────────────────── */
.ht-hours-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ht-hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 8.5px;
}
.ht-hours-row span {
  font-weight: 800;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ht-hours-row i {
  font-style: normal;
  color: var(--accent);
  font-weight: 800;
}
.ht-hours-row.off i { color: var(--muted-2); font-style: italic; font-weight: 600; }

/* ── Slide 4 · Share your link ────────────────────────────────────── */
.ht-link-card {
  background: linear-gradient(135deg, var(--accent-tint), #ffffff);
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.ht-link-host { color: var(--muted); font-weight: 700; }
.ht-link-slug {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -.01em;
}
.ht-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.ht-act {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  border-radius: 5px;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .2px;
  text-align: center;
}
.ht-act.share { background: var(--g-cta); color: #fff; }
.ht-act.wa    { background: #25D366; color: #fff; }
.ht-act.copy  { background: var(--cream); color: var(--ink-2); border: 1px solid var(--line); }
.ht-act.embed { background: var(--ink); color: #fff; }
.ht-preview {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
}
.ht-preview b {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--ink);
}
.ht-preview em {
  display: block;
  font-style: normal;
  font-size: 7.5px;
  color: var(--muted);
  font-weight: 600;
}
.ht-mini-av {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--g-cta);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ── Slide 5 · Calendar / manage ──────────────────────────────────── */
.ht-month-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 6.5px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  letter-spacing: .3px;
}
.ht-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding-top: 2px;
}
.ht-month-grid > i {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.ht-month-grid > i.empty { background: transparent; border-color: transparent; }
.ht-month-grid > i.today {
  background: var(--g-cta);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px -2px rgba(91, 141, 239, .55);
}
.ht-month-grid > i.book {
  background: var(--mint-soft);
  color: var(--success);
  border-color: transparent;
}
.ht-month-grid > i.off {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.ht-cal-note {
  margin-top: 4px;
  text-align: center;
  font-size: 7.5px;
  color: var(--muted);
  font-weight: 600;
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .hero-tablet-body,
  .hero-tablet-slide { animation: none !important; }
  .hero-tablet-slide:first-child {
    opacity: 1;
    translate: none;
  }
}

/* =====================================================================
   Proportional minified-device scaling
   --------------------------------------------------------------------
   Each device's screen becomes a CSS container; the slide inside is
   sized to a fixed "design width" larger than the actual device, then
   uniformly shrunk with transform: scale() so the inner UI (text,
   paddings, icons, gaps) shrinks in lockstep with the device width —
   making the floating mockups look like real screens minified down,
   instead of mockups with oversized type.

   tan(atan2(L1, L2)) returns L1 / L2 as a unitless number, which is
   what transform: scale() needs. The fade-in animation now uses the
   separate `translate` property so the scale transform isn't replaced
   on every keyframe.
   ===================================================================== */
.hero-phone-screen,
.hero-monitor-screen,
.hero-tablet-screen {
  container-type: inline-size;
}

.hero-slide {
  --d-w: 270px;
  --d-h: calc(var(--d-w) * 2.15);   /* phone screen interior aspect */
  inset: auto;
  top: 0;
  left: 0;
  width: var(--d-w);
  height: var(--d-h);
  transform-origin: top left;
  transform: scale(tan(atan2(100cqi, var(--d-w))));
}

.hero-pc-slide {
  --d-w: 400px;
  --d-h: calc(var(--d-w) * 0.609);  /* 16:10 monitor content-area aspect (W=340 → 198.5/326) */
  inset: auto;
  top: 7px;
  left: 7px;
  width: var(--d-w);
  height: var(--d-h);
  transform-origin: top left;
  /* container is the monitor screen (incl. 7px bezel on each side);
     subtract 14px so 100% of the design width fills the inner area */
  transform: scale(tan(atan2(calc(100cqi - 14px), var(--d-w))));
}

.hero-tablet-slide {
  --d-w: 410px;
  --d-h: calc(var(--d-w) * 0.731);  /* 4:3 tablet screen aspect (W=360 → 244/334) */
  inset: auto;
  top: 0;
  left: 0;
  width: var(--d-w);
  height: var(--d-h);
  transform-origin: top left;
  transform: scale(tan(atan2(100cqi, var(--d-w))));
}
