:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #5f6b73;
  --line: #d9e1e5;
  --panel: #ffffff;
  --bg: #f4f7f7;
  --accent: #006b5f;
  --accent-dark: #004f49;
  --warn: #8a4b00;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { color: var(--ink); font-weight: 700; text-decoration: none; }
nav { display: flex; align-items: center; gap: 16px; }
nav a { color: var(--ink); text-decoration: none; }
nav form { margin: 0; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 28px auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }
p { color: var(--muted); }
.lede { max-width: 760px; }
.panel, .table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.narrow { max-width: 480px; margin: 0 auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; }
.span { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 600; color: #2d383f; }
input, select, textarea {
  width: 100%;
  border: 1px solid #bdc9cf;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
button, .button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.primary { background: var(--accent); border-color: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #eef5f4; }
.badge {
  display: inline-block;
  border: 1px solid #aac5c0;
  color: var(--accent-dark);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
}
.total { font-size: 24px; font-weight: 700; }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
dt { color: var(--muted); }
dd { margin: 0; }
.plain { padding-left: 18px; }
.declaration { color: var(--warn); font-weight: 600; }
.inline { display: inline-block; margin-right: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
pre { white-space: pre-wrap; background: #111820; color: #d8f4ec; padding: 16px; border-radius: 6px; overflow: auto; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0;
}
legend { font-weight: 700; padding: 0 6px; }
.transaction-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.transaction-summary > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.summary-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.transaction-summary strong { font-size: 18px; }
.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.choice { display: block; cursor: pointer; }
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border: 1px solid #9fb4bb;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}
.choice input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.compact .choice span { min-height: 48px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input { width: auto; }
.notice {
  border: 1px solid #aac5c0;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #eef8f6;
  padding: 12px;
}
.row-action { margin-left: 10px; color: var(--accent-dark); font-weight: 700; }
.plain-pre {
  background: transparent;
  color: var(--ink);
  padding: 0;
  margin: 0;
}
@media (max-width: 760px) {
  .topbar, .page-head { align-items: flex-start; flex-direction: column; height: auto; padding: 16px; }
  .grid-form, .two, .transaction-summary, .choice-row { grid-template-columns: 1fr; }
  .shell { margin-top: 18px; }
}
