/* InvestMIDAS front end. Colours are roles (CSS variables) so light and dark
   swap in one place. Chart palette: the dataviz reference palette. Theme: the
   ScreenMIDAS family look shared with BetMIDAS and screenmidas.com (green
   accent strip and tabs, warm neutrals). The logo keeps its own colours. The
   --brand-navy / --brand-gold names are historical: both now carry the green. */
:root {
  color-scheme: light;
  --brand-navy: #0d8f62;      /* accent: tabs, buttons, card and tile edges, the hero tile */
  --brand-on-navy: #ffffff;   /* text on an accent fill */
  --brand-ink: #0b0b0b;       /* strong text: active items, the wordmark */
  --brand-gold: #0d8f62;      /* accent lines and highlights */
  --brand-gold-text: #0d8f62; /* "MIDAS" in the wordmark */
  --accent-soft: #dcf1e8;     /* soft green fill for highlights */
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --hover: rgba(11, 11, 11, 0.04);
  --series-1: #2a78d6;      /* Business Model / new ideas */
  --series-2: #eb6834;      /* Price Trend / watchlist */
  --series-3: #1baf7a;
  --neutral-mark: #b9b8b0;  /* unflagged dots */
  --div-hi: #5598e7;        /* diverging: high rank */
  --div-lo: #e66767;        /* diverging: low rank */
  --div-max: 58%;           /* strongest tint of a rank cell */
  --delta-up: #006300;
  --delta-down: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand-navy: #34c58f;
    --brand-on-navy: #0b0b0b;
    --brand-ink: #f0efec;
    --brand-gold: #34c58f;
    --brand-gold-text: #34c58f;
    --accent-soft: #143628;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --hover: rgba(255, 255, 255, 0.05);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --neutral-mark: #5a5955;
    --div-hi: #256abf;
    --div-lo: #b5403f;
    --div-max: 70%;
    --delta-up: #0ca30c;
    --delta-down: #e66767;
  }
}

/* The wordmark's typeface, served from this site (Fredoka, SIL Open Font
   License; one variable file covers every weight, latin characters only). */
