:root {
  --bg: #f4f1ea;
  --panel: #fffdf9;
  --ink: #1e2329;
  --muted: #5c6773;
  --line: #d7d1c6;
  --accent: #2f6c5c;
  --accent-soft: #e3efe9;
  --warn: #8f4a2b;
  --shadow: 0 18px 40px rgba(24, 28, 34, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

button,
input {
  font: inherit;
}

.page {
  width: min(1120px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

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

.hero {
  padding: 1.4rem;
  margin-bottom: 1rem;
}

.panel {
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.back-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:hover,
button:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 0.2rem;
  font-size: 1.3rem;
}

.lead,
.panel-head p,
.status,
.callout,
.result-notes,
label {
  color: var(--muted);
}

.hero-actions,
.field-grid,
.summary-grid {
  display: grid;
  gap: 0.8rem;
}

.hero-actions {
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
  margin: 1rem 0 0.6rem;
}

.field-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.96rem;
}

input {
  min-height: 42px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.risk-cell {
  display: grid;
  gap: 0.4rem;
}

.risk-option {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.88rem;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.summary-grid article,
.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.summary-grid article {
  padding: 1rem;
}

.summary-grid p,
.result-money {
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.05rem;
}

.callout {
  margin-top: 0.95rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(47, 108, 92, 0.18);
}

.results {
  display: grid;
  gap: 0.8rem;
}

.result-card {
  padding: 1rem;
}

.result-card.top {
  border-color: rgba(47, 108, 92, 0.38);
  background: #f8fcfa;
}

.result-head,
.result-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
}

.result-metrics {
  margin-top: 0.7rem;
}

.result-pill {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #f4f1ea;
  color: var(--muted);
  font-size: 0.84rem;
}

.warning {
  color: var(--warn);
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 1rem, 1120px);
  }

  .hero,
  .panel {
    padding: 1rem;
  }
}
