/* ==========================================================================
   KreditChain — shared stylesheet

   Palette is the KreditChain brand specification v1.0, unaltered:
     Blockchain Blue     #0070C0   primary action, links, focus
     AI Teal             #00C0A0   accent and the gradient's right stop.
                                   NEVER text on white — 2.3:1, it fails AA.
                                   --teal-ink below is the readable step.
     Institutional Navy  #0C2040   ink, dark surfaces, the wordmark

   Type: Montserrat for the wordmark and display, tracked +0.12em on the
   wordmark as the spec requires. Inter for interface text, which the spec
   names as the secondary face and which sets better at 13px.
   ========================================================================== */

:root {
  --bg:          #F7F9FB;
  --bg-panel:    #FFFFFF;
  --bg-sunk:     #EDF2F7;
  --ink:         #0C2040;
  --ink-2:       #2A3E5C;
  --muted:       #4A6180;   /* 6.3:1 on white */
  --faint:       #5C728E;   /* 4.7:1 on white — it labels 11px text */
  --line:        #DCE5ED;
  --line-strong: #C3D1DE;

  --accent:      #0070C0;
  --accent-ink:  #005A9A;
  --accent-soft: #E6F1FA;

  --teal:        #00C0A0;
  --teal-ink:    #00806B;
  --teal-soft:   #E1F7F2;

  --grad:        linear-gradient(90deg, #0070C0 0%, #00C0A0 100%);

  --amber:       #8A6A1F;
  --amber-soft:  #FBF3E2;
  --red:         #A8452C;
  --red-soft:    #FBECE8;

  --radius:   10px;
  --radius-s: 6px;
  --shadow:   0 1px 2px rgba(12,32,64,.05), 0 8px 24px -12px rgba(12,32,64,.14);

  --font:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Montserrat", "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv05" 1;
}

a { color: inherit; text-decoration: none; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 32px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,251,249,.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
  height: 62px; display: flex; align-items: center; gap: 28px;
}
.brand {
  font-family: var(--display);
  font-weight: 700; font-size: 19px; letter-spacing: .12em; color: var(--ink);
  display: flex; align-items: center; gap: 10px; text-transform: uppercase;
}
/* The mark is the supplied artwork, not a CSS approximation of it — the brand
   spec forbids modifying the shape. Swap the file when the vector master lands. */
.brand-mark {
  width: 26px; height: 30px; flex: none;
  background: url("../img/kove-mark.png") center/contain no-repeat;
}
.brand-mark.on-dark { background-image: url("../img/kove-mark-white.png"); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a {
  font-size: 13.5px; color: var(--muted); letter-spacing: -.005em;
  padding: 6px 0; border-bottom: 1.5px solid transparent; transition: color .15s;
}
.nav a:hover { color: var(--ink); }
/* A button in the nav is a button, not a nav link. `.nav a` is (0,1,1) and
   `.btn-primary` only (0,1,0), so without this the label is painted muted on
   the accent fill — 1.9:1, and unreadable. */
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }
.nav a.btn-ghost, .nav a.btn-ghost:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 500; letter-spacing: -.005em;
  padding: 10px 18px; border-radius: var(--radius-s);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-sunk); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }

/* ---------- homepage ---------- */
.hero { padding: 108px 0 84px; border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(42px, 6.2vw, 74px); line-height: 1.04; letter-spacing: -.02em;
  margin: 0 0 26px; max-width: 15ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-size: 18px; line-height: 1.6; color: var(--ink-2);
  max-width: 58ch; margin: 0 0 36px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: 13px; color: var(--faint); margin-left: 6px; }

.statstrip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
.stat { padding: 34px 28px 34px 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-v {
  font-family: var(--display); font-size: 36px; line-height: 1;
  letter-spacing: -.02em; margin-bottom: 8px;
}
.stat-l { font-size: 13px; color: var(--muted); max-width: 26ch; }

.section { padding: 84px 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 52px; }
.section-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -.018em;
  margin: 0 0 16px;
}
.section-head p { font-size: 16.5px; color: var(--ink-2); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--bg-panel); padding: 30px 26px 34px; }
.step-n {
  font-family: var(--mono); font-size: 12px; color: var(--accent-ink);
  border: 1px solid var(--accent-soft); background: var(--accent-soft);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.step h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 9px; }