@font-face {
  font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/brand/fonts/fredoka-latin.woff2") format("woff2");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--text-primary);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 2px; font-weight: 650; }
.sub { color: var(--text-secondary); font-size: 13px; margin: 0 0 12px; }
.muted { color: var(--text-muted); }

/* Shown only on a non-live instance (config.INSTANCE). */
.instance-flag {
  background: #e2a61c; color: #1f2a44; text-align: center; font-size: 12px;
  font-weight: 650; letter-spacing: 0.04em; padding: 3px 12px;
}

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; padding: 10px 20px; background: var(--surface-1);
  border-bottom: 2px solid var(--brand-navy);
  /* The bar spans the page; its contents stop at 1280px (20px gutters included). */
  padding-inline: max(20px, calc((100% - 1240px) / 2));
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { display: block; }
.brand-word { font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: .2px; }
.brand-word .ink { color: var(--brand-ink); }
.brand-word .gold { color: var(--brand-gold-text); }
.brand-group { display: flex; align-items: center; gap: 6px; }
/* The universe switch reads as part of the name: "InvestMIDAS 500 v" */
select.brand-select {
  font-weight: 700; font-size: 16px; letter-spacing: 0.02em; padding: 2px 4px; cursor: pointer;
  border-color: transparent; background-color: transparent; color: var(--brand-ink);
}
select.brand-select:hover, select.brand-select:focus { border-color: var(--axis); }
/* The tabs always sit on their own row, resting on the green strip; the
   logo and controls share the row above. */
.topbar { row-gap: 8px; }
.topbar nav { order: 3; flex-basis: 100%; display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-end; margin-bottom: -10px; }
.topbar nav a {
  text-decoration: none; padding: 7px 14px 6px; border-radius: 8px 8px 0 0; background: var(--brand-navy);
  color: var(--brand-on-navy); font-weight: 600; line-height: 1.2; white-space: nowrap; transition: filter .12s, padding .12s;
}
.topbar nav a:hover { filter: brightness(1.08); }
.topbar nav a.active { padding-top: 10px; filter: brightness(.82); font-weight: 700; }
.topbar-controls { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.topbar-controls label { color: var(--text-secondary); font-size: 13px; display: flex; gap: 6px; align-items: center; }
select, input[type="text"], input[type="search"], input:not([type]) {
  font: inherit; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 6px; padding: 5px 8px;
}
#jump-input { width: 130px; }

main { padding: 20px; margin: 0; }

/* Main pages get the market headlines panel on the right (wide screens) or
   below the page (narrow ones). The page keeps its full width beside it. */
.layout { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.layout > main { max-width: none; margin: 0; min-width: 0; }
/* About, Subscribe and the admin pages (Lab, Users): content capped at 1280px.
   The other pages stay full width for now (user is reviewing them one by one). */
.layout > main.capped { max-width: 1280px; width: 100%; margin: 0 auto; }
@media (min-width: 1200px) {
  .layout.with-side { grid-template-columns: minmax(0, 1fr) 300px; }
  .layout.with-side .side-news { padding: 20px 20px 20px 0; }
  .side-news .card { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
  .side-news .zh-list { overflow-y: auto; }
}
.side-news { padding: 0 20px 20px; }
.side-news .card { margin: 0; }
.zh-list { list-style: none; margin: 0; padding: 0; }
.zh-list li { padding: 8px 0; border-top: 1px solid var(--border); }
.zh-list li:first-child { border-top: 0; padding-top: 2px; }
.zh-list a { display: block; text-decoration: none; font-weight: 600; color: var(--brand-ink); line-height: 1.35; }
.zh-list a:hover { text-decoration: underline; }
.zh-list .when { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.zh-list li.new .when::after { content: " · new"; color: var(--text-secondary); font-weight: 600; }
.side-news .sub { margin: 10px 0 0; font-size: 12px; }
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; margin-bottom: 16px;
}
/* A card whose title sits in a navy band across the top. */
.card.banded { border-top: 3px solid var(--brand-navy); }
.card.banded > h2:first-child { margin: 0 0 10px; }
tr.comp td { padding-top: 10px; font-weight: 650; color: var(--brand-ink); border-bottom: 1px solid var(--brand-ink); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters .count { margin-left: auto; color: var(--text-secondary); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 6px; overflow: hidden; }
.seg button {
  font: inherit; border: 0; background: transparent; color: var(--text-secondary);
  padding: 5px 11px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--axis); }
.seg button.on { background: var(--hover); color: var(--text-primary); font-weight: 600; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 8px; text-align: right; white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--axis); }
thead tr.groups th { border-bottom: 0; padding-bottom: 0; color: var(--text-muted); font-weight: 600; text-align: center; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text-primary); }
th.sorted { color: var(--text-primary); }
td.l, th.l { text-align: left; }
td.name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
tbody tr { border-bottom: 1px solid var(--grid); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td:not(.rank) { background: var(--hover); }
td.ticker { font-weight: 650; }
td.rank { min-width: 44px; }
td.sep, th.sep { border-left: 1px solid var(--grid); }
.screen-table { max-height: calc(100vh - 230px); overflow: auto; }
.screen-table thead th { position: sticky; top: 0; background: var(--surface-1); z-index: 2; }
.screen-table thead tr.cols th { top: 22px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--axis); color: var(--text-secondary); vertical-align: middle;
}
.badge .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.new_idea { background: var(--series-1); }
.dot.watchlist { background: var(--series-2); }
.up { color: var(--delta-up); }
.down { color: var(--delta-down); }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile .label { color: var(--text-secondary); font-size: 12px; }
.tile .value { font-size: 28px; font-weight: 650; line-height: 1.2; }
.tile { border-top: 3px solid var(--brand-navy); }
.tile.hero .value { font-size: 48px; }
/* The headline tile is filled navy, with a gold rule. */
.tile.hero { background: var(--brand-navy); border-color: var(--brand-navy); border-top-color: var(--brand-gold); }
.tile.hero .value { color: var(--brand-on-navy); }
.tile.hero .label, .tile.hero .deltas { color: rgba(255, 255, 255, 0.78); }
.tile.hero .up { color: #7fdc97; }
.tile.hero .down { color: #ffa39c; }
.tile .deltas { font-size: 12px; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- charts ---- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--text-muted); font-size: 11px; }
.chart text.lbl { fill: var(--text-secondary); }
.chart text.cap { fill: var(--text-muted); font-size: 11px; }
/* Labels over dots get a surface-coloured halo so they stay readable. */
.chart text.halo { paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px; stroke-linejoin: round; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin: 2px 0 6px; }
.legend .key { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.legend .keydot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid2 .card { margin-bottom: 0; }
.cols2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cols2 { grid-template-columns: 1fr; } }

/* Horizontal bars (sector weights): thin, square at the baseline, rounded data end. */
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 170px minmax(60px, 1fr) 52px 86px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: block; height: 14px; }
.bar-track i { display: block; height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.bar-note { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.bar-row:hover .bar-label { color: var(--text-primary); }
tbody tr.group td { font-weight: 650; padding-top: 12px; border-bottom: 1px solid var(--axis); }
tbody tr.group td.muted { font-weight: 400; font-size: 12px; }
.card p a { text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--axis); }

/* Header account buttons, login form, locked panels, footer */
.auth { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.btn.primary { background: var(--brand-navy); color: var(--brand-on-navy); border-color: var(--brand-navy); font-weight: 600; }
a.btn { text-decoration: none; display: inline-block; }
.btn { cursor: pointer; }
.form { display: grid; gap: 12px; max-width: 360px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.form input { font: inherit; padding: 8px 10px; border: 1px solid var(--axis); border-radius: 6px; background: var(--surface-1); color: var(--text-primary); }
.form .msg { color: var(--delta-down); font-size: 13px; min-height: 18px; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.locked { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.locked p { margin: 0; flex: 1 1 320px; color: var(--text-secondary); }
.disclaimer { margin: 8px 0 0; padding: 16px 20px 28px; border-top: 2px solid var(--brand-navy); }
.disclaimer p { margin: 0; font-size: 12px; line-height: 1.55; color: var(--text-muted); }
.disclaimer b { color: var(--text-secondary); }
/* The footer bar every ScreenMIDAS site shares: copyright and a link home. */
.site-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--grid); font-size: 13px; color: var(--text-muted); }
.site-foot a { color: var(--text-muted); }

/* ---- custom screen builder ---- */
.custom-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .custom-layout { grid-template-columns: 1fr; } }
.model-list { display: grid; gap: 6px; margin-bottom: 12px; }
.model-list p { margin: 0; }
.model {
  font: inherit; text-align: left; cursor: pointer; padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent; color: var(--text-primary);
  display: grid; gap: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.model span { font-size: 12px; }
.model:hover { background: var(--hover); }
.model.on { border-color: var(--brand-ink); box-shadow: inset 3px 0 0 var(--brand-gold); font-weight: 600; }
.pick-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 24px; }
.pick-group h3 {
  margin: 0 0 6px; font-size: 11px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--brand-ink); border-bottom: 1px solid var(--grid); padding-bottom: 4px;
}
.pick { display: flex; gap: 8px; align-items: center; padding: 3px 0; cursor: pointer; }
.pick input { width: 15px; height: 15px; flex: none; }
.pick:has(input:disabled) { color: var(--text-muted); cursor: not-allowed; }
.cm-chosen td { white-space: normal; vertical-align: top; }
.cm-chosen td.how { color: var(--text-secondary); font-size: 12.5px; min-width: 240px; }
.cm-chosen input[type="number"] {
  font: inherit; width: 64px; text-align: right; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 6px; padding: 4px 6px;
}
.btn.small { padding: 3px 9px; font-size: 12px; }
/* one card per tier (Subscribe / Plans page) */
.tier-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 12px; }
.tier-card {
  background: var(--surface-1); border: 1px solid var(--border); border-top: 4px solid var(--brand-navy);
  border-radius: 10px; padding: 16px;
}
.tier-card.cur { border-top-color: var(--brand-gold); box-shadow: 0 0 0 1px var(--brand-gold); }
.tier-card h3 { margin: 0; font-size: 17px; font-weight: 650; color: var(--brand-ink); }
.tier-price { font-size: 30px; font-weight: 650; line-height: 1.2; margin: 4px 0 10px; }
.tier-price span { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
/* Early Access: paid tiers' prices blurred under a stamp; the notice above the plans. */
.fee-stamped { position: relative; display: inline-block; }
.fee-blur { filter: blur(4px); user-select: none; }
.fee-stamped .stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); white-space: nowrap; }
.tier-price .fee-stamped, .tier-price .fee-blur { font-size: inherit; color: inherit; }
.tier-price .fee-stamped .stamp, table.plans th .fee-stamped .stamp { color: var(--brand-gold); font-weight: 800; }
.tier-price .fee-stamped .stamp { font-size: 13px; left: 45%; transform: translate(0, -50%) rotate(-8deg); }
table.plans th .fee-stamped { display: block; margin-top: 4px; }
table.plans th .fee-stamped span { display: inline; margin: 0; }
table.plans th .fee-stamped .stamp { font-size: 10px; padding: 1px 5px; display: inline-block; }
.stamp { display: inline-block; border: 2px solid var(--brand-gold); color: var(--brand-gold); background: color-mix(in srgb, var(--surface-1) 35%, transparent);
  border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; line-height: 1.2; }
.card.early-access { display: flex; align-items: center; gap: 14px; border-top-color: var(--brand-gold); }
.card.early-access .stamp { transform: rotate(-6deg); flex: none; font-size: 13px; }
.card.early-access p { margin: 0; }
/* Subscribe page: the Early Access notice beside a 400px sign-up box in the upper
   right; the plan cards on their own row below. */
.sub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; margin-bottom: 16px; }
.sub-layout .card { margin-bottom: 0; }
.sub-side .form { max-width: none; }
.sub-main .card.early-access { margin-bottom: 14px; }
.sub-main .tier-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sub-main > p.sub { margin-bottom: 0 !important; }
@media (max-width: 760px) { .sub-layout { grid-template-columns: minmax(0, 1fr); } .sub-side { max-width: 400px; } .sub-main .tier-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .card.early-access { flex-direction: column; align-items: flex-start; } }
.tier-card ul { margin: 0; padding-left: 18px; }
.tier-card li { margin-bottom: 6px; line-height: 1.45; }
/* the plans comparison (Subscribe and Account pages) */
table.plans th { text-align: center; vertical-align: bottom; font-size: 15px; color: var(--brand-ink); padding: 8px 10px; }
table.plans th span { display: block; font-size: 12px; font-weight: 400; color: var(--text-secondary); margin-top: 2px; }
table.plans th span.badge { display: inline-block; margin-top: 5px; font-weight: 600; }
table.plans td { text-align: center; white-space: normal; padding: 7px 10px; }
table.plans td.l { text-align: left; color: var(--text-secondary); }
table.plans .cur { background: var(--accent-soft); }
/* sub-pages of a tab (New ideas: lists | market inefficiencies) */
.subtabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--grid); }
.subtabs a {
  text-decoration: none; padding: 7px 14px; color: var(--text-secondary); border-radius: 6px 6px 0 0;
  margin-bottom: -1px; border-bottom: 2px solid transparent;
}
.subtabs a:hover { background: var(--hover); }
/* Insider/Institutional Activity: ownership bar */
.own-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface-1); margin: 4px 0 8px; }
.own-seg { display: block; height: 100%; }
.own-seg.inst, .own-key i.inst { background: var(--series-1); }
.own-seg.ins, .own-key i.ins { background: var(--brand-gold); }
.own-seg.rest, .own-key i.rest { background: var(--neutral-mark); }
.own-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-secondary); }
.own-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.own-h3 { font-size: 15px; margin: 18px 0 8px; }
.own-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .own-two { grid-template-columns: 1fr; } }
.tile .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
/* Company Financials table */
table.fin th { text-align: right; white-space: nowrap; }
table.fin th span { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-muted); }
table.fin td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.fin td.l, table.fin th.l { text-align: left; }
table.fin tr.total td { font-weight: 650; border-top: 1px solid var(--grid); }
table.fin tr.base td { background: var(--accent-soft); }
table.fin .pos { color: var(--delta-up); }
table.fin .neg { color: var(--delta-down); }
table.fin td.l, table.fin th.l { position: sticky; left: 0; background: var(--surface-1); z-index: 1; min-width: 220px; white-space: normal; }
table.fin tr.sub td.l { padding-left: 24px; color: var(--text-secondary); }
table.fin tr.sub2 td.l { padding-left: 44px; }
table.fin tr.sub td { font-size: 13px; }
table.fin tr.head td { font-weight: 650; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em;
  font-size: 11.5px; padding-top: 14px; border-bottom: 1px solid var(--grid); }
