:root {
  color-scheme: dark;
  --bg: #101114;
  --bg-2: #171a20;
  --bg-3: #21262e;
  --line: rgba(244, 240, 230, 0.1);
  --text: #f4f0e6;
  --muted: #a39e93;
  --faint: #6f6a62;
  --brass: #e4b56a;
  --brass-2: #f3d7a4;
  --brass-fill: #e4b56a;
  --brass-dim: rgba(228, 181, 106, 0.14);
  --red: #ffb0a4;
  --red-dim: rgba(255, 90, 72, 0.18);
  --green: #b7ebcf;
  --green-dim: rgba(120, 190, 150, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --top: rgba(16, 17, 20, 0.78);
  --sheet: rgba(23, 26, 32, 0.92);
  --input: #0e1014;
  --wash: rgba(255, 255, 255, 0.05);
  --wash-soft: rgba(255, 255, 255, 0.025);
  --wash-row: rgba(255, 255, 255, 0.03);
  --stripe: rgba(255, 255, 255, 0.04);
  --stripe-hover: rgba(255, 255, 255, 0.075);
  --danger-line: rgba(255, 176, 164, 0.4);
  --danger-line-soft: rgba(255, 176, 164, 0.25);
  --danger-ring: rgba(255, 176, 164, 0.45);
  --glow: rgba(228, 181, 106, 0.09);
  --selection: rgba(228, 181, 106, 0.35);
  --on-brass: #23190c;
  --mark-a: #3a3122;
  --mark-b: #2a2418;
  --radius: 18px;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}

html.light {
  color-scheme: light;
  --bg: #f4efe4;
  --bg-2: #fffaf3;
  --bg-3: #efe4d2;
  --line: rgba(62, 44, 18, 0.14);
  --text: #2c241c;
  --muted: #6e5b45;
  --faint: #7a6752;
  --brass: #8a5612;
  --brass-2: #6e4510;
  --brass-dim: rgba(138, 86, 18, 0.14);
  --red: #a33b32;
  --red-dim: rgba(163, 59, 50, 0.12);
  --green: #1d6b43;
  --green-dim: rgba(29, 107, 67, 0.14);
  --shadow: 0 18px 40px rgba(72, 48, 12, 0.08);
  --top: rgba(244, 239, 228, 0.9);
  --sheet: rgba(255, 250, 243, 0.96);
  --input: #fffdf8;
  --wash: rgba(62, 44, 18, 0.06);
  --wash-soft: rgba(62, 44, 18, 0.035);
  --wash-row: rgba(62, 44, 18, 0.05);
  --stripe: rgba(62, 44, 18, 0.045);
  --stripe-hover: rgba(62, 44, 18, 0.08);
  --danger-line: rgba(163, 59, 50, 0.35);
  --danger-line-soft: rgba(163, 59, 50, 0.2);
  --danger-ring: rgba(163, 59, 50, 0.4);
  --glow: rgba(138, 86, 18, 0.12);
  --selection: rgba(138, 86, 18, 0.22);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  background:
    radial-gradient(900px 420px at 8% -10%, var(--glow), transparent 55%),
    var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

::selection { background: var(--selection); }

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 16px 22px;
  background: var(--top);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.mark {
  width: 22px;
  height: 16px;
  position: relative;
  display: inline-block;
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  border-radius: 3px;
  border: 1.5px solid var(--brass);
}

.mark::before {
  inset: 3px 0 0 4px;
  background: var(--mark-a);
}

.mark::after {
  inset: 0 4px 3px 0;
  background: var(--mark-b);
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.top nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
}

.top nav a.on {
  color: var(--text);
  background: var(--brass-dim);
}

.top nav { align-items: center; }
.save-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.save-btn:hover { color: var(--text); background: var(--wash); }
.save-btn[data-state="pending"],
.save-btn[data-state="saving"],
.save-btn[data-state="offline"] { color: var(--brass); }
.save-btn[data-state="done"] { color: var(--green); }
.save-btn[data-state="error"] { color: var(--red); }
.save-btn[data-state="saving"] svg { animation: save-spin 0.9s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }

.nav-menu { position: relative; }
.nav-menu > summary {
  list-style: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::marker { content: ""; }
.nav-menu > summary:hover,
.nav-menu[open] > summary { color: var(--text); background: var(--wash); }
.top nav a.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
}
.top nav a.nav-icon:hover { color: var(--text); background: var(--wash); }
.nav-icon .nav-dot {
  position: absolute;
  top: 7px;
  right: 7px;
}
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brass);
  flex: 0 0 auto;
}
.nav-drop {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 6;
  width: min(18rem, calc(100vw - 28px));
  padding-top: 8px;
}
.nav-menu[open] > .nav-drop,
.nav-menu:hover > .nav-drop { display: block; }
.nav-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: min(70vh, 28rem);
  overflow: auto;
}
.top nav .nav-panel a,
.top nav .nav-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: inherit;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.top nav .nav-panel a.on {
  color: var(--text);
  background: var(--brass-dim);
}
.top nav .nav-panel a:hover,
.top nav .nav-panel button:hover { background: var(--wash); color: var(--brass-2); }
.nav-panel a svg,
.nav-panel button svg,
.nav-label svg { flex: 0 0 auto; }
.nav-panel form { margin: 0; }
.nav-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 2px;
  color: var(--text);
}
.top nav .nav-panel a.nav-sub,
.top nav .nav-panel button.nav-sub { padding-left: 40px; }
.top nav .nav-panel button.on { color: var(--text); background: var(--brass-dim); }
.profile-menu .nav-label { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); margin: 0 0 18px; }
.heading-with-info { display: flex; align-items: center; gap: 10px; }
.heading-with-info h1 { margin: 0; }
.info { cursor: help; }
.info-mark {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1;
}
.info .tip-bubble { white-space: normal; width: min(18rem, 70vw); font-style: normal; }
h2 { font-size: 1.45rem; margin: 0; }

