@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&subset=cyrillic,latin&display=swap');

/* ==========================================================================
   CURAT.CLINIC — DESIGN SYSTEM "CLINICAL EDITORIAL"
   Ink green + bone white + ember accent. Unified Manrope geometric font
   for 100% identical Ukrainian & English typography.
   ========================================================================== */
:root {
  /* Core palette */
  --ink: #0B1F1E;
  --ink-2: #12302E;
  --ink-3: #1D4543;
  --teal: #0E7C72;
  --teal-2: #0A5E57;
  --teal-soft: #E2F0EC;
  --ember: #E2553A;
  --ember-2: #C7442B;
  --ember-soft: #FCEBE5;
  --bone: #F7F5F0;
  --paper: #FFFFFF;
  --sand: #EFEBE2;
  --line: #E3DED3;
  --line-2: #D3CDC0;
  --muted: #5F6B69;
  --body: #2A3735;

  /* Compatibility tokens (used by app.js inline styles & portal pages) */
  --bg-main: var(--bone);
  --bg-alt: var(--sand);
  --bg-card: var(--paper);
  --navy-deep: var(--ink);
  --navy-primary: var(--ink-2);
  --navy-dark: #061312;
  --navy-muted: var(--ink-3);
  --blue-accent: var(--teal);
  --blue-bright: #14A394;
  --blue-hover: var(--teal-2);
  --blue-soft: var(--teal-soft);
  --gold-luxury: #C9A45C;
  --gold-light: #E3C88F;
  --gold-soft: #FBF5E8;
  --green-ok: #0F8A5F;
  --green-success: #12A170;
  --green-soft: #E5F5EE;
  --amber-warn: #C27C0E;
  --amber-soft: #FDF4E1;
  --red-danger: #C93A2B;
  --red-soft: #FCECE9;
  --text-main: var(--ink);
  --text-body: var(--body);
  --text-muted: var(--muted);
  --border-color: var(--line);
  --border-strong: var(--line-2);

  /* Unified font family for Ukrainian & English (no font switching between languages) */
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shape & depth */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 30, 0.04), 0 4px 14px -4px rgba(11, 31, 30, 0.06);
  --shadow-md: 0 2px 6px rgba(11, 31, 30, 0.04), 0 18px 40px -16px rgba(11, 31, 30, 0.16);
  --shadow-lg: 0 4px 10px rgba(11, 31, 30, 0.04), 0 40px 80px -30px rgba(11, 31, 30, 0.30);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  max-width: 100%;
  width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y pinch-zoom;
}

main, .section, .site-footer, .hero, .marquee {
  max-width: 100%;
  overflow-x: clip;
}

img, svg { max-width: 100%; display: inline-block; vertical-align: middle; }
a { color: var(--teal); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--teal-2); }
code, .mono { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-weight: 600; }
code { font-size: 0.92em; }
::selection { background: var(--ember); color: #fff; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.muted { color: var(--muted); }
.muted-light { color: rgba(255, 255, 255, 0.6); }
.break { word-break: break-all; }

@media (max-width: 768px) {
  .container { padding: 0 18px; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   MOTION
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(18, 161, 112, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(18, 161, 112, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 161, 112, 0); }
}
@keyframes drift-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.12); } }
@keyframes drift-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-50px, 30px) scale(0.92); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes underline-draw { from { background-size: 0% 0.12em; } to { background-size: 100% 0.12em; } }

/* Scroll reveal (enabled only when JS is running; content stays visible without JS) */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

.pulse-dot, .live-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-success);
  display: inline-block; flex-shrink: 0;
  animation: pulse-ring 2.2s infinite;
}

/* ==========================================================================
   TYPOGRAPHY PRIMITIVES
   ========================================================================== */
.eyebrow, .section-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}
.eyebrow::before, .section-kicker::before {
  content: ''; width: 22px; height: 1.5px; background: currentColor; opacity: 0.6;
}
.eyebrow-light { color: var(--gold-light); }

.section-title, .section-header h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  color: inherit;
  font-variation-settings: 'opsz' 96;
}
.section-lead, .section-header p {
  color: var(--muted);
  font-size: 17px;
  max-width: 60ch;
  margin: 16px 0 0;
}

