/* Monterra Signal look (navy theme), self-hosted fonts */
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(/fonts/public-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url(/fonts/public-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-display: swap; src: url(/fonts/public-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-display: swap; src: url(/fonts/big-shoulders-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url(/fonts/big-shoulders-display-latin-800-normal.woff2) format("woff2"); }

:root {
  --f-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-num: "Big Shoulders Display", "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --bg: #F3F4F1; --surface: #FFFFFF; --surface-2: #E9ECE7; --line: #D9DDD6;
  --ink: #121A17; --ink-2: #3C4642; --muted: #646E69;
  --hi: #F2C94C; --hi-soft: #FBF1CF; --accent: #2440B3;
  --navy: #061433; --sky: #7FC8FF; --band: #D6E6FB; --tile: #EEF2F8;
  --up: #2F7D4F; --down: #B5524A; --bar-up: #4E9A69; --bar-down: #C9716A;
  --shadow: 0 1px 2px rgba(6,20,51,.08), 0 8px 24px rgba(6,20,51,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); color: var(--navy); margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: rgba(243,244,241,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1760px; margin: 0 auto; padding: 12px clamp(16px, 4vw, 58px); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand b { display: block; font-family: var(--f-display); font-size: 19px; line-height: 1.1; }
.brand span { display: block; font-size: 12.5px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.pick { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pick select { font: 600 14px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }

/* Buttons and forms */
.btn { font: 700 15px var(--f-body); background: var(--navy); color: #fff; border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 7px 14px; font-size: 13.5px; }
.btn.ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: 600 14px var(--f-body); cursor: pointer; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input { font: 15px var(--f-body); padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

main { max-width: 1760px; margin: 0 auto; padding: 18px clamp(16px, 4vw, 58px) 60px; }

/* Sign-in cards */
.auth { max-width: 440px; margin: 56px auto; background: var(--surface); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); border-top: 6px solid var(--navy); }
.auth h1 { font-size: 26px; margin-bottom: 6px; }
.auth form { display: grid; gap: 10px; margin: 18px 0 12px; }
.qr { display: grid; place-items: center; padding: 8px; }
.qr img { width: 180px; height: 180px; }
.secret { font-size: 12px; color: var(--ink-2); word-break: break-all; }
.error { max-width: 440px; margin: 0 auto 16px; background: #F6E1DE; color: var(--down); border-radius: 10px; padding: 10px 14px; }

/* Page layout: sidebar + content */
.layout { display: grid; grid-template-columns: 206px minmax(0, 1fr); gap: 28px; }
.side-nav { position: sticky; top: 84px; align-self: start; padding-top: 18px; }
.side-nav nav { display: grid; gap: 2px; }
.side-nav a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.side-nav a[aria-current="page"] { background: var(--navy); color: #fff; }

.hero-band { background: var(--navy); border-radius: 18px; padding: 22px 28px 20px; margin: 18px 0 6px; }
.hero-band h1 { font-family: var(--f-num); font-weight: 800; font-size: clamp(32px, 3.6vw, 44px); line-height: .95; color: var(--sky); letter-spacing: .005em; }
.hero-band p { color: #DCE6F5; font-size: 15px; margin: 10px 0 0; }
.lede { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.rail { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.rail a { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 13.5px; background: var(--surface); }
.rail a b { font-family: var(--f-num); font-size: 16px; color: var(--navy); letter-spacing: .02em; }

.sec { margin-top: 26px; }
.sec.band { background: var(--band); border-radius: 20px; padding: 20px 18px 24px; }
.lvl-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.lvl-head h2 { font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -.01em; }
.lvl-head .sub { color: var(--muted); font-size: 13px; }
.lvl-tag { font-family: var(--f-num); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 4px; padding: 0 6px; }
.card { background: var(--surface); border-radius: 16px; padding: clamp(18px, 3vw, 28px); box-shadow: 0 1px 2px rgba(6,20,51,.06); }
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.row .eyebrow { margin: 0; }
.row input { padding: 7px 12px; font-size: 13.5px; width: 220px; border-radius: 999px; }

/* Big-number tiles */
.duel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.duel > div { background: var(--surface); border-radius: 14px; padding: 16px 20px; display: grid; gap: 4px; align-content: start; box-shadow: 0 1px 2px rgba(6,20,51,.06); }
.duel .k { font-size: 13px; font-weight: 600; color: var(--navy); }
.duel .v { font-family: var(--f-num); font-weight: 800; font-size: clamp(36px, 4vw, 50px); line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.duel .s { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.v.up { color: var(--up); } .v.down { color: var(--down); }

/* Tables */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; border-top: 2px solid var(--navy); font-variant-numeric: tabular-nums; }
.tbl th { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--navy); text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--navy); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap; vertical-align: middle; }
.tbl td:first-child { white-space: normal; min-width: 170px; }
.r { text-align: right !important; }
.up { color: var(--up); } .down { color: var(--down); }
.tkr { display: inline-block; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; border-radius: 5px; padding: 3px 7px; line-height: 1.2; margin-right: 8px; vertical-align: 1px; }
.hold th { cursor: pointer; user-select: none; }
.hold th.sorted::after { content: " ↓"; }
.hold th.sorted.asc::after { content: " ↑"; }
.tbl tr.cash td { background: #E9ECF1; font-weight: 600; }
.ib { display: inline-block; width: 60px; height: 12px; vertical-align: -1px; margin-right: 8px; position: relative; }
.ib i { position: absolute; right: 0; top: 0; height: 100%; border-radius: 2px; max-width: 100%; background: var(--navy); }
.partial { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.note { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }

/* Allocation bars */
.alloc-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 16px; font-size: 14px; }
.alloc-row:last-child { margin-bottom: 0; }
.alloc-row b { font-family: var(--f-num); font-size: 18px; color: var(--navy); }
.alloc-row .bar { grid-column: 1 / -1; height: 12px; background: var(--tile); border-radius: 3px; overflow: hidden; }
.alloc-row .bar span { display: block; height: 100%; background: var(--navy); }

/* Footer with the yellow M */
.fine { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.fine p { margin: 0; }
.m { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--hi); color: var(--navy); font: 800 11px var(--f-display); margin-right: 6px; vertical-align: 1px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side-nav { position: static; padding-top: 4px; }
  .side-nav nav { display: flex; overflow-x: auto; gap: 4px; }
  .duel { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .ib { display: none; }
  .tbl td, .tbl th { padding: 9px 6px; }
  .tbl td:first-child { min-width: 0; }
  .row input { width: 150px; }
  .hero-band { padding: 18px 20px; }
  .sec.band { padding: 16px 12px 18px; }
  .who .email { display: none; }
}