@media (max-width: 640px) { table.fin td.l, table.fin th.l { min-width: 150px; } }
.subtabs a.on { color: var(--brand-ink); font-weight: 600; border-bottom-color: var(--brand-gold); }
.badge.status-open { border-color: var(--brand-ink); color: var(--brand-ink); }
.badge.status-recognised { border-color: var(--delta-up); color: var(--delta-up); }
.badge.status-faded { color: var(--text-muted); }
.badge.trap { border-color: var(--series-2); color: var(--series-2); cursor: help; }
/* the portfolio analyzer */
.az-entry input {
  font: inherit; width: 130px; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 6px; padding: 4px 8px;
}
.az-entry input[data-f="shares"] { text-align: right; }
.az-entry input[data-f="t"] { text-transform: uppercase; }
.az-entry tbody tr { border-bottom: 0; }
.az-entry { max-height: 340px; overflow: auto; }
.badge.review { background: var(--accent-soft); border-color: var(--brand-gold); color: var(--brand-gold-text); }
.az-idea { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.az-idea h3 { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.az-idea h3 a { text-decoration: none; border-bottom: 1px solid var(--axis); }
.az-idea h3 .muted { font-weight: 400; font-size: 12.5px; margin-left: 8px; }
/* the formula form */
code { font: 12.5px/1.4 Consolas, "Cascadia Mono", ui-monospace, monospace; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
input.cf-formula {
  width: 100%; font: 14px/1.4 Consolas, "Cascadia Mono", ui-monospace, monospace; padding: 9px 11px;
  border: 1px solid var(--brand-ink); border-radius: 6px; background: var(--surface-1); color: var(--text-primary);
}
.cf-points { display: grid; gap: 6px; }
.cf-points h3.cf-section {
  margin: 10px 0 2px; padding-bottom: 4px; font-size: 11px; font-weight: 650; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--brand-ink); border-bottom: 1px solid var(--brand-ink);
}
.cf-points h3.cf-section:first-child { margin-top: 0; }
.cf-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; }
.cf-row > span { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
@media (max-width: 700px) { .cf-row { grid-template-columns: 1fr; } }
.chip {
  font: 12px/1.3 Consolas, "Cascadia Mono", ui-monospace, monospace; cursor: pointer; margin: 0 5px 5px 0;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--axis); background: transparent; color: var(--text-primary);
}
.chip:hover { background: var(--brand-navy); color: var(--brand-on-navy); border-color: var(--brand-navy); }

/* Text pages (About) */
.prose { }
.prose p { margin: 0 0 10px; line-height: 1.6; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin-bottom: 8px; }
.prose .grid2 { margin-bottom: 16px; }
.btn { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--axis); background: var(--surface-1); color: var(--text-primary); }
.btn:disabled { color: var(--text-muted); cursor: not-allowed; }