/* ==========================================================================
   HEADER — floating glass bar
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  padding: 12px 20px 0;
  pointer-events: none;
}
.header-inner {
  pointer-events: auto;
  max-width: 1280px; margin: 0 auto;
  height: 60px;
  padding: 0 10px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid rgba(227, 222, 211, 0.9);
  border-radius: 999px;
  box-shadow: 0 6px 24px -12px rgba(11, 31, 30, 0.18);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled .header-inner {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px -14px rgba(11, 31, 30, 0.28);
}

.brand-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); white-space: nowrap; flex-shrink: 0;
}
.brand-logo:hover { color: var(--ink); }
.brand-logo-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.5s var(--ease), background 0.3s;
}
.brand-logo:hover .brand-logo-mark { transform: rotate(90deg); background: var(--ember); }
.brand-word, .brand-logo > span:last-child {
  font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: -0.01em;
}
.dot { color: var(--ember); }

.header-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.header-nav a {
  color: var(--body); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.header-nav a:hover, .header-nav a.active { background: var(--sand); color: var(--ink); }
.header-nav .badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-link-cabinet { font-size: 14px; font-weight: 700; color: var(--ink); padding: 8px 12px; }
.header-link-cabinet:hover { color: var(--ember); }

.lang-switch {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--sand); flex-shrink: 0;
}
.lang-btn {
  border: 0; background: transparent; cursor: pointer;
  font: 700 11px/1 var(--font-ui); letter-spacing: 0.06em;
  color: var(--muted); padding: 7px 10px; border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.lang-btn.active { background: var(--ink); color: #fff; }

.header-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--ember); color: #fff !important;
  font: 700 14px/1 var(--font-ui); cursor: pointer; white-space: nowrap;
  transition: background 0.2s, transform 0.3s var(--ease);
}
.header-cta-btn:hover { background: var(--ember-2); transform: translateY(-1px); }
.header-cta-btn svg { transition: transform 0.3s var(--ease); }
.header-cta-btn:hover svg { transform: translateX(3px); }

.burger-btn {
  display: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

.mobile-menu-drawer {
  pointer-events: auto;
  display: none;
  max-width: 1280px; margin: 10px auto 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px; box-shadow: var(--shadow-lg);
  animation: rise 0.35s var(--ease);
}
.mobile-menu-drawer.open { display: block; }
.mobile-menu-links { display: grid; gap: 2px; }
.mobile-menu-links a, .mobile-menu-links button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; padding: 14px 14px;
  border: 0; border-radius: 12px; background: transparent;
  font: 600 16px/1.3 var(--font-ui); color: var(--ink); cursor: pointer;
}
.mobile-menu-links a::after, .mobile-menu-links button::after { content: '→'; color: var(--muted); }
.mobile-menu-links a:hover, .mobile-menu-links button:hover { background: var(--bone); }
.mobile-menu-phones {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mobile-menu-phones strong { width: 100%; font-size: 12px; color: var(--muted); }
.mobile-menu-phones a {
  font: 700 14px/1 var(--font-mono); color: var(--ink);
  background: var(--bone); padding: 10px 12px; border-radius: 999px;
}

@media (max-width: 1080px) {
  .header-nav { display: none; }
  .burger-btn { display: inline-flex; }
}
@media (max-width: 640px) {
  .site-header { padding: 8px 10px 0; }
  .header-inner { height: 56px; padding: 0 6px 0 14px; border-radius: 18px; gap: 8px; }
  .header-link-cabinet { display: none; }
  .brand-word, .brand-logo > span:last-child { font-size: 18px; }
  .brand-logo-mark { width: 30px; height: 30px; }
  .header-cta-btn { height: 38px; padding: 0 14px; font-size: 13px; }
  .header-cta-btn svg { display: none; }
  .lang-btn { padding: 6px 8px; }
  .burger-btn { width: 38px; height: 38px; }
}
@media (max-width: 380px) {
  .brand-logo-mark { display: none; }
  .lang-switch { display: none; }
}

/* ==========================================================================
   BUTTONS, CHIPS, BADGES
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 999px;
  font: 700 14px/1.2 var(--font-ui); text-align: center;
  cursor: pointer; white-space: normal; max-width: 100%;
  transition: background 0.25s var(--ease), color 0.25s, border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { transition: transform 0.3s var(--ease); flex-shrink: 0; }
.btn:hover svg { transform: translateX(3px); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 15px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-ember { background: var(--ember); color: #fff !important; box-shadow: 0 10px 24px -12px rgba(226, 85, 58, 0.7); }
.btn-ember:hover { background: var(--ember-2); }
.btn-ink, .btn-navy { background: var(--ink); color: #fff !important; }
.btn-ink:hover, .btn-navy:hover { background: var(--ink-3); }
.btn-primary { background: var(--teal); color: #fff !important; }
.btn-primary:hover { background: var(--teal-2); }
.btn-ghost, .btn-outline { background: transparent; color: var(--ink) !important; border-color: var(--line-2); }
.btn-ghost:hover, .btn-outline:hover { border-color: var(--ink); background: rgba(11, 31, 30, 0.03); }
.btn-success { background: var(--green-ok); color: #fff !important; }
.btn-success:hover { background: #0B6E4C; }
.btn-danger { background: var(--red-danger); color: #fff !important; }
.btn-gold { background: var(--gold-luxury); color: var(--ink) !important; }
.btn-gold:hover { background: #B8914A; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn-light { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.icon-btn-light:hover { border-color: #fff; }
.link-btn { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: var(--bone); color: var(--ink);
}
.chip-live { background: var(--green-soft); color: #0B6E4C; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1.3;
  border: 1px solid transparent;
}
.badge-blue { background: var(--teal-soft); color: var(--teal-2); }
.badge-green { background: var(--green-soft); color: #0B6E4C; }
.badge-amber { background: var(--amber-soft); color: #8F5A06; }
.badge-red { background: var(--red-soft); color: #A42D20; }
.badge-navy { background: var(--ink); color: #fff; }
.badge-gold { background: var(--gold-soft); color: #7C5C1B; border-color: rgba(201, 164, 92, 0.45); }

.slot-chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 14px;
  font: 600 13px/1.2 var(--font-ui); cursor: pointer;
  transition: all 0.2s var(--ease);
}
.slot-chip:hover { border-color: var(--ink); }
.slot-chip.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.slot-chip:disabled { background: transparent; color: #A9B1AF; border-color: var(--line); text-decoration: line-through; cursor: not-allowed; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot-grid .slot-chip { font-family: var(--font-mono); text-align: center; padding: 10px 6px; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  padding: 64px 0 88px;
  overflow: hidden;
}
.hero-ambient { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; }
.blob-a { width: 520px; height: 520px; background: #CFE7E0; top: -160px; left: -120px; animation: drift-a 18s ease-in-out infinite; }
.blob-b { width: 420px; height: 420px; background: #F8D6CB; top: 80px; right: -120px; animation: drift-b 22s ease-in-out infinite; }
.blob-c { width: 360px; height: 360px; background: #EFE6D3; bottom: -160px; left: 40%; animation: drift-a 26s ease-in-out infinite reverse; }

.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 64px; align-items: center;
}
.hero-copy .eyebrow { color: var(--ink); background: rgba(255, 255, 255, 0.7); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); }
.hero-copy .eyebrow::before { display: none; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 5.6vw, 82px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 8px 0 0;
  font-variation-settings: 'opsz' 144;
}
.hero-title em {
  font-style: italic; color: var(--ember);
  background-image: linear-gradient(var(--ember), var(--ember));
  background-repeat: no-repeat; background-position: 0 92%;
  background-size: 100% 0.08em;
  animation: underline-draw 1.4s 0.6s var(--ease) both;
}
.hero-lead { font-size: clamp(16px, 1.4vw, 19px); color: var(--body); max-width: 54ch; margin: 28px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-trust {
  list-style: none; padding: 0; margin: 40px 0 0;
  display: flex; flex-wrap: wrap; gap: 10px 28px;
}
.hero-trust li { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.hero-trust svg { color: var(--teal); }
.hero-footnote { font-size: 12px; color: var(--muted); margin: 18px 0 0; }

.hero-doctor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
}
.hero-doctor::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, rgba(226, 85, 58, 0.35), transparent 30%, transparent 70%, rgba(14, 124, 114, 0.35)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  border: 1px solid transparent;
}
.hero-doctor-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-doctor-nav { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.hero-doctor-id { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
.hero-doctor .hero-doctor-photo { width: 96px; height: 96px; border-radius: 22px; }
.hero-doctor-meta h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.hero-doctor-spec { font-size: 14px; color: var(--teal); font-weight: 700; margin-top: 4px; }
.hero-doctor-price { margin-top: 8px; font-size: 13px; }
.hero-doctor-price .mono { font-weight: 700; font-size: 15px; color: var(--ink); }
.hero-doctor-bio {
  margin: 0; font-size: 14px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-doctor-slots { background: var(--bone); border-radius: var(--r-md); padding: 14px; }
.hero-doctor-slots-label { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }

.doctor-photo-square {
  width: 120px; height: 120px; aspect-ratio: 1 / 1; overflow: hidden; flex-shrink: 0;
  border-radius: 20px; background: var(--ink);
}
.doctor-photo-square img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 1024px) {
  .hero { padding: 40px 0 64px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-doctor { max-width: 560px; }
}
@media (max-width: 640px) {
  .hero { padding: 28px 0 48px; }
  .hero-title { font-size: clamp(38px, 11vw, 54px); }
  .hero-lead { margin-top: 20px; }
  .hero-actions { margin-top: 28px; }
  .hero-actions .btn { width: 100%; }
  .hero-trust { margin-top: 28px; flex-direction: column; gap: 12px; }
  .hero-doctor { padding: 18px; border-radius: var(--r-lg); }
  .hero-doctor-id { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; }
  .hero-doctor .hero-doctor-photo { width: 76px; height: 76px; border-radius: 18px; }
  .hero-copy .eyebrow { font-size: 10.5px; letter-spacing: 0.08em; padding: 7px 12px; }
  .hero-doctor-meta h3 { font-size: 19px; }
  .blob { filter: blur(50px); opacity: 0.45; }
}

/* ==========================================================================
   MARQUEE
   ========================================================================== */
