:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18202b;
  --muted: #657083;
  --line: #d9dee7;
  --blue: #2563eb;
  --green: #047857;
  --amber: #b45309;
  --red: #b91c1c;
  --shadow: 0 18px 50px rgba(24, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

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

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 8px;
}

nav a.active,
nav a:hover {
  background: #eef4ff;
  color: var(--blue);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

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

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

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

h1 {
  font-size: 28px;
  line-height: 1.18;
  margin-bottom: 8px;
}

.intro p,
.model-card p,
.decision-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.status-pill,
.version-tag,
.fit-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  background: #eef4ff;
  color: var(--blue);
}

.status-pill.success {
  background: #e9f8f1;
  color: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.form-panel,
.result-panel,
.decision-panel {
  padding: 22px;
}

.section-heading {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}

.section-heading:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.section-heading h2,
.result-panel h2,
.model-card h2,
.decision-panel h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

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

.check-row label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.primary {
  width: 100%;
  height: 46px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}

.primary:hover {
  background: #1d4ed8;
}

.result-panel {
  position: sticky;
  top: 96px;
}

.result-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.risk-badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 850;
  margin-bottom: 16px;
}

.risk-badge.muted {
  background: #f0f2f5;
  color: var(--muted);
}

.risk-badge.low {
  background: #e9f8f1;
  color: var(--green);
}

.risk-badge.medium {
  background: #fff7ed;
  color: var(--amber);
}

.risk-badge.high {
  background: #fef2f2;
  color: var(--red);
}

#result-copy {
  color: var(--muted);
  line-height: 1.5;
}

.score-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.score-box span {
  color: var(--muted);
  font-weight: 700;
}

.score-box strong {
  font-size: 18px;
}

.reason-list {
  margin-top: 18px;
}

.reason-list ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

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

.model-card {
  padding: 22px;
}

.model-card.recommended {
  border-color: rgba(4, 120, 87, 0.38);
  box-shadow: 0 18px 50px rgba(4, 120, 87, 0.12);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.version-tag {
  background: #eef4ff;
  color: var(--blue);
}

.fit-tag.underfit {
  background: #f0f2f5;
  color: #475467;
}

.fit-tag.overfit {
  background: #fef2f2;
  color: var(--red);
}

.fit-tag.best {
  background: #e9f8f1;
  color: var(--green);
}

dl {
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

dl div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 750;
}

.decision-panel {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .workspace,
  .version-grid,
  .grid.two,
  .grid.three,
  .check-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .intro {
    flex-direction: column;
    align-items: stretch;
  }

  .result-panel {
    position: static;
  }
}