.meter { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--grid); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--series-1); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 24px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--grid); }
.kv div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-secondary); }
.kv span:last-child { font-variant-numeric: tabular-nums; }
ul.notes { margin: 0; padding-left: 18px; color: var(--text-secondary); }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 8px; padding: 8px 10px; font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14); max-width: 280px;
}
.tooltip .tt-title { font-weight: 650; margin-bottom: 3px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-secondary); }
.tooltip .tt-row b { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.error { color: var(--delta-down); padding: 30px; }
.back { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--text-primary); }

/* Recent news on the company page */
table.news td { white-space: normal; padding: 7px 8px; vertical-align: top; }
table.news td:first-child, table.news td:last-child { white-space: nowrap; }
table.news td.headline a { text-decoration: none; font-weight: 600; color: var(--brand-ink); }
table.news td.headline a:hover { text-decoration: underline; }

/* Lab (admins only) */
.lab-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .lab-grid { grid-template-columns: 1fr; } }
.lab-row { display: grid; grid-template-columns: 1fr 120px 44px; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.lab-row input[type=range] { width: 100%; accent-color: var(--brand-navy); }
.lab-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.lab-h3 { font-size: 13px; margin: 10px 0 2px; color: var(--text-secondary); font-weight: 650; }
.lab-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Users (admins only) */
.um-actions { white-space: nowrap; }
.um-actions .btn { padding: 3px 9px; font-size: 12px; margin-right: 4px; }
.btn.danger { color: var(--delta-down); }
.badge.ok { background: rgba(46, 125, 50, 0.12); color: var(--text-primary); }
.badge.off { background: var(--hover); color: var(--text-muted); }
.ok-msg { color: var(--text-secondary); }

/* SEC filing red flags */
.red-flag { color: var(--delta-down); font-weight: 700; cursor: help; }
.flag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.badge.red-badge { color: var(--delta-down); border-color: var(--delta-down); text-decoration: none; font-weight: 600; }

/* Economy */
.econ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.econ-tile { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 4px; border-top: 3px solid var(--brand-navy); }
.econ-tile .label { color: var(--text-secondary); font-size: 12px; }
.econ-tile .value { font-size: 26px; font-weight: 650; line-height: 1.2; }
.econ-tile .deltas { font-size: 12px; color: var(--text-secondary); }
.econ-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.econ-chart { margin-top: 6px; }
.econ-cal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; }
.econ-cal li { padding: 5px 0; border-top: 1px solid var(--border); font-size: 13px; }
.econ-cal .when { display: inline-block; min-width: 150px; font-weight: 600; color: var(--brand-ink); }

