@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Lora:ital,wght@0,400;0,500;1,500&family=Poppins:wght@300;400;500;600&display=swap");
:root {
  --navy: #0a1628;
  --gold: #c9a84c;
  --bg: #f8f6f1;
  --line: #e5dfd4;
  --muted: #687380;
  --card: #fff;
  --soft: #f5f3ee;
  color: var(--navy);
  background: var(--bg);
  font:
    400 15px/1.65 Poppins,
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
header {
  border-bottom: 1px solid var(--line);
  padding: 22px max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  font:
    500 26px Lora,
    Georgia,
    serif;
  gap: 10px;
  border-top: 1px solid var(--gold);
  padding-top: 8px;
}
.brand span {
  font-size: 36px;
  border-right: 1px solid var(--gold);
  padding-right: 10px;
}
.brand i {
  font-style: normal;
  color: var(--gold);
}
.brand small {
  font:
    8px "IBM Plex Mono",
    monospace;
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 42px 24px 80px;
}
h1 {
  font:
    300 clamp(28px, 4vw, 42px) / 1.3 Poppins,
    system-ui;
  text-transform: uppercase;
  margin: 9px 0 18px;
}
h1 em {
  font:
    italic 500 1em Lora,
    Georgia;
  text-transform: none;
  color: #a58b40;
}
h2 {
  font:
    500 25px/1.35 Lora,
    Georgia;
  margin: 0 0 13px;
}
h3 {
  font-size: 16px;
  margin: 0 0 8px;
  font-weight: 500;
}
p {
  margin: 8px 0 18px;
}
.eyebrow {
  font:
    12px "IBM Plex Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}
.eyebrow:before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 22px;
}
.navy {
  background: var(--navy);
  color: white;
}
.navy .muted {
  color: #c6ced8;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.grid > .card {
  margin-bottom: 0;
}
.stack > * + * {
  margin-top: 18px;
}
.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  text-decoration: none;
  font:
    500 12px "IBM Plex Mono",
    monospace;
  letter-spacing: 0.04em;
  min-height: 44px;
}
.primary {
  background: var(--gold);
  border-color: var(--gold);
}
.navy button {
  color: white;
  border-color: #657083;
}
.text {
  border: 0;
  padding: 8px 0;
  text-decoration: underline;
}
.small {
  font-size: 13px;
}
.muted {
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.mt {
  margin-top: 22px;
}
.badge {
  font:
    12px "IBM Plex Mono",
    monospace;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  display: inline-block;
  background: var(--soft);
}
.badge.ok {
  color: #286047;
  background: #edf6ee;
}
.badge.warn {
  color: #8e5324;
  background: #fff3e7;
}
.note {
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
  background: var(--soft);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
}
.error {
  color: #9e3529;
  background: #fff0ec;
  padding: 14px;
  border-radius: 9px;
  margin: 14px 0;
  overflow-wrap: anywhere;
}
.success {
  color: #256145;
  background: #edf6ee;
  padding: 14px;
  border-radius: 9px;
  margin: 14px 0;
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0 6px;
}
input:not([type="checkbox"]),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  padding: 12px 14px;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.check input {
  margin-top: 3px;
}
.fieldrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.status-list > div,
.list-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.status-list > div:last-child,
.list-item:last-child {
  border-bottom: 0;
}
.status-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.mono,
code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
nav button[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.nav-tag {
  font-size: 10px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 6px;
  background: #fff6db;
  color: #594418;
  border: 1px solid var(--gold);
}
nav button[aria-pressed="true"] .nav-tag {
  background: var(--gold);
  color: var(--navy);
}
.amount {
  font: 300 30px Poppins;
  letter-spacing: -0.04em;
}
.hidden,
[hidden] {
  display: none !important;
}
details > summary {
  cursor: pointer;
  list-style-position: outside;
  font-weight: 500;
}
details > div {
  margin-top: 20px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  width: min(650px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  color: var(--navy);
  background: var(--card);
}
dialog::backdrop {
  background: #0a1628b5;
}
dialog h2 {
  margin-top: 14px;
}
.close {
  float: right;
  padding: 8px;
  width: 44px;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}
.scroll {
  overflow: auto;
}
.empty {
  text-align: center;
  padding: 38px 20px;
}
.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}
footer {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.access {
  max-width: 560px;
  margin: 40px auto;
}
.codebox {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
#flash:empty {
  display: none;
}
.bankline {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-top: 14px;
}
.bankline .amount {
  font-size: 25px;
}
.sandbox-notice {
  background: #fff6db;
  color: #594418;
  border: 1px solid var(--gold);
  border-left-width: 5px;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 22px;
  overflow-wrap: anywhere;
}
.sandbox-notice strong {
  display: inline-block;
  margin-bottom: 6px;
}
.sandbox-notice p {
  margin: 0;
  font-size: 13px;
}
.sandbox-badge {
  background: #fff6db;
  border-color: var(--gold);
  color: #594418;
}
.bank-balance-label {
  margin: 14px 0 0;
}
.bankline .amount {
  margin-top: 0;
}
.bank-transaction strong,
.bank-transaction p {
  overflow-wrap: anywhere;
}
#bank-account-filter {
  margin-bottom: 18px;
}
.group-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.group-item {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--soft);
}
.group-item strong {
  display: block;
  font: 500 17px Lora, Georgia, serif;
  margin-bottom: 6px;
}
.group-item:hover {
  border-color: var(--gold);
}
.consent-text {
  font: 400 14px/1.6 Lora, Georgia, serif;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  max-height: 40dvh;
  overflow: auto;
  white-space: pre-wrap;
}
.consent .actions,
.hint .actions {
  margin-top: 12px;
}
.consent p {
  margin: 4px 0 6px;
}
.text.mt {
  margin-top: 12px;
  min-height: 0;
}
@media (max-width: 700px) {
  main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    gap: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fffdfa;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px #0a162814;
  }
  nav button {
    border: 0;
    border-radius: 10px;
    min-height: 52px;
    padding: 8px 2px;
    font-size: 10px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  nav button[aria-pressed="true"] {
    background: var(--navy);
    color: white;
  }
  .nav-tag {
    display: none;
  }
  #content > .row.between:first-child {
    margin-bottom: 22px;
  }
  .group-list {
    grid-template-columns: 1fr;
  }
  dialog {
    width: calc(100% - 20px);
    max-height: 92dvh;
    padding: 20px;
  }
  h1 {
    font-size: 26px;
  }
}
@media (max-width: 700px) {
  header {
    padding: 18px 20px;
  }
  .brand {
    font-size: 21px;
  }
  .brand span {
    font-size: 28px;
  }
  main {
    padding: 28px 20px 70px;
  }
  .grid,
  .split,
  .fieldrow {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 21px;
  }
  .status-list > div {
    flex-direction: column;
    gap: 5px;
  }
  .desktop-only {
    display: none;
  }
  .actions .btn,
  .actions button {
    flex: 1;
  }
  .table {
    min-width: 550px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
