/* Biological Age Estimator — Stylesheet
   Prefix: --bio-
   Cluster: health (accent: --tf-accent #8c2f39 in light, #d9737d in dark). */

:root {
  --bio-surface: #ffffff;
  --bio-card: #ffffff;
  --bio-border: #e2e8f0;
  --bio-text: #0f172a;
  --bio-muted: #64748b;
  --bio-code-bg: #f8fafc;
  --bio-radius: 4px;
}

.bio-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.bio-main {
  padding: 16px 0 60px;
}

/* Workspace Split Grid */
.bio-grid-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .bio-grid-workspace {
    grid-template-columns: 1fr;
  }
}

.bio-card {
  background: var(--bio-surface);
  border: 1.5px solid var(--bio-border);
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.bio-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--bio-border);
  padding-bottom: 12px;
}

.bio-sec-title {
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--bio-text);
  margin: 0;
}

.bio-presets-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bio-preset-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bio-muted);
}

.bio-chip {
  background: var(--bio-surface);
  border: 1px solid var(--bio-border);
  color: var(--bio-text);
  padding: 4px 10px;
  border-radius: var(--bio-radius);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.bio-chip:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

.bio-chip.active {
  background: var(--tf-accent-wash);
  border-color: var(--tf-accent);
  color: var(--tf-accent);
  font-weight: 700;
}

/* Form Controls */
.bio-group {
  margin-bottom: 16px;
}

.bio-lbl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bio-lbl {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--bio-text);
}

.bio-val-badge {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  color: var(--tf-accent);
  background: var(--tf-accent-wash);
  border: 1px solid var(--tf-accent);
  padding: 2px 8px;
  border-radius: var(--bio-radius);
  font-weight: 700;
}

.bio-slider {
  width: 100%;
  height: 6px;
  accent-color: var(--tf-accent);
  background: var(--bio-border);
  border-radius: 3px;
  outline: none;
}

.bio-toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
  border-top: 1px solid var(--bio-border);
  padding-top: 16px;
}

@media (max-width: 520px) {
  .bio-toggles-grid {
    grid-template-columns: 1fr;
  }
}

.bio-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bio-surface);
  border: 1px solid var(--bio-border);
  color: var(--bio-text);
  padding: 8px 10px;
  border-radius: var(--bio-radius);
  font-size: 0.8125rem;
  font-family: inherit;
  margin-top: 4px;
}

.bio-select:focus {
  outline: 2px solid var(--tf-accent);
  border-color: var(--tf-accent);
}

/* Results Hero */
.bio-score-hero {
  background: var(--bio-code-bg);
  border: 1.5px solid var(--bio-border);
  border-radius: 6px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 520px) {
  .bio-score-hero {
    flex-direction: column;
    text-align: center;
  }
}

.bio-score-col {
  display: flex;
  flex-direction: column;
}

.bio-s-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bio-muted);
  margin-bottom: 4px;
}

.bio-big-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--tf-accent);
  font-family: ui-monospace, monospace;
  line-height: 1;
}

.bio-s-unit {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bio-muted);
  margin-top: 4px;
}

.bio-delta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

@media (max-width: 520px) {
  .bio-delta-col {
    align-items: center;
    text-align: center;
  }
}

.bio-delta-badge {
  font-family: ui-monospace, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.bio-delta-badge.positive {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.bio-delta-badge.negative {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.bio-delta-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bio-muted);
  max-width: 180px;
}

/* Biomarker Gauges */
.bio-breakdown-sec {
  margin-bottom: 24px;
}

.bio-sub-heading {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--bio-text);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bio-gauge-item {
  margin-bottom: 14px;
}

.bio-g-lbl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bio-text);
  margin-bottom: 6px;
}

.bio-g-lbl-row strong {
  font-size: 0.75rem;
  font-weight: 700;
}

.bio-bar-bg {
  height: 8px;
  background: var(--bio-border);
  border-radius: 4px;
  overflow: hidden;
}

.bio-bar-fill {
  height: 100%;
  background: var(--tf-accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bio-bar-fill.emerald { background: #059669; }
.bio-bar-fill.amber { background: #d97706; }
.bio-bar-fill.red { background: #dc2626; }

/* Recommendations Box */
.bio-rec-box {
  background: var(--tf-accent-wash);
  border: 1.5px solid var(--tf-accent);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.bio-rec-title {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--tf-accent);
}

.bio-rec-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8125rem;
  color: var(--bio-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.45;
}

.bio-btn-copy {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bio-surface);
  border: 1.5px solid var(--bio-border);
  color: var(--bio-text);
  padding: 12px;
  border-radius: var(--bio-radius);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.bio-btn-copy:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

.bio-ad-container {
  margin-block: 2rem;
  min-height: 280px;
  border: 1px dashed var(--bio-border);
  border-radius: var(--bio-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --bio-surface: var(--tf-surface);
  --bio-card: var(--tf-surface);
  --bio-border: var(--tf-surface);
  --bio-text: var(--tf-ink);
  --bio-muted: var(--tf-ink-faint);
  --bio-code-bg: var(--tf-surface);
}

[data-theme="dark"] .bio-bar-bg {
  background: var(--tf-rule);
}