.marquee {
  background: var(--ink); color: #fff;
  overflow: hidden; padding: 22px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; align-items: center; gap: 28px; width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px); white-space: nowrap; letter-spacing: -0.01em;
}
.marquee-track i { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); flex-shrink: 0; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding: 120px 0; position: relative; }
.section-paper { background: var(--paper); }
.section-ink { background: var(--ink); color: #fff; }
.section-ink .section-lead { color: rgba(255, 255, 255, 0.65); }
.section-head { margin-bottom: 56px; max-width: 820px; }
.section-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 32px;
}
.section-header h2 { font-size: clamp(26px, 3.2vw, 40px); }
.section-header p { font-size: 15px; margin-top: 10px; }
.section-alt { background: var(--paper); }

@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .section-lead { font-size: 16px; }
}

/* Bento programs */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}
.bento-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  border-radius: var(--r-xl); padding: 36px;
  color: inherit; min-height: 260px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.bento-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: inherit; }
.bento-card h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -0.015em; margin: 0; }
.bento-card p { margin: 0; font-size: 15px; opacity: 0.8; max-width: 46ch; }
.bento-tag {
  align-self: flex-start;
  font: 700 13px/1 var(--font-mono);
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.bento-link { margin-top: auto; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; padding-top: 12px; }
.bento-link svg { transition: transform 0.3s var(--ease); }
.bento-card:hover .bento-link svg { transform: translateX(5px); }

.bento-dark { grid-row: span 2; background: var(--ink); color: #fff; min-height: 540px; }
.bento-dark h3 { margin-top: auto; }
.bento-dark:hover { color: #fff; }
.bento-dark::before {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  right: -180px; top: -180px;
  background: radial-gradient(circle, rgba(14, 124, 114, 0.55), transparent 65%);
}
.bento-dark .bento-tag { position: relative; background: var(--ember); color: #fff; }
.bento-dark > * { position: relative; }
.bento-dark h3 { font-size: clamp(28px, 3vw, 44px); max-width: 16ch; }
.bento-ember { background: var(--ember); color: #fff; }
.bento-ember:hover { color: #fff; }
.bento-ember .bento-tag { background: rgba(255, 255, 255, 0.2); }
.bento-paper { background: #fff; border: 1px solid var(--line); }
.bento-paper .bento-link { color: var(--teal); }

.doc-visual { position: absolute; right: 28px; top: 28px; }
.doc-sheet {
  width: 92px; height: 120px; background: var(--bone); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px;
  transform: rotate(6deg); box-shadow: var(--shadow-md); position: relative;
  transition: transform 0.5s var(--ease);
}
.bento-paper:hover .doc-sheet { transform: rotate(0deg) translateY(-4px); }
.doc-line { height: 4px; border-radius: 2px; background: var(--line-2); }
.w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; } .w90 { width: 90%; }
.doc-qr {
  position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px;
  background:
    linear-gradient(90deg, var(--ink) 50%, transparent 50%) 0 0 / 6px 6px,
    linear-gradient(var(--ink) 50%, transparent 50%) 0 0 / 6px 6px;
  border-radius: 3px; opacity: 0.85;
}
.bento-paper h3 { max-width: 12ch; }

@media (max-width: 900px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento-dark { grid-row: auto; min-height: 380px; }
  .bento-card { padding: 28px; min-height: 0; }
}

/* How it works */
.section-ink::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000, transparent 70%);
          mask-image: radial-gradient(ellipse at 30% 20%, #000, transparent 70%);
}
.section-ink .container { position: relative; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.step { position: relative; padding-top: 28px; }
.step::before {
  content: ''; position: absolute; top: 0; left: 0; height: 2px; width: 100%;
  background: rgba(255, 255, 255, 0.15);
}
.step::after {
  content: ''; position: absolute; top: 0; left: 0; height: 2px; width: 0;
  background: var(--ember); transition: width 1.2s var(--ease) 0.2s;
}
.step.is-visible::after { width: 100%; }
.step-num {
  display: block;
  font-family: var(--font-display); font-weight: 400; font-size: 72px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.55);
  margin-bottom: 20px; letter-spacing: -0.03em;
}
.step h3 { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.step p { margin: 0; font-size: 15px; color: rgba(255, 255, 255, 0.65); }
.steps .step:nth-child(2) { transition-delay: 0.08s; }
.steps .step:nth-child(3) { transition-delay: 0.16s; }
.steps .step:nth-child(4) { transition-delay: 0.24s; }

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .step-num { font-size: 56px; margin-bottom: 12px; }
}

/* ==========================================================================
   TRIAGE
   ========================================================================== */
.triage-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 32px; align-items: start; }
.triage-steps { display: flex; flex-direction: column; gap: 16px; }
.triage-block { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.triage-block-head { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; margin-bottom: 18px; }
.triage-n {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; font: 700 13px/1 var(--font-mono);
}
.triage-zone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.triage-zone-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bone); color: var(--ink);
  font: 700 14px/1.25 var(--font-ui); text-align: left; cursor: pointer;
  transition: all 0.25s var(--ease);
}
.triage-zone-btn svg { color: var(--teal); }
.triage-zone-btn:hover { border-color: var(--ink); background: #fff; }
.triage-zone-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.triage-zone-btn.active svg { color: var(--ember); }

.range-row + .range-row { margin-top: 22px; }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; color: var(--body); }
.vas-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 16px 0 4px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, #8FCFB8 0%, #F2C26B 50%, var(--ember) 100%);
}
.vas-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ink);
  box-shadow: 0 4px 12px rgba(11, 31, 30, 0.25);
  transition: transform 0.2s var(--ease);
}
.vas-slider::-webkit-slider-thumb:active { transform: scale(1.15); }
.vas-slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }

.triage-result {
  position: sticky; top: calc(var(--header-h) + 20px);
  background: var(--ink); color: #fff;
  border-radius: var(--r-xl); padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-lg);
}
.triage-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.triage-result-head .eyebrow { margin: 0; }
.triage-result-body {
  font-family: var(--font-display); font-size: 18px; line-height: 1.5; font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}
.triage-result-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px; color: rgba(255, 255, 255, 0.6);
}
.triage-result-meta strong { color: var(--gold-light); font-size: 15px; }
.triage-disclaimer { margin: 0; font-size: 12px; color: rgba(255, 255, 255, 0.5); }

/* Legacy triage shell (other pages) */
.triage-shell { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; }

@media (max-width: 1024px) {
  .triage-layout { grid-template-columns: minmax(0, 1fr); }
  .triage-result { position: static; }
}
@media (max-width: 560px) {
  .triage-zone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .triage-block { padding: 18px; }
  .triage-zone-btn { padding: 14px 12px; gap: 10px; font-size: 13px; }
  .triage-result { padding: 22px; border-radius: var(--r-lg); }
  .triage-result-body { font-size: 16px; }
}

/* ==========================================================================
   DIRECTIONS — editorial accordion
   ========================================================================== */
.dir-layout { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }
.sticky-head { position: sticky; top: calc(var(--header-h) + 32px); margin-bottom: 0; }
.sticky-head .btn { margin-top: 28px; }
.dir-list { border-top: 1px solid var(--line); }
.dir-item { border-bottom: 1px solid var(--line); }
.dir-item summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 28px; align-items: center; gap: 16px;
  padding: 26px 0;
}
.dir-item summary::-webkit-details-marker { display: none; }
.dir-num { font: 500 13px/1 var(--font-mono); color: var(--muted); }
.dir-title {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 2vw, 27px);
  line-height: 1.2; letter-spacing: -0.01em; transition: color 0.2s, transform 0.4s var(--ease);
}
.dir-item summary:hover .dir-title { color: var(--ember); transform: translateX(4px); }
.dir-code { font-size: 12px; color: var(--teal-2); background: var(--teal-soft); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.dir-chevron { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); transition: transform 0.4s var(--ease), background 0.2s; }
.dir-chevron::before, .dir-chevron::after { content: ''; position: absolute; top: 50%; left: 50%; width: 10px; height: 1.5px; background: var(--ink); transform: translate(-50%, -50%); }
.dir-chevron::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.4s var(--ease); }
.dir-item[open] .dir-chevron { background: var(--ink); border-color: var(--ink); }
.dir-item[open] .dir-chevron::before, .dir-item[open] .dir-chevron::after { background: #fff; }
.dir-item[open] .dir-chevron::after { transform: translate(-50%, -50%) rotate(0deg); }
.dir-body { padding: 0 0 28px 60px; animation: rise 0.45s var(--ease); }
.dir-body p { margin: 0 0 18px; color: var(--muted); max-width: 58ch; }

@media (max-width: 960px) {
  .dir-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .sticky-head { position: static; }
}
@media (max-width: 560px) {
  .dir-item summary { grid-template-columns: 30px minmax(0, 1fr) 28px; gap: 12px; padding: 20px 0; }
  .dir-code { display: none; }
  .dir-body { padding-left: 42px; }
}

/* ==========================================================================
   DOCTORS GRID (cards rendered by app.js)
   ========================================================================== */
.doctors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.doctors-grid .med-card { border-radius: var(--r-xl); padding: 28px; }
.doctors-grid .med-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px !important; }
@media (max-width: 400px) { .doctors-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   BOOKING
   ========================================================================== */
.booking-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: stretch; }
.booking-aside {
  background: var(--ink); color: #fff; border-radius: var(--r-xl); padding: 40px;
  display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden;
}
.booking-aside::after {
  content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  left: -120px; bottom: -160px; background: radial-gradient(circle, rgba(226, 85, 58, 0.45), transparent 65%);
}
.booking-aside > * { position: relative; z-index: 1; }
.booking-aside .eyebrow { margin: 0; }
.booking-aside p { margin: 0; color: rgba(255, 255, 255, 0.7); }
.check-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.check-list li { position: relative; padding-left: 32px; font-size: 15px; }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ember) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.booking-phones { margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-direction: column; gap: 6px; }
.booking-phones a { color: #fff; font-size: 24px; font-weight: 700; }
.booking-card { background: var(--bone); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 36px; min-width: 0; max-width: 100%; overflow-x: hidden; }
.booking-card form, .modal-card form { width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; min-width: 0; max-width: 100%; }
.form-result:empty { display: none; }
.form-result { margin: 4px 0 16px; }
.form-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; text-align: center; }

