/* =========================================================================
   CyberSec Pulse — terminal-style equities monitor
   Flat surfaces, hairline rules, tabular figures, restrained amber accent.
   ========================================================================= */

:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #111418;
  --raised: #171b21;
  --hover: #1d222a;
  --line: #232831;
  --line-strong: #323945;

  --text: #d9dee5;
  --text-2: #9aa3af;
  --text-3: #6b7480;

  --accent: #d9a03f;
  --accent-hover: #e7b154;
  --accent-link-hover: #f0bd63;
  --accent-dim: rgba(217, 160, 63, 0.14);
  --accent-ink: #f3dcb0;
  --accent-on: #15120b;
  --active-bg: #262c35;
  --active-text: #ffffff;

  --up: #4cbb6c;
  --down: #e5605a;
  --legend: linear-gradient(90deg, #d0453f 0%, #b23b3b 25%, #3a3f4a 50%, #2f7d4a 75%, #30a05a 100%);

  --notice-border: rgba(217, 160, 63, 0.45);
  --notice-bg: rgba(217, 160, 63, 0.07);
  --notice-text: #e9d3a6;
  --notice-err-border: rgba(229, 96, 90, 0.5);
  --notice-err-bg: rgba(229, 96, 90, 0.07);
  --notice-err-text: #f2c2bf;

  --overlay-bg: rgba(0, 0, 0, 0.55);
  --shadow-drawer: -12px 0 32px rgba(0, 0, 0, 0.45);
  --shadow-sheet: 0 -12px 32px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55);
  --tv-bg: #0e1115;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --r: 3px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --raised: #f6f8fa;
  --hover: #ebeff4;
  --line: #dce2ea;
  --line-strong: #c2ccd8;

  --text: #141923;
  --text-2: #4b5563;
  --text-3: #647082;

  --accent: #b47412;
  --accent-hover: #9a620d;
  --accent-link-hover: #8a5609;
  --accent-dim: rgba(180, 116, 18, 0.12);
  --accent-ink: #7c4b07;
  --accent-on: #ffffff;
  --active-bg: #e8edf4;
  --active-text: #111827;

  --up: #15803d;
  --down: #c93330;
  --legend: linear-gradient(90deg, #cf3c37 0%, #dc6a64 25%, #8b95a5 50%, #3a9659 75%, #1d8348 100%);

  --notice-border: rgba(180, 116, 18, 0.45);
  --notice-bg: rgba(180, 116, 18, 0.08);
  --notice-text: #7c4b07;
  --notice-err-border: rgba(201, 51, 48, 0.45);
  --notice-err-bg: rgba(201, 51, 48, 0.07);
  --notice-err-text: #991b1b;

  --overlay-bg: rgba(15, 23, 42, 0.35);
  --shadow-drawer: -12px 0 32px rgba(15, 23, 42, 0.14);
  --shadow-sheet: 0 -12px 32px rgba(15, 23, 42, 0.16);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.16);
  --tv-bg: #ffffff;
}

body.palette-colorblind {
  --up: #5aa0e6;
  --down: #ef9a4a;
  --legend: linear-gradient(90deg, #e0822a 0%, #c06a1f 25%, #3a3f4a 50%, #2b5fa8 75%, #3d82d6 100%);
}

:root[data-theme="light"] body.palette-colorblind {
  --up: #1d64b8;
  --down: #c25b0c;
  --legend: linear-gradient(90deg, #d46b14 0%, #e08d42 25%, #8b95a5 50%, #3a7ac9 75%, #1e60b0 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.text-up {
  color: var(--up);
}

.text-down {
  color: var(--down);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -40px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-on);
  padding: 6px 10px;
  border-radius: var(--r);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100vh;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, var(--raised) 0%, var(--panel) 100%);
  border: 1px solid var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.28);
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
}

:root[data-theme="light"] .brand-mark {
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(15, 23, 42, 0.08);
}

