/* Iron Coast Deals — shared stylesheet.
   The token block is the only place a colour or size is defined; everything
   below it uses the variables. Light is the default; dark overrides tokens
   only, per the house rule that a theme is not a coat of paint. */

/* Iron Coast brand: gunmetal + Gulf teal base; each division carries its own
   accent, and Deals is green. Manage blue, GC safety orange and Capital brass
   exist in the system but have no business on this site. */
:root {
  color-scheme: light;
  --bg: #f2f4f4;
  --surface: #ffffff;
  --surface-2: #e8edee;
  --border: #d2dadb;
  --text: #22303c;
  --text-dim: #64748b;
  --accent: #2b9348;          /* Deals green — the division accent */
  --accent-strong: #237a3c;
  --accent-soft: #ddf0e1;
  --ink: #28323d;             /* gunmetal — the parent base */
  --teal: #2c7f74;            /* Gulf teal — the waterline */
  --teal-soft: #ddecea;
  --good: #1f8a3d;
  --good-soft: #e0f0e5;
  --bad: #b02a2a;
  --bad-soft: #f7e2e2;
  --warn: #92610c;
  --warn-soft: #f6ecd6;
  --chart-1: #2b9348;         /* net wealth line — validated pair, light */
  --chart-2: #2f6db6;         /* equity line */
  --radius: 10px;
  --shadow: 0 1px 3px rgba(34, 48, 60, 0.10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b232d;
  --surface: #232e3a;
  --surface-2: #2c3947;
  --border: #3b4a5a;
  --text: #e6ebee;
  --text-dim: #93a3b3;
  --accent: #46b563;
  --accent-strong: #5ecf79;
  --accent-soft: #1e3626;
  --ink: #cfdae4;
  --teal: #4aa79e;
  --teal-soft: #1c3330;
  --good: #57c777;
  --good-soft: #1d3527;
  --bad: #e06c6c;
  --bad-soft: #402224;
  --warn: #d8a94a;
  --warn-soft: #3b310f;
  --chart-1: #3aa85c;         /* net wealth line — validated pair, dark */
  --chart-2: #5187d6;         /* equity line */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }  /* the page does not jump when a scrollbar appears */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative; /* anchors the mobile menu panel */
}

/* ---------- mobile navigation ----------
   ironcoast.js gathers everything after the brand into .topnav and adds the
   ☰ button. Desktop: display:contents keeps the original row layout exactly.
   Phone: the row collapses to brand + ☰, and the items become a dropdown. */
.topnav { display: contents; }
.topbar .nav-burger { display: none; }
@media (max-width: 880px) {
  .topbar { gap: 10px; padding: 12px 14px; }
  .topbar .spacer { display: none; }
  .topbar .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; font-size: 19px; line-height: 1; padding: 6px 12px;
  }
  .topnav {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 10px; left: 10px; z-index: 60;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.25);
    padding: 10px; flex-direction: column; gap: 8px;
  }
  .topbar.nav-open .topnav { display: flex; }
  .topnav .btn { width: 100%; justify-content: flex-start; text-align: left; padding: 11px 14px; font-size: 15px; }
  .page { padding: 14px; }
}

/* Iron Coast division lockup: shoreline block, wordmark, green DEALS line. */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand .mark-img { width: 36px; height: 36px; display: block; }

.brand .lockup { display: flex; flex-direction: column; line-height: 1.05; }