@media (max-width: 1024px) {
  .booking-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .form-row-3 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .booking-aside, .booking-card { padding: 20px 16px; border-radius: var(--r-lg); width: 100%; max-width: 100%; overflow-x: hidden; }
  .booking-phones a { font-size: 20px; }
}

/* ==========================================================================
   VERIFY & FAQ
   ========================================================================== */
.verify-band {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: end;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 48px;
}
.verify-copy .section-title { font-size: clamp(28px, 3.4vw, 44px); }
.verify-form { display: flex; gap: 10px; }
.verify-form .form-control { height: 56px; font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; }
.verify-form .btn { min-height: 56px; flex-shrink: 0; }
.verify-result:empty { display: none; }
.verify-result { margin-top: 20px; }
@media (max-width: 900px) {
  .verify-band { grid-template-columns: minmax(0, 1fr); padding: 28px; gap: 24px; border-radius: var(--r-lg); }
  .verify-form { flex-direction: column; }
}

.faq-layout { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 24px 48px 24px 0;
  font-family: var(--font-display); font-size: clamp(19px, 1.8vw, 23px); font-weight: 500; line-height: 1.3;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font: 400 28px/1 var(--font-ui); color: var(--ember); transition: transform 0.35s var(--ease);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { margin: 0 0 24px; color: var(--muted); max-width: 64ch; animation: rise 0.4s var(--ease); }
.emergency-card {
  margin-top: 32px; padding: 22px; border-radius: var(--r-lg);
  background: var(--ember-soft); border: 1px solid rgba(226, 85, 58, 0.25);
}
.emergency-card strong { display: block; font-size: 15px; margin-bottom: 8px; color: var(--ember-2); }
.emergency-card p { margin: 0 0 14px; font-size: 14px; color: var(--body); }
@media (max-width: 960px) { .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; min-width: 0; max-width: 100%; }
.form-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.form-control {
  width: 100%; max-width: 100%; min-width: 0; min-height: 48px; padding: 12px 16px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: #fff; color: var(--ink);
  font: 500 15px/1.4 var(--font-ui);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box;
}
input[type="date"].form-control {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
select.form-control {
  padding-right: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F1E' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 14px no-repeat;
}
.form-control:hover { border-color: var(--muted); }
.form-control:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11, 31, 30, 0.08); }
textarea.form-control { resize: vertical; min-height: 96px; }
.input-row { display: flex; gap: 8px; }
.input-row .form-control { flex: 1 1 auto; min-width: 0; }

.payment-notice-banner {
  background: var(--gold-soft); border: 1px solid rgba(201, 164, 92, 0.35);
  border-radius: 14px; padding: 14px 16px; font-size: 14px; color: var(--ink); margin: 14px 0;
}
.info-box { background: var(--bone); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; font-size: 14px; display: grid; gap: 4px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ==========================================================================
   GENERIC GRID & CARDS (portals, special booking, patient)
   ========================================================================== */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; align-items: stretch; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.consult-stage-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.verify-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }

@media (max-width: 1040px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consult-stage-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4, .verify-card-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
}

.med-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), border-color 0.25s, transform 0.35s var(--ease);
}
.med-card:hover { box-shadow: var(--shadow-md); }
button.med-card { font: inherit; color: inherit; cursor: pointer; }
button.med-card:hover { transform: translateY(-2px); }
.med-card h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: var(--ink); letter-spacing: -0.01em; }
.med-card p { margin: 0 0 16px; color: var(--body); font-size: 14.5px; flex: 1 1 auto; }
.med-card-icon {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-soft); color: var(--teal);
}
.med-card-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
@media (max-width: 540px) { .med-card { padding: 18px; border-radius: var(--r-md); } }

.live-status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--green-soft); color: #0B6E4C; font-size: 12px; font-weight: 700; }

/* Portal pages: main container spacing */
body:not(.page-home) main.container { padding-top: 32px !important; }
body:not(.page-home) .section { padding: 56px 0; }