.brand-logo {
  width: 34px;
  height: 34px;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-accent {
  color: var(--accent);
}

.brand-sub {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

.mast-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mast-mcap {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.mast-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.mast-time {
  font-size: 12px;
  color: var(--text-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}

.tag-live {
  color: var(--up);
  border-color: currentColor;
}

.tag-mock,
.tag-warn {
  color: var(--accent);
  border-color: currentColor;
}

.tag-pos {
  color: var(--up);
  border-color: currentColor;
}

.tag-neg {
  color: var(--down);
  border-color: currentColor;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.tb-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.tb-spacer {
  flex: 1;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  overflow: hidden;
}

.seg-btn {
  background: var(--panel);
  border: 0;
  border-right: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, color 0.12s;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.seg-btn.active {
  background: var(--active-bg);
  color: var(--active-text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.seg-btn:focus-visible {
  outline-offset: -2px;
}

.seg-block {
  display: flex;
  width: 100%;
}

.seg-block .seg-btn {
  flex: 1;
  padding: 7px 6px;
}

.tb-search input,
.f-input {
  width: 150px;
  padding: 5px 9px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.f-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
}

.tb-search input::placeholder,
.f-input::placeholder {
  text-transform: none;
  color: var(--text-3);
}

.btn-filters {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.btn-filters:hover {
  background: var(--hover);
}

.btn-filters[aria-expanded="true"] {
  border-color: var(--accent);
}

.count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
}

/* ---------- Active filter chips ---------- */

.active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.af-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: 2px;
}

.af-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.af-chip:hover {
  border-color: var(--text-3);
}

.af-x {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--text-2);
  font-size: 11px;
}

.af-chip:hover .af-x {
  color: var(--text);
}

.link-btn {
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--accent-link-hover);
}

/* ---------- Notices ---------- */

.notice {
  padding: 8px 12px;
  border: 1px solid var(--notice-border);
  border-left-width: 3px;
  background: var(--notice-bg);
  color: var(--notice-text);
  font-size: 13px;
  border-radius: 2px;
}

.notice-error {
  border-color: var(--notice-err-border);
  background: var(--notice-err-bg);
  color: var(--notice-err-text);
  margin-bottom: 8px;
}

/* ---------- KPIs ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r);
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: left;
  min-width: 0;
}

.kpi:last-child {
  border-right: 0;
}

.kpi-btn {
  cursor: pointer;
}

.kpi-btn:hover {
  background: var(--hover);
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

.kpi-value {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-2);
}

/* ---------- Category strip ---------- */

.sector-strip-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strip-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.strip-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-3);
}

.sector-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}

.sector-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -1px -1px 0;
  font-size: 12px;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.sector-cell:hover {
  background: var(--hover);
  color: var(--text);
}

.sector-cell.active {
  background: var(--active-bg);
  color: var(--active-text);
  box-shadow: inset 2px 0 0 var(--accent);
}

.sector-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-pct {
  font-weight: 600;
  flex-shrink: 0;
}

/* ---------- Main panel ---------- */

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 600px;
  outline: none;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-meta {
  font-size: 12px;
  color: var(--text-2);
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.legend-bar {
  width: 120px;
  height: 8px;
  background: var(--legend);
  border-radius: 1px;
}

.legend-tick {
  font-size: 11px;
  color: var(--text-2);
}

.heatmap {
  flex: 1;
  width: 100%;
  min-height: 560px;
  padding: 4px;
}

.panel-foot {
  margin: 0;
  padding: 6px 12px 8px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--line);
}

/* ---------- Mobile list ---------- */

.m-list {
  display: none;
  flex-direction: column;
}

.m-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 12px 6px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

.m-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.m-row:hover {
  background: var(--hover);
}

.m-row.is-dim {
  opacity: 0.38;
}

.m-row.is-pf {
  box-shadow: inset 2px 0 0 var(--accent);
}

.m-ticker {
  font-size: 13px;
  font-weight: 600;
}

.m-mid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.m-name {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-name-emp {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.m-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-bar {
  height: 5px;
  background: var(--raised);
  border-radius: 1px;
  overflow: hidden;
}

.m-bar-fill {
  display: block;
  height: 100%;
  min-width: 3px;
}

.m-pct {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}

.m-emp {
  color: var(--text);
}

.m-sub-pct {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
}

.m-empty {
  padding: 16px 12px;
  color: var(--text-2);
}

/* ---------- Footer ---------- */

.footer {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

.footer p {
  margin: 0 0 4px;
  line-height: 1.5;
}

.footer-src {
  color: var(--text-3);
}

/* ---------- Overlays & sheets ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 40;
}

.sheet,
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-drawer);
  animation: slideInRight 0.16s ease-out;
}

.sheet {
  width: min(380px, 100vw);
}

.drawer {
  width: clamp(480px, 40vw, 960px);
  max-width: 100vw;
}

/* Full-page vendor view (#vendor/TICKER) */
.drawer.is-full {
  width: 100vw;
  border-left: 0;
  box-shadow: none;
  animation: none;
}

.drawer.is-full > .drawer-head,
.drawer.is-full > .tabs,
.drawer.is-full > .drawer-body > .vpanel {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.drawer.is-full .tv {
  height: 520px;
}

@keyframes slideInRight {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(32px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet-head,
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 12px;
}

.f-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.f-section:last-child {
  border-bottom: 0;
}

.f-title {
  display: block;
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.f-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-3);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  cursor: pointer;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.switch-name {
  font-size: 13px;
  font-weight: 500;
}

.switch-desc {
  font-size: 11px;
  color: var(--text-3);
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 18px;
  margin: 0;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

.switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text-2);
  border-radius: 50%;
  transition: transform 0.12s, background-color 0.12s;
}

.switch:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch:checked::before {
  transform: translateX(14px);
  background: var(--accent-on);
}

.pf-fieldset {
  margin: 8px 0 6px;
  padding: 0;
  border: 0;
}

.pf-legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.pf-item {
  position: relative;
  display: block;
}

.pf-item input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pf-item span {
  display: block;
  padding: 5px 0;
  text-align: center;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.pf-item span:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.pf-item input:checked + span {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pf-item input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sheet-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--hover);
}

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-on);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* ---------- Vendor drawer ---------- */

.drawer-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ticker-tag {
  padding: 2px 7px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  border-radius: 2px;
}

.meta-tag {
  font-size: 12px;
  color: var(--text-2);
}

.meta-tag + .meta-tag::before {
  content: "·";
  margin-right: 6px;
  color: var(--text-3);
}

.drawer-company {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.quote {
  padding: 9px 11px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.quote:last-child {
  border-right: 0;
}

.quote dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

.quote dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quote-delta {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
}

.returns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.ret {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 11px;
  border-right: 1px solid var(--line);
}

.ret:last-child {
  border-right: 0;
}

.ret-tf {
  font-size: 11px;
  color: var(--text-3);
}

.ret-val {
  font-size: 13px;
  font-weight: 600;
}

.d-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.d-section-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.d-section-src {
  font-size: 11px;
  color: var(--text-3);
}

.d-section-tags {
  display: flex;
  gap: 6px;
}

.tv {
  height: 340px;
  border: 1px solid var(--line);
  background: var(--tv-bg);
}

.filing {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filing-headline {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.filing-block h4 {
  margin: 0 0 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.filing-block p,
.filing-block ul {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

.filing-block ul {
  padding-left: 16px;
}

.filing-block li + li {
  margin-top: 4px;
}

.filing-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-3);
}

.filing-foot a {
  color: var(--accent);
  font-weight: 600;
}

.filing-empty {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

/* ---------- Vendor panel: header actions, tabs, sections ---------- */

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.drawer-pos {
  min-width: 44px;
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-text {
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-text:hover {
  background: var(--hover);
  color: var(--text);
}

.tag-pf {
  color: var(--accent);
  border-color: currentColor;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  padding: 9px 10px 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.vpanel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.why {
  padding: 10px 12px 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.why .d-section-head {
  padding-bottom: 0;
  border-bottom: 0;
}

.why-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
}

.why-text.muted,
.why-note {
  color: var(--text-3);
}

.why-note {
  margin: 6px 0 0;
  font-size: 11px;
}

.why-sources {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.why-sources a {
  color: var(--text);
}

.why-sources a:hover {
  color: var(--accent);
}

.why-src-meta {
  font-size: 11px;
  color: var(--text-3);
}

.ret.is-active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fact-label,
.fund-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

.fact-value {
  font-size: 13px;
  font-weight: 600;
}

/* Employees over time */

.emp-hist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emp-chart-wrap {
  padding: 8px 10px 4px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.emp-chart {
  display: block;
  width: 100%;
  height: auto;
}

.emp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.emp-table th,
.emp-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.emp-table tr:last-child td {
  border-bottom: 0;
}

.emp-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--raised);
}

.emp-table .emp-num,
.emp-table .emp-chg {
  text-align: right;
}

.emp-na {
  color: var(--text-3);
}

.emp-foot {
  margin: 0;
  font-size: 11px;
  color: var(--text-3);
}

.peers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.peer {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 9px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font-size: 12px;
  cursor: pointer;
}

.peer:hover {
  background: var(--hover);
  border-color: var(--text-3);
}

.peer-t {
  font-family: var(--mono);
  font-weight: 600;
}

.panel-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

/* Fundamentals */

.fund-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fund {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.fund-value {
  font-size: 20px;
  font-weight: 600;
}

.fund-value.na {
  color: var(--text-3);
}

.fund-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-3);
}

.fund-foot {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-3);
}

/* Filings tab */

.filing-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.filing-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.filing-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filing-top a {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Main view tabs & news feed ---------- */

.main-tabs {
  display: inline-flex;
  gap: 2px;
}

.main-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.main-tab:hover,
.main-tab.active {
  color: var(--text);
}

.main-tab.active {
  border-bottom-color: var(--accent);
}

.main-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mark {
  color: var(--accent);
  font-size: 10px;
}

.m-mark {
  margin-left: 4px;
  color: var(--accent);
  font-size: 10px;
}

.news-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.nf {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nf-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.nf-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
}

.f-select {
  padding: 5px 8px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  padding: 3px 9px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 11.5px;
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.chip[aria-pressed="true"] {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip-sev {
  border-color: rgba(255, 123, 114, 0.45);
  color: #ff8c84;
  font-weight: 600;
}

.chip-sev:hover {
  border-color: #ff7b72;
  color: #ffb3ae;
}

.chip-sev[aria-pressed="true"] {
  background: rgba(255, 123, 114, 0.16);
  border-color: #ff7b72;
  color: #ffd3d0;
}

:root[data-theme="light"] .chip-sev {
  border-color: rgba(200, 40, 36, 0.35);
  color: #b42318;
}

:root[data-theme="light"] .chip-sev:hover {
  border-color: #c82824;
  color: #912018;
}

:root[data-theme="light"] .chip-sev[aria-pressed="true"] {
  background: rgba(200, 40, 36, 0.11);
  border-color: #c82824;
  color: #912018;
}

/* ---------- Daily News Brief ---------- */

.news-brief {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}

.nb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.nb-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nb-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.nb-badge {
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
}

.nb-badge-ai {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.nb-sev-pill {
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(255, 123, 114, 0.14);
  border: 1px solid rgba(255, 123, 114, 0.5);
  color: #ff948c;
  font-size: 10.5px;
  font-weight: 600;
}

:root[data-theme="light"] .nb-sev-pill {
  background: rgba(200, 40, 36, 0.1);
  border-color: rgba(200, 40, 36, 0.35);
  color: #b42318;
}

.nb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nb-actions .ni-share {
  margin-left: 0;
}

.nb-meta {
  font-size: 11px;
  color: var(--text-3);
}

.nb-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.nb-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.nb-foot {
  margin: 0;
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- High-Severity Breaches & Incidents spotlight ---------- */

.news-breaches {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 123, 114, 0.045);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid #e5605a;
}

:root[data-theme="light"] .news-breaches {
  background: rgba(200, 40, 36, 0.04);
  border-left-color: #c82824;
}

.br-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.br-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.br-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ff8c84;
}

:root[data-theme="light"] .br-title {
  color: #b42318;
}

.br-count {
  font-size: 11px;
  color: var(--text-3);
}

.br-filter-btn {
  font-size: 11.5px;
}

.br-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.br-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid rgba(255, 123, 114, 0.28);
  border-radius: var(--r);
}

:root[data-theme="light"] .br-card {
  border-color: rgba(200, 40, 36, 0.24);
}

.br-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
}

.br-src {
  color: var(--text-2);
  font-weight: 500;
}

.br-head {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.38;
  text-decoration: none;
}

.br-head::after {
  content: " \2197";
  color: var(--text-3);
  font-weight: 400;
}

.br-head:hover {
  color: var(--accent);
  text-decoration: underline;
}

.br-sum {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sev {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  white-space: nowrap;
}

.sev-high {
  background: rgba(229, 96, 90, 0.18);
  border: 1px solid rgba(255, 123, 114, 0.65);
  color: #ff9c95;
}

.sev-med {
  background: rgba(240, 180, 90, 0.14);
  border: 1px solid rgba(240, 180, 90, 0.5);
  color: #f0b45a;
}

:root[data-theme="light"] .sev-high {
  background: rgba(200, 40, 36, 0.12);
  border-color: rgba(200, 40, 36, 0.45);
  color: #b42318;
}

:root[data-theme="light"] .sev-med {
  background: rgba(168, 100, 11, 0.11);
  border-color: rgba(168, 100, 11, 0.4);
  color: #9a5b08;
}

.ni-industry {
  display: inline-flex;
  padding: 1px 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10.5px;
}

.news-item.is-high-breach {
  border-left: 2px solid #e5605a;
  padding-left: 10px;
}

:root[data-theme="light"] .news-item.is-high-breach {
  border-left-color: #c82824;
}

.news-item.is-targeted {
  background: var(--accent-dim);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.news-list-panel .news-item {
  padding: 10px 0;
}

.ni-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-3);
}

.ni-head {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.ni-head::after {
  content: " \2197";
  color: var(--text-3);
  font-weight: 400;
}

.ni-head:hover {
  color: var(--accent);
  text-decoration: underline;
}

.ni-sum {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.ni-pending {
  margin: 0;
  font-size: 11px;
  font-style: italic;
  color: var(--text-3);
}

.ni-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ni-ticker {
  padding: 1px 6px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
}

.ni-ticker:hover {
  background: var(--accent-dim);
}

.ev {
  display: inline-flex;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ev-earnings { color: #7fb2ff; }
.ev-guidance { color: #c9a2ff; }
.ev-ma { color: #f0b45a; }
.ev-breach { color: #ff7b72; }
.ev-analyst { color: #56c2c2; }
.ev-product { color: #8fd18f; }
.ev-filing { color: #b8bec8; }
.ev-other { color: var(--text-3); }

:root[data-theme="light"] .ev-earnings { color: #1d5fd1; }
:root[data-theme="light"] .ev-guidance { color: #7c3aed; }
:root[data-theme="light"] .ev-ma { color: #a8640b; }
:root[data-theme="light"] .ev-breach { color: #c82824; }
:root[data-theme="light"] .ev-analyst { color: #0e7490; }
:root[data-theme="light"] .ev-product { color: #1f7a3d; }
:root[data-theme="light"] .ev-filing { color: #4b5563; }

.news-status,
.news-empty {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--text-2);
}

.news-list-panel .news-empty {
  padding: 4px 0;
}

.news-more {
  align-self: flex-start;
  margin: 10px 12px;
}

.news-sources {
  margin: auto 0 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-3);
}

.news-sources .src-err {
  color: var(--accent);
}

/* ---------- Share menu ---------- */

.ni-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.why-sources .ni-share {
  margin-left: 6px;
  vertical-align: middle;
}

.ni-share:hover {
  background: var(--hover);
  border-color: var(--text-3);
  color: var(--text);
}

.ni-share .icon {
  width: 11px;
  height: 11px;
}

.share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: transparent;
}

.share-pop {
  position: fixed;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 400px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow-pop);
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.share-post-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-post-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

.btn-accent {
  padding: 5px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-accent:hover {
  filter: brightness(1.08);
}

.share-text {
  width: 100%;
  min-height: 112px;
  padding: 8px 9px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.share-text:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.share-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-3);
}

.share-hint kbd {
  padding: 0 4px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-2);
}

.share-link-row {
  display: flex;
  gap: 6px;
}

.share-url {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 11.5px;
}

.share-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.share-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.share-item:hover {
  background: var(--hover);
  border-color: var(--text-3);
}

.share-item-wide {
  grid-column: 1 / -1;
}

.share-badge {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: #6b7480;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.sb-linkedin { background: #0a66c2; }
.sb-x { background: #000; border: 1px solid #4a525e; }
.sb-facebook { background: #1877f2; }
.sb-reddit { background: #ff4500; }
.sb-whatsapp { background: #25d366; color: #0b2a14; }
.sb-telegram { background: #229ed9; }

.share-status {
  min-height: 16px;
  margin: 0;
  font-size: 11.5px;
  color: var(--up);
}

/* ---------- Responsive ---------- */

.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi:nth-child(2) {
    border-right: 0;
  }

  .kpi:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 767px) {
  .app {
    padding: 0 10px 16px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  span.mobile-only {
    display: inline;
  }

  .mast-right {
    width: 100%;
    gap: 8px;
  }

  .mast-mcap {
    font-size: 12px;
  }

  .toolbar {
    gap: 10px;
    flex-wrap: nowrap;
  }

  .tb-group .tb-label {
    display: none;
  }

  .tb-group .seg-btn {
    padding: 6px 10px;
  }

  .btn-filters-text {
    display: none;
  }

  .kpi {
    padding: 8px 10px;
  }

  .kpi-value {
    font-size: 15px;
  }

  .sector-strip {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sector-cell {
    flex: 0 0 auto;
    min-width: 150px;
    border-bottom: 0;
    margin: 0;
  }

  .panel {
    min-height: auto;
  }

  .heatmap {
    display: none;
  }

  .m-list {
    display: flex;
  }

  /* Filters drawer becomes a bottom sheet */
  .sheet {
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 86vh;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow-sheet);
    animation: slideInUp 0.18s ease-out;
  }

  .sheet-grip {
    display: block;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    background: var(--line-strong);
    border-radius: 2px;
  }

  .sheet-head {
    padding-top: 8px;
  }

  /* Share menu becomes a bottom sheet */
  .share-backdrop {
    background: var(--overlay-bg);
  }

  .share-pop {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 8px 8px 0 0;
    animation: slideInUp 0.18s ease-out;
  }

  /* Vendor panel is full screen on phones */
  .drawer {
    left: 0;
    width: 100%;
    border-left: 0;
  }

  .drawer-head {
    flex-wrap: wrap;
  }

  .tabs {
    padding: 0 8px;
  }

  .fund-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-filters {
    padding: 8px 10px;
  }

  .br-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .nf-note {
    width: 100%;
    margin-left: 0;
  }

  .quote-grid,
  .returns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote:nth-child(2),
  .ret:nth-child(2) {
    border-right: 0;
  }

  .quote:nth-child(-n + 2),
  .ret:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- Earnings calendar & valuation map (main tabs) ---------- */

.view-intro {
  margin: 0;
  padding: 10px 12px 6px;
  font-size: 12px;
  color: var(--text-2);
  max-width: 820px;
}

.er-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 12px 12px;
}

.er-title {
  margin: 6px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.er-count {
  margin-left: 4px;
  font-weight: 500;
  color: var(--text-2);
}

.er-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.er-list li + li {
  border-top: 1px solid var(--line);
}

.er-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.3fr) 72px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.er-row:hover {
  background: var(--hover);
}

.er-date {
  font-size: 12px;
  color: var(--text-2);
}

.er-ticker {
  font-weight: 700;
}

.er-name,
.er-cat,
.er-when {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.er-cat,
.er-when {
  font-size: 12px;
  color: var(--text-2);
}

.er-chg {
  font-size: 12px;
  text-align: right;
}

.val-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  padding-right: 12px;
}

.val-head .view-intro {
  flex: 1 1 320px;
}

.val-head .seg {
  margin-top: 10px;
}

.val-chart {
  width: 100%;
  height: 520px;
}

.val-details {
  padding: 4px 12px 10px;
}

.val-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-2);
}

.val-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
}

.val-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.val-table th,
.val-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.val-table thead th {
  font-weight: 600;
  color: var(--text-3);
}

.val-table .num {
  text-align: right;
}

.val-np {
  font-size: 11px;
  color: var(--text-3);
}

.linkish {
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  cursor: pointer;
}

@media (max-width: 767px) {
  .main-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .er-row {
    grid-template-columns: 84px minmax(0, 1fr) 64px;
    grid-template-areas:
      "date name chg"
      "date when when";
    row-gap: 2px;
  }

  .er-date { grid-area: date; }
  .er-name { grid-area: name; }
  .er-chg { grid-area: chg; }
  .er-when { grid-area: when; }
  .er-cat { display: none; }

  .val-chart {
    height: 400px;
  }
}

/* ---------- About & methodology page ---------- */

.about {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.about h1 {
  margin: 8px 0 12px;
  font-size: 30px;
  line-height: 1.2;
}

.about h2 {
  margin: 34px 0 10px;
  padding-top: 6px;
  font-size: 19px;
  border-top: 1px solid var(--line);
}

.about h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.about a {
  color: var(--accent);
}

.about-lead {
  font-size: 17px;
  color: var(--text-2);
}

.about-back {
  margin: 0;
  font-size: 13px;
}

.about-toc {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-3);
}

.about-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px 24px;
}

.about-cat p {
  margin: 0;
  font-size: 13px;
}

.about-np {
  font-size: 12px;
  color: var(--text-3);
}

.about-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.about-table th,
.about-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.about-table th {
  font-weight: 600;
  color: var(--text-3);
}

.about-dl dt {
  margin-top: 12px;
  font-weight: 700;
}

.about-dl dd {
  margin: 2px 0 0;
  color: var(--text-2);
}

.about ul {
  padding-left: 20px;
}

.about li {
  margin: 6px 0;
}

.about-foot {
  margin-top: 36px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}

@media (max-width: 767px) {
  .about-table thead {
    display: none;
  }

  .about-table td {
    display: block;
    padding: 2px 0;
    border: 0;
  }

  .about-table tr {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
}

.about-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- Views & commentary (dashboard tab + standalone /views/ pages) ---------- */

.vw-tab-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-right: 12px;
  border-bottom: 1px solid var(--line);
}

.vw-tab-head .view-intro {
  flex: 1 1 320px;
  padding-bottom: 10px;
}

.vw-all-link {
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.vw-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.vw-list-tab {
  margin-top: 0;
  padding: 12px;
}

.vw-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
}

.vw-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.vw-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vw-tag {
  padding: 1px 6px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 10.5px;
  color: var(--text-2);
}

.vw-card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.vw-card-title a {
  color: var(--text);
  text-decoration: none;
}

.vw-card-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.vw-card-sum {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

.vw-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.vw-read-more {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.vw-read-more:hover {
  text-decoration: underline;
}

.vw-article .vw-header {
  margin-top: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.vw-tickers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.vw-tickers-label {
  font-size: 12px;
  color: var(--text-3);
}

.vw-tickers a.ni-ticker {
  text-decoration: none;
}

.vw-share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 14px;
}

.vw-share-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

.vw-share-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text) !important;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.vw-share-btn:hover {
  background: var(--hover);
  border-color: var(--text-3);
}

.vw-share-status {
  font-size: 11.5px;
  color: var(--up);
}

.vw-body {
  margin-top: 20px;
}

.vw-body h2 {
  margin: 28px 0 10px;
  padding-top: 6px;
  font-size: 19px;
  border-top: 1px solid var(--line);
}

.vw-body h3 {
  margin: 20px 0 8px;
  font-size: 16px;
  color: var(--text);
}

.vw-body p {
  margin: 0 0 14px;
}

.vw-body ul,
.vw-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.vw-body li {
  margin: 6px 0;
}

.vw-body blockquote {
  margin: 16px 0;
  padding: 10px 14px;
  background: var(--raised);
  border-left: 3px solid var(--accent);
  color: var(--text-2);
}

.vw-body blockquote p {
  margin: 0;
}

.vw-body code {
  padding: 1px 5px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 13px;
}

.vw-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.vw-pager {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.vw-nav-next {
  margin-left: auto;
}
