/* Plain, readable layout: one column on phones, inputs beside results on wide screens. */
:root {
  --ink: #1f2a1c; --muted: #5b6656; --line: #d9dfd2; --bg: #fbfcf8;
  --accent: #3f6b2a; --accent-ink: #fff; --loss: #a33a2a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e6ebe1; --muted: #a9b3a3; --line: #3a4436; --bg: #161b14; --accent: #8cc06b; --accent-ink: #10150e; --loss: #f08a78; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header, main, footer { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
header { padding-top: 1.5rem; }
h1 { margin: 0 0 .25rem; font-size: 1.8rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.button, button {
  font: inherit; padding: .45rem .8rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); text-decoration: none;
}
.button { background: var(--accent); color: var(--accent-ink); }
#status { color: var(--muted); }
main { display: grid; gap: 0 2rem; }
@media (min-width: 960px) {
  main { grid-template-columns: 340px 1fr; }
  #inputs { grid-row: 1 / span 5; }
}
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .5rem .9rem .8rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.field { margin: .5rem 0; }
.field label { display: block; font-size: .92rem; }
.control { display: flex; gap: .4rem; align-items: center; }
input, select { font: inherit; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: inherit; width: 9rem; }
select { width: auto; }
input:disabled, select:disabled { opacity: .45; }
.unit, small, .note { color: var(--muted); font-size: .85rem; }
small { display: block; }
.headline { font-size: 1.1rem; font-weight: 600; padding: .6rem .8rem; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.headline.loss { border-color: var(--loss); color: var(--loss); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead th { font-size: .82rem; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 500; white-space: normal; }
.n { text-align: right; font-variant-numeric: tabular-nums; }
tfoot th, tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.sources { padding-left: 1.2rem; font-size: .9rem; }
.sources a { color: var(--accent); }
footer { color: var(--muted); font-size: .85rem; padding-top: 1rem; padding-bottom: 2rem; }
