/* Flipping Command Center — mobile-first, one-glance, big numbers. */

:root {
  --bg: #f4f4f0;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e3e2dc;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --blue: #1d4ed8;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}

.container { max-width: 720px; margin: 0 auto; padding: 12px 12px 80px; }
/* Wide pages (auction feed, bid sheets, docs) use the screen instead of the
   narrow phone column. */
.container--wide { max-width: 1150px; }

h1 { font-size: 1.5rem; margin: 0.6em 0 0.4em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 0.5em; }
h3 { font-size: 1rem; margin: 0.8em 0 0.4em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0.4em 0; }

/* Nav */
.topnav {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 6px; background: var(--ink); color: #fff; padding: 10px 14px;
  position: sticky; top: 0; z-index: 50;
}
.topnav a { color: #fff; font-weight: 600; padding: 4px 7px; border-radius: 6px; }
.topnav a:hover { background: rgba(255, 255, 255, 0.15); text-decoration: none; }
.topnav__brand { font-size: 1.05rem; }
.topnav__links { display: flex; flex-wrap: wrap; gap: 2px; }

/* Flash + banner */
.flash, .banner {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 10px 14px; margin: 8px; border-radius: var(--radius); font-weight: 600;
}
.flash--notice { background: var(--green-soft); color: var(--green); }
.flash--alert { background: var(--red-soft); color: var(--red); }
.banner { background: var(--amber-soft); color: var(--amber); }
.flash__close { background: none; border: none; font-size: 1rem; cursor: pointer; color: inherit; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 10px 0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Numbers */
.label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.num { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.num--huge { font-size: 2.1rem; line-height: 1.1; }

/* Budget bar */
.budget-bar { display: flex; gap: 8px; text-align: center; }
.budget-bar__cell { flex: 1; padding: 6px 2px; }
.budget-bar__cell--hero { background: var(--green-soft); border-radius: var(--radius); }
.budget-bar__cell--hero .num { color: var(--green); }
.budget-bar__cell--danger { background: var(--red-soft); }
.budget-bar__cell--danger .num { color: var(--red); }

/* Bid cards */
.auction-group h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.bid-card { display: flex; gap: 12px; }
.bid-card__photo { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.bid-card__body { flex: 1; min-width: 0; }
.bid-card__title { font-weight: 700; }
.bid-card__max { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.bid-card__max .num--huge { color: var(--green); }
.bid-card__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.why { font-size: 0.85rem; color: var(--muted); margin: 4px 0; }
.stretch { font-size: 0.8rem; color: var(--amber); font-weight: 600; }
.verdict { font-size: 0.85rem; color: var(--blue); }
.citation { border-left: 3px solid var(--line); margin: 6px 0; padding: 4px 10px; color: var(--muted); font-size: 0.9rem; }

/* Countdown */
.countdown { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--amber); }
.countdown--urgent { color: var(--red); }
.countdown--closed { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; border: none; border-radius: 10px; padding: 10px 16px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(0.96); }
.btn--primary { background: var(--green); color: #fff !important; }
.btn--secondary { background: #ececec; color: var(--ink) !important; border: 1px solid var(--line); }
.btn--won { background: var(--green-soft); color: var(--green) !important; }
.btn--lost { background: var(--red-soft); color: var(--red) !important; }
.btn--big { font-size: 1.1rem; padding: 14px 22px; width: 100%; }
.btn--small { padding: 4px 10px; font-size: 0.8rem; }

/* Bid-placed toggle */
.check-toggle, button.check-toggle {
  background: #fff; border: 2px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font-size: 0.95rem; font-weight: 700; cursor: pointer; color: var(--muted);
}
.check-toggle--done, button.check-toggle--done { background: var(--green-soft); border-color: var(--green); color: var(--green); }

/* Decide row (WON/LOST) */
.decide { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.won-details summary { list-style: none; }
.won-details summary::-webkit-details-marker { display: none; }
.won-form { display: flex; gap: 6px; margin-top: 6px; }
.won-form input[type="number"] { width: 130px; }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem;
  font-weight: 700; background: #ececec; color: var(--ink); vertical-align: middle;
}
.chip--open, .chip--ready, .chip--won, .chip--bid { background: var(--green-soft); color: var(--green); }
.chip--closed, .chip--needed, .chip--lost, .chip--skip { background: var(--red-soft); color: var(--red); }
.chip--settled, .chip--in_progress, .chip--watch { background: var(--amber-soft); color: var(--amber); }

/* Rows / lists */
.auction-row, .listit-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lot-row { display: flex; gap: 12px; }
.lot-row__photo { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.lot-row__body { flex: 1; min-width: 0; }
.lot-row__title { font-weight: 700; }
.lot-row--won { border-left: 4px solid var(--green); }
.lot-row--lost { opacity: 0.6; }
.checklist { padding-left: 1.2em; margin: 6px 0; }
.checklist li { margin: 4px 0; }
.doc-list { list-style: none; padding: 0; }
.doc-list li { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.empty { color: var(--muted); font-style: italic; }
.muted { color: var(--muted); font-size: 0.9rem; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin: 10px 0; }
.gallery img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }

/* Thermometer */
.thermo { background: #ececec; border-radius: 999px; height: 26px; overflow: hidden; }
.thermo__fill { background: linear-gradient(90deg, var(--green), #22c55e); height: 100%; border-radius: 999px; transition: width 0.4s; }
.thermo__caption { margin-top: 8px; }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 6px; }
.stack-form label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-top: 6px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inline-form label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="datetime-local"], select, textarea {
  font-size: 1rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; width: 100%; max-width: 100%; font-family: inherit;
}
.inline-form input[type="number"] { width: 140px; }
textarea { resize: vertical; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }

/* Docs — wide tables and code scroll inside their container instead of
   bleeding out of it (render_markdown wraps every table in .table-scroll). */
.doc__body { overflow-wrap: break-word; }
.doc__body img { max-width: 100%; }
.doc__body table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.doc__body th, .doc__body td { border: 1px solid var(--line); padding: 6px; text-align: left; white-space: nowrap; }
.doc__body td { white-space: normal; min-width: 90px; }
.doc__body pre { background: #f3f3f3; padding: 10px; border-radius: 8px; overflow-x: auto; }
.doc__body code { overflow-wrap: break-word; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; }

/* Login */
.login { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.login h1 { font-size: 1.7rem; }
.login .card { text-align: left; }

/* Channel cards */
.channel-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

@media (min-width: 600px) {
  .container { padding: 16px 20px 60px; }
  h1 { font-size: 1.8rem; }
}

/* Icons — hand-rolled inline SVG, inherit text color */
.icon { vertical-align: -0.18em; }
h2 .icon { vertical-align: -0.12em; margin-right: 2px; }

/* Bid lockup: small uppercase label ABOVE, big number below — never wraps
   awkwardly against its label. */
.bid-lockup { display: inline-flex; flex-direction: column; align-items: flex-start; margin: 6px 12px 6px 0; }
.bid-lockup__label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.bid-lockup__num { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 2.2rem; line-height: 1.05; color: var(--green); }
.bid-lockup--compact .bid-lockup__num { font-size: 1.5rem; }
.bid-lockup .muted, .bid-lockup .stretch { margin-top: 2px; }
.lot-row__numbers { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Auction feed cards */
.auction-feed { display: flex; flex-direction: column; gap: 4px; }
.auction-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.auction-card__venue { font-size: 1.05rem; }
.fulfillment {
  display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 2px;
  padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em;
}
.fulfillment--pickup { background: var(--amber-soft); color: var(--amber); }
.fulfillment--ships { background: #dbeafe; color: var(--blue); }
.stake-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 8px 0 2px; }
.stake-line__stake { font-size: 1.05rem; }
.stake-line__stake strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stake-line__roi { font-size: 0.92rem; }
.stake-line__roi strong { color: var(--green); }
.stake-line__hint { font-size: 0.75rem; color: var(--muted); font-style: italic; flex-basis: 100%; }
.auction-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 6px; }

/* The Pool + buckets */
.pool-viz { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pool-viz__pool { flex: 0 0 230px; max-width: 100%; }
.pool-svg { width: 100%; height: auto; display: block; }
.pool-basin { fill: #eef0f3; stroke: #94a3b8; stroke-width: 2; }
.pool-water { fill: #7dd3fc; }
.pool-wave { fill: none; stroke: #38bdf8; stroke-width: 2; stroke-linecap: round; }
.pool-num { font-size: 27px; font-weight: 800; fill: #075985; font-variant-numeric: tabular-nums; }
.pool-caption { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; fill: var(--muted); text-transform: uppercase; }
.pool-viz__buckets { flex: 1; min-width: 220px; }
.pool-viz__buckets-label { font-weight: 600; font-size: 0.92rem; }
.bucket-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.bucket { display: flex; flex-direction: column; align-items: center; width: 72px; text-align: center; }
.bucket-svg { width: 44px; height: 46px; }
.bucket-outline { fill: none; stroke: #64748b; stroke-width: 2; stroke-linecap: round; }
.bucket-fill { fill: #7dd3fc; }
.bucket__amount { font-weight: 800; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.bucket__venue { font-size: 0.7rem; color: var(--muted); line-height: 1.2; }

/* Funnel strip — stage-by-stage snapshot */
.funnel-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; }
.funnel-stage {
  flex: 1; min-width: 96px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; text-align: center;
}
.funnel-stage__label { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.funnel-stage__count { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.funnel-stage__amount { display: block; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-stage__amount-label { display: block; font-weight: 400; color: var(--muted); font-size: 0.68rem; }

/* Price tag */
.price-tag { width: 178px; max-width: 100%; height: auto; flex-shrink: 0; }
.price-tag__shape { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 2; stroke-linejoin: round; }
.price-tag__hole { fill: #fff; stroke: var(--amber); stroke-width: 2; }
.price-tag__value { font-size: 17px; font-weight: 800; fill: var(--ink); font-variant-numeric: tabular-nums; }
.price-tag__hint { font-size: 10px; font-weight: 600; fill: var(--muted); }
.price-tag__profit { font-size: 11px; font-weight: 700; fill: var(--green); }

/* Server-rendered SVG graphs */
.graph { width: 100%; height: auto; display: block; }
.graph-axis { stroke: var(--line); stroke-width: 1; }
.graph-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.graph-line--pool { stroke: #0284c7; }
.graph-line--profit { stroke: var(--green); }
.graph-goal-line { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 6 4; }
.graph-projection { stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 2 4; opacity: 0.8; }
.graph-label { font-size: 11px; fill: var(--muted); font-weight: 600; }
.graph-label--goal { fill: var(--amber); }
.graph-label--strong { fill: var(--ink); font-weight: 800; }
.graph-bar { fill: #7dd3fc; stroke: #0284c7; stroke-width: 1; }

/* Channels page */
.channel-group__blurb { color: var(--muted); font-size: 0.9rem; margin: -2px 0 8px; }
.channel-card .api-note { font-size: 0.85rem; color: var(--blue); }
.status-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.status-form select { width: auto; }

/* Lifecycle timeline */
.timeline { list-style: none; padding: 0; margin: 6px 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; border-left: 3px solid var(--line); padding-left: 12px; margin-left: 6px; }
.timeline li.timeline--done { border-left-color: var(--green); }
.timeline__stage { font-weight: 700; min-width: 110px; }
.timeline__when { color: var(--muted); }
.timeline__gap { color: var(--amber); font-weight: 600; font-size: 0.85rem; }

/* Insights */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat .label { margin-bottom: 2px; }

/* Photo sets */
.photo-set h3 { display: flex; align-items: center; gap: 6px; }
.melt-hint { background: var(--green-soft); color: var(--green); font-weight: 700; padding: 8px 12px; border-radius: 8px; display: inline-block; margin-top: 4px; }

/* Passkeys */
.btn--danger { background: #c0392b; color: #fff !important; }
.form-error { color: #c0392b; font-size: 0.9rem; margin: 8px 0 0; }
.hint { color: #666; font-size: 0.9rem; }
.login .btn--big { margin-top: 4px; }
.login__hint { color: #666; font-size: 0.9rem; text-align: center; }
.login__password { margin-top: 14px; }
.login__password summary { color: #666; font-size: 0.9rem; cursor: pointer; text-align: center; padding: 6px; }
.login__password .stack-form { margin-top: 10px; }
.passkey-promo { border: 2px solid var(--line); text-align: center; }
.passkey-promo .btn--primary { width: 100%; margin: 8px 0; }
.passkey-list { list-style: none; padding: 0; margin: 0 0 12px; }
.passkey-list__item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.passkey-list__name { font-weight: 600; margin-right: 8px; }
.passkey-list__meta { color: #666; font-size: 0.85rem; }
.passkey-list__remove summary { color: #c0392b; font-size: 0.85rem; cursor: pointer; margin-top: 4px; }
.passkey-list__remove .stack-form { margin-top: 8px; max-width: 320px; }

/* ── V3 hotfix: outbound links, loaded-cost hero, current-bid edit ─────── */
.outbound-link { white-space: nowrap; }
.outbound-link .icon { vertical-align: -2px; }

/* H1.2: a lot without a direct link wears the gap on its sleeve. */
.no-direct-link { font-size: 0.85rem; color: var(--muted); }
.no-direct-link__catalog { white-space: nowrap; }

/* H1.2b: per-lot close time (staggered closes). */
.lot-close { margin: 4px 0; font-size: 0.9rem; }
.lot-close strong { font-variant-numeric: tabular-nums; }
.auction-card__cta { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: center; }
.lot-row__head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

.lot-numbers { margin: 4px 0; }
.exit-line { margin: 2px 0; font-size: 0.95rem; }
.exit-line strong { color: var(--green); font-variant-numeric: tabular-nums; }

.loaded-cost { margin: 2px 0; }
.loaded-cost summary { list-style: none; cursor: pointer; }
.loaded-cost summary::-webkit-details-marker { display: none; }
.loaded-cost__label {
  display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase;
}
.loaded-cost__num {
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: 2.2rem;
  line-height: 1.05; color: var(--ink);
}
.loaded-cost--unknown .loaded-cost__num { color: var(--muted); font-size: 1.5rem; }
.loaded-cost__reason { color: var(--amber); font-weight: 600; font-size: 0.85rem; }
.loaded-cost__breakdown { font-size: 0.85rem; color: var(--muted); margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.lot-row .loaded-cost__num { font-size: 1.5rem; }

.current-vs-max { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 0.95rem; }
.current-vs-max__max strong { font-variant-numeric: tabular-nums; color: var(--green); }
.bid-edit { display: inline-block; }
.bid-edit__summary { list-style: none; cursor: pointer; }
.bid-edit__summary::-webkit-details-marker { display: none; }
.bid-edit__num { font-variant-numeric: tabular-nums; border-bottom: 1px dashed var(--muted); }
.bid-edit__form { display: flex; gap: 6px; margin-top: 6px; }
.bid-edit__form input[type="number"] { width: 120px; }

.chip--warn { background: var(--amber-soft); color: var(--amber); }

/* ── V4 evidence: comps, derivation table, assumptions ──────────────────── */
.evidence-badge { font-size: 0.65rem; vertical-align: middle; }
.evidence-badge--measured { background: var(--green-soft); color: var(--green); }
.evidence-badge--estimated { background: var(--amber-soft); color: var(--amber); }
.evidence-badge--thin-evidence { background: var(--red-soft); color: var(--red); }

.anchor-line { font-size: 0.95rem; }
.comp-list { list-style: none; margin: 6px 0; padding: 0; }
.comp {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 6px 0; border-top: 1px solid var(--line);
}
.comp__price { font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--green); }
.comp__meta { font-size: 0.85rem; color: var(--ink); flex: 1 1 240px; }
.comp__source { font-weight: 600; color: var(--muted); }
.comp__link { white-space: nowrap; font-size: 0.85rem; }
.velocity-line { font-size: 0.85rem; }

.derivation { margin: 10px 0; border-top: 1px solid var(--line); padding-top: 8px; }
.derivation__summary { cursor: pointer; font-weight: 700; }
.derivation__justification {
  font-style: italic; border-left: 3px solid var(--line); padding-left: 10px;
  color: var(--ink); margin: 8px 0;
}
.derivation__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 8px 0; }
.derivation__row td { padding: 6px 6px 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.derivation__label { font-weight: 600; white-space: nowrap; }
.derivation__value strong { font-variant-numeric: tabular-nums; }
.derivation__detail { display: block; font-size: 0.78rem; }
.derivation__row--assumption { background: var(--amber-soft); }
.derivation__verdict { font-size: 1rem; }
.derivation__edit-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: end; }
.derivation__edit-form label { font-size: 0.78rem; color: var(--muted); display: grid; gap: 2px; }
.derivation__edit-form input[type="number"] { width: 110px; }

.tag {
  display: inline-block; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 1px 6px; border-radius: 6px; background: var(--line); color: var(--muted);
}
.tag--fact { background: var(--green-soft); color: var(--green); }
.tag--assumption { background: var(--amber-soft); color: var(--amber); }
.tag--setting { background: #dbeafe; color: var(--blue); }
.tag--computed { background: var(--line); color: var(--ink); }

.assumption { display: grid; gap: 2px; }
.assumption .muted { font-size: 0.8rem; }
.assumption__override { margin: 4px 0 0; font-weight: 600; color: var(--blue); font-size: 0.85rem; }

/* ── V4 market + lifecycle: trends, drift, sparklines, provenance ────────── */
.trend { display: inline-flex; vertical-align: middle; }
.trend--up { color: var(--green); }
.trend--down { color: var(--red); }
.trend--flat { color: var(--muted); }

.chip--caution { background: var(--amber-soft); color: var(--amber); }
.trend-chip { font-size: 0.7rem; }
.chip--reunderwrite {
  background: var(--red); color: #fff; font-weight: 800;
  display: inline-flex; align-items: center; gap: 4px;
}
.market-signal { margin: 4px 0; }

.underwriting-frames { font-size: 0.85rem; display: block; margin: 4px 0; }
.derivation__frames { font-size: 0.9rem; margin: 6px 0; }
.derivation__drift { margin: 8px 0 4px; }

/* U8.4 wife-mode metal outcome line */
.metal-outcome-card { font-size: 1.05rem; }
.metal-outcome { margin: 0; }

/* U6 spot sparklines on the Money page */
.spot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 10px 0; }
.spot-grid__cell { display: grid; gap: 4px; }
.sparkline { display: flex; align-items: center; gap: 10px; }
.sparkline__svg { width: 160px; height: 44px; }
.sparkline__line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sparkline__line--up { stroke: var(--green); }
.sparkline__line--down { stroke: var(--red); }
.sparkline__line--flat { stroke: var(--muted); }
.sparkline__now { font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.sparkline-empty { font-size: 0.85rem; }

/* U3 provenance footers on volatile facts */
.provenance { font-size: 0.74rem; color: var(--muted); margin: 2px 0; }
.provenance--stale { color: var(--red); font-weight: 600; display: flex; align-items: center; gap: 3px; }

/* U8.3 calibration */
.calibration h4 { margin: 12px 0 4px; font-size: 0.9rem; }

/* Over-cap rule: dead/skipped lots fold away — attention goes to live bids only */
.removed-lots { margin-top: 24px; }
.removed-lots__summary { color: var(--muted); font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.removed-lots[open] .removed-lots__summary { margin-bottom: 8px; }
.removed-lots .lot-section { opacity: 0.75; }

/* Profit-now line: the two numbers the sheet is steered by */
.profit-now { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 4px 0; font-size: 0.92rem; }
.profit-now__exit strong { font-variant-numeric: tabular-nums; }
.profit-now__profit { font-weight: 700; font-variant-numeric: tabular-nums; }
.profit-now__profit--pos { color: var(--green, #1e7d46); }
.profit-now__profit--neg { color: var(--red, #c0392b); }
.closed-toggle { margin: 4px 0 12px; }

/* Receipts on a phone: the 3-column table becomes stacked cards — tag+label
   on the first line, the value full-width beneath (never scrunched). */
@media (max-width: 640px) {
  .derivation__table, .derivation__table tbody { display: block; }
  .derivation__row { display: grid; grid-template-columns: max-content 1fr; gap: 2px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
  .derivation__row td { display: block; padding: 0; border-top: none; }
  .derivation__label { white-space: normal; }
  .derivation__value { grid-column: 1 / -1; }
}