.step p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.6; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
.split h2 { font-family: var(--display); font-weight: 600; font-size: 36px; letter-spacing: -.018em; line-height: 1.14; margin: 0 0 18px; }
.split p { color: var(--ink-2); font-size: 16px; margin: 0 0 16px; }
.ledger-demo {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.ledger-demo h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--faint); font-weight: 500; margin: 0 0 18px;
}
.ledger-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .mono { color: var(--muted); flex: none; width: 108px; }
.ledger-row .who { flex: 1; color: var(--ink-2); }
.ledger-row .pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.capacity-bar { height: 8px; border-radius: 99px; background: var(--bg-sunk); overflow: hidden; display: flex; margin-top: 20px; }
.capacity-bar span { display: block; height: 100%; }
.cap-sold { background: var(--accent); }
.cap-retained { background: var(--line-strong); }
.capacity-key { display: flex; gap: 18px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.capacity-key i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.footer { padding: 54px 0 72px; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }

/* ---------- app chrome (market pages) ---------- */
.page-head { padding: 40px 0 26px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--display); font-weight: 600; font-size: 38px; letter-spacing: -.02em; margin: 0 0 8px; }
.page-head p { color: var(--muted); margin: 0; font-size: 15px; }

.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  position: sticky; top: 62px; background: var(--bg); z-index: 40;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 500; }
select, input[type="text"], input[type="number"], input[type="search"] {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--bg-panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); padding: 8px 11px; min-width: 130px;
  transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="search"] { min-width: 220px; }

.results-line { padding: 16px 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- loan grid ---------- */
.loan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding-bottom: 72px; }
.loan-card {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: 14px;
}
.loan-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.lc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lc-ref { font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0; }
.lc-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 3px 0 0; }
.lc-sub { font-size: 13px; color: var(--muted); }
.lc-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 4px; }
.fig-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 3px; }
.fig-v { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 13px; border-top: 1px solid var(--line); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-strong);
  color: var(--muted); background: var(--bg-sunk); white-space: nowrap;
}
.pill-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.pill-amber { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.pill-red { background: var(--red-soft); border-color: transparent; color: var(--red); }
.pill-rating { font-family: var(--mono); font-size: 11px; }

.cap-mini { flex: 1; }
.cap-mini-bar { height: 6px; border-radius: 99px; background: var(--bg-sunk); overflow: hidden; display: flex; }
.cap-mini-bar span { display: block; height: 100%; }
.cap-mini-txt { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.empty { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty h3 { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--ink); margin: 0 0 10px; }

/* ---------- drawer (loan detail + bidding) ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(12,15,14,.34);
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 80;
  backdrop-filter: blur(2px);
}
.scrim.open { opacity: 1; pointer-events: auto; }
/* translateX alone moves the drawer off screen but leaves its inputs in the
   tab order, so a keyboard user tabs into a bid form they cannot see, while
   aria-hidden="true" tells a screen reader the same controls do not exist.
   visibility:hidden takes the whole subtree out of both, and is animatable
   as long as it flips at the END of the transition out and immediately on
   the way in — hence the 0s/.26s delay pair. */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%);
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%); visibility: hidden;
  transition: transform .26s cubic-bezier(.32,.72,0,1), visibility 0s linear .26s;
  z-index: 90; display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -30px rgba(12,15,14,.4);
}
.drawer.open {
  transform: none; visibility: visible;
  transition: transform .26s cubic-bezier(.32,.72,0,1), visibility 0s linear 0s;
}

/* A card is the only way into the drawer, so it has to be reachable without
   a mouse. */
.loan-card:focus-visible {
  outline: 2px solid var(--accent, #0070C0); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .drawer { transition: visibility 0s linear .01s; }
  .drawer.open { transition: visibility 0s linear 0s; }
}
.drawer-head {
  padding: 22px 28px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 16px;
}
.drawer-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -.015em; margin: 4px 0 5px; }
.drawer-body { overflow-y: auto; flex: 1; padding: 0 28px 40px; }
.x-btn {
  margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--bg-panel);
  cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.x-btn:hover { background: var(--bg-sunk); color: var(--ink); }

