/* Simple Food Track — shared guide theme (matches web app) */
:root {
  --page: #0b0f0d;
  --brand: #34d399;
  --brand-muted: #6ee7b7;
  --brand-dim: #065f46;
  --brand-ink: #042f2e;
  --focus: #3b82f6;
  --warn: #fbbf24;
  --surface: #18221c;
  --surface-elevated: #121916;
  --surface-secondary: #1f2b24;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: rgba(255, 255, 255, 0.92);
  --text-soft: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.45);
  /* Legacy aliases used throughout guide markup/CSS */
  --rust: var(--brand);
  --rust-light: var(--brand-muted);
  --rust-dark: var(--brand-dim);
  --cream: var(--page);
  --ink: var(--text);
  --ink-soft: var(--text-soft);
  --muted: var(--text-muted);
  --white: var(--surface-secondary);
  --surface-2: var(--surface);
  --gold: var(--warn);
  --gold-light: var(--brand-muted);
  --green: #34d399;
  --green-light: #6ee7b7;
  --red: #fb7185;
  --amber: #fbbf24;
  --purple: #c084fc;
  --stage-1: #fb7185;
  --stage-2: #fbbf24;
  --stage-3: #f87171;
  --healthy: #34d399;
  --scrollbar-thumb: rgba(110, 231, 183, 0.32);
  --scrollbar-thumb-hover: rgba(110, 231, 183, 0.5);
  --scrollbar-track: rgba(255, 255, 255, 0.04);
}


html,
body {
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #34d399 #121916;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: #121916;
}

*::-webkit-scrollbar-thumb {
  background-color: #065f46;
  border-radius: 6px;
  border: 3px solid #121916;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #34d399;
}

