:root {
  --ink: #1c2430;
  --muted: #5b6573;
  --line: #d5dbe3;
  --paper: #f6f4ef;
  --card: #ffffff;
  --navy: #1e3a5f;
  --navy-2: #2a4d73;
  --orange: #e07a2f;
  --orange-soft: #fde8d4;
  --green: #2e6b4f;
  --green-soft: #e4f1ea;
  --gold: #f6ecd0;
  --result: #14324f;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  line-height: 1.45;
}

a { color: var(--navy); }

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
}

.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  color: #d7e2ef;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 12px;
  border-radius: 999px;
}

.nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav a.active { background: rgba(255,255,255,0.16); color: #fff; font-weight: 600; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

header.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

header.hero h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.85rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

header.hero p { margin: 0; opacity: 0.88; font-size: 1.02rem; }

header.hero .badge {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card h2 {
  margin: 0;
  padding: 14px 20px;
  background: #f0eee8;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}

.card .body { padding: 18px 20px 20px; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

select, input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 10px 12px;
  border: 1.5px solid #c9b59a;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--ink);
}

select:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(224,122,47,0.2);
}

.field { margin-bottom: 14px; }
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 8px;
}

.status-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.status-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.status-table tr.active {
  background: var(--green-soft);
  font-weight: 600;
}

.check { color: var(--green); font-weight: 700; width: 22px; }

.result-box {
  background: var(--result);
  color: #fff;
  border-radius: 12px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}

.result-box .kicker {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.result-box .big {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2rem;
  margin: 4px 0 2px;
}

.result-box .sub { font-size: 0.88rem; opacity: 0.85; }

.pct-bar {
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 12px;
}

.pct-bar > span {
  display: block;
  height: 100%;
  background: var(--orange);
  width: 0%;
  transition: width 0.25s ease;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

button {
  font: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 16px;
}

button.print { background: #ece9e1; color: var(--ink); }
button.reset { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button:hover { filter: brightness(0.97); }

.worksheet { width: 100%; border-collapse: collapse; }
.worksheet td {
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.worksheet .lbl { color: var(--ink); }
.worksheet .num {
  width: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.worksheet .amt {
  width: 130px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.worksheet tr.section td {
  background: #f7f5f0;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: none;
  padding-top: 14px;
}
.worksheet tr.total td {
  border-top: 2px solid var(--navy);
  border-bottom: none;
  font-size: 1.05rem;
  padding-top: 12px;
}
.worksheet tr.total .amt { color: var(--navy); }

.notes {
  margin-top: 24px;
  background: var(--gold);
  border: 1px solid #e4d6a8;
  border-radius: 14px;
  padding: 20px 22px;
}

.notes h3 {
  margin: 0 0 8px;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--navy);
}

.notes p, .notes li { color: #3d3a32; font-size: 0.92rem; }
.notes ul { margin: 8px 0 0; padding-left: 18px; }

.page-footer {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding: 20px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.tool-card:hover { border-color: var(--orange); }
.tool-card h3 {
  margin: 0 0 6px;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--navy);
}
.tool-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tool-card .soon {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
}

@media print {
  body { background: #fff; }
  .site-header, .actions, .hint, .page-footer { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  header.hero { box-shadow: none; border-radius: 0; }
  .card, .notes { box-shadow: none; }
  select, input { border: 1px solid #999; background: #fff; }
}
