
:root {
  --background: #ffffff;
  --foreground: #161921;
  --muted-foreground: #687587;
  --border: #e2e8f0;
  --card: #ffffff;
  --muted: #f8fafc;
  --accent: #013164;
  --ring: rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size:15px;
  line-height:1.4em;
}

body {
  min-height: 100vh;
}

.page-shell {
  width: min(960px, calc(100% - 32px));
  margin: 40px auto;
  display: grid;
  gap: 20px;
}

.header {
  padding: 24px;
  margin-bottom: 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 24px;
}

.hero-card {
  padding: 32px 24px;
  background: var(--muted)
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  margin-bottom: 12px;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

h3 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 16px;
  margin-bottom: 10px;
}

.lead,
.lead-small,
.section-header p,
.stat-card p,
.detail-card p,
.breakdown-item p {
  color: var(--muted-foreground);
}

.lead {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.6;
}

.lead-small {
  margin-top: 10px;
  line-height: 1.6;
}

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

.badge {
  border: 1px solid var(--border);
  background: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

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

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

.field-full {
  grid-column: 1 / -1;
}

label {
  font-size: 14px;
  font-weight: 600;
}

select,
button {
  font: inherit;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--foreground);
  padding: 0 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

select:focus {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 4px var(--ring);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--foreground);
  background: var(--foreground);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform .3s ease, opacity .3s ease, background .3s ease;
}

.button:hover {
  /* transform: translateY(-1px); */
  border: 1px solid var(--accent);
  background: var(--accent);
}

.button-secondary {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
  width: 100%;
}

.button-secondary:hover {
  background: var(--accent);
}

.restart-card {
  padding-top: 18px;
  display: flex;
  justify-content: right;
  width: 100%;
}

.hidden {
  display: none;
}

.result-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}

.result-hero,
.score-card,
.stat-card,
.detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.result-hero {
  padding: 20px;
  background: var(--muted)
}

.score-card {
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: var(--muted);
}

.score-card span,
.stat-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-card strong {
  font-size: 34px;
  line-height: 1;
}

.score-card small {
  color: var(--muted-foreground);
}

.stats-grid,
.insights-grid {
  display: grid;
  gap: 16px;
}

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

.phase-separator {
  grid-column: 1 / -1;
  /* padding-bottom: 8px; */
  /* border-bottom: 1px solid var(--border); */
  margin-top: 48px;
}

.phase-separator h4 {
  font-size: 15px;
  margin: 0;
}

.stat-card,
.detail-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 20px;
  margin: 8px 0 8px;
  letter-spacing: -0.01em;
}

.breakdown-list {
  display: grid;
  gap: 12px;
}

.reference-list {
  display: grid;
  gap: 8px;
}

.reference-list a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breakdown-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.breakdown-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.breakdown-item strong {
  font-size: 14px;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
    margin: 20px auto;
  }

  .card {
    padding: 18px;
  }

  .form-grid,
  .stats-grid,
  .insights-grid,
  .result-top {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
  }
}