*::-webkit-scrollbar-corner {
  background: var(--page);
}

  

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: Inter, system-ui, sans-serif;
    background: var(--page);
    color: var(--text);
    overflow-x: hidden;
  }

  /* Content links — avoid browser default blue on dark background */
  a:not(.nav-tab),
  a:not(.nav-tab):link,
  a:not(.nav-tab):any-link {
    color: var(--brand-muted);
    text-decoration: underline;
    text-decoration-color: rgba(110, 231, 183, 0.4);
    text-underline-offset: 2px;
    -webkit-text-fill-color: var(--brand-muted);
  }

  a:not(.nav-tab):hover {
    color: #a7f3d0;
    text-decoration-color: rgba(167, 243, 208, 0.65);
    -webkit-text-fill-color: #a7f3d0;
  }

  a:not(.nav-tab):visited {
    color: #86efac;
    -webkit-text-fill-color: #86efac;
  }

  a:not(.nav-tab):focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 2px;
  }

  /* NAV TABS */
  .nav-tabs {
    background: var(--surface-elevated);
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .nav-tabs::-webkit-scrollbar { display: none; }

  .nav-tab {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 16px 20px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
    text-decoration: none;
  }

  .nav-tab:hover { color: rgba(255, 255, 255, 0.92); }

  .nav-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    background: rgba(255, 255, 255, 0.04);
  }

  @media (max-width: 767px) {
    .nav-tabs.guide-nav-desktop-only {
      display: none;
    }

    .nav-tabs:not(.guide-nav-desktop-only) {
      padding: 0 4px;
      -webkit-overflow-scrolling: touch;
      scroll-snap-type: x proximity;
    }

    .nav-tabs:not(.guide-nav-desktop-only) .nav-tab {
      padding: 14px 16px;
      font-size: 10px;
      scroll-snap-align: start;
    }
  }

  @media (min-width: 768px) {
    .guide-nav-mobile { display: none !important; }
  }

  .guide-nav-mobile {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 110;
  }

  @media (max-width: 767px) {
    .guide-nav-mobile[aria-hidden="false"] {
      display: flex;
    }
  }

  .guide-nav-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface-secondary);
    color: var(--text);
    border-radius: 0.75rem;
    padding: 10px 12px;
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .guide-nav-mobile-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }

  .guide-nav-mobile-icon {
    font-size: 14px;
    line-height: 1;
  }

  .guide-nav-mobile-current {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .guide-nav-mobile {
    position: sticky;
    flex-wrap: wrap;
  }

  .guide-nav-mobile-panel {
    width: 100%;
    order: 4;
    background: var(--surface-elevated);
    border-top: 1px solid var(--border);
    max-height: min(60vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .guide-nav-mobile-panel[hidden] {
    display: none !important;
  }

  .guide-nav-mobile-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-soft);
    padding: 14px 16px;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .guide-nav-mobile-item:last-child {
    border-bottom: none;
  }

  .guide-nav-mobile-item.active,
  .guide-nav-mobile-item:hover,
  .guide-nav-mobile-item:focus-visible {
    background: rgba(52, 211, 153, 0.08);
    color: var(--brand-muted);
    outline: none;
  }

  body.guide-nav-open {
    overflow: hidden;
  }

  /* SECTIONS */
  .section {
    display: none;
    animation: fadeIn 0.4s ease;
  }
  .section.active { display: block; }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
  }

  .guide-layout-wide .container {
    max-width: 1360px;
  }

  .guide-layout-wide .section-desc {
    max-width: 760px;
  }

  /* SECTION HEADERS */
  .section-header {
    margin-bottom: 32px;
  }

  .section-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--rust);
    margin-bottom: 8px;
  }

  .section-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: 2px;
    color: var(--text);
    line-height: 1;
  }

  .section-desc {
    font-size: 15px;
    color: var(--muted);
    font-weight: 300;
    margin-top: 10px;
    max-width: 640px;
    line-height: 1.6;
  }

  /* CARDS */
  .card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 24px;
    margin-bottom: 16px;
  }

  .card-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 20px;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: var(--text);
  }

  /* GRID LAYOUTS */
  .grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

  /* IRON EXPLAINED */
  .iron-trio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
  }

  .trio-card {
    border-radius: 1rem;
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
  }

  .trio-card.serum { background: linear-gradient(135deg, #1e3a5f, #2563a8); color: white; }
  .trio-card.tibc { background: linear-gradient(135deg, #2d5a2d, #3d7a3d); color: white; }
  .trio-card.ferritin { background: linear-gradient(135deg, var(--rust-dark), var(--rust)); color: white; }

  .trio-icon {
    font-size: 36px;
    margin-bottom: 12px;
  }

  .trio-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 6px;
  }

  .trio-name {
    font-family: Inter, system-ui, sans-serif;
    font-size: 26px;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }

  .trio-desc {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.6;
    font-weight: 300;
  }

  .trio-analogy {
    margin-top: 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 0.75rem;
    padding: 10px 14px;
    font-size: 12px;
    font-style: italic;
    opacity: 0.9;
  }

  /* FERRITIN GAUGE */
  .gauge-section {
    background: var(--surface-elevated);
    border-radius: 1rem;
    padding: 32px;
    margin-bottom: 32px;
    color: var(--text);
  }

  .gauge-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    margin-bottom: 6px;
    color: var(--gold-light);
  }

  .gauge-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 24px;
    font-weight: 300;
  }

  .gauge-bar {
    position: relative;
    height: 44px;
    border-radius: 1rem;
    overflow: hidden;
    background: #333;
    margin-bottom: 8px;
  }

  .gauge-segments {
    display: flex;
    height: 100%;
    width: 100%;
  }

  .gauge-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: opacity 0.2s;
    cursor: default;
  }

  .gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
  }

  .gauge-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 9px;
    color: rgba(255,255,255,0.45);
  }

  .gauge-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 20px;
  }

  .gauge-zone {
    border-radius: 0.75rem;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
  }

  .gauge-zone-range {
    font-family: Inter, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 4px;
  }

  .gauge-zone-label {
    font-size: 11px;
    opacity: 0.7;
  }

  /* SYMPTOMS */
  .symptom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  .symptom-category {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
  }

  .symptom-cat-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .symptom-cat-icon { font-size: 20px; }

  .symptom-cat-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 17px;
    letter-spacing: 1px;
  }

  .symptom-list {
    padding: 4px 18px 14px;
  }

  .symptom-item {
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid var(--surface-2);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink-soft);
    line-height: 1.4;
  }

  .symptom-item:last-child { border-bottom: none; }

  .symptom-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rust);
    flex-shrink: 0;
    margin-top: 5px;
  }

  /* FOOD SOURCES */
  .food-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .food-table th {
    background: var(--surface-elevated);
    color: var(--text);
    padding: 10px 14px;
    text-align: left;
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
  }

  .food-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  .food-table tr:hover td { background: var(--surface); }

  .food-bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--rust), var(--gold));
    display: inline-block;
    vertical-align: middle;
  }

  .food-type-heme {
    background: rgba(193,68,14,0.12);
    color: var(--rust-dark);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 3px;
    font-family: Inter, system-ui, sans-serif;
    letter-spacing: 1px;
  }

  .food-type-non {
    background: rgba(45,122,79,0.12);
    color: var(--green);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 3px;
    font-family: Inter, system-ui, sans-serif;
    letter-spacing: 1px;
  }

  /* ABSORPTION */
  .absorb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  @media (max-width: 640px) { .absorb-grid { grid-template-columns: 1fr; } }

  .absorb-card {
    border-radius: 1rem;
    padding: 20px;
  }

  .absorb-card.boosters {
    background: linear-gradient(135deg, rgba(45,122,79,0.08), rgba(76,175,120,0.05));
    border: 1px solid rgba(45,122,79,0.25);
  }

  .absorb-card.blockers {
    background: linear-gradient(135deg, rgba(185,28,28,0.08), rgba(193,68,14,0.05));
    border: 1px solid rgba(185,28,28,0.2);
  }

  .absorb-header {
    font-family: Inter, system-ui, sans-serif;
    font-size: 22px;
    letter-spacing: 1px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .absorb-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 13px;
    line-height: 1.5;
  }

  .absorb-item:last-child { border-bottom: none; }

  .absorb-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

  /* TIMING PROTOCOL */
  .timeline {
    position: relative;
    padding-left: 32px;
    margin: 20px 0;
  }

  .timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--rust), var(--gold));
  }

  .timeline-item {
    position: relative;
    margin-bottom: 20px;
  }

  .timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rust);
    border: 2px solid var(--cream);
    box-shadow: 0 0 0 2px var(--rust);
  }

  .timeline-time {
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--rust);
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .timeline-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 3px;
  }

  .timeline-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
  }

  /* OVERLOAD SECTION */
  .danger-banner {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: white;
    border-radius: 1rem;
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .danger-icon { font-size: 40px; flex-shrink: 0; }

  .danger-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 26px;
    letter-spacing: 2px;
    margin-bottom: 6px;
  }

  .danger-desc {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.6;
    font-weight: 300;
  }

  /* FORMS */
  .form-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 28px;
    margin-bottom: 20px;
  }

  .form-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    margin-bottom: 4px;
    color: var(--text);
  }

  .form-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
    font-weight: 300;
  }

  .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }

  .form-group { display: flex; flex-direction: column; gap: 6px; }

  .form-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
  }

  .form-input {
    background: var(--page);
    border: 1.5px solid var(--border);
    border-radius: 0.75rem;
    padding: 10px 14px;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.2s;
    -webkit-appearance: none;
  }

  .form-input:focus {
    outline: none;
    border-color: var(--rust);
  }

  .form-input.normal { border-color: var(--green); }
  .form-input.low { border-color: var(--red); }
  .form-input.high { border-color: var(--amber); }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rust);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 12px 24px;
    font-family: Inter, system-ui, sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
  }

  .btn:hover { background: var(--rust-dark); transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }

  .btn-secondary {
    background: transparent;
    color: var(--rust);
    border: 1.5px solid var(--rust);
  }

  .btn-secondary:hover { background: var(--rust); color: white; }

  .btn-green {
    background: var(--green);
  }

  .btn-green:hover { background: #1a5c39; }

  /* RESULT PANEL */
  .result-panel {
    border-radius: 1rem;
    padding: 24px;
    margin-top: 20px;
    display: none;
  }

  .result-panel.show { display: block; animation: fadeIn 0.3s ease; }

  .result-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
  }

  .result-icon { font-size: 40px; }

  .result-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
  }

  .result-sub { font-size: 13px; opacity: 0.7; }

  .result-items { margin-top: 12px; }

  .result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    font-size: 13px;
    line-height: 1.5;
  }

  .result-item:last-child { border-bottom: none; }

  /* REMINDER */
  .reminder-section {
    background: linear-gradient(135deg, var(--ink), var(--ink-soft));
    border-radius: 1rem;
    padding: 28px;
    color: var(--text);
    margin-bottom: 20px;
  }

  .reminder-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--gold-light);
    margin-bottom: 6px;
  }

  .reminder-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 20px;
    font-weight: 300;
  }

  .reminder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
  }

  .reminder-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 16px;
  }

  .reminder-card-title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 8px;
  }

  .reminder-card-desc {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255,255,255,0.75);
  }

  /* SUPPLEMENT LOG */
  .supp-log {
    margin-top: 16px;
  }

  .supp-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: end;
  }

  @media (max-width: 600px) {
    .supp-row { grid-template-columns: 1fr 1fr; }
    .supp-row .supp-delete { grid-column: span 2; }
  }

  .supp-delete {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--muted);
    border-radius: 0.75rem;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    align-self: end;
  }

  .supp-delete:hover { border-color: var(--red); color: var(--red); }

  /* ALERT BOXES */
  .alert {
    border-radius: 1rem;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.6;
  }

  .alert-icon { font-size: 18px; flex-shrink: 0; }
  .alert-text { flex: 1; }
  .alert-title { font-weight: 600; margin-bottom: 3px; }

  .alert-warning { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.28); color: #fde68a; }
  .alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.25); color: #bfdbfe; }
  .alert-success { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.28); color: #a7f3d0; }
  .alert-danger { background: rgba(251, 113, 133, 0.1); border: 1px solid rgba(251, 113, 133, 0.28); color: #fecdd3; }

  /* TAG */
  .tag {
    display: inline-block;
    font-family: Inter, system-ui, sans-serif;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: 6px;
  }

  .tag-red { background: rgba(185,28,28,0.12); color: var(--red); }
  .tag-green { background: rgba(45,122,79,0.12); color: var(--green); }
  .tag-amber { background: rgba(217,119,6,0.12); color: var(--amber); }

  /* SUPPLEMENT FORMS TABLE */
  .supp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
  }

  .supp-table th {
    background: var(--surface-2);
    padding: 10px 14px;
    text-align: left;
    font-family: Inter, system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 400;
    border-bottom: 2px solid var(--border);
  }

  .supp-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  .supp-table tr:hover td { background: var(--surface); }

  .stars { color: var(--rust); }

  /* PROGRESS TRACKER */
  .progress-list { margin-top: 12px; }

  .progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }

  .progress-item:last-child { border-bottom: none; }

  .progress-date {
    font-family: Inter, system-ui, sans-serif;
    font-size: 11px;
    color: var(--muted);
  }

  .progress-value {
    font-family: Inter, system-ui, sans-serif;
    font-size: 20px;
    letter-spacing: 1px;
  }

  .progress-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
  }

  .delete-history {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
  }

  .delete-history:hover { color: var(--red); }

  /* EMPTY STATE */
  .empty-state {
    text-align: center;
    padding: 32px;
    color: var(--muted);
  }

  .empty-state-icon { font-size: 36px; margin-bottom: 10px; }
  .empty-state-text { font-size: 14px; font-weight: 300; }

  /* FOOTER */
  .footer {
    background: var(--surface-elevated);
    color: rgba(255,255,255,0.45);
    text-align: center;
    padding: 24px;
    font-size: 12px;
    font-weight: 300;
    line-height: 1.8;
  }

  /* UTILITY */
  .divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
  }

  .text-rust { color: var(--rust); }
  .text-green { color: var(--green); }
  .text-red { color: var(--red); }
  .text-amber { color: var(--amber); }
  .text-muted { color: var(--muted); }

  .fw-600 { font-weight: 600; }

  .mt-4 { margin-top: 4px; }
  .mt-8 { margin-top: 8px; }
  .mt-16 { margin-top: 16px; }
  .mt-24 { margin-top: 24px; }
  .mb-16 { margin-bottom: 16px; }
  .mb-24 { margin-bottom: 24px; }

  /* ACCORDION */
  .accordion-item {
    border: 1px solid var(--border);
    border-radius: 1rem;
    margin-bottom: 8px;
    overflow: hidden;
  }

  .accordion-header {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    transition: background 0.2s;
    user-select: none;
  }

  .accordion-header:hover { background: var(--surface); }

  .accordion-header-text {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .accordion-arrow {
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.25s;
  }

  .accordion-item.open .accordion-arrow { transform: rotate(180deg); }

  .accordion-body {
    display: none;
    padding: 0 20px 16px;
    background: var(--white);
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.7;
  }

  .accordion-item.open .accordion-body { display: block; }

  /* CHART */
  .mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    margin-top: 12px;
  }

  .chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
  }

  .chart-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
  }

  .chart-bar-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 8px;
    color: var(--muted);
    text-align: center;
  }

  .chart-bar-val {
    font-family: Inter, system-ui, sans-serif;
    font-size: 9px;
    color: var(--ink-soft);
    text-align: center;
  }

  @media (max-width: 768px) {
    .hero { padding: 40px 20px 36px; }
    .container { padding: 28px 16px; }
    .danger-banner { flex-direction: column; text-align: center; }
    .absorb-grid { grid-template-columns: 1fr; }
  }


