:root {
  --ground: #04121a; --ground-2: #071a24; --panel: #0a2029; --panel-2: #0d2932;
  --line: #123842; --line-soft: #0f2c35;
  --porcelain: #eef5f6; --muted: #9db6bd; --faint: #7897a1;
  --brass: #f2a23c; --brass-hi: #ffbe64; --brass-deep: #b06f1d;
  --up: #5bd6a8; --down: #f2645c;
  --font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; border-color: var(--line); }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--porcelain); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; margin: 0; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button, select, summary, [role=button] { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.shell { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.wrap { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.num, table td, table th { font-variant-numeric: tabular-nums; }

.tag { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.panel { background: color-mix(in oklab, var(--panel) 78%, transparent); border: 1px solid var(--line); border-radius: 3px; box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.03); }
.panel-lift { transition: border-color .35s ease, transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease; }
.panel-lift:hover { border-color: color-mix(in oklab, var(--brass) 45%, var(--line)); transform: translateY(-3px); }

.btn-brass, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 2px; font-weight: 600; border: 0; font-family: inherit; }
.btn-brass { background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-deep)); color: #14100a; box-shadow: inset 0 1px 0 0 rgb(255 255 255 / .35), 0 10px 26px -14px rgb(242 162 60 / .9); transition: filter .2s, transform .2s; }
.btn-brass:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); color: var(--porcelain); background: transparent; transition: border-color .2s, background .2s, transform .2s; }
.btn-ghost:hover { border-color: color-mix(in oklab, var(--brass) 55%, var(--line)); background: color-mix(in oklab, var(--brass) 10%, transparent); transform: translateY(-1px); }

.field { width: 100%; min-height: 48px; background: #0e2a34; border: 1px solid #23525f; border-radius: 2px; padding: .6875rem .875rem; color: var(--porcelain); font-size: .9375rem; font-family: inherit; }
.break-all { word-break: break-all; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.table-wrap .ledger { min-width: 36rem; }
.wallet-row { display: flex; gap: 1.25rem; align-items: center; }
.income-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.income-tabs a { border: 1px solid var(--line); color: var(--muted); border-radius: 2px; padding: .45rem .7rem; font-size: .8125rem; font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.income-tabs a.on, .income-tabs a:hover { border-color: var(--brass); color: var(--brass); background: color-mix(in oklab, var(--brass) 10%, transparent); }
.field:hover:not(:disabled) { border-color: color-mix(in oklab, var(--brass) 45%, #23525f); }
.field:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgb(242 162 60 / .16); }
.label { display: block; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .4375rem; }

.pill { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid; padding: .1875rem .5625rem; font-family: var(--font-mono); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; }
.pill-up { border-color: color-mix(in oklab, var(--up) 40%, transparent); background: color-mix(in oklab, var(--up) 12%, transparent); color: var(--up); }
.pill-down { border-color: color-mix(in oklab, var(--down) 40%, transparent); background: color-mix(in oklab, var(--down) 12%, transparent); color: var(--down); }
.pill-wait { border-color: color-mix(in oklab, var(--brass) 40%, transparent); background: color-mix(in oklab, var(--brass) 12%, transparent); color: var(--brass); }
.pill-idle { border-color: var(--line); color: var(--muted); }

.ledger { width: 100%; border-collapse: collapse; font-size: .875rem; }
.ledger th { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: left; font-weight: 400; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.ledger td { padding: .8125rem 1rem; border-bottom: 1px solid var(--line-soft); }
.ledger tbody tr.row-hit { cursor: pointer; }
.ledger tbody tr.row-hit:hover td { background: color-mix(in oklab, var(--brass) 9%, transparent); }

.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--ground) 88%, transparent); backdrop-filter: blur(16px); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1.5rem; }
.nav { display: flex; gap: .25rem; }
.nav a { padding: .5rem .875rem; border-radius: 2px; color: var(--muted); font-size: .875rem; transition: color .2s, background .2s; }
.nav a:hover, .nav a.on { color: var(--porcelain); background: color-mix(in oklab, var(--panel) 70%, transparent); }
.hero h1 { font-size: clamp(2.15rem, 8vw, 4rem); line-height: 1; font-weight: 800; }
.brass-text { color: var(--brass); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.stat dd { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin: 0; }
.stat dt { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .4rem; }
.tiles { display: grid; gap: .75rem; }
.tile { padding: 1rem; position: relative; overflow: hidden; }
.tile .v { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin-top: .5rem; }
.flash-ok { border: 1px solid color-mix(in oklab, var(--up) 35%, transparent); background: color-mix(in oklab, var(--up) 8%, transparent); color: var(--up); padding: .75rem 1rem; border-radius: 2px; margin-bottom: 1rem; }
.flash-err { border: 1px solid color-mix(in oklab, var(--down) 35%, transparent); background: color-mix(in oklab, var(--down) 8%, transparent); color: var(--down); padding: .75rem 1rem; border-radius: 2px; margin-bottom: 1rem; }
.app { display: flex; min-height: 100vh; }
.side { width: 248px; border-right: 1px solid var(--line); background: color-mix(in oklab, var(--ground-2) 60%, transparent); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side nav { padding: 1.25rem .75rem; flex: 1; overflow: auto; }
.side a { display: flex; align-items: center; gap: .75rem; padding: .5rem .625rem; border-radius: 2px; color: var(--muted); font-size: .875rem; position: relative; transition: background .2s, color .2s, transform .2s; }
.side a:hover { color: var(--porcelain); background: color-mix(in oklab, var(--panel) 70%, transparent); transform: translateX(2px); }
.side a.on { color: var(--porcelain); background: color-mix(in oklab, var(--brass) 10%, transparent); }
.side a.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--brass); }
.main { flex: 1; min-width: 0; }
.topbar { height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 1.5rem; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.body { padding: 1.5rem; }
.page-title { margin-bottom: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: end; }
.page-title h1 { font-size: 1.6rem; }
.card-h { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: .75rem 1.25rem; }
.modal-bg { position: fixed; inset: 0; background: rgb(0 0 0 / .7); z-index: 60; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-bg.open { display: flex; }
.modal { background: var(--ground); border: 1px solid var(--line); width: min(640px, 100%); max-height: 92vh; overflow: auto; border-radius: 3px; }
.modal.wide { width: min(820px, 100%); }
.modal-h { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-b { padding: 1.25rem 1.25rem 1.5rem; }
.modal-b textarea.field { min-height: 8.5rem; resize: vertical; }
.report-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fig { width: 100%; height: 180px; object-fit: cover; border: 1px solid var(--line); }
.footer { border-top: 1px solid var(--line); margin-top: 5rem; padding: 3rem 0 2rem; background: color-mix(in oklab, var(--ground-2) 40%, transparent); color: var(--muted); font-size: .875rem; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--porcelain); width: 36px; height: 36px; }
.logo { font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; font-size: 1.15rem; }
.logo span { color: var(--brass); }
.alert-warn { border: 1px solid color-mix(in oklab, var(--brass) 35%, transparent); background: color-mix(in oklab, var(--brass) 7%, transparent); padding: .75rem 1rem; border-radius: 3px; margin-bottom: 1rem; }
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: 1.1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 3rem; align-items: center; }
}
@media (max-width: 799px) {
  .side { display: none; }
  .side.open { display: flex; position: fixed; z-index: 50; }
  .menu-btn { display: grid; place-items: center; }
  .nav { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none !important; }
  .wallet-row { flex-direction: column; align-items: stretch; text-align: center; }
  .tile .v { font-size: 1.2rem; word-break: break-word; }
}
