:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4ee;
  --soft: #f6f8fb;
  --panel: #ffffff;
  --green: #047857;
  --teal: #0f766e;
  --blue: #2563eb;
  --red: #dc2626;
  --amber: #d97706;
  --violet: #7c3aed;
  --shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #edf2f7;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 44px 48px 34px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 14px;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.lead {
  max-width: 960px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.app-header > div,
.section-header > div,
.notice-band > *,
.pager-panel,
.process-strip div,
.panel {
  min-width: 0;
}

.metadata {
  display: grid;
  grid-template-columns: repeat(2, 132px);
  gap: 10px;
}

.metadata div,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfefe;
  padding: 14px;
}

.metadata div {
  position: relative;
  min-height: 84px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.metadata div::before,
.metric::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--teal);
}

.metadata div:nth-child(2)::before,
.metric:nth-child(2)::before {
  background: var(--blue);
}

.metadata div:nth-child(3)::before,
.metric:nth-child(3)::before {
  background: var(--amber);
}

.metadata div:nth-child(4)::before,
.metric:nth-child(4)::before {
  background: var(--violet);
}

.metric:nth-child(5)::before {
  background: var(--green);
}

.metric:nth-child(6)::before {
  background: var(--red);
}

.metadata strong,
.metric strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.metadata span,
.metric span,
.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

main {
  display: grid;
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.notice-band {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  overflow-wrap: anywhere;
}

.pager-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.pager-copy h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.pager-copy p:last-child {
  max-width: 920px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pager-controls {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.pager-controls button,
.view-mode-toggle button,
.page-tabs button,
.guide-tabs button,
.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pager-controls button {
  min-width: 96px;
  padding: 11px 14px;
}

.pager-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.view-mode-toggle {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.view-mode-toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-mode-toggle button {
  min-height: 36px;
  padding: 7px 12px;
  color: #334155;
  font-size: 12px;
}

.view-mode-toggle button.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

body[data-view-mode="simple"] [data-detail-level="advanced"] {
  display: none !important;
}

.page-tabs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.page-tabs button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  color: #334155;
  font-size: 13px;
}

.page-tabs button span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
}

.page-tabs button.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.page-tabs button.active span {
  background: #0f766e;
  color: #ffffff;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.process-strip div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.process-strip span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
}

.process-strip strong {
  min-width: 0;
  font-size: 14px;
}

.process-strip small {
  color: var(--muted);
  line-height: 1.35;
}

.guide-panel {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.guide-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.guide-tabs button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  color: #334155;
  font-size: 13px;
}

.guide-tabs button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
}

.guide-tabs button.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.guide-tabs button.active span {
  background: #0f766e;
  color: #ffffff;
}

.guide-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.guide-card h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.guide-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.guide-card ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.45;
}

.guide-card li + li {
  margin-top: 7px;
}

.secondary-button {
  min-width: 178px;
  padding: 11px 14px;
  background: #0f172a;
  color: #ffffff;
  white-space: nowrap;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: var(--shadow);
}

.punchline {
  border-color: #99f6e4;
  background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 72%);
}

.punchline h2 {
  max-width: 1100px;
  font-size: 26px;
}

.data-explainer {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.data-explainer p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.data-definition-grid div,
.calc-card,
.feature-bridge div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 13px;
}

.data-definition-grid strong,
.calc-card strong,
.feature-bridge strong {
  display: block;
}

.data-definition-grid span,
.feature-bridge span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compare-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

