:root {
  color-scheme: dark;
  --bg: #0c111a; /* deepen base background to navy for calmer contrast */
  --panel: #141c28; /* navy panel tone to replace near-black */
  --panel-light: #1c2636; /* lift input surfaces above panel */
  --text: #f1f5f9; /* brighter text for quick readability */
  --muted: #b3bcc9; /* softer secondary text with enough contrast */
  --accent: #f28b2d; /* orange accent reserved for primary actions */
  --accent-strong: #d9771f; /* darker orange for hover emphasis */
  --accent-blue: #5bb7ff; /* structural blue for headings */
  --accent-blue-strong: #3d8bd6; /* stronger blue for focus/contrast */
  --positive: #5bd38a; /* green only for positive signals */
  --border: #2c374a; /* navy-aligned border color */
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, #182233, var(--bg) 60%); /* navy gradient for Endura-like energy */
  color: var(--text);
  min-height: 100vh;
}

.page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  margin-bottom: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent-blue); /* align eyebrow with blue system color */
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  margin-bottom: 12px;
}

.subtitle {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

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

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 18px;
  color: var(--accent-blue); /* blue headers for clearer hierarchy */
  margin-bottom: 16px;
}

.panel:first-of-type h2 {
  font-weight: 650;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel:first-of-type {
  border-top: 1px solid rgba(91, 183, 255, 0.2); /* subtle blue edge for panel separation */
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 13px;
  color: #c7d0dc; /* brighten field labels for quick scanning */
  font-weight: 600; /* increase label weight without changing size */
}

input,
select {
  background: var(--panel-light);
  border: 1px solid #324159; /* clearer input edges against navy panel */
  border-radius: 12px;
  padding: 12px 14px;
  color: #f7fafc; /* brighter input text for readability */
  font-size: 15px;
}

#kb-standards-root input,
#kb-standards-root select {
  line-height: 1.4;
  padding-block: 10px;
  min-height: 40px;
}

#kb-standards-root select {
  padding-right: 40px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(91, 183, 255, 0.45); /* blue focus ring for clarity */
  border-color: var(--accent-blue-strong);
}

