:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-muted: #eef3fb;
  --text: #122033;
  --muted: #627189;
  --line: #dbe5f1;
  --shadow: 0 14px 34px rgba(13, 32, 66, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --indigo: #4f46e5;
  --indigo-soft: #e0e7ff;
  --teal: #0f766e;
  --teal-soft: #d9fbf2;
  --amber: #c67a00;
  --amber-soft: #fff2cf;
  --rose: #d6336c;
  --rose-soft: #ffe0ea;
  --green: #1c8c5b;
  --green-soft: #dcfce7;
  --danger: #c2410c;
  --danger-soft: #ffedd5;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(219, 234, 254, 0.85), transparent 28%),
    radial-gradient(circle at top right, rgba(224, 231, 255, 0.65), transparent 26%),
    linear-gradient(180deg, #f9fbff 0%, #f3f7fc 100%);
  color: var(--text);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.zoom-outer {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.zoom-shell {
  width: var(--ui-width, 100%);
  transform: scale(var(--ui-scale, 1));
  transform-origin: top center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(249, 251, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(219, 229, 241, 0.9);
}
.topbar-inner,
.page {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  flex: 0 0 52px;
  padding: 0;
}
.brand-badge img,
.brand-logo {
  display: block;
  width: 26px !important;
  height: 26px !important;
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
  flex: 0 0 26px;
}
.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.1rem, 1.1vw + 0.95rem, 1.6rem);
}

.brand-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.zoom-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 38px;
  font-weight: 700;
}

.zoom-btn:hover {
  background: var(--surface-soft);
}

.zoom-reset {
  padding-inline: 12px;
}

.zoom-readout {
  min-width: 52px;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.meta-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.tabs-row {
  border-top: 1px solid rgba(219, 229, 241, 0.9);
}
.tabs-row .page {
  padding: 0;
}

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0 16px;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 8px; }
.tabs::-webkit-scrollbar-thumb { background: #cdd8e7; border-radius: 999px; }
.tab-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  border-radius: 999px;
  padding: 11px 16px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.tab-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tab-btn[data-tab="home"] { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.tab-btn[data-tab="library"] { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.tab-btn[data-tab="dose"] { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; }
.tab-btn[data-tab="calc"] { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.tab-btn[data-tab="data"] { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.tab-btn.active { color: white; border-color: transparent; }
.tab-btn.active[data-tab="home"] { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.tab-btn.active[data-tab="library"] { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.tab-btn.active[data-tab="dose"] { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.tab-btn.active[data-tab="calc"] { background: linear-gradient(135deg, #f59e0b, #b45309); }
.tab-btn.active[data-tab="data"] { background: linear-gradient(135deg, #fb7185, #be123c); }
.page {
  padding: 26px 0 48px;
}
.hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(245,249,255,0.96));
  border: 1px solid rgba(219, 229, 241, 0.95);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 3vw, 38px);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
}

.eyebrow {
  display: none !important;
}

.hero h2 {
  font-size: clamp(1.7rem, 2vw + 1rem, 2.7rem);
  line-height: 1.06;
  margin: 12px 0 14px;
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 72ch;
}
.hero-actions,
.action-row,
.inline-actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.grid,
.metrics-grid,
.card-grid,
.quick-grid,
.plan-grid,
.calc-grid,
.two-col,
.three-col,
.four-col {
  display: grid;
  gap: 18px;
}
.card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.specifier-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: start;
}
.specifier-figure-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(219, 229, 241, 0.95);
  border-radius: var(--radius);
  padding: 18px;
}

.specifier-copy {
  display: grid;
  gap: 14px;
}
.specifier-copy p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}
.specifier-copy strong {
  color: var(--text);
}
.specifier-note {
  margin-top: 4px;
}
.quick-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.plan-grid { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.85fr); align-items: start; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metrics-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.panel {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}
.section-card,
.glass-card,
.info-card,
.result-card,
.metric-card,
.feature-card,
.step-card,
.activity-card,
.plan-card,
.calc-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(219, 229, 241, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-card,
.calc-card,
.plan-card,
.activity-card,
.info-card,
.result-card,
.feature-card,
.step-card {
  padding: 20px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-head h3,
.card-head h2 {
  margin: 0;
}
.card-head p,
.subtle,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.badge-row,
.chip-row,
.filter-row,
.meta-row,
.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.badge,
.chip,
.stat-pill,
.meta-dot,
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 600;
}
.chip {
  background: white;
}
.chip.active,
.filter-chip.active {
  background: var(--indigo-soft);
  color: var(--indigo);
  border-color: #c7d2fe;
}
.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.card-list {
  display: grid;
  gap: 14px;
}
.feature-card h4,
.step-card h4,
.activity-card h4,
.plan-card h4,
.calc-card h4 {
  margin: 0 0 8px;
}
.feature-card p,
.step-card p,
.activity-card p,
.plan-card p,
.calc-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.step-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.step-pill {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}
.step-pill.active { background: var(--indigo-soft); color: var(--indigo); border-color: #c7d2fe; }
.step-pill.complete { background: var(--green-soft); color: var(--green); border-color: #a7f3d0; }
form { display: grid; gap: 14px; }
.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}
label span, .label-note {
  font-size: 0.92rem;
}
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 13px 14px;
  background: white;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(96, 165, 250, 0.28);
  border-color: #60a5fa;
}
textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; }
.btn-dose { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; }
.btn-calc { background: linear-gradient(135deg, #f59e0b, #b45309); color: white; }
.btn-soft { background: white; color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: var(--surface-muted); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.metric-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248, 250, 253, 0.98));
}
.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
}
.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.2rem, 1vw + 0.95rem, 1.7rem);
}
.library-layout,
.calc-layout,
.data-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}
.library-results {
  display: grid;
  gap: 14px;
}
.activity-card.selected {
  border-color: #60a5fa;
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.12);
}
.activity-title {
  font-weight: 800;
  font-size: 1.03rem;
  line-height: 1.45;
}
.small { font-size: 0.9rem; }
.mini-note,
.help-box,
.status-box {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.help-box summary {
  cursor: pointer;
  font-weight: 800;
}
.helper-copy {
  margin-top: 12px;
  color: var(--text);
}
.helper-copy p {
  margin: 0 0 10px;
  line-height: 1.6;
}
.helper-copy ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: var(--muted);
  line-height: 1.65;
}
.helper-copy li + li { margin-top: 6px; }
.status-box.good { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.status-box.warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.next-step-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #bfdbfe;
  font-size: 0.9rem;
  font-weight: 800;
}
.next-step-cue .arrow {
  animation: bounceArrow 1s infinite;
}
@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.source-list {
  display: grid;
  gap: 14px;
}
.source-item {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.source-item p {
  margin: 0;
  line-height: 1.7;
  color: var(--text);
}
.source-item a {
  word-break: break-word;
}
.qr-reference-card {
  margin-top: 4px;
}

.qr-reference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.qr-reference-copy {
  flex: 1 1 320px;
}

.qr-reference-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.qr-reference-code {
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 0;
}

.qr-reference-code a {
  display: block;
  width: 100px;
  height: 100px;
  overflow: hidden;
}

.qr-reference-code img,
.qr-code-image {
  display: block;
  width: 100px !important;
  height: 100px !important;
  max-width: 120px !important;
  max-height: 120px !important;
  object-fit: contain;
  border-radius: 4px;
  background: white;
  border: 1px solid var(--line);
  padding: 2px;
  box-shadow: none;
}

.summary-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(250px, 0.78fr) minmax(520px, 1.22fr);
  align-items: start;
}

.sticky-side {
  position: sticky;
  top: 130px;
}
.plan-list,
.draft-list {
  display: grid;
  gap: 14px;
}
.plan-card .topline,
.activity-card .topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
.inline-meta .badge {
  background: white;
}
.checklist {
  display: grid;
  gap: 10px;
}
.check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
}
.check-item strong { color: var(--text); }
.specifier-grid {
  display: grid;
  gap: 12px;
}

.specifier-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
}
.specifier-row label {
  font-size: 0.9rem;
  line-height: 1.2;
}
input[type="range"] {
  width: 100%;
  accent-color: #7e22ce;
}
.specifier-score {
  width: 42px;
  text-align: center;
  padding: 7px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 800;
  font-size: 0.92rem;
}
.radar-shell {
  display: grid;
  place-items: center;
  padding: 20px;
}
.radar-shell svg {
  width: min(100%, 900px);
  height: auto;
  display: block;
  overflow: visible;
}
.specifier-summary-scale {
  display: grid;
  gap: 12px;
}
.specifier-summary-scale p {
  margin: 0;
  line-height: 1.65;
}
.specifier-summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.6;
}
.specifier-summary-list li strong {
  color: var(--text);
}
.specifier-band-guide {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.specifier-band-guide li strong {
  color: var(--text);
}

.specifier-band {
  color: var(--muted);
  font-weight: 600;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
}
.toast {
  padding: 14px 16px;
  border-radius: 16px;
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  max-width: 340px;
}
.toast.success { background: linear-gradient(135deg, #15803d, #166534); }
.toast.warn { background: linear-gradient(135deg, #b45309, #92400e); }
.pager {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.kpi-band {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.kpi {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246, 248, 252, 0.98));
  border: 1px solid var(--line);
}
.kpi span { color: var(--muted); font-size: 0.88rem; }
.kpi strong { display: block; margin-top: 8px; font-size: 1.45rem; }
.calc-section {
  display: grid;
  gap: 14px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.section-title-row h3 { margin: 0; }
.section-title-row p { margin: 4px 0 0; color: var(--muted); }
.calc-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.calc-card details { margin-top: 12px; }
.calc-result {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fffdf7;
  border: 1px solid #fde68a;
}
.calc-result strong { display: block; margin-bottom: 8px; }
.result-text { color: var(--text); line-height: 1.6; }
.empty-state {
  padding: 24px;
  border: 1px dashed #bfd0e3;
  border-radius: 20px;
  background: rgba(255,255,255,0.8);
  text-align: center;
  color: var(--muted);
}
.footer-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.dose-page {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.dose-main {
  display: grid;
  gap: 18px;
}

.dose-sidebar {
  display: grid;
  gap: 18px;
}

.dose-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: start;
}

/* =========================================================
   MOBILE / TABLET RESPONSIVE LAYOUT
   These rules change the desktop layout for smaller screens.

   1100px:
   - collapses major 2-column sections into 1 column
   - turns off sticky side panels

   800px:
   - stacks top bar content
   - changes specifier sliders to a vertical layout
   - keeps tabs scrollable instead of cramped

   560px:
   - reduces padding
   - makes buttons full width
   - shrinks the live radar for phone screens

   If mobile looks broken later, check these three media queries first.
   ========================================================= */

@media (max-width: 900px) {
  .hero,
  .plan-grid,
  .specifier-layout,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .sticky-side {
    position: static;
    top: auto;
  }
}

@media (max-width: 800px) {
  .topbar {
    position: static;
  }

  .topbar-inner,
  .page {
    width: min(100%, calc(100% - 20px));
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-meta {
    width: 100%;
    justify-content: flex-start;
  }
  
  .zoom-controls {
    width: 100%;
    justify-content: flex-start;
  }
  
  .brand {
    align-items: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    overflow: visible;
    padding-bottom: 0;
  }

  .tab-btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .specifier-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "slider"
      "score";
    gap: 8px;
  }

  .specifier-score {
    width: 100%;
    max-width: 72px;
  }

  .two-col,
  .three-col,
  .four-col,
  .plan-grid,
  .summary-grid,
  .specifier-layout {
    grid-template-columns: 1fr;
  }

  .radar-shell svg {
    width: min(100%, 420px);
  }
  .qr-reference-row {
  flex-direction: column;
  align-items: flex-start;
}

.qr-code-image {
  width: 38px;
  height: 38px;
}
  
}

@media (max-width: 560px) {
  .hero,
  .section-card,
  .calc-card,
  .activity-card,
  .plan-card,
  .feature-card,
  .step-card,
  .info-card {
    padding: 16px;
  }

  .brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .brand-copy h1 {
    font-size: 1.15rem;
  }

  .brand-copy p {
    font-size: 0.88rem;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  .btn,
  .button-row .btn,
  .hero-actions .btn,
  .inline-actions .btn,
  .action-row .btn {
    width: 100%;
  }

  .radar-shell svg {
    width: min(100%, 360px);
  }
}


.calc-inline-details {
  margin-top: 12px;
}

.calc-inline-section {
  display: grid;
  gap: 12px;
}

.calc-inline-section h5 {
  margin: 0;
  font-size: 0.98rem;
}

.calc-inline-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.calc-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0 0;
}

.calc-formula-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.formula-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 700;
}

.formula-arrow {
  color: var(--muted);
  font-weight: 800;
}

.calc-range-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calc-range-value {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}




/* ===== Exercise Px refresh ===== */

.brand-badge {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand-copy h1 {
  letter-spacing: -0.03em;
}

.home-shell {
  display: grid;
  gap: 24px;
}

.px-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 660px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4f46e5;
}

.px-hero h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 14px 0 10px;
  max-width: 60ch;
}

.hero-sub {
  color: var(--muted);
  line-height: 1.7;
  max-width: 62ch;
  margin-bottom: 18px;
}

.px-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.px-stat-card {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.px-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.px-stat-card strong {
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}

.px-hero-side {
  display: flex;
  align-items: stretch;
}

.glass-card {
  width: 100%;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.glass-card h3,
.glass-card h4 {
  margin-top: 6px;
  margin-bottom: 10px;
}

.mini-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.home-card-section {
  padding: 24px;
  border-radius: 26px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.section-header h3 {
  margin: 6px 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.px-card-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.px-card-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.px-card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card-apple {
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(255,255,255,1));
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
}

.product-card {
  min-height: 100%;
}

.pro-card {
  background:
    radial-gradient(circle at top right, rgba(216, 180, 254, 0.22), transparent 30%),
    rgba(255,255,255,0.84);
}

.coming-soon-panel {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}

.coming-soon-left p {
  line-height: 1.7;
}

.coming-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.device-mock-wrap {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: center;
  flex-wrap: wrap;
}

.device-mock {
  border-radius: 28px;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.desktop-mock {
  width: 290px;
  height: 220px;
}

.phone-mock {
  width: 150px;
  height: 240px;
  border-radius: 30px;
}

.mock-topbar {
  height: 18px;
  background: rgba(99, 102, 241, 0.14);
}

.mock-content {
  padding: 14px;
}

.mock-pill {
  height: 12px;
  width: 46%;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  margin-bottom: 14px;
}

.mock-chart {
  height: 84px;
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(99,102,241,0.22), transparent 45%),
    rgba(255,255,255,0.76);
  margin-bottom: 12px;
}

.mock-chart.small {
  height: 64px;
}

.mock-row {
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  margin-bottom: 10px;
}

.mock-row.short {
  width: 66%;
}

.compact-bottom .home-bottom-copy {
  margin-top: 16px;
  line-height: 1.8;
  max-width: 78ch;
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.preset-chip {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.preset-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.print-sheet {
  display: none;
}

.print-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.print-sheet h1 {
  margin: 0;
  font-size: 1.7rem;
}

.print-subtitle {
  margin: 4px 0 0;
  color: #475569;
}

.print-date {
  color: #475569;
  font-size: 0.95rem;
}

.print-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.print-summary-card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.print-summary-card span {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 4px;
}

.print-summary-card strong {
  font-size: 1.05rem;
}

.print-section {
  margin-top: 22px;
}

.print-section h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.print-block {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  break-inside: avoid;
}

.print-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.print-block-meta,
.print-block-details,
.print-note {
  color: #334155;
  line-height: 1.55;
}

.print-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}

.print-spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

/* =========================================
   CLEANER UI PASS — paste at very bottom
   ========================================= */

/* 1) tighten the global page width */
.topbar-inner,
.page,
.tabs-row .tabs {
  width: min(1200px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

/* 2) make the top row feel cleaner */
.topbar {
  background: rgba(249, 251, 255, 0.92);
  border-bottom: 1px solid rgba(219, 229, 241, 0.75);
}

.topbar-inner {
  padding: 14px 0;
  gap: 14px;
}

.topbar-meta {
  gap: 8px;
}

.meta-pill {
  padding: 8px 12px;
  font-size: 0.86rem;
  background: rgba(255,255,255,0.72);
}

/* 3) make the tabs look less chunky */
.tabs-row {
  border-top: 1px solid rgba(219, 229, 241, 0.72);
}

.tabs {
  gap: 8px;
  padding: 10px 0 14px;
}

.tab-btn {
  padding: 10px 14px;
  font-size: 0.95rem;
  border-radius: 999px;
  box-shadow: none;
}

.tab-btn:hover {
  transform: translateY(0);
  box-shadow: none;
  background: rgba(255,255,255,0.96);
}

/* 4) tighten the home page hero */
.hero {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
  gap: 20px;
  padding: clamp(22px, 2.5vw, 30px);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(13, 32, 66, 0.06);
}

.hero h2 {
  font-size: clamp(1.9rem, 1.8vw + 1rem, 2.5rem);
  margin: 8px 0 12px;
}

.hero p {
  max-width: 68ch;
  line-height: 1.7;
}

/* 5) make the right radar panel feel like a companion,
      not a second giant slab */
.px-hero-side,
.hero-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.px-hero-side .glass-card,
.hero-side .glass-card,
.hero .glass-card {
  width: min(100%, 420px);
}

.hero-side-panel {
  width: min(100%, 390px);
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(219, 229, 241, 0.9);
  box-shadow: 0 6px 16px rgba(13, 32, 66, 0.04);
}

.px-hero-side,
.hero-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* 6) soften the card system overall */
.glass-card,
.section-card,
.calc-card,
.activity-card,
.plan-card,
.feature-card,
.step-card,
.info-card,
.home-card-section {
  border-radius: 20px;
  border: 1px solid rgba(219, 229, 241, 0.82);
  box-shadow: 0 8px 22px rgba(13, 32, 66, 0.05);
}

/* 7) reduce the "boxy" feeling on cards */
.glass-card,
.home-card-section {
  padding: 20px;
}

/* 8) make the radar image section cleaner */
.specifier-image-wrap {
  position: relative;
  margin: 14px 0 12px;
  display: flex;
  justify-content: center;
}

.specifier-figure {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.specifier-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(13, 32, 66, 0.08);
}

/* 9) make buttons cleaner */
.btn,
button.btn {
  border-radius: 12px;
}

.hero-actions .btn,
.button-row .btn,
.inline-actions .btn,
.action-row .btn {
  padding: 10px 14px;
}

/* 10) keep the hero 2-column layout a little longer */
@media (max-width: 980px) {
  .hero,
  .px-hero,
  .plan-grid,
  .specifier-layout,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}


@page {
  size: auto;
  margin: 0.5in;
}

@media (max-width: 1100px) {
  .px-hero,
  .coming-soon-panel,
  .px-card-grid.three,
  .px-card-grid.two,
  .px-stats {
    grid-template-columns: 1fr;
  }

  .px-hero {
    padding: 22px;
  }

  .device-mock-wrap {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .home-card-section,
  .glass-card {
    padding: 18px;
  }

  .px-hero h2 {
    font-size: 2.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
.specifier-engine-card .specifier-engine-chart,
.specifier-modal-card .specifier-engine-chart {
  margin: 14px 0 18px;
  min-height: 260px;
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.specifier-engine-chart.expanded {
  min-height: 520px;
}

.specifier-grid-compact {
  display: grid;
  gap: 12px;
}

.specifier-grid-compact .specifier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 1fr) 42px;
  gap: 12px;
  align-items: center;
}

.specifier-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.56);
  display: grid;
  place-items: center;
  padding: 24px;
}

.specifier-modal-shell {
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.specifier-modal-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 22px;
}

@media print {
  body {
    background: #ffffff !important;
  }

  body * {
    visibility: hidden;
  }

  #printPlanSheet,
  #printPlanSheet * {
    visibility: visible;
  }

  #printPlanSheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    background: #ffffff;
    color: #111827;
  }
}