select {
  min-width: 280px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.metric {
  min-height: 118px;
}

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

.metric-preset {
  display: grid;
  gap: 6px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.metric-preset:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

.metric-preset span {
  color: var(--muted);
  font-size: 12px;
}

.metric-explorer-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.43fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.radar-panel {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.direction-card {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.direction-card.positive {
  border-color: #bbf7d0;
}

.direction-card.negative {
  border-color: #fecaca;
}

.direction-card span,
.direction-card small {
  color: var(--muted);
  font-size: 12px;
}

.metric-direction-table,
.interval-table {
  margin-top: 14px;
}

.comparison-verdict {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.comparison-verdict div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.comparison-verdict strong {
  display: block;
  margin-bottom: 6px;
}

.comparison-verdict span {
  color: var(--muted);
  line-height: 1.45;
}

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

.clone-compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.clone-compare-card.risk {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
}

.clone-compare-card.winner {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.compare-card-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.compare-card-head span,
.compare-card-head small,
.compare-kpis span,
.compare-row small {
  color: var(--muted);
  font-size: 12px;
}

.compare-card-head strong {
  font-size: 30px;
  line-height: 1;
}

.compare-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compare-kpis div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  padding: 10px;
}

.compare-kpis strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.1;
}

.risk-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.45;
}

.risk-list li + li {
  margin-top: 5px;
}

.compare-matrix {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compare-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 106px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.compare-row > div {
  position: relative;
  min-height: 30px;
  overflow: hidden;
  border-radius: 6px;
  background: #e2e8f0;
}

.compare-row i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: inherit;
  background: #94a3b8;
}

.compare-row div:nth-of-type(1).winner i {
  background: #dc2626;
}

.compare-row div:nth-of-type(2).winner i {
  background: #047857;
}

.compare-row span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 7px 9px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pilot-panel {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff 0%, #f7fef9 100%);
}

.pilot-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.32fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 14px;
}

.pilot-hero > div:first-child,
.pilot-outcome {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.pilot-hero h3 {
  max-width: 900px;
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.18;
}

.pilot-hero p {
  max-width: 1000px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pilot-outcome {
  display: grid;
  align-content: center;
  gap: 8px;
  border-color: #99f6e4;
  background: #ecfdf5;
}

.fba-select-label {
  align-content: center;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #ecfdf5;
  padding: 18px;
}

.fba-select-label select {
  width: 100%;
  min-width: 0;
}

.pilot-outcome strong {
  font-size: 26px;
  line-height: 1.12;
}

.pilot-outcome span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.pilot-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

.pilot-card strong {
  display: block;
  margin-bottom: 8px;
}

.pilot-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pilot-callout {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px 16px;
  color: #1e3a8a;
}

.pilot-callout strong {
  white-space: nowrap;
}

.fba-result-hero code {
  color: #334155;
}

.fba-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.fba-kpi,
.fba-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

.fba-kpi {
  display: grid;
  gap: 6px;
  min-height: 106px;
}

.fba-kpi span,
.fba-kpi small {
  color: var(--muted);
  font-size: 12px;
}

.fba-kpi span {
  font-weight: 800;
  text-transform: uppercase;
}

.fba-kpi strong {
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.fba-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px 16px;
  color: #1e3a8a;
}

.fba-note span {
  line-height: 1.45;
}

.fba-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.fba-score-definition {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.fba-score-definition strong {
  display: block;
  margin-bottom: 8px;
}

.fba-score-definition p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.fba-results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.fba-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.fba-card h3 {
  font-size: 17px;
}

.fba-inspect-card {
  position: sticky;
  top: 14px;
}

.fba-inspect-header {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.fba-inspect-card h4 {
  margin: 16px 0 8px;
  color: #334155;
  font-size: 13px;
  text-transform: uppercase;
}

.fba-inline-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.fba-ranking-formula {
  display: block;
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #334155;
  white-space: normal;
}

.model-fit-table tr[data-fba-clone-row] {
  cursor: pointer;
}

.model-fit-table tr.selected-row {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 #0f766e;
}

.fba-bullets {
  margin: 0 0 14px;
  padding-left: 18px;
  color: #334155;
  line-height: 1.45;
}

.fba-bullets li + li {
  margin-top: 6px;
}

.advanced-model-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-model-details summary {
  cursor: pointer;
  color: #334155;
  font-weight: 800;
}

.advanced-model-details p {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill.mid {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.warn {
  background: #fee2e2;
  color: #991b1b;
}

.export-panel {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
}

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

.export-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 164px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

.export-card strong,
.export-card span {
  display: block;
}

.export-card strong {
  margin-bottom: 8px;
}

.export-card span {
  color: var(--muted);
  line-height: 1.45;
}

.export-button {
  width: 100%;
  border: 1px solid #0f172a;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 12px;
}

.export-button:hover,
.secondary-button:hover {
  background: #1e293b;
}

.recommendation-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.recommendation-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 156px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f7fef9;
  padding: 14px;
}

.recommendation-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.recommendation-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.recommendation-card small {
  color: var(--muted);
  line-height: 1.35;
}

.recommendation-summary-grid + .table-wrap,
#recommendation-table {
  margin-top: 14px;
}

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

.mini-chart {
  min-height: 218px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.wide-chart,
#scatter-titer-overflow,
#scatter-qp-ivcd,
#ranking-impact {
  width: 100%;
  overflow-x: auto;
}

svg {
  display: block;
  width: 100%;
  height: auto;
}

svg text {
  font-family: inherit;
}

.chart-title {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.axis-label,
.rank-label,
.score-label,
.tick-label,
.legend-label,
.rank-detail,
.annotation,
.point-label,
.threshold-label {
  fill: var(--muted);
  font-size: 11px;
}

.tick-label {
  font-size: 10px;
}

.legend-label {
  font-size: 10px;
}

.score-label {
  fill: var(--ink);
  font-weight: 800;
}

.radar-label {
  fill: #334155;
  font-size: 11px;
  font-weight: 800;
}

.rank-detail {
  fill: #94a3b8;
}

.metric-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.annotation,
.threshold-label {
  fill: #475569;
  font-size: 10px;
  font-weight: 700;
}

.point-label {
  fill: #0f172a;
  font-size: 11px;
  font-weight: 800;
}

.bar-internal {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.interval-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.interval-explain {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 16px;
  color: #1e3a8a;
}

.interval-explain h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.interval-explain p {
  margin-bottom: 10px;
  line-height: 1.45;
}

.interval-explain p:last-child {
  margin-bottom: 0;
}

.interval-cards,
.feature-bridge {
  display: grid;
  gap: 10px;
}

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

.calc-card {
  display: grid;
  gap: 8px;
  background: #ffffff;
}

.calc-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calc-card code {
  color: #334155;
  white-space: normal;
}

.calc-card strong {
  color: var(--ink);
  font-size: 18px;
}

.feature-bridge {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.ranking-explainer {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px 16px;
  color: #1e3a8a;
}

.ranking-explainer p {
  margin-bottom: 0;
  line-height: 1.45;
}

.ranking-explainer code {
  display: block;
  color: #1e3a8a;
  white-space: normal;
}

.score-name-table,
.score-math-table {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.ranking-math-table {
  margin-top: 10px;
}

.screen-score-explainer {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

.screen-score-explainer h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.screen-score-explainer p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.screen-score-explainer code {
  display: block;
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #334155;
  white-space: normal;
}

.constraint-bridge {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 14px 16px;
}

.constraint-bridge p {
  margin-bottom: 0;
  color: #166534;
  line-height: 1.45;
}

.learning-panel {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.learning-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}

.learning-hero > div:first-child {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.learning-hero h3 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.18;
}

.learning-hero p,
.learning-card p,
.latent-card p,
.section-note span {
  color: var(--muted);
  line-height: 1.45;
}

.learning-hero p,
.learning-card p,
.latent-card p {
  margin-bottom: 0;
}

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

.learning-kpi,
.learning-card,
.latent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

.learning-kpi {
  display: grid;
  gap: 7px;
  min-height: 116px;
}

.learning-kpi span,
.learning-kpi small,
.latent-card span {
  color: var(--muted);
  font-size: 12px;
}

.learning-kpi span,
.latent-card span {
  font-weight: 800;
  text-transform: uppercase;
}

.learning-kpi strong {
  font-size: 28px;
  line-height: 1;
}

.section-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px 16px;
  color: #1e3a8a;
}

.section-note strong {
  white-space: nowrap;
}

.relationship-map {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.relationship-map article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 84px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.relationship-map article > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.relationship-map div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.relationship-map small {
  color: var(--muted);
}

.relationship-map i,
.weight-list i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #2563eb;
}

.relationship-map b {
  text-align: right;
}

.learning-split,
.learning-two-column,
.learning-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.learning-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.weight-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.weight-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
}

.weight-list span {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.weight-list strong {
  color: var(--ink);
  font-size: 13px;
}

.weight-list i {
  grid-column: 1 / -1;
  background: #0f766e;
}

.weight-list.learned i {
  background: #7c3aed;
}

.latent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.latent-card {
  display: grid;
  gap: 8px;
}

.latent-card strong {
  font-size: 20px;
}

.cycle-chart-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.cycle-layout small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.mini-section-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 14px;
}

.secondary-mini-button,
.preset-row button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.secondary-mini-button:hover,
.preset-row button:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

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

.weight-slider {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(140px, 1fr) 52px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.weight-slider.disabled {
  background: #f8fafc;
  opacity: 0.58;
}

.weight-slider span {
  display: grid;
  gap: 4px;
}

.weight-slider strong {
  font-size: 13px;
}

.weight-slider small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.weight-slider input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.weight-slider b {
  text-align: right;
  font-size: 13px;
}

.learning-target-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

@media (min-width: 1081px) {
  .learning-target-layout > .learning-card:first-child {
    position: sticky;
    top: 14px;
  }
}

.learning-target-select {
  margin: 14px 0;
}

.learning-target-select select {
  width: 100%;
  min-width: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.learning-formula {
  display: block;
  margin-bottom: 12px;
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #334155;
  white-space: normal;
}

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

.quality-grid.compact {
  margin: 0;
}

.quality-pill {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.quality-pill span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quality-pill strong {
  font-size: 18px;
  line-height: 1;
}

.disabled-input-note {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  padding: 10px 12px;
  color: #9a3412;
  font-size: 12px;
}

.prediction-scatter {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.feature-matrix-table {
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature-matrix-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.hypothesis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.hypothesis-card {
  display: grid;
  gap: 11px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.hypothesis-card.accepted {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.hypothesis-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hypothesis-card strong {
  font-size: 16px;
}

.hypothesis-card code {
  color: #334155;
  white-space: normal;
}

.hypothesis-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hypothesis-card > b {
  justify-self: start;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.fba-pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pipeline-step {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px;
}

.pipeline-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.pipeline-step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.table-note {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.muted-svg {
  fill: var(--muted);
  font-size: 10px;
}

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

.comparison ol {
  margin: 0;
  padding-left: 20px;
}

.comparison li {
  margin-bottom: 10px;
}

.comparison p {
  margin: 0 0 10px;
  border-left: 3px solid #fecaca;
  padding-left: 10px;
  color: #334155;
}

.comparison span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-align: left;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr:hover {
  background: #eff6ff;
}

td code {
  color: #334155;
  font-size: 12px;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.detail-drawer {
  margin-top: 14px;
  background: #ffffff;
}

.detail-drawer.compact {
  margin: 0 0 12px;
  padding: 10px 12px;
}

.detail-drawer[open] > summary {
  margin-bottom: 12px;
}

.detail-drawer .learning-two-column {
  margin-bottom: 0;
}

.detail-drawer .learning-formula {
  margin-bottom: 0;
}

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

.formula-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #f8fafc;
}

.formula-grid code {
  display: block;
  white-space: normal;
}

.formula-grid span,
.assumptions p {
  color: var(--muted);
}

.formula-grid span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
}

.assumptions {
  max-width: 980px;
  margin-top: 16px;
}

.assumptions p:last-child {
  margin-bottom: 0;
}

@media (max-width: 1080px) {
  .app-header,
  .pager-panel,
  .two-column,
  .comparison,
  .process-strip,
  .guide-tabs,
  .guide-card,
  .data-explainer,
  .comparison-verdict,
  .clone-compare-grid,
  .metric-explorer-grid,
  .pilot-hero,
  .fba-results-layout,
  .fba-layout,
  .interval-layout,
  .feature-bridge,
  .learning-hero,
  .learning-split,
  .learning-two-column,
  .learning-rank-grid,
  .learning-target-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .trajectory-grid,
  .formula-grid,
  .compare-controls,
  .page-tabs,
  .pilot-grid,
  .export-grid,
  .recommendation-summary-grid,
  .data-definition-grid,
  .interval-cards,
  .metric-shortcuts,
  .direction-card-grid,
  .fba-kpi-grid,
  .fba-score-grid,
  .fba-pipeline,
  .latent-grid,
  .learning-kpi-grid,
  .hypothesis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fba-inspect-card {
    position: static;
  }

  .pager-controls {
    justify-content: start;
  }

  .view-mode-toggle {
    justify-content: start;
  }

  .guide-tabs button {
    justify-content: start;
  }

  .compare-row {
    grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr);
  }

  .compare-row small {
    grid-column: 2 / -1;
  }
}

@media (max-width: 680px) {
  .app-header {
    padding: 28px 18px;
  }

  h1 {
    font-size: 30px;
  }

  .lead {
    font-size: 16px;
  }

  main {
    padding: 18px 12px 40px;
  }

  .panel {
    padding: 18px;
  }

  .punchline h2 {
    font-size: 24px;
  }

  .metric-grid,
  .trajectory-grid,
  .formula-grid,
  .metadata,
  .page-tabs,
  .compare-controls,
  .compare-kpis,
  .pilot-grid,
  .export-grid,
  .recommendation-summary-grid,
  .data-definition-grid,
  .interval-cards,
  .metric-shortcuts,
  .direction-card-grid,
  .fba-kpi-grid,
  .fba-score-grid,
  .fba-pipeline,
  .latent-grid,
  .learning-kpi-grid,
  .hypothesis-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .guide-card {
    padding: 14px;
  }

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

  .pager-controls button {
    width: 100%;
  }

  .page-tabs button {
    justify-content: start;
  }

  .secondary-button {
    width: 100%;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .compare-row small {
    grid-column: auto;
  }

  .pilot-callout {
    display: grid;
  }

  .fba-note {
    display: grid;
  }

  .section-note {
    display: grid;
  }

  .relationship-map article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .relationship-map b {
    grid-column: 2;
    text-align: left;
  }

  .weight-slider {
    grid-template-columns: 1fr;
  }

  .weight-slider b {
    text-align: left;
  }

  .notice-band,
  .section-header {
    display: grid;
  }

  select {
    min-width: 0;
    width: 100%;
  }
}