.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.helper {
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.helper.is-visible {
  opacity: 1;
}

.validation {
  font-size: 13px;
  color: #ff9b9b;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.validation.is-visible {
  opacity: 1;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary {
  background: var(--accent);
  color: #10141c; /* keep contrast on orange action */
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 650; /* stronger emphasis for primary action */
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(242, 139, 45, 0.35); /* orange glow for action feedback */
  background: var(--accent-strong);
}

.ghost {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.ghost:hover {
  border-color: #3a4a63; /* subtle hover outline for secondary actions */
  color: #e4eaf2;
}

a.ghost[data-reset] {
  padding: 10px 16px;
  border-color: rgba(91, 183, 255, 0.2); /* blue-tinted secondary action */
  background: rgba(28, 38, 54, 0.5); /* slightly lifted for clarity */
}

a.ghost[data-reset]:hover {
  border-color: rgba(91, 183, 255, 0.35);
  background: rgba(28, 38, 54, 0.7);
}

a.ghost[data-reset]:focus-visible {
  outline: 2px solid rgba(91, 183, 255, 0.45); /* focus ring for accessible reset */
  outline-offset: 2px;
}

.updated {
  font-size: 12px;
  color: rgba(91, 183, 255, 0.75); /* align update indicator with blue system */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.updated.is-visible {
  opacity: 1;
}

.result {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.result.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card {
  display: grid;
  gap: 18px;
}

.verdict {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: 1px solid rgba(91, 183, 255, 0.45);
  border-radius: 16px;
  padding: 18px;
  position: relative;
}

.verdict h3 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #fefeff; /* ensure strength tier label is readable */
}

.tier-cue {
  font-size: 13px;
  color: #d7e4f2;
  margin-top: 4px;
}

.label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: #cfd6e4;
}

.subline {
  font-size: 12px;
  color: #d7e2ef; /* clearer supporting line */
  margin-top: 6px;
}

.interpretation-line {
  font-size: 11px;
  color: #cbd7e6;
  margin-top: 4px;
}

.verdict .ghost {
  font-size: 12px;
  opacity: 0.75;
}

.compare p {
  font-size: 14px;
  color: #f2f6fb; /* brighter percentile and comparison text */
}

.compare-line {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 22, 35, 0.45);
  border-left: 3px solid transparent;
}

.compare-line.compare-positive {
  border-left-color: rgba(110, 219, 152, 0.8);
}

.compare-line.compare-neutral {
  border-left-color: rgba(111, 215, 255, 0.75);
}

.compare strong {
  color: #6edb98; /* stronger green for comparison headings */
  font-weight: 650; /* reinforce favorable result */
}

.compare span {
  color: #e6eef7; /* readable comparison body copy */
}

.meaning h4 {
  font-size: 15px;
  color: #6fd7ff; /* blue section headers for hierarchy */
  font-weight: 650;
  margin-bottom: 6px;
}

.meaning {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(79, 148, 199, 0.12);
  border-left: 3px solid rgba(111, 215, 255, 0.75);
}

.bjj-results-header,
.results-header {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(79, 148, 199, 0.08);
  border-left: 3px solid rgba(111, 215, 255, 0.55);
}

/* Align the BJJ snapshot header with the result cards by matching the results offset. */
.strength-standards-root [data-bjj-results-header],
.strength-standards-root .results-header {
  margin-left: 40px;
  padding-left: 40px;
}

.bjj-results-header h3,
.results-header h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #fefeff;
}

.bjj-results-header .subline,
.results-header .subline {
  margin-top: 0;
}

.bjj-results-header p,
.results-header p {
  margin: 4px 0 0;
  color: #d7e2ef;
  font-size: 13px;
}

.meaning p {
  color: #e9f1f9; /* readable explanatory copy */
  line-height: 1.5;
}

.inputs-used {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-light);
  border: 1px solid #2f3d53; /* improve separation for input summary */
  border-left: 3px solid rgba(111, 215, 255, 0.65);
}

.inputs-used p {
  font-size: 14px;
  margin-top: 4px;
  color: #f2f6fc; /* clearer input summary text */
}

.label-visual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.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;
}

.assumptions {
  background: var(--panel-light);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #2f3d53; /* match input summary framing */
}

.assumptions summary {
  cursor: pointer;
  font-size: 14px;
  color: #eef4fb; /* clearer summary text */
}

.assumptions ul {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  padding-left: 18px;
  color: #e5edf6; /* readable secondary list */
  font-size: 13px;
}

.how-it-works {
  font-size: 12px;
  color: #d7e0ec; /* readable explanatory tone */
}

.how-it-works summary {
  cursor: pointer;
  color: #eef4fb; /* clear summary text */
  font-size: 12px;
}

.how-it-works summary:hover,
.how-it-works summary:focus-visible {
  color: #eef3f8; /* hover clarity without new layout */
}

.how-it-works__content {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  color: #d7e0ec; /* readable explanatory tone */
  font-size: 13px;
  line-height: 1.5;
}

.age-adjustment,
.endura {
  font-size: 12px;
  color: #d7e0ec; /* readable explanatory tone */
}

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

  .verdict {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    flex-wrap: wrap;
  }
}

/* === RESULTS PANEL: FINAL READABILITY OVERRIDES (SHIP THIS) === */

/* Strength tier label: clearer section label styling */
#kb-standards-root .result .verdict .label,
.strength-standards-root .result .verdict .label {
  color: #6fd7ff;
  font-weight: 650;
  letter-spacing: 0.16em;
}

/* Tier result: keep dominant and bright */
#kb-standards-root .result .verdict h3,
.strength-standards-root .result .verdict h3 {
  color: #ffffff;
}

