:root {
  --navy: #1f2a5c; --gold: #e8b73a; --brown: #8a5a00; --ink: #222; --body: #333; --muted: #5a6378;
  --line: #d5d9e3; --sec: #f1f2f7; --base: #eaf1fb; --green: #2e7d32; --red: #b3261e;
  --bg: #f6f7fb; --card: #fff;
  font-family: Calibri, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--body);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
h1, h2, .callout strong, table th { font-family: Georgia, "Times New Roman", serif; }

.top { background: var(--navy); color: #fff; padding: 28px 0 22px; }
.top h1 { margin: 0 0 6px; font-size: 30px; }
.top .sub { margin: 0; color: #cfd6ee; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 18px 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
select, input[type=number] { font: inherit; font-size: 15px; color: var(--ink); padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; }
button { font: inherit; font-weight: 700; border-radius: 6px; padding: 9px 16px; cursor: pointer; }
button.primary { background: var(--navy); color: var(--gold); border: 1px solid var(--navy); }
button.primary:disabled { opacity: .6; cursor: wait; }
button.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); align-self: end; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }

.pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 18px 0; }
.pickers .panel { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.picker.base { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.picker.off > label, .picker.off .row2 { opacity: .4; pointer-events: none; }
.picker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.picker-head .toggle { flex-direction: row; align-items: center; gap: 8px; font-size: 17px; color: var(--navy); }
.picker-head em { font-style: normal; font-size: 12px; color: var(--brown); background: #fbf3dc; padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.row2 .min { padding-bottom: 9px; }

.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-head h2 { margin: 0; color: var(--navy); }
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 7px 10px; }
thead th { background: var(--navy); color: #fff; text-align: center; }
thead th:first-child { text-align: left; }
thead th.base { color: var(--gold); }
tbody th { text-align: left; color: var(--ink); font-weight: 700; white-space: nowrap; }
td { text-align: center; color: var(--body); }
td.base { background: var(--base); color: var(--navy); font-weight: 700; }
tr.sec td { background: var(--sec); color: var(--brown); text-align: left; font: 700 11px Georgia, serif; letter-spacing: 2px; }
tr.strong td { font-weight: 700; }
tr.savings td:not(.base) { color: var(--green); font-weight: 700; }
tr.savings td.neg { color: var(--red); }

.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.callout { background: #eef6ee; border: 1px solid #c8e0c9; border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.callout strong { color: var(--green); font-size: 22px; }
.callout.neg { background: #fbeeee; border-color: #e8c4c1; }
.callout.neg strong { color: var(--red); }
.notes { font-size: 12px; color: #666; padding-left: 18px; margin: 14px 0 0; }
.notes li:last-child { list-style: none; margin-left: -18px; }
.foot { font-size: 12px; color: var(--muted); margin: 0 0 32px; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .top h1 { font-size: 24px; }
}
