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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: 24px;
  align-items: end;
  padding: 40px clamp(18px, 5vw, 64px) 28px;
  background: #ffffff;
  border-bottom: 1px solid #d9e1e5;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4b6f6c;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: #4d5960;
  font-size: 1.05rem;
}

.notice {
  border-left: 4px solid #b4453c;
  padding: 12px 14px;
  background: #fff4f1;
  color: #6b2c26;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 24px;
  padding: 28px clamp(18px, 5vw, 64px) 48px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e1e5;
  border-radius: 8px;
  padding: 18px;
}

label,
fieldset {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 14px;
  color: #334148;
  font-size: 0.92rem;
  font-weight: 650;
}

fieldset {
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 8px;
  font-weight: 650;
}

.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 500;
}

input,
select,
button {
  width: 100%;
  border: 1px solid #b8c7cd;
  border-radius: 6px;
  padding: 10px 11px;
  color: #172026;
  background: #ffffff;
  font: inherit;
}

input[type="radio"] {
  width: auto;
}

button {
  border-color: #1f6b5f;
  background: #1f6b5f;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.advanced-grid {
  margin-top: 16px;
}

.status,
.caption {
  margin: 12px 0 0;
  color: #59666d;
  font-size: 0.9rem;
}

.results {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

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

.metrics article {
  min-height: 112px;
  border: 1px solid #d9e1e5;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.metrics span {
  display: block;
  margin-bottom: 12px;
  color: #56636a;
  font-size: 0.86rem;
  font-weight: 700;
}

.metrics strong {
  color: #102128;
  font-size: 1.55rem;
}

.error {
  border: 1px solid #cc6a5e;
  border-radius: 8px;
  padding: 14px;
  background: #fff4f1;
  color: #702f27;
  font-weight: 700;
}

.chart {
  width: 100%;
  min-height: 430px;
}

@media (max-width: 900px) {
  .app-header,
  .app-shell,
  .metrics {
    grid-template-columns: 1fr;
  }
}
