/* Styles for the extra commands (WORLD, MOVERS, HEATMAP, ...). Same tokens as style.css. */

:root {
  --ln-0: var(--accent);
  --ln-1: hsl(262, 85%, 78%);
  --ln-2: hsl(328, 80%, 72%);
  --ln-3: hsl(168, 62%, 56%);
  --ln-4: var(--text-2);
}

/* ---- Layout ----------------------------------------------------------- */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-wide { grid-column: 1 / -1; }
.pad { padding: 8px 10px; }
.more { padding: 6px 10px; font-size: 12px; }

/* ---- Shared cells ----------------------------------------------------- */
.tk { color: var(--accent); font-weight: 600; }
.tk-name { color: var(--dim); margin-left: 6px; }
.cc { margin-left: 4px; color: var(--dim); font-size: 11px; }
.grid-table .name a:hover .tk, .grid-table .row-link:hover .tk { color: var(--text); }
.movers-table .vol { color: var(--text-2); }
.st { width: 1%; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.st-open { color: var(--up); }
.st-lunch { color: var(--text-2); }
.st-closed { color: var(--dim); }
/* On phones the status is a coloured dot (legend under the panels), so names keep room. */
.st-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-legend { display: none; }
.delayed { padding: 0 5px; border: 1px solid var(--rule-strong); color: var(--text-2); font-weight: 600; letter-spacing: .08em; }
.contract { margin-left: 6px; font-size: 11px; }
.unit { font-size: 12px; }
.bar-cell { width: 1%; }
.grid-table td.bar-cell { padding-right: 16px; }

.pbar { display: block; width: 160px; height: 8px; }
.tbar { display: inline-block; margin-right: 16px; vertical-align: middle; }
.pbar-mid { fill: var(--rule-strong); }
.pbar-v.up { fill: var(--up); }
.pbar-v.down { fill: var(--down); }
.pbar-level { fill: var(--accent); opacity: .75; }

/* ---- SECTORS: rows that open to their S&P 100 members, and the map (screens/sectors.js) ---- */
.sc-body { display: flex; flex-direction: column; }
.sc-body > .toolbar { flex: 0 0 auto; }
.sc-host { position: relative; min-height: 120px; }
.sc-host > .loading, .sc-host > .panel-msg { padding: 8px 10px; }
.sc-scroll { overflow-x: auto; }
.sc-table { width: auto; min-width: 560px; }
.sc-table .sc-sym { width: 84px; font-weight: 600; }
.sc-table .sc-sym a { color: var(--accent); }
.sc-caret { display: inline-block; width: 14px; color: var(--dim); font-weight: 400; }
.sc-table .sc-name { width: 240px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.sc-table .sc-move { width: 76px; }
.sc-table td.sc-bar { width: 96px; padding: 0 4px 0 12px; }
.sc-table .sc-bar .pbar { width: 96px; }
.sc-table .sc-x { width: 84px; font-size: 11px; color: var(--dim); }
.sc-table .sc-x.up { color: var(--up); }
.sc-table .sc-x.down { color: var(--down); }
.sc-row { cursor: pointer; }
.sc-table tr:focus, .sc-tree tr:focus { outline: 0; background: var(--panel-3); box-shadow: inset 2px 0 0 var(--accent); }
.sc-tree .bb-in { padding-left: 24px; }
.sc-tree .bb-in a { color: var(--text); }
.sc-tree .sc-x { font-size: 11px; color: var(--dim); }
.sc-tree .sc-who td { padding-left: 24px; }
.sc-row.is-open { background: var(--panel-2); }
.sc-mem .sc-sym { padding-left: 24px; font-weight: 400; }
.sc-mem .sc-sym a { color: var(--text); }
.sc-table tr.sc-who { border-bottom: 0; }
.sc-who td { height: 20px; padding-left: 24px; font-size: 11px; color: var(--dim); }
.sc-swim { margin-left: 12px; letter-spacing: .08em; }
.sc-host.is-map { overflow: hidden; }
.sc-map { outline: 0; }
.sc-msec { cursor: pointer; }
.sc-mcur { fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 3 3; pointer-events: none; }
.sc-map:focus .sc-mcur { stroke: var(--accent); stroke-width: 2; stroke-dasharray: none; }
.sc-host.is-split { display: flex; flex-direction: column; overflow: hidden; }
.sc-split { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); }
.sc-split > .sc-scroll { min-height: 0; overflow: auto; border-right: 1px solid var(--rule-strong); }
.sc-split .sc-table { width: 100%; min-width: 0; }
.sc-split .sc-table .sc-name { width: auto; max-width: 0; }
.sc-side { position: relative; min-width: 0; min-height: 0; overflow: hidden; cursor: pointer; }
.sc-side .sc-mcur { stroke: var(--accent); stroke-width: 2; stroke-dasharray: none; }
@media (max-width: 1279px) { .sc-split { display: block; } .sc-side { display: none; } }
@media (min-width: 1100px) {
  html:not(.is-embed) .view > .panel > .panel-body.sc-body { overflow: hidden; scrollbar-gutter: auto; }
  html:not(.is-embed) .sc-host { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-gutter: stable; }
  html:not(.is-embed) .sc-host.is-map, html:not(.is-embed) .sc-host.is-split { overflow: hidden; scrollbar-gutter: auto; }
}
@media (max-width: 639px) {
  .sc-table { min-width: 0; width: 100%; }
  .sc-table .sc-name { width: auto; max-width: 0; }
  .sc-table td.sc-bar { display: none; }
  .sc-table .sc-sym { width: 64px; }
}

/* ---- Multi-line charts ------------------------------------------------ */
.ln { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.ln.ln-0 { stroke: var(--ln-0); }
.ln.ln-1 { stroke: var(--ln-1); }
.ln.ln-2 { stroke: var(--ln-2); }
.ln.ln-3 { stroke: var(--ln-3); }
.ln.ln-4 { stroke: var(--ln-4); stroke-dasharray: 4 3; }
.ln-tag-bg.ln-0, .ln-dot.ln-0 { fill: var(--ln-0); }
.ln-tag-bg.ln-1, .ln-dot.ln-1 { fill: var(--ln-1); }
.ln-tag-bg.ln-2, .ln-dot.ln-2 { fill: var(--ln-2); }
.ln-tag-bg.ln-3, .ln-dot.ln-3 { fill: var(--ln-3); }
.ln-tag-bg.ln-4, .ln-dot.ln-4 { fill: var(--ln-4); }
.ln-tag { fill: var(--ink); font-family: var(--font); font-size: 11px; font-weight: 600; }
.ln-zero { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; shape-rendering: crispEdges; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 6px 10px 8px; border-top: 1px solid var(--rule); font-size: 12px; }
.legend li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sw { display: inline-block; width: 12px; height: 3px; flex: 0 0 auto; }
/* EARNINGS day pills sit above the panels; on phones they scroll with an edge fade. */
.er-bar { margin-bottom: 8px; border: 1px solid var(--rule-strong); }
.er-bar .toolbar { border-bottom: 0; flex-wrap: nowrap; }
.er-bar .toolbar-main { flex-wrap: nowrap; }

/* COMPARE: ticker chips (press to remove) and the add field. */
.cp-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.cp-chip { gap: 6px; color: var(--text); }
.cp-chip.is-fixed { border-color: var(--rule); }
.cp-x { color: var(--dim); font-size: 13px; }
.cp-chip:hover .cp-x { color: var(--down); }
.cp-add { display: inline-flex; align-items: center; gap: 4px; }
.cp-full { font-size: 11px; letter-spacing: .06em; }
.cp-bar { padding: 4px 8px; }
.field-input {
  height: 22px; width: 14ch; padding: 0 6px;
  border: 1px solid var(--rule-strong); background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.field-input:focus { outline: 0; border-color: var(--accent); }
/* FX converter row */
.fx-out { padding: 8px 10px; }
.fx-form { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.fx-form .fx-amt { width: 16ch; text-align: right; }
.fx-form .fx-code { width: 5ch; text-align: center; }
.fx-form .fx-year { width: 7ch; text-align: center; }
.field-input::placeholder { color: var(--dim); }
.sw.ln-0 { background: var(--ln-0); }
.sw.ln-1 { background: var(--ln-1); }
.sw.ln-2 { background: var(--ln-2); }
.sw.ln-3 { background: var(--ln-3); }
.sw.ln-4 { background: var(--ln-4); }
.lg-tk { font-weight: 600; }
.lg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.lg-v.ln-0 { color: var(--ln-0); }
.lg-v.ln-1 { color: var(--ln-1); }
.lg-v.ln-2 { color: var(--ln-2); }

/* ---- HEATMAP ---------------------------------------------------------- */
.hm-host { position: relative; min-height: 200px; }
.hm-host > .loading, .hm-host > .panel-msg { padding: 8px 10px; }
.heatmap { display: block; }
.hm-sec { fill: var(--panel); stroke: var(--bg); stroke-width: 2; }
.hm-sec-t { fill: var(--text-2); font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.hm-cell { stroke: var(--bg); stroke-width: 1; }
.hm-a:hover .hm-cell, .hm-a:focus .hm-cell { stroke: var(--text); stroke-width: 1.5; }
.hm-a:focus { outline: 0; }
.hm-t { fill: var(--text); font-family: var(--font); font-weight: 600; pointer-events: none; }
.hm-p { fill: var(--text); opacity: .85; font-family: var(--font); pointer-events: none; }
.hm-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.hm-foot .footnote { margin: 0; }
.hm-scale { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--dim); }
.hm-sw { width: 18px; height: 10px; }
.hm-scale span { margin-right: 6px; }

/* ---- CLOCK ------------------------------------------------------------ */
.clock-table .secs { font-weight: 400; }
.clock-table .next { color: var(--text-2); }
.ex-name { color: var(--text); font-weight: 600; }
.daybar { display: block; width: 240px; height: 10px; }
.db-track { fill: var(--rule-strong); }
.db-on { fill: var(--accent); opacity: .45; }
.db-now { fill: var(--text); }
.db-tick { fill: var(--rule-strong); }
.db-scale { display: flex; justify-content: space-between; width: 240px; }
.db-scale span { width: 0; display: flex; justify-content: center; }
.db-scale span:first-child { justify-content: flex-start; }
.db-scale span:last-child { justify-content: flex-end; }
.nb { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.nb dt { color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; line-height: 19px; }
.nb dd { margin: 0; color: var(--text-2); }
.nb-in { margin-left: 8px; color: var(--text); }

/* ---- FXMATRIX --------------------------------------------------------- */
.fxm-wrap { overflow-x: auto; }
.fxm th, .fxm td { text-align: right; }
.fxm .fxm-corner { text-align: left; }
.fxm .fxm-row { color: var(--text); font-weight: 600; text-align: left; }
.fxm td { border-left: 1px solid var(--rule); }
.fxm-cell { color: var(--text); }
.fxm-cell:hover { color: var(--accent); text-decoration: none; }
.fxm-arr { display: inline-block; width: 10px; margin-left: 3px; font-size: 7px; vertical-align: 2px; text-align: right; }
.fxm-arr.up { color: var(--up); }
.fxm-arr.down { color: var(--down); }
/* The currency column stays put while the rates scroll sideways. */
.fxm .fxm-row, .fxm .fxm-corner { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: inset -1px 0 0 var(--rule-strong); }
.fxm thead .fxm-corner { background: var(--bg); }
.fxm-self { color: var(--faint); }
.fxm td.fxm-self { padding-right: 23px; }

/* ---- EARNINGS and CALENDAR -------------------------------------------- */
.when { font-size: 11px; letter-spacing: .06em; color: var(--text-2); }
.cal-time { width: 1%; }
.cal-cty { width: 1%; color: var(--text-2); }
.cal-imp { width: 1%; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.imp-high { color: var(--accent); }
.imp-med { color: var(--text-2); }
.imp-low { color: var(--dim); }
.cal-body > .loading, .cal-body > .panel-msg { padding: 8px 10px; }
.imp-hol { color: var(--text-2); }
.calendar-table .cal-title { color: var(--text); }
.calendar-table .cal-short { display: none; }
.calendar-table tr.is-past td, .calendar-table tr.is-past th { opacity: .55; }

/* ---- Company screens -------------------------------------------------- */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 24px; padding: 2px 0 6px; }
.profile-name { margin: 2px 0 8px; font-size: 24px; font-weight: 600; line-height: 1.2; }
.profile-desc { max-width: 78ch; color: var(--text-2); line-height: 1.6; }
.profile-web { margin-top: 10px; }
.hist-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--rule-strong); font-size: 11px; letter-spacing: .06em; }
.btn {
  height: 22px; padding: 0 10px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .1em; cursor: pointer;
}
.btn:hover { background: var(--accent); color: var(--ink); }
.dv-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 24px; }
.dv-stats { margin-top: 12px; max-width: 420px; }
.dv-years { border: 1px solid var(--rule); }
.dv-note { margin-top: 10px; font-size: 12px; }
.dv-chart-head { margin-top: 14px; font-size: 11px; color: var(--text-2); letter-spacing: .04em; }
.dv-chart-host { position: relative; height: 150px; max-width: 520px; margin-top: 4px; }
.dv-bar { fill: var(--series-1); }
.dv-bar.is-part { fill-opacity: .45; }
/* NEWS <T>: the source in the same slot as NEWS (second), wider for full names. */
.tnews-row { grid-template-columns: 48px 16ch minmax(0, 1fr); }
.tnews-src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money { padding: 2px 0 6px; }

/* ---- Narrower screens ------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .profile, .dv-top { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

@media (max-width: 639px) {
  .tk-name { display: none; }
  .sectors-table .tk { display: none; }
  .sectors-table .tk-name { display: inline; margin-left: 0; color: var(--text-2); }
  .bar-cell, .tbar { display: none; }
  .unit { display: none; }
  .contract { display: none; }
  .st { font-size: 10px; }
  .world-table .st { text-align: center; }
  .world-table .st-dot { display: inline-block; }
  .world-table .st-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .st-legend { display: flex; gap: 16px; }
  .st-legend > span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .08em; }
  .st-legend .st-dot { display: inline-block; }
  .clock-table .secs, .ex-city { display: none; }
  .fxm { font-size: 11px; }
  .fxm th, .fxm td { padding: 0 6px; }
  .cal-imp { display: none; }
  /* Phones: event names wrap, short column heads, no sideways scroll. */
  .calendar-table .cal-title { max-width: 0; width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; padding-top: 3px; padding-bottom: 3px; }
  .calendar-table th, .calendar-table td { padding: 0 6px; }
  .calendar-table .cal-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .calendar-table .cal-short { display: inline; }
  .earnings-table .when { font-size: 10px; }
  .legend { gap: 4px 12px; }
  .lg-name { display: none; }
  .hm-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tnews-row { grid-template-columns: 44px minmax(0, 1fr); }
  .tnews-src { display: none; }
  .profile-name { font-size: 20px; }
  .hist-bar { flex-wrap: wrap; }
}

/* ---- Company data (INSIDERS, OWNERS, FILINGS, SHORTS, BEATS, VALUE, IPOS, SPLITS, EXDIV) ---- */
.co-pad { padding: 8px 10px; }
.co-source { margin-top: 6px; }
.grid-table .co-n { width: 1%; padding-right: 0; color: var(--faint); }
.grid-table .co-date { width: 1%; color: var(--text-2); }
.grid-table .co-form { width: 1%; font-weight: 600; }
.grid-table .co-kind { width: 1%; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.grid-table .co-kind.dim { color: var(--dim); }
.grid-table .co-title { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.co-table .name { color: var(--text-2); }
/* Capped on wide screens, so a label and its numbers do not drift apart. */
.sp-table, .xd-table, .ipo-table, .calendar-table, .earnings-table { max-width: 960px; }
.fil-table .name a { color: var(--text-2); }
.fil-table .name a:hover { color: var(--accent); text-decoration: none; }
.co-totals { max-width: 720px; border-right: 1px solid var(--rule); }
.co-totals .name, .co-pos .name { width: auto; max-width: none; color: var(--dim); }
.co-totals .last { color: var(--text); font-weight: 600; }
.co-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.co-chips { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); background: var(--panel); }
.co-chips::-webkit-scrollbar { display: none; }
.co-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-right: 1px solid var(--rule); color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.co-chip:hover { text-decoration: none; color: var(--text); background: var(--panel-3); }
.co-chip.is-active { color: var(--ink); background: var(--text-2); }
.co-count { color: var(--faint); font-weight: 400; }
.co-chip.is-active .co-count { color: var(--ink); }
.co-noname { color: var(--text-2); }
@media (max-width: 639px) { .tk-name.co-noname { display: inline; } }
.co-title-line { margin-bottom: 10px; }
.co-group { margin: 0 0 4px; color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.co-groups { display: grid; gap: 12px 24px; }
.co-when { margin-left: 8px; font-size: 11px; }

@media (max-width: 1100px) {
  .co-split { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

@media (max-width: 639px) {
  .grid-table .co-n { display: none; }
  .grid-table .co-date { font-size: 11px; }
  .co-when { display: none; }
  .co-table .name { max-width: 0; }
}

/* ---- BBRK: our own site numbers for sponsors, drawn like a quote (screens/bbrk.js) ---- */
.bb-panel > .panel-body { padding: 10px 12px; }
.bb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.bb-globe { margin: 0; text-align: center; font-size: 11px; }
.bb-globe canvas { display: block; width: 100%; aspect-ratio: 1; --globe-land: hsla(201, 100%, 71%, .38); --globe-hot: var(--text); --globe-rim: hsla(201, 100%, 71%, .22); }
.bb-globe figcaption { margin-top: 4px; letter-spacing: .04em; }
@media (max-width: 900px) { .bb-grid { grid-template-columns: minmax(0, 1fr); } .bb-globe { width: min(240px, 100%); margin: 0 auto; } }
.bb-spark { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; font-size: 11px; }
.bb-tops { display: grid; gap: 4px; margin-top: 14px; max-width: 760px; }
.bb-tops > div { display: grid; grid-template-columns: 11ch minmax(0, 1fr); gap: 12px; }
.bb-tops dt { color: var(--dim); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.bb-tops dd { color: var(--text-2); overflow-wrap: anywhere; }
.bb-panel .bb-table { margin-top: 12px; max-width: 760px; }
.bb-table th[scope="row"] { text-align: left; font-weight: 400; color: var(--text-2); }
.bb-src { margin-top: 10px; }
@media (max-width: 639px) {
  .bb-spark .spark { width: 160px; }
  .bb-panel .bb-table { table-layout: fixed; }
  .bb-table th, .bb-table td { padding-left: 4px; padding-right: 4px; font-size: 11px; }
  .bb-table thead th:first-child { width: 55%; }
}