/* Pathway guide — components not in iron health guide */
.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
}

.flow-arrow,
.triage-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  line-height: 1;
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-muted);
  text-align: center;
  min-height: 28px;
  padding: 4px 0;
  flex-shrink: 0;
}

.flow-split {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
  position: relative;
}
.flow-split::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--border);
}
.flow-split-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 220px;
}

.flow-node {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 14px 18px;
  width: 100%;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
  font-family: Inter, system-ui, sans-serif;
}
.flow-node:hover,
.flow-node:focus-visible {
  background: var(--surface);
  border-color: var(--brand);
  outline: none;
}
.flow-node[aria-expanded="true"] {
  border-left: 4px solid var(--brand);
  border-color: var(--brand);
  background: var(--surface);
}
.flow-node-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.flow-node-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.flow-node-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.blocker-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.node-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.node-detail-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 16px 18px;
  margin: 8px 0 16px;
  font-size: 14px;
  line-height: 1.65;
}
.node-detail-inner dt {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-muted);
  margin-top: 10px;
}
.node-detail-inner dt:first-child { margin-top: 0; }
.node-detail-inner dd { margin-left: 0; color: var(--text-soft); }

.stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.stage-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 180px;
  text-align: center;
}
.stage-pill:hover,
.stage-pill:focus-visible { border-color: var(--brand); outline: none; }