/* Tier metadata line */
#kb-standards-root .result .subline,
.strength-standards-root .result .subline {
  color: #ffffff;
  font-size: 13px;
}

/* Interpretation line under percentile */
#kb-standards-root .result .interpretation-line,
.strength-standards-root .result .interpretation-line {
  color: #f5f9ff;
  font-size: 14px;
}

/* Verdict paragraph text: ensure bright white for readability */
#kb-standards-root .result .verdict p,
.strength-standards-root .result .verdict p {
  color: #f5f9ff;
  font-size: 14px;
  line-height: 1.55;
}

/* Tier cue text under label */
#kb-standards-root .result .tier-cue,
.strength-standards-root .result .tier-cue {
  color: #e3ecf7;
  font-size: 13px;
  margin-top: 6px;
}

/* Copy result link */
#kb-standards-root .result .ghost,
.strength-standards-root .result .ghost {
  color: #e4ebf5;
  opacity: 1;
}

/* Inputs used content */
#kb-standards-root .result .inputs-used p,
.strength-standards-root .result .inputs-used p {
  color: #f5f9ff;
}

/* Comparison statements: stronger contrast and accents */
#kb-standards-root .result .compare p,
.strength-standards-root .result .compare p,
#kb-standards-root .result .compare span,
.strength-standards-root .result .compare span {
  color: #eef3f9;
}

#kb-standards-root .result .compare strong,
.strength-standards-root .result .compare strong {
  color: #79e1a4;
}

#kb-standards-root .result .compare-line,
.strength-standards-root .result .compare-line {
  background: rgba(12, 18, 28, 0.6);
}

#kb-standards-root .result .compare-line.compare-positive,
.strength-standards-root .result .compare-line.compare-positive {
  border-left-color: rgba(121, 225, 164, 0.9);
}

#kb-standards-root .result .compare-line.compare-neutral,
.strength-standards-root .result .compare-line.compare-neutral {
  border-left-color: rgba(111, 215, 255, 0.85);
}

/* What this means */
#kb-standards-root .result .meaning,
.strength-standards-root .result .meaning {
  background: rgba(111, 215, 255, 0.16);
  border-left: none;
}

#kb-standards-root .result .meaning p,
.strength-standards-root .result .meaning p {
  color: #e9f1f9;
}

/* BJJ standards ranges readability */
#kb-standards-root .result-card .meaning[data-bjj-standards] .standards-list li,
.strength-standards-root .result-card .meaning[data-bjj-standards] .standards-list li {
  color: #f3f6ff !important;
}

/* Inputs used: clearer subheading and block contrast */
#kb-standards-root .result .inputs-used,
.strength-standards-root .result .inputs-used {
  border-color: #3b4a62;
}

#kb-standards-root .result .inputs-used .label,
.strength-standards-root .result .inputs-used .label {
  color: #f7fbff;
  font-weight: 650;
  letter-spacing: 0.08em;
}

#kb-standards-root .result .inputs-used .label-visual,
.strength-standards-root .result .inputs-used .label-visual {
  color: #f7fbff;
}

/* Assumptions & limits: readable header/body */
#kb-standards-root .result .assumptions summary,
.strength-standards-root .result .assumptions summary {
  color: #f5f9ff;
  font-weight: 600;
}

/* Assumptions & limits body text tone */
#kb-standards-root .result .assumptions ul,
.strength-standards-root .result .assumptions ul {
  color: #e9f1f8;
}

#kb-standards-root .result .feedback-note,
.strength-standards-root .result .feedback-note {
  color: rgba(210, 223, 238, 0.95);
  font-size: 12px;
}

