:root {
  color-scheme: light;
  --font-ui: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Manrope, sans-serif;
  --bg: #f5f6f8;
  --bg-soft: #eceff4;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: #f3f5f9;
  --surface-elevated: #ffffff;
  --line: #d9dfeb;
  --line-strong: #c5cedd;
  --text: #111217;
  --muted: #646b78;
  --muted-strong: #4b5361;
  --primary: #0a74ff;
  --primary-strong: #035fd1;
  --primary-soft: #e8f2ff;
  --success: #0a9d75;
  --warning-bg: #fff5e8;
  --warning-border: #f1d6aa;
  --warning-text: #8d5a07;
  --danger-bg: #fff1f1;
  --danger-border: #efb7b7;
  --danger-text: #af2c2c;
  --shadow-soft: 0 30px 70px rgba(15, 28, 52, 0.08);
  --shadow-card: 0 18px 44px rgba(11, 28, 51, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218;
  --bg-soft: #171d27;
  --surface: rgba(22, 27, 37, 0.84);
  --surface-strong: #1f2633;
  --surface-muted: #242c3b;
  --surface-elevated: #202938;
  --line: #343f52;
  --line-strong: #45556d;
  --text: #f5f7fb;
  --muted: #a2abbb;
  --muted-strong: #c2cad7;
  --primary: #4da1ff;
  --primary-strong: #78b7ff;
  --primary-soft: #1f3e60;
  --success: #27c49a;
  --warning-bg: #3e3323;
  --warning-border: #67573a;
  --warning-text: #ffd49a;
  --danger-bg: #42272b;
  --danger-border: #75474f;
  --danger-text: #ffb8be;
  --shadow-soft: 0 30px 70px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 18px 44px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.58;
  background:
    radial-gradient(circle at 10% 8%, rgba(11, 116, 255, 0.13), transparent 38%),
    radial-gradient(circle at 90% 82%, rgba(86, 194, 164, 0.13), transparent 35%),
    linear-gradient(160deg, #ffffff 0%, #f7f8fb 38%, var(--bg) 100%);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 8%, rgba(54, 128, 210, 0.19), transparent 38%),
    radial-gradient(circle at 90% 82%, rgba(58, 132, 114, 0.16), transparent 35%),
    linear-gradient(160deg, #171c26 0%, #121821 40%, var(--bg) 100%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: rgba(10, 116, 255, 0.22);
  color: var(--text);
}

.container {
  width: min(100% - 42px, var(--container));
  margin-inline: auto;
}

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(rgba(17, 23, 37, 0.05) 0.45px, transparent 0.45px);
  background-size: 4px 4px;
}

html[data-theme="dark"] .noise-layer {
  opacity: 0.17;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 0.45px, transparent 0.45px);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(86px);
  z-index: -2;
  opacity: 0.66;
}

.orb-1 {
  top: 96px;
  left: -125px;
  width: 360px;
  height: 360px;
  background: #bfdfff;
}

.orb-2 {
  right: -120px;
  bottom: 70px;
  width: 330px;
  height: 330px;
  background: #c5f0df;
}

html[data-theme="dark"] .orb-1 {
  background: #2f5e97;
}

html[data-theme="dark"] .orb-2 {
  background: #2f6357;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(165%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(170%);
}

html[data-theme="dark"] .site-header {
  background: rgba(17, 22, 30, 0.78);
}

.nav {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand-wordmark {
  font-size: 1.92rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #5baeff, #7adbc0);
  color: #05213f;
  font-weight: 800;
}

.brand-badge-logo {
  width: 58px;
  height: 58px;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.8);
  transform-origin: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 610;
  letter-spacing: -0.01em;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: var(--surface-muted);
}

.nav-links a.is-active {
  color: var(--text);
  background: rgba(10, 116, 255, 0.1);
}

.nav-links .nav-build-cta {
  color: #ffffff;
  border: 1px solid rgba(3, 95, 209, 0.8);
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  box-shadow: 0 12px 28px rgba(10, 116, 255, 0.28);
}

.nav-links .nav-build-cta:hover,
.nav-links .nav-build-cta:focus-visible {
  color: #ffffff;
  background: linear-gradient(145deg, #2383ff, #0567df);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 11px;
  line-height: 1;
}

.theme-toggle {
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.8rem;
  line-height: 1;
}

.hero {
  position: relative;
}

.hero-home {
  padding: 86px 0 56px;
}

.hero-headline-band {
  margin-bottom: 24px;
}

.hero-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(10, 116, 255, 0.22);
  background: rgba(232, 242, 255, 0.76);
  color: var(--primary-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] .hero-status {
  background: rgba(38, 65, 95, 0.66);
  border-color: rgba(96, 156, 228, 0.35);
  color: #9dc9ff;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 34px;
}

.hero-copy-shell {
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-strong);
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.hero h1,
.page-intro h1 {
  margin: 0;
  letter-spacing: -0.05em;
  line-height: 1.01;
  font-size: clamp(2.5rem, 5vw, 5.05rem);
}

.hero-copy {
  margin: 19px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions,
.form-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.93rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.17s ease, box-shadow 0.17s ease, border-color 0.17s ease, background-color 0.17s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  border-color: rgba(3, 95, 209, 0.88);
  box-shadow: 0 14px 30px rgba(10, 116, 255, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 16px 32px rgba(10, 116, 255, 0.33);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--surface-muted);
  border-color: var(--line);
}

.hero-trust {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.trust-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 14px;
}

html[data-theme="dark"] .trust-card {
  background: rgba(33, 41, 56, 0.66);
}

.trust-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.93rem;
  letter-spacing: -0.01em;
}

.trust-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-panel {
  padding: 24px;
}

.hero-panel-preview {
  position: relative;
  overflow: hidden;
}

.hero-panel-preview::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(10, 116, 255, 0.12), transparent 36%, rgba(103, 198, 176, 0.11) 100%);
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(10, 157, 117, 0.18);
}

.protocol-preview {
  display: grid;
  gap: 11px;
  position: relative;
  z-index: 1;
}

.time-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px 15px 14px;
  background: rgba(249, 251, 255, 0.86);
}

html[data-theme="dark"] .time-block {
  background: rgba(35, 44, 60, 0.78);
}

.time-block h4 {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted-strong);
}

.time-block p {
  margin: 4px 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.014em;
}

.time-block small {
  color: var(--muted);
}

.section {
  padding: 74px 0;
}

.signature-band {
  padding-top: 0;
}

.signature-band-inner {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.signature-band-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-intro {
  padding: 52px 0 0;
}

.intro-shell {
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.intro-shell::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -36px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(10, 116, 255, 0.16), transparent 70%);
  pointer-events: none;
}

html[data-theme="dark"] .intro-shell::after {
  background: radial-gradient(circle, rgba(72, 151, 236, 0.18), transparent 70%);
}

.intro-shell h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.intro-shell p {
  margin: 14px 0 0;
  max-width: 66ch;
  color: var(--muted);
}

.intro-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.section-heading {
  margin-bottom: 24px;
  max-width: 72ch;
}