.pathway-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .pathway-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .pathway-grid { grid-template-columns: 1fr; } }

.pathway-header {
  padding: 18px 18px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.2s;
  background: var(--surface-secondary);
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.pathway-header:hover,
.pathway-header:focus-visible { background: var(--surface); outline: none; }
.pathway-header h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.pathway-subtitle {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}
.pathway-chevron { font-size: 12px; color: var(--text-muted); transition: transform 0.25s ease; flex-shrink: 0; margin-top: 4px; }
.pathway-card.expanded .pathway-chevron { transform: rotate(180deg); }
.pathway-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.pathway-body-inner { padding: 0 18px 18px; }

.insight-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  padding: 12px 14px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-soft);
  margin-bottom: 16px;
  border-radius: 0 0.75rem 0.75rem 0;
}
.note-banner {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 0.75rem;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 16px;
  color: #fecdd3;
}

.mini-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
}
.mini-flow-step {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 10px 14px;
  font-size: 12px;
  text-align: center;
  width: 100%;
  line-height: 1.45;
  color: var(--text-soft);
}
.mini-flow-arrow {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-muted);
  padding: 4px 0;
  line-height: 1;
}
.mini-flow-branch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin: 6px 0;
}
@media (max-width: 480px) { .mini-flow-branch { grid-template-columns: 1fr; } }