.brand .wordmark {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.brand .division {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-top: 2px;
}

.brand .division::before {
  content: "";
  width: 14px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.brand .tag { color: var(--text-dim); font-size: 13px; margin-left: 10px; }

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

.topbar .spacer { flex: 1; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--surface-2); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn.danger { color: var(--bad); }

.btn.small { padding: 4px 10px; font-size: 13px; font-weight: 500; }

.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

/* ---------- layout ---------- */

/* Fluid, left-anchored: the page uses whatever glass it gets (Walter works on
   a widescreen) — no centered column, no dead margins. Readability comes from
   the grids inside growing MORE COLUMNS, and from per-pane caps, not from
   capping the page. */
.page {
  max-width: none;
  margin: 0;
  padding: 24px 28px;
}

.deal-layout {
  display: grid;
  /* verdict first: results lead, the input rail sits to the right. Cards
     flow into two columns on ultrawide (below) instead of stretching. */
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 24px;
  align-items: start;
}

/* on wide screens the result cards flow into two columns; verdict rows,
   notes, tiles and the hold chart span both */
@media (min-width: 1700px) {
  .results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .results > div[style*="height:12px"] { display: none; }
  .results > .compare, .results > .note, .results > .chip-row,
  .results > .headline-grid, .results > .span-all { grid-column: 1 / -1; }
  .results > .headline-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 0; }
}

/* dashboard sections flow into columns as the window widens */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(560px, 1fr));
  gap: 0 14px;
  align-items: start;
}
@media (max-width: 700px) { .dash-grid { grid-template-columns: 1fr; } }

/* the deal map: every deal pinned where it sits */
.deal-map-svg { width: 100%; height: auto; max-height: 380px; display: block; }
/* the viewBox zooms to the pins, so strokes are set in SCREEN pixels */
.deal-map-svg path { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.deal-pin { stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.deal-pin.pin-under { fill: var(--teal); }
.deal-pin.pin-cf { fill: var(--good); }
.deal-pin.pin-neg { fill: var(--text-dim); opacity: 0.75; }
.deal-pin:hover { stroke: var(--text); stroke-width: 2.5; }

/* the Market Book: map + research rail beside the book, not above it */
.market-layout {
  display: grid;
  grid-template-columns: minmax(360px, 540px) minmax(0, 1280px);
  gap: 16px;
  align-items: start;
}
.market-rail { position: sticky; top: 16px; }
@media (max-width: 1100px) {
  .market-layout { grid-template-columns: 1fr; }
  .market-rail { position: static; }
}

@media (max-width: 900px) {
  .deal-layout { grid-template-columns: 1fr; }
  .results { position: static !important; }
}



/* ---------- cards & sections ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }

.section h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.section .hint { font-size: 12.5px; color: var(--text-dim); margin: -6px 0 10px; }
/* the -6px pull-up is for hints snugged under inputs; after a chip row or a
   lines table it collides with the content above — those followers clear it */
.section .chip-row + .hint, .section table.lines + .hint { margin-top: 6px; }

/* ---------- forms ---------- */

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.thirds { grid-template-columns: 1fr 1fr 1fr; }

.field { margin-bottom: 10px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.input-wrap:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }

.input-wrap .affix {
  padding: 0 9px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-2);
  align-self: stretch;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}

.input-wrap .affix.suffix { border-right: none; border-left: 1px solid var(--border); }

.input-wrap input, .input-wrap select {
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
  outline: none;
}

/* designed numeric inputs: the browser spinners go */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); margin: 6px 0; }
.checkline input[type="checkbox"] {
  appearance: none;
  width: 17px; height: 17px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  flex: none;
}
.checkline input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.checkline input[type="checkbox"]:checked::after {
  content: "";
  position: absolute; inset: 2px 4px 4px 4px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- segmented mode toggle ---------- */

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 3px;
  gap: 3px;
}

.segmented button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 7px;
  cursor: pointer;
}

.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- results ---------- */

.headline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.stat .label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 22px; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.stat.good .value { color: var(--good); }
.stat.bad .value { color: var(--bad); }
.stat.accent { border-color: var(--teal); background: linear-gradient(0deg, var(--teal-soft), var(--surface)); }

/* breakdown tables */

.lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lines td { padding: 4px 0; }
.lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines tr.total td { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 700; }
.lines tr.dim td { color: var(--text-dim); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
}
.chip.pass { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.info { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.fail { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.accent { background: var(--teal); color: #fff; border-color: transparent; }

/* the Iron Coast Standard grade — a medallion, not a chip */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 32px; padding: 0 8px;
  border-radius: 9px;
  font-weight: 850; font-size: 17px; line-height: 1; letter-spacing: -0.02em;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  cursor: default;
}
.grade-badge.gr-aplus {
  background: linear-gradient(135deg, var(--teal) 0%, #2b6e63 100%);
  color: #fff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--teal) 45%, transparent);
}
.grade-badge.gr-a { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.grade-badge.gr-b { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.grade-badge.gr-c { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.grade-badge.big { min-width: 52px; height: 46px; font-size: 25px; border-radius: 12px; padding: 0 12px; }

/* the badge explains itself on hover — same panel as the market signal tiles */
.grade-badge { position: relative; cursor: help; }
.grade-badge .tip {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 7px;
  z-index: 12;
  width: 290px;
  max-width: 82vw;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .grade-badge .tip { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.grade-badge:hover .tip { display: block; }
.grade-badge .tip .tip-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.75; margin-bottom: 4px; }
.grade-badge .tip .ok { color: #5ec98f; font-weight: 800; }
.grade-badge .tip .no { color: #ff7b72; font-weight: 800; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- deal list (index) ---------- */

.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

.deal-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }

.deal-card .addr { font-weight: 700; font-size: 15.5px; color: var(--text); text-decoration: none; }
.deal-card .addr:hover { color: var(--accent); }

.deal-card .meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-dim); }

.deal-card .numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.deal-card .numbers .k { color: var(--text-dim); }
.deal-card .numbers .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.deal-card .numbers .v.good { color: var(--good); }
.deal-card .numbers .v.bad { color: var(--bad); }

.deal-card .actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; align-items: center; }

.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* ---------- empty & error states (designed, per house rule 21) ---------- */

.empty {
  text-align: center;
  padding: 64px 24px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
}

.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.empty p { margin: 0 0 16px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  z-index: 50;
}

[data-theme="dark"] .toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- photos ---------- */

.photo-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.photo-thumb {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--surface-2);
  padding: 0;
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-thumb .x {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(20, 26, 33, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
  padding: 0;
}

.add-photo {
  width: 76px; height: 76px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}

.add-photo:hover { border-color: var(--accent); color: var(--accent); }

.viewer {
  position: fixed; inset: 0;
  background: rgba(15, 20, 26, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  cursor: zoom-out;
}

.viewer img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---------- quick add (index) ---------- */

.quick { padding: 16px 18px; margin-bottom: 22px; }

.quick h2 {
  margin: 0 0 10px;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink);
}

.quick .row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }

.quick .actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

.quick .photo-note { font-size: 12.5px; color: var(--text-dim); }

/* ---------- strategy compare (results) ---------- */

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.compare-card {
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.compare-card:hover { border-color: var(--text-dim); }

.compare-card.active {
  border-color: var(--accent);
  background: linear-gradient(0deg, var(--accent-soft), var(--surface));
}

.compare-card .strat {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

.compare-card.active .strat { color: var(--accent); }

.compare-card .big { font-size: 19px; font-weight: 750; margin-top: 3px; font-variant-numeric: tabular-nums; }
.compare-card .big.good { color: var(--good); }
.compare-card .big.bad { color: var(--bad); }
.compare-card .sub { font-size: 12.5px; color: var(--text-dim); margin-top: 1px; }

/* ---------- deal cards: photo + strategy lines ---------- */

.deal-card .card-photo {
  width: 100%; height: 128px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.strat-line {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.strat-line .strat {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em;
  color: var(--teal);
  min-width: 44px;
}

.strat-line .v { font-weight: 600; }
.strat-line .v.good { color: var(--good); }
.strat-line .v.bad { color: var(--bad); }
.strat-line .dim { color: var(--text-dim); font-size: 12.5px; }

/* ---------- compare table ---------- */

.cmp-wrap { overflow-x: auto; }  /* wide content scrolls in its own container */

table.cmp { border-collapse: collapse; width: 100%; font-size: 13.5px; }

.cmp th, .cmp td {
  padding: 8px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cmp th:first-child, .cmp td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 600;
  min-width: 150px;
  z-index: 2;
}

/* Deal columns keep a readable width: the table OVERFLOWS and swipes inside
   .cmp-wrap instead of compressing into slivers on a phone. */
.cmp th:not(:first-child), .cmp td:not(:first-child) { min-width: 132px; }

.mobile-only { display: none; }
@media (max-width: 880px) {
  .mobile-only { display: block; }
  table.cmp { font-size: 12px; }
  .cmp th, .cmp td { padding: 7px 9px; }
  .cmp th:first-child, .cmp td:first-child { min-width: 104px; max-width: 124px; font-size: 11.5px; box-shadow: 2px 0 0 var(--border); }
  .cmp th:not(:first-child), .cmp td:not(:first-child) { min-width: 116px; }
}

.cmp thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--border);
}

.cmp thead a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.cmp thead a:hover { color: var(--accent); }
.cmp thead .sub { display: block; font-weight: 500; font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.cmp td.best { color: var(--good); font-weight: 700; background: var(--good-soft); }
.cmp td.neg { color: var(--bad); }

.cmp tr.group td {
  padding-top: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--teal);
  border-bottom: none;
  background: var(--surface);
}

/* ---------- whole-page drop overlay ---------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;   /* the drop still lands on the page underneath */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 26, 33, 0.45);
}

/* display:flex above beats the browser's own [hidden] rule (author styles
   override UA styles), which kept the overlay painted over the whole page
   from load. Stated explicitly so hidden actually hides. */
.drop-overlay[hidden] { display: none; }

.drop-overlay-text {
  border: 2px dashed #fff;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  padding: 28px 44px;
  border-radius: 12px;
  background: rgba(20, 26, 33, 0.55);
}

/* ---------- market book: signals, ratio chart, strategy badges ---------- */

.sig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 6px;
}

.sig {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
  position: relative;
  cursor: help;
}

/* the hover explainer: what this highlight means and where it came from */
.sig .tip {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  margin-top: 6px;
  z-index: 8;
  width: 260px;
  max-width: 78vw;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  padding: 9px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .sig .tip { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.sig:hover .tip { display: block; }
.sig.accent .v { color: var(--accent); }
.sig .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.sig .v { font-size: 18px; font-weight: 750; margin-top: 1px; font-variant-numeric: tabular-nums; }
.sig .s { font-size: 11.5px; color: var(--text-dim); }
.sig.good .v { color: var(--good); }
.sig.bad .v { color: var(--bad); }

.ratio-block { margin: 12px 0 4px; }
.ratio-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 12.5px; }
.ratio-row .city { width: 110px; flex: none; color: var(--text); font-weight: 600; }
.ratio-track { flex: 1; height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.ratio-fill { height: 100%; border-radius: 4px; }
.ratio-fill.hi { background: var(--good); }
.ratio-fill.mid { background: var(--teal); }
.ratio-fill.lo { background: var(--warn); }
.ratio-row .pct { width: 56px; flex: none; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.strat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  vertical-align: 2px;
}
.strat-badge.brrr { background: var(--accent-soft); color: var(--accent-strong); }
.strat-badge.flip { background: color-mix(in srgb, var(--chart-2) 16%, var(--surface)); color: var(--chart-2); }
.strat-badge.hold { background: var(--teal-soft); color: var(--teal); }
.strat-badge.caution { background: var(--warn-soft); color: var(--warn); }

/* ---------- hold-trajectory chart ---------- */

.chart-wrap { position: relative; }
.hold-chart { width: 100%; height: auto; display: block; }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.ch-net { stroke: var(--chart-1); }
.ch-equity { stroke: var(--chart-2); }
.ch-zero { stroke: var(--border); stroke-dasharray: 4 3; }
.ch-tick { font-size: 10px; fill: var(--text-dim); }
.ch-label { font-size: 11px; font-weight: 600; fill: var(--text); }
.ch-cross { stroke: var(--text-dim); stroke-width: 1; }
.ch-dot { fill: var(--surface); stroke-width: 2 }
.ch-dot.ch-net { stroke: var(--chart-1); }
.ch-dot.ch-equity { stroke: var(--chart-2); }

.ch-tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.6;
  padding: 6px 10px;
  z-index: 6;
  white-space: nowrap;
}
.ch-tip[hidden] { display: none; }

.ch-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-dim); margin-top: 4px; flex-wrap: wrap; }
.ch-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- misc ---------- */

.page-title { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 21px; color: var(--ink); }
.page-title .spacer { flex: 1; }

.note {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
}
