/* ==========================================================================
   Global Dashboard — dark operations-room theme
   ========================================================================== */

:root {
  --bg:        #0a0e14;
  --bg-2:      #0f141c;
  --panel:     #141b25;
  --panel-2:   #1a2330;
  --line:      #232f3f;
  --line-2:    #2e3d50;
  --text:      #e6edf5;
  --text-dim:  #8fa3ba;
  --text-dimr: #61748c;
  --accent:    #4cc2ff;
  --accent-2:  #7c5cff;

  --good:      #35d07f;
  --ok:        #9fd356;
  --mid:       #f2c744;
  --warn:      #f79448;
  --bad:       #ef4d5a;

  --up:        #35d07f;
  --down:      #ef4d5a;

  --radius:    10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ------------------------------------------------------ */

header.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #0d1219 0%, #0a0e14cc 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.brand .globe { font-size: 22px; }
.brand small {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-dimr);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

nav.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

nav.tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
nav.tabs button:hover { color: var(--text); background: var(--panel); }
nav.tabs button[aria-selected="true"] {
  color: #071018;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.status-cluster { display: flex; align-items: center; gap: 10px; }

.mode-line {
  width: 100%;
  font-size: 11px;
  color: var(--text-dimr);
  margin-top: -4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  background: var(--panel);
  white-space: nowrap;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dimr);
}
.pill[data-state="live"]    { color: var(--good); border-color: #1d6b4a; }
.pill[data-state="live"] .dot   { background: var(--good); box-shadow: 0 0 8px var(--good); }
.pill[data-state="loading"]     { color: var(--mid); border-color: #6b5a1d; }
.pill[data-state="loading"] .dot{ background: var(--mid); animation: blink 1s infinite; }
.pill[data-state="offline"]     { color: var(--bad); border-color: #6b1d26; }
.pill[data-state="offline"] .dot{ background: var(--bad); }

@keyframes blink { 50% { opacity: .25; } }

.btn {
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.btn:hover { background: var(--panel-2); border-color: var(--accent); }

/* ---------- layout ------------------------------------------------------ */

main {
  max-width: 1680px;
  margin: 0 auto;
  padding: 22px 20px 80px;
}

.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.section { margin-bottom: 34px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text);
}
.section-head .sub { font-size: 12.5px; color: var(--text-dimr); }
.section-head .spacer { flex: 1; }

/* ---------- KPI tiles --------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .8;
}
.kpi.human::before { background: var(--warn); }
.kpi .k-label {
  font-size: 11.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.kpi .k-value {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.kpi .k-note { font-size: 11.5px; color: var(--text-dimr); margin-top: 5px; }
.kpi .k-trend { font-size: 11.5px; color: var(--accent); margin-top: 2px; }
.kpi.human .k-trend { color: var(--warn); }

/* ---------- country code chip ------------------------------------------- */
/* Used instead of flag emoji — Windows ships no flag glyphs, so emoji flags
   degrade to bare letter pairs. A deliberate chip reads better everywhere. */

.cc {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  line-height: 1;
  padding: 4px 5px 3px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  flex: none;
}
.cc.sm { font-size: 9px; padding: 3px 4px 2px; letter-spacing: .5px; }
.cc.lg {
  font-size: 17px; padding: 9px 11px 8px; letter-spacing: 1.5px;
  color: var(--text); border-color: var(--accent);
}

/* ---------- market tiles ------------------------------------------------ */

.mkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.mkt {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 92px;
}
.mkt .m-top {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-dim);
}
.mkt .m-icon { font-size: 15px; line-height: 1; flex: none; }
.mkt .m-name {
  color: var(--text); font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mkt .m-state {
  margin-left: auto; flex: none;
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: .6px; padding: 2px 4px; border-radius: 3px;
  border: 1px solid var(--line-2); color: var(--text-dimr);
}
.mkt .m-state.open {
  color: var(--good); border-color: #1d6b4a; background: #35d07f14;
}
.mkt .m-state.closed { color: var(--text-dimr); }
.mkt .m-when {
  font-size: 10px; color: var(--text-dimr); margin-top: auto; padding-top: 3px;
}
.mkt .m-price {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-top: 2px;
}
.mkt .m-chg { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.mkt .m-unit { font-size: 11px; color: var(--text-dimr); }
.mkt.up    { border-color: #1d6b4a; }
.mkt.down  { border-color: #6b1d26; }
.up-txt   { color: var(--up); }
.down-txt { color: var(--down); }
.flat-txt { color: var(--text-dim); }
.mkt.food-staple { background: linear-gradient(180deg, #1a1d14 0%, var(--panel) 60%); }

/* ---------- country tile set -------------------------------------------- */

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.controls label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dimr);
  margin-right: 4px;
}
select, input[type="search"] {
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 9px;
  border-radius: 7px;
  outline: none;
}
select:focus, input[type="search"]:focus { border-color: var(--accent); }
input[type="search"] { min-width: 190px; }

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-dimr);
  margin-left: auto;
}
.legend .ramp {
  width: 150px; height: 9px; border-radius: 999px;
  background: linear-gradient(90deg, var(--bad), var(--warn), var(--mid), var(--ok), var(--good));
  border: 1px solid var(--line-2);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 9px;
}

.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--text-dimr);
  border-radius: var(--radius);
  padding: 10px 11px 11px;
  cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s;
  overflow: hidden;
}
.tile:hover {
  transform: translateY(-2px);
  background: var(--panel-2);
  border-top-color: var(--line-2);
  border-right-color: var(--line-2);
  border-bottom-color: var(--line-2);
}
.tile .t-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }

/* Sovereign credit rating badge. The investment-grade boundary is the line
   that matters, so it drives the color rather than the individual notch. */
.rating {
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1;
  padding: 3px 4px 2px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
  color: var(--text-dimr);
}
.rating.ig      { color: var(--good); border-color: #1d6b4a; background: #35d07f12; }
.rating.spec    { color: var(--mid);  border-color: #6b5a1d; background: #f2c74412; }
.rating.default { color: var(--bad);  border-color: #6b1d26; background: #ef4d5a12; }
.rating.none    { color: var(--text-dimr); }
.tile .t-name {
  font-size: 12.5px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .t-metric {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 2px;
}
.tile .t-metric.na { font-size: 15px; color: var(--text-dimr); font-weight: 500; }
.tile .t-sub { font-size: 10.5px; color: var(--text-dimr); margin-top: 2px; }
.tile .t-bar {
  height: 3px; border-radius: 999px; margin-top: 8px;
  background: var(--line);
  overflow: hidden;
}
.tile .t-bar span { display: block; height: 100%; border-radius: 999px; }

/* Debt always rides along on every tile, whatever metric is selected. */
.tile .t-debt {
  display: flex; align-items: baseline; gap: 5px;
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
}
.tile .td-label {
  color: var(--text-dimr); text-transform: uppercase; letter-spacing: .5px;
  font-size: 9px;
}
.tile .td-val { font-family: var(--mono); font-weight: 700; }
.tile .td-abs { margin-left: auto; color: var(--text-dimr); font-family: var(--mono); }

.empty {
  padding: 28px;
  text-align: center;
  color: var(--text-dimr);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}

/* ---------- ranked bars (poverty / food / health) ----------------------- */

.rank-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.rank-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
}
.rank-panel h3 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .4px;
}
.rank-panel .rp-sub { font-size: 11.5px; color: var(--text-dimr); margin-bottom: 12px; }

.rank-row {
  display: grid;
  grid-template-columns: 28px 1fr 66px;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  cursor: pointer;
  border-radius: 5px;
}
.rank-row:hover { background: var(--panel-2); }
.rank-row .rr-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .rr-track { height: 6px; background: var(--line); border-radius: 999px; margin-top: 3px; overflow: hidden; }
.rank-row .rr-track span { display: block; height: 100%; border-radius: 999px; }
.rank-row .rr-val {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; text-align: right;
}

/* ---------- news -------------------------------------------------------- */

.news-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}
.desk {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 620px;
}
.desk-head {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
}
.desk-head .d-icon { font-size: 17px; }
.desk-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: .3px; }
.desk-head .d-blurb { font-size: 11px; color: var(--text-dimr); }
.desk-head .d-count {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; color: var(--text-dimr);
}
.desk-body { overflow-y: auto; padding: 4px 0; }

.item {
  display: block;
  padding: 9px 15px;
  border-bottom: 1px solid #1a2330;
  color: var(--text);
  text-decoration: none;
}
.item:last-child { border-bottom: none; }
.item:hover { background: var(--panel-2); text-decoration: none; }
.item .i-title { font-size: 13px; line-height: 1.35; }
.item .i-meta {
  font-size: 10.5px; color: var(--text-dimr); margin-top: 4px;
  display: flex; gap: 8px; align-items: center;
}
.item .i-src { color: var(--accent); }

.skeleton { padding: 15px; }
.skeleton div {
  height: 11px; background: var(--panel-2); border-radius: 4px; margin-bottom: 9px;
  animation: pulse 1.4s infinite;
}
.skeleton div:nth-child(2) { width: 82%; }
.skeleton div:nth-child(3) { width: 64%; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- country detail drawer --------------------------------------- */

.drawer-backdrop {
  position: fixed; inset: 0;
  background: #05080cd9;
  backdrop-filter: blur(3px);
  z-index: 90;
  display: none;
}
.drawer-backdrop.open { display: block; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  z-index: 100;
  transform: translateX(100%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 13px;
}
.drawer-head h2 { margin: 0; font-size: 21px; font-weight: 700; }
.drawer-head .dh-sub { font-size: 12px; color: var(--text-dimr); }
.drawer-head .dh-title { min-width: 0; }
.drawer-head h2 {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer-head .close, .drawer-head .back {
  background: none; border: 1px solid var(--line-2); color: var(--text-dim);
  width: 30px; height: 30px; border-radius: 7px; cursor: pointer;
  font-size: 17px; line-height: 1; flex: none;
}
.drawer-head .close { margin-left: auto; }
.drawer-head .close:hover { color: var(--text); border-color: var(--bad); }
.drawer-head .back { font-size: 20px; }
.drawer-head .back:hover { color: var(--text); border-color: var(--accent); }
.drawer-head .back[hidden] { display: none; }

/* ---------- drill-down breadcrumb + subdivision list -------------------- */

.crumbs {
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-dimr);
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  background: var(--bg);
}
.crumbs:empty { display: none; }
.crumb { cursor: pointer; color: var(--accent); }
.crumb:hover { text-decoration: underline; }
.crumb.current { color: var(--text-dim); cursor: default; }
.crumb.current:hover { text-decoration: none; }
.crumb-sep { color: var(--text-dimr); }

.drawer-body { overflow-y: auto; padding: 18px 22px 40px; }

.drawer-body h4 { display: flex; align-items: center; gap: 10px; }
#subs-filter {
  margin-left: auto;
  font-size: 11px;
  padding: 3px 7px;
  text-transform: none;
  letter-spacing: 0;
  min-width: 0;
  width: 130px;
}
#subs-filter[hidden] { display: none; }

.sub-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.sub-row {
  display: grid;
  grid-template-columns: 1fr 74px 14px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #1a2330;
  cursor: pointer;
}
.sub-list.with-pov  .sub-row { grid-template-columns: 1fr 74px 48px 14px; }
.sub-list.with-wage .sub-row { grid-template-columns: 1fr 74px 54px 14px; }
.sub-list.with-pov.with-wage .sub-row { grid-template-columns: 1fr 70px 46px 54px 14px; }

.sr-pov, .sr-wage {
  font-family: var(--mono); font-size: 12px; font-weight: 700; text-align: right;
}
.sr-pov.dim, .sr-wage.dim { color: var(--text-dimr); font-weight: 500; }
.sr-wage { color: var(--ok); }
/* States sitting on the federal $7.25 floor read as the outlier they are. */
.sr-wage.floor { color: var(--warn); }
/* A city ordinance beating its state floor. */
.sr-wage.local { color: var(--accent); }
/* A county ordinance that only covers unincorporated areas. */
.sr-wage.partial { color: var(--accent-2); }
.sr-wage sup { font-size: 8px; vertical-align: super; margin-left: 1px; }

/* Standalone list of every local ordinance in a state. */
.sub-list.locals { max-height: 300px; }
.loc-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #1a2330;
}
.loc-row:last-child { border-bottom: none; }
.loc-row .rr-track { height: 4px; margin: 4px 0 3px; }
.loc-tag {
  font-size: 8.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--accent-2); border: 1px solid var(--line-2);
  padding: 1px 4px; border-radius: 3px; margin-left: 4px; white-space: nowrap;
}
.subs-note {
  font-size: 10.5px; color: var(--text-dimr); margin-top: 6px; text-align: right;
}
.sub-row:last-child { border-bottom: none; }
.sub-row:hover { background: var(--panel-2); }
.sub-row .sr-main { min-width: 0; }
.sub-row .sr-name {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub-row .rr-track { height: 4px; margin: 4px 0 3px; }
.sub-row .sr-note {
  font-size: 10.5px; color: var(--text-dimr);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub-row .sr-val {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  text-align: right; color: var(--text-dim);
}
.sub-row .sr-go { color: var(--text-dimr); font-size: 15px; text-align: right; }
.sub-row:hover .sr-go { color: var(--accent); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.stat .s-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-dim); margin-bottom: 4px;
}
.stat .s-value { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.stat .s-note { font-size: 10.5px; color: var(--text-dimr); margin-top: 2px; }

.drawer h4 {
  margin: 20px 0 9px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

/* ---------- footer ------------------------------------------------------ */

footer {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-dimr);
  line-height: 1.7;
}
footer strong { color: var(--text-dim); }

/* ---------- responsive -------------------------------------------------- */

@media (max-width: 720px) {
  .topbar-inner { padding: 10px 13px; gap: 10px; }
  nav.tabs { margin-left: 0; order: 3; width: 100%; }
  main { padding: 16px 13px 60px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .legend { margin-left: 0; }
}


/* Attribution line under each location-aware desk. */
.d-sources {
  padding: 10px 14px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted, #7c8794);
  border-top: 1px solid var(--line, #e2e6eb);
}

/* ---------- Market Deep Dive (TradingView widgets) ---------------------- */
.tv-block {
  background: var(--bg-2, #0f141c);
  border: 1px solid var(--line, #1e2531);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}
.tv-tape { padding: 0; }

.tv-attr { padding: 4px 8px 2px; font-size: 11px; }
.tv-attr a { color: var(--muted, #7c8794); text-decoration: none; }
.tv-attr a:hover { color: var(--accent, #4c8dff); text-decoration: underline; }

.tv-tiles {
  display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tv-tile {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  background: var(--bg-2, #0f141c); border: 1px solid var(--line, #1e2531);
  border-radius: 12px; padding: 13px 15px; color: inherit; font: inherit;
  transition: border-color .14s ease, transform .14s ease;
}
.tv-tile:hover { border-color: var(--accent, #4c8dff); transform: translateY(-2px); }
.tv-tile.on { border-color: var(--accent, #4c8dff); background: rgba(76,141,255,.09); }
.tv-tile-icon { font-size: 20px; }
.tv-tile-label { font-weight: 650; font-size: 14.5px; }
.tv-tile-blurb { font-size: 11.5px; color: var(--muted, #7c8794); }

.tv-symbolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 12px;
  background: var(--bg-2, #0f141c); border: 1px solid var(--line, #1e2531); border-radius: 12px;
}
.tv-lab { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted, #7c8794); }
.tv-current { font-weight: 680; font-size: 14px; font-variant-numeric: tabular-nums; }
.tv-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.tv-pick {
  background: transparent; border: 1px solid var(--line, #1e2531); color: var(--muted, #7c8794);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer;
}
.tv-pick:hover { border-color: var(--accent, #4c8dff); color: inherit; }
.tv-pick.on { background: var(--accent, #4c8dff); border-color: var(--accent, #4c8dff); color: #fff; }
#tv-symbol-input {
  flex: 1; min-width: 210px; background: var(--bg, #0a0e14); color: inherit;
  border: 1px solid var(--line, #1e2531); border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
#tv-symbol-input:focus { outline: 0; border-color: var(--accent, #4c8dff); }

.tv-grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .tv-grid-2 { grid-template-columns: 1fr; } }

.tv-note { font-size: 12px; color: var(--muted, #7c8794); line-height: 1.6; margin-top: 4px; }

/* ---------- Top Headlines: two columns on wide screens ------------------
   This block is full-bleed on the overview, and a single column left most of
   the width empty while pushing the list well down the page.

   Multi-column rather than a grid on purpose: the list is time-ordered, and
   columns flow top-to-bottom then wrap, so you read down the left and continue
   down the right — newspaper order. A row-major grid would zig-zag the
   chronology across the page, which reads badly for a ranked list. */
@media (min-width: 900px) {
  #top-headlines {
    columns: 2;
    column-gap: 26px;
    column-rule: 1px solid #1a2330;
  }
  #top-headlines .item {
    break-inside: avoid;      /* never split a headline across the fold */
  }
}

/* DB-IP is CC BY 4.0; attribution is a licence condition, not decoration. */
.geo-attr {
  grid-column: 1 / -1;
  font-size: 11.5px; line-height: 1.55; color: var(--muted, #7c8794);
  margin: 2px 0 6px;
}
.geo-attr a { color: var(--accent, #4c8dff); text-decoration: none; }
.geo-attr a:hover { text-decoration: underline; }
