/* Rio Dell Times Markets — TeX Gyre Schola (GFL) embed; prefer local Century Schoolbook */
@font-face {
  font-family: "TeX Gyre Schola";
  src: url("../fonts/texgyreschola-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TeX Gyre Schola";
  src: url("../fonts/texgyreschola-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TeX Gyre Schola";
  src: url("../fonts/texgyreschola-italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TeX Gyre Schola";
  src: url("../fonts/texgyreschola-bolditalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy: #000080;
  --navy-deep: #0b1f4a;
  --brick-red: #B90004;
  --panel: #000080;
  --ink: #1a1a1a;
  --muted: #d7dcf5;
  --tile-gap: 2px;
  /* Local OS Century Schoolbook first; licensed TeX Gyre Schola embed next */
  --font: "Century Schoolbook", "CenturySchoolbook", "TeX Gyre Schola", "TeXGyreSchola", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #000080 url("../img/Background-web.jpg") repeat top left;
  /* Same as Education page: body background-image (Education uses Education/Background.jpg, navy bgcolor). Web copy 1920x1280 of the original. */
  min-height: 100%;
}

.masthead {
  text-align: center;
  padding: 14px 12px 6px;
}
.masthead h1 {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 1px 1px 4px #000;
}
.masthead .tagline {
  margin: 4px 0 0;
  font-family: var(--font);
  font-style: italic;
  font-size: 15px;
  color: #f5e6b8;
  text-shadow: 1px 1px 3px #000;
}

.wrap {
  max-width: 1080px;
  margin: 8px auto 28px;
  background: var(--panel);
  border: 1px solid #333;
  padding: 16px 18px 18px;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  border-bottom: 3px solid var(--brick-red);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.bar h2 {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: 26px;
  color: var(--navy);
}
.status {
  font-family: var(--font);
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}
.status .live { color: #063; font-weight: 700; }
.status .closed { color: var(--brick-red); font-weight: 700; }
.status .warn { color: #8a4b00; font-weight: 700; }

#treemap {
  position: relative;
  width: 100%;
  height: min(62vh, 560px);
  min-height: 320px;
  background: #111;
  border: 1px solid #222;
  overflow: hidden;
}

.tile {
  position: absolute;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  border: var(--tile-gap) solid #111;
  padding: 4px;
  user-select: none;
  transition: background-color 0.35s ease;
}
.tile .sym,
.tile .chg {
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  font-family: var(--font);
}
.tile .sym {
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}
.tile .chg {
  font-weight: 400;
  line-height: 1;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}
.tile.tile-inline {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}
.tile.tile-inline .chg {
  margin-top: 0;
}
.tile.tile-sm .sym,
.tile.tile-xs .sym {
  letter-spacing: 0;
}
.tile.tile-sm,
.tile.tile-xs {
  padding: 2px;
}
.tile.nodata {
  background: #2a2a2a !important;
  color: #ccc;
}
.tile.nodata .chg { font-style: italic; }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin-top: 12px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--muted);
}
.legend-bar {
  width: 160px;
  height: 12px;
  border: 1px solid #333;
  background: linear-gradient(90deg,
    #d32f2f 0%,
    #8b0000 33%,
    #111 50%,
    #0a5c2f 67%,
    #1b9e4b 100%);
}
.credit, .meta {
  font-family: var(--font);
  font-size: 12px;
  color: #666;
  margin: 0;
}
.credit a { color: var(--navy); text-decoration: underline; }
.credit {
  overflow: visible;
  max-width: min(420px, 100%);
}

@media (max-width: 640px) {
  .wrap { padding: 10px; margin: 4px 6px 20px; }
  .bar h2 { font-size: 22px; }
  #treemap { min-height: 280px; height: 50vh; }
}

/* —— v2 analysis workspace —— */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.bar-sub { border-bottom-color: #ccc; margin-top: 18px; }
.bar-sub .hint {
  margin: 0; font-family: var(--font); font-size: 13px; color: var(--muted); font-style: italic;
}
.index-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.index-card {
  border: 1px solid #333;
  padding: 10px 12px;
  cursor: pointer;
  background: #111;
  color: #fff;
  text-align: left;
  font-family: var(--font);
  transition: filter 0.15s ease;
}
.index-card:hover, .index-card:focus-visible { filter: brightness(1.12); outline: 2px solid #f5e6b8; outline-offset: 1px; }
.index-card .ilab { font-size: 12px; opacity: 0.9; letter-spacing: 0.3px; }
.index-card .ipx { font-size: 22px; font-weight: 700; line-height: 1.15; margin-top: 2px; }
.index-card .ichg { font-size: 14px; margin-top: 2px; }
.index-card.up { background: #0a3d24; }
.index-card.down { background: #5a1010; }
.index-card.flat { background: #1a1a1a; }

.tile { cursor: pointer; }
.tile:focus-visible { outline: 2px solid #f5e6b8; outline-offset: -2px; z-index: 2; }
.tile .px {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.search-row {
  display: flex; gap: 8px; margin-top: 14px; align-items: stretch;
}
.search-row input, .compare-row input {
  flex: 1; min-width: 0;
  font-family: var(--font); font-size: 15px;
  padding: 8px 10px; border: 1px solid #333; background: #fff; color: #111;
}
.btn {
  font-family: var(--font); font-size: 14px; font-weight: 700;
  padding: 8px 14px; border: 1px solid #000080; background: #000080; color: #fff; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: #0b1f4a; }
.btn-back { background: #fff; color: #000080; }
.btn.chip {
  background: #f3f3f3; color: #222; border-color: #999; padding: 5px 10px; font-weight: 400;
}
.btn.chip.active { background: #000080; color: #fff; border-color: #000080; font-weight: 700; }
.suggest {
  list-style: none; margin: 4px 0 0; padding: 0;
  border: 1px solid #333; background: #fff; max-height: 220px; overflow: auto;
}
.suggest li button {
  display: block; width: 100%; text-align: left;
  font-family: var(--font); font-size: 14px; padding: 8px 10px;
  border: 0; border-bottom: 1px solid #eee; background: #fff; cursor: pointer;
}
.suggest li button:hover, .suggest li button:focus-visible { background: #eef2ff; }

.analyze { margin-top: 0; }
.analyze-top {
  display: flex; gap: 12px; align-items: flex-start;
  border-bottom: 3px solid var(--brick-red); padding-bottom: 8px; margin-bottom: 10px;
}
.analyze-head h2 { margin: 0; font-size: 24px; color: var(--navy); font-family: var(--font); }
.az-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-family: var(--font); }
.az-quote {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline;
  font-family: var(--font); margin-bottom: 10px;
}
.az-quote .big { font-size: 28px; font-weight: 700; }
.az-quote .chg { font-size: 18px; font-weight: 700; }
.az-quote .meta { font-size: 13px; color: var(--muted); }
.az-quote .up { color: #063; }
.az-quote .down { color: var(--brick-red); }

.az-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.ranges { display: flex; flex-wrap: wrap; gap: 4px; }
.ranges .btn.chip { padding: 4px 8px; font-size: 12px; }
.compare-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.compare-row input { flex: 1; min-width: 140px; }
.compare-msg { min-height: 1.3em; margin: 0 0 8px; font-size: 0.95rem; font-weight: 600; color: #ffd27a; }
.compare-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-sym {
  font-family: var(--font); font-size: 12px; padding: 3px 8px;
  border: 1px solid #333; background: #f7f7f7; display: inline-flex; gap: 6px; align-items: center;
}
.chip-sym button {
  border: 0; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; color: #600;
}

.chart-wrap { border: 1px solid #333; background: #0e1524; }
.chart { width: 100%; height: 340px; }
.chart-vol { height: 100px; border-top: 1px solid #243049; }
.chart-status {
  font-family: var(--font); font-size: 13px; color: var(--muted); margin: 6px 0 0; min-height: 1.2em;
}
.chart-attrib {
  font-family: var(--font); font-size: 11px; color: #777; margin: 6px 0 0;
}
.chart-attrib a { color: #000080; }

@media (max-width: 720px) {
  .index-strip { grid-template-columns: 1fr; }
  .chart { height: 280px; }
  .analyze-top { flex-direction: column; }
}

/* mobile QA targets: 375×667, 390×844, 768×1024 */
@media (max-width: 720px) {
  .search-row { flex-direction: column; }
  .search-row .btn, .btn-back, .ranges .btn.chip { min-height: 40px; }
  .az-toolbar { flex-direction: column; align-items: stretch; }
  .modes { display: flex; gap: 6px; }
  .compare-row { flex-direction: column; align-items: stretch; }
  .index-card .ipx { font-size: 20px; }
  .chart-vol { height: 88px; }
}
@media (max-width: 400px) {
  .ranges .btn.chip { padding: 6px 7px; font-size: 11px; }
  .analyze-head h2 { font-size: 20px; }
}

/* Navy content panels over Education background (picture itself not darkened) */
.wrap { color: #fff; border-color: #f5e6b8; }
.bar h2, .analyze-head h2 { color: #fff; }
.bar { border-bottom-color: #f5e6b8; }
.bar-sub { border-bottom-color: #8892c8; }
.credit, .status { color: #d7dcf5; }
.credit a, .chart-attrib a { color: #f5e6b8; }
.chart-attrib { color: #c4c9e8; }
.az-quote { color: #fff; }
.btn { border-color: #f5e6b8; }
.btn-back { background: #fff; color: #000080; }
.masthead { background: rgba(0,0,128,0.92); max-width: 1080px; margin: 10px auto 0; border: 1px solid #f5e6b8; }
#treemap { background: #000040; }
.status .closed { color: #ffb4b4; }
.az-quote .down { color: #ff9e9e; }
.analyze-top, .analyze .bar { border-bottom-color: #f5e6b8; }

/* —— t375u: full-viewport (up to 4K), AI board, stats, legend, fullscreen —— */
html, body { overflow-x: hidden; }
.wrap, .masthead { max-width: 3840px; width: auto; margin-left: max(8px, calc((100% - 3840px) / 2)); margin-right: max(8px, calc((100% - 3840px) / 2)); }
.az-quote .chg.up { color: #7dffb0; } .az-quote .chg.down { color: #ff9e9e; }
.masthead { position: relative; }
.masthead .btn-fs { position: absolute; right: 10px; top: 10px; }
.board-controls { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.cat-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-filters .btn.chip { min-height: 36px; }
.board-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #fff; font-family: var(--font); }
.board-tools input, .board-tools select { min-height: 36px; padding: 6px 8px; font-family: var(--font); font-size: 15px; max-width: 100%; }
.board-tools input { flex: 1 1 220px; }
.board-status { margin: 0; font-size: 13px; color: #d7dcf5; font-family: var(--font); }
.ai-board .cat h3 { color: #f5e6b8; font-family: var(--font); font-size: clamp(16px, 1vw + 8px, 26px); margin: 14px 0 6px; border-bottom: 1px solid #8892c8; padding-bottom: 3px; }
.card-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(clamp(128px, 8.5vw, 260px), 1fr)); }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: clamp(84px, 6vw, 150px); padding: 8px 10px;
  border: 1px solid #222; color: #fff; text-align: left; cursor: pointer; font-family: var(--font); background: #1a1a1a; overflow: hidden; }
.card:hover, .card:focus-visible { outline: 3px solid #f5e6b8; outline-offset: 1px; filter: brightness(1.1); }
.card.nodata { background: #2a2a2a; color: #ccc; }
.card .c-sym { font-weight: 700; font-size: clamp(17px, 0.9vw + 8px, 30px); line-height: 1.1; }
.card .c-name { font-size: clamp(11px, 0.4vw + 6px, 17px); opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card .c-px { font-size: clamp(14px, 0.6vw + 7px, 24px); margin-top: auto; }
.card .c-chg { font-size: clamp(13px, 0.5vw + 7px, 22px); }
.empty { color: #fff; font-family: var(--font); }
.scope-note { color: #d7dcf5; font-size: 12px; font-family: var(--font); margin: 10px 0 0; }
.chart { height: clamp(300px, 58vh, 1500px); }
.chart-vol { height: clamp(80px, 12vh, 320px); }
.chart-legend { min-height: 1.5em; font-family: var(--font); font-size: clamp(13px, 0.5vw + 8px, 20px); color: #fff; padding: 4px 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.chart-legend .lg-sym { font-weight: 700; }
.stats-h { color: #f5e6b8; font-family: var(--font); margin: 14px 0 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 0; }
.stats div { background: #0b1f4a; border: 1px solid #31405f; padding: 6px 8px; }
.stats dt { font-size: 12px; color: #c4c9e8; font-family: var(--font); }
.stats dd { margin: 2px 0 0; color: #fff; font-family: var(--font); font-size: 16px; }
.stats .na, .muted { color: #aab0d0; font-style: italic; }
.muted { font-size: 12px; font-family: var(--font); }
.az-quote .big, .az-quote .chg, .az-quote .meta { color: #fff; }
body.pseudo-fs .masthead { display: none; }
body.pseudo-fs .wrap { margin: 0; width: 100vw; max-width: 100vw; min-height: 100vh; }
:fullscreen body .wrap, body:fullscreen .wrap { margin: 0 auto; }
@media (max-width: 720px) {
  .masthead .btn-fs { position: static; margin-top: 6px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-height: 76px; }
  .chart { height: clamp(260px, 50vh, 460px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap, .masthead { margin-left: 4px; margin-right: 4px; }
  .wrap { padding: 8px; }
  .analyze-top .btn-fs { align-self: flex-start; }
}

/* Top 10 movers heat map in the Technology section */
#movers-wrap #treemap { height: clamp(300px, 52vh, 1300px); min-height: 300px; }
@media (max-width: 720px) { #movers-wrap #treemap { height: clamp(360px, 70vh, 620px); } }

/* phones: Top 10 as ranked readable cards */
#treemap.movers-list { height: auto !important; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; }
.mv-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 64px; padding: 6px 8px 6px 26px;
  border: 1px solid #222; color: #fff; font-family: var(--font); text-align: left; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.mv-card:focus-visible, .mv-card:hover { outline: 3px solid #f5e6b8; outline-offset: 1px; }
.mv-rank { position: absolute; left: 7px; top: 6px; font-size: 13px; opacity: .85; }
.mv-sym { font-weight: 700; font-size: 18px; }
.mv-px { font-size: 15px; }
.mv-chg { font-size: 15px; font-weight: 700; }

/* t380u: all 96 colored cards by default (same gain/loss palette as the heat map) */
.card { min-height: max(84px, clamp(84px, 6vw, 150px)); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.card .c-sym { font-size: max(17px, clamp(17px, 0.9vw + 8px, 30px)); }
.card .c-px, .card .c-chg { font-size: max(15px, clamp(15px, 0.6vw + 7px, 24px)); }
.card .c-chg { font-weight: 700; }
@media (max-width: 420px) { .card { min-height: 76px; padding: 6px 8px; } .card .c-name { font-size: 12px; } }

/* —— company profile: website link + info hovercard —— */
.analyze-head { position: relative; }
.az-profile-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-family: var(--font); }
.az-site { font-size: 14px; color: #e8eefc; }
.az-site a { color: #ffd27a; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }
.az-site a:hover, .az-site a:focus-visible { color: #fff; }
.az-site .muted-status { color: #c9d3ea; font-style: italic; }
.az-info-btn { min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: 22px; border: 1px solid #ffd27a; background: transparent; color: #ffd27a; font: 600 14px var(--font); cursor: pointer; }
.az-info-btn:hover, .az-info-btn:focus-visible, .az-info-btn[aria-expanded="true"] { background: #ffd27a; color: #0b1f44; outline: none; }
.az-info-btn:focus-visible { box-shadow: 0 0 0 3px #fff; }
.az-info { position: absolute; z-index: 60; left: 0; top: 100%; width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto;
  background: #0b1f44; color: #f3f6fd; border: 1px solid #ffd27a; border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font: 14px/1.45 var(--font); }
.az-info h3 { margin: 0 0 6px; font-size: 16px; color: #ffd27a; }
.az-info p { margin: 0 0 8px; }
.az-info dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; margin: 0 0 8px; }
.az-info dt { color: #c9d3ea; } .az-info dd { margin: 0; }
.az-info .nv { color: #c9d3ea; font-style: italic; }
.az-info .src { font-size: 12px; color: #c9d3ea; margin: 6px 0 0; padding-left: 16px; }
.az-info .src a { color: #ffd27a; word-break: break-word; }
@media (max-width: 600px) { .az-info { position: fixed; left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-height: 60vh; } }
.az-info-close { float: right; min-height: 44px; min-width: 64px; margin: -6px -6px 4px 8px; border: 1px solid #ffd27a; border-radius: 22px; background: transparent; color: #ffd27a; font: 600 14px var(--font); cursor: pointer; }
.az-info-close:hover, .az-info-close:focus-visible { background: #ffd27a; color: #0b1f44; outline: none; }


/* After-hours / pre-market figures (cards, index strip, detail). Century Schoolbook via --font. */
.card.has-ah { min-height: max(108px, clamp(108px, 7.5vw, 186px)); }
.card .c-ah, .index-card .c-ah, .az-ah .c-ah {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  font-family: var(--font);
  font-size: clamp(10px, 0.35vw + 8px, 15px);
  line-height: 1.3;
  margin-top: 3px;
  max-width: 100%;
}
.card .c-ah-lab, .index-card .c-ah-lab, .az-ah .c-ah-lab { font-weight: 700; }
.card .c-ah-asof, .index-card .c-ah-asof, .az-ah .c-ah-asof {
  flex-basis: 100%;
  opacity: 0.92;
  font-size: 0.95em;
  overflow: visible;
}
.card .c-ah-chg.up, .index-card .c-ah-chg.up, .az-ah .c-ah-chg.up { color: #7dffb0; }
.card .c-ah-chg.down, .index-card .c-ah-chg.down, .az-ah .c-ah-chg.down { color: #ffc4c4; }
.card .c-ah-none, .index-card .c-ah-none, .az-ah .c-ah-none {
  display: block;
  font-family: var(--font);
  font-size: clamp(10px, 0.35vw + 8px, 14px);
  margin-top: 3px;
  opacity: 0.88;
  font-style: italic;
}
.index-card .iah { margin-top: 2px; }
.az-quote .az-ah {
  display: block;
  margin-top: 8px;
  font-family: var(--font);
}
.az-quote .az-ah .c-ah {
  font-size: clamp(15px, 0.5vw + 10px, 20px);
  gap: 0 10px;
}
.az-quote .az-ah .c-ah-asof { font-size: 14px; color: #d7dcf5; }
.az-quote .az-ah .c-ah-none { font-size: 15px; font-style: italic; color: #d7dcf5; }

@media (max-width: 720px) {
  .card.has-ah { min-height: 108px; }
  .index-card .c-ah { font-size: 11px; }
  .index-card { min-height: 96px; }
}
@media (max-width: 420px) {
  .card.has-ah { min-height: 102px; padding: 6px 8px; }
  .card .c-ah { font-size: 11px; }
}
@media (max-width: 360px) {
  .card.has-ah { min-height: 100px; }
  .card .c-ah { font-size: 10px; }
}
