/* =====================================================
   DoctorAppointments — Design System
   Aesthetic: refined editorial + medical precision
   Typography: Fraunces (display serif) + Inter Tight (body)
   Palette: deep slate + cream + clinical red accent
   ===================================================== */

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

:root {
  /* Colors */
  --ink: #0B1220;
  --ink-2: #1a2236;
  --ink-3: #2a3449;
  --cream: #FBF8F3;
  --cream-2: #F3EDE3;
  --paper: #FFFFFF;
  --line: #E6DFD3;
  --line-2: #D4CCBC;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --accent: #C1272D;           /* clinical red */
  --accent-soft: #F6E5E3;
  --success: #0F7A4F;
  --success-soft: #E3F0E8;
  --warning: #B4730D;
  --warning-soft: #F7ECCF;

  /* Type */
  --f-display: 'Fraunces', Georgia, serif;
  --f-body: 'Inter Tight', -apple-system, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Space */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(11,18,32,.04), 0 1px 3px rgba(11,18,32,.06);
  --sh-2: 0 4px 12px rgba(11,18,32,.06), 0 2px 4px rgba(11,18,32,.04);
  --sh-3: 0 20px 50px rgba(11,18,32,.12);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--f-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 44px; line-height: 1.05; }
h2 { font-size: 28px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }

.mono { font-family: var(--f-mono); }
.micro { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: var(--cream);
  padding: 28px 20px;
  position: sticky; top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar .brand {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.sidebar .brand .dot { color: var(--accent); }
.sidebar .sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; opacity: .5; margin-bottom: 32px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--cream); opacity: .72;
  font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
}
.sidebar nav a:hover { opacity: 1; background: rgba(255,255,255,.04); text-decoration: none; }
.sidebar nav a.active { opacity: 1; background: rgba(255,255,255,.08); }
.sidebar nav a .ic { width: 18px; height: 18px; opacity: .9; }
.sidebar .group-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; opacity: .4; margin: 24px 12px 8px; }
.sidebar .userbox { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.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: 40px; height: 40px;
  background: var(--ink); color: var(--cream);
  border: none; border-radius: var(--r-md);
  cursor: pointer; align-items: center; justify-content: center;
  flex-direction: column; gap: 5px; padding: 10px;
  box-shadow: var(--sh-2);
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--cream); border-radius: 2px; transition: all .2s; }
.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(0,0,0,.45);
}
.sidebar-overlay.active { display: block; }

.main { padding: 40px 48px 60px; max-width: 1200px; }
.pageheader {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.pageheader h1 { font-size: 38px; }
.pageheader .eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 8px; }