.kicker {
  margin: 0 0 6px;
  color: var(--brass);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker a { text-decoration: none; }

.summary, .help, .empty { color: var(--muted); }
.summary { margin-top: -6px; }
.help { margin: 8px 0 0; font-size: 0.92rem; }

.page-head, .board header, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.head-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.more { position: relative; flex: 0 0 auto; }
.more > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::marker { content: ""; }
.more > summary:hover,
.more[open] > summary { color: var(--text); background: var(--wash); }
.dots {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}
.more-menu {
  position: absolute;
  z-index: 3;
  right: 0;
  top: calc(100% + 8px);
  min-width: 11rem;
  margin: 0;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.more-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.more-menu a:hover { background: var(--wash); color: var(--brass-2); }
.more-menu a.danger { color: var(--red); }
.more-menu a.danger:hover { color: var(--red); background: var(--red-dim); }
.more-menu form { display: flex; flex-direction: column; gap: 8px; padding: 6px; }
.more-menu input { width: 12rem; }
.more-menu button {
  align-self: stretch;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  box-shadow: none;
}
.more-menu button:hover { background: var(--wash); color: var(--brass-2); }
.more-menu form.theme-toggle,
.more-menu form.menu-action { margin: 0; padding: 0; gap: 0; }
.more-menu form.menu-action button { font-weight: inherit; font-size: inherit; }
.theme-toggle .when-light { display: none; }
html.light .theme-toggle .when-dark { display: none; }
html.light .theme-toggle .when-light { display: inline; }
.confirm-pop { position: relative; }
.confirm-pop:not([open]) > form { display: none; }
.confirm-pop > summary {
  list-style: none;
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--red);
  cursor: pointer;
}
.confirm-pop > summary::-webkit-details-marker { display: none; }
.confirm-pop > summary::marker { content: ""; }
.confirm-pop > summary:hover,
.confirm-pop[open] > summary { color: var(--red); background: var(--red-dim); }
.confirm-pop[open] > form {
  position: absolute;
  z-index: 6;
  right: 0;
  top: calc(100% + 6px);
  width: min(16rem, calc(100vw - 36px));
  margin: 0;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.confirm-pop[open] > form p { margin: 0; color: var(--muted); }
.confirm-pop button.danger,
.icon-pop button.danger {
  border: 1px solid var(--danger-line);
  border-radius: 999px;
  background: transparent;
  color: var(--red);
  box-shadow: none;
  text-align: center;
  width: auto;
}
.merge-review h2 { margin: 22px 0 6px; }
.merge-review .help { margin-top: 0; }
.merge-sheet .merge-check { width: 1%; white-space: nowrap; padding-right: 0; }
.merge-sheet input[type="checkbox"],
.merge-sheet input[type="radio"] {
  width: auto;
  padding: 0;
  accent-color: var(--brass);
}
.merge-sheet details > summary {
  cursor: pointer;
  list-style: none;
}
.merge-sheet details > summary::-webkit-details-marker { display: none; }
.merge-sheet details > summary::marker { content: ""; }
.merge-sheet details > summary::before {
  content: "▸ ";
  color: var(--muted);
}
.merge-sheet details[open] > summary::before { content: "▾ "; }
.merge-sheet details ul {
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}
.merge-sheet li { margin: 2px 0; }
.merge-sheet select { width: min(28rem, 100%); margin-top: 8px; }
.merge-pair-label { display: block; margin-top: 8px; }
.merge-resolve { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.merge-resolve .choice { grid-column: auto; }
.diff-add { color: var(--green); }
.diff-remove { color: var(--red); }
.merge-confirm { position: relative; display: inline-block; }
.merge-confirm > summary {
  list-style: none;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brass-fill);
  color: var(--on-brass);
  border: 1px solid transparent;
  cursor: pointer;
}
.merge-confirm > summary::-webkit-details-marker { display: none; }
.merge-confirm > summary::marker { content: ""; }
.merge-confirm:not([open]) > .confirm-body { display: none; }
.merge-confirm[open] > .confirm-body {
  position: absolute;
  z-index: 6;
  left: 0;
  top: calc(100% + 6px);
  width: min(16rem, calc(100vw - 36px));
  margin: 0;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.merge-confirm .confirm-body p { margin: 0; color: var(--muted); }
.alert-mark {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: -6px;
  border-radius: 999px;
  background: var(--red-dim);
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--danger-ring);
}
.finder-live { margin: 0; min-height: 0; }
a.icon-add[hidden] { display: none !important; }
a.icon-add,
summary.icon-add {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
a.icon-add:hover,
a.icon-add:focus-visible,
summary.icon-add:hover,
summary.icon-add:focus-visible { background: var(--wash); color: var(--text); }
summary.icon-add::-webkit-details-marker { display: none; }
summary.icon-add::marker { content: ""; }
.finder-open {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  box-shadow: none;
  cursor: pointer;
}
.finder-open:hover { color: var(--text); }
.finder-live .finder-field { display: none; width: min(20rem, 100%); height: 36px; padding: 6px 12px; }
.finder-live.is-open .finder-open { display: none; }
.finder-live.is-open .finder-field { display: block; }
#region-sheet tr.is-filtered,
#region-mobile li.is-filtered { display: none; }
#region-sheet .live-empty { display: none; }
#region-sheet .live-empty.is-shown { display: table-row; }
#region-mobile .live-empty { display: none; }
#region-mobile .live-empty.is-shown { display: block; }
.notice-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.notice-list li {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.notice-list .unread { box-shadow: inset 3px 0 0 var(--brass); }
.notice-list .failure { box-shadow: inset 3px 0 0 var(--red); }
.notice-title { margin: 0; font-weight: 650; }
.notice-body { white-space: pre-line; color: var(--muted); }
.kicker-row { display: flex; align-items: center; gap: 10px; }
.kicker-row .kicker { margin: 0; }
.kicker-row .more-menu { left: 0; right: auto; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 18px;
}
.status-tabs { display: contents; }

.filters a, .button, button {
  font: inherit;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.filters a.on, .button, button {
  background: var(--brass-fill);
  color: var(--on-brass);
  border-color: transparent;
}

.filters a span { color: var(--faint); margin-left: 4px; }
.filters a.on span { color: var(--on-brass); opacity: 0.7; }

.button.danger, button.quiet {
  background: transparent;
  color: var(--red);
  border-color: var(--danger-line);
}

button.quiet { color: var(--muted); border-color: var(--line); padding: 8px 10px; }

.text-link { color: var(--brass-2); }

.sheet-wrap, .panel, .board {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sheet-wrap { overflow-x: auto; }
.sheet-wrap.pops { overflow: visible; }

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

th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

th { color: var(--muted); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
td a { text-decoration: none; }
td a:hover { color: var(--brass-2); }
tr:last-child td, tr:last-child th { border-bottom: 0; }
tbody tr:nth-child(even):not(.group) { background: var(--stripe); }
tbody tr:hover:not(.group) { background: var(--stripe-hover); }
.num, td.num { text-align: right; }
.sheet th.center, .sheet td.center { text-align: center; }
.churn { color: var(--brass-2); }
.warn { color: var(--red); }
td.met {
  background: var(--green-dim);
  color: var(--green);
  font-weight: 650;
}
.spend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
}
.spend-head h2 { margin: 0; font-size: 1.2rem; }
.spend-add { position: relative; }
.spend-add[open] > .pop { left: auto; right: 0; width: min(22rem, calc(100vw - 36px)); }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--brass-2); }
.region-sheet { overflow: visible; }
.tip { position: relative; }
.tip-bubble {
  display: none;
  position: absolute;
  z-index: 4;
  left: 0;
  top: calc(100% + 6px);
  white-space: nowrap;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.tip.end .tip-bubble { left: auto; right: 0; }
.tip:hover .tip-bubble,
.tip:focus-within .tip-bubble { display: block; }
.rename-row { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.rename-row input[type="text"] { flex: 1; }
.customize-merge { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 16px; }
.customize-merge select, .customize-merge input { min-width: 12rem; }
.tip-bubble.warn { color: var(--red); }
.row-pop { display: none; margin-top: 6px; color: var(--muted); font-size: 0.88rem; font-weight: 450; }
.has-bonus:hover .row-pop,
.has-bonus:focus-within .row-pop { display: block; }
.region-stack { display: flex; flex-direction: column; gap: 28px; margin-top: 28px; }
.region-stack h2 { margin: 0 0 10px; }
.region-stack h2 a { text-decoration: none; }
.alert {
  background: var(--red-dim);
  color: var(--red);
  box-shadow: inset 0 0 0 1px var(--danger-line-soft);
}
.emphasis { font-size: 1.25rem; }

.group th {
  background: var(--wash-row);
  color: var(--brass-2);
  letter-spacing: 0.12em;
}

.hint {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.board { padding: 8px 18px 14px; }
.board header { padding: 12px 0; }
.board header a { text-decoration: none; }

.roster { list-style: none; margin: 0; padding: 0; }
.roster li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.roster a { text-decoration: none; font-weight: 600; }
.roster .issuer { grid-column: 1; color: var(--muted); font-size: 0.88rem; }
.roster .status { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.roster .age { grid-column: 3; grid-row: 1 / span 2; align-self: center; color: var(--muted); }

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--wash);
  color: var(--muted);
}
.status.open { background: var(--green-dim); color: var(--green); }
.status.pending { background: var(--brass-dim); color: var(--brass-2); }
.status.closed { color: var(--faint); }

.panel { padding: 8px 18px 18px; margin-top: 8px; }
fieldset { border: 0; padding: 8px 0 0; margin: 0; }
legend {
  padding: 0;
  color: var(--brass-2);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 12px;
}
.span-2 { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 0.86rem; }
input, select, output {
  width: 100%;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
}
output { color: var(--brass-2); }
.actions { margin-top: 16px; justify-content: flex-start; }
.choice {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}
.choice input { width: auto; accent-color: var(--brass); }
.guide h2 { margin: 14px 0 0; }
.guide-table {
  margin: 14px 0;
  box-shadow: none;
  background: var(--input);
}
.guide-table th, .guide-table td { text-transform: none; letter-spacing: 0; font-size: 0.92rem; }
.guide-table thead th { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }
.guide-table input, .guide-table select { padding: 7px 8px; font-size: 0.92rem; min-width: 14rem; }
.guide-table input:invalid, .guide-table select:invalid {
  border-color: var(--red);
  background: var(--red-dim);
  box-shadow: inset 0 0 0 1px var(--red);
}
.csv-view {
  overflow-x: auto;
  margin: 14px 0;
  padding: 14px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  white-space: pre;
  font-size: 0.85rem;
}
textarea.csv-view {
  display: block;
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}
.template-reveal { margin: 0 0 4px; }
.template-reveal > summary {
  list-style: none;
  cursor: pointer;
  width: fit-content;
}
.template-reveal > summary::-webkit-details-marker { display: none; }
.template-reveal > summary::marker { content: ""; }
.template-reveal .hide-label { display: none; }
.template-reveal[open] .show-label { display: none; }
.template-reveal[open] .hide-label { display: inline; }
.sample-date { color: var(--text); }
.banner {
  background: var(--brass-dim);
  color: var(--brass-2);
  border-radius: 12px;
  padding: 10px 12px;
}
.banner.error { background: var(--red-dim); color: var(--red); }
.fields-panel { margin-top: 18px; }
.fields-panel h2 { margin: 12px 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.field-row form:first-child {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
}
.add-field { grid-template-columns: 1fr 1.4fr auto; }
.field-split {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--faint);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.field-split::before,
.field-split::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.saved-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.saved-field > div:first-child { flex: 1; min-width: 0; }
.saved-name { font-weight: 600; margin-right: 10px; }
.saved-value { color: var(--muted); }
.icon-pop { position: relative; flex: 0 0 auto; }
.icon-pop:not([open]) > form { display: none; }
.icon-button {
  list-style: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-button::-webkit-details-marker { display: none; }
.icon-button::marker { content: ""; }
.icon-button:hover,
.icon-pop[open] > .icon-button { color: var(--text); background: var(--wash); }
.icon-pop > summary.name-button {
  list-style: none;
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: inherit;
}
.icon-pop > summary.name-button::-webkit-details-marker { display: none; }
.icon-pop > summary.name-button::marker { content: ""; }
.icon-pop[open] > summary.name-button { color: inherit; background: transparent; }
.icon-pop[open] > form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: min(16rem, calc(100vw - 36px));
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.icon-pop[open] > form p { margin: 0; color: var(--muted); }
.icon-pop > summary.text-button {
  list-style: none;
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--red);
  font: inherit;
  cursor: pointer;
}
.icon-pop > summary.text-button::-webkit-details-marker { display: none; }
.icon-pop > summary.text-button::marker { content: ""; }
.card-delete { margin-top: 18px; }
.card-delete[open] > form { left: 0; right: auto; }
.actions-cell { text-align: right; width: 1%; }
.actions-cell .icon-pop { display: inline-block; margin-left: 0; }
.sheet td .icon-pop { margin-left: auto; }
.quiet-danger { margin-top: 18px; }
.quiet-danger a { color: var(--red); }
.mobile-sheet { display: none; list-style: none; margin: 0; padding: 0; }
.mobile-sheet li {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.mobile-sheet a { font-weight: 600; text-decoration: none; font-size: 1.05rem; }
.mobile-sheet p { margin: 6px 0 0; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 800px) {
  .boards, .fields, .field-row form:first-child, .add-field { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .region-sheet { display: none; }
  .mobile-sheet { display: block; }
  .top { padding-inline: 14px; }
  main { width: min(1120px, calc(100% - 20px)); }
  .page-head { align-items: flex-start; }
  .nav-drop { width: min(18rem, calc(100vw - 28px)); }
  .heading-with-info { position: relative; }
  .heading-with-info .info.tip { position: static; }
  .heading-with-info .info .tip-bubble {
    left: 0;
    right: auto;
    width: min(18rem, calc(100vw - 36px));
  }
}

.logout { margin: 0; }
.auth-panel { max-width: 460px; }
.spender-tools { margin-bottom: 12px; }
.spender-category { margin-top: 22px; }
.spender-category h2 { margin-bottom: 6px; }
.spender-list { list-style: none; margin: 0; padding: 0; }
.spender-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.spender-list a,
.spender-list .card-name { font-size: 1rem; font-weight: 600; line-height: 1.35; text-decoration: none; }
.spender-list .card-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  line-height: 1.35;
}
.spender-list .issuer {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-right: 0.35em;
}
.spender-list .name-stack { display: inline-flex; flex-direction: column; align-items: flex-start; }
.spender-list .card-network { color: var(--muted); font-size: 0.75rem; font-weight: 500; line-height: 1.2; }
.score-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.score { color: var(--brass-2); font-variant-numeric: tabular-nums; font-weight: 650; }
.score-edit summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.score-edit summary::-webkit-details-marker { display: none; }
.score-edit summary::marker { content: ""; }
.score-edit form { margin-top: 8px; }
.override-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.override-form input { width: 6.5rem; padding: 8px 10px; }
.visibility { margin-top: 28px; }
.visibility button {
  background: transparent;
  color: var(--faint);
  border-color: transparent;
  font-size: 0.82rem;
  padding: 4px 0;
}
.visibility button:hover { color: var(--muted); }
.add-region {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.add-region input {
  width: 11rem;
  background: transparent;
  color: var(--faint);
  border-color: transparent;
  font-size: 0.82rem;
  padding: 4px 0;
}
.add-region input:focus {
  color: var(--text);
  border-color: var(--line);
}
.add-region button {
  background: transparent;
  color: var(--faint);
  border-color: transparent;
  font-size: 0.82rem;
  padding: 4px 0;
}
.add-region button:hover { color: var(--muted); }

.network-field { display: grid; gap: 6px; }
.network-field.is-dim select { opacity: 0.55; }
.network-field.is-dim select:focus { opacity: 1; }
.network-add { margin-top: 4px; }
.network-add > summary {
  list-style: none;
  cursor: pointer;
  color: var(--brass-2);
  font-size: 0.92rem;
  width: fit-content;
}
.network-add > summary::-webkit-details-marker { display: none; }
.network-add > summary::marker { content: ""; }
.network-add-fields {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.network-add-fields input { flex: 1; }
.custom-networks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.custom-networks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.icon-pop[open] > .pop,
.promo-pop[open] > .pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: min(18rem, calc(100vw - 36px));
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.icon-pop:not([open]) > .pop,
.promo-pop:not([open]) > .pop { display: none; }
.icon-pop[open] > .pop p,
.promo-pop .help { margin: 0; }
.earn-field { display: grid; gap: 6px; color: var(--muted); font-size: 0.86rem; }
.earn-name { display: flex; align-items: center; gap: 8px; }
.promo-pop { position: relative; }
.promo-plus {
  list-style: none;
  cursor: pointer;
  color: var(--brass-2);
  font-weight: 650;
  line-height: 1;
  font-size: 1.05rem;
}
.promo-plus::-webkit-details-marker { display: none; }
.promo-plus::marker { content: ""; }
.promo-pop[open] > .pop { left: 0; right: auto; }
.terms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}
.terms-head {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}
.terms-shot { margin: 0 0 18px; }
.terms-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}
.terms-upload { flex: 1 1 16rem; }
.terms-file {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--brass-2);
  text-decoration: none;
}
.terms-file svg { display: block; }
.terms-frame {
  display: block;
  width: 100%;
  height: 70vh;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.promo-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35em;
  color: var(--brass-2);
  vertical-align: middle;
}
.promo-mark svg { display: block; }
.custom-program { display: none; }
form:has(select[name="program"] option[value="__custom__"]:checked) .custom-program { display: grid; }
.points-add { margin-bottom: 18px; }
.points-add h2 { margin: 12px 0 0; }
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  align-items: center;
}
.row-actions .wallet-edit > summary.text-button {
  list-style: none;
  cursor: pointer;
  color: var(--brass-2);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.row-actions .text-button::-webkit-details-marker { display: none; }
.row-actions .text-button::marker { content: ""; }
.wallet-edit[open] > form { left: 0; right: auto; width: min(22rem, calc(100vw - 36px)); }
.sheet th .info { margin-left: 6px; text-transform: none; letter-spacing: 0; vertical-align: middle; }
.sheet th .tip-bubble { text-transform: none; letter-spacing: 0; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}

/* Colour palette: bottom left of every page */
.palette-dock { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 7; }
.palette-dock .palette-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); color: var(--brass); box-shadow: var(--shadow); cursor: pointer; }
.palette-dock .palette-btn:hover, .palette-dock .palette-btn[aria-expanded="true"] { color: var(--brass-2); border-color: var(--brass); }
.palette-panel { position: absolute; left: 0; bottom: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.palette-panel[hidden] { display: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches .swatch { width: 34px; height: 34px; min-height: 0; padding: 0; border: 2px solid var(--line); border-radius: 50%; cursor: pointer; }
.swatches .swatch:hover { transform: scale(1.08); }
.swatches .swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatches .swatch-default { background: linear-gradient(135deg, #e4b56a 50%, #171a20 50%); }

/* ---------- login (matches Fintracker) ---------- */
main.login { width: auto; min-height: 100vh; display: grid; place-items: center; padding: 16px; margin: 0; }
.login-card {
  width: min(360px, 100%);
  padding: 28px 24px 16px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card .brand { justify-content: center; margin-bottom: 6px; color: var(--brass-2); }
.login-card .brand h1 { margin: 0; font-size: 1.6rem; }
.login-card .mark { flex: none; }
.login-card input { padding: 0 12px; min-height: 36px; }
.login-card input::placeholder { color: var(--muted); opacity: 0.8; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.form-error { color: var(--red); margin: 0; min-height: 1.2em; font-size: 0.9rem; }
.wide { width: 100%; }
.login-card .button, .login-card button.wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
}
.login-card .button.outline { background: transparent; color: var(--text); border-color: var(--line); }
.login-card .button.outline:hover { background: var(--wash); }
.login-card .text-link.center { align-self: center; text-underline-offset: 3px; }
.or { text-align: center; color: var(--muted); font-size: 0.85rem; }
.login-foot { display: flex; justify-content: center; }
.login-foot form { margin: 0; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--wash); }
