html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --ink: #18332f;
  --muted: #60726e;
  --brand: #177c68;
  --brand-dark: #0e5f50;
  --soft: #eff7f3;
  --warm: #f6f2e9;
  --line: #dce7e3;
}

body {
  color: var(--ink);
  background: #fff;
  font-family: Inter, "Segoe UI", sans-serif;
  margin: 0;
}

h1, h2, h3, .navbar-brand {
  letter-spacing: -.03em;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; font-weight: 750; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.08; font-weight: 720; max-width: 760px; }
h3 { font-weight: 700; }
p { color: var(--muted); line-height: 1.7; }
a { color: var(--brand-dark); }

.navbar { min-height: 74px; }
.navbar-brand { color: var(--ink) !important; font-weight: 800; font-size: 1.35rem; }
.nav-link { color: var(--muted) !important; font-weight: 600; }
.btn { border-radius: .7rem; font-weight: 700; padding: .65rem 1.1rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.form-control, .form-select { border-color: #ccd9d5; border-radius: .65rem; padding: .72rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(23,124,104,.14); }

.hero-section {
  padding: 7rem 0;
  background: radial-gradient(circle at 80% 10%, #dcefe6 0, transparent 32%), linear-gradient(140deg, #fbfdfc, #f3f7f3);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 5rem; align-items: center; }
.hero-copy { font-size: 1.25rem; max-width: 690px; margin: 1.5rem 0 2rem; }
.eyebrow { display: inline-block; color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; margin-bottom: 1rem; }
.hero-panel { background: var(--ink); color: #fff; border-radius: 1.5rem; padding: 1.25rem; box-shadow: 0 30px 70px rgba(24,51,47,.18); transform: rotate(1.5deg); }
.status-line { display: grid; grid-template-columns: 12px 1fr auto; gap: .8rem; align-items: center; padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.11); }
.status-line strong { font-size: .9rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.success { background: #56d6a2; }.status-dot.pending { background: #f0c56d; }.status-dot.alert { background: #ff8d78; }
.care-note { margin-top: 1rem; padding: 1.5rem; border-radius: 1rem; color: var(--ink); background: var(--warm); display: grid; gap: .5rem; }
.care-note span, .care-note small { color: var(--muted); }
.content-section { padding: 6.5rem 0; }
.content-section h2 { margin-bottom: 3rem; }
.soft-section { background: var(--soft); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.feature-grid article { border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; }
.feature-number { color: var(--brand); font-weight: 800; }
.feature-grid h3 { margin-top: 2rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.steps-grid article { display: flex; gap: 1rem; }
.steps-grid article > strong { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--brand); color: white; }
.pricing-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 5rem; align-items: center; }
.pricing-card { background: var(--warm); border-radius: 1.25rem; padding: 2rem; }
.pricing-card h3 { font-size: 2.5rem; margin: 1rem 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; align-items: stretch; }
.tier-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.75rem; background: #fff; }
.tier-card.is-featured { border-color: var(--brand); box-shadow: 0 24px 60px rgba(23,124,104,.16); position: relative; }
.tier-badge { position: absolute; top: -.85rem; left: 1.75rem; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .3rem .7rem; border-radius: .5rem; }
.tier-name { font-weight: 800; font-size: 1.1rem; }
.tier-price { font-size: 2.4rem; font-weight: 780; margin: .5rem 0 .25rem; letter-spacing: -.03em; }
.tier-price span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.tier-desc { min-height: 3rem; margin-bottom: 0; }
.tier-features { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .55rem; }
.tier-features li { position: relative; padding-left: 1.6rem; color: var(--ink); font-size: .93rem; line-height: 1.45; }
.tier-features li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.tier-features li.tier-features-heading { padding-left: 0; color: var(--muted); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.tier-features li.tier-features-heading::before { content: ""; }
.tier-cta { margin-top: auto; }
.tier-note { font-size: .85rem; color: var(--muted); margin-top: .85rem; }
.contact-section { color: white; background: var(--ink); }
.contact-section h2 { margin: 0 auto 1.5rem; }
.contact-section p { color: #c8d7d3; }
.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; }

.auth-page { min-height: calc(100vh - 190px); display: grid; place-items: center; padding: 4rem 1rem; background: var(--soft); }
.auth-card { width: min(100%, 620px); background: #fff; padding: clamp(1.5rem, 5vw, 3rem); border-radius: 1.25rem; box-shadow: 0 20px 60px rgba(24,51,47,.09); }
.auth-card h1 { font-size: 2.2rem; }
.admin-section { min-height: calc(100vh - 190px); background: #f5f8f7; }
.admin-section .page-header h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.impersonation-banner {
  position: relative;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 52px;
  padding: .6rem 1rem;
  color: #2f260d;
  background: #f5cf67;
  border-bottom: 1px solid #d8ae3c;
}
.impersonation-banner form { margin: 0; }

.app-body { background: #f5f8f7; min-height: 100vh; }
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app-sidebar { background: var(--ink); color: white; padding: 1.5rem; display: flex; flex-direction: column; }
.app-brand { color: white; font-size: 1.25rem; font-weight: 800; text-decoration: none; margin-bottom: 2.5rem; }
.app-nav { display: grid; gap: .35rem; }
.app-nav a { color: #c8d7d3; text-decoration: none; border-radius: .55rem; padding: .75rem .9rem; font-weight: 600; }
.app-nav a:hover { color: white; background: rgba(255,255,255,.08); }
.app-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; }
.app-user span { display: block; margin-bottom: .5rem; }
.app-main { min-width: 0; }
.app-topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); padding: 0 2rem; }
.app-content { padding: 2rem; max-width: 1440px; margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; margin: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.metric-card, .panel { background: white; border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; }
.metric-card span { color: var(--muted); font-weight: 600; }
.metric-card strong { display: block; font-size: 2.5rem; margin-top: .5rem; }
.panel h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .9rem .75rem; border-color: var(--line); }
.empty-state { text-align: center; padding: 3rem; color: var(--muted); }
.form-panel { max-width: 820px; }
.badge-soft { color: var(--brand-dark); background: var(--soft); padding: .35rem .6rem; border-radius: 999px; font-weight: 700; font-size: .78rem; }
.trend-bar { display: grid; grid-template-columns: 90px 1fr auto; gap: 1rem; align-items: center; margin: .9rem 0; }
.trend-track { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.trend-fill { height: 100%; background: var(--brand); border-radius: inherit; }

.app-topbar-actions { display: flex; align-items: center; gap: 1rem; }
.location-switcher { display: flex; align-items: center; gap: .75rem; }
.location-switcher-form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.location-switcher-label { margin: 0; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.location-switcher-form .form-select { min-width: 200px; }
.location-switcher-current { font-weight: 700; color: var(--brand-dark); }
.coverage-warning { border-width: 2px; }
.coverage-warning-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: 1.05rem; }
.coverage-warning-icon { font-size: 1.3rem; line-height: 1; }
.coverage-gap-list { margin-top: .25rem; padding-left: 1.25rem; }
.notification-prefs .notif-window { border-left: 3px solid var(--line); padding-left: 1rem; }
.app-notification-bell { position: relative; color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.app-notification-bell:hover { text-decoration: underline; }
.notification-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: .35rem; border-radius: 999px; background: #d64545; color: white; font-size: .72rem; font-weight: 700; }
.setup-banner { border-radius: .9rem; }
.setup-step { border: 1px solid var(--line); border-radius: .9rem; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.setup-step h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.notification-list { list-style: none; margin: 0; padding: 0; }
.notification-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: none; }
.notification-item.is-unread { background: rgba(31, 122, 108, .05); border-radius: .6rem; padding: 1rem; }
.notification-heading { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.dashboard-outcomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.outcome-card { background: white; border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; }
.outcome-card span { color: var(--muted); font-weight: 600; }
.outcome-card strong { display: block; font-size: 2rem; margin-top: .35rem; }
.outcome-card.is-alert { border-color: #d64545; }
.outcome-card.is-alert strong { color: #d64545; }

@media (max-width: 991px) {
  .hero-grid, .pricing-wrap { grid-template-columns: 1fr; gap: 3rem; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: static; }
  .app-nav { grid-template-columns: repeat(3, 1fr); }
  .app-user { margin-top: 1rem; }
}
@media (max-width: 600px) {
  .hero-section, .content-section { padding: 4rem 0; }
  .feature-grid, .metric-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .app-nav { grid-template-columns: repeat(2, 1fr); }
  .app-content { padding: 1rem; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .site-footer .container { align-items: flex-start; flex-direction: column; gap: 1rem; }
}