/* ---------- CARDS ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-1);
}
.card h3 { font-size: 18px; margin-bottom: 16px; }
.card + .card { margin-top: 20px; }

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

/* ---------- STAT CARD ---------- */
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}
.stat .label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.stat .value { font-family: var(--f-display); font-size: 40px; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.stat .delta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.stat.accent { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.stat.accent .label { color: rgba(255,255,255,.5); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--cream);
  padding: 11px 18px; border-radius: var(--r-md);
  font-family: var(--f-body); font-weight: 500; font-size: 14px;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform .15s, background .15s;
}
.btn:hover { background: var(--ink-2); transform: translateY(-1px); text-decoration: none; }
.btn.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line-2); }
.btn.secondary:hover { background: var(--cream-2); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #A2191F; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.lg { padding: 14px 24px; font-size: 15px; }
.btn.full { width: 100%; justify-content: center; }

/* ---------- TABLE ---------- */
table.t {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.t th {
  text-align: left; font-weight: 500; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
}
table.t td {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.t tr:hover td { background: var(--cream); }

/* ---------- BADGES ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: .05em;
  background: var(--cream-2); color: var(--ink-2); border: 1px solid var(--line-2);
}
.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(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.info    { background: #EBF2F9; color: #0C4A6E; border-color: transparent; }

/* ---------- FORMS ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-2); background: var(--paper);
  border-radius: var(--r-md);
  font-family: var(--f-body); font-size: 14px; color: var(--ink);
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(11,18,32,.08);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ---------- ALERTS ---------- */
.alert { padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 20px; font-size: 14px; }
.alert.success { background: var(--success-soft); color: var(--success); border-left: 3px solid var(--success); }
.alert.error   { background: var(--accent-soft); color: var(--accent); border-left: 3px solid var(--accent); }
.alert.info    { background: #EBF2F9; color: #0C4A6E; border-left: 3px solid #0C4A6E; }

/* ---------- AUTH PAGES ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--cream);
}
.auth-panel {
  background: var(--ink);
  color: var(--cream);
  padding: 48px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-panel::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 110% -10%, rgba(193,39,45,.2), transparent 60%),
    radial-gradient(500px 300px at -20% 110%, rgba(255,255,255,.05), transparent 50%);
  pointer-events: none;
}
.auth-panel .brand { font-family: var(--f-display); font-size: 32px; font-weight: 600; position: relative; }
.auth-panel .brand .dot { color: var(--accent); }
.auth-panel .quote {
  font-family: var(--f-display); font-size: 28px; line-height: 1.35;
  font-weight: 400; font-style: italic; letter-spacing: -.01em;
  max-width: 420px; position: relative;
}
.auth-panel .quote::before {
  content: '"'; position: absolute; left: -30px; top: -20px;
  font-size: 80px; color: var(--accent); opacity: .4;
}
.auth-panel .foot { font-size: 12px; opacity: .5; letter-spacing: .1em; text-transform: uppercase; position: relative; }
.auth-form {
  padding: 48px;
  display: flex; align-items: center; justify-content: center;
}
.auth-form-inner { width: 100%; max-width: 420px; }
.auth-form h1 { font-size: 40px; margin-bottom: 8px; }
.auth-form .sub { color: var(--muted); margin-bottom: 32px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-panel { display: none; } }

/* ---------- RESPONSIVE: TABLET ---------- */
@media (max-width: 900px) {
  .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 .25s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { padding: 24px 20px 48px; margin-top: 60px; max-width: 100%; }
  .pageheader { flex-wrap: wrap; gap: 10px; align-items: flex-start; }
  .pageheader h1 { font-size: 28px; }
  h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .row-split { flex-wrap: wrap; gap: 10px; }
  .dow-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  table.t { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stat .value { font-size: 30px; }
}

/* ---------- RESPONSIVE: MOBILE ---------- */
@media (max-width: 480px) {
  .nav-toggle { top: 8px; left: 8px; }
  .main { padding: 16px 12px 40px; margin-top: 56px; }
  .pageheader h1 { font-size: 22px; }
  h1 { font-size: 26px; }
  .btn { font-size: 13px; padding: 9px 14px; }
  .card { padding: 16px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 26px; }
  .landing .hero h1 { font-size: 36px; }
  .landing { padding: 48px 16px; }
  .feat-grid { grid-template-columns: 1fr; }
  .landing nav .links { display: none; }
  .auth-form { padding: 24px 20px; }
  .auth-form-inner { max-width: 100%; }
}

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

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

/* Misc */
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.sp { flex: 1; }
.row-split { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-3 { margin-top: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

code.inline { background: var(--cream-2); padding: 2px 6px; border-radius: 4px; font-family: var(--f-mono); font-size: 12px; }

/* Marketing / landing */
.landing { max-width: 1100px; margin: 0 auto; padding: 80px 40px; }
.landing .hero h1 { font-size: 80px; line-height: 0.95; letter-spacing: -.035em; max-width: 900px; }
.landing .hero h1 em { font-style: italic; color: var(--accent); }
.landing .hero .lede { font-size: 20px; color: var(--muted); max-width: 600px; margin: 20px 0 32px; line-height: 1.5; }
.landing nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 80px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.landing nav .brand { font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.landing nav .brand .dot { color: var(--accent); }
.landing nav .links { display: flex; gap: 28px; font-size: 14px; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 60px; }
.feat { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.feat .num { font-family: var(--f-display); font-size: 14px; color: var(--accent); letter-spacing: .1em; margin-bottom: 12px; }
.feat h3 { font-size: 22px; margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---------- PUBLIC CLINIC / DOCTOR PAGES ---------- */
body.public-page {
  background:
    radial-gradient(700px 360px at 100% 0%, var(--public-hero-glow), transparent 55%),
    radial-gradient(520px 280px at 0% 0%, rgba(255,255,255,.55), transparent 48%),
    var(--cream);
  color: var(--ink);
}
body.public-page h1,
body.public-page h2,
body.public-page h3 { color: var(--ink); }
body.public-theme-simple { --public-frame-radius: 22px; }
body.public-theme-elegant {
  --public-frame-radius: 30px;
  --public-card-lift: translateY(-2px);
}
body.public-theme-classic {
  --public-frame-radius: 20px;
}
body.public-theme-funky {
  --public-frame-radius: 28px;
  --public-card-lift: translateY(-4px) rotate(-1deg);
}
body.public-theme-modern {
  --public-frame-radius: 26px;
  --public-card-lift: translateY(-3px);
}
.public-wrap { max-width: 1160px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 28px) 88px; }
.public-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: var(--public-topbar-bg);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(14px);
}
.public-topbar .brand { font-family: var(--f-display); font-size: 20px; font-weight: 600; }
.public-topbar .brand .dot { color: var(--accent); }
.public-theme-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--public-accent-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.public-section-head { margin-bottom: 18px; }
.public-section-head.compact { margin-bottom: 0; }
.public-section-head h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 0; }
.clinic-hero,
.doctor-hero {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: clamp(20px, 4vw, 38px);
  align-items: start;
  padding: clamp(24px, 4vw, 42px);
  margin-bottom: 34px;
  background: linear-gradient(180deg, var(--public-surface-tint), var(--paper));
  border: 1px solid var(--line);
  border-radius: var(--public-frame-radius, 24px);
  box-shadow: var(--public-card-shadow);
}
.clinic-hero-img {
  width: min(100%, 160px); aspect-ratio: 1;
  border-radius: calc(var(--public-frame-radius, 24px) - 6px);
  object-fit: cover; flex-shrink: 0;
  background: var(--cream-2); display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: clamp(42px, 5vw, 54px); font-weight: 600; color: var(--ink-3);
  border: 1px solid var(--line);
}
.clinic-hero-info h1 { font-size: clamp(32px, 4.6vw, 48px); margin-bottom: 10px; }
.clinic-hero-info .clinic-city { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.clinic-hero-info .clinic-desc { color: var(--ink); font-size: 15px; line-height: 1.75; max-width: 680px; }
.doctor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.doctor-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: calc(var(--public-frame-radius, 24px) - 8px);
  padding: 24px; text-align: center;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  box-shadow: 0 8px 22px rgba(11,18,32,.04);
}
.doctor-card:hover {
  box-shadow: var(--public-card-shadow);
  transform: var(--public-card-lift, translateY(-2px));
  border-color: var(--accent);
  text-decoration: none;
}
.doctor-card-avatar {
  width: 82px; height: 82px; border-radius: 50%; margin: 0 auto 14px;
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--f-display); font-size: 28px; font-weight: 600;
  border: 2px solid var(--line);
}
.doctor-card h3 { font-size: 18px; margin-bottom: 4px; }
.doctor-card .spec { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.doctor-card .qual { font-size: 12px; color: var(--muted-2); }
.doctor-card .book-btn {
  display: inline-block; margin-top: 14px;
  background: linear-gradient(135deg, var(--public-gradient-a), var(--public-gradient-b)); color: #fff;
  padding: 9px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 20px rgba(0,0,0,.10);
}
.doctor-hero-img {
  width: min(100%, 170px); aspect-ratio: 1;
  border-radius: 50%; flex-shrink: 0;
  object-fit: cover; border: 3px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), var(--public-accent-soft-alt));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: clamp(44px, 5vw, 58px); font-weight: 600; color: var(--accent);
}
.doctor-hero-info h1 { font-size: clamp(30px, 4.3vw, 44px); margin-bottom: 6px; }
.doctor-hero-info .spec-tag { font-size: 15px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.doctor-hero-info .qual-tag { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.doctor-hero-info .clinic-link { font-size: 14px; color: var(--muted); }
.doctor-bio-section { margin-bottom: 32px; }
.doctor-bio-section h2 { font-size: 22px; margin-bottom: 12px; }
.doctor-bio-section p { font-size: 15px; line-height: 1.8; color: var(--ink); }
.expertise-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.expertise-tag {
  background: var(--cream-2); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; color: var(--ink-2);
}
.fee-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--success-soft); color: var(--success);
  border-radius: 999px; padding: 6px 14px;
  font-size: 14px; font-weight: 600; margin-top: 10px;
}

/* Public-page minimal header (no DoctorAppointments branding). */
.public-minimal-bar {
  display: flex; justify-content: flex-end;
  padding: 14px clamp(16px, 3vw, 28px) 0;
}

/* "Powered by DoctorAppointments" pill — fixed bottom-right of public pages. */
.powered-by-pill {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  background: rgba(255,255,255,.92); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  box-shadow: 0 6px 18px rgba(11,18,32,.08);
  text-decoration: none;
  backdrop-filter: blur(10px);
}
.powered-by-pill:hover { text-decoration: none; border-color: var(--accent); }
.powered-by-pill strong { color: var(--accent); font-weight: 600; }

/* Clinic gallery + Google maps embed */
.clinic-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
  margin: 24px 0 32px;
}
.clinic-gallery img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: var(--public-frame-radius, 24px);
  border: 1px solid var(--line);
  background: var(--cream-2);
}
.clinic-map-wrap {
  margin: 24px 0 32px;
  border-radius: var(--public-frame-radius, 24px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream-2);
}
.clinic-map-wrap iframe { display: block; width: 100%; height: 360px; 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(--public-accent-strong);
  font-size: 13px; font-weight: 600; margin-top: 10px;
}

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

/* Doctor multi-location list */
.doctor-locations { display: grid; gap: 14px; margin: 18px 0 28px; }
.doctor-location {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  background: var(--paper);
}
.doctor-location h4 { font-size: 16px; margin: 0 0 4px; font-family: var(--f-display); }
.doctor-location .loc-addr { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.doctor-location .loc-hours { font-size: 14px; color: var(--ink-2); }
.doctor-location .loc-hours span { display: inline-block; margin-right: 12px; }

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 18px 45px rgba(34,26,18,.08);
}
body.public-theme-elegant .doctor-card .book-btn {
  border-radius: 12px;
}
body.public-theme-classic .public-topbar {
  box-shadow: 0 6px 18px rgba(16,35,63,.06);
}
body.public-theme-classic .doctor-card,
body.public-theme-classic .clinic-hero,
body.public-theme-classic .doctor-hero {
  background: linear-gradient(180deg, #FFFFFF, #F9FBFE);
}
body.public-theme-funky .clinic-hero,
body.public-theme-funky .doctor-hero {
  background:
    radial-gradient(260px 120px at 100% 0%, rgba(255,255,255,.45), transparent 60%),
    linear-gradient(135deg, var(--public-surface-tint), #fff 56%);
}
body.public-theme-funky .doctor-card:nth-child(2n) {
  transform: rotate(.8deg);
}
body.public-theme-funky .doctor-card:hover {
  transform: translateY(-5px) rotate(-.6deg);
}
body.public-theme-modern .public-topbar {
  border-bottom-color: rgba(255,255,255,.55);
}
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)),
    linear-gradient(135deg, var(--public-gradient-a), var(--public-gradient-b));
  backdrop-filter: blur(14px);
}
body.public-theme-modern .doctor-card {
  background: rgba(255,255,255,.92);
}

/* Copyable code block */
.embed-code-wrap { position: relative; margin-top: 8px; }
.embed-code-wrap pre {
  background: var(--ink); color: var(--cream);
  border-radius: var(--r-md); padding: 14px 16px;
  font-family: var(--f-mono); font-size: 12px;
  overflow-x: auto; white-space: pre; margin: 0;
  line-height: 1.6;
}
.embed-code-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.1); color: var(--cream);
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-sm);
  padding: 4px 10px; font-size: 11px; cursor: pointer;
  font-family: var(--f-body); transition: background .15s;
}
.embed-code-copy:hover { background: rgba(255,255,255,.2); }
.embed-code-copy.copied { background: var(--success); color: #fff; border-color: var(--success); }
.palette-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.palette-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-2);
}
.palette-chip.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.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(10px, 2vw, 20px); background: transparent; min-height: 100vh; }

@media (max-width: 960px) {
  .doctor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clinic-hero,
  .doctor-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .clinic-hero-info,
  .doctor-hero-info { max-width: 760px; }
  .clinic-hero-info .clinic-desc { margin: 0 auto; }
  .expertise-tags { justify-content: center; }
}
@media (max-width: 720px) {
  .public-topbar { flex-wrap: wrap; }
  .doctor-grid { grid-template-columns: 1fr; }
  .embed-code-wrap { display: grid; gap: 8px; }
  .embed-code-copy { position: static; justify-self: start; }
  .grid-2 .calendoc-embed { margin-left: 0; margin-right: 0; }
}
@media (max-width: 520px) {
  .public-wrap { padding: 18px 14px 56px; }
  .clinic-hero,
  .doctor-hero { padding: 18px; }
  .public-section-head h2 { font-size: 22px; }
  .public-theme-badge { font-size: 11px; letter-spacing: .06em; }
  .doctor-card { padding: 18px; }
  .palette-swatches { gap: 8px; }
  .palette-chip { width: 100%; justify-content: flex-start; }
}