/* Formula preview (custom screen) */
.cf-preview { border: 1px solid var(--border); border-left: 3px solid var(--brand-gold); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.cf-preview-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.cf-preview-head input { width: 84px; text-transform: uppercase; font: inherit; padding: 4px 8px; border: 1px solid var(--axis); border-radius: 6px; background: var(--surface-1); color: var(--text-primary); }
.cf-ptable { width: auto; }
.cf-ptable td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* TradingView price chart (config.PRICE_WIDGET) */
.tv-box { height: 340px; }

/* Prices withheld until licensed (config.NO_EXTERNAL_PRICES) */
.unlic { filter: blur(3.5px); user-select: none; cursor: help; color: var(--text-primary); }
.unlic:hover { filter: blur(3px); }
.unlic-chart { height: 150px; display: flex; align-items: center; justify-content: center; cursor: help;
  border-radius: 6px; background: repeating-linear-gradient(135deg, var(--hover) 0 8px, transparent 8px 16px); }
.unlic-chart .unlic { font-size: 20px; font-weight: 650; }
.chart text.unlic { filter: blur(3px); }

/* Pro Screen structure: buckets holding scores */
.pro-tree { display: grid; gap: 10px; }
.pro-bucket { border: 1px solid var(--grid); border-radius: 8px; padding: 10px 12px; background: var(--surface-1); }
.pro-scores { display: flex; flex-wrap: wrap; gap: 8px; }
.pro-score { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--axis); border-radius: 6px; padding: 4px 8px; }
.pro-score.on { border-color: var(--brand-gold); box-shadow: inset 0 0 0 1px var(--brand-gold); }
.pro-score input[type="number"] { width: 48px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--text-primary); cursor: pointer; font-weight: 600; }
.linkish:hover { text-decoration: underline; }


