:root {
  --ink: #1a1f2b;
  --muted: #5b6473;
  --border: #d8dce3;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --accent: #1d4ed8;
  --ok-bg: #e8f7ed;
  --ok-ink: #146c2e;
  --warn-bg: #fdecea;
  --warn-ink: #a3271b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

main {
  padding: 2rem 1.25rem 3rem;
}

section {
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 1.3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

.callout {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.field-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="number"],
select {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.transactions-input select,
.transactions-input input[type="number"] {
  max-width: none;
  width: 100%;
}

.transactions-input td:last-child {
  width: 2.5rem;
  text-align: center;
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

button.secondary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  margin-top: 0.75rem;
}

button.secondary:hover {
  background: var(--border);
}

.remove-row {
  background: none;
  border: none;
  color: var(--warn-ink);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

.results {
  margin-top: 1.75rem;
}

.status-banner {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  margin-bottom: 1rem;
}

.status-banner.ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.status-banner.exceeded {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.status-detail {
  font-weight: 400;
  display: block;
  margin-top: 0.3rem;
  font-size: 0.92rem;
}

td.treatment-home {
  color: var(--ok-ink);
}

td.treatment-destination {
  color: var(--warn-ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem 2.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

pre.code-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

pre.code-block code {
  background: none;
  padding: 0;
  border-radius: 0;
}