.symptom-box {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 14px 16px;
  margin-top: 8px;
}
.symptom-box-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.symptom-box ul { list-style: none; font-size: 13px; }
.symptom-box li {
  padding: 5px 0 5px 16px;
  position: relative;
  color: var(--text-soft);
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
}
.symptom-box li:last-child { border-bottom: none; }
.symptom-box li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.pathway-card[data-pathway="1"] .symptom-box li::before { background: var(--amber); }
.pathway-card[data-pathway="2"] .symptom-box li::before { background: var(--red); }
.pathway-card[data-pathway="3"] .symptom-box li::before { background: var(--purple); }

.triage-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 28px;
}
.triage-tier {
  width: 100%;
  border-radius: 1rem;
  padding: 18px 22px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  text-align: center;
}
.triage-tier:nth-child(1) { width: 55%; border-top: 4px solid var(--healthy); }
.triage-tier:nth-child(2) { width: 75%; border-top: 4px solid var(--amber); }
.triage-tier:nth-child(3) { width: 100%; border-top: 4px solid var(--red); }
.triage-tier-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.triage-tier h4 { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.triage-tier ul { list-style: none; font-size: 13px; color: var(--text-soft); }
.triage-tier li { padding: 3px 0; }
.triage-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.missed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 768px) { .missed-grid { grid-template-columns: 1fr; } }
.missed-item {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface-secondary);
}
.missed-trigger {
  width: 100%;
  text-align: left;
  background: var(--surface-secondary);
  border: none;
  padding: 16px 20px;
  cursor: pointer;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}
