:root {
  --bg: #f5f7f8;
  --text: #1d252c;
  --muted: #66727d;
  --line: #d8e0e6;
  --accent: #146c5f;
  --accent-dark: #0d5147;
  --surface: #ffffff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.topbar a {
  color: var(--accent);
  text-decoration: none;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 32px auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.narrow {
  max-width: 560px;
  margin: 0 auto;
}

h1, h2 {
  margin: 0 0 12px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat,
.action-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 26px;
}

.instructions {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

pre {
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: #1d252c;
  color: #f5f7f8;
}

.row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.form {
  display: grid;
  gap: 14px;
}

.form p {
  display: grid;
  gap: 6px;
  margin: 0;
}

input, select, textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.options ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.options li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 12px;
  border-radius: 6px;
  background: #e8f3ef;
  border: 1px solid #b7d9cd;
}

.message.error {
  color: var(--danger);
  background: #fff0ee;
  border-color: #f5c5be;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.receipt {
  overflow-wrap: anywhere;
  font-family: Consolas, monospace;
}

@media (max-width: 640px) {
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .split {
    grid-template-columns: 1fr;
  }
}