/* KPI strip */
.kpi-strip, .portal-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card, .kpi-stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-card:first-child { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi-card:first-child .kpi-card-label, .kpi-card:first-child .kpi-card-sub { color: rgba(255, 255, 255, 0.6); }
.kpi-card:first-child .kpi-card-value { color: #fff; }
.kpi-card-label, .kpi-stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi-card-value, .kpi-stat-val { font-family: var(--font-display); font-size: 40px; font-weight: 500; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.kpi-card-sub { font-size: 12.5px; color: var(--muted); }
@media (max-width: 960px) { .kpi-strip, .portal-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpi-card-value { font-size: 32px; } .kpi-card { padding: 16px; } }

/* Portal tabs */
.portal-tabs {
  display: flex; gap: 4px; margin-bottom: 24px; padding: 5px;
  background: var(--sand); border-radius: 999px; overflow-x: auto; scrollbar-width: none;
}
.portal-tabs::-webkit-scrollbar { display: none; }
.portal-tab-btn {
  flex-shrink: 0; border: 0; background: transparent; cursor: pointer;
  padding: 10px 18px; border-radius: 999px;
  font: 700 13.5px/1.2 var(--font-ui); color: var(--body); white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.portal-tab-btn:hover { color: var(--ink); }
.portal-tab-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* Tables → cards on mobile */
.table-responsive { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { background: var(--bone); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(247, 245, 240, 0.6); }
@media (max-width: 720px) {
  .table-responsive { border: 0; background: transparent; overflow: visible; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tbody tr { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; margin-bottom: 12px; }
  .data-table tbody td { display: block; width: 100% !important; padding: 0; border: 0; }
}

/* ==========================================================================
   CHAT CENTER (portals) & CHAT BUBBLES
   ========================================================================== */
.chat-center-grid { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 300px); gap: 16px; min-height: 520px; }
@media (max-width: 1080px) { .chat-center-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; } }
.chat-threads-panel, .chat-dialog-panel, .chat-telemetry-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.thread-list { flex: 1 1 auto; overflow-y: auto; max-height: 440px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1080px) { .thread-list { max-height: 220px; } }
.thread-item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; transition: all 0.2s; }
.thread-item:hover, .thread-item.active { border-color: var(--ink); background: var(--bone); }
.chat-messages-box { flex: 1 1 auto; overflow-y: auto; max-height: 360px; min-height: 240px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bone); }
.chat-bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; word-break: break-word; animation: rise 0.3s var(--ease); }
.chat-bubble.client, .chat-bubble.patient { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-bubble.doctor, .chat-bubble.admin { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.chat-bubble.system { align-self: center; background: transparent; color: var(--muted); font-size: 12px; text-align: center; padding: 4px 10px; }
.chat-bubble-meta { font-size: 11px; opacity: 0.7; margin-bottom: 3px; font-weight: 700; }
.telemetry-kv-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.telemetry-kv { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.telemetry-kv span:first-child { color: var(--muted); }
.telemetry-kv span:last-child { font-weight: 700; text-align: right; word-break: break-all; }

/* ==========================================================================
   FLOATING CHAT WIDGET
   ========================================================================== */
.comm-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 1100;
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; cursor: pointer;
  font: 700 14px/1 var(--font-ui);
  box-shadow: 0 18px 40px -14px rgba(11, 31, 30, 0.6);
  transition: transform 0.35s var(--ease), background 0.2s;
}
.comm-fab:hover { transform: translateY(-3px); background: var(--ink-3); }
.comm-widget {
  position: fixed; right: 24px; bottom: 92px; z-index: 1150;
  width: 400px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 120px);
  display: none; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); animation: rise 0.35s var(--ease);
}
.comm-widget.open { display: flex; }
.comm-widget.fullscreen { inset: 0; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
.comm-widget-header { background: var(--ink); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comm-widget-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); }
.comm-widget-actions { display: flex; gap: 6px; }
.comm-widget-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px; gap: 4px; background: var(--bone); border-bottom: 1px solid var(--line); }
.comm-tab-btn { border: 0; background: transparent; padding: 9px 6px; border-radius: 999px; font: 700 12.5px/1 var(--font-ui); color: var(--muted); cursor: pointer; }
.comm-tab-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.widget-pane { padding: 18px; flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.widget-pane h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.widget-pane p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.widget-pane-chat { padding: 0; gap: 0; overflow: hidden; }
.widget-pane-video { padding: 14px; gap: 12px; display: flex; flex-direction: column; }
.widget-video-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.widget-video-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
  background: var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#widgetRemoteVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
}
#widgetLocalVideo {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #000;
  z-index: 3;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.widget-video-placeholder {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #fff;
  gap: 8px;
}
.widget-video-placeholder strong { font-size: 15px; }
.widget-video-placeholder span { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); max-width: 26ch; }
.widget-video-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-success);
  animation: pulse-ring 2s infinite;
  margin-bottom: 4px;
}
.widget-video-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.widget-visitor { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.widget-visitor .form-control { min-height: 40px; padding: 8px 12px; font-size: 13.5px; }
.widget-compose { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.widget-compose .form-control { min-height: 44px; }
.widget-compose-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }

/* Mobile dock */
.mobile-bottom-dock { display: none; }
@media (max-width: 768px) {
  .comm-fab { display: none; }
  .comm-widget.open { inset: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .mobile-bottom-dock {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 1090;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
    height: 64px; padding: 0 6px;
    background: rgba(11, 31, 30, 0.92);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-radius: 22px; box-shadow: 0 18px 40px -14px rgba(11, 31, 30, 0.55);
  }
  .mobile-dock-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    height: 100%; border: 0; background: transparent; cursor: pointer; padding: 0;
    color: rgba(255, 255, 255, 0.65) !important; font: 700 10.5px/1 var(--font-ui);
  }
  .mobile-dock-item svg { width: 20px; height: 20px; }
  .mobile-dock-item:hover, .mobile-dock-item.active { color: #fff !important; }
  .mobile-dock-primary span { display: none; }
  .mobile-dock-primary svg {
    width: 48px; height: 48px; padding: 13px; border-radius: 50%;
    background: var(--ember); color: #fff;
    box-shadow: 0 8px 20px -6px rgba(226, 85, 58, 0.8);
  }
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1200;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(11, 31, 30, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow-y: auto; overflow-x: hidden;
  width: 100%; max-width: 100%;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; overflow-x: hidden;
  background: #fff; border-radius: var(--r-xl); padding: 32px;
  box-shadow: var(--shadow-lg); animation: rise 0.4s var(--ease);
  box-sizing: border-box; min-width: 0;
}
.modal-card.modal-xl { max-width: 1000px; }
.modal-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.modal-header h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.modal-header .eyebrow { margin-bottom: 6px; }
@media (max-width: 560px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-card { width: 100%; max-width: 100%; max-height: 94dvh; border-radius: 24px 24px 0 0; padding: 20px 16px calc(22px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .modal-header h3 { font-size: 20px; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, 0.72); padding: 96px 0 40px; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.7fr); gap: 48px; }
.footer-word {
  font-family: var(--font-display); font-weight: 400; color: #fff;
  font-size: clamp(48px, 8vw, 112px); line-height: 0.95; letter-spacing: -0.04em;
}
.footer-brand p { max-width: 44ch; margin: 24px 0 0; }
.footer-chief { font-size: 14px; color: #fff; }
.footer-chief span { color: rgba(255, 255, 255, 0.55); }
.footer-col { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.footer-col strong { color: #fff; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.footer-col a { color: rgba(255, 255, 255, 0.72); font-size: 15px; }
.footer-col a:hover { color: #fff; }
.social-links-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 56px; }
.social-icon-link {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18); color: #fff !important;
  transition: background 0.25s, border-color 0.25s, transform 0.35s var(--ease);
}
.social-icon-link:hover { background: var(--ember); border-color: var(--ember); transform: translateY(-3px); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; color: rgba(255, 255, 255, 0.5); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 860px) {
  .site-footer { padding: 64px 0 32px; }
  .footer-top, .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .social-links-row { margin-top: 36px; }
}

/* ==========================================================================
   OFFICIAL FORM NO. 028/O CERTIFICATE (Clean Minimalist European Sheet)
   ========================================================================== */
.luxury-cert-sheet {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 4px solid #0E7C72;
  border-radius: 12px;
  padding: 28px;
  color: #0F172A;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-ui);
}
.luxury-cert-header {
  padding-bottom: 14px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.luxury-cert-title-banner {
  padding: 6px 0 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.luxury-cert-title-banner h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: #0F172A;
}
.cert-demographics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.cert-section-card {
  background: #FFFFFF;
  border-bottom: 1px solid #F1F5F9;
  padding: 10px 0;
  margin-bottom: 8px;
}
.cert-section-card.diagnosis-highlight {
  background: #F0FDFA;
  border: none;
  border-left: 3px solid #0E7C72;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.cert-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin-bottom: 4px;
}
.cert-section-card.diagnosis-highlight .cert-section-head {
  color: #0E7C72;
}
.cert-sign-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #CBD5E1;
  margin-top: 14px;
}
.cert-tech-bar {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #F1F5F9;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  word-break: break-all;
}
.cert-studio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
}
@media (max-width: 680px) {
  .luxury-cert-sheet { padding: 16px 14px; }
  .cert-demographics-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   BOT QUESTIONNAIRE WIDGET & ADMIN INCOMING ALERT
   ========================================================================== */
.comm-widget-tabs.tabs-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bot-quiz-box {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bot-quiz-step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bot-quiz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bot-quiz-chip {
  border: 1px solid var(--line-2);
  background: var(--bone);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font: 600 12px/1.2 var(--font-ui);
  cursor: pointer;
  transition: all 0.2s;
}
.bot-quiz-chip:hover, .bot-quiz-chip.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.widget-admin-wait-bar {
  background: var(--gold-soft);
  border-bottom: 1px solid rgba(201, 164, 92, 0.45);
  color: var(--ink);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.widget-admin-wait-bar.connected {
  background: var(--green-soft);
  border-color: rgba(18, 161, 112, 0.35);
  color: #0B6E4C;
}
.admin-incoming-alert {
  background: var(--ember);
  color: #fff;
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 12px 28px rgba(226, 85, 58, 0.35);
  animation: rise 0.35s var(--ease);
}
.admin-incoming-alert.active {
  display: flex;
}

/* ==========================================================================
   UNIFIED SPLIT-SCREEN CONSULTATION ROOM (/consultation)
   ========================================================================== */
.consult-unified-window {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.consult-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.consult-timers-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.consult-timer-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}
.consult-split-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 400px;
}
.consult-video-half {
  position: relative;
  background: #071413;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.consult-video-half video {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}
.consult-video-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  background: rgba(11, 31, 30, 0.82);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.consult-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 6px;
}
.consult-chat-window {
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (max-width: 820px) {
  .consult-split-stage {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .consult-video-half, .consult-video-half video {
    min-height: 230px;
    max-height: 260px;
  }
  .consult-unified-window {
    padding: 14px;
    border-radius: var(--r-lg);
  }
}

/* ==========================================================================
   DOCTOR & PATIENT PHOTO UPLOADER
   ========================================================================== */
.profile-photo-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 18px;
}
.profile-photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--teal);
  background: #fff;
  flex-shrink: 0;
}

/* ==========================================================================
   REMOTE PARTICIPANT OVERLAY, TYPING INDICATOR & CALL INVITE CARD
   ========================================================================== */
.remote-participant-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  background: radial-gradient(circle at center, rgba(15, 118, 110, 0.25), rgba(7, 20, 19, 0.92));
  pointer-events: none;
}
.remote-participant-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--teal);
  background: #0b1f1e;
}
.typing-indicator-bar {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.call-invite-card {
  margin-top: 8px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  border-radius: 12px;
  color: #0b1f1e;
}
@media (max-width: 768px) {
  .header-cta-btn {
    display: none !important;
  }
  /* Prevent mobile iOS/Android viewport auto-zoom when focusing inputs or chat fields */
  input,
  textarea,
  select,
  .form-control,
  .chat-input-row input,
  .chat-input-row textarea {
    font-size: 16px !important;
  }
  .comm-widget.open {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
}

/* Unified menu burger button across all cabinets */
body[data-page="doctor"] .burger-btn,
body[data-page="patient"] .burger-btn,
body[data-page="admin"] .burger-btn,
body[data-page="consultation"] .burger-btn {
  display: inline-flex;
}

/* ==========================================================================
   PHONE-STYLE AUDIO CALL WINDOW & ANIMATED EQUALIZER
   ========================================================================== */
.phone-call-card {
  background: linear-gradient(165deg, #0B1F1E 0%, #12302E 60%, #091918 100%);
  color: #F7F5F0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  padding: 28px 22px;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 24px 60px -18px rgba(6, 19, 18, 0.55);
}
.phone-call-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 4px;
  background: rgba(14, 124, 114, 0.28);
  border: 2px solid #14A394;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-call-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.audio-equalizer {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 36px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.audio-equalizer .eq-bar {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: #2DD4BF;
  animation: eqPulse 1.05s ease-in-out infinite;
}
.audio-equalizer .eq-bar:nth-child(1) { animation-delay: 0.05s; }
.audio-equalizer .eq-bar:nth-child(2) { animation-delay: 0.22s; }
.audio-equalizer .eq-bar:nth-child(3) { animation-delay: 0.40s; }
.audio-equalizer .eq-bar:nth-child(4) { animation-delay: 0.12s; }
.audio-equalizer .eq-bar:nth-child(5) { animation-delay: 0.32s; }
.audio-equalizer .eq-bar:nth-child(6) { animation-delay: 0.50s; }
.audio-equalizer .eq-bar:nth-child(7) { animation-delay: 0.18s; }
.audio-equalizer .eq-bar:nth-child(8) { animation-delay: 0.38s; }
.audio-equalizer .eq-bar:nth-child(9) { animation-delay: 0.08s; }
.audio-equalizer .eq-bar:nth-child(10) { animation-delay: 0.28s; }
.audio-equalizer.paused .eq-bar {
  animation-play-state: paused;
  height: 5px;
  opacity: 0.45;
}
@keyframes eqPulse {
  0%, 100% { height: 6px; opacity: 0.55; }
  50% { height: 24px; opacity: 1; }
}

/* ==========================================================================
   POST-CONSULTATION COMPLETED SUMMARY & CHAT PROTOCOL EMAIL CARD
   ========================================================================== */
.consult-ended-card {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 22px;
  padding: 28px 24px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 22px 52px -20px rgba(11, 31, 30, 0.16);
}

/* ==========================================================================
   QUICK MESSAGE TEMPLATES & PRE-CHAT GATE
   ========================================================================== */
.chat-quick-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bone);
  border-top: 1px solid var(--line);
}
.quick-tpl-chip {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: left;
}
.quick-tpl-chip:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-2);
}
.prechat-gate-box {
  padding: 14px 16px;
  background: var(--bone);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.closed-chat-banner {
  padding: 14px 16px;
  background: var(--bone);
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ==========================================================================
   BUILT-IN WEBRTC SOFTPHONE & DIRECTORY
   ========================================================================== */
.softphone-hud {
  position: fixed;
  right: 20px;
  bottom: 86px;
  z-index: 1250;
  width: min(380px, calc(100vw - 24px));
  background: linear-gradient(165deg, #0B1F1E 0%, #102B29 65%, #071615 100%);
  color: #F7F5F0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(6, 19, 18, 0.52);
  transition: width 0.2s ease, padding 0.2s ease, border-radius 0.2s ease;
}
.softphone-hud.minimized {
  width: min(340px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 999px;
}
.softphone-min-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.softphone-min-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
  animation: eqPulse 1.3s ease-in-out infinite;
}
.softphone-mini-icon-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #F7F5F0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.softphone-mini-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}
.softphone-mini-icon-btn.danger {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.48);
  color: #FCA5A5;
}
.softphone-mini-icon-btn.danger:hover {
  background: #DC2626;
  color: #FFFFFF;
}
.softphone-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.softphone-ctrl-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #F7F5F0;
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.softphone-ctrl-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  flex-shrink: 0;
}
.softphone-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(45, 212, 191, 0.45);
}
.softphone-ctrl-btn.active {
  background: rgba(20, 163, 148, 0.32);
  border-color: #2DD4BF;
  color: #5EEAD4;
}
.softphone-ctrl-btn.warn {
  background: rgba(245, 158, 11, 0.25);
  border-color: #F59E0B;
  color: #FDE68A;
}
.softphone-video-stage {
  position: relative;
  width: 100%;
  height: 176px;
  border-radius: 14px;
  overflow: hidden;
  background: #05100F;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.softphone-second-line {
  background: rgba(20, 163, 148, 0.18);
  border: 1px solid rgba(45, 212, 191, 0.42);
  border-radius: 12px;
  padding: 10px;
}
.softphone-drawer-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px;
}
.softphone-chat-messages {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}
.softphone-chat-bubble {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 11.5px;
  line-height: 1.35;
}
.softphone-chat-bubble.mine {
  background: rgba(20, 163, 148, 0.3);
  border: 1px solid rgba(45, 212, 191, 0.35);
}
.intranet-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.intranet-contact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.intranet-ext-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bone);
  border: 1px solid var(--line-2);
  font-size: 11px;
  font-weight: 800;
  color: var(--teal);
}

/* Form 028/o in-page preview aligned with website Clinical Editorial palette */
.luxury-cert-sheet {
  background: var(--paper) !important;
  border: 1px solid var(--line) !important;
  border-top: 5px solid var(--ink) !important;
  border-radius: 18px !important;
  color: var(--ink) !important;
}
