:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f6f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

a { color: inherit; }

button, input { font: inherit; }

.site-header,
.site-footer,
.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #dfe3ea;
}

.site-header nav { display: flex; gap: 20px; }
.site-header nav a { color: #596273; text-decoration: none; }
.site-header nav a[aria-current="page"] { color: #172033; }
.brand { font-weight: 750; text-decoration: none; }

.page-shell { padding-block: 56px 72px; }
.intro { max-width: 720px; margin-bottom: 32px; }
.intro h1 { margin: 6px 0 12px; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.04; }
.intro p { color: #596273; line-height: 1.6; }
.eyebrow, .step-label { margin: 0; color: #5162d6; font-size: .8rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid #dfe3ea; border-radius: 14px; padding: 24px; box-shadow: 0 8px 24px rgb(23 32 51 / 5%); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading h2, .explanation h2 { margin: 4px 0 0; font-size: 1.25rem; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; color: #3f4858; font-size: .92rem; }
.field input { width: 100%; padding: 12px 14px; color: #172033; background: #fff; border: 1px solid #cdd3dd; border-radius: 8px; outline: none; }
.field input:focus { border-color: #5162d6; box-shadow: 0 0 0 3px rgb(81 98 214 / 13%); }
.field input[aria-invalid="true"] { border-color: #c63f4f; }

.results-panel { position: sticky; top: 20px; }
.status-badge { padding: 6px 10px; border-radius: 999px; background: #eef0f4; color: #596273; font-size: .82rem; font-weight: 700; }
.status-badge[data-status="positive"] { background: #e6f6ec; color: #1e7140; }
.status-badge[data-status="warning"] { background: #fff4da; color: #835d08; }
.status-badge[data-status="negative"] { background: #fde9eb; color: #a12938; }
.primary-result { padding: 20px; border-radius: 10px; background: #f2f4ff; display: grid; gap: 6px; }
.primary-result span { color: #596273; font-size: .9rem; }
.primary-result strong { font-size: clamp(1.8rem, 5vw, 2.5rem); }
.result-list, .breakdown-list { margin: 20px 0 0; }
.result-list div, .breakdown-list div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #e8ebf0; }
.result-list dt, .breakdown-list dt { color: #596273; }
.result-list dd, .breakdown-list dd { margin: 0; font-weight: 700; text-align: right; }

.actions { margin-top: 24px; }
.button { min-height: 42px; border-radius: 8px; padding: 10px 14px; border: 1px solid transparent; cursor: pointer; }
.button-primary { width: 100%; background: #2739aa; color: #fff; }
.button-secondary { background: #fff; color: #596273; border-color: #cdd3dd; }
.button:hover { filter: brightness(.97); }
.action-status { min-height: 20px; margin: 8px 0 0; color: #596273; font-size: .85rem; text-align: center; }

.explanation { margin-top: 24px; }
.explanation details { margin-top: 24px; padding-top: 20px; border-top: 1px solid #e8ebf0; }
.explanation summary { cursor: pointer; font-weight: 700; }
.explanation details p { color: #596273; line-height: 1.6; }
.site-footer { padding-block: 24px; border-top: 1px solid #dfe3ea; color: #6b7381; font-size: .85rem; }

@media (max-width: 820px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .results-panel { position: static; }
}

@media (max-width: 560px) {
  .site-header, .site-footer, .page-shell { width: min(100% - 24px, 1160px); }
  .site-header nav { display: none; }
  .page-shell { padding-block: 36px 52px; }
  .panel { padding: 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
}