#kb-standards-root .result .feedback-note a,
.strength-standards-root .result .feedback-note a {
  color: #d8ecff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#kb-standards-root .result .age-adjustment,
.strength-standards-root .result .age-adjustment,
#kb-standards-root .result .endura,
.strength-standards-root .result .endura,
#kb-standards-root .result .how-it-works__content,
.strength-standards-root .result .how-it-works__content {
  color: rgba(204, 216, 232, 0.82);
}

/* Ensure results card content is contained */
#kb-standards-root .result-card,
.strength-standards-root .result-card,
#kb-standards-root .verdict,
.strength-standards-root .verdict,
#kb-standards-root .panel,
.strength-standards-root .panel {
  overflow: hidden;
}

/* Strength standards: consistent select sizing */
.strength-standards-root select {
  min-height: 44px;
  line-height: 44px;
  padding: 0 12px;
  box-sizing: border-box;
}

/* Strength standards: separate inputs and results */
.strength-standards-root .panel.result[data-result-section] {
  margin-left: 40px;
  padding-left: 40px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* Strength standards: secondary emphasis for percentile line */

.strength-standards-root .subline[data-tier-subline] {
  font-size: 0.9em;
  opacity: 0.75;
  margin-top: 4px;
}

/* Override dimming for primary performance line in Card 1 (verdict) */
#kb-standards-root .result .verdict .subline[data-tier-subline],
.strength-standards-root .result .verdict .subline[data-tier-subline] {
  opacity: 1;
}

/* BJJ Results Header: dark version to match result cards */
.strength-standards-root .bjj-results-header,
.strength-standards-root [data-bjj-results-header],
.strength-standards-root .results-header,
.strength-standards-root .bjj-snapshot-card {
  background: linear-gradient(180deg, #0b1220, #0f1f34);
  border: 1px solid rgba(148, 163, 184, 0.20);
  box-shadow: 0 16px 40px rgba(2, 8, 23, 0.25);
}

.strength-standards-root .bjj-results-header *,
.strength-standards-root [data-bjj-results-header] *,
.strength-standards-root .results-header *,
.strength-standards-root .bjj-snapshot-card * {
  color: #f8fafc !important;
  opacity: 1 !important;
}

/* GLOBAL FIX: Align results width with calculator width for all tools */
.strength-standards-root .results-container,
.strength-standards-root .results,
.strength-standards-root [data-result-section],
.strength-standards-root .results-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}




/* === FINAL OVERRIDES: Card 1 (Strength Tier) hierarchy === */

/* Make Strength Tier label blue and prominent */
#kb-standards-root .result .verdict .label,
.strength-standards-root .result .verdict .label {
  color: var(--accent-blue) !important;
}

/* Ensure Card 1 body text matches other cards in size and readability */
#kb-standards-root .result .verdict p,
#kb-standards-root .result .verdict .interpretation-line,
.strength-standards-root .result .verdict p,
.strength-standards-root .result .verdict .interpretation-line {
  font-size: 14px !important;
  line-height: 1.55 !important;
}


/* === FINAL OVERRIDES (NO ROOT WRAPPER): Card 1 verdict readability === */

/* Strength Tier label (Card 1) should match blue header treatment */
.panel.result .verdict .label {
  color: var(--positive) !important;
}

/* Primary performance line and verdict body text should match other cards */
.panel.result .verdict p,
.panel.result .verdict .interpretation-line,
.panel.result .verdict .subline {
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Card 1 inner readable surface */
.panel.result .verdict .verdict-content {
  background: var(--panel-light);
  border-radius: 12px;
  padding: 14px 16px;
}
/* Copy result summary as top-right overlay in Card 1 */
.panel.result .verdict .ghost[data-copy-result],
#kb-standards-root .result .verdict .ghost[data-copy-result],
.strength-standards-root .result .verdict .ghost[data-copy-result] {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  opacity: 0.7;
}

.panel.result .verdict .ghost[data-copy-result]:hover,
.panel.result .verdict .ghost[data-copy-result]:focus-visible {
  opacity: 1;
}

/* Ensure verdict content uses full width when overlay button is present */
.panel.result .verdict .verdict-content {
  width: 100%;
}

@media (max-width: 900px) {
  .panel.result .verdict .ghost[data-copy-result] {
    top: 8px;
    right: 8px;
  }
}