.section-heading h2 {
  margin: 0;
  letter-spacing: -0.036em;
  font-size: clamp(1.86rem, 3vw, 3rem);
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.builder-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.builder-aside {
  padding: 22px;
  position: sticky;
  top: 104px;
}

.builder-aside h3 {
  margin: 0;
  letter-spacing: -0.02em;
  font-size: 1.22rem;
}

.builder-aside > p {
  margin: 9px 0 0;
  color: var(--muted);
}

.builder-points {
  margin: 16px 0 18px;
  display: grid;
  gap: 10px;
}

.builder-points p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.builder-main {
  min-width: 0;
}

.form-card,
.results-card,
.why-card,
.info-card,
.footer-note,
.quality-card {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.9rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
  transition: border-color 0.17s ease, box-shadow 0.17s ease, background-color 0.17s ease;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: rgba(30, 38, 52, 0.9);
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8790a0;
}

select[multiple] {
  min-height: 168px;
  padding: 7px;
}

select[multiple] option {
  border-radius: 8px;
  margin: 2px 0;
  padding: 6px 7px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(10, 116, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(10, 116, 255, 0.16);
}

.hidden {
  display: none !important;
}

.yes-no-group {
  display: inline-flex;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 999px;
  padding: 4px;
}

.yes-no-option {
  position: relative;
}

.yes-no-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.yes-no-option span {
  min-width: 82px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 620;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.yes-no-option input:checked + span {
  border-color: rgba(10, 116, 255, 0.3);
  background: rgba(10, 116, 255, 0.11);
  color: var(--primary-strong);
}

.current-picker {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 10px;
}

.current-picker .btn {
  white-space: nowrap;
}

.selected-items {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-chip {
  border-radius: 999px;
  border: 1px solid rgba(10, 116, 255, 0.24);
  background: rgba(232, 242, 255, 0.84);
  color: #184b86;
  padding: 5px 11px;
  font-size: 0.82rem;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

html[data-theme="dark"] .selected-chip {
  color: #d5e9ff;
  background: rgba(36, 63, 94, 0.62);
  border-color: rgba(114, 166, 232, 0.35);
}

.selected-chip button {
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(10, 116, 255, 0.18);
  color: #1d4d83;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

html[data-theme="dark"] .selected-chip button {
  color: #d5e9ff;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: rgba(249, 251, 255, 0.9);
}

.checkbox-grid input {
  width: auto;
  margin: 0;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.results-grid-optimized {
  grid-template-columns: 1.2fr 0.8fr;
}

.results-primary-card {
  grid-row: span 2;
}

.protocol-overview {
  padding-bottom: 18px;
}

.protocol-summary-shell {
  padding: 28px;
}

.protocol-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.protocol-subtitle {
  margin-top: 12px;
  max-width: 62ch;
}

.protocol-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.protocol-summary-meta {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.protocol-stats {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.protocol-stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(249, 251, 255, 0.82);
  padding: 14px;
}

html[data-theme="dark"] .protocol-stat-card {
  background: rgba(34, 42, 56, 0.76);
}

.protocol-stat-card h3 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: -0.015em;
}

.protocol-stat-card .stat-value {
  margin: 8px 0 4px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.protocol-stat-card-confidence.confidence-high {
  border-color: rgba(36, 149, 86, 0.36);
  background: linear-gradient(145deg, rgba(237, 251, 242, 0.94), rgba(245, 255, 249, 0.9));
}

.protocol-stat-card-confidence.confidence-moderate {
  border-color: rgba(214, 158, 46, 0.34);
  background: linear-gradient(145deg, rgba(255, 248, 231, 0.92), rgba(255, 252, 242, 0.88));
}

.protocol-stat-card-confidence.confidence-cautious {
  border-color: rgba(225, 114, 54, 0.36);
  background: linear-gradient(145deg, rgba(255, 240, 234, 0.92), rgba(255, 248, 244, 0.88));
}

html[data-theme="dark"] .protocol-stat-card-confidence.confidence-high {
  border-color: rgba(93, 212, 149, 0.48);
  background: linear-gradient(145deg, rgba(20, 62, 44, 0.84), rgba(14, 46, 32, 0.84));
}

html[data-theme="dark"] .protocol-stat-card-confidence.confidence-moderate {
  border-color: rgba(234, 190, 98, 0.42);
  background: linear-gradient(145deg, rgba(78, 59, 24, 0.84), rgba(64, 48, 18, 0.84));
}

html[data-theme="dark"] .protocol-stat-card-confidence.confidence-cautious {
  border-color: rgba(245, 150, 102, 0.44);
  background: linear-gradient(145deg, rgba(84, 42, 28, 0.84), rgba(67, 33, 21, 0.84));
}

.protocol-confidence-pill,
.evidence-strength-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.protocol-confidence-pill.confidence-high,
.evidence-strength-pill.evidence-high {
  color: #0f6b3f;
  background: rgba(20, 145, 80, 0.14);
  border-color: rgba(20, 145, 80, 0.3);
}

.protocol-confidence-pill.confidence-moderate,
.evidence-strength-pill.evidence-moderate {
  color: #7e5709;
  background: rgba(214, 158, 46, 0.17);
  border-color: rgba(214, 158, 46, 0.31);
}

.protocol-confidence-pill.confidence-cautious,
.evidence-strength-pill.evidence-emerging {
  color: #8a3d13;
  background: rgba(225, 114, 54, 0.15);
  border-color: rgba(225, 114, 54, 0.31);
}

html[data-theme="dark"] .protocol-confidence-pill.confidence-high,
html[data-theme="dark"] .evidence-strength-pill.evidence-high {
  color: #b8f6d8;
  background: rgba(32, 137, 83, 0.32);
  border-color: rgba(113, 225, 170, 0.46);
}

html[data-theme="dark"] .protocol-confidence-pill.confidence-moderate,
html[data-theme="dark"] .evidence-strength-pill.evidence-moderate {
  color: #ffdea0;
  background: rgba(176, 124, 33, 0.32);
  border-color: rgba(247, 204, 123, 0.44);
}

html[data-theme="dark"] .protocol-confidence-pill.confidence-cautious,
html[data-theme="dark"] .evidence-strength-pill.evidence-emerging {
  color: #ffd0b3;
  background: rgba(175, 92, 44, 0.33);
  border-color: rgba(245, 155, 112, 0.46);
}

.confidence-inline-row {
  margin-bottom: 10px;
}

.confidence-breakdown-toggle {
  margin-top: 8px;
}

.confidence-breakdown-popover {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
}

html[data-theme="dark"] .confidence-breakdown-popover {
  background: rgba(19, 25, 35, 0.88);
}

.confidence-breakdown-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.confidence-breakdown-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.confidence-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.83rem;
}

.confidence-breakdown-row strong {
  font-size: 0.83rem;
}

.confidence-breakdown-row.confidence-row-bonus strong,
.confidence-breakdown-row.confidence-row-evidence strong {
  color: #0f6b3f;
}

.confidence-breakdown-row.confidence-row-penalty strong {
  color: #8a3d13;
}

html[data-theme="dark"] .confidence-breakdown-row.confidence-row-bonus strong,
html[data-theme="dark"] .confidence-breakdown-row.confidence-row-evidence strong {
  color: #b8f6d8;
}

html[data-theme="dark"] .confidence-breakdown-row.confidence-row-penalty strong {
  color: #ffd0b3;
}

.confidence-breakdown-note,
.confidence-breakdown-empty {
  margin: 8px 0 0;
}

.protocol-results-section {
  padding-top: 18px;
}

.results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.results-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.86rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

html[data-theme="dark"] .results-tab {
  background: rgba(32, 40, 54, 0.8);
}

.results-tab:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.results-tab.is-active {
  color: var(--primary-strong);
  border-color: rgba(10, 116, 255, 0.3);
  background: rgba(232, 242, 255, 0.88);
}

html[data-theme="dark"] .results-tab.is-active {
  color: #a5ceff;
  background: rgba(34, 65, 99, 0.72);
}

.results-panel {
  display: none;
}

.results-panel.is-active {
  display: block;
}

.results-panel-card {
  padding: 22px;
}

.section-intro-copy {
  margin: -4px 0 14px;
}

.results-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

.results-panel-actions-wide {
  margin-bottom: 12px;
}

.results-panel-actions .btn {
  padding: 6px 10px;
  font-size: 0.74rem;
  line-height: 1.1;
}

.insights-layout {
  display: grid;
  gap: 16px;
}

.schedule-time-group + .schedule-time-group {
  margin-top: 18px;
}

.schedule-time-head {
  margin-bottom: 10px;
}

.schedule-time-head h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.schedule-time-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.schedule-timeline-list {
  display: grid;
  gap: 10px;
}

.schedule-timeline-item {
  position: relative;
  padding: 14px;
}

.schedule-glance-overview {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

html[data-theme="dark"] .schedule-glance-overview {
  background: rgba(27, 35, 49, 0.74);
}

.compact-summary-stack {
  display: grid;
  gap: 5px;
}

.schedule-item-quick p {
  margin: 5px 0 0;
}

.schedule-item-quick p:first-child {
  margin-top: 0;
}

.schedule-item-glance,
.supplement-card-glance {
  margin: 0;
}

.compact-summary-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.schedule-detail-panel {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.schedule-detail-toggle {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--primary-strong);
  font-weight: 620;
}

.schedule-detail-panel[open] .schedule-detail-toggle {
  margin-bottom: 8px;
}

.schedule-detail-body {
  display: grid;
  gap: 4px;
}

.supplements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.protocol-priority-stack {
  display: grid;
  gap: 10px;
}

.protocol-priority-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

html[data-theme="dark"] .protocol-priority-section {
  background: rgba(30, 38, 52, 0.82);
}

.protocol-priority-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.protocol-priority-summary::-webkit-details-marker {
  display: none;
}

.protocol-priority-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.protocol-priority-meta {
  font-size: 0.8rem;
  color: var(--muted-strong);
  text-align: right;
}

.protocol-priority-summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--muted-strong);
  justify-self: end;
  transition: transform 180ms ease;
}

.protocol-priority-section[open] .protocol-priority-summary::after {
  transform: rotate(180deg);
}

.protocol-priority-body {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.protocol-priority-note,
.protocol-priority-empty {
  margin: 0;
}

.supplement-filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.supplement-filter-dropdown {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .supplement-filter-dropdown {
  background: rgba(28, 36, 50, 0.82);
}

.supplement-filter-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
}

.supplement-filter-summary::-webkit-details-marker {
  display: none;
}

.supplement-filter-summary::after {
  content: "▾";
  color: var(--muted-strong);
  font-size: 0.92rem;
  transition: transform 180ms ease;
}

.supplement-filter-dropdown[open] .supplement-filter-summary::after {
  transform: rotate(180deg);
}

.supplement-filter-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.supplement-filter-value {
  font-weight: 700;
  color: var(--text);
}

.supplement-filter-menu {
  border-top: 1px solid var(--line);
  padding: 8px;
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.supplement-filter-option {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

html[data-theme="dark"] .supplement-filter-option {
  background: rgba(20, 28, 42, 0.82);
}

.supplement-filter-option:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.supplement-filter-option.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 72%, white 28%);
}

html[data-theme="dark"] .supplement-filter-option.is-active {
  background: color-mix(in srgb, var(--primary-soft) 36%, #0b1220 64%);
}

.supplement-filter-no-items {
  margin: 2px 2px 4px;
}

.supplement-filter-note,
.supplement-filter-empty {
  margin: 0 0 10px;
}

.food-target-line {
  opacity: 0.72;
}

.supplement-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(249, 251, 255, 0.86);
  padding: 14px;
}

html[data-theme="dark"] .supplement-card {
  background: rgba(34, 42, 56, 0.78);
}

.supplement-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.supplement-card-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.supplement-priority-pill.priority-primary {
  border-color: color-mix(in srgb, var(--primary) 46%, white 54%);
  background: color-mix(in srgb, var(--primary-soft) 74%, white 26%);
  color: var(--primary-strong);
}

.supplement-priority-pill.priority-secondary {
  border-color: color-mix(in srgb, #7f8ea3 42%, white 58%);
  background: color-mix(in srgb, #dfe7f1 68%, white 32%);
  color: #445266;
}

html[data-theme="dark"] .supplement-priority-pill.priority-primary {
  border-color: color-mix(in srgb, var(--primary) 54%, #111827 46%);
  background: color-mix(in srgb, var(--primary-soft) 34%, #111827 66%);
  color: color-mix(in srgb, #c7ffd8 82%, white 18%);
}

html[data-theme="dark"] .supplement-priority-pill.priority-secondary {
  border-color: rgba(170, 183, 202, 0.35);
  background: rgba(66, 79, 99, 0.55);
  color: #d5deeb;
}

.supplement-card-head h4 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.supplement-card-actions {
  margin-top: 10px;
}

.supplement-card .schedule-detail-panel {
  margin-top: 12px;
}

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

.alert-overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(249, 251, 255, 0.84);
  padding: 12px;
}

html[data-theme="dark"] .alert-overview-card {
  background: rgba(34, 42, 56, 0.76);
}

.alert-overview-card h4 {
  margin: 0;
  font-size: 1.38rem;
  letter-spacing: -0.03em;
}

.alert-overview-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.reason-context-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(249, 251, 255, 0.84);
  padding: 12px;
  margin-bottom: 12px;
}

html[data-theme="dark"] .reason-context-card {
  background: rgba(34, 42, 56, 0.76);
}

.reason-sources-panel {
  margin-top: 12px;
}

.reason-item .schedule-detail-panel {
  margin-top: 10px;
}

.source-list {
  margin-top: 10px;
}

.reason-citation-row {
  margin-top: 8px;
}

.reason-citation-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reason-citation-links {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-citation-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

html[data-theme="dark"] .reason-citation-link {
  background: rgba(26, 34, 46, 0.8);
}

.reason-citation-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.tracking-layout {
  display: grid;
  gap: 12px;
}

.tracking-card-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(249, 251, 255, 0.84);
  padding: 14px;
}

html[data-theme="dark"] .tracking-card-block {
  background: rgba(34, 42, 56, 0.76);
}

.tracking-card-block h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: -0.014em;
}

.tracking-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.tracking-list-full {
  margin-top: 10px;
}

.tracking-evidence {
  display: block;
  margin-top: 4px;
}

.tracking-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tracking-safety-gate {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.tracking-safety-gate p {
  margin: 0;
}

.tracking-safety-gate .btn {
  margin-top: 8px;
}

.tracking-safety-gate.is-blocking {
  border-color: rgba(220, 53, 69, 0.4);
  background: rgba(220, 53, 69, 0.08);
}

.tracking-safety-gate.is-cleared,
.tracking-safety-gate.is-clear {
  border-color: rgba(20, 123, 80, 0.35);
  background: rgba(20, 123, 80, 0.08);
}

.tracking-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.tracking-last-saved {
  margin-top: 8px;
  opacity: 0.84;
}

.tracking-version-name-input,
.tracking-version-notes-input,
.tracking-compare-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

.tracking-version-notes-input {
  margin-top: 8px;
  resize: vertical;
  min-height: 68px;
}

.tracking-version-status {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.tracking-version-status.is-success {
  border-color: rgba(20, 123, 80, 0.4);
  background: rgba(20, 123, 80, 0.08);
}

.tracking-version-status.is-warning {
  border-color: rgba(198, 146, 32, 0.4);
  background: rgba(198, 146, 32, 0.08);
}

.tracking-version-status.is-error {
  border-color: rgba(220, 53, 69, 0.4);
  background: rgba(220, 53, 69, 0.08);
}

.tracking-version-history-head {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tracking-version-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.tracking-version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
}

.tracking-version-title {
  margin: 0;
  font-weight: 700;
}

.tracking-version-item .meta {
  margin: 4px 0 0;
}

.tracking-version-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px;
  color: var(--muted);
  background: var(--surface-muted);
}

.tracking-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.tracking-compare-grid label {
  display: grid;
  gap: 4px;
}

.tracking-compare-actions {
  margin-top: 8px;
}

.tracking-compare-output {
  margin-top: 8px;
}

.tracking-compare-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
}

.tracking-compare-card h5 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.tracking-compare-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tracking-compare-label {
  margin: 6px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted-strong);
}

.tracking-compare-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.dose-reason-panel {
  margin-top: 8px;
}

.why-card {
  margin-top: 18px;
}

.card-head {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-head h3 {
  margin: 0;
  font-size: 1.17rem;
  letter-spacing: -0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.77rem;
  color: var(--muted);
  background: var(--surface-muted);
  font-weight: 600;
}

.pill-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-text);
}

.empty-state {
  color: var(--muted);
}

.empty-state a {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.schedule-list,
.alert-list,
.reason-list,
.quality-list {
  display: grid;
  gap: 12px;
}

.schedule-item,
.alert-item,
.reason-item,
.library-card,
.metric-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(249, 251, 255, 0.88);
}

html[data-theme="dark"] .schedule-item,
html[data-theme="dark"] .alert-item,
html[data-theme="dark"] .reason-item,
html[data-theme="dark"] .library-card,
html[data-theme="dark"] .metric-item {
  background: rgba(34, 42, 56, 0.76);
}

.schedule-item,
.alert-item,
.reason-item,
.library-card {
  padding: 15px;
}

.schedule-item h4,
.alert-item h4,
.reason-item h4,
.library-card h3,
.info-card h3,
.footer-note h3,
.quality-card h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.schedule-item-head {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-select-btn {
  padding: 6px 9px;
  font-size: 0.74rem;
  line-height: 1;
}

.schedule-select-btn.is-selected {
  border-color: rgba(10, 116, 255, 0.35);
  background: rgba(10, 116, 255, 0.12);
  color: var(--primary-strong);
}

.schedule-select-btn.is-excluded {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted);
}

.schedule-item.selected {
  border-color: rgba(10, 116, 255, 0.34);
}

.schedule-item.excluded {
  opacity: 0.66;
}

.schedule-item.excluded .schedule-item-body {
  display: none;
}

.schedule-item.excluded .schedule-item-head {
  margin-bottom: 0;
}

.schedule-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 10px;
}

.schedule-item p,
.alert-item p,
.reason-item p,
.library-card p,
.info-card p,
.footer-note p,
.quality-card p {
  margin: 7px 0 0;
}

.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-item {
  padding: 11px;
}

.metric-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-value {
  font-weight: 650;
  letter-spacing: -0.012em;
}

.alert-item.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.alert-item.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.library-grid,
.safety-grid {
  display: grid;
  gap: 18px;
}

.library-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.safety-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.library-card .tag-row {
  margin: 13px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  border: 1px solid rgba(10, 116, 255, 0.2);
  background: rgba(232, 242, 255, 0.76);
  color: #205591;
  padding: 6px 9px;
  font-size: 0.75rem;
  font-weight: 600;
}

html[data-theme="dark"] .tag {
  color: #d5e8ff;
  border-color: rgba(98, 160, 236, 0.35);
  background: rgba(34, 64, 97, 0.62);
}

.quality-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quality-layout > .section-heading {
  grid-column: 1 / -1;
}

.quality-card h4 {
  margin: 10px 0 0;
}

.quality-list {
  margin: 7px 0 0;
  padding-left: 18px;
}

.quality-list li {
  margin: 0;
}

.quality-list a {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quality-full {
  grid-column: 1 / -1;
}

.quality-btn {
  display: inline-flex;
  padding: 8px 13px;
  font-size: 0.81rem;
}

.disclaimer-bar {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

html[data-theme="dark"] .disclaimer-bar {
  background: rgba(23, 30, 41, 0.66);
}

.disclaimer-bar .container {
  padding: 14px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  padding: 26px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-inner a:hover {
  opacity: 0.86;
}

@media (max-width: 1180px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-aside {
    position: static;
  }

  .results-grid-optimized {
    grid-template-columns: 1fr;
  }

  .results-primary-card {
    grid-row: auto;
  }
}

@media (max-width: 1020px) {
  .hero-grid,
  .safety-grid,
  .quality-layout,
  .hero-trust,
  .form-grid,
  .current-picker,
  .metric-grid,
  .checkbox-grid,
  .protocol-stats,
  .alerts-overview-grid {
    grid-template-columns: 1fr;
  }

  .quality-layout > .section-heading,
  .quality-full {
    grid-column: auto;
  }

  .hero h1,
  .page-intro h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .nav {
    min-height: 74px;
  }

  .brand-wordmark {
    font-size: 1.6rem;
  }

  .brand-badge-logo {
    width: 50px;
    height: 50px;
  }

  .brand-logo {
    transform: scale(1.72);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: absolute;
    top: 74px;
    left: 12px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft);
  }

  html[data-theme="dark"] .nav-links {
    background: rgba(24, 31, 43, 0.95);
  }

  .nav-links a,
  .theme-toggle {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .nav-links.open {
    display: flex;
  }

  .hero-home {
    padding-top: 48px;
  }

  .protocol-summary-head {
    flex-direction: column;
    align-items: stretch;
  }

  .protocol-summary-actions {
    width: 100%;
  }

  .protocol-summary-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .results-tabs {
    gap: 6px;
  }

  .results-tab {
    width: 100%;
    text-align: center;
  }

  .hero h1,
  .page-intro h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .section {
    padding: 60px 0;
  }

  .page-intro {
    padding-top: 34px;
  }

  .intro-shell,
  .form-card,
  .results-card,
  .why-card,
  .info-card,
  .footer-note,
  .quality-card,
  .builder-aside,
  .hero-panel {
    padding: 18px;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* === Reference-inspired redesign overrides === */
:root {
  --bg: #eff1ec;
  --bg-soft: #e7e9e4;
  --surface: rgba(248, 248, 245, 0.92);
  --surface-strong: #f7f7f4;
  --surface-muted: #eceee9;
  --surface-elevated: #fbfbf8;
  --line: #d8dbd3;
  --line-strong: #c7cbc2;
  --text: #0d0f0f;
  --muted: #6f736d;
  --muted-strong: #4d514c;
  --primary: #31c973;
  --primary-strong: #1db861;
  --primary-soft: #e6f8ee;
  --shadow-soft: 0 18px 40px rgba(12, 15, 12, 0.05);
  --shadow-card: 0 12px 24px rgba(12, 15, 12, 0.035);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --container: 1230px;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.noise-layer {
  opacity: 0.10;
  background-image: radial-gradient(rgba(17, 20, 18, 0.06) 0.55px, transparent 0.55px);
  background-size: 10px 10px;
}

.bg-orb { display: none; }

.container {
  width: min(100% - 48px, var(--container));
}

.site-header {
  position: sticky;
  top: 0;
  padding-top: 10px;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

.nav {
  min-height: 82px;
  padding: 10px 22px;
  border: 1px solid rgba(255,255,255,0.95);
  background: rgba(243, 244, 239, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  margin-top: 2px;
}

.brand-wordmark {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-badge-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.brand-logo {
  transform: scale(1.35);
}

.nav-links {
  gap: 12px;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 14px;
  color: #777b75;
  background: transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  background: transparent;
  color: var(--text);
}

.nav-links .nav-build-cta,
.btn-primary {
  background: #0d0f0f;
  border-color: #0d0f0f;
  color: #fff;
  box-shadow: none;
  padding-inline: 22px;
}

.nav-links .nav-build-cta:hover,
.btn-primary:hover {
  background: #171919;
  border-color: #171919;
  color: #fff;
}

.hero-home {
  padding: 46px 0 72px;
}

.hero-headline-band {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.hero-status,
.eyebrow {
  background: transparent;
  border: 0;
  padding: 0;
  color: #7b7f79;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.hero-status::before,
.eyebrow::before {
  content: "•";
  color: var(--primary);
  margin-right: 8px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 34px;
  align-items: center;
}

.hero-copy-shell {
  max-width: 760px;
}

.hero h1,
.page-intro h1,
.section-heading h2 {
  font-size: clamp(3rem, 7vw, 5.6rem);
  letter-spacing: -0.07em;
  line-height: 0.94;
  text-wrap: balance;
}

.hero h1 em,
.page-intro h1 em,
.section-heading h2 em,
#qualityTitle em {
  font-style: italic;
  font-weight: 500;
  color: #242724;
}

.hero-copy,
.intro-shell p,
.section-heading p,
.signature-band-inner p,
.meta,
.time-block small,
.library-card p,
.info-card p,
.footer-note p,
.quality-card p,
.quality-list li {
  color: var(--muted);
}

.hero-copy {
  font-size: 1.12rem;
  max-width: 56ch;
}

.hero-actions, .form-actions {
  margin-top: 26px;
}

.btn,
.results-tab,
.pill,
.tag,
.yes-no-option span {
  border-radius: 999px;
}

.btn-secondary {
  background: #f5f6f2;
  border-color: var(--line);
  color: var(--text);
}

.hero-trust {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.trust-card,
.library-card,
.info-card,
.footer-note,
.quality-card,
.protocol-stat-card,
.results-card,
.time-block,
.intro-shell,
.hero-panel,
.glass {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(248, 248, 245, 0.84);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.trust-card {
  padding: 18px;
  min-height: 130px;
}

.trust-card strong,
.library-card h3,
.info-card h3,
.protocol-stat-card h3,
.card-head h3,
.quality-card h3 {
  font-size: 1.1rem;
  letter-spacing: -0.035em;
}

.hero-panel {
  padding: 26px;
  position: relative;
  overflow: hidden;
}

.hero-panel-preview::before {
  background: radial-gradient(circle at center, rgba(49, 201, 115, 0.10), transparent 60%);
}

.panel-top {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 5px rgba(49, 201, 115, 0.12);
  background: var(--primary);
}

.time-block h4 {
  color: #7d817c;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.time-block p {
  font-size: 1.05rem;
  margin: 8px 0 6px;
}

.signature-band-inner {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.disclaimer-bar {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  color: #5c615b;
  background: rgba(245,246,241,0.7);
}

.site-footer {
  padding: 34px 0 48px;
  background: transparent;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #686c67;
}

.page-intro {
  padding-top: 42px;
}

.intro-shell {
  padding: 38px;
}

.intro-shell::after { display: none; }

.library-grid,
.safety-grid,
.quality-layout {
  gap: 18px;
}

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

.library-card,
.quality-card,
.info-card,
.results-card,
.protocol-stat-card {
  padding: 20px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.tag,
.pill {
  padding: 9px 13px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #f3f4ef;
  border: 1px solid var(--line);
  color: #555954;
}

.pill-warning {
  background: #f7f0dd;
  border-color: #eadbb1;
  color: #7b6121;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-page="safety"] .section#safety {
  background: #080a09;
  margin: 36px 24px 0;
  border-radius: 34px;
  position: relative;
  overflow: hidden;
}

body[data-page="safety"] .section#safety::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 0.6px, transparent 0.6px);
  background-size: 18px 18px;
  opacity: 0.32;
}

body[data-page="safety"] .section#safety .container {
  position: relative;
  z-index: 1;
}

body[data-page="safety"] .safety-grid,
body[data-page="safety"] .footer-note {
  color: #f5f6f3;
}

body[data-page="safety"] .info-card,
body[data-page="safety"] .footer-note {
  background: rgba(10, 12, 11, 0.82);
  border-color: rgba(255,255,255,0.08);
}

body[data-page="safety"] .info-card h3,
body[data-page="safety"] .footer-note h3,
body[data-page="safety"] .intro-shell h1,
body[data-page="safety"] .eyebrow {
  color: inherit;
}

body[data-page="optimized"] .protocol-summary-shell,
body[data-page="quality"] .section .quality-layout > .section-heading {
  background: rgba(248,248,245,0.9);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 28px;
}

.results-tabs {
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.results-tab {
  border: 1px solid var(--line);
  background: #f5f6f2;
  padding: 12px 16px;
  font-weight: 700;
}

.results-tab.is-active {
  background: #0d0f0f;
  border-color: #0d0f0f;
  color: #fff;
}

.protocol-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.card-head {
  align-items: center;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(241,242,237,0.65);
}

#qualityTitle {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: .96;
  letter-spacing: -0.07em;
}

.quality-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.quality-full {
  grid-column: 1 / -1;
}

/* Build page overrides */
body:has(#protocolForm) {
  background: var(--bg);
}

body:has(#protocolForm) header {
  position: sticky;
  top: 0;
  z-index: 40;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

body:has(#protocolForm) header > div {
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.95);
  background: rgba(243, 244, 239, 0.9) !important;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

body:has(#protocolForm) .bg-white,
body:has(#protocolForm) section[data-step],
body:has(#protocolForm) .border.rounded-2xl,
body:has(#protocolForm) .border.rounded-3xl,
body:has(#protocolForm) .rounded-3xl,
body:has(#protocolForm) .rounded-2xl {
  border-radius: 28px !important;
}

body:has(#protocolForm) .bg-white,
body:has(#protocolForm) section[data-step],
body:has(#protocolForm) .border.rounded-2xl,
body:has(#protocolForm) .border.rounded-3xl,
body:has(#protocolForm) .rounded-3xl {
  background: rgba(248,248,245,0.88) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

body:has(#protocolForm) h1 {
  letter-spacing: -0.06em;
  line-height: .95;
}

body:has(#protocolForm) .bg-gradient-to-r,
body:has(#protocolForm) .from-sky-600,
body:has(#protocolForm) .to-cyan-500,
body:has(#protocolForm) .from-sky-500,
body:has(#protocolForm) .to-cyan-400 {
  background-image: none !important;
  background-color: #0d0f0f !important;
  color: #fff !important;
}

body:has(#protocolForm) .goal.sel,
body:has(#protocolForm) .chip.sel {
  border-color: rgba(49, 201, 115, 0.35) !important;
  background: rgba(49, 201, 115, 0.10) !important;
  box-shadow: none !important;
}

@media (max-width: 980px) {
  .hero-grid,
  .library-grid,
  .safety-grid,
  .quality-layout {
    grid-template-columns: 1fr;
  }

  .hero-trust,
  .protocol-stats,
  .insights-layout {
    grid-template-columns: 1fr;
  }

  .nav {
    border-radius: 28px;
    padding: 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  body[data-page="safety"] .section#safety {
    margin: 28px 0 0;
    border-radius: 0;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 26px, var(--container));
  }

  .site-header {
    padding-top: 0;
  }

  .nav {
    min-height: 72px;
  }

  .brand-wordmark { font-size: 1rem; }
  .hero-home { padding-top: 24px; }
  .hero h1, .page-intro h1, .section-heading h2, #qualityTitle {
    font-size: clamp(2.3rem, 11vw, 3.8rem);
  }

  .hero-actions,
  .form-actions { flex-direction: column; }

  .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
  }
}

/* === Codex visual redesign: clinical editorial system === */
:root {
  --bg: #f2f6f0;
  --bg-soft: #e8f0e5;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --surface-muted: #edf3ea;
  --surface-elevated: #ffffff;
  --line: #cfd8ca;
  --line-strong: #aebbaa;
  --text: #10120f;
  --muted: #5c665a;
  --muted-strong: #384138;
  --primary: #20a66a;
  --primary-strong: #147b50;
  --primary-soft: #dff4e8;
  --success: #20a66a;
  --warning-bg: #fff7dc;
  --warning-border: #e0c972;
  --warning-text: #735f12;
  --danger-bg: #fff0ed;
  --danger-border: #dfa79b;
  --danger-text: #993827;
  --shadow-soft: 0 18px 60px rgba(16, 18, 15, 0.08);
  --shadow-card: 0 12px 30px rgba(16, 18, 15, 0.07);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --container: 1180px;
}

html[data-theme="dark"] {
  --bg: #10120f;
  --bg-soft: #171a15;
  --surface: #191d17;
  --surface-strong: #1f241d;
  --surface-muted: #232a21;
  --surface-elevated: #20251e;
  --line: #3a4437;
  --line-strong: #566152;
  --text: #f5f8f1;
  --muted: #b7c1b2;
  --muted-strong: #d7dfd2;
  --primary: #42c982;
  --primary-strong: #77e5aa;
  --primary-soft: #203b2b;
  --shadow-soft: 0 20px 64px rgba(0, 0, 0, 0.38);
  --shadow-card: 0 14px 34px rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
  letter-spacing: 0 !important;
}

body {
  background: var(--bg) !important;
  color: var(--text);
  line-height: 1.52;
}

html[data-theme="dark"] body {
  background: var(--bg) !important;
}

.noise-layer {
  opacity: 0.08;
  background-image: linear-gradient(rgba(16, 18, 15, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 18, 15, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
}

html[data-theme="dark"] .noise-layer {
  opacity: 0.06;
}

.bg-orb,
.orb-1,
.orb-2 {
  display: none !important;
}

.container {
  width: min(100% - 48px, var(--container));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 0;
  border-bottom: 1px solid rgba(207, 216, 202, 0.72);
  background: rgba(242, 246, 240, 0.9);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .site-header {
  background: rgba(16, 18, 15, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav {
  min-height: 62px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand {
  gap: 10px;
}

.brand-wordmark {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

.brand-badge,
.brand-badge-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.brand-logo {
  transform: scale(1.45);
}

.nav-links {
  gap: 4px;
}

.nav-links a,
.theme-toggle,
.btn,
button {
  border-radius: 8px !important;
}

.nav-links a {
  padding: 10px 13px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  color: var(--text);
  background: var(--surface-muted);
}

.nav-links .nav-build-cta,
.btn-primary {
  color: #ffffff;
  background: #10120f;
  border-color: #10120f;
  box-shadow: none;
}

.nav-links .nav-build-cta:hover,
.nav-links .nav-build-cta:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible {
  color: #ffffff;
  background: #1a1d18;
  border-color: #1a1d18;
  box-shadow: none;
}

html[data-theme="dark"] .nav-links .nav-build-cta,
html[data-theme="dark"] .btn-primary {
  background: #f5f8f1;
  border-color: #f5f8f1;
  color: #10120f;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.hero-home {
  min-height: 620px;
  padding: 76px 0 48px;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #10120f;
}

.hero-photo,
.hero-scrim {
  position: absolute;
  inset: 0;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(0.9) contrast(1.04);
}

.hero-scrim {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 10, 8, 0.9) 0%, rgba(8, 10, 8, 0.72) 42%, rgba(8, 10, 8, 0.26) 100%),
    linear-gradient(0deg, rgba(8, 10, 8, 0.46), rgba(8, 10, 8, 0.06));
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 54px;
  align-items: end;
}

.hero-copy-shell {
  max-width: 760px;
}

.hero-status,
.eyebrow {
  display: block;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-status::before,
.eyebrow::before {
  content: "";
  margin: 0;
}

.hero-home .hero-status {
  color: #a9efc6;
}

.hero h1,
.page-intro h1,
.section-heading h2,
.visual-copy h2,
.final-cta h2,
#qualityTitle {
  margin: 0;
  max-width: 880px;
  font-size: 4.75rem;
  line-height: 0.98;
  font-weight: 800;
}

.hero h1 {
  color: #ffffff;
  max-width: 780px;
}

.hero h1 em,
.page-intro h1 em,
.section-heading h2 em,
#qualityTitle em {
  font-style: normal;
  color: inherit;
}

.hero-copy {
  margin: 22px 0 0;
  max-width: 620px;
  color: #e4eee2;
  font-size: 1.12rem;
}

.hero-actions,
.form-actions {
  margin-top: 28px;
  gap: 10px;
}

.hero-home .btn-primary {
  background: #f7fbf3;
  border-color: #f7fbf3;
  color: #10120f;
}

.hero-home .btn-primary:hover,
.hero-home .btn-primary:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: #10120f;
}

.hero-home .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.hero-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.hero-panel-preview::before {
  display: none;
}

.panel-top {
  margin-bottom: 12px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(32, 166, 106, 0.16);
}

.protocol-preview {
  gap: 8px;
}

.time-block {
  border-radius: 8px;
  border-color: rgba(16, 18, 15, 0.12);
  background: rgba(255, 255, 255, 0.76);
  padding: 14px;
}

.time-block h4 {
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.time-block p {
  margin: 5px 0;
  font-size: 1rem;
  font-weight: 800;
}

.time-block small {
  color: var(--muted);
  font-size: 0.86rem;
}

.industry-counter {
  min-height: 205px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 16px 10px 20px;
  text-align: center;
  transition: transform 1400ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.hero-home .hero-panel-preview {
  background: rgba(30, 34, 32, 0.68);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
  color: #ffffff;
  justify-self: end;
  max-width: 310px;
  width: 100%;
  padding: 16px;
}

.hero-home .hero-panel-preview .panel-top {
  color: rgba(255, 255, 255, 0.72);
}

.industry-counter.is-complete {
  transform: translateY(14px);
}

.industry-kicker {
  max-width: 24ch;
  margin: 0 auto 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.industry-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2em;
  min-height: 1.05em;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.25rem, 4.8vw, 3.2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 0.9;
}

.industry-value span:first-child {
  min-width: 5.8ch;
  text-align: right;
}

.industry-cents {
  display: inline-block;
  min-width: 0 !important;
  margin-left: 0.03em;
  font-size: 0.48em;
  line-height: 1;
  vertical-align: super;
  transform: translateY(-0.42em);
}

.industry-unit {
  min-width: 4.6ch;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.33em;
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.industry-subline {
  min-height: 1.35em;
  margin: 12px 0 0;
  color: #a9efc6;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.proof-strip {
  color: #f7fbf3;
  background: #10120f;
}

.proof-strip-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.proof-strip-inner > div {
  padding: 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.proof-strip-inner > div:last-child {
  border-right: 0;
}

.proof-strip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.proof-strip span {
  display: block;
  color: #c9d6c4;
  font-size: 0.94rem;
}

.section {
  padding: 86px 0;
}

.split-section,
.visual-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 56px;
  align-items: start;
}

.section-heading p,
.visual-copy p,
.intro-shell p,
.signature-band-inner p,
.meta,
.library-card p,
.info-card p,
.footer-note p,
.quality-card p,
.quality-list li {
  color: var(--muted);
}

.feature-list {
  border-top: 1px solid var(--line);
}

.feature-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition: transform 0.18s ease;
}

.feature-row:hover {
  transform: translateX(4px);
}

.feature-row span {
  color: var(--primary-strong);
  font-weight: 900;
}

.feature-row h3 {
  margin: 0;
  font-size: 1.28rem;
}

.feature-row p {
  margin: 7px 0 0;
  color: var(--muted);
}

.visual-section {
  padding-top: 0;
}

.visual-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
}

.visual-copy h2,
.final-cta h2 {
  font-size: 3.5rem;
}

.visual-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: 1.04rem;
}

.detail-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.text-link {
  display: inline-flex;
  margin-top: 22px;
  color: var(--primary-strong);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.final-cta {
  padding: 78px 0;
  color: #f7fbf3;
  background: #10120f;
}

.final-cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
}

.final-cta .eyebrow {
  color: #a9efc6;
}

.final-cta h2 {
  max-width: 720px;
  color: #ffffff;
}

.final-cta .btn-primary {
  background: #ffffff;
  border-color: #ffffff;
  color: #10120f;
}

.glass,
.trust-card,
.library-card,
.info-card,
.footer-note,
.quality-card,
.protocol-stat-card,
.results-card,
.alert-overview-card,
.reason-context-card,
.tracking-card-block,
.supplement-card,
.schedule-item,
.alert-item,
.reason-item,
.metric-item,
.intro-shell {
  border-radius: 8px !important;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}

.page-intro {
  padding: 70px 0 22px;
}

.intro-shell {
  padding: 0;
  border: 0;
  background: transparent;
}

.intro-shell::after {
  display: none;
}

.intro-shell h1 {
  font-size: 4.2rem;
}

.intro-shell p {
  max-width: 690px;
  margin-top: 16px;
  font-size: 1.04rem;
}

.library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.library-card,
.quality-card,
.info-card,
.footer-note,
.results-card,
.protocol-stat-card {
  padding: 20px;
}

.library-card,
.info-card,
.quality-card,
.protocol-stat-card,
.results-card {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.library-card:hover,
.info-card:hover,
.quality-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.library-card h3,
.info-card h3,
.footer-note h3,
.quality-card h3,
.protocol-stat-card h3,
.card-head h3 {
  font-size: 1.1rem;
  font-weight: 900;
}

.tag-row,
.library-card .tag-row {
  margin: 13px 0;
  gap: 7px;
}

.tag,
.pill,
.results-tab,
.yes-no-option span,
.selected-chip {
  border-radius: 8px !important;
}

.tag,
.pill {
  padding: 6px 9px;
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.safety-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body[data-page="safety"] .section#safety {
  margin: 34px 24px 0;
  border-radius: 8px;
  background: #10120f;
}

body[data-page="safety"] .section#safety::before {
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

body[data-page="safety"] .info-card,
body[data-page="safety"] .footer-note {
  color: #f7fbf3;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

body[data-page="safety"] .info-card p,
body[data-page="safety"] .footer-note p {
  color: #c9d6c4;
}

.protocol-summary-shell,
body[data-page="optimized"] .protocol-summary-shell,
body[data-page="quality"] .section .quality-layout > .section-heading {
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
}

.protocol-stats {
  gap: 12px;
}

.protocol-stat-card .stat-value {
  color: var(--primary-strong);
  font-size: 2.1rem;
}

.results-tabs {
  gap: 8px;
}

.results-tab {
  padding: 10px 13px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
  font-weight: 800;
}

.results-tab.is-active {
  color: #ffffff;
  background: #10120f;
  border-color: #10120f;
}

html[data-theme="dark"] .results-tab.is-active {
  color: #10120f;
  background: #f5f8f1;
  border-color: #f5f8f1;
}

.empty-state {
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px dashed var(--line-strong);
  padding: 16px;
}

.quality-layout {
  gap: 14px;
}

.quality-list a,
.empty-state a {
  color: var(--primary-strong);
}

.disclaimer-bar {
  padding: 0;
  border-color: var(--line);
  background: rgba(251, 252, 248, 0.74);
}

html[data-theme="dark"] .disclaimer-bar {
  background: rgba(25, 29, 23, 0.74);
}

.disclaimer-bar .container {
  padding: 16px 0;
  color: var(--muted);
}

.site-footer {
  padding: 30px 0 44px;
  color: var(--muted);
  background: transparent;
}

/* Build page */
body[data-page="build"] {
  background: var(--bg) !important;
  color: var(--text) !important;
}

body[data-page="build"] > .absolute {
  display: none !important;
}

body[data-page="build"] header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(207, 216, 202, 0.72) !important;
  background: rgba(242, 246, 240, 0.92) !important;
  backdrop-filter: blur(18px) !important;
}

body[data-page="build"] header > div {
  max-width: var(--container) !important;
  padding: 12px 24px !important;
  margin: 0 auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="build"] main {
  max-width: var(--container) !important;
  padding: 42px 24px 96px !important;
}

body[data-page="build"] .rounded-full,
body[data-page="build"] .rounded-xl,
body[data-page="build"] .rounded-2xl,
body[data-page="build"] .rounded-3xl {
  border-radius: 8px !important;
}

body[data-page="build"] .shadow {
  box-shadow: none !important;
}

body[data-page="build"] .bg-white,
body[data-page="build"] section[data-step],
body[data-page="build"] .border.rounded-2xl,
body[data-page="build"] .border.rounded-3xl {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}

body[data-page="build"] main > div:first-child {
  padding: 18px !important;
  background: #10120f !important;
  color: #ffffff !important;
  border-color: #10120f !important;
}

body[data-page="build"] main > div:first-child p {
  color: #ffffff !important;
}

body[data-page="build"] #bar,
body[data-page="build"] .bg-gradient-to-r,
body[data-page="build"] .from-sky-500,
body[data-page="build"] .from-sky-600,
body[data-page="build"] .to-cyan-400,
body[data-page="build"] .to-cyan-500 {
  background-image: none !important;
  background-color: var(--primary) !important;
}

body[data-page="build"] section[data-step] {
  padding: 28px !important;
}

body[data-page="build"] h1 {
  font-size: 3.2rem !important;
  line-height: 1 !important;
  color: var(--text) !important;
}

body[data-page="build"] h2 {
  font-size: 2rem !important;
  line-height: 1.1 !important;
}

body[data-page="build"] .goal {
  min-height: 122px;
  background: var(--surface-strong) !important;
  border-color: var(--line) !important;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

body[data-page="build"] .goal:hover,
body[data-page="build"] .chip:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong) !important;
}

body[data-page="build"] .goal.sel,
body[data-page="build"] .chip.sel,
body[data-page="build"] label:has(input:checked) {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

body[data-page="build"] .chip,
body[data-page="build"] input,
body[data-page="build"] select,
body[data-page="build"] textarea,
body[data-page="build"] label.border {
  border-radius: 8px !important;
}

body[data-page="build"] input,
body[data-page="build"] select,
body[data-page="build"] textarea {
  background: var(--surface-strong) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body[data-page="build"] button[type="submit"],
body[data-page="build"] #quick,
body[data-page="build"] #to3 {
  background: #10120f !important;
  color: #ffffff !important;
  border-color: #10120f !important;
}

body[data-page="build"] #toast {
  border-radius: 8px !important;
}

.global-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1300;
  min-width: 220px;
  max-width: min(92vw, 360px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(10, 18, 32, 0.16);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

html[data-theme="dark"] .global-toast {
  background: rgba(20, 27, 38, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

.global-toast.hidden {
  display: none;
}

.global-toast.is-success {
  border-color: rgba(20, 123, 80, 0.45);
}

.global-toast.is-warning {
  border-color: rgba(214, 158, 46, 0.45);
}

.global-toast.is-error {
  border-color: rgba(220, 53, 69, 0.45);
}

@media (max-width: 1100px) {
  .hero-grid,
  .split-section,
  .visual-grid,
  .library-grid,
  .safety-grid,
  .quality-layout {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 30px;
  }

  .hero-panel {
    max-width: 560px;
  }

  .proof-strip-inner {
    grid-template-columns: 1fr;
  }

  .proof-strip-inner > div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .proof-strip-inner > div:last-child {
    border-bottom: 0;
  }

  .final-cta-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .site-header {
    padding: 6px 0;
  }

  .nav {
    min-height: 58px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-wordmark {
    font-size: 0.98rem;
  }

  .brand-badge-logo {
    width: 34px;
    height: 34px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
  }

  .nav-links {
    top: 70px;
    left: 14px;
    right: 14px;
    display: none !important;
    border-radius: 8px;
    background: var(--surface-strong);
  }

  .nav-links.open {
    display: flex !important;
  }

  .hero-home {
    min-height: auto;
    padding: 48px 0 34px;
  }

  .hero h1,
  .page-intro h1,
  .section-heading h2,
  .visual-copy h2,
  .final-cta h2,
  #qualityTitle {
    font-size: 2.75rem;
    line-height: 1;
  }

  .hero-copy,
  .visual-copy p,
  .intro-shell p {
    font-size: 1rem;
  }

  .hero-actions,
  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .hero-panel {
    padding: 12px;
  }

  .proof-strip-inner > div {
    padding: 20px;
  }

  .section {
    padding: 58px 0;
  }

  .feature-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
  }

  .final-cta {
    padding: 58px 0;
  }

  .footer-inner {
    align-items: flex-start;
  }

  body[data-page="safety"] .section#safety {
    margin: 24px 0 0;
    border-radius: 0;
  }

  body[data-page="build"] main {
    padding: 28px 14px 76px !important;
  }

  body[data-page="build"] section[data-step] {
    padding: 20px !important;
  }

  body[data-page="build"] h1 {
    font-size: 2.4rem !important;
  }
}

/* Final conflict fixes for older high-specificity builder/theme overrides */
html[data-theme="dark"] .hero-status,
html[data-theme="dark"] .eyebrow {
  background: transparent !important;
  border: 0 !important;
}

body[data-page="build"] {
  --bg: #f2f6f0;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --surface-muted: #edf3ea;
  --line: #cfd8ca;
  --line-strong: #aebbaa;
  --text: #10120f;
  --muted: #5c665a;
  --muted-strong: #384138;
  --primary: #20a66a;
  --primary-strong: #147b50;
  --primary-soft: #dff4e8;
}

body[data-page="build"]:has(#protocolForm) {
  background: var(--bg) !important;
  color: var(--text) !important;
}

body[data-page="build"]:has(#protocolForm) header {
  background: rgba(242, 246, 240, 0.94) !important;
  border-bottom: 1px solid var(--line) !important;
}

body[data-page="build"]:has(#protocolForm) header > div {
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="build"]:has(#protocolForm) main > div:first-child {
  border-radius: 8px !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body[data-page="build"]:has(#protocolForm) main > div:first-child p {
  color: var(--muted-strong) !important;
}

body[data-page="build"]:has(#protocolForm) .bg-white,
body[data-page="build"]:has(#protocolForm) section[data-step],
body[data-page="build"]:has(#protocolForm) .border.rounded-2xl,
body[data-page="build"]:has(#protocolForm) .border.rounded-3xl,
body[data-page="build"]:has(#protocolForm) .rounded-3xl {
  border-radius: 8px !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body[data-page="build"]:has(#protocolForm) .rounded-full,
body[data-page="build"]:has(#protocolForm) .rounded-xl,
body[data-page="build"]:has(#protocolForm) .rounded-2xl,
body[data-page="build"]:has(#protocolForm) button,
body[data-page="build"]:has(#protocolForm) input,
body[data-page="build"]:has(#protocolForm) select,
body[data-page="build"]:has(#protocolForm) textarea {
  border-radius: 8px !important;
}

body[data-page="build"]:has(#protocolForm) h1,
body[data-page="build"]:has(#protocolForm) h2,
body[data-page="build"]:has(#protocolForm) h3,
body[data-page="build"]:has(#protocolForm) p,
body[data-page="build"]:has(#protocolForm) label,
body[data-page="build"]:has(#protocolForm) span {
  color: inherit;
}

body[data-page="build"]:has(#protocolForm) h1 {
  color: var(--text) !important;
}

body[data-page="build"]:has(#protocolForm) .text-slate-500,
body[data-page="build"]:has(#protocolForm) .text-slate-600,
body[data-page="build"]:has(#protocolForm) .text-xs {
  color: var(--muted) !important;
}

body[data-page="build"]:has(#protocolForm) .goal {
  background: var(--surface-strong) !important;
  border-color: var(--line) !important;
}

body[data-page="build"]:has(#protocolForm) .goal p:first-of-type {
  color: var(--text) !important;
}

body[data-page="build"]:has(#protocolForm) .goal.sel,
body[data-page="build"]:has(#protocolForm) .chip.sel,
body[data-page="build"]:has(#protocolForm) label:has(input:checked) {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  color: var(--text) !important;
}

body[data-page="build"]:has(#protocolForm) .bg-gradient-to-r,
body[data-page="build"]:has(#protocolForm) .from-sky-600,
body[data-page="build"]:has(#protocolForm) .to-cyan-500,
body[data-page="build"]:has(#protocolForm) .from-sky-500,
body[data-page="build"]:has(#protocolForm) .to-cyan-400 {
  background-image: none !important;
  background-color: #10120f !important;
  color: #ffffff !important;
}

body[data-page="build"]:has(#protocolForm) #bar {
  background-color: var(--primary) !important;
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .hero h1,
  .page-intro h1,
  .section-heading h2,
  .visual-copy h2,
  .final-cta h2,
  #qualityTitle {
    font-size: 2.25rem;
    overflow-wrap: break-word;
  }

  .hero-panel {
    display: none;
  }

  .hero-home .hero-panel {
    display: block;
    max-width: 100%;
  }

  .industry-counter {
    min-height: 185px;
    padding: 14px 8px 18px;
  }

  .industry-counter.is-complete {
    transform: translateY(12px);
  }

  .hero-copy-shell,
  .hero-copy {
    max-width: 100%;
  }

  .hero-copy {
    max-width: 32ch;
    font-size: 0.96rem;
  }

  .menu-toggle {
    display: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 40px;
    margin-left: auto;
    min-width: 40px;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 3;
    color: #10120f !important;
    background: #f5f8f1 !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
  }

  #menuToggle.menu-toggle {
    display: none !important;
  }

  .nav-links,
  .nav-links.open {
    position: static;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: calc(100vw - 28px);
    overflow: hidden;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .nav-links a {
    width: auto !important;
    padding: 8px 6px;
    font-size: 0.76rem;
    min-width: 0;
    white-space: normal;
    line-height: 1.1;
    text-align: center;
  }

  .nav-links a:nth-child(n + 3),
  .nav-links .nav-build-cta {
    display: none !important;
  }

  .nav-links .theme-toggle {
    display: inline-flex !important;
    grid-column: 1 / -1;
    width: 100% !important;
    justify-content: center;
  }

  .tracking-save-row,
  .tracking-version-item {
    grid-template-columns: 1fr;
  }

  .tracking-export-actions .btn,
  .tracking-version-item .btn {
    width: 100%;
  }
}

/* === Unified index/build/optimized theme pass === */
:root {
  color-scheme: light;
  --bg: #f2f6f0;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --surface-muted: #edf3ea;
  --line: #cfd8ca;
  --line-strong: #aebbaa;
  --text: #10120f;
  --muted: #5c665a;
  --muted-strong: #384138;
  --primary: #20a66a;
  --primary-strong: #147b50;
  --primary-soft: #dff4e8;
  --hero-ink: #f7fbf3;
  --hero-muted: #dce8d7;
  --dark-panel: #10120f;
  --shadow-soft: 0 18px 58px rgba(16, 18, 15, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f0c;
  --surface: #131812;
  --surface-strong: #182017;
  --surface-muted: #20291e;
  --line: #334030;
  --line-strong: #596653;
  --text: #f5f8f1;
  --muted: #b8c5b2;
  --muted-strong: #dae4d5;
  --primary: #42c982;
  --primary-strong: #9af0bd;
  --primary-soft: #193322;
  --hero-ink: #f7fbf3;
  --hero-muted: #d3dfce;
  --dark-panel: #090c09;
  --shadow-soft: 0 18px 58px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] body[data-page="build"] {
  --bg: #0c0f0c;
  --surface: #131812;
  --surface-strong: #182017;
  --surface-muted: #20291e;
  --line: #334030;
  --line-strong: #596653;
  --text: #f5f8f1;
  --muted: #b8c5b2;
  --muted-strong: #dae4d5;
  --primary: #42c982;
  --primary-strong: #9af0bd;
  --primary-soft: #193322;
}

body {
  background: var(--bg) !important;
  color: var(--text);
}

.site-header,
body[data-page="build"] header,
body[data-page="build"]:has(#protocolForm) header {
  background: color-mix(in srgb, var(--bg) 90%, transparent) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
}

.nav,
body[data-page="build"] header > div,
body[data-page="build"]:has(#protocolForm) header > div {
  width: min(100% - 48px, var(--container)) !important;
  min-height: 62px;
  margin-inline: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-links {
  margin-left: auto;
}

.theme-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 0 !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  background: var(--surface-strong) !important;
  color: var(--text) !important;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface-muted) !important;
  transform: translateY(-1px);
}

.theme-toggle span[aria-hidden="true"] {
  line-height: 1;
  transform: translateY(-1px);
}

.language-control {
  flex: 0 0 auto;
  margin-left: 8px;
}

.language-control select {
  min-width: 128px;
  height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  background: var(--surface-strong) !important;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.language-control select:hover,
.language-control select:focus-visible {
  background: var(--surface-muted) !important;
}

.translation-widget-host,
.goog-te-banner-frame,
.skiptranslate iframe {
  display: none !important;
}

body {
  top: 0 !important;
}

.brand-wordmark,
.nav-links a,
.theme-toggle,
.language-control select,
body[data-page="build"] header a,
body[data-page="build"] header p {
  color: var(--text) !important;
}

.brand-badge-logo {
  background: var(--surface-strong);
  border-color: var(--line);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  color: var(--text) !important;
  background: var(--surface-muted);
}

.nav-links .nav-build-cta,
body[data-page="build"] .nav-links .nav-build-cta,
.btn-primary {
  color: #f7fbf3 !important;
  background: #10120f !important;
  border-color: #10120f !important;
}

html[data-theme="dark"] .nav-links .nav-build-cta,
html[data-theme="dark"] body[data-page="build"] .nav-links .nav-build-cta,
html[data-theme="dark"] .btn-primary {
  color: #10120f !important;
  background: #f5f8f1 !important;
  border-color: #f5f8f1 !important;
}

.btn-secondary,
.theme-toggle,
.language-control select,
body[data-page="build"] #to2,
body[data-page="build"] [data-back],
body[data-page="build"] #resetBtn,
body[data-page="build"] #addCurrentSupplementBtn,
body[data-page="build"] #skip {
  color: var(--text) !important;
  background: var(--surface-strong) !important;
  border-color: var(--line-strong) !important;
}

body[data-page="build"] .supplement-rich-toggle-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body[data-page="build"] .supplement-rich-toggle-card.is-enabled {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line) 58%) !important;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface) 65%) !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

body[data-page="build"] .supplement-rich-toggle-hit {
  width: 100%;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="build"] .supplement-rich-toggle-copy {
  display: block;
  min-width: 0;
}

body[data-page="build"] .supplement-rich-toggle-title {
  display: block;
}

body[data-page="build"] .supplement-rich-toggle-description {
  color: var(--muted-strong) !important;
}

body[data-page="build"] .supplement-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

body[data-page="build"] .supplement-switch-track {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface) 30%);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body[data-page="build"] .supplement-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  box-shadow: 0 2px 6px color-mix(in srgb, #000 16%, transparent);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body[data-page="build"] .supplement-rich-toggle-input:focus-visible + .supplement-switch-track,
body[data-page="build"] .supplement-food-only-input:focus-visible + .supplement-switch-track {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong) 45%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

body[data-page="build"] .supplement-rich-toggle-input:checked + .supplement-switch-track,
body[data-page="build"] .supplement-food-only-input:checked + .supplement-switch-track {
  background: color-mix(in srgb, var(--accent) 82%, #ffffff 18%);
  border-color: color-mix(in srgb, var(--accent) 85%, var(--line-strong) 15%);
}

body[data-page="build"] .supplement-rich-toggle-input:checked + .supplement-switch-track .supplement-switch-thumb,
body[data-page="build"] .supplement-food-only-input:checked + .supplement-switch-track .supplement-switch-thumb {
  transform: translateX(22px);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

body[data-page="build"] #supplementFoodPanel {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line) 74%) !important;
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface) 72%) !important;
}

body[data-page="build"] .supplement-food-only-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

body[data-page="build"] .supplement-food-only-copy {
  min-width: 0;
}

body[data-page="build"] .supplement-food-only-title {
  display: block;
  font-weight: 800;
  color: var(--text) !important;
}

body[data-page="build"] .supplement-food-only-description {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  color: var(--muted-strong) !important;
}

body[data-page="build"] .lab-aware-panel {
  border-color: var(--line) !important;
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent) !important;
  overflow: hidden;
}

body[data-page="build"] .lab-aware-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
}

body[data-page="build"] .lab-aware-summary::-webkit-details-marker {
  display: none;
}

body[data-page="build"] .lab-aware-summary-title {
  font-size: 0.76rem;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-strong) !important;
}

body[data-page="build"] .lab-aware-summary-title em {
  font-style: normal;
  color: var(--muted);
}

body[data-page="build"] .lab-aware-summary-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

body[data-page="build"] .lab-aware-body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

body[data-page="build"] .lab-aware-intro {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted) !important;
}

body[data-page="build"] .lab-aware-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
}

body[data-page="build"] .lab-aware-field {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 10px;
}

body[data-page="build"] .lab-aware-field > span {
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--muted-strong);
}

body[data-page="build"] .lab-aware-field > span small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

body[data-page="build"] .lab-aware-field input {
  border-radius: 8px !important;
  height: 34px;
  font-size: 0.85rem;
  padding: 0 9px !important;
  background: var(--surface-strong) !important;
}

body[data-page="build"] .lab-aware-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-page="build"] .lab-aware-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

body[data-page="build"] .lab-aware-clear {
  border: 1px solid var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px !important;
}

body[data-page="build"] .lab-aware-clear:hover,
body[data-page="build"] .lab-aware-clear:focus-visible {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
}

.hero-home .btn-primary,
.build-hero .btn-primary {
  background: #f7fbf3 !important;
  border-color: #f7fbf3 !important;
  color: #10120f !important;
}

.hero-home .btn-secondary,
.build-hero .btn-secondary {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.36) !important;
}

.glass,
.library-card,
.info-card,
.footer-note,
.quality-card,
.protocol-stat-card,
.results-card,
.alert-overview-card,
.reason-context-card,
.tracking-card-block,
.supplement-card,
.schedule-item,
.alert-item,
.reason-item,
.metric-item,
.empty-state,
.time-block,
input,
select,
textarea {
  color: var(--text);
  background: var(--surface) !important;
  border-color: var(--line) !important;
}

.tag,
.pill,
.results-tab,
.selected-chip,
body[data-page="build"] .chip,
body[data-page="build"] .goal,
body[data-page="build"] label.border,
body[data-page="build"] .border.rounded-xl,
body[data-page="build"] .border.rounded-2xl,
body[data-page="build"] .border.rounded-3xl {
  color: var(--muted-strong) !important;
  background: var(--surface-muted) !important;
  border-color: var(--line) !important;
}

.meta,
.library-card p,
.info-card p,
.footer-note p,
.quality-card p,
.quality-list li,
.schedule-time-head p,
.empty-state,
body[data-page="build"] .text-slate-500,
body[data-page="build"] .text-slate-600,
body[data-page="build"] .text-xs {
  color: var(--muted) !important;
}

body[data-page="build"] .goal p:first-of-type,
body[data-page="build"] section[data-step] h1,
body[data-page="build"] section[data-step] h2,
body[data-page="build"] section[data-step] .font-bold,
body[data-page="build"] section[data-step] .font-extrabold {
  color: var(--text) !important;
}

body[data-page="build"] .goal.sel,
body[data-page="build"] .chip.sel,
body[data-page="build"] label:has(input:checked) {
  color: var(--text) !important;
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
}

body[data-page="build"] #quick,
body[data-page="build"] #to3,
body[data-page="build"] button[type="submit"],
body[data-page="build"]:has(#protocolForm) .bg-gradient-to-r,
body[data-page="build"]:has(#protocolForm) .from-sky-600,
body[data-page="build"]:has(#protocolForm) .to-cyan-500,
body[data-page="build"]:has(#protocolForm) .from-sky-500,
body[data-page="build"]:has(#protocolForm) .to-cyan-400 {
  color: #f7fbf3 !important;
  background: #10120f !important;
  border-color: #10120f !important;
}

html[data-theme="dark"] body[data-page="build"] #quick,
html[data-theme="dark"] body[data-page="build"] #to3,
html[data-theme="dark"] body[data-page="build"] button[type="submit"],
html[data-theme="dark"] body[data-page="build"]:has(#protocolForm) .bg-gradient-to-r {
  color: #10120f !important;
  background: #f5f8f1 !important;
  border-color: #f5f8f1 !important;
}

.build-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 360px;
  background: #10120f;
}

.build-hero .hero-photo,
body[data-page="optimized"] .protocol-overview::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.build-hero .hero-scrim {
  z-index: -1;
}

.build-hero-inner {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 72px 0 48px;
  color: var(--hero-ink);
}

.build-hero h1 {
  max-width: 780px;
  margin: 0;
  color: #ffffff !important;
  font-size: 4.2rem;
  line-height: 0.98;
  font-weight: 800;
}

.build-hero p:not(.hero-status) {
  max-width: 590px;
  margin: 18px 0 0;
  color: var(--hero-muted);
  font-size: 1.08rem;
}

body[data-page="build"] main {
  width: min(100% - 48px, var(--container)) !important;
  max-width: var(--container) !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
  padding-top: 34px !important;
}

body[data-page="build"] main > div:first-child,
body[data-page="build"]:has(#protocolForm) main > div:first-child,
body[data-page="build"] section[data-step] {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

body[data-page="build"] main > div:first-child {
  margin-top: 0;
}

body[data-page="build"] #bar,
body[data-page="build"]:has(#protocolForm) #bar {
  background: var(--primary) !important;
}

body[data-page="build"] .h-2 {
  background: var(--surface-muted) !important;
}

body[data-page="build"] section[data-step] {
  padding: 30px !important;
}

body[data-page="build"] section[data-step] h1 {
  max-width: 760px;
  font-size: 3.4rem !important;
}

body[data-page="build"] .goal {
  min-height: 124px;
  padding: 16px !important;
  background: var(--surface-strong) !important;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

body[data-page="build"] .goal:hover,
.library-card:hover,
.info-card:hover,
.quality-card:hover,
.results-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong) !important;
  box-shadow: var(--shadow-soft);
}

body[data-page="optimized"] .protocol-overview {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 82px 0 58px;
  background: #10120f;
}

body[data-page="optimized"] .protocol-overview > .container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

body[data-page="optimized"] .protocol-overview::before {
  content: "";
  background-image: url("https://images.pexels.com/photos/13787596/pexels-photo-13787596.jpeg?auto=compress&cs=tinysrgb&w=1800");
  background-size: cover;
  background-position: center;
  filter: saturate(0.88) contrast(1.04);
}

body[data-page="optimized"] .protocol-overview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 10, 8, 0.88), rgba(8, 10, 8, 0.56)),
    linear-gradient(0deg, rgba(8, 10, 8, 0.32), rgba(8, 10, 8, 0.1));
}

body[data-page="optimized"] .protocol-summary-shell {
  background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
  border-color: color-mix(in srgb, var(--line) 82%, transparent) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-summary-shell {
  background: rgba(19, 24, 18, 0.88) !important;
}

body[data-page="optimized"] .protocol-summary-shell h1 {
  color: var(--text);
  font-size: 4.2rem;
}

body[data-page="optimized"] .protocol-subtitle {
  color: var(--muted) !important;
}

body[data-page="optimized"] .protocol-stat-card {
  min-height: 138px;
  background: var(--surface-strong) !important;
}

body[data-page="optimized"] .protocol-results-section {
  padding-top: 38px;
}

body[data-page="optimized"] .results-tabs {
  position: sticky;
  top: 82px;
  z-index: 20;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

body[data-page="optimized"] .results-tab.is-active {
  color: #f7fbf3 !important;
  background: #10120f !important;
  border-color: #10120f !important;
}

html[data-theme="dark"] body[data-page="optimized"] .results-tab.is-active {
  color: #10120f !important;
  background: #f5f8f1 !important;
  border-color: #f5f8f1 !important;
}

html[data-theme="dark"] body[data-page="safety"] .section#safety {
  background: #090c09;
}

html[data-theme="dark"] body[data-page="safety"] .info-card,
html[data-theme="dark"] body[data-page="safety"] .footer-note {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] body[data-page="safety"] .info-card p,
html[data-theme="dark"] body[data-page="safety"] .footer-note p {
  color: #d3dfce !important;
}

@media (max-width: 980px) {
  .build-hero-inner,
  body[data-page="optimized"] .protocol-summary-head {
    grid-template-columns: 1fr;
  }

  .build-hero h1,
  body[data-page="optimized"] .protocol-summary-shell h1 {
    font-size: 3rem;
  }

  body[data-page="optimized"] .results-tabs {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-header {
    transform: translateY(0);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
  }

  .site-header.is-hidden-mobile {
    transform: translateY(calc(-100% - 10px));
  }

  .nav,
  body[data-page="build"] header > div,
  body[data-page="build"]:has(#protocolForm) header > div {
    width: min(100% - 28px, var(--container)) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .theme-toggle {
    grid-column: 3;
    grid-row: 1;
    width: 44px !important;
    height: 44px;
    margin-left: 0;
    justify-self: end;
  }

  .language-control {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    justify-self: end;
  }

  .language-control select {
    width: 112px;
    min-width: 112px;
    height: 44px;
    padding-left: 10px;
    padding-right: 26px;
    font-size: 0.78rem;
  }

  .nav-links,
  .nav-links.open {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  .nav-links a:nth-child(n + 3) {
    display: inline-flex !important;
  }

  .nav-links .nav-build-cta {
    display: inline-flex !important;
  }

  .nav-links .theme-toggle {
    display: inline-flex !important;
    grid-column: 1 / -1;
    width: 100% !important;
    justify-content: center;
  }

  .build-hero {
    min-height: 330px;
  }

  .build-hero-inner {
    width: min(100% - 28px, var(--container));
    min-height: 330px;
    padding: 48px 0 34px;
  }

  body[data-page="optimized"] .protocol-overview > .container {
    width: min(100% - 28px, var(--container));
  }

  .build-hero h1,
  body[data-page="optimized"] .protocol-summary-shell h1 {
    font-size: 2.15rem !important;
    line-height: 1;
  }

  .build-hero p:not(.hero-status) {
    max-width: 31ch;
    font-size: 0.98rem;
  }

  body[data-page="build"] main {
    width: min(100% - 28px, var(--container)) !important;
    padding-inline: 0 !important;
  }

  body[data-page="build"] section[data-step] {
    padding: 20px !important;
  }

  body[data-page="build"] section[data-step] h1 {
    font-size: 2.35rem !important;
  }

  body[data-page="build"] .supplement-rich-toggle-hit {
    min-height: 48px;
    align-items: center;
  }

  body[data-page="optimized"] .protocol-overview {
    padding: 44px 0 34px;
  }

  body[data-page="optimized"] .protocol-summary-shell {
    padding: 20px !important;
  }
}

body[data-page="build"]:has(#protocolForm) .build-hero .build-hero-inner {
  width: min(100% - 48px, var(--container)) !important;
  margin-inline: auto !important;
}

body[data-page="build"]:has(#protocolForm) .build-hero h1 {
  color: #ffffff !important;
}

body[data-page="build"]:has(#protocolForm) .build-hero p {
  color: var(--hero-muted) !important;
}

body[data-page="build"]:has(#protocolForm) .build-hero .hero-status {
  color: #a9efc6 !important;
}

.protocol-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f7fbf3;
  background: rgba(7, 10, 8, 0.66);
  backdrop-filter: blur(18px) saturate(130%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.protocol-loading-overlay.is-visible {
  opacity: 1;
}

.protocol-loading-card {
  width: min(calc(100vw - 32px), 310px);
  height: 310px;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  padding: 22px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(30, 34, 32, 0.74);
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.28);
}

.protocol-loading-card::before {
  display: none;
}

.protocol-loading-card > * {
  position: relative;
  z-index: 1;
}

.protocol-loading-orbit {
  width: 58px;
  height: 58px;
  position: relative;
  border: 1px solid rgba(169, 239, 198, 0.26);
  border-radius: 999px;
  animation: protocolPulse 1.7s ease-in-out infinite;
}

.protocol-loading-orbit::before,
.protocol-loading-orbit::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: inherit;
}

.protocol-loading-orbit::after {
  inset: 22px;
  background: radial-gradient(circle, rgba(169, 239, 198, 0.95), rgba(169, 239, 198, 0.08) 62%, transparent 64%);
  border: 0;
}

.protocol-loading-orbit span {
  display: none;
}

.protocol-loading-eyebrow {
  margin: 0;
  color: #a9efc6;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.protocol-loading-card h2 {
  width: 100%;
  max-width: 22ch;
  min-height: 4.35em;
  display: grid;
  place-items: center;
  margin: 0;
  color: #ffffff;
  font-size: 1.15rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.protocol-loading-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.protocol-loading-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #a9efc6, #ffffff);
}

.protocol-loading-note {
  max-width: 28ch;
  margin: 0;
  color: rgba(247, 251, 243, 0.72);
  font-size: 0.82rem;
  line-height: 1.35;
}

.protocol-loading-pills {
  display: none;
}

.food-plan {
  border-color: rgba(20, 184, 166, 0.28);
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.9));
}

html[data-theme="dark"] .food-plan {
  border-color: rgba(45, 212, 191, 0.26);
  background:
    linear-gradient(135deg, rgba(20, 83, 72, 0.34), rgba(18, 24, 38, 0.86));
}

@keyframes protocolPulse {
  50% {
    transform: scale(1.06);
    opacity: 0.72;
  }
}

@media (max-width: 760px) {
  body[data-page="build"]:has(#protocolForm) .build-hero .build-hero-inner {
    width: min(100% - 28px, var(--container)) !important;
  }

  .protocol-loading-card {
    width: min(calc(100vw - 32px), 310px);
    height: 310px;
    padding: 22px;
  }

  .protocol-loading-orbit {
    width: 58px;
    height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .protocol-loading-card::before,
  .protocol-loading-orbit,
  .protocol-loading-orbit::after {
    animation: none !important;
  }
}

body[data-page="account"] .account-hero {
  padding: 78px 0 56px;
}

body[data-page="account"] .account-hero-grid {
  grid-template-columns: 1.06fr 0.94fr;
}

.account-hero-panel {
  position: relative;
  overflow: hidden;
}

.account-hero-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(10, 116, 255, 0.16), transparent 44%, rgba(10, 157, 117, 0.16));
}

.account-hero-panel-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.account-hero-panel-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(249, 251, 255, 0.88);
}

html[data-theme="dark"] .account-hero-panel-grid article {
  background: rgba(34, 42, 56, 0.76);
}

.account-hero-panel-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.account-hero-panel-grid h3 {
  margin: 8px 0 0;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.account-hero-panel-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  position: relative;
  z-index: 1;
}

.account-live-graph-wrap {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 16% 14%, rgba(31, 140, 255, 0.18), transparent 52%),
    radial-gradient(circle at 82% 82%, rgba(46, 211, 183, 0.14), transparent 48%),
    rgba(249, 251, 255, 0.9);
  padding: 10px;
  min-height: 170px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .account-live-graph-wrap {
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 140, 255, 0.26), transparent 48%),
    radial-gradient(circle at 85% 80%, rgba(46, 211, 183, 0.18), transparent 48%),
    rgba(34, 42, 56, 0.82);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.account-live-graph-wrap canvas {
  width: 100%;
  height: 148px !important;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-grid.is-auth-hidden {
  grid-template-columns: 1fr;
}

.account-card {
  padding: 24px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.account-card.is-visible,
.account-chart-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.account-auth-toggle {
  margin-top: 2px;
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(249, 251, 255, 0.86);
}

.account-auth-toggle .results-tab {
  min-width: 118px;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  background: transparent;
  color: var(--muted-strong);
  padding: 10px 13px;
}

.account-auth-toggle .results-tab.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #0a74ff, #0b9f79);
  box-shadow: 0 10px 22px rgba(10, 116, 255, 0.22);
}

.account-auth-card {
  position: relative;
  overflow: hidden;
}

.account-auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at center, rgba(10, 116, 255, 0.18), transparent 68%);
  pointer-events: none;
}

.account-auth-head {
  position: relative;
  z-index: 1;
}

.account-auth-subtitle {
  margin-top: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.account-auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 14px;
}

.account-auth-shell.is-signed-in {
  grid-template-columns: 1fr;
}

.account-auth-main {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

html[data-theme="dark"] .account-auth-main,
html[data-theme="dark"] .account-auth-toggle {
  background: rgba(34, 42, 56, 0.82);
}

.account-auth-field {
  gap: 7px;
}

.account-field-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 700;
}

.account-auth-field input {
  border: 1px solid color-mix(in srgb, var(--line) 82%, #8db9ff);
  border-radius: 12px;
  height: 46px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.94rem;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.account-auth-field input:focus-visible {
  outline: none;
  border-color: rgba(10, 116, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(10, 116, 255, 0.14);
  transform: translateY(-1px);
}

html[data-theme="dark"] .account-auth-field input {
  background: rgba(20, 26, 36, 0.94);
  border-color: rgba(116, 136, 168, 0.48);
  color: #edf2ff;
}

html[data-theme="dark"] .account-auth-field input::placeholder {
  color: rgba(201, 212, 229, 0.58);
}

.account-submit-btn {
  margin-top: 8px;
  min-height: 46px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.account-auth-side {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background:
    linear-gradient(165deg, rgba(10, 116, 255, 0.1), rgba(10, 157, 117, 0.08)),
    rgba(249, 251, 255, 0.82);
}

.account-auth-side-kicker {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--primary-strong);
  font-weight: 700;
}

.account-auth-side h3 {
  margin: 6px 0 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.account-auth-benefits {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.account-auth-benefits li {
  position: relative;
  padding-left: 20px;
  color: var(--muted-strong);
  font-size: 0.87rem;
  line-height: 1.35;
}

.account-auth-benefits li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0a74ff, #0b9f79);
  box-shadow: 0 0 0 3px rgba(10, 116, 255, 0.12);
}

.account-auth-side-note {
  margin: 12px 0 0;
  font-size: 0.79rem;
  color: var(--muted);
}

html[data-theme="dark"] .account-auth-side {
  background:
    linear-gradient(165deg, rgba(11, 95, 204, 0.22), rgba(7, 115, 86, 0.16)),
    rgba(34, 42, 56, 0.82);
}

.account-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.account-fullname-field.hidden,
.account-form .field.hidden {
  display: none;
}

.account-auth-message {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  border-radius: 10px;
  padding: 4px 0;
}

.account-auth-message.is-success {
  color: #0d7a5c;
  background: rgba(10, 157, 117, 0.12);
  padding: 8px 10px;
}

.account-auth-message.is-error {
  color: #a22121;
  background: rgba(198, 58, 58, 0.12);
  padding: 8px 10px;
}

.account-auth-message.is-warning {
  color: #8b5806;
  background: rgba(223, 154, 16, 0.13);
  padding: 8px 10px;
}

html[data-theme="dark"] .account-auth-message.is-success {
  color: #7ce4bf;
  background: rgba(15, 134, 102, 0.24);
}

html[data-theme="dark"] .account-auth-message.is-error {
  color: #ffaaaa;
  background: rgba(154, 46, 46, 0.26);
}

html[data-theme="dark"] .account-auth-message.is-warning {
  color: #ffd99a;
  background: rgba(145, 97, 28, 0.3);
}

.account-member-card {
  display: grid;
  align-content: start;
}

.account-member-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(249, 251, 255, 0.86);
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .account-member-details {
  background: rgba(34, 42, 56, 0.76);
}

.account-member-details h3 {
  margin: 4px 0 0;
  letter-spacing: -0.02em;
}

.account-id {
  margin: 4px 0 0;
  color: var(--muted-strong);
  font-size: 0.84rem;
  word-break: break-all;
}

.account-subscription-status {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  color: var(--muted-strong);
  background: var(--surface-muted);
}

.account-delete-btn {
  color: #9f2323;
  border-color: rgba(159, 35, 35, 0.38);
  background: rgba(255, 237, 237, 0.78);
}

.account-delete-btn:hover,
.account-delete-btn:focus-visible {
  color: #ffffff;
  border-color: rgba(159, 35, 35, 0.9);
  background: linear-gradient(135deg, #c63a3a, #9f2323);
}

html[data-theme="dark"] .account-delete-btn {
  color: #ffb7b7;
  border-color: rgba(198, 58, 58, 0.5);
  background: rgba(68, 28, 28, 0.76);
}

html[data-theme="dark"] .account-delete-btn:hover,
html[data-theme="dark"] .account-delete-btn:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #c63a3a, #9f2323);
}

.account-danger-note {
  margin-top: 10px;
}

.account-subscription-badge.is-success {
  color: #ffffff;
  background: linear-gradient(135deg, #0a9d75, #0c815f);
  border-color: rgba(8, 99, 75, 0.7);
}

.account-subscription-badge.is-danger {
  color: #ffffff;
  background: linear-gradient(135deg, #c63a3a, #9f2323);
  border-color: rgba(129, 27, 27, 0.8);
}

.account-subscription-badge.is-warning {
  color: var(--text);
}

.account-analytics-section {
  padding-top: 10px;
}

.account-analytics-head {
  align-items: flex-start;
}

.account-lookback-field {
  min-width: 170px;
  margin: 0;
}

.account-metrics-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-charts-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 8% 10%, rgba(31, 140, 255, 0.16), transparent 48%),
    radial-gradient(circle at 92% 88%, rgba(139, 125, 255, 0.12), transparent 44%),
    rgba(249, 251, 255, 0.9);
  padding: 14px;
  min-height: 282px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 420ms ease, box-shadow 320ms ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .account-chart-card {
  background:
    radial-gradient(circle at 10% 12%, rgba(31, 140, 255, 0.24), transparent 44%),
    radial-gradient(circle at 90% 86%, rgba(139, 125, 255, 0.2), transparent 44%),
    rgba(34, 42, 56, 0.82);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.34);
}

.account-chart-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 35%, rgba(255, 255, 255, 0.03));
}

.account-chart-card.is-visible:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

html[data-theme="dark"] .account-chart-card.is-visible:hover {
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.48);
}

.account-chart-card canvas {
  margin-top: 10px;
  width: 100%;
  height: 210px !important;
}

.account-chart-wide {
  grid-column: 1 / -1;
  min-height: 290px;
}

.account-list-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.account-history-card {
  display: grid;
  gap: 12px;
}

.account-history-head {
  align-items: flex-start;
}

.account-history-refresh-btn {
  min-width: 100px;
}

.account-history-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-history-status {
  margin: 0;
}

.account-history-status.is-success {
  color: #087443;
}

.account-history-status.is-warning {
  color: #9a6a00;
}

.account-history-status.is-error {
  color: #b42318;
}

html[data-theme="dark"] .account-history-status.is-success {
  color: #7ce4b4;
}

html[data-theme="dark"] .account-history-status.is-warning {
  color: #ffd17a;
}

html[data-theme="dark"] .account-history-status.is-error {
  color: #ff9c92;
}

.account-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.account-history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] .account-history-item {
  background: rgba(32, 40, 54, 0.74);
}

.account-history-item.is-unavailable {
  opacity: 0.72;
}

.account-history-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-history-item-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.account-history-item-meta,
.account-history-item-summary,
.account-history-item-preview {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted-strong);
}

.account-history-item-preview {
  color: var(--muted);
}

.account-history-open-btn {
  white-space: nowrap;
  min-width: 92px;
}

.account-history-list li.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
}

html[data-theme="dark"] .account-history-list li.empty {
  background: rgba(32, 40, 54, 0.5);
}

.account-simple-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.account-simple-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.76);
}

html[data-theme="dark"] .account-simple-list li {
  background: rgba(32, 40, 54, 0.74);
}

.account-simple-list li strong {
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.account-simple-list li small {
  color: var(--muted);
  font-weight: 500;
}

.account-simple-list li.empty {
  color: var(--muted);
}

.account-admin-card {
  display: grid;
  gap: 14px;
}

.account-admin-funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-admin-section {
  display: grid;
  gap: 8px;
}

.account-admin-subhead {
  align-items: center;
}

.account-admin-flag-list li,
.account-admin-account-list li {
  align-items: flex-start;
}

.account-admin-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-admin-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-admin-row-main p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted-strong);
}

.account-admin-row-main strong {
  display: block;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.account-admin-row-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.account-admin-inline-select {
  min-width: 110px;
}

.account-analytics-footnote {
  margin-top: 14px;
}

@media (max-width: 1080px) {
  body[data-page="account"] .account-hero-grid {
    grid-template-columns: 1fr;
  }

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

  .account-auth-shell {
    grid-template-columns: 1fr;
  }

  .account-admin-funnel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-charts-grid {
    grid-template-columns: 1fr;
  }

  .account-chart-wide {
    grid-column: auto;
  }

  .account-list-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .account-card {
    padding: 18px;
  }

  .account-hero-panel-grid {
    grid-template-columns: 1fr;
  }

  .account-auth-toggle .results-tab {
    min-width: 0;
    flex: 1 1 0;
  }

  .account-auth-toggle {
    width: 100%;
  }

  .account-metrics-grid {
    grid-template-columns: 1fr;
  }

  .account-history-item {
    flex-direction: column;
    align-items: stretch;
  }

  .account-history-open-btn {
    width: 100%;
  }
}

/* Mobile stability patch: keep nav collapsed by default and opened only on toggle */
@media (max-width: 760px) {
  .nav {
    position: relative !important;
  }

  #menuToggle.menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: absolute !important;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 60;
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
    box-shadow: var(--shadow-soft);
  }

  .nav-links.open {
    display: grid !important;
  }

  .nav-links a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 430px) {
  .brand-wordmark {
    font-size: 0.86rem !important;
  }

  .language-control select {
    width: 98px !important;
    min-width: 98px !important;
    font-size: 0.72rem !important;
  }
}

.protocol-stat-card-alert {
  border-color: rgba(231, 76, 76, 0.38);
  background: linear-gradient(145deg, rgba(255, 236, 236, 0.96), rgba(255, 247, 247, 0.9));
  box-shadow: 0 0 0 1px rgba(231, 76, 76, 0.16), 0 10px 28px rgba(201, 35, 35, 0.13);
}

.protocol-stat-card-alert .stat-value {
  color: #a52929;
}

html[data-theme="dark"] .protocol-stat-card-alert {
  border-color: rgba(255, 122, 122, 0.46);
  background: linear-gradient(145deg, rgba(84, 35, 35, 0.9), rgba(59, 27, 27, 0.86));
  box-shadow: 0 0 0 1px rgba(255, 122, 122, 0.2), 0 14px 34px rgba(0, 0, 0, 0.44);
}

/* -------------------------------------------------------------------------- */
/* Dashboard Page                                                             */
/* -------------------------------------------------------------------------- */
body[data-page="dashboard"] {
  background: #08110d;
  color: #eaf7ef;
  min-height: 100vh;
}

body[data-page="dashboard"]::before,
body[data-page="dashboard"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body[data-page="dashboard"]::before {
  z-index: -2;
  background:
    linear-gradient(120deg, rgba(4, 10, 8, 0.82), rgba(4, 10, 8, 0.72)),
    url("https://images.pexels.com/photos/1072179/pexels-photo-1072179.jpeg?auto=compress&cs=tinysrgb&w=1800") center/cover no-repeat;
}

body[data-page="dashboard"]::after {
  z-index: -1;
  background:
    radial-gradient(circle at 20% 10%, rgba(83, 224, 143, 0.2), transparent 42%),
    radial-gradient(circle at 80% 85%, rgba(83, 153, 224, 0.19), transparent 38%);
}

body[data-page="dashboard"] .bg-orb,
body[data-page="dashboard"] .noise-layer {
  display: none;
}

.dash-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

.dash-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(140, 174, 154, 0.18);
  background: rgba(7, 13, 10, 0.78);
  backdrop-filter: blur(12px);
  padding: 30px 20px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
}

.dash-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f3fff8;
}

.dash-brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  border: 1px solid rgba(113, 179, 141, 0.46);
  background: rgba(22, 44, 33, 0.68);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dash-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}

.dash-brand-wordmark {
  font-size: 1.02rem;
  line-height: 1.06;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.dash-sidebar-nav {
  display: grid;
  gap: 8px;
}

.dash-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
  color: rgba(222, 241, 231, 0.88);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.dash-sidebar-nav a span {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  color: rgba(115, 213, 152, 0.95);
}

.dash-sidebar-nav a:hover,
.dash-sidebar-nav a:focus-visible {
  border-color: rgba(113, 179, 141, 0.4);
  background: rgba(23, 38, 31, 0.66);
  color: #ffffff;
}

.dash-sidebar-nav a.is-active {
  border-color: rgba(113, 179, 141, 0.58);
  background: linear-gradient(135deg, rgba(28, 51, 39, 0.88), rgba(20, 34, 27, 0.84));
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.dash-sidebar-footer {
  border: 1px solid rgba(140, 174, 154, 0.24);
  border-radius: 14px;
  background: rgba(14, 24, 19, 0.7);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.dash-sidebar-footer-label {
  margin: 0;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(192, 214, 202, 0.86);
}

.dash-sidebar-footer-user {
  margin: 0;
  color: #f2fff8;
  font-weight: 700;
  word-break: break-word;
}

.dash-sidebar-footer-link {
  color: #74d79d;
  font-size: 0.84rem;
  font-weight: 600;
}

.dash-main {
  padding: 24px 26px 24px;
  min-width: 0;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.dash-back-link {
  color: #8ce1ae;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dash-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dash-session-pill {
  border: 1px solid rgba(140, 174, 154, 0.3);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(207, 227, 216, 0.9);
  background: rgba(17, 31, 24, 0.7);
}

.dash-session-pill.is-live {
  color: #d6ffe7;
  border-color: rgba(112, 204, 148, 0.5);
  background: rgba(26, 61, 42, 0.76);
}

.dash-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(140, 174, 154, 0.28);
  background: rgba(15, 29, 22, 0.78);
  color: #f2fff8;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.dash-icon-btn:hover,
.dash-icon-btn:focus-visible {
  border-color: rgba(113, 179, 141, 0.52);
  background: rgba(25, 46, 35, 0.88);
  transform: translateY(-1px);
}

.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.dash-primary-column {
  display: grid;
  gap: 16px;
}

.dash-secondary-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

.dash-surface {
  border: 1px solid rgba(140, 174, 154, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(20, 32, 27, 0.82), rgba(10, 18, 14, 0.76));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 22px 44px rgba(0, 0, 0, 0.32);
}

.dash-hero-card {
  padding: 22px;
}

.dash-kicker {
  margin: 0;
  color: #9ee9ba;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dash-hero-card h1 {
  margin: 10px 0 10px;
  font-size: clamp(1.9rem, 3.7vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 760px;
}

.dash-hero-card > p {
  margin: 0;
  color: rgba(212, 230, 220, 0.88);
  font-size: 1.05rem;
  max-width: 740px;
}

.dash-stat-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dash-stat-card {
  border: 1px solid rgba(140, 174, 154, 0.24);
  border-radius: 14px;
  padding: 12px;
  background: rgba(12, 21, 17, 0.78);
}

.dash-stat-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(198, 222, 207, 0.92);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 760;
}

.dash-help-dot {
  width: 19px;
  height: 19px;
  border-radius: 999px;
  border: 1px solid rgba(145, 182, 161, 0.35);
  background: rgba(16, 29, 23, 0.9);
  color: #dff5e8;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.dash-help-dot:hover,
.dash-help-dot:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(132, 223, 174, 0.7);
  background: rgba(26, 53, 40, 0.92);
}

.dash-help-popover {
  --dash-help-arrow-left: 50%;
  position: fixed;
  z-index: 1400;
  max-width: min(250px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(132, 197, 163, 0.35);
  background: rgba(8, 17, 13, 0.66);
  color: #e5f4eb;
  font-size: 0.77rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dash-help-popover::after {
  content: "";
  position: absolute;
  left: var(--dash-help-arrow-left);
  bottom: -5px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(132, 197, 163, 0.35);
  border-bottom: 1px solid rgba(132, 197, 163, 0.35);
  background: rgba(8, 17, 13, 0.66);
}

.dash-help-popover.hidden {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

.dash-stat-value {
  margin: 8px 0 0;
  font-size: clamp(1.42rem, 2vw, 2.05rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 780;
  color: #f1fff8;
}

.dash-stat-sub {
  margin: 7px 0 0;
  font-size: 0.92rem;
  color: rgba(164, 229, 191, 0.93);
}

.dash-metric-help {
  margin: 10px 0 0;
  color: rgba(188, 211, 198, 0.9);
  font-size: 0.84rem;
}

.dash-action-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-action-btn {
  min-height: 46px;
}

body[data-page="dashboard"] .dash-action-row .btn-primary {
  background: linear-gradient(145deg, #3aca71, #28a75a);
  border-color: rgba(38, 132, 76, 0.92);
  box-shadow: 0 16px 30px rgba(44, 158, 91, 0.26);
}

body[data-page="dashboard"] .dash-action-row .btn-primary:hover,
body[data-page="dashboard"] .dash-action-row .btn-primary:focus-visible {
  background: linear-gradient(145deg, #46d67d, #33b764);
}

body[data-page="dashboard"] .dash-action-row .btn-secondary {
  border-color: rgba(140, 174, 154, 0.36);
  background: rgba(13, 22, 18, 0.78);
  color: #eaf7ef;
}

body[data-page="dashboard"] .dash-action-row .btn-secondary:hover,
body[data-page="dashboard"] .dash-action-row .btn-secondary:focus-visible {
  border-color: rgba(113, 179, 141, 0.64);
  background: rgba(19, 35, 27, 0.92);
}

.dash-inline-note {
  margin: 10px 0 0;
  font-size: 0.91rem;
  color: rgba(198, 219, 207, 0.88);
}

.dash-inline-note.is-success {
  color: #9ff0bf;
}

.dash-inline-note.is-warning {
  color: #ffd998;
}

.dash-inline-note.is-error {
  color: #ffb2b2;
}

.dash-workflow-card {
  padding: 16px;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dash-card-head h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.dash-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-workflow-progress {
  margin-top: 10px;
}

.dash-workflow-progress-text {
  margin: 0 0 7px;
  font-size: 0.86rem;
  color: rgba(196, 217, 206, 0.9);
}

.dash-progress-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(140, 174, 154, 0.28);
  background: rgba(12, 22, 18, 0.64);
  overflow: hidden;
}

.dash-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 220ms ease;
  background: linear-gradient(145deg, #58df94, #4db1f6);
}

.dash-workflow-next-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-workflow-next-hint {
  margin: 0;
  font-size: 0.83rem;
  color: rgba(189, 213, 198, 0.94);
}

.dash-mini-btn {
  min-height: 36px;
  font-size: 0.83rem;
  padding: 8px 12px;
}

.dash-workflow-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dash-workflow-item {
  border: 1px solid rgba(140, 174, 154, 0.24);
  border-radius: 14px;
  background: rgba(12, 21, 17, 0.76);
  overflow: hidden;
}

.dash-workflow-item.is-complete .dash-step-copy h3 {
  opacity: 0.86;
}

.dash-workflow-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}

.dash-step-index {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 780;
  color: #ebfff4;
  border: 1px solid rgba(113, 179, 141, 0.35);
  background: rgba(24, 46, 35, 0.72);
}

.dash-step-copy {
  min-width: 0;
}

.dash-step-copy h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.dash-step-copy p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: rgba(194, 214, 203, 0.82);
}

.dash-step-pill {
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid rgba(113, 179, 141, 0.38);
  background: rgba(28, 62, 45, 0.82);
  color: #c7f9da;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.dash-step-pill.is-soft {
  color: #d5dfda;
  border-color: rgba(140, 174, 154, 0.3);
  background: rgba(23, 33, 29, 0.82);
}

.dash-step-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(140, 174, 154, 0.32);
  background: rgba(11, 18, 15, 0.78);
  color: #f2fff8;
  font-size: 1.18rem;
  cursor: pointer;
}

.dash-step-check {
  min-width: 62px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(120, 181, 146, 0.42);
  background: rgba(22, 45, 34, 0.82);
  color: #d8f6e6;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.dash-step-check:hover,
.dash-step-check:focus-visible {
  border-color: rgba(113, 179, 141, 0.66);
}

.dash-step-check.is-complete {
  background: linear-gradient(145deg, rgba(62, 206, 125, 0.9), rgba(52, 174, 105, 0.9));
  border-color: rgba(85, 226, 146, 0.72);
  color: #082012;
}

.dash-step-toggle:hover,
.dash-step-toggle:focus-visible {
  border-color: rgba(113, 179, 141, 0.62);
  background: rgba(20, 35, 28, 0.88);
}

.dash-workflow-details {
  border-top: 1px solid rgba(140, 174, 154, 0.21);
  padding: 10px 12px 12px;
  display: grid;
  gap: 6px;
}

.dash-workflow-details p {
  margin: 0;
  color: rgba(208, 226, 216, 0.9);
  font-size: 0.88rem;
  line-height: 1.46;
}

.dash-workflow-empty {
  border: 1px dashed rgba(140, 174, 154, 0.35);
  border-radius: 12px;
  padding: 12px;
  color: rgba(206, 223, 214, 0.86);
}

.dash-chart-card,
.dash-reasons-card,
.dash-params-card {
  padding: 16px;
}

.dash-chart-wrap {
  margin-top: 12px;
  height: 250px;
}

.dash-chart-note {
  margin: 10px 0 0;
  color: rgba(194, 216, 203, 0.9);
  font-size: 0.82rem;
}

.dash-mini-select-label select {
  min-width: 130px;
  border-radius: 10px;
  border: 1px solid rgba(140, 174, 154, 0.3);
  background: rgba(11, 19, 16, 0.8);
  color: #ecfff4;
  height: 38px;
  padding: 0 10px;
}

.dash-bullet-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.dash-bullet-list li {
  position: relative;
  padding-left: 20px;
  color: rgba(216, 232, 223, 0.9);
  line-height: 1.42;
}

.dash-bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5be28f, #46a9ff);
}

.dash-param-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.dash-param-list li {
  border: 1px solid rgba(140, 174, 154, 0.21);
  border-radius: 12px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(11, 19, 16, 0.72);
}

.dash-param-list li span {
  color: rgba(198, 217, 207, 0.86);
  font-size: 0.88rem;
}

.dash-param-list li strong {
  color: #f2fff8;
  font-size: 0.88rem;
  text-align: right;
}

.dash-param-readonly {
  color: #f2fff8;
  font-size: 0.88rem;
  text-align: right;
}

.dash-param-input-wrap {
  min-width: 0;
}

.dash-param-input {
  width: 100%;
  min-width: 130px;
  text-align: right;
  border: 1px solid rgba(140, 174, 154, 0.28);
  border-radius: 9px;
  background: rgba(13, 23, 18, 0.74);
  color: #ecfff3;
  padding: 6px 8px;
  font-size: 0.86rem;
  font-weight: 600;
}

.dash-param-select {
  width: 100%;
  min-width: 130px;
  text-align: right;
  border: 1px solid rgba(140, 174, 154, 0.28);
  border-radius: 9px;
  background: rgba(13, 23, 18, 0.74);
  color: #ecfff3;
  padding: 6px 26px 6px 8px;
  font-size: 0.86rem;
  font-weight: 600;
}

.dash-param-select:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.dash-param-input:focus-visible,
.dash-param-select:focus-visible {
  outline: 2px solid rgba(93, 182, 134, 0.48);
  outline-offset: 1px;
}

.dash-inline-link {
  color: #96e7b8;
  font-weight: 700;
  font-size: 0.85rem;
}

html[data-theme="light"] body[data-page="dashboard"] {
  background: #edf5f1;
  color: #102319;
}

html[data-theme="light"] body[data-page="dashboard"]::before {
  background:
    linear-gradient(180deg, rgba(242, 248, 245, 0.92), rgba(234, 243, 238, 0.88));
}

html[data-theme="light"] body[data-page="dashboard"]::after {
  background:
    radial-gradient(circle at 10% 8%, rgba(52, 157, 108, 0.19), transparent 43%),
    radial-gradient(circle at 88% 84%, rgba(57, 112, 184, 0.13), transparent 40%);
  opacity: 0.82;
}

html[data-theme="light"] .dash-sidebar {
  background: rgba(249, 253, 250, 0.98);
  border-right-color: rgba(65, 113, 89, 0.16);
  box-shadow: 0 0 0 1px rgba(194, 220, 206, 0.52) inset;
}

html[data-theme="light"] .dash-brand,
html[data-theme="light"] .dash-sidebar-nav a,
html[data-theme="light"] .dash-step-copy h3,
html[data-theme="light"] .dash-card-head h2 {
  color: #102018;
}

html[data-theme="light"] .dash-sidebar-nav a span {
  color: #17935a;
}

html[data-theme="light"] .dash-sidebar-nav a:hover,
html[data-theme="light"] .dash-sidebar-nav a:focus-visible {
  background: #eef8f2;
  border-color: rgba(102, 164, 131, 0.32);
  color: #12271d;
}

html[data-theme="light"] .dash-sidebar-nav a.is-active {
  background: linear-gradient(135deg, #dff2e7, #ecf8f1);
  border-color: rgba(95, 161, 126, 0.44);
  color: #12261d;
  box-shadow: 0 10px 22px rgba(26, 74, 52, 0.12);
}

html[data-theme="light"] .dash-surface,
html[data-theme="light"] .dash-sidebar-footer,
html[data-theme="light"] .dash-stat-card,
html[data-theme="light"] .dash-workflow-item,
html[data-theme="light"] .dash-param-list li {
  border-color: rgba(76, 121, 98, 0.28);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(25, 59, 42, 0.12);
}

html[data-theme="light"] .dash-kicker {
  color: #0d7f45;
}

html[data-theme="light"] .dash-stat-label {
  color: #1b3a2e;
}

html[data-theme="light"] .dash-hero-card > p,
html[data-theme="light"] .dash-step-copy p,
html[data-theme="light"] .dash-workflow-details p,
html[data-theme="light"] .dash-param-list li span {
  color: rgba(27, 53, 42, 0.9);
}

html[data-theme="light"] .dash-stat-value,
html[data-theme="light"] .dash-param-list li strong,
html[data-theme="light"] .dash-param-readonly {
  color: #102018;
}

html[data-theme="light"] .dash-stat-sub,
html[data-theme="light"] .dash-inline-link,
html[data-theme="light"] .dash-back-link {
  color: #0f8b4e;
}

html[data-theme="light"] .dash-inline-note {
  color: #294f3d;
}

html[data-theme="light"] .dash-inline-note.is-success {
  color: #0f7a45;
}

html[data-theme="light"] .dash-inline-note.is-warning {
  color: #875c00;
}

html[data-theme="light"] .dash-inline-note.is-error {
  color: #9c2f2f;
}

html[data-theme="light"] .dash-metric-help,
html[data-theme="light"] .dash-chart-note {
  color: rgba(23, 44, 34, 0.92);
}

html[data-theme="light"] .dash-bullet-list li {
  color: #1e4132;
}

html[data-theme="light"] .dash-workflow-progress-text {
  color: #244838;
}

html[data-theme="light"] .dash-progress-track {
  border-color: rgba(57, 112, 82, 0.24);
  background: rgba(227, 241, 233, 0.9);
}

html[data-theme="light"] .dash-sidebar-footer-label {
  color: #355347 !important;
}

html[data-theme="light"] .dash-sidebar-footer-user {
  color: #10271b !important;
  opacity: 1;
}

html[data-theme="light"] .dash-sidebar-footer-link {
  color: #0d7d44 !important;
}

html[data-theme="light"] .dash-session-pill,
html[data-theme="light"] .dash-icon-btn,
html[data-theme="light"] .dash-mini-select-label select,
html[data-theme="light"] .dash-step-toggle {
  color: #173527;
  background: #ffffff;
  border-color: rgba(92, 141, 114, 0.4);
}

html[data-theme="light"] body[data-page="dashboard"] .dash-action-row .btn-secondary {
  color: #163527;
  border-color: rgba(91, 140, 114, 0.38);
  background: #ffffff;
}

html[data-theme="light"] body[data-page="dashboard"] .dash-action-row .btn-primary {
  color: #f7fff9;
  border-color: rgba(24, 108, 70, 0.92);
  background: linear-gradient(145deg, #23b06f, #19955c);
  box-shadow: 0 14px 26px rgba(25, 134, 83, 0.22);
}

html[data-theme="light"] body[data-page="dashboard"] .dash-action-row .btn-primary:hover,
html[data-theme="light"] body[data-page="dashboard"] .dash-action-row .btn-primary:focus-visible {
  background: linear-gradient(145deg, #2aba78, #1fa666);
}

html[data-theme="light"] .dash-step-index {
  color: #0f2c1f;
  background: rgba(218, 242, 227, 0.95);
  border-color: rgba(57, 112, 82, 0.32);
}

html[data-theme="light"] .dash-workflow-next-hint {
  color: #204635;
}

html[data-theme="light"] .dash-step-pill {
  color: #0f472c;
  border-color: rgba(82, 132, 106, 0.32);
  background: #e3f4ea;
}

html[data-theme="light"] .dash-step-pill.is-soft {
  color: #244434;
  background: #ecf4ef;
}

html[data-theme="light"] .dash-step-check {
  color: #123425;
  border-color: rgba(89, 136, 111, 0.36);
  background: #eef8f2;
}

html[data-theme="light"] .dash-step-check.is-complete {
  color: #082012;
  border-color: rgba(50, 153, 93, 0.62);
  background: linear-gradient(145deg, rgba(123, 233, 167, 0.96), rgba(91, 214, 142, 0.94));
}

html[data-theme="light"] .dash-param-input {
  color: #143224;
  border-color: rgba(87, 134, 109, 0.38);
  background: #f3f8f5;
}

html[data-theme="light"] .dash-param-select {
  color: #143224;
  border-color: rgba(87, 134, 109, 0.38);
  background: #f3f8f5;
}

html[data-theme="light"] .dash-help-dot {
  color: #0f2a1d;
  border-color: rgba(88, 138, 112, 0.52);
  background: rgba(233, 247, 239, 0.98);
}

html[data-theme="light"] .dash-help-dot:hover,
html[data-theme="light"] .dash-help-dot:focus-visible {
  border-color: rgba(24, 132, 79, 0.72);
  background: rgba(217, 241, 228, 0.98);
}

html[data-theme="light"] .dash-help-popover {
  border-color: rgba(76, 129, 103, 0.36);
  background: rgba(244, 251, 247, 0.78);
  color: #153023;
  box-shadow: 0 12px 24px rgba(22, 60, 40, 0.16);
}

html[data-theme="light"] .dash-help-popover::after {
  border-right-color: rgba(76, 129, 103, 0.36);
  border-bottom-color: rgba(76, 129, 103, 0.36);
  background: rgba(244, 251, 247, 0.78);
}

@media (max-width: 1220px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }

  .dash-chart-wrap {
    height: 220px;
  }
}

@media (max-width: 1020px) {
  .dash-shell {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .dash-sidebar-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-main {
    padding-top: 14px;
  }
}

@media (max-width: 760px) {
  .dash-main {
    padding: 14px;
  }

  .dash-topbar {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .dash-sidebar {
    padding: 14px;
    gap: 14px;
  }

  .dash-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-stat-grid {
    grid-template-columns: 1fr;
  }

  .dash-workflow-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .dash-step-pill {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .dash-step-check {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .dash-head-actions {
    width: 100%;
  }

  .dash-head-actions .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 480px) {
  .dash-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dash-step-copy h3 {
    font-size: 0.98rem;
  }

  .dash-step-copy p {
    font-size: 0.84rem;
  }

  .dash-param-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-param-input {
    text-align: left;
    min-width: 0;
  }

  .dash-param-select {
    text-align: left;
    min-width: 0;
  }
}

html[data-theme="dark"] .protocol-stat-card-alert .stat-value {
  color: #ffd5d5;
}

.alert-overview-card.danger {
  border-color: rgba(231, 76, 76, 0.42);
  background: linear-gradient(145deg, rgba(255, 240, 240, 0.94), rgba(255, 248, 248, 0.92));
}

html[data-theme="dark"] .alert-overview-card.danger {
  border-color: rgba(255, 122, 122, 0.46);
  background: linear-gradient(145deg, rgba(84, 35, 35, 0.88), rgba(59, 27, 27, 0.84));
}

.alert-top-summary {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 13px;
}

.alert-top-summary h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.alert-top-summary p {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
}

.alert-top-summary.warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.alert-top-summary.danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.high-priority-pulse {
  animation: highPriorityPulse 1.75s ease-in-out infinite;
}

[data-stop-pulse-on-click="true"] {
  cursor: pointer;
}

[data-stop-pulse-on-click="true"].pulse-dismissed {
  cursor: default;
}

@keyframes highPriorityPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(220, 65, 65, 0.26), 0 10px 26px rgba(195, 44, 44, 0.12);
  }
  50% {
    transform: translateY(-1px) scale(1.013);
    box-shadow: 0 0 0 8px rgba(220, 65, 65, 0), 0 15px 36px rgba(195, 44, 44, 0.24);
  }
}

/* Optimized protocol visual upgrade */
body[data-page="optimized"] .protocol-overview {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 58px 0 40px;
  background: linear-gradient(180deg, #f4f8f4 0%, #eef6ef 68%, #ecf5ee 100%);
}

body[data-page="optimized"] .protocol-overview::before {
  content: none;
  background-image: none;
}

body[data-page="optimized"] .protocol-overview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px 260px at 90% 16%, rgba(91, 168, 138, 0.18), transparent 70%),
    radial-gradient(500px 240px at 10% 0%, rgba(85, 126, 202, 0.12), transparent 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0));
}

body[data-page="optimized"] .protocol-summary-shell {
  border-color: rgba(72, 108, 86, 0.2) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 22px 44px rgba(26, 56, 39, 0.12);
  backdrop-filter: blur(8px);
}

body[data-page="optimized"] .protocol-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
  align-items: center;
  gap: 24px;
}

body[data-page="optimized"] .protocol-summary-shell h1 {
  color: #12243f;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.05;
}

body[data-page="optimized"] .protocol-subtitle {
  color: #4f617f !important;
  font-size: 1.03rem;
  max-width: 52ch;
}

body[data-page="optimized"] .protocol-hero-aside {
  display: grid;
  justify-items: end;
  gap: 12px;
}

body[data-page="optimized"] .protocol-hero-art {
  width: min(100%, 220px);
  aspect-ratio: 1.25 / 1;
  border-radius: 20px;
  border: 1px solid rgba(109, 130, 201, 0.22);
  background: linear-gradient(140deg, rgba(146, 126, 248, 0.16), rgba(104, 170, 224, 0.14));
  display: grid;
  place-items: center;
}

body[data-page="optimized"] .protocol-hero-art-inner {
  position: relative;
  width: 74%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

body[data-page="optimized"] .protocol-hero-glyph {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(100, 122, 211, 0.34);
  color: #5861cf;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body[data-page="optimized"] .protocol-hero-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(110, 132, 229, 0.24);
}

body[data-page="optimized"] .protocol-hero-orb-a {
  width: 42px;
  height: 42px;
  top: 6px;
  right: -8px;
}

body[data-page="optimized"] .protocol-hero-orb-b {
  width: 24px;
  height: 24px;
  left: -6px;
  bottom: 10px;
  background: rgba(72, 174, 141, 0.28);
}

body[data-page="optimized"] .protocol-stats {
  margin-top: 20px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(106, 130, 201, 0.2);
  background: rgba(255, 255, 255, 0.75);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="optimized"] .protocol-stat-card {
  min-height: 132px;
  border-radius: 14px;
  border: 1px solid rgba(111, 132, 191, 0.2);
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: none;
}

body[data-page="optimized"] .protocol-stat-content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
}

body[data-page="optimized"] .protocol-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(105, 126, 205, 0.34);
  background: rgba(107, 128, 211, 0.12);
  color: #4b53b8;
  display: grid;
  place-items: center;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

body[data-page="optimized"] .protocol-stat-card .stat-value {
  font-size: clamp(1.1rem, 2.2vw, 1.75rem);
  line-height: 1.1;
  word-break: break-word;
}

body[data-page="optimized"] .workflow-shell {
  border: 1px solid rgba(98, 126, 185, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
}

body[data-page="optimized"] .workflow-shell-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

body[data-page="optimized"] .workflow-shell-head h4 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

body[data-page="optimized"] .workflow-list {
  display: grid;
  gap: 10px;
}

body[data-page="optimized"] .workflow-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: transparent;
  border: 0;
  padding: 0;
}

body[data-page="optimized"] .workflow-step {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d60e8, #6d8ef1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 14px;
}

body[data-page="optimized"] .workflow-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
}

body[data-page="optimized"] .workflow-card-head {
  margin-bottom: 8px;
}

body[data-page="optimized"] .workflow-card-desc {
  margin: 4px 0 0;
}

body[data-page="optimized"] .workflow-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

body[data-page="optimized"] .workflow-chip {
  border: 1px solid rgba(93, 126, 186, 0.26);
  background: rgba(99, 121, 191, 0.1);
  color: #334a74;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 600;
}

body[data-page="optimized"] .workflow-chip-accent {
  background: rgba(49, 167, 121, 0.15);
  border-color: rgba(49, 167, 121, 0.28);
  color: #1d684c;
}

body[data-page="optimized"] .supplements-glance-overview {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(100, 128, 188, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

body[data-page="optimized"] .insights-glance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

body[data-page="optimized"] .insights-glance-grid .reason-context-card h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-overview {
  background: linear-gradient(180deg, #0d1714 0%, #0a1311 100%);
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-overview::after {
  background:
    radial-gradient(560px 260px at 88% 16%, rgba(101, 136, 215, 0.2), transparent 70%),
    radial-gradient(500px 240px at 8% 0%, rgba(67, 168, 132, 0.14), transparent 66%),
    linear-gradient(180deg, rgba(8, 12, 10, 0.58), rgba(8, 12, 10, 0.22));
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-summary-shell,
html[data-theme="dark"] body[data-page="optimized"] .protocol-stats,
html[data-theme="dark"] body[data-page="optimized"] .workflow-shell,
html[data-theme="dark"] body[data-page="optimized"] .workflow-card,
html[data-theme="dark"] body[data-page="optimized"] .supplements-glance-overview {
  background: rgba(17, 27, 32, 0.84) !important;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-summary-shell h1 {
  color: #e8f3f0;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-subtitle {
  color: #b6c8c1 !important;
}

@media (max-width: 1100px) {
  body[data-page="optimized"] .protocol-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-page="optimized"] .protocol-summary-head {
    grid-template-columns: 1fr;
  }

  body[data-page="optimized"] .protocol-hero-aside {
    justify-items: start;
  }

  body[data-page="optimized"] .insights-glance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body[data-page="optimized"] .protocol-stats {
    grid-template-columns: 1fr;
  }

  body[data-page="optimized"] .workflow-row {
    grid-template-columns: 1fr;
  }

  body[data-page="optimized"] .workflow-step {
    margin-top: 0;
    width: 26px;
    height: 26px;
  }

  body[data-page="optimized"] .workflow-card {
    margin-top: -2px;
  }
}

/* Optimized Protocol v2 (near 1:1 reference style) */
body[data-page="optimized"] .protocol-v2-overview {
  padding-top: 46px;
  padding-bottom: 20px;
  background: #f7f7fb;
}

body[data-page="optimized"] .protocol-v2-hero-shell {
  border: 1px solid #e6e1fb !important;
  border-radius: 28px;
  background: #ffffff !important;
  box-shadow: 0 12px 36px rgba(80, 69, 160, 0.08);
  padding: 30px 30px 24px;
}

body[data-page="optimized"] .protocol-v2-kicker {
  color: #6353f4;
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

body[data-page="optimized"] .protocol-v2-kicker::before {
  content: "✦";
  margin-right: 8px;
  color: #7668f8;
  font-size: 0.85em;
}

body[data-page="optimized"] .protocol-v2-hero-head h1 {
  color: #151e43;
  font-size: clamp(2.1rem, 4vw, 4rem);
  letter-spacing: -0.032em;
  line-height: 1.05;
}

body[data-page="optimized"] .protocol-v2-hero-head .protocol-subtitle {
  color: #606989 !important;
  font-size: 1.05rem;
  max-width: 35ch;
}

body[data-page="optimized"] .protocol-v2-meta {
  margin-top: 12px;
  gap: 4px;
}

body[data-page="optimized"] .protocol-v2-meta .meta {
  font-size: 0.83rem;
}

body[data-page="optimized"] .protocol-v2-art {
  width: 250px;
  aspect-ratio: 1.08 / 1;
  border-radius: 26px;
  border: 1px solid #e7e0ff;
  background:
    radial-gradient(circle at 18% 30%, rgba(141, 126, 243, 0.13), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(124, 105, 236, 0.1), transparent 52%),
    linear-gradient(145deg, #faf8ff, #f2efff);
}

body[data-page="optimized"] .protocol-v2-art .protocol-hero-glyph {
  width: 116px;
  height: 116px;
  border-radius: 24px;
  border: 1px solid #d4c8ff;
  color: #6758f0;
  background: #ffffff;
  font-size: 1.08rem;
  transform: rotate(-6deg);
}

body[data-page="optimized"] .protocol-v2-stats {
  margin-top: 22px;
  border-radius: 22px;
  border: 1px solid #e6e1fb;
  background: #fbfaff !important;
  padding: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card {
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  min-height: 126px;
  padding: 14px 16px;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card + .protocol-stat-card {
  border-left: 1px solid #e8e3fb;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  font-size: 0.74rem;
  color: #5f53ec;
  border-color: #cfc5ff;
  background: #f1ecff;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card h3 {
  color: #4a5373;
  font-size: 0.94rem;
  margin-bottom: 2px;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .stat-value {
  margin: 4px 0;
  color: #101939;
  font-size: clamp(1.6rem, 2.6vw, 2.22rem);
  letter-spacing: -0.03em;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .meta {
  color: #667099;
  font-size: 0.9rem;
}

body[data-page="optimized"] .protocol-v2-main {
  background: #f7f7fb;
  padding-top: 12px;
  padding-bottom: 24px;
}

body[data-page="optimized"] .protocol-v2-stack {
  display: grid;
  gap: 16px;
}

body[data-page="optimized"] .protocol-v2-workflow-card,
body[data-page="optimized"] .protocol-v2-params-card,
body[data-page="optimized"] .protocol-v2-why-card,
body[data-page="optimized"] .protocol-v2-protips-card,
body[data-page="optimized"] .protocol-v2-actions-card,
body[data-page="optimized"] .protocol-v2-deep-details {
  border: 1px solid #e7e1fb !important;
  border-radius: 22px;
  background: #ffffff !important;
  box-shadow: none;
}

body[data-page="optimized"] .protocol-v2-workflow-card {
  padding: 20px 18px 14px;
}

body[data-page="optimized"] .protocol-v2-workflow-head {
  margin-bottom: 14px;
}

body[data-page="optimized"] .protocol-v2-workflow-head h3 {
  color: #181f43;
  font-size: clamp(1.52rem, 2.5vw, 2rem);
}

body[data-page="optimized"] .protocol-v2-workflow-head .btn {
  border-radius: 12px;
  border-color: #ddd6fb;
  color: #454f79;
  background: #faf8ff;
}

body[data-page="optimized"] .protocol-v2-workflow-shell {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body[data-page="optimized"] .protocol-v2-workflow-shell > .workflow-shell-head {
  display: none;
}

body[data-page="optimized"] .workflow-list {
  position: relative;
  gap: 12px;
  padding-left: 0;
}

body[data-page="optimized"] .workflow-list::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  bottom: 26px;
  width: 2px;
  background: linear-gradient(180deg, #7d6bf3 0%, #c8bff8 100%);
  border-radius: 999px;
}

body[data-page="optimized"] .workflow-row {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  position: relative;
}

body[data-page="optimized"] .workflow-step {
  width: 32px;
  height: 32px;
  margin-top: 18px;
  font-size: 0.95rem;
  border: 1px solid #6d5cf2;
  background: #6d5cf2;
  box-shadow: 0 0 0 6px #f7f7fb;
}

body[data-page="optimized"] .workflow-card {
  border: 1px solid #e7e1fb;
  border-radius: 16px;
  background: #fefeff;
  padding: 12px;
}

body[data-page="optimized"] .workflow-row-surface {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
}

body[data-page="optimized"] .workflow-icon-slot {
  width: 74px;
  height: 74px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #5f53ec;
  border: 1px solid #dad2ff;
  background: #f3efff;
}

body[data-page="optimized"] .workflow-icon-slot.tone-blue {
  color: #2f6cd6;
  border-color: #d4e6ff;
  background: #ecf4ff;
}

body[data-page="optimized"] .workflow-icon-slot.tone-teal {
  color: #188a70;
  border-color: #cceee6;
  background: #eafaf6;
}

body[data-page="optimized"] .workflow-copy-slot h4 {
  margin: 0;
  color: #161f42;
  font-size: 1.92rem;
  letter-spacing: -0.02em;
}

body[data-page="optimized"] .workflow-copy-slot .meta {
  margin-top: 4px;
  color: #606a8a;
  font-size: 0.97rem;
}

body[data-page="optimized"] .workflow-data-pill {
  min-width: 132px;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-size: 0.93rem;
  font-weight: 700;
  color: #5d57a4;
  background: #f2ecff;
}

body[data-page="optimized"] .workflow-data-pill.tone-blue {
  color: #2f6cd6;
  background: #eaf3ff;
}

body[data-page="optimized"] .workflow-data-pill.tone-teal {
  color: #188a70;
  background: #e7f8f2;
}

body[data-page="optimized"] .schedule-select-btn {
  min-width: 106px;
  border-radius: 12px;
  border-color: #d9d3fb;
  color: #48537f;
  background: #faf8ff;
}

body[data-page="optimized"] .schedule-item.excluded .workflow-row-surface {
  opacity: 0.78;
}

body[data-page="optimized"] .protocol-v2-schedule-quick {
  margin-top: 10px;
  border-top: 1px dashed #e5def8;
  padding-top: 10px;
}

body[data-page="optimized"] .workflow-summary-bar {
  margin-top: 12px;
  border: 1px solid #e6e0fb;
  border-radius: 14px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: #f8f5ff;
}

body[data-page="optimized"] .workflow-summary-total {
  margin: 0;
  color: #4e40dd;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

body[data-page="optimized"] .workflow-summary-badge {
  margin: 0;
  border: 1px solid #b8ecd4;
  border-radius: 10px;
  background: #def8ec;
  color: #16744f;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 5px 10px;
}

body[data-page="optimized"] .protocol-v2-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.2fr);
  gap: 16px;
}

body[data-page="optimized"] .protocol-v2-right-rail {
  display: grid;
  gap: 16px;
}

body[data-page="optimized"] .protocol-v2-params-card,
body[data-page="optimized"] .protocol-v2-why-card,
body[data-page="optimized"] .protocol-v2-protips-card {
  padding: 18px 18px 14px;
}

body[data-page="optimized"] .protocol-v2-params-card .card-head h3,
body[data-page="optimized"] .protocol-v2-why-card .card-head h3,
body[data-page="optimized"] .protocol-v2-protips-card .card-head h3 {
  color: #182145;
  font-size: 1.55rem;
}

body[data-page="optimized"] .protocol-v2-parameter-list {
  display: grid;
  gap: 4px;
}

body[data-page="optimized"] .protocol-v2-parameter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #ede8fb;
  padding: 9px 0;
}

body[data-page="optimized"] .protocol-v2-parameter-row:last-child {
  border-bottom: 0;
}

body[data-page="optimized"] .protocol-v2-parameter-label {
  color: #6c7598;
  font-size: 0.94rem;
}

body[data-page="optimized"] .protocol-v2-parameter-value {
  color: #202a4b;
  font-weight: 700;
  font-size: 0.97rem;
}

body[data-page="optimized"] .protocol-v2-why-summary {
  border: 1px solid #d8f0e8;
  border-radius: 16px;
  background: #f1fbf7;
  padding: 12px 14px;
}

body[data-page="optimized"] .protocol-v2-checklist {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

body[data-page="optimized"] .protocol-v2-checklist li {
  position: relative;
  padding-left: 26px;
  color: #1d3f37;
}

body[data-page="optimized"] .protocol-v2-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #178161;
  background: #d6f6ea;
}

body[data-page="optimized"] .protocol-v2-profile-summary {
  margin-top: 10px;
  border: 1px solid #ece7fb;
  border-radius: 14px;
  background: #faf9ff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

body[data-page="optimized"] .protocol-v2-protips-card {
  border-color: #dbe7ff !important;
  background: #f3f7ff !important;
}

body[data-page="optimized"] .protocol-v2-protips-card .meta {
  color: #3c4c78;
  font-size: 1rem;
}

body[data-page="optimized"] .protocol-v2-actions-card {
  padding: 16px;
}

body[data-page="optimized"] .protocol-v2-actionbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="optimized"] .protocol-v2-actionbtn {
  min-height: 60px;
  border-radius: 14px;
  font-size: 1.15rem;
}

body[data-page="optimized"] .protocol-v2-actionbtn-primary {
  background: linear-gradient(135deg, #6b5cf0, #7564f7);
  border-color: #6f60f2;
}

body[data-page="optimized"] .protocol-v2-action-meta {
  margin-top: 10px;
  display: grid;
  gap: 2px;
}

body[data-page="optimized"] .protocol-v2-gate {
  margin-top: 10px;
}

body[data-page="optimized"] .protocol-v2-advanced-panel {
  margin-top: 12px;
}

body[data-page="optimized"] .protocol-v2-advanced-panel > summary {
  font-size: 0.95rem;
  font-weight: 700;
}

body[data-page="optimized"] .protocol-v2-deep-details {
  padding: 14px 16px;
}

body[data-page="optimized"] .protocol-v2-deep-details > summary {
  font-size: 0.96rem;
  font-weight: 700;
}

body[data-page="optimized"] .protocol-v2-deep-details[open] > summary {
  margin-bottom: 10px;
}

body[data-page="optimized"] .reason-detail-drawer {
  margin-top: 10px;
}

body[data-page="optimized"] .reason-detail-drawer .reason-list {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  body[data-page="optimized"] .protocol-v2-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card:nth-child(odd) {
    border-left: 0;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card:nth-child(n + 3) {
    border-top: 1px solid #e8e3fb;
  }

  body[data-page="optimized"] .workflow-row-surface {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "icon copy action"
      "icon chip1 chip2";
  }

  body[data-page="optimized"] .workflow-icon-slot {
    grid-area: icon;
    width: 66px;
    height: 66px;
  }

  body[data-page="optimized"] .workflow-copy-slot {
    grid-area: copy;
  }

  body[data-page="optimized"] .workflow-data-pill:first-of-type {
    grid-area: chip1;
    justify-self: start;
  }

  body[data-page="optimized"] .workflow-data-pill:last-of-type {
    grid-area: chip2;
    justify-self: start;
  }

  body[data-page="optimized"] .schedule-select-btn {
    grid-area: action;
  }
}

@media (max-width: 980px) {
  body[data-page="optimized"] .protocol-v2-hero-head {
    grid-template-columns: 1fr;
  }

  body[data-page="optimized"] .protocol-v2-art {
    width: 210px;
  }

  body[data-page="optimized"] .protocol-v2-lower-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="optimized"] .workflow-summary-bar {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
  }

  body[data-page="optimized"] .protocol-v2-actionbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body[data-page="optimized"] .protocol-v2-hero-shell {
    padding: 18px 16px;
    border-radius: 18px;
  }

  body[data-page="optimized"] .protocol-v2-kicker {
    font-size: 1.45rem;
  }

  body[data-page="optimized"] .workflow-list::before {
    left: 12px;
  }

  body[data-page="optimized"] .workflow-row {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
  }

  body[data-page="optimized"] .workflow-step {
    width: 24px;
    height: 24px;
    margin-top: 18px;
    font-size: 0.72rem;
    box-shadow: 0 0 0 4px #f7f7fb;
  }

  body[data-page="optimized"] .workflow-row-surface {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  body[data-page="optimized"] .workflow-icon-slot,
  body[data-page="optimized"] .workflow-copy-slot,
  body[data-page="optimized"] .workflow-data-pill,
  body[data-page="optimized"] .schedule-select-btn {
    grid-area: auto;
    width: 100%;
  }

  body[data-page="optimized"] .workflow-icon-slot {
    height: 52px;
    border-radius: 12px;
  }

  body[data-page="optimized"] .workflow-copy-slot h4 {
    font-size: 1.25rem;
  }

  body[data-page="optimized"] .workflow-data-pill {
    min-width: 0;
  }
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-overview,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-main {
  background: #0f131d;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-hero-shell,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-workflow-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-params-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-why-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-protips-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-actions-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-deep-details,
html[data-theme="dark"] body[data-page="optimized"] .workflow-card {
  border-color: rgba(138, 128, 218, 0.38) !important;
  background: #171d2b !important;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-stats {
  border-color: rgba(136, 124, 224, 0.4);
  background: #1a2132 !important;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card + .protocol-stat-card {
  border-left-color: rgba(145, 136, 223, 0.32);
}

html[data-theme="dark"] body[data-page="optimized"] .workflow-list::before {
  background: linear-gradient(180deg, rgba(124, 111, 239, 0.92), rgba(80, 69, 152, 0.56));
}

html[data-theme="dark"] body[data-page="optimized"] .workflow-step {
  box-shadow: 0 0 0 6px #0f131d;
}

/* ------------------------------------------------------------------------- */
/* Build: deficiencies dropdown + mobile scroll                               */
/* ------------------------------------------------------------------------- */
body[data-page="build"] .deficiencies-field {
  display: grid;
  gap: 8px;
}

body[data-page="build"] .multi-select-dropdown {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  overflow: hidden;
}

body[data-page="build"] .multi-select-dropdown-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-page="build"] .multi-select-dropdown-summary::-webkit-details-marker {
  display: none;
}

body[data-page="build"] .multi-select-dropdown-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.72;
  transition: transform 180ms ease;
}

body[data-page="build"] .multi-select-dropdown[open] .multi-select-dropdown-summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

body[data-page="build"] .multi-select-dropdown-panel {
  border-top: 1px solid var(--line);
  padding: 10px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
}

body[data-page="build"] .multi-select-dropdown-menu {
  width: 100%;
  min-height: 172px;
  max-height: 230px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.95rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  body[data-page="build"] .multi-select-dropdown-summary {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  body[data-page="build"] .multi-select-dropdown-menu {
    min-height: 184px;
    max-height: 250px;
    font-size: 0.92rem;
  }
}

/* ------------------------------------------------------------------------- */
/* Optimized: view nav + confidence details                                   */
/* ------------------------------------------------------------------------- */
body[data-page="optimized"] .protocol-v2-view-nav-wrap {
  margin-bottom: 12px;
}

body[data-page="optimized"] .protocol-view-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-page="optimized"] .protocol-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  transition: all 180ms ease;
}

body[data-page="optimized"] .protocol-view-link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}

body[data-page="optimized"] .protocol-view-link.is-active {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface-muted));
  color: var(--primary-strong);
}

.confidence-breakdown-details {
  margin-top: 8px;
}

.confidence-breakdown-details > summary {
  list-style: none;
  cursor: pointer;
}

.confidence-breakdown-details > summary::-webkit-details-marker {
  display: none;
}

.confidence-breakdown-details:not([open]) .confidence-breakdown-popover {
  display: none;
}

.confidence-breakdown-details-inline {
  margin-top: 10px;
}

@media (max-width: 760px) {
  body[data-page="optimized"] .protocol-view-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="optimized"] .protocol-view-link {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.86rem;
    white-space: nowrap;
  }
}

/* ------------------------------------------------------------------------- */
/* Optimized mobile hardening                                                 */
/* ------------------------------------------------------------------------- */
@media (max-width: 760px) {
  body[data-page="optimized"] .workflow-row {
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  body[data-page="optimized"] .workflow-step {
    width: 28px !important;
    height: 28px !important;
    margin-top: 8px !important;
    font-size: 0.78rem !important;
  }

  body[data-page="optimized"] .workflow-card {
    padding: 10px 10px 12px !important;
    border-radius: 14px !important;
  }

  body[data-page="optimized"] .workflow-row-surface {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "copy action"
      "chip1 chip1"
      "chip2 chip2" !important;
    align-items: start !important;
    gap: 8px !important;
  }

  body[data-page="optimized"] .workflow-icon-slot {
    display: none !important;
  }

  body[data-page="optimized"] .workflow-copy-slot {
    grid-area: copy !important;
    min-width: 0 !important;
  }

  body[data-page="optimized"] .workflow-copy-slot .workflow-card-title {
    margin: 0 !important;
    font-size: 1.08rem !important;
    line-height: 1.22 !important;
    letter-spacing: -0.01em;
  }

  body[data-page="optimized"] .workflow-copy-slot .workflow-card-desc {
    margin-top: 4px !important;
    font-size: 0.91rem !important;
    line-height: 1.34 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body[data-page="optimized"] .workflow-data-pill {
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 34px !important;
    padding: 7px 11px !important;
    font-size: 0.84rem !important;
  }

  body[data-page="optimized"] .workflow-time-pill {
    grid-area: chip1 !important;
    justify-self: start;
  }

  body[data-page="optimized"] .workflow-state-pill {
    grid-area: chip2 !important;
    justify-self: start;
  }

  body[data-page="optimized"] .schedule-select-btn {
    grid-area: action !important;
    min-width: 94px !important;
    width: auto !important;
    min-height: 34px !important;
    padding: 7px 11px !important;
    font-size: 0.84rem !important;
    justify-self: end !important;
    align-self: start !important;
  }

  body[data-page="optimized"] .schedule-item-quick {
    margin-top: 8px !important;
  }

  body[data-page="optimized"] .schedule-item.excluded {
    opacity: 1 !important;
  }

  body[data-page="optimized"] .schedule-item.excluded .workflow-row-surface {
    grid-template-areas: "copy action" !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body[data-page="optimized"] .schedule-item.excluded .workflow-copy-slot .workflow-card-title {
    font-size: 1.02rem !important;
  }

  body[data-page="optimized"] .schedule-item.excluded .workflow-copy-slot .workflow-card-desc,
  body[data-page="optimized"] .schedule-item.excluded .workflow-data-pill,
  body[data-page="optimized"] .schedule-item.excluded .schedule-item-body,
  body[data-page="optimized"] .workflow-copy-slot.is-compact .workflow-card-desc {
    display: none !important;
  }

  body[data-page="optimized"] [data-protocol-view-section="supplements"] .supplement-card {
    padding: 10px !important;
    border-radius: 14px !important;
  }

  body[data-page="optimized"] [data-protocol-view-section="supplements"] .supplement-card-head {
    align-items: flex-start !important;
    gap: 8px !important;
  }

  body[data-page="optimized"] [data-protocol-view-section="supplements"] .supplement-card-head h4 {
    font-size: 1.04rem !important;
    line-height: 1.26 !important;
  }

  body[data-page="optimized"] [data-protocol-view-section="supplements"] .supplement-card-pills {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* -------------------------------------------------------------------------- */
/* Mobile Optimization Final Pass                                             */
/* -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  .container {
    width: min(100% - 20px, var(--container)) !important;
  }

  .section {
    padding: 44px 0 !important;
  }

  .page-intro {
    padding-top: 20px !important;
  }

  .intro-shell,
  .form-card,
  .results-card,
  .why-card,
  .info-card,
  .footer-note,
  .quality-card,
  .builder-aside,
  .hero-panel {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .site-header .nav,
  .nav {
    position: relative !important;
    min-height: 68px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: min(100% - 20px, var(--container)) !important;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-wordmark {
    font-size: 1.14rem !important;
    line-height: 1.08 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-badge-logo {
    width: 42px !important;
    height: 42px !important;
  }

  .brand-logo {
    transform: scale(1.55) !important;
  }

  .site-header .menu-toggle,
  .menu-toggle,
  #menuToggle.menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    margin-left: 0 !important;
    font-size: 1rem !important;
  }

  .language-control {
    margin-left: auto !important;
    order: 2;
  }

  .language-control select {
    width: 102px !important;
    min-width: 102px !important;
    height: 40px !important;
    font-size: 0.76rem !important;
    padding: 0 24px 0 8px !important;
  }

  .theme-toggle,
  [data-theme-toggle] {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    margin-left: 0 !important;
  }

  .nav-links {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 70 !important;
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent) !important;
    box-shadow: var(--shadow-soft) !important;
  }

  .nav-links.open {
    display: grid !important;
  }

  .nav-links a,
  .nav-links .nav-build-cta,
  .nav-links a:nth-child(n) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    width: 100% !important;
    padding: 10px 8px !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.2 !important;
    font-size: 0.84rem !important;
  }

  .hero-home {
    padding-top: 36px !important;
    padding-bottom: 34px !important;
  }

  .hero-grid,
  .proof-strip-inner,
  .split-section,
  .visual-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .hero h1,
  .page-intro h1 {
    font-size: clamp(1.96rem, 10vw, 2.6rem) !important;
  }

  .hero-copy {
    font-size: 0.98rem !important;
    max-width: none !important;
  }

  .hero-actions .btn,
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  body[data-page="build"] main {
    width: min(100% - 20px, var(--container)) !important;
    padding-inline: 0 !important;
  }

  body[data-page="build"] section[data-step] {
    padding: 16px !important;
  }

  body[data-page="build"] .goal {
    min-height: 92px;
    padding: 12px !important;
  }

  body[data-page="build"] .goal-media {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    font-size: 0.74rem !important;
  }

  body[data-page="build"] .goal p:first-of-type {
    font-size: 1rem !important;
    line-height: 1.25 !important;
  }

  body[data-page="build"] .goal p:last-of-type {
    font-size: 0.83rem !important;
    line-height: 1.35 !important;
  }

  body[data-page="build"] .chip,
  body[data-page="build"] button,
  body[data-page="build"] select,
  body[data-page="build"] input,
  body[data-page="build"] textarea {
    min-height: 44px !important;
  }

  body[data-page="optimized"] .protocol-v2-overview {
    padding-top: 30px !important;
    padding-bottom: 16px !important;
  }

  body[data-page="optimized"] .protocol-v2-main {
    padding-top: 8px !important;
  }

  body[data-page="optimized"] .protocol-v2-hero-shell {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  body[data-page="optimized"] .protocol-v2-hero-head h1 {
    font-size: clamp(1.8rem, 9vw, 2.3rem) !important;
    line-height: 1.08 !important;
  }

  body[data-page="optimized"] .protocol-v2-stats {
    grid-template-columns: 1fr !important;
    padding: 6px !important;
    border-radius: 14px !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card {
    min-height: 0 !important;
    padding: 10px !important;
    border-left: 0 !important;
    border-top: 1px solid #e8e3fb !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card:first-child {
    border-top: 0 !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-content {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-content > div {
    min-width: 0 !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.58rem !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card h3 {
    font-size: 0.82rem !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .stat-value {
    font-size: clamp(1.25rem, 7vw, 1.85rem) !important;
    line-height: 1.15 !important;
    margin: 2px 0 !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .meta {
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
  }

  body[data-page="optimized"] .workflow-row-surface {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body[data-page="optimized"] .workflow-copy-slot h4 {
    font-size: 1.05rem !important;
  }

  body[data-page="optimized"] .workflow-data-pill,
  body[data-page="optimized"] .schedule-select-btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-page="optimized"] .protocol-v2-actionbtn {
    min-height: 50px !important;
    font-size: 0.95rem !important;
  }

  body[data-page="account"] .account-card {
    opacity: 1 !important;
    transform: none !important;
    padding: 16px !important;
  }

  body[data-page="account"] .account-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body[data-page="account"] .account-auth-shell {
    grid-template-columns: 1fr !important;
  }

  body[data-page="account"] .account-auth-toggle .results-tab {
    min-height: 44px !important;
  }

  body[data-page="account"] .account-history-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-page="account"] .account-history-actions .btn {
    width: 100%;
    min-height: 42px;
  }

  body[data-page="account"] .account-chart-card {
    min-height: 220px !important;
  }

  body[data-page="account"] .account-chart-card canvas {
    height: 170px !important;
  }

  body[data-page="dashboard"] .dash-main {
    padding: 12px !important;
  }

  body[data-page="dashboard"] .dash-sidebar {
    position: static !important;
    height: auto !important;
    padding: 12px !important;
    gap: 10px !important;
  }

  body[data-page="dashboard"] .dash-brand-mark {
    width: 46px !important;
    height: 46px !important;
    border-radius: 12px !important;
  }

  body[data-page="dashboard"] .dash-brand-wordmark {
    font-size: 0.9rem !important;
  }

  body[data-page="dashboard"] .dash-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body[data-page="dashboard"] .dash-sidebar-nav a {
    padding: 10px 8px !important;
    font-size: 0.86rem !important;
  }

  body[data-page="dashboard"] .dash-layout {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body[data-page="dashboard"] .dash-stat-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .dash-action-row .btn {
    width: 100%;
  }

  body[data-page="dashboard"] .dash-workflow-head {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 8px !important;
  }

  body[data-page="dashboard"] .dash-step-copy {
    grid-column: 2 / 3 !important;
    min-width: 0 !important;
  }

  body[data-page="dashboard"] .dash-step-pill {
    grid-column: 2 / 3 !important;
    justify-self: start !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-page="dashboard"] .dash-step-pill.is-soft {
    grid-column: 2 / 3 !important;
  }

  body[data-page="dashboard"] .dash-step-check {
    grid-column: 3 / 4 !important;
    grid-row: 2 / 3 !important;
    justify-self: end !important;
  }

  body[data-page="dashboard"] .dash-step-toggle {
    grid-column: 3 / 4 !important;
    grid-row: 1 / 2 !important;
    justify-self: end !important;
  }

  body[data-page="dashboard"] .dash-chart-wrap {
    height: 190px !important;
  }
}

@media (max-width: 430px) {
  .brand-wordmark {
    font-size: 1.02rem !important;
  }

  .language-control select {
    width: 90px !important;
    min-width: 90px !important;
  }
}

/* Library: collapsed-by-title cards */
body[data-page="library"] .library-card.library-card-collapsed {
  padding: 0;
  overflow: hidden;
}

body[data-page="library"] .library-card-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
}

body[data-page="library"] .library-card-summary::-webkit-details-marker {
  display: none;
}

body[data-page="library"] .library-card-summary h3 {
  margin: 0;
}

body[data-page="library"] .library-card-summary-chevron {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(60, 106, 81, 0.32);
  background: rgba(233, 246, 238, 0.92);
  color: #194731;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease;
}

body[data-page="library"] .library-card[open] .library-card-summary-chevron {
  transform: rotate(45deg);
}

body[data-page="library"] .library-card-body {
  border-top: 1px dashed rgba(73, 111, 89, 0.22);
  padding: 10px 16px 14px;
}

html[data-theme="dark"] body[data-page="library"] .library-card-summary-chevron {
  border-color: rgba(121, 172, 144, 0.38);
  background: rgba(19, 35, 27, 0.82);
  color: #c6f5dc;
}

/* Gentle page transition to reduce navigation harshness */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body[data-page] main {
  animation: pageFadeIn 220ms ease-out;
}

/* Mobile polish across pages */
@media (max-width: 760px) {
  body[data-page="build"] .st[data-step="1"] > .grid:first-of-type,
  body[data-page="build"] #secondaryGoalCards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body[data-page="build"] .goal {
    min-height: 78px !important;
    padding: 9px !important;
    border-radius: 14px !important;
  }

  body[data-page="build"] .goal-media {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    font-size: 0.62rem !important;
    margin-bottom: 6px !important;
  }

  body[data-page="build"] .goal p:first-of-type {
    font-size: 0.88rem !important;
    line-height: 1.2 !important;
  }

  body[data-page="build"] .goal p:last-of-type {
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
  }

  body[data-page="build"] .multi-select-dropdown-menu {
    display: block !important;
    height: 188px !important;
    max-height: 188px !important;
    min-height: 188px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9rem !important;
  }

  body[data-page="build"] .multi-select-dropdown-menu option {
    padding: 8px 10px;
    line-height: 1.25;
  }

  body[data-page="dashboard"] .dash-sidebar-footer {
    padding: 14px;
  }

  body[data-page="dashboard"] .dash-sidebar-footer-user {
    font-size: 0.96rem;
  }

  body[data-page="dashboard"] .dash-sidebar-footer-link {
    font-size: 0.88rem;
  }

  body[data-page="dashboard"] .dash-workflow-next-row {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="dashboard"] .dash-workflow-next-row .btn {
    width: 100%;
  }

  body[data-page="library"] .library-card-summary {
    padding: 12px 14px;
  }

  body[data-page="library"] .library-card-body {
    padding: 10px 14px 12px;
  }

  body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card h3 {
    font-size: 0.9rem;
  }

  body[data-page="optimized"] .protocol-v2-actions-card .btn {
    min-height: 52px;
  }

  body[data-page="account"] .account-chart-card,
  body[data-page="account"] .tracking-card-block {
    padding: 14px;
  }
}

html[data-theme="dark"] body[data-page="optimized"] .workflow-summary-bar {
  border-color: rgba(136, 124, 224, 0.34);
  background: #1f2640;
}

html[data-theme="dark"] body[data-page="optimized"] .workflow-summary-badge {
  border-color: rgba(112, 222, 176, 0.38);
  background: rgba(34, 97, 72, 0.72);
  color: #9de9c7;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-actionbtn {
  border-color: rgba(143, 132, 221, 0.44);
  background: #1c2338;
  color: #e4e9ff;
}

/* Optimized v2 recolor to match index hero palette + photo atmosphere */
body[data-page="optimized"] .protocol-v2-overview,
body[data-page="optimized"] .protocol-v2-main {
  position: relative;
  overflow: hidden;
}

body[data-page="optimized"] .protocol-v2-overview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(122deg, rgba(9, 13, 10, 0.92) 0%, rgba(12, 17, 13, 0.84) 42%, rgba(18, 28, 20, 0.74) 100%),
    url("https://images.pexels.com/photos/13787596/pexels-photo-13787596.jpeg?auto=compress&cs=tinysrgb&w=1800");
  background-size: cover;
  background-position: center;
}

body[data-page="optimized"] .protocol-v2-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(160deg, rgba(238, 245, 236, 0.96) 0%, rgba(236, 244, 234, 0.97) 54%, rgba(232, 242, 230, 0.98) 100%);
}

body[data-page="optimized"] .protocol-v2-main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background:
    radial-gradient(circle at 86% 22%, rgba(32, 166, 106, 0.2), transparent 34%),
    radial-gradient(circle at 12% 72%, rgba(20, 123, 80, 0.16), transparent 32%),
    url("https://images.pexels.com/photos/13787565/pexels-photo-13787565.jpeg?auto=compress&cs=tinysrgb&w=1300");
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  background-position: center;
  filter: saturate(0.75);
}

body[data-page="optimized"] .protocol-v2-hero-shell {
  border-color: rgba(166, 219, 188, 0.34) !important;
  background: rgba(14, 20, 15, 0.8) !important;
  box-shadow: 0 14px 40px rgba(9, 12, 9, 0.24);
}

body[data-page="optimized"] .protocol-v2-kicker {
  color: #8be6b2;
}

body[data-page="optimized"] .protocol-v2-kicker::before {
  color: #5fd895;
}

body[data-page="optimized"] .protocol-v2-hero-head h1 {
  color: #f3f8ef;
}

body[data-page="optimized"] .protocol-v2-hero-head .protocol-subtitle {
  color: #cad9cc !important;
}

body[data-page="optimized"] .protocol-v2-meta .meta {
  color: #b7c5b8;
}

body[data-page="optimized"] .protocol-v2-art {
  border-color: rgba(147, 228, 182, 0.38);
  background:
    radial-gradient(circle at 18% 30%, rgba(95, 216, 149, 0.24), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(67, 173, 116, 0.2), transparent 52%),
    linear-gradient(145deg, rgba(17, 26, 20, 0.78), rgba(16, 24, 19, 0.84));
}

body[data-page="optimized"] .protocol-v2-art .protocol-hero-glyph {
  border-color: rgba(144, 230, 181, 0.44);
  color: #9cf1c1;
  background: rgba(14, 21, 16, 0.9);
}

body[data-page="optimized"] .protocol-v2-stats {
  border-color: rgba(171, 224, 192, 0.34);
  background: rgba(14, 21, 16, 0.74) !important;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card + .protocol-stat-card {
  border-left-color: rgba(170, 224, 190, 0.24);
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-icon {
  color: #0f5f3e;
  border-color: rgba(141, 228, 177, 0.6);
  background: linear-gradient(145deg, #c6f2d9, #dcf7e9);
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card h3 {
  color: #b9cbbd;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .stat-value {
  color: #f4f9f2;
}

body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .meta {
  color: #afc3b3;
}

html[data-theme="light"] body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card h3 {
  color: #d9efe2 !important;
}

html[data-theme="light"] body[data-page="optimized"] .protocol-v2-stats .protocol-stat-card .meta {
  color: #acd2be !important;
}

body[data-page="optimized"] .protocol-v2-workflow-card,
body[data-page="optimized"] .protocol-v2-params-card,
body[data-page="optimized"] .protocol-v2-why-card,
body[data-page="optimized"] .protocol-v2-protips-card,
body[data-page="optimized"] .protocol-v2-actions-card,
body[data-page="optimized"] .protocol-v2-deep-details,
body[data-page="optimized"] .workflow-card {
  border-color: #d5e4d5 !important;
  background: #fbfcf8 !important;
}

body[data-page="optimized"] .protocol-v2-workflow-head h3,
body[data-page="optimized"] .protocol-v2-params-card .card-head h3,
body[data-page="optimized"] .protocol-v2-why-card .card-head h3,
body[data-page="optimized"] .protocol-v2-protips-card .card-head h3,
body[data-page="optimized"] .workflow-copy-slot h4 {
  color: #101e13;
}

body[data-page="optimized"] .workflow-copy-slot .meta,
body[data-page="optimized"] .protocol-v2-parameter-label {
  color: #5e6e61;
}

body[data-page="optimized"] .workflow-list::before {
  background: linear-gradient(180deg, rgba(32, 166, 106, 0.92), rgba(20, 123, 80, 0.52));
}

body[data-page="optimized"] .workflow-step {
  border-color: #1f9f64;
  background: #20a66a;
}

body[data-page="optimized"] .workflow-icon-slot {
  color: #147b50;
  border-color: #c7ebd6;
  background: #e7f7ee;
}

body[data-page="optimized"] .workflow-icon-slot.tone-blue {
  color: #147b50;
  border-color: #c7ebd6;
  background: #e7f7ee;
}

body[data-page="optimized"] .workflow-icon-slot.tone-teal {
  color: #0f6a43;
  border-color: #bbe7ce;
  background: #dcf4e8;
}

body[data-page="optimized"] .workflow-data-pill {
  color: #1d7a52;
  background: #e9f7ee;
  border-color: #c4e8d2;
}

body[data-page="optimized"] .workflow-data-pill.tone-blue,
body[data-page="optimized"] .workflow-data-pill.tone-teal {
  color: #1d7a52;
  background: #e4f4eb;
}

body[data-page="optimized"] .schedule-select-btn {
  border-color: #c8ddd0;
  color: #3f5447;
  background: #f2f7f2;
}

body[data-page="optimized"] .schedule-select-btn.is-selected {
  border-color: rgba(32, 166, 106, 0.44);
  background: rgba(32, 166, 106, 0.12);
  color: #147b50;
}

body[data-page="optimized"] .workflow-summary-bar {
  border-color: #cbe4d4;
  background: #edf8f1;
}

body[data-page="optimized"] .workflow-summary-total {
  color: #147b50;
}

body[data-page="optimized"] .workflow-summary-badge {
  border-color: #b6e3c8;
  background: #dff4e8;
  color: #147b50;
}

body[data-page="optimized"] .protocol-v2-why-summary {
  border-color: #cae9d8;
  background: #edf8f2;
}

body[data-page="optimized"] .protocol-v2-checklist li {
  color: #20483a;
}

body[data-page="optimized"] .protocol-v2-checklist li::before {
  color: #147b50;
  background: #dff4e8;
}

body[data-page="optimized"] .protocol-v2-profile-summary {
  border-color: #d9e9db;
  background: #f6fbf6;
}

body[data-page="optimized"] .protocol-v2-protips-card {
  border-color: #cde4d3 !important;
  background: #edf4f0 !important;
}

body[data-page="optimized"] .protocol-v2-protips-card .meta {
  color: #3b5546;
}

body[data-page="optimized"] .protocol-v2-actionbtn {
  border-color: #c8ddd0;
  color: #384f41;
  background: #f3f7f2;
}

body[data-page="optimized"] .protocol-v2-actionbtn-primary {
  color: #f6fbf3;
  background: linear-gradient(135deg, #10120f, #1b1f1a);
  border-color: #10120f;
}

body[data-page="optimized"] .protocol-v2-actionbtn-primary:hover {
  background: linear-gradient(135deg, #0b0d0b, #151915);
}

@media (max-width: 980px) {
  body[data-page="optimized"] .protocol-v2-overview::after {
    background-position: 55% center;
  }
}

@media (max-width: 640px) {
  body[data-page="optimized"] .protocol-v2-main::after {
    opacity: 0.12;
    filter: saturate(0.7);
  }
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-overview::after {
  background:
    linear-gradient(125deg, rgba(4, 8, 6, 0.94) 0%, rgba(7, 12, 9, 0.88) 40%, rgba(11, 19, 14, 0.78) 100%),
    url("https://images.pexels.com/photos/13787596/pexels-photo-13787596.jpeg?auto=compress&cs=tinysrgb&w=1800");
  background-size: cover;
  background-position: center;
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-main::before {
  background: linear-gradient(160deg, rgba(10, 14, 11, 0.96) 0%, rgba(11, 16, 12, 0.98) 100%);
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-main::after {
  opacity: 0.14;
  filter: saturate(0.65) brightness(0.7);
}

html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-workflow-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-params-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-why-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-protips-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-actions-card,
html[data-theme="dark"] body[data-page="optimized"] .protocol-v2-deep-details,
html[data-theme="dark"] body[data-page="optimized"] .workflow-card {
  border-color: #314033 !important;
  background: #131a13 !important;
}

html[data-theme="dark"] body[data-page="optimized"] .workflow-step {
  box-shadow: 0 0 0 6px #0f131d;
}