.d-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.d-section h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--faint); font-weight: 500; margin: 0 0 16px;
}
.attr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 22px; }
.attr { min-width: 0; }
.attr dt { font-size: 11.5px; color: var(--faint); margin-bottom: 3px; }
.attr dd { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -.005em; overflow-wrap: break-word; }

.auction-box {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-top: 4px;
}
.auction-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.best-bid-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 4px; }
.best-bid-v { font-family: var(--display); font-size: 32px; line-height: 1; letter-spacing: -.02em; }
.best-bid-v small { font-family: var(--font); font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.countdown { text-align: right; }
.countdown .t { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.countdown.urgent .t { color: var(--red); }

.bid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.bid-form .field { min-width: 0; }
.bid-form input { width: 100%; min-width: 0; }
.bid-hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin: -2px 0 2px; }
.bid-submit { grid-column: 1 / -1; }
.bid-submit .btn { width: 100%; }

.bid-list { margin-top: 6px; }
.bid-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.bid-row:last-child { border-bottom: 0; }
.bid-rank {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  width: 22px; flex: none;
}
.bid-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bid-who.me { font-weight: 600; }
.bid-slice { font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.bid-spread { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; width: 74px; text-align: right; }
.bid-row.leading { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: var(--radius-s); }

.msg { padding: 11px 14px; border-radius: var(--radius-s); font-size: 13.5px; margin-bottom: 14px; }
.msg-err { background: var(--red-soft); color: var(--red); }
.msg-ok { background: var(--accent-soft); color: var(--accent-ink); }
.msg-warn { background: var(--amber-soft); color: var(--amber); }

.bank-toggle {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted);
  padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 99px;
  background: var(--bg-panel); cursor: pointer; user-select: none;
}
.bank-toggle input { accent-color: var(--accent); margin: 0; }
.orig-note { margin: 14px 0 0; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; }
.lc-manage { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.bank-toggle.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- seed page ---------- */
.seed-panel {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; margin: 32px 0; box-shadow: var(--shadow);
}
.log {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  background: var(--ink); color: #AFC3D8; border-radius: var(--radius-s);
  padding: 18px 20px; max-height: 330px; overflow-y: auto; margin-top: 22px;
  white-space: pre-wrap; word-break: break-word;
}
.log .ok { color: #46D6B4; }
.log .err { color: #F0947C; }
.log .dim { color: #7288A3; }
.progress { height: 4px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; margin-top: 20px; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.callout {
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  padding: 14px 18px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 13.5px; color: var(--accent-ink); margin: 18px 0;
}
.callout code { font-family: var(--mono); font-size: .93em; background: rgba(255,255,255,.6); padding: 1px 5px; border-radius: 3px; }

.banner {
  background: var(--amber-soft); color: var(--amber);
  border-bottom: 1px solid rgba(180,83,9,.2);
  padding: 11px 32px; font-size: 13.5px; text-align: center;
}
.banner code { font-family: var(--mono); background: rgba(255,255,255,.65); padding: 1px 5px; border-radius: 3px; }
.banner a { text-decoration: underline; }
.hidden { display: none !important; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-sunk) 25%, #E3EBF2 50%, var(--bg-sunk) 75%);
  background-size: 200% 100%; animation: sh 1.3s linear infinite;
  border-radius: var(--radius); height: 178px;
}
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .wrap, .wrap-narrow, .topbar-inner { padding: 0 20px; }
  .statstrip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: 0; padding: 26px 0; border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 68px 0 56px; }
  .section { padding: 60px 0; }
  .nav { gap: 16px; }
  .attr-grid { grid-template-columns: 1fr; }
  .drawer-head, .drawer-body { padding-left: 20px; padding-right: 20px; }
  .toolbar { position: static; }
}
@media (max-width: 620px) {
  .nav a:not(.nav-cta) { display: none; }
  .bid-form { grid-template-columns: 1fr; }
}

/* --- access gate ---------------------------------------------------------- */

/* The sign-in card itself lives in css/gate.css and nowhere else. It used to
   be duplicated here, the two copies drifted, and the same overlay looked
   different on market.html and demo.html. Every page that can show the gate
   now loads gate.css.

   What stays here is the SIGNED-IN chrome — the identity block in the top bar,
   which is part of the page and not part of the gate. It shares .auth-link,
   so that one rule stays too. */

.auth-link {
  display: block; margin-top: 14px;
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 13px; color: var(--muted, #5E7189);
  text-decoration: underline; cursor: pointer;
}
.auth-link:hover { color: var(--ink, #0C2040); }
/* signed-in chrome in the top bar */
.identity-block { display: flex; align-items: center; gap: 12px; margin-left: 20px; }
.ident { display: flex; align-items: baseline; gap: 7px; font-size: 13.5px; }
.ident-org { color: var(--ink, #0C2040); font-weight: 500; }
.ident-role {
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink, #005A9A); background: var(--accent-soft, #E6F1FA);
  padding: 2px 7px; border-radius: 4px;
}
.identity-block .auth-link { margin-top: 0; }

@media (max-width: 720px) {
  .ident-org { display: none; }
}

/* Visible only to assistive technology. Used by the timeline's live region:
   the page rewrites itself on every step and needs somewhere to say so. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  border: 0;
}

/* The chain entry under each ledger row. Deliberately quiet: it is evidence,
   not a headline. */
.ledger-hash {
  font-size: 11px; color: var(--faint); letter-spacing: .01em;
  padding: 0 0 8px 2px; margin-top: -4px;
}

/* ---------- dropdown nav (grouped menu) ---------- */
.nav-group { position: relative; }
.nav-trigger {
  font: inherit; font-size: 13.5px; color: var(--muted); letter-spacing: -.005em;
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border-bottom: 1.5px solid transparent; transition: color .15s;
}
.nav-trigger:hover, .nav-group.open > .nav-trigger { color: var(--ink); }
.nav-trigger.has-active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-trigger .caret { font-size: 9px; opacity: .55; transition: transform .15s; }
.nav-group.open > .nav-trigger .caret { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 184px;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; display: none; z-index: 100;
}
.nav-group.account .nav-menu { left: auto; right: 0; }
.nav-group.open > .nav-menu { display: block; }
.nav-menu a, .nav-menu button {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  padding: 8px 11px; border-radius: var(--radius-s);
  font: inherit; font-size: 13.5px; color: var(--ink-2);
  text-decoration: none; background: none; border: 0; cursor: pointer;
}
.nav-menu a:hover, .nav-menu button:hover { background: var(--bg-sunk); color: var(--ink); }
.nav-menu a.active { color: var(--accent-ink); font-weight: 600; }
/* account trigger reuses the identity chips */
.nav-group.account .nav-trigger { padding: 4px 2px; }

/* ---------- phones (found by the rehearsal's 390px pass) ----------
   The account menu pushed the top bar 12–25px past the screen on every signed-in
   page, and the Positions / Custodian tables and tiles were laid out for a laptop.
   `body` raises specificity over the pages' own inline <style> blocks, which load
   after this file. */
@media (max-width: 620px) {
  .topbar-inner { padding: 0 14px; }
  .nav { gap: 10px; }
  .identity-block { margin-left: 6px; gap: 6px; }
  body .cust-totals { grid-template-columns: repeat(2, 1fr); }
  body table.cbook { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body table.cbook td, body table.cbook th { white-space: nowrap; }
}

/* single-login demo: the admin acting as a demo investor (auth.js) */
.nav-menu .nav-note { padding: 6px 11px 2px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3, #5A6B80); }
.nav-menu .nav-hint { padding: 0 11px 6px; max-width: 250px; font-size: 11.5px; line-height: 1.4; white-space: normal; color: var(--ink-3, #5A6B80); }
.nav-menu .nav-sep { height: 1px; background: var(--line, #DDE3EA); margin: 6px 4px; }
.ident-acting, .demo-acting {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: #7A4B00; background: #FFE8B3; padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
