/* PharmacyPulse Design System — Modern, rounded, community-first */
/* Primary: #008F82 (teal) | Serif: DM Serif Display | Sans: Plus Jakarta Sans */

:root {
  --bg: #FAFBFC;
  --surface: #ffffff;
  --border: #E5E7EB;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --primary: #008F82;
  --primary-light: #E6F7F5;
  --primary-dark: #006B62;
  --primary-foreground: #ffffff;
  --secondary: #7c3aed;
  --secondary-light: #f3f0ff;
  --warning: #F59E0B;
  --destructive: #ef4444;
  --success: #10B981;
  --radius: 1rem;
  --radius-pill: 9999px;
  --radius-input: 0.75rem;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.08);
  --gold: #F5D060;
  --gold-dark: #ECC94B;
  --purple-dark: #3D1952;
}

/* Base font-size bumped from 16px → 17px per 2026-04-16 sync: users shouldn't need A+ to read comfortably. All rem-based sizes across the site scale automatically. */
html { font-size: 17px; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
input, select, textarea { background: white !important; color: var(--text) !important; }
/* Checkbox/radio styling handled by framework (layout.go end-of-body injection) */
/* Display headings — same humanist sans as body, heavier weight + tight tracking for a sharp, modern feel. */
.font-serif { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; font-weight: 800; letter-spacing: -0.02em; }
/* Defense-in-depth: override any inline DM Serif Display styles across the site. */
[style*="DM Serif Display"] { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important; font-weight: 800 !important; letter-spacing: -0.02em !important; font-style: normal !important; }

/* ===== DOT GRID BACKGROUND ===== */
.dot-grid {
  background-image: linear-gradient(#e5e7eb33 1px, transparent 1px), linear-gradient(90deg, #e5e7eb33 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ===== LAYOUT ===== */
.page-container {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
  min-height: 100vh;
}

/* ===== TOP NAV ===== */
/*.topbar {
  display: none;
}*/
/* topbar styles are inline in the partial */

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  z-index: 50;
  padding: 0.625rem 0 calc(0.625rem + env(safe-area-inset-bottom, 0px));
}
.bottom-nav > div {
  display: grid; grid-template-columns: repeat(5, 1fr); max-width: 100%; padding: 0 0.5rem;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  padding: 0.25rem 0; font-size: 0.5625rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none; transition: color 0.15s;
  letter-spacing: 0.02em;
}
.bottom-nav a:hover, .bottom-nav a.active { color: var(--primary); }
.bottom-nav a svg { width: 22px; height: 22px; stroke: currentColor; }

/* Bottom nav hidden by default — only shows in PWA standalone mode */
.bottom-nav { display: none !important; }

/* ===== ADMIN SIDEBAR ===== */
.admin-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
  background: #0f172a;
  color: white; padding: 0; z-index: 40; overflow-y: auto;
  font-size: 0.9375rem;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.admin-sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.admin-sidebar nav {
  padding: 0.75rem 0.75rem;
  flex: 1;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1rem; color: #94a3b8; text-decoration: none;
  font-size: 0.875rem; font-weight: 500; transition: all 0.15s;
  border-radius: 0.625rem; margin-bottom: 0.125rem;
}
.admin-sidebar a .pp-emoji { font-size: 1.0625rem; line-height: 1; flex-shrink: 0; }
.admin-sidebar a:hover { color: #e2e8f0; background: rgba(255,255,255,0.07); }
.admin-sidebar a.active { color: #ffffff; background: rgba(0,143,130,0.25); border-left: 2.5px solid #008F82; padding-left: calc(1rem - 2.5px); }
.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* Admin content area */
.admin-content { margin-left: 240px; flex: 1; min-width: 0; min-height: 100vh; background: #e8edf4; }

/* Page header bar */
.admin-pg-header {
  background: #ffffff;
  border-bottom: 1px solid #dde3ec;
  padding: 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 4px rgba(15,23,42,0.07);
}
.admin-pg-header-left h1 {
  font-size: 1.375rem; font-weight: 800; color: #0f172a; margin: 0 0 0.125rem;
  letter-spacing: -0.025em;
}
.admin-pg-header-left p { font-size: 0.8125rem; color: #64748b; margin: 0; }
.admin-pg-body { padding: 1.75rem 2rem; }

/* Cards in admin — lift off gray bg */
.admin-content .glass-card {
  box-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 8px 24px rgba(15,23,42,0.06);
  border-color: #dde3ec;
}
.admin-content .stat-card {
  box-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 8px 24px rgba(15,23,42,0.06);
  border-color: #dde3ec;
  border-radius: 0.875rem;
}

/* Stat metric components */
.stat-num { font-size: 2.25rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: #0f172a; }
.stat-lbl { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }

/* Metric icon box (right-aligned in stat cards) */
.metric-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-icon-teal   { background: #ddf3f1; color: #007a6f; }
.metric-icon-purple { background: #ede9fe; color: #6d28d9; }
.metric-icon-amber  { background: #fef3c7; color: #b45309; }
.metric-icon-slate  { background: #e2e8f0; color: #475569; }
.metric-icon-green  { background: #dcfce7; color: #15803d; }
.metric-icon-red    { background: #fee2e2; color: #b91c1c; }

/* Admin table styling */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table thead tr { background: #f8fafc; border-bottom: 2px solid #e2e8f0; }
.admin-table thead th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #64748b;
}
.admin-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.1s; }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table tbody td { padding: 0.875rem 1rem; color: #1e293b; vertical-align: middle; }

/* ===== ADMIN STAT CARD VARIANTS ===== */
.stat-card-teal   { border-top: 3px solid #008F82; }
.stat-card-purple { border-top: 3px solid #7c3aed; }
.stat-card-amber  { border-top: 3px solid #f59e0b; }
.stat-card-red    { border-top: 3px solid #ef4444; }
.stat-card-blue   { border-top: 3px solid #3b82f6; }
.stat-card-slate  { border-top: 3px solid #64748b; }
.stat-card-green  { border-top: 3px solid #10b981; }

.stat-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; margin-bottom: 0.5rem; }
.stat-icon-teal   { background: #e6f7f5; }
.stat-icon-purple { background: #f3f0ff; }
.stat-icon-amber  { background: #fffbeb; }
.stat-icon-red    { background: #fef2f2; }
.stat-icon-blue   { background: #eff6ff; }
.stat-icon-slate  { background: #f1f5f9; }
.stat-icon-green  { background: #f0fdf4; }

/* Admin info/note banner */
.admin-info-banner { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 3px solid #008F82; border-radius: 0.75rem; padding: 1rem 1.25rem; }
.admin-code { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 0.75rem; background: #1e293b; color: #7dd3fc; padding: 0.75rem 1rem; border-radius: 0.5rem; white-space: pre; overflow-x: auto; display: block; margin-top: 0.5rem; }

/* Section heading inside glass cards */
.admin-card-heading { font-size: 0.8125rem; font-weight: 700; color: #0f172a; margin: 0 0 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid #f1f5f9; letter-spacing: -0.01em; }

/* Missing badges */
.badge-flagged   { background: #fffbeb; color: #d97706; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-suspended { background: #fef2f2; color: #dc2626; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-active    { background: #f0fdf4; color: #16a34a; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary); color: white; font-weight: 600;
  padding: 0.625rem 1.5rem; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; border: none; cursor: pointer; font-size: 0.875rem;
  transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,143,130,0.2);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(0,143,130,0.25); }

.btn-outline {
  background: white; color: var(--text); font-weight: 600;
  padding: 0.625rem 1.5rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); display: inline-flex; align-items: center;
  gap: 0.5rem; text-decoration: none; cursor: pointer; font-size: 0.875rem;
  transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-card); }

.btn-ghost {
  background: transparent; color: var(--text-secondary); font-weight: 500;
  padding: 0.5rem 1rem; border-radius: var(--radius-pill); border: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; cursor: pointer; font-size: 0.875rem; transition: all 0.15s;
}
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

.btn-secondary {
  background: var(--secondary); color: white; font-weight: 600;
  padding: 0.625rem 1.5rem; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; border: none; cursor: pointer; font-size: 0.875rem;
  transition: all 0.2s;
}
.btn-secondary:hover { opacity: 0.9; }

.btn-destructive {
  background: var(--destructive); color: white; font-weight: 600;
  padding: 0.625rem 1.5rem; border-radius: var(--radius-pill); border: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; cursor: pointer; font-size: 0.875rem; transition: all 0.2s;
}
.btn-destructive:hover { opacity: 0.9; }

/* ===== CARDS ===== */
.card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; transition: all 0.2s; box-shadow: var(--shadow-card);
}
.card:hover { box-shadow: var(--shadow-hover); }

.pharmacy-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; transition: all 0.2s; box-shadow: var(--shadow-card);
}
.pharmacy-card:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); }

.stat-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-card);
}

.glass-panel {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.glass-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }

/* ===== FORM ELEMENTS ===== */
.input-field {
  width: 100%; padding: 0.625rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-input);
  font-size: 0.875rem; background: white; color: var(--text);
  transition: all 0.15s;
}
.input-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,143,130,0.1); }
.input-field::placeholder { color: var(--text-muted); }

/* ===== BADGES ===== */
.badge-current { background: #fef2f2; color: #dc2626; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-resolved { background: #f0fdf4; color: #16a34a; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-discontinued { background: #f1f5f9; color: #64748b; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: #fffbeb; color: #d97706; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-approved { background: #f0fdf4; color: #16a34a; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-rejected { background: #fef2f2; color: #dc2626; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }

/* ===== TABS ===== */
.tab-group {
  display: flex; gap: 0.25rem; background: #f1f5f9;
  padding: 0.25rem; border-radius: var(--radius);
}
.tab-btn {
  padding: 0.5rem 1rem; border-radius: 0.75rem; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary); background: transparent; border: none; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: white; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-radius: 0.75rem; }

/* ===== FILTER CHIPS ===== */
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.375rem 0.875rem; border-radius: 9999px; font-size: 0.8125rem; font-weight: 500;
  border: 1.5px solid var(--border); background: white; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== STARS ===== */
.star-filled { color: #F59E0B; }
.star-empty { color: #e5e7eb; }

/* ===== CONFIDENCE BAR ===== */
.confidence-bar { height: 6px; border-radius: 3px; background: #f1f5f9; overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.confidence-high { background: var(--success); }
.confidence-medium { background: var(--warning); }
.confidence-low { background: var(--destructive); }

/* ===== RATING OPTIONS ===== */
.rating-option {
  width: 48px; height: 48px; border-radius: var(--radius);
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.125rem; cursor: pointer; transition: all 0.15s;
  color: var(--text-secondary);
}
.rating-option:hover { border-color: var(--primary); color: var(--primary); }
.rating-option.selected, .peer:checked ~ .rating-option {
  background: var(--primary); border-color: var(--primary); color: white;
}

/* ===== SERVICE BADGES ===== */
.service-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.7rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.service-walk_in { background: var(--primary-light); color: var(--primary-dark); }
.service-delivery { background: var(--secondary-light); color: var(--secondary); }
.service-online { background: #e0f2fe; color: #0369a1; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.animate-fade-up { animation: fadeUp 0.4s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }

/* ===== LANDING PAGE ===== */
.hero-grid {
  background-image: linear-gradient(#e5e7eb33 1px, transparent 1px), linear-gradient(90deg, #e5e7eb33 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-orb-teal { position: absolute; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(0,143,130,0.08), transparent 70%); pointer-events: none; }
.hero-orb-purple { position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(124,58,237,0.05), transparent 70%); pointer-events: none; }
.hero-underline {
  text-decoration: none;
  background-image: linear-gradient(var(--primary), var(--primary));
  background-position: 0 85%;
  background-repeat: no-repeat;
  background-size: 100% 6px;
}

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 0.5rem;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ===== MAP ===== */
#pharmacy-map { height: 400px; border-radius: var(--radius); z-index: 1; border: 1px solid var(--border); }

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 639px) {
  /* GoodRx-style mobile readability */
  body { font-size: 15px; line-height: 1.65; }
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.25rem !important; }
  /* Admin sidebar: full-width overlay on mobile */
  .admin-sidebar { width: 100%; }
  .admin-content { margin-left: 0; }

  /* Footer: auto columns on mobile */
  .pp-footer .grid { grid-template-columns: 1fr !important; }

  /* Metric strips: 2x2 grid */
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Inputs: prevent iOS zoom */
  input, select, textarea { font-size: 16px !important; }
  /* Copilot: tighten position on mobile (clears bottom-nav + cookie banner) */
  .pp-sticky-copilot { bottom: 4.5rem; right: 0.75rem; }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .page-container { max-width: 42rem; padding: 2rem 1.5rem 2rem; }
}
@media (min-width: 768px) {
  .page-container { max-width: 48rem; }
}
/* Base: responsive auto-fit so the grid uses every available column at any
   viewport width (the prod media-query rules below override this at common
   breakpoints, but this base catches narrow & in-between widths). */
.pharmacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; }
@media (min-width: 1024px) {
  .topbar { display: block; }
  .page-container { max-width: 72rem; padding: 2.5rem 2rem 3rem; }
  .pharmacy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}
@media (min-width: 1280px) {
  .page-container { max-width: 72rem; padding-left: 1.5rem; padding-right: 1.5rem; }
  .pharmacy-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== PWA STANDALONE / NATIVE APP MODE ===== */
/* When installed as PWA or running in Capacitor WebView */
/* Keep the branded sticky header visible — users want to see the PharmacyPulse identity */
@media (display-mode: standalone) {
  header[style*="sticky"] { padding-top: env(safe-area-inset-top, 0px); }
  .bottom-nav { display: flex !important; }
  .page-container { padding-bottom: 5rem; }
}
/* Capacitor native app — JS adds .native-app to body */
body.native-app header[style*="sticky"] { padding-top: env(safe-area-inset-top, 0px); }
body.native-app .bottom-nav { display: grid !important; }
body.native-app .page-container { padding-bottom: 5rem; }
body.native-app { padding-bottom: 4.5rem; }
body.native-app .pp-footer { display: none !important; }

/* ===== FOOTER ===== */
.pp-footer { padding: 1.5rem; background: #F9FAFB; color: var(--text-secondary); border-top: 1px solid var(--border); }
.pp-footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.15s; }
.pp-footer a:hover { color: var(--primary); }
.pp-footer h4 { color: var(--text); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.pp-footer ul { list-style: none; padding: 0; margin: 0; }
.pp-footer li { margin-bottom: 0.5rem; }
.pp-footer li a { font-size: 0.8125rem; }

/* ===== MOBILE TWEAKS ===== */
@media (max-width: 639px) {
  .search-dropdown { max-height: 60vh; }
  .pp-modal { max-width: 100% !important; margin: 0 0.5rem; border-radius: var(--radius) !important; }
}

/* ===== TOPBAR: keep nav labels + action buttons on a single line ===== */
.pp-topbar a,
.pp-topbar button { white-space: nowrap; }

/* ===== STICKY FLOATING BUTTONS ===== */
.pp-sticky-btn {
  position: fixed;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #008F82;
  background: white;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.pp-sticky-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.pp-sticky-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #008F82;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== STICKY COPILOT BUTTON ===== */
.pp-sticky-copilot {
  bottom: 1.25rem;
  right: 1rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  gap: 0.625rem;
}
.pp-sticky-copilot-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pp-sticky-copilot-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #008F82;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1.2;
}
.pp-sticky-copilot-subtitle {
  font-size: 0.6875rem;
  color: #6B7280;
  font-weight: 500;
  line-height: 1.2;
}
.pp-sticky-copilot-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7454BE;
  border: 2px solid white;
}

/* ===== AI COPILOT MODAL ===== */
.pp-ai-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pp-ai-open { display: flex !important; }
.pp-ai-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  cursor: pointer;
}
.pp-ai-panel {
  position: relative;
  width: 100%;
  max-width: 42rem;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}
.pp-ai-header {
  background: linear-gradient(135deg, #008F82 0%, #006B62 100%);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pp-ai-header-left { display: flex; align-items: center; gap: 0.75rem; }
.pp-ai-avatar { position: relative; }
.pp-ai-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pp-ai-avatar-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7454BE;
  border: 2px solid #008F82;
}
.pp-ai-guarded {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.pp-ai-assistant-title { font-size: 1rem; font-weight: 700; color: white; }
.pp-ai-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.pp-ai-restart {
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: inherit;
}
.pp-ai-header-close {
  padding: 0.375rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pp-ai-content { flex: 1; overflow-y: auto; padding: 1.5rem; }
.pp-ai-welcome { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.pp-ai-bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #008F82;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pp-ai-bubble {
  background: #F9FAFB;
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
}
.pp-ai-bubble p {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.6;
  margin: 0;
}
.pp-ai-intent-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #008F82;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.pp-ai-card {
  display: block;
  text-decoration: none;
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.15s;
}
.pp-ai-card:hover { transform: translateY(-1px); }
.pp-ai-card-find {
  background: #F0FDF4;
  border: 2px solid #008F82;
  margin-bottom: 1rem;
}
.pp-ai-card-find:hover { box-shadow: 0 4px 12px rgba(0,143,130,0.15); }
.pp-ai-card-visit { background: #F5F3FF; border: 2px solid #7454BE; }
.pp-ai-card-visit:hover { box-shadow: 0 4px 12px rgba(116,84,190,0.15); }
.pp-ai-card-top { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.pp-ai-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pp-ai-card-icon-teal { background: #008F82; }
.pp-ai-card-icon-purple { background: #7454BE; }
.pp-ai-card-body { flex: 1; }
.pp-ai-card-title { font-size: 1rem; font-weight: 700; color: #1A1A2E; margin-bottom: 0.25rem; }
.pp-ai-card-desc { font-size: 0.8125rem; color: #6B7280; line-height: 1.5; }
.pp-ai-card-tag {
  font-size: 0.625rem;
  font-weight: 700;
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.pp-ai-card-tag-teal { color: #008F82; border: 1px solid #B7E8E3; }
.pp-ai-card-tag-purple { color: #7454BE; border: 1px solid #C4B5FD; }
.pp-ai-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid;
}
.pp-ai-card-foot-teal { border-top-color: #B7E8E3; }
.pp-ai-card-foot-purple { border-top-color: #C4B5FD; }
.pp-ai-card-link { font-size: 0.8125rem; font-weight: 600; }
.pp-ai-card-link-teal { color: #008F82; }
.pp-ai-card-link-purple { color: #7454BE; }
.pp-ai-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
}
.pp-ai-footer-label { font-size: 0.75rem; color: #6B7280; }
.pp-ai-close-assistant {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: white;
  border: 1px solid #E5E7EB;
  color: #374151;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ===== NEARBY RX SAVINGS POPUP ===== */
.pp-savings-popup {
  display: none;
  position: fixed;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  z-index: 900;
  width: 340px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  animation: pp-savings-slide 0.3s ease-out;
}
.pp-savings-open { display: block; }
@keyframes pp-savings-slide {
  from { opacity: 0; transform: translateY(-50%) translateX(20px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.pp-savings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #E6F7F5;
  border-bottom: 1px solid #B7E8E3;
}
.pp-savings-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #008F82;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pp-savings-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6B7280;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.pp-savings-close:hover { background: rgba(0,0,0,0.06); }
.pp-savings-body { padding: 1rem; }
.pp-savings-pharmacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.pp-savings-pharmacy-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
}
.pp-savings-badge-sale {
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.1875rem 0.5rem;
  border-radius: 9999px;
  background: #7c3aed;
  color: white;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.pp-savings-deal-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1A1A2E;
  line-height: 1.4;
  margin-bottom: 0.375rem;
}
.pp-savings-meta {
  font-size: 0.6875rem;
  color: #6B7280;
  line-height: 1.5;
}
.pp-savings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid #f1f5f9;
}
.pp-savings-distance {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}
.pp-savings-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: #008F82;
  text-decoration: none;
}
.pp-savings-link:hover { text-decoration: underline; }
@media (max-width: 768px) {
  .pp-savings-popup {
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-width: 340px;
  }
}

/* ============================================================
   COMPARE PAGE — vertical side-by-side layout
   ============================================================ */
.cmp-page {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
.cmp-container { display: flex; flex-direction: column; gap: 1.5rem; }

/* Back link */
.cmp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s;
}
.cmp-back-link:hover { opacity: 0.8; }

/* Header */
.cmp-header { text-align: center; }
.cmp-eyebrow {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.cmp-title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.375rem;
}
.cmp-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Pharmacy selector pills */
.cmp-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}
.cmp-selector-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cmp-selector-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.cmp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.cmp-pill-check { opacity: 0; transition: opacity 0.15s; }
.cmp-pill-active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.cmp-pill-active .cmp-pill-check { opacity: 1; }

/* Table wrapper */
.cmp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table */
.cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 0.8125rem;
}
.cmp-table thead th {
  padding: 0.875rem 1rem;
  text-align: center;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  vertical-align: bottom;
}
.cmp-th-feature {
  text-align: left !important;
  min-width: 11rem;
  background: #f9fafb;
}
.cmp-th-pharmacy { min-width: 11rem; }
.cmp-th-name { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.cmp-th-meta { font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.125rem; }

/* Rows */
.cmp-table tbody tr { transition: background 0.12s; }
.cmp-table tbody tr:hover { background: #f9fafb; }
.cmp-table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.cmp-table tbody tr:last-child td { border-bottom: none; }

/* Feature column */
.cmp-td-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f9fafb;
  font-weight: 600;
  color: var(--text-secondary);
}
.cmp-feat-icon {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
}
.cmp-feat-icon-amber { background: #FEF3C7; }
.cmp-feat-icon-blue  { background: #DBEAFE; }
.cmp-feat-icon-red   { background: #FEE2E2; }
.cmp-feat-icon-purple{ background: #EDE9FE; }
.cmp-feat-icon-teal  { background: #D1FAE5; }
.cmp-feat-name { font-size: 0.8125rem; }

/* Value column */
.cmp-td-value { text-align: center; }
.cmp-score {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.cmp-score-best {
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}
.cmp-score-max {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.cmp-score-muted { color: var(--text-muted); font-weight: 600; }
.cmp-score-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* Traffic */
.cmp-traffic-level {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.cmp-traffic-desc {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* Contact */
.cmp-td-contact {
  text-align: left !important;
  vertical-align: top;
}
.cmp-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.cmp-contact-row a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.cmp-contact-row a:hover { text-decoration: underline; }

/* View Full Details row */
.cmp-details-row {
  display: grid;
  grid-template-columns: 12rem repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0.75rem 0.75rem;
}
.cmp-details-spacer {
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}
.cmp-details-cell {
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.cmp-view-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.15s;
}
.cmp-view-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Hint */
.cmp-hint {
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Empty state */
.cmp-empty {
  text-align: center;
  padding: 3rem 1rem;
}
.cmp-empty-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.cmp-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.375rem;
}
.cmp-empty-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}
.cmp-empty-btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.15s;
}
.cmp-empty-btn:hover { background: var(--primary-dark); }

/* Section title (ZIP preview) */
.cmp-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Preview card (anonymous) */
.cmp-preview-card {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
}
.cmp-preview-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.cmp-preview-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0 0 0.875rem;
}
.cmp-preview-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.cmp-preview-input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  width: 11rem;
}
.cmp-preview-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.cmp-preview-btn:hover { background: var(--primary-dark); }

/* Responsive */
@media (max-width: 768px) {
  .cmp-page { padding: 1rem 0.75rem 3rem; }
  .cmp-th-feature { min-width: 9rem; }
  .cmp-th-pharmacy { min-width: 9rem; }
  .cmp-details-row {
    grid-template-columns: 9rem repeat(auto-fit, minmax(9rem, 1fr));
  }
}

/* Sidebar */
.pd-sidebar-inner {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  flex: 1;
}
.pd-sidebar-brand {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
}
.pd-sidebar-pharmacy {
  margin-bottom: 1.5rem;
}
.pd-sidebar-name {
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 0.375rem;
}
.pd-sidebar-verified {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}
.pd-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: auto;
}
.pd-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: all 0.12s;
}
.pd-sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.pd-sidebar-link-active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.pd-sidebar-public {
  display: block;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #10B981;
  text-decoration: none;
}
.pd-sidebar-public:hover { text-decoration: underline; }

/* Main content */
.pd-main {
  flex: 1;
  background: #FAFBFC;
  min-height: 100vh;
}
.pd-main-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

/* Banners */
.pd-banner {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.pd-banner-success { background: #E6F7F5; border: 1px solid #bbf7d0; color: #006B62; }
.pd-banner-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.pd-banner-green { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }

/* Top row — eyebrow + greeting + signal badge */
.pd-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.pd-eyebrow {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.pd-eyebrow-small {
  display: block;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.pd-greeting {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.pd-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
}
.pd-signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  white-space: nowrap;
}

/* Metric cards */
.pd-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.pd-metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.pd-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.pd-metric-label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}
.pd-metric-big {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.375rem;
  letter-spacing: -0.02em;
}
.pd-metric-unit {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.pd-metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.pd-metric-trend-up { color: var(--primary); }
.pd-metric-trend-down { color: var(--destructive); }
.pd-metric-note {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.pd-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.pd-link:hover { text-decoration: underline; }

/* Sparkline row */
.pd-sparkline-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.5625rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Two-column cards */
.pd-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Card base */
.pd-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.pd-card-pad { padding: 1.5rem; }
.pd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.pd-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.125rem;
}
.pd-card-title-lg {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.375rem;
}
.pd-card-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin: 0;
}
.pd-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.6;
}
.pd-card-quote {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

/* Bottleneck items */
.pd-bottleneck-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.pd-bottleneck-last { border-bottom: none; }
.pd-bottleneck-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.pd-bottleneck-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.pd-bottleneck-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0 0 0.375rem;
  line-height: 1.5;
}

/* Badges */
.pd-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pd-badge-red { background: #FEE2E2; color: #dc2626; }
.pd-badge-purple { background: #f3f0ff; color: #7c3aed; }
.pd-badge-yellow { background: #fef9c3; color: #a16207; }

/* Button row */
.pd-btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
}
.pd-btn-sm { padding: 0.375rem 0.875rem; font-size: 0.6875rem; }
.pd-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.pd-btn-primary:hover { background: var(--primary-dark); }
.pd-btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.pd-btn-outline:hover { border-color: var(--text-muted); }
.pd-btn-dark { background: #1A1A2E; color: #fff; border-color: #1A1A2E; }
.pd-btn-dark:hover { background: #0f172a; }

/* Page title */
.pd-page-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 1rem;
}
.pd-page-title-lg {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.375rem;
  letter-spacing: -0.02em;
}

/* Reviews list */
.pd-reviews-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}
.pd-review-item {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.pd-review-item:last-child { border-bottom: none; }
.pd-review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.pd-review-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}
.pd-review-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.pd-review-metrics {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
.pd-star { color: var(--warning); }
.pd-stock-in { color: var(--primary); font-weight: 600; }
.pd-stock-out { color: var(--destructive); font-weight: 600; }
.pd-review-wait { color: var(--text-secondary); }
.pd-review-comment {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

/* Response box */
.pd-response-box {
  padding: 0.75rem;
  background: #f0fdf4;
  border-left: 3px solid var(--primary);
  border-radius: 0.375rem;
}
.pd-response-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 0.25rem;
}
.pd-response-text {
  font-size: 0.8125rem;
  color: #374151;
  margin: 0;
}

/* Reply details */
.pd-reply-details { margin-top: 0.5rem; }
.pd-reply-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
  list-style: none;
}
.pd-reply-form { margin-top: 0.5rem; }
.pd-reply-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
  color: var(--text);
  resize: vertical;
}
.pd-reply-textarea:focus { border-color: var(--primary); }

/* HIPAA gate */
.pd-hipaa-gate {
  margin-top: 0.5rem;
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
}
.pd-hipaa-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.pd-hipaa-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1; }
.pd-hipaa-title { font-weight: 700; color: #dc2626; font-size: 0.8125rem; margin: 0 0 0.25rem; }
.pd-hipaa-sub { font-size: 0.75rem; color: #7f1d1d; margin: 0; }
.pd-hipaa-list {
  font-size: 0.6875rem;
  color: #991b1b;
  line-height: 1.8;
  padding-left: 1.25rem;
  margin: 0 0 0.75rem;
}
.pd-hipaa-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #991b1b;
}

/* Hours */
.pd-hours-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  border-bottom: 1px solid #f8fafc;
}
.pd-hours-day { font-weight: 500; color: var(--text); }
.pd-hours-time { color: var(--text-secondary); }
.pd-hours-closed { color: var(--destructive); font-weight: 600; font-size: 0.75rem; }

/* Members table */
.pd-members-table { width: 100%; }
.pd-members-header {
  display: grid;
  grid-template-columns: 1fr 80px 100px 60px;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pd-members-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px 60px;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f8fafc;
  align-items: center;
  font-size: 0.8125rem;
}
.pd-members-name { font-weight: 600; color: var(--text); }
.pd-members-email { font-size: 0.6875rem; color: var(--text-muted); margin: 0.125rem 0 0; }
.pd-members-role-owner { color: var(--secondary); font-weight: 600; }
.pd-members-col-joined { font-size: 0.6875rem; color: var(--text-muted); }
.pd-btn-remove {
  padding: 0.25rem 0.5rem;
  background: none;
  color: var(--destructive);
  border: 1px solid #fecaca;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  cursor: pointer;
}
.pd-btn-remove:hover { background: #fef2f2; }

/* Leader row */
.pd-leader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 0.8125rem;
}
.pd-leader-name { font-weight: 600; color: var(--text); }
.pd-leader-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

/* Widget */
.pd-widget-preview {
  padding: 1.25rem;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
}
.pd-label-sm {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.pd-code-wrap { position: relative; margin-bottom: 1rem; }
.pd-code {
  padding: 1rem;
  background: #0f172a;
  color: #a5f3fc;
  font-size: 0.6875rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 0.5rem;
  margin: 0;
}
.pd-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: #1e293b;
  color: #a5f3fc;
  border: 1px solid #334155;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0.25rem;
}
.pd-tamper-note {
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  color: #006B62;
}

/* Badge preview */
.pd-badge-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.pd-badge-dark {
  padding: 0.625rem 1rem;
  background: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pd-badge-dark .pd-star { color: var(--warning); }
.pd-badge-dark .pd-badge-val { color: #fff; font-weight: 700; font-size: 0.875rem; }
.pd-badge-dark .pd-badge-label { color: #94a3b8; font-size: 0.625rem; }
.pd-badge-light {
  padding: 0.625rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pd-badge-light .pd-star { color: var(--warning); }
.pd-badge-light .pd-badge-val { color: var(--text); font-weight: 700; font-size: 0.875rem; }
.pd-badge-light .pd-badge-label { color: var(--text-secondary); font-size: 0.625rem; }

/* Services */
.pd-svc-current { margin-bottom: 1.25rem; }
.pd-svc-tags { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.pd-svc-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: #f0fdf4;
  color: #006B62;
  border: 1px solid #bbf7d0;
}
.pd-svc-form {
  display: grid;
  gap: 0.75rem;
}
.pd-select-full { width: 100%; }

/* Upgrade */
.pd-upgrade-wrap { max-width: 40rem; margin: 0 auto; }
.pd-upgrade-header { text-align: center; margin-bottom: 2rem; }
.pd-pro-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.pd-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.pd-plan-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.pd-plan-pro {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 16px rgba(0,143,130,0.12);
  position: relative;
}
.pd-plan-badge {
  position: absolute;
  top: -0.625rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.125rem 0.75rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pd-plan-name {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}
.pd-plan-name-teal { color: var(--primary); }
.pd-plan-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.pd-plan-period {
  font-size: 0.875rem;
  font-weight: 500;
  color: #9CA3AF;
}
.pd-plan-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
}
.pd-plan-features { display: grid; gap: 0.5rem; margin-bottom: 1.5rem; }
.pd-plan-feat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #374151;
}
.pd-plan-feat-disabled { color: #9CA3AF; }
.pd-check { color: var(--primary); }
.pd-plan-btn {
  display: block;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-decoration: none;
}
.pd-plan-btn-muted { background: #F3F4F6; color: #6B7280; }
.pd-plan-btn-current { background: var(--primary-light); color: var(--primary-dark); }
.pd-plan-btn-pro { background: var(--primary); color: #fff; transition: background 0.15s; }
.pd-plan-btn-pro:hover { background: var(--primary-dark); }
.pd-plan-btn-pro-active { background: var(--primary); color: #fff; }
.pd-upgrade-footer {
  text-align: center;
  font-size: 0.6875rem;
  color: #9CA3AF;
  margin-top: 1.5rem;
}

/* Usage banner */
.pd-usage-banner {
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.pd-usage-warning { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.pd-usage-clear { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.pd-usage-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 1rem;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  text-decoration: none;
  border-radius: 9999px;
}
.pd-usage-link { color: #2563eb; font-weight: 600; text-decoration: none; font-size: 0.75rem; }

/* Empty / utility */
.pd-empty-state { text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 0.75rem; padding: 3rem 1rem; }
.pd-empty-title { font-weight: 600; color: var(--text); margin: 0 0 0.25rem; }
.pd-empty-desc { font-size: 0.8125rem; color: var(--text-secondary); margin: 0 0 1rem; }
.pd-empty-inline { padding: 2rem; text-align: center; font-size: 0.8125rem; color: var(--text-muted); }
.pd-muted { font-size: 0.8125rem; color: var(--text-muted); }
.pd-member-count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: #f1f5f9;
}
.pd-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.pd-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  outline: none;
  box-sizing: border-box;
  color: var(--text);
}
.pd-input:focus { border-color: var(--primary); }
.pd-select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text);
  background: #fff;
  outline: none;
}
.pd-invite-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}
.pd-invite-field { flex: 1; min-width: 200px; }

/* Responsive */
@media (max-width: 900px) {
  .pd-layout { flex-direction: column; }
  .pd-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }
  .pd-sidebar-inner {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
  }
  .pd-sidebar-brand { margin-bottom: 0; white-space: nowrap; }
  .pd-sidebar-pharmacy { margin-bottom: 0; white-space: nowrap; }
  .pd-sidebar-nav { flex-direction: row; margin-bottom: 0; }
  .pd-sidebar-public { margin-top: 0; white-space: nowrap; }
  .pd-main-inner { padding: 1rem; }
  .pd-metric-row { grid-template-columns: 1fr; }
  .pd-two-col { grid-template-columns: 1fr; }
  .pd-plan-grid { grid-template-columns: 1fr; }
  .pd-members-header, .pd-members-row { grid-template-columns: 1fr 80px 60px; }
  .pd-members-col-joined { display: none; }
}
@media (max-width: 480px) {
  .pd-sidebar-brand { display: none; }
  .pd-top-row { flex-direction: column; }
}