.missed-trigger:hover,
.missed-trigger:focus-visible { background: var(--surface); outline: none; }
.missed-trigger .chevron { font-size: 12px; color: var(--text-muted); transition: transform 0.25s; flex-shrink: 0; }
.missed-item.open .missed-trigger .chevron { transform: rotate(180deg); }
.missed-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.missed-content-inner {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
  background: var(--surface-secondary);
}

.marker-table-wrap,
.ref-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  padding: 6px 8px 8px;
}
.marker-table,
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stage-summary {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.75;
  border-left: 4px solid var(--brand);
  color: var(--text-soft);
}


/* App-aligned hero */
.hero {
  background: linear-gradient(180deg, rgba(11, 36, 24, 0.85) 0%, var(--page) 100%);
  position: relative;
  overflow: hidden;
  padding: 60px 40px 50px;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(52, 211, 153, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(34, 211, 238, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 9999px;
  margin-bottom: 20px;
  position: relative;
}

.hero h1 {
  font-weight: 900;
  font-size: clamp(40px, 7vw, 72px);
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.05;
  position: relative;
  margin-bottom: 8px;
}

.hero h1 span {
  background: linear-gradient(90deg, #6ee7b7, #fff, #a5f3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 400;
  letter-spacing: 0;
  position: relative;
  margin-top: 12px;
}

/* nav-tabs — defined above in NAV TABS section */

.section-label {
  color: var(--brand-muted);
  font-weight: 800;
  letter-spacing: 0.22em;
}

.section-title {
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 4vw, 40px);
}

.section-desc { color: var(--text-muted); font-weight: 400; }

.card,
.symptom-category,
.form-section,
.flow-node,
.pathway-card,
.triage-tier,
.missed-item,
.marker-table-wrap,
.ref-table-wrap,
.stage-summary,
.accordion-item {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.card-title,
.form-title,
.trio-name,
.gauge-title,
.danger-title,
.reminder-title,
.absorb-header,
.pathway-header h3 {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.food-table th,
.marker-table th,
.ref-table th {
  background: var(--surface-elevated);
  color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.food-table td,
.marker-table td,
.ref-table td,
.supp-table td {
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.marker-table tr:last-child td,
.ref-table tr:last-child td {
  border-bottom: none;
}

.food-table tr:hover td,
.marker-table tr:hover td,
.ref-table tr:hover td,
.supp-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.btn {
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.btn:hover { background: #6ee7b7; transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(52, 211, 153, 0.45);
}
.btn-secondary:hover { background: rgba(52, 211, 153, 0.12); color: var(--brand-muted); }

.alert-warning { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.28); color: #fde68a; }
.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.25); color: #bfdbfe; }
.alert-success { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.28); color: #a7f3d0; }
.alert-danger { background: rgba(251, 113, 133, 0.1); border: 1px solid rgba(251, 113, 133, 0.28); color: #fecdd3; }

.gauge-section,
.reminder-section {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.gauge-title,
.reminder-title { color: var(--brand-muted); }

.footer {
  background: var(--surface-elevated);
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

.trio-card.serum { background: linear-gradient(135deg, #1e3a5f, #2563eb); }
.trio-card.tibc { background: linear-gradient(135deg, #065f46, #34d399); }
.trio-card.ferritin { background: linear-gradient(135deg, var(--brand-dim), var(--brand)); }

.absorb-card.boosters {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
}
.absorb-card.blockers {
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.2);
}

.danger-banner {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.9), rgba(153, 27, 27, 0.85));
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.food-type-heme { background: rgba(52, 211, 153, 0.12); color: var(--brand-muted); }
.food-type-non { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }

.symptom-dot { background: var(--brand); }
.stars { color: var(--brand); }

.blocker-badge {
  background: rgba(52, 211, 153, 0.1);
  color: var(--brand-muted);
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.pathway-card[data-pathway="1"] { border-top: 3px solid var(--amber); }
.pathway-card[data-pathway="2"] { border-top: 3px solid var(--red); }
.pathway-card[data-pathway="3"] { border-top: 3px solid var(--purple); }

.pathway-card[data-pathway="1"] .pathway-header h3 { color: var(--amber); }
.pathway-card[data-pathway="2"] .pathway-header h3 { color: var(--red); }
.pathway-card[data-pathway="3"] .pathway-header h3 { color: var(--purple); }

.stage-pill.active { color: var(--brand-ink); font-weight: 800; }
.stage-pill[data-stage="1"].active { background: var(--stage-1); border-color: var(--stage-1); color: #fff; }
.stage-pill[data-stage="2"].active { background: var(--stage-2); border-color: var(--stage-2); color: var(--brand-ink); }
.stage-pill[data-stage="3"].active { background: var(--stage-3); border-color: var(--stage-3); color: #fff; }
.strategy-pill.active,
.intensity-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

html { scroll-behavior: smooth; }
section { scroll-margin-top: 56px; }

/* Food/Macro Chain guide */
.sources-list {
  list-style: none;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-soft);
}
.sources-list > li { margin-bottom: 14px; padding-left: 0; }
.sources-list a,
.sources-list a:link,
.sources-list a:any-link {
  color: var(--brand-muted);
  -webkit-text-fill-color: var(--brand-muted);
}
.sources-list a:visited {
  color: #86efac;
  -webkit-text-fill-color: #86efac;
}
.sources-group-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 12px;
}
.sources-group-title:first-child { margin-top: 0; }
.trio-card.macro-carb { background: linear-gradient(135deg, #92400e, #fbbf24); color: #fff; }
.trio-card.macro-fat { background: linear-gradient(135deg, #4c1d95, #c084fc); color: #fff; }
.trio-card.macro-protein { background: linear-gradient(135deg, #065f46, #34d399); color: #fff; }
.fuel-triage {
  max-width: 100%;
  align-items: stretch;
  width: 100%;
  gap: 4px;
}

.fuel-triage .triage-arrow {
  align-self: center;
  width: auto;
  min-height: 28px;
  padding: 2px 0;
}

.fuel-triage .triage-tier,
.fuel-triage .triage-tier.fuel-1,
.fuel-triage .triage-tier.fuel-2,
.fuel-triage .triage-tier.fuel-3,
.fuel-triage .triage-tier.fuel-4,
.fuel-triage .triage-tier.fuel-5,
.fuel-triage .triage-tier.fuel-6 {
  width: 100%;
  max-width: 100%;
  text-align: left;
  padding: 16px 18px;
}

.fuel-triage .triage-tier.fuel-1 { border-top: 4px solid #6ee7b7; }
.fuel-triage .triage-tier.fuel-2 { border-top: 4px solid #34d399; }
.fuel-triage .triage-tier.fuel-3 { border-top: 4px solid #fbbf24; }
.fuel-triage .triage-tier.fuel-4 { border-top: 4px solid #f59e0b; }
.fuel-triage .triage-tier.fuel-5 { border-top: 4px solid #fb923c; }
.fuel-triage .triage-tier.fuel-6 { border-top: 4px solid #fb7185; }

.fuel-triage .triage-tier-label {
  letter-spacing: 0.12em;
  line-height: 1.45;
}

.fuel-triage .triage-tier h4 {
  font-size: 16px;
  line-height: 1.4;
}

.fuel-triage .triage-tier ul {
  line-height: 1.55;
}

.fuel-triage .triage-tier li {
  padding: 5px 0 5px 14px;
  position: relative;
}

.fuel-triage .triage-tier li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--brand-muted);
}

@media (max-width: 640px) {
  .fuel-triage .triage-tier {
    padding: 14px 16px;
  }

  .fuel-triage .triage-tier-label {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .fuel-triage .triage-tier h4 {
    font-size: 15px;
  }

  .fuel-triage .triage-tier ul {
    font-size: 14px;
  }
}
.fuel-chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.fuel-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.intensity-pills { flex-wrap: wrap; }
.intensity-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
}

/* ── Mobile readability (guides) ── */
@media (max-width: 767px) {
  .container {
    padding: 24px 14px;
  }

  .section-title {
    font-size: clamp(26px, 8vw, 36px);
    letter-spacing: 0.02em;
    line-height: 1.1;
  }

  .section-desc {
    font-size: 14px;
    line-height: 1.65;
  }

  .card {
    padding: 18px 16px;
  }

  .card-title {
    font-size: 17px;
    line-height: 1.35;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stage-pills {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
  }

  .stage-pill {
    min-width: 0;
    flex: none;
    width: 100%;
    padding: 14px 16px;
    font-size: 12px;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: none;
  }

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

  .intensity-pills .stage-pill:last-child {
    grid-column: 1 / -1;
  }

  .stage-summary {
    padding: 16px 18px;
    font-size: 14px;
  }

  .flowchart {
    max-width: 100%;
  }

  .flow-split {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
  }

  .flow-split::before {
    display: none;
  }

  .flow-split-col {
    max-width: none;
    width: 100%;
  }

  .flow-node {
    padding: 14px 16px;
  }

  .flow-node-title {
    font-size: 15px;
  }

  .node-detail,
  .node-detail.open {
    max-width: 100%;
  }

  .pathway-header h3 {
    font-size: 18px;
  }

  .gauge-section {
    padding: 20px 16px;
  }

  .gauge-title {
    font-size: 22px;
  }

  .gauge-seg {
    font-size: 0;
  }

  .gauge-labels {
    font-size: 9px;
  }

  .gauge-zone-label {
    font-size: 13px;
    line-height: 1.5;
  }

  .iron-trio {
    grid-template-columns: 1fr;
  }

  .trio-card {
    padding: 22px 18px;
  }

  .trio-name {
    font-size: 22px;
  }

  /* Tables: card layout on small screens */
  .marker-table-wrap,
  .ref-table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
    margin-bottom: 16px;
    padding: 0;
  }

  .marker-table,
  .ref-table,
  .marker-table tbody,
  .ref-table tbody,
  .marker-table tr,
  .ref-table tr,
  .marker-table td,
  .ref-table td {
    display: block;
    width: 100%;
  }

  .marker-table thead,
  .ref-table thead {
    display: none;
  }

  .marker-table tr,
  .ref-table tr {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface-secondary);
  }

  .marker-table td,
  .ref-table td {
    border: none;
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
  }

  .marker-table td:first-child,
  .ref-table td:first-child {
    grid-column: 1 / -1;
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }

  .marker-table td[data-label]:not(:first-child)::before,
  .ref-table td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
    grid-column: 1;
  }

  .marker-table td[data-label]:not(:first-child),
  .ref-table td[data-label]:not(:first-child) {
    grid-template-columns: 1fr;
  }

  /* Two-column reference tables (question / answer) */
  .ref-table--qa td:first-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 4px;
  }

  .ref-table--qa td:last-child {
    display: block;
    color: var(--text-soft);
  }

  .ref-table--qa td:last-child::before {
    display: none;
  }

  /* Wide food tables: horizontal scroll instead of crushing columns */
  .card:has(> .food-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .food-table {
    min-width: 560px;
    font-size: 12px;
  }

  .food-table th,
  .food-table td {
    padding: 10px 12px;
    vertical-align: top;
  }

  .food-table td:last-child {
    min-width: 120px;
    line-height: 1.45;
  }

  .alert {
    align-items: flex-start;
  }

  .alert-text {
    font-size: 13px;
    line-height: 1.55;
  }

  .insight-callout {
    font-size: 14px;
    line-height: 1.6;
  }

  .footer {
    padding: 24px 16px;
    font-size: 12px;
    line-height: 1.6;
  }
}

@media (max-width: 767px) and (min-width: 480px) {
  .intensity-pills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intensity-pills .stage-pill:last-child {
    grid-column: auto;
  }
}

/* Fat burn strategies section */
.evidence-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evidence-tier {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.evidence-tier h4 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text);
}

.evidence-tier p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
}

.evidence-rank {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.evidence-strong { border-left: 4px solid #34d399; }
.evidence-strong .evidence-rank { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; }
.evidence-moderate { border-left: 4px solid #fbbf24; }
.evidence-moderate .evidence-rank { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.evidence-weak { border-left: 4px solid #fb7185; }
.evidence-weak .evidence-rank { background: rgba(251, 113, 133, 0.2); color: #fda4af; }

.strategy-pills {
  margin-bottom: 24px;
}

.strategy-panel[hidden] {
  display: none !important;
}

.strategy-list {
  list-style: none;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
}

.strategy-list li {
  padding: 6px 0 6px 16px;
  position: relative;
}

.strategy-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--brand-muted);
  font-weight: 700;
}

.strategy-week-table th,
.strategy-week-table td {
  font-size: 13px;
  line-height: 1.5;
  vertical-align: top;
}

@media (max-width: 767px) {
  .strategy-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .strategy-pills .stage-pill {
    text-align: center;
    padding: 12px 10px;
    font-size: 11px;
    white-space: normal;
    line-height: 1.35;
  }
}