/* Earnings & Guidance */
.earn-rel { padding: 10px 0; border-bottom: 1px solid var(--grid); }
.earn-rel:last-of-type { border-bottom: 0; }
.earn-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.earn-head .links { margin-left: auto; font-size: 13px; }
table.earn { margin-top: 6px; }
table.earn td, table.earn th { padding: 4px 10px 4px 0; }
table.earn-wire td { vertical-align: top; padding: 8px 10px 8px 0; }
.earn-chip { display: inline-block; margin: 4px 10px 0 0; font-size: 13px; }
.chg-notable { margin: 6px 0 10px; padding-left: 18px; }
.chg-notable li { margin: 6px 0; }
.chg-quote { font-style: italic; font-size: 13px; margin-top: 2px; }
.chg-flag { border-color: var(--delta-down); color: var(--delta-down); }
.chg-sec { margin: 8px 0; }
.chg-sec summary { cursor: pointer; padding: 4px 0; }
.chg-p { border-left: 3px solid var(--grid); padding: 4px 0 4px 10px; margin: 8px 0; line-height: 1.5; }
.chg-added { border-left-color: var(--brand-navy); }
.chg-removed { border-left-color: var(--axis); color: var(--text-muted); text-decoration: line-through; }
.chg-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-right: 8px; display: inline-block; }
.chg-p ins { background: var(--accent-soft); text-decoration: none; }
.chg-p del { color: var(--text-muted); }
.earn-score { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.earn-score .big { font-size: 32px; font-weight: 700; line-height: 1; }
.nowrap { white-space: nowrap; }
table.earn-wire td { white-space: normal; }
table.earn-wire td.nowrap { white-space: nowrap; }
table.earn-wire td:nth-child(3) { min-width: 260px; }
table.earn td:first-child, table.earn td:last-child { white-space: normal; }

/* Analyst note (midas/notes.py) */
.note-list { margin: 4px 0 6px; padding-left: 20px; }
.note-list li { margin: 2px 0; }
.note-list li.t-up::marker { content: "▲  "; color: var(--delta-up); }
.note-list li.t-down::marker { content: "▼  "; color: var(--delta-down); }
.earn-rel .note-list { margin-top: 6px; }

.note-story { margin: 4px 0 6px; line-height: 1.5; }
/* X queue (admin) */
.xq { padding: 10px 0; border-bottom: 1px solid var(--grid); }
.xq:last-child { border-bottom: 0; }
.xq-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.xq-text { width: 100%; margin-top: 6px; font: inherit; box-sizing: border-box; }
.xq-post { margin: 6px 0 0; white-space: pre-wrap; }
.xq-link { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.xq-note { margin: 6px 0 0; font-size: 14px; }
.xq-act { margin-top: 6px; display: flex; gap: 6px; }
.xq-focus { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.xq-co { white-space: nowrap; font-size: 14px; }
/* Email choices on the sign-up forms */
.su-emails { border: 1px solid var(--border, #e1e0d9); border-radius: 8px; padding: 8px 12px 10px; margin: 2px 0 0; display: grid; gap: 6px; }
.su-emails legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.form .su-emails label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; }
.form .su-emails label.check input { flex: none; width: 16px; height: 16px; padding: 0; margin: 1px 0 0; }
