:root {
  color-scheme: light dark;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #081020;
  --muted: #64748b;
  --line: #d6e0ea;
  --green: #16804a;
  --red: #c43f37;
  --amber: #b36b19;
  --blue: #1a73e8;
  --blue-soft: #58a2ff;
  --polamera-deep: #081020;
  --polamera-slate: #1e293b;
  --polamera-steel: #64748b;
  --shadow: 0 14px 34px rgba(8, 16, 32, 0.08);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081020;
  --surface: #13293b;
  --surface-2: #102232;
  --ink: #f7fbff;
  --muted: #9fb2c4;
  --line: #2f5268;
  --green: #42b878;
  --red: #e1665f;
  --amber: #e0ad36;
  --blue: #1a73e8;
  --blue-soft: #58a2ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 16% 0%, rgba(26, 115, 232, 0.2), transparent 30%),
    radial-gradient(circle at 84% 6%, rgba(88, 162, 255, 0.08), transparent 28%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--line);
  background: #fbfdff;
  padding: 22px;
  overflow: visible;
  transition: transform 180ms ease, opacity 180ms ease;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.sidebar-toggle,
.sidebar-expand-toggle {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.sidebar-toggle {
  position: absolute;
  top: 12px;
  right: -14px;
  z-index: 10;
  width: 28px;
  height: 28px;
  box-shadow: var(--shadow);
}

.sidebar-expand-toggle {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

body.sidebar-collapsed .sidebar-expand-toggle {
  display: grid;
}

body[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(11, 24, 40, 0.98), rgba(8, 16, 32, 0.98)),
    var(--bg);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #17211c;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.logo-mark {
  object-fit: contain;
  border: 1px solid rgba(23, 33, 28, 0.1);
  background: #fff;
  padding: 4px;
}

body[data-theme="dark"] .logo-mark {
  border-color: rgba(237, 244, 239, 0.14);
  background: #f7faf7;
}

.brand-logo {
  display: block;
  width: min(248px, 100%);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.brand-logo-dark {
  display: none;
}

body[data-theme="dark"] .brand-logo-dark {
  display: block;
}

body[data-theme="dark"] .brand-logo-light {
  display: none;
}

.brand-copy {
  display: none;
}

.account-panel {
  display: grid;
  gap: 12px;
}

.account-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.account-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(26, 115, 232, 0.42);
  border-radius: 50%;
  background: rgba(26, 115, 232, 0.13);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-copy strong,
.account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.account-copy span {
  color: var(--muted);
  font-size: 11px;
}

.account-sign-out {
  width: 100%;
}

.coverage-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.coverage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.coverage-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 800;
}

.legacy-data-controls[hidden] {
  display: none !important;
}

.data-health-panel .panel-title span {
  color: var(--positive);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.15;
}

h2 {
  font-size: 21px;
  line-height: 1.2;
}

h3 {
  font-size: 14px;
}

p,
small,
.panel-title span,
.field span,
.toggle,
.metric span,
th,
td {
  color: var(--muted);
}

.brand p,
.toolbar p,
.analysis-header p {
  margin-top: 4px;
  font-size: 13px;
}

.analysis-header .pulse-header-status {
  max-width: 920px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

#pulseView > .pulse-sticky-header {
  margin: -8px -6px 0;
}

.tab-view > .tab-sticky-header {
  position: sticky;
  z-index: 24;
  top: calc(var(--topbar-sticky-height, 68px) + 8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 8px 18px rgba(8, 16, 32, 0.08);
  padding: 12px 14px;
  backdrop-filter: blur(12px);
}

.momentum-tab-header {
  min-height: 64px;
}

body[data-theme="dark"] .analysis-header .pulse-header-status {
  color: #8fb2bb;
}

.panel,
.table-panel,
.chart-wrap,
.analysis-card,
.news-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2 {
  font-size: 15px;
}

.panel-title span {
  font-size: 12px;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  border: 1px dashed #aeb9b3;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  background: var(--surface-2);
}

.file-drop:hover {
  border-color: var(--blue);
  background: #edf3f8;
}

body[data-theme="dark"] .file-drop:hover {
  background: #15232a;
}

.file-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.file-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.file-drop strong,
.file-drop small {
  display: block;
}

.file-drop small {
  margin-top: 3px;
  font-size: 12px;
}

.text-button,
.icon-button,
.tab-button,
.period-button,
.pulse-period-button,
.analysis-period-button,
.trend-period-button,
.mini-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

body[data-theme="dark"] .text-button,
body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .tab-button,
body[data-theme="dark"] .period-button,
body[data-theme="dark"] .pulse-period-button,
body[data-theme="dark"] .analysis-period-button,
body[data-theme="dark"] .trend-period-button,
body[data-theme="dark"] .mini-button,
body[data-theme="dark"] .theme-toggle {
  background: #102232;
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .table-panel,
body[data-theme="dark"] .chart-wrap,
body[data-theme="dark"] .analysis-card,
body[data-theme="dark"] .news-card,
body[data-theme="dark"] .tracking-panel,
body[data-theme="dark"] .trend-card,
body[data-theme="dark"] .trend-basket-info,
body[data-theme="dark"] .pulse-card,
body[data-theme="dark"] .data-card {
  border-color: rgba(88, 162, 255, 0.28);
  background: linear-gradient(180deg, rgba(19, 41, 59, 0.98), rgba(16, 34, 50, 0.98));
}

body[data-theme="dark"] .pulse-card,
body[data-theme="dark"] .tracking-panel,
body[data-theme="dark"] .news-card,
body[data-theme="dark"] .data-card,
body[data-theme="dark"] .intelligence-panel,
body[data-theme="dark"] .intelligence-hero,
body[data-theme="dark"] .positioning-card,
body[data-theme="dark"] .table-panel {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(88, 162, 255, 0.06);
}

.text-button {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.button-row .text-button {
  margin-top: 0;
  min-height: 36px;
  font-size: 12px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  font-size: 17px;
}

.text-button:hover,
.icon-button:hover,
.tab-button:hover,
.period-button:hover,
.pulse-period-button:hover,
.analysis-period-button:hover,
.trend-period-button:hover,
.anchor-period-button:hover,
.anchor-lookback-button:hover,
.mini-button:hover {
  border-color: var(--blue);
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.field span {
  font-size: 12px;
}

.field input,
.field select,
.selector-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .selector-row input {
  border-color: rgba(88, 162, 255, 0.24);
  background: #0b1828;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.compact {
  display: grid;
  gap: 10px;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
}

.metric:last-child {
  border-bottom: 0;
}

.metric strong {
  font-size: 18px;
}

.source-card p {
  font-size: 12px;
  line-height: 1.45;
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 0;
  border-bottom: 1px solid rgba(23, 33, 28, 0.08);
  background: rgba(247, 249, 247, 0.94);
  backdrop-filter: blur(16px);
  padding: 20px 22px 14px;
}

body[data-theme="dark"] .topbar {
  border-bottom-color: rgba(88, 162, 255, 0.22);
  background: rgba(8, 16, 32, 0.92);
}

.tabs,
.periods,
.pulse-periods,
.analysis-periods,
.trend-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar .tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.periods[hidden] {
  display: none;
}

.tab-button,
.period-button,
.pulse-period-button,
.analysis-period-button,
.trend-period-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
}

.tab-button.active,
.period-button.active,
.pulse-period-button.active,
.analysis-period-button.active,
.trend-period-button.active {
  border-color: var(--blue);
  background: #081020;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 140, 255, 0.28);
}

body[data-theme="light"] .tab-button.active,
body[data-theme="light"] .period-button.active,
body[data-theme="light"] .pulse-period-button.active,
body[data-theme="light"] .analysis-period-button.active,
body[data-theme="light"] .trend-period-button.active {
  background: linear-gradient(180deg, #1f8cff, #1269d0);
  border-color: #1a73e8;
  color: #ffffff;
}

body[data-theme="dark"] .tab-button.active,
body[data-theme="dark"] .period-button.active,
body[data-theme="dark"] .pulse-period-button.active,
body[data-theme="dark"] .analysis-period-button.active,
body[data-theme="dark"] .trend-period-button.active {
  background: linear-gradient(180deg, #1f8cff, #1269d0);
  border-color: #67bdff;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(103, 189, 255, 0.28), 0 6px 16px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] #analysisView .analysis-period-button.active {
  background: linear-gradient(180deg, #1f8cff, #1269d0);
  border-color: #8ed0ff;
  color: #ffffff;
}

body[data-theme="dark"] .tab-button,
body[data-theme="dark"] .period-button,
body[data-theme="dark"] .pulse-period-button,
body[data-theme="dark"] .analysis-period-button,
body[data-theme="dark"] .trend-period-button,
body[data-theme="dark"] .anchor-period-button,
body[data-theme="dark"] .anchor-lookback-button {
  border-color: rgba(88, 162, 255, 0.34);
  background: #102232;
  color: #f5fbfc;
  box-shadow: inset 0 1px 0 rgba(88, 162, 255, 0.05);
}

body[data-theme="dark"] .tab-button:hover,
body[data-theme="dark"] .period-button:hover,
body[data-theme="dark"] .pulse-period-button:hover,
body[data-theme="dark"] .analysis-period-button:hover,
body[data-theme="dark"] .trend-period-button:hover,
body[data-theme="dark"] .anchor-period-button:hover,
body[data-theme="dark"] .anchor-lookback-button:hover {
  border-color: #58a2ff;
  background: #142b3e;
}

.theme-toggle {
  min-width: 64px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--blue);
}

.tab-view {
  display: none;
  min-width: 0;
}

.tab-view.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.toolbar,
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#analysisView > .analysis-header {
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 243, 0.94)),
    #fff;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

body[data-theme="dark"] #analysisView > .analysis-header {
  border-color: rgba(88, 162, 255, 0.28);
  background: linear-gradient(180deg, #13293b, #102232);
}

.formula-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.formula-strip span {
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 999px;
  background: #fff;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

body[data-theme="dark"] .formula-strip span {
  border-color: rgba(88, 162, 255, 0.22);
  background: #0b1828;
}

.title-with-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.info-button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #17211c;
  color: #fff;
  cursor: help;
  font-size: 13px;
  font-weight: 850;
}

.framework-popover {
  position: absolute;
  z-index: 8;
  top: 30px;
  left: 0;
  display: none;
  width: min(760px, calc(100vw - 380px));
  min-width: 520px;
  border: 1px solid #343a37;
  border-radius: 8px;
  background: #151716;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  color: #f3f5f3;
  padding: 16px;
}

.title-with-info:hover .framework-popover,
.title-with-info:focus-within .framework-popover {
  display: block;
}

.framework-popover table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.framework-popover th,
.framework-popover td {
  border-bottom: 1px solid #3a403d;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.framework-popover th {
  color: #fff;
  font-weight: 850;
}

.framework-popover td {
  color: #f0f2f0;
  line-height: 1.45;
}

.framework-popover p {
  margin-top: 14px;
  color: #fff;
  font-size: 14px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.header-actions .periods {
  justify-content: flex-end;
}

#newsView .header-actions {
  flex-direction: column;
  align-items: flex-end;
}

.news-source-row {
  display: flex;
  justify-content: flex-end;
}

.chart-wrap {
  position: relative;
  aspect-ratio: 3 / 2.535;
  max-height: min(86vh, 1048px);
  min-height: 608px;
  overflow: hidden;
}

.tracking-panel {
  overflow: hidden;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tracking-panel header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #f4f8f5);
  padding: 14px 16px;
}

body[data-theme="dark"] .tracking-panel header {
  background: linear-gradient(180deg, #151f22, #11191c);
}

.tracking-panel header h2 {
  font-size: 16px;
}

.tracking-panel header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.anchored-panel-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #f4f8f5);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

body[data-theme="dark"] .anchored-panel-summary {
  background: linear-gradient(180deg, #151f22, #11191c);
}

.anchored-panel-summary::-webkit-details-marker {
  display: none;
}

.anchored-panel-summary span {
  font-size: 16px;
  font-weight: 850;
}

.anchored-panel-summary b {
  color: var(--muted);
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
  transition: transform 160ms ease;
}

.collapsible-tracking-panel[open] .anchored-panel-summary b {
  transform: rotate(90deg);
}

.collapsible-tracking-panel:not([open]) .anchored-panel-summary {
  border-bottom: 0;
}

.collapsible-tracking-panel:not([open]) .anchored-panel-summary b {
  color: var(--blue);
}

.anchor-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.anchor-controls > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.anchor-controls > div:last-child {
  margin-left: auto;
}

.anchor-controls span {
  min-width: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.anchor-period-button,
.anchor-lookback-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.anchor-period-button.active,
.anchor-lookback-button.active {
  border-color: var(--blue);
  background: #17211c;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 140, 255, 0.28);
}

body[data-theme="dark"] .anchor-period-button,
body[data-theme="dark"] .anchor-lookback-button {
  background: #111a1d;
}

body[data-theme="dark"] .anchor-period-button.active,
body[data-theme="dark"] .anchor-lookback-button.active {
  border-color: #67bdff;
  background: linear-gradient(180deg, #1e93e7, #1266aa);
  color: #ffffff;
}

.tracking-wrap {
  aspect-ratio: 3 / 2.535;
  width: 100%;
  min-height: 608px;
  max-height: min(86vh, 1048px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tracking-actions {
  left: 92px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#scatterCanvas {
  min-height: 100%;
}

.map-actions {
  display: flex;
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 92px;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 120px);
}

.mini-button.light {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.mini-button.light.active {
  border-color: #17211c;
  background: #17211c;
  color: #fff;
}

.bottom-legend {
  position: absolute;
  right: 18px;
  bottom: 8px;
  left: 68px;
  display: grid;
  grid-template-columns: 74px auto 54px auto 74px auto;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 12px;
}

.chart-wrap > .bottom-legend:not(.bubble-size-legend) {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.legend-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.roc-color-legend {
  display: grid;
  grid-template-columns: minmax(40px, 74px) auto minmax(32px, 54px) auto minmax(40px, 74px) auto;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
}

.price-ring-key {
  flex: 0 0 auto;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

html[data-live-price-direction-ring="false"] .price-ring-key {
  display: none;
}

.price-ring-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 3px solid;
  border-radius: 50%;
  background: #657071;
}

.price-ring-swatch.higher {
  border-color: #20c981;
}

.price-ring-swatch.lower {
  border-color: #ff5f62;
}

body[data-theme="light"] .price-ring-swatch {
  background: #aeb7b8;
}

.bottom-legend.bubble-size-legend {
  grid-template-columns: 18px auto 28px auto 40px auto;
  left: 74px;
  right: 18px;
}

.bubble-dot {
  display: inline-block;
  justify-self: center;
  border: 1.5px solid #fff;
  border-radius: 999px;
  background: #3474b8;
  box-shadow: 0 0 0 1px rgba(23, 33, 28, 0.12);
}

.bubble-dot.small {
  width: 10px;
  height: 10px;
}

.bubble-dot.medium {
  width: 18px;
  height: 18px;
}

.bubble-dot.large {
  width: 28px;
  height: 28px;
}

body[data-theme="dark"] .bottom-legend {
  background: rgba(19, 31, 34, 0.92);
  color: #c7d8da;
}

body[data-theme="dark"] .bubble-dot {
  border-color: #edf6ff;
  background: #3f79bc;
  box-shadow: 0 0 0 1px rgba(181, 210, 224, 0.2);
}

body[data-theme="dark"] .bottom-legend::before {
  border-top-color: rgba(116, 136, 140, 0.4);
}

.bottom-legend::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 0;
  left: 0;
  border-top: 1px solid var(--line);
}

.legend-red,
.legend-green,
.legend-neutral {
  height: 10px;
  border-radius: 999px;
}

.legend-red {
  background: linear-gradient(90deg, #7c201c, #f1a09b);
}

.legend-green {
  background: linear-gradient(90deg, #a7dec0, #127840);
}

.legend-neutral {
  background: #9aa7a0;
}

.tracking-panel .legend-red {
  background: linear-gradient(90deg, #c7cfcb, #eef2ef);
}

.tracking-panel .legend-green {
  background: linear-gradient(90deg, #cfd8d3, #61706a);
}

body[data-theme="dark"] .legend-red,
body[data-theme="dark"] .tracking-panel .legend-red {
  background: linear-gradient(90deg, #8e2f2c, #f28e88);
}

body[data-theme="dark"] .legend-green,
body[data-theme="dark"] .tracking-panel .legend-green {
  background: linear-gradient(90deg, #7fd6a8, #17a866);
}

body[data-theme="dark"] .legend-neutral {
  background: #c6d2cf;
}

.tooltip {
  position: absolute;
  z-index: 2;
  min-width: 250px;
  border: 1px solid rgba(23, 33, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 10px;
  pointer-events: none;
  font-size: 12px;
}

.tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
}

.tooltip div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 3px;
  color: var(--muted);
}

.tooltip span:last-child {
  color: var(--ink);
  font-weight: 650;
}

.tooltip span:last-child.gain,
.chart-tooltip span:last-child.gain,
.trend-tooltip span:last-child.gain {
  color: #087f4c !important;
}

.tooltip span:last-child.loss,
.chart-tooltip span:last-child.loss,
.trend-tooltip span:last-child.loss {
  color: #c83f3f !important;
}

body[data-theme="dark"] .tooltip span:last-child.gain,
body[data-theme="dark"] .chart-tooltip span:last-child.gain,
body[data-theme="dark"] .trend-tooltip span:last-child.gain {
  color: #45df92 !important;
}

body[data-theme="dark"] .tooltip span:last-child.loss,
body[data-theme="dark"] .chart-tooltip span:last-child.loss,
body[data-theme="dark"] .trend-tooltip span:last-child.loss {
  color: #ff7770 !important;
}

body[data-theme="dark"] .tooltip,
body[data-theme="dark"] .chart-tooltip,
body[data-theme="dark"] .trend-tooltip {
  border-color: rgba(205, 221, 224, 0.28);
  background: rgba(69, 79, 82, 0.96);
  color: #f5fbfb;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .tooltip strong,
body[data-theme="dark"] .chart-tooltip strong,
body[data-theme="dark"] .trend-tooltip strong {
  color: #ffffff;
}

body[data-theme="dark"] .tooltip div,
body[data-theme="dark"] .chart-tooltip div,
body[data-theme="dark"] .trend-tooltip div {
  color: #cbdadc;
}

body[data-theme="dark"] .tooltip span:last-child,
body[data-theme="dark"] .chart-tooltip span:last-child,
body[data-theme="dark"] .trend-tooltip span:last-child {
  color: #ffffff;
}

.table-panel {
  min-height: 250px;
  padding: 14px 14px 0;
}

.table-wrap {
  overflow: auto;
  max-height: 330px;
  margin: 0 -14px;
}

.strategy-suggestions-wrap {
  max-height: 260px;
}

.strategy-suggestions-wrap table {
  table-layout: auto;
}

.strategy-suggestions-wrap th:first-child,
.strategy-suggestions-wrap td:first-child {
  width: 120px;
  min-width: 120px;
}

.strategy-suggestions-wrap th:nth-child(2),
.strategy-suggestions-wrap td:nth-child(2) {
  width: 260px;
  min-width: 260px;
}

.quadrant-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  height: 38px;
  border-top: 1px solid var(--line);
  padding: 0 12px;
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9f7;
  cursor: pointer;
  font-weight: 750;
}

th:first-child,
td:first-child {
  text-align: left;
  color: var(--ink);
  font-weight: 800;
}

td:first-child button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 850;
  padding: 0;
}

.framework-popover th,
.framework-popover td,
.framework-popover td:first-child,
.framework-popover th:first-child {
  position: static;
  height: auto;
  border-top: 0;
  border-bottom: 1px solid #3a403d;
  background: #151716;
  color: #f3f5f3;
  cursor: default;
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
}

.framework-popover thead th {
  background: #202522;
  color: #ffffff;
}

.framework-popover tbody th {
  background: #1b1f1d;
  color: #ffffff;
}

.framework-popover strong {
  color: #ffffff;
}

.gain {
  color: var(--green);
}

.loss {
  color: var(--red);
}

.selector-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
}

.selector-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-controls {
  display: block;
}

.analysis-grid,
.news-grid,
.data-grid,
.positioning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
  min-width: 0;
}

.strategy-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.strategy-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 245, 0.9)),
    radial-gradient(circle at 12% 0%, rgba(50, 104, 168, 0.16), transparent 34%),
    radial-gradient(circle at 90% 16%, rgba(22, 128, 74, 0.15), transparent 30%);
  box-shadow: var(--shadow);
  padding: 18px;
}

.strategy-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strategy-hero h3 {
  max-width: 760px;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.18;
}

.strategy-hero p {
  max-width: 860px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.strategy-cycle {
  display: grid;
  gap: 8px;
  align-content: center;
}

.strategy-cycle span,
.strategy-primer,
.strategy-origin,
.strategy-matrix thead th {
  border-radius: 8px;
}

.strategy-cycle span {
  border: 1px solid rgba(23, 33, 28, 0.08);
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 900;
}

.strategy-primer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.strategy-primer {
  border: 1px solid rgba(23, 33, 28, 0.1);
  padding: 13px;
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.06);
}

.strategy-primer strong {
  display: block;
  font-size: 13px;
}

.strategy-primer span {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.strategy-primer p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.strategy-primer-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(23, 33, 28, 0.08);
  border-radius: 8px;
  background: #101512;
  padding: 12px 14px;
  color: #f4f7f4;
  font-size: 13px;
  font-weight: 750;
}

.strategy-matrix-wrap {
  overflow: hidden;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.strategy-matrix-title {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
  padding: 14px 16px;
}

.strategy-matrix-title p,
.strategy-matrix-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.strategy-matrix-title span {
  max-width: 360px;
  text-align: right;
}

.strategy-table-scroll {
  overflow-x: auto;
  padding: 12px;
}

.strategy-matrix-grid {
  display: grid;
  grid-template-columns: 150px repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px;
  padding: 12px;
}

.strategy-head {
  border: 1px solid rgba(23, 33, 28, 0.08);
  border-radius: 8px;
  background: #f8faf8;
  padding: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.strategy-matrix {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 6px;
}

.strategy-col-origin {
  width: 150px;
}

.strategy-col-destination {
  width: calc((100% - 150px) / 4);
}

.strategy-matrix th,
.strategy-matrix td {
  vertical-align: top;
}

.strategy-matrix thead th {
  border: 1px solid rgba(23, 33, 28, 0.08);
  padding: 10px;
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  overflow-wrap: anywhere;
}

.strategy-matrix thead th:first-child {
  width: 150px;
}

.strategy-origin {
  border: 1px solid rgba(23, 33, 28, 0.08);
  padding: 10px;
  color: var(--ink);
  font-size: 12px;
  text-align: left;
}

.strategy-origin span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.strategy-cell {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-cell-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.strategy-cell-top strong {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.strategy-cell-top span,
.strategy-cell em {
  max-width: 100%;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 900;
}

.strategy-cell-top span {
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 7px;
}

.strategy-cell p {
  margin-top: 8px;
  color: #3e4b45;
  font-size: 10.5px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.strategy-cell p b {
  color: var(--ink);
}

.strategy-cell em {
  display: inline-block;
  margin-top: 10px;
  background: rgba(23, 33, 28, 0.78);
  color: #fff;
  font-style: normal;
  padding: 5px 8px;
}

.strategy-arrow {
  align-self: flex-end;
  margin-top: auto;
  padding-top: 10px;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
}

.same-quadrant {
  outline: 2px solid rgba(23, 33, 28, 0.12);
}

.preview-match {
  outline: 3px solid rgba(50, 104, 168, 0.75);
  box-shadow: 0 0 0 5px rgba(50, 104, 168, 0.12);
}

.strategy-preview {
  position: fixed;
  z-index: 20;
  width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(23, 33, 28, 0.16);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 18px 46px rgba(23, 33, 28, 0.22);
  pointer-events: none;
}

.strategy-preview p {
  margin-top: 8px;
  color: #3e4b45;
  font-size: 11px;
  line-height: 1.42;
}

.strategy-preview p b {
  color: var(--ink);
}

.strategy-preview em {
  display: inline-block;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.78);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.dead,
.to-dead {
  background: linear-gradient(180deg, #eef2f1, #dfe7e4);
}

.distribution,
.to-distribution {
  background: linear-gradient(180deg, #fff1ee, #f8d9d4);
}

.fading,
.to-fading {
  background: linear-gradient(180deg, #fff7df, #f7e8b8);
}

.breakout,
.to-breakout {
  background: linear-gradient(180deg, #eaf7ef, #cfeedd);
}

.to-dead .strategy-arrow {
  color: #64716b;
}

.to-distribution .strategy-arrow {
  color: #c43f37;
}

.to-fading .strategy-arrow {
  color: #b36b19;
}

.to-breakout .strategy-arrow {
  color: #16804a;
}

body[data-theme="dark"] .strategy-hero,
body[data-theme="dark"] .strategy-matrix-wrap {
  border-color: rgba(116, 136, 140, 0.28);
  background:
    linear-gradient(135deg, rgba(28, 42, 46, 0.98), rgba(16, 26, 29, 0.98)),
    radial-gradient(circle at 12% 0%, rgba(29, 140, 255, 0.16), transparent 34%),
    radial-gradient(circle at 90% 16%, rgba(66, 184, 120, 0.14), transparent 30%);
}

body[data-theme="dark"] .strategy-matrix-title,
body[data-theme="dark"] .strategy-head,
body[data-theme="dark"] .strategy-origin {
  border-color: rgba(116, 136, 140, 0.28);
  background: #142126;
  color: #f5fbfb;
}

body[data-theme="dark"] .strategy-primer,
body[data-theme="dark"] .strategy-cycle span {
  border-color: rgba(116, 136, 140, 0.28);
  color: #f5fbfb;
}

body[data-theme="dark"] .dead,
body[data-theme="dark"] .to-dead {
  background: linear-gradient(180deg, #293533, #202d2b);
}

body[data-theme="dark"] .distribution,
body[data-theme="dark"] .to-distribution {
  background: linear-gradient(180deg, #52302f, #3b2525);
}

body[data-theme="dark"] .fading,
body[data-theme="dark"] .to-fading {
  background: linear-gradient(180deg, #51441f, #3b321b);
}

body[data-theme="dark"] .breakout,
body[data-theme="dark"] .to-breakout {
  background: linear-gradient(180deg, #1f4634, #183629);
}

body[data-theme="dark"] .strategy-primer strong,
body[data-theme="dark"] .strategy-primer span,
body[data-theme="dark"] .strategy-cell-top strong,
body[data-theme="dark"] .strategy-cell p b,
body[data-theme="dark"] .strategy-preview p b,
body[data-theme="dark"] .strategy-matrix thead th {
  color: #f7fbfb;
}

body[data-theme="dark"] .strategy-primer p,
body[data-theme="dark"] .strategy-cell p,
body[data-theme="dark"] .strategy-preview p {
  color: #c5d2d2;
}

body[data-theme="dark"] .strategy-cell {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .strategy-cell-top span {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body[data-theme="dark"] .strategy-cell em,
body[data-theme="dark"] .strategy-preview em {
  background: rgba(245, 251, 251, 0.9);
  color: #11191c;
}

.positioning-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.positioning-card.contract {
  grid-column: 1 / -1;
}

.positioning-card header {
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
  padding: 14px;
}

.positioning-card header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.risk-metric {
  min-height: 84px;
  background: #fff;
  padding: 12px;
}

.risk-metric span,
.risk-metric em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.risk-metric strong {
  display: block;
  margin: 7px 0 5px;
  color: var(--ink);
  font-size: 18px;
}

.holder-list {
  padding: 14px;
}

.ownership-source {
  margin: 14px 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f7;
  padding: 12px;
}

body[data-theme="dark"] .risk-grid {
  background: rgba(116, 136, 140, 0.28);
}

body[data-theme="dark"] .risk-metric {
  background: #101a1d;
}

body[data-theme="dark"] .risk-metric strong {
  color: #f5fbfb;
}

body[data-theme="dark"] .ownership-source {
  border-color: rgba(116, 136, 140, 0.28);
  background: #101a1d;
}

body[data-theme="dark"] .ownership-source h4,
body[data-theme="dark"] .holder-list h4 {
  color: #f5fbfb;
}

body[data-theme="dark"] .contract-tags span {
  border-color: rgba(116, 136, 140, 0.34);
  background: #142126;
  color: #c7d7da;
}

.ownership-source h4 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.ownership-source a {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holder-list h4 {
  margin: 0 0 10px;
  font-size: 12px;
}

.holder-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 12px;
}

.holder-list p,
.positioning-card.contract p {
  font-size: 12px;
  line-height: 1.45;
}

.positioning-card.contract p {
  padding: 14px 14px 0;
}

.contract-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
}

.contract-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9f7;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.pulse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  min-width: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  min-width: 0;
}

.home-header {
  align-items: center;
}

.home-quick-actions,
.home-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.home-regime-card,
.home-panel {
  border: 1px solid rgba(88, 162, 255, 0.28);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.home-regime-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: center;
  background:
    radial-gradient(circle at 8% 8%, rgba(26, 115, 232, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(8, 16, 32, 0.98), rgba(19, 41, 59, 0.94));
  color: #f8fbf8;
  padding: 18px;
  overflow: visible;
}

body[data-theme="light"] .home-regime-card {
  background:
    radial-gradient(circle at 8% 8%, rgba(26, 115, 232, 0.12), transparent 32%),
    linear-gradient(135deg, #ffffff, #eef5fb);
  color: var(--ink);
}

.home-regime-card h3 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
}

.home-regime-card p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.45;
}

body[data-theme="light"] .home-regime-card p {
  color: var(--muted);
}

.home-regime-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-regime-stats div,
.home-status-list div {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
}

body[data-theme="light"] .home-regime-stats div {
  border-color: rgba(23, 33, 28, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.home-regime-stats span,
.home-status-list span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-regime-stats strong {
  display: block;
  margin-top: 6px;
  color: inherit;
  font-size: 22px;
}

.home-regime-rationale {
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px 16px;
}

.home-regime-rationale > span {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.home-regime-rationale p {
  max-width: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.55;
}

.home-regime-rationale strong {
  color: #ffffff;
}

body[data-theme="light"] .home-regime-rationale {
  border-color: rgba(23, 33, 28, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .home-regime-rationale > span,
body[data-theme="light"] .home-regime-rationale p {
  color: var(--muted);
}

body[data-theme="light"] .home-regime-rationale strong {
  color: var(--ink);
}

.home-panel {
  display: flex;
  min-height: 280px;
  flex-direction: column;
}

.home-priority-panel,
.home-map-panel {
  grid-column: span 2;
}

.home-watchlist-panel {
  grid-column: 3;
  grid-row: 2 / span 3;
  min-height: 100%;
}

.home-watchlist-panel .home-watchlist-list {
  align-content: start;
  flex: 1;
}

.home-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #f4f8f5);
  padding: 14px;
}

body[data-theme="dark"] .home-panel header {
  background: linear-gradient(180deg, #18313b, #10242c);
}

.home-panel h3 {
  margin: 0;
  font-size: 17px;
}

.home-panel header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.home-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
  padding: 14px;
}

.home-signal-card,
.home-watchlist-row,
.home-flow-list button {
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbf9);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

body[data-theme="dark"] .home-signal-card,
body[data-theme="dark"] .home-watchlist-row,
body[data-theme="dark"] .home-flow-list button {
  border-color: rgba(116, 136, 140, 0.3);
  background: linear-gradient(180deg, #132126, #101a1d);
  color: #f5fbfb;
}

.home-signal-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 12px 12px 10px 42px;
}

.home-signal-card:hover,
.home-watchlist-row:hover,
.home-flow-list button:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.home-rank {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(180deg, #1f8cff, #1269d0);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.home-signal-card strong {
  overflow: hidden;
  color: var(--blue);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-signal-card strong em {
  color: var(--muted);
  font-style: normal;
}

.home-signal-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-signal-card div {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.home-signal-card i {
  margin-left: auto;
  color: #58a2ff;
  font-style: normal;
}

.home-momentum-svg {
  display: block;
  width: 100%;
  min-height: 320px;
  padding: 10px;
  cursor: grab;
  touch-action: none;
}

.home-momentum-svg:active {
  cursor: grabbing;
}

.home-map-wrap {
  position: relative;
  min-width: 0;
}

.home-map-actions {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 14px;
  display: flex;
  gap: 5px;
}

.home-map-legend {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.home-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.home-map-legend i {
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #c8d2d0;
}

.home-map-legend i.positive {
  background: #19a460;
}

.home-map-legend i.negative {
  background: #d95c5c;
}

.home-map-tooltip {
  position: absolute;
  z-index: 8;
}

.home-map-plot {
  fill: color-mix(in srgb, var(--surface-2) 86%, transparent);
  stroke: var(--line);
}

.home-map-grid {
  stroke: color-mix(in srgb, var(--line) 72%, transparent);
  stroke-width: 1;
}

.home-map-reference {
  stroke: color-mix(in srgb, var(--muted) 86%, transparent);
  stroke-width: 1.4;
  stroke-dasharray: 7 7;
}

.home-map-axis,
.home-map-point text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-map-point circle {
  fill: #c8d2d0;
  stroke: #ffffff;
  stroke-width: 1.5;
  opacity: 0.9;
}

.home-map-point {
  cursor: pointer;
}

.home-map-point circle.positive {
  fill: #19a460;
}

.home-map-point circle.negative {
  fill: #d95c5c;
}

.home-map-point:hover circle {
  stroke: #58a2ff;
  stroke-width: 2.5;
}

.home-watchlist-list,
.home-status-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.home-watchlist-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px 58px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
}

.home-watchlist-row strong {
  color: var(--blue);
  font-size: 12px;
}

.home-watchlist-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-watchlist-row b,
.home-watchlist-row em {
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.home-portfolio-list {
  display: grid;
  gap: 7px;
  padding: 12px 14px 14px;
}

.home-portfolio-row {
  display: grid;
  grid-template-columns:
    minmax(156px, 1fr)
    64px
    64px
    72px
    96px
    126px
    50px
    54px;
  gap: 4px;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(23, 33, 28, 0.12);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.home-portfolio-row:hover,
.home-portfolio-row.selected {
  border-color: #268ee8;
  box-shadow: inset 3px 0 #268ee8;
}

.home-portfolio-row strong,
.home-portfolio-row > span {
  min-width: 0;
}

.home-portfolio-row strong {
  color: var(--blue);
  font-size: 12px;
  white-space: nowrap;
}

.home-portfolio-row strong span {
  margin-left: 5px;
  color: var(--muted);
  font-weight: 700;
}

.home-portfolio-row > span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-portfolio-row > span:nth-child(7) {
  box-sizing: border-box;
  padding-left: 6px;
}

.home-portfolio-row b {
  color: var(--ink);
  font-size: 11px;
  text-transform: none;
  white-space: nowrap;
}

.home-portfolio-row b.gain,
body[data-theme="dark"] .home-portfolio-row b.gain {
  color: var(--green);
}

.home-portfolio-row b.loss,
body[data-theme="dark"] .home-portfolio-row b.loss {
  color: var(--red);
}

.home-portfolio-row .watchlist-quadrant {
  display: inline-block;
  width: fit-content;
  padding: 2px 5px;
  white-space: nowrap;
}

body[data-theme="dark"] .home-portfolio-row {
  border-color: rgba(116, 136, 140, 0.34);
  background: #101a1d;
  color: #f5fbfb;
}

body[data-theme="dark"] .home-portfolio-row b {
  color: #f5fbfb;
}

.portfolio-dialog {
  width: min(460px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  padding: 0;
}

.portfolio-dialog::backdrop {
  background: rgba(4, 10, 16, 0.7);
}

.portfolio-dialog-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.portfolio-dialog-card header,
.portfolio-dialog-card footer,
.portfolio-field-row {
  display: flex;
  gap: 12px;
}

.portfolio-dialog-card header {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.portfolio-dialog-card h3 {
  margin: 0;
  font-size: 17px;
}

.portfolio-dialog-card header span {
  color: var(--muted);
  font-size: 11px;
}

.portfolio-dialog-card label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.portfolio-dialog-card input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 10px;
}

.portfolio-dialog-card footer {
  justify-content: flex-end;
}

.dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
}

.home-flow-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.home-flow-list {
  display: grid;
  gap: 8px;
}

.home-flow-list h4 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.home-flow-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 10px;
}

.home-flow-list span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-flow-list b {
  color: #19a460;
  font-size: 12px;
}

.home-status-panel {
  min-height: 0;
}

.home-status-list div {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.home-status-list b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.home-empty-card,
.home-map-empty {
  grid-column: 1 / -1;
  padding: 18px;
}

.pulse-hero {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.7fr);
  gap: 16px;
  align-items: stretch;
  border: 1px solid rgba(88, 162, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 16, 32, 0.98), rgba(19, 41, 59, 0.94)),
    #081020;
  box-shadow: var(--shadow);
  color: #f8fbf8;
  padding: 18px;
  overflow: visible;
}

.tape-title-with-info {
  z-index: 5;
  align-items: center;
}

.tape-heading-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.tape-heading-block .pulse-kicker {
  display: inline-flex;
  margin: 0 0 10px;
}

.tape-history-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tape-history-row .pulse-kicker {
  margin-bottom: 10px;
}

.tape-history-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.tape-history-controls button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(88, 162, 255, 0.42);
  border-radius: 6px;
  background: rgba(8, 16, 32, 0.55);
  color: #f8fbf8;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.tape-history-controls button:hover:not(:disabled) {
  border-color: #58a2ff;
  background: rgba(26, 115, 232, 0.34);
}

.tape-history-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

.tape-history-controls span {
  min-width: 58px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.tape-live-context {
  margin-top: 6px !important;
  max-width: 620px;
  line-height: 1.4;
}

.tape-live-context strong {
  color: #f8fbf8;
}

body[data-theme="light"] .tape-history-controls button {
  border-color: rgba(26, 115, 232, 0.28);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

body[data-theme="light"] .tape-history-controls span,
body[data-theme="light"] .tape-live-context strong {
  color: var(--ink);
}

.tape-heading-block .tape-title-with-info {
  display: inline-flex;
}

.tape-heading-block .tape-title-with-info h3 {
  margin: 0 0 6px;
}

.tape-info-button {
  flex: 0 0 auto;
}

.tape-glossary-popover {
  top: calc(100% - 2px);
  width: min(660px, calc(100vw - 64px));
  min-width: 560px;
  padding: 10px;
}

.tape-glossary-popover table {
  font-size: 12px;
}

.tape-glossary-popover th,
.tape-glossary-popover td,
.tape-glossary-popover td:first-child,
.tape-glossary-popover th:first-child {
  padding: 7px 9px;
}

body[data-theme="light"] .pulse-hero {
  border-color: rgba(26, 115, 232, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 243, 249, 0.98)),
    #f4f8fb;
  color: var(--ink);
}

body[data-theme="light"] .pulse-hero .pulse-kicker {
  border-color: rgba(26, 115, 232, 0.22);
  background: rgba(26, 115, 232, 0.08);
  color: #245c9b;
}

body[data-theme="light"] .pulse-hero p,
body[data-theme="light"] .pulse-hero .pulse-status-line {
  color: var(--muted);
}

body[data-theme="light"] .pulse-hero .pulse-stat {
  border-color: rgba(23, 33, 28, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .pulse-hero .pulse-stat span,
body[data-theme="light"] .pulse-hero .pulse-stat em {
  color: var(--muted);
}

body[data-theme="light"] .pulse-hero .pulse-stat strong {
  color: var(--ink);
}

.statement-summary-wrap {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.statement-summary-wrap > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 10px 12px;
}

.statement-summary-wrap h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.statement-summary-wrap header span {
  color: var(--muted);
  font-size: 10px;
}

.statement-summary-scroll {
  overflow-x: auto;
}

.statement-summary-table {
  width: 100%;
  min-width: 430px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.statement-summary-table th,
.statement-summary-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3px 9px;
  font-size: 10px;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.statement-summary-table th:first-child {
  text-align: left;
}

.statement-summary-table thead th {
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--ink);
  font-weight: 850;
}

.statement-summary-table .statement-section th {
  background: color-mix(in srgb, var(--blue) 8%, var(--surface-2));
  color: var(--blue);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pulse-kicker {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pulse-hero h3 {
  margin: 12px 0 6px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.pulse-hero p {
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.pulse-hero .pulse-status-line {
  margin-top: 10px;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  line-height: 1.45;
}

.pulse-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pulse-stat {
  display: grid;
  align-content: center;
  min-height: 102px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
}

button.pulse-stat {
  cursor: pointer;
  text-align: left;
}

.pulse-stat.clickable:hover,
.pulse-stat.clickable:focus-visible {
  border-color: rgba(47, 153, 241, 0.68);
  background: rgba(47, 153, 241, 0.18);
  outline: none;
}

.pulse-stat span,
.pulse-stat em {
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.pulse-stat strong {
  margin: 7px 0 5px;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
}

.pulse-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  min-width: 0;
}

.trend-card {
  overflow: hidden;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trend-aggregate-card {
  grid-column: 1 / -1;
}

.trend-aggregate-card header span {
  max-width: none;
}

.trend-aggregate-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
}

.trend-aggregate-stats {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--line));
  overflow: hidden;
}

.trend-aggregate-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 12px;
}

.trend-aggregate-table th,
.trend-aggregate-table td {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  padding: 8px 9px;
  text-align: left;
}

.trend-aggregate-table thead th {
  background: color-mix(in srgb, var(--blue) 28%, var(--surface-2));
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.trend-aggregate-table tbody th {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-aggregate-table tbody td {
  color: var(--text);
  font-weight: 800;
}

.trend-aggregate-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface) 88%, var(--blue));
}

.trend-aggregate-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 96%, var(--blue));
}

body[data-theme="dark"] .trend-aggregate-table thead th {
  background: color-mix(in srgb, var(--blue) 22%, var(--surface-2));
  color: var(--ink);
}

body[data-theme="dark"] .trend-aggregate-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface) 82%, var(--blue));
}

body[data-theme="dark"] .trend-aggregate-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 92%, var(--blue));
}

.trend-aggregate-count {
  display: grid;
  min-width: 78px;
  justify-items: end;
  align-content: center;
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.trend-aggregate-count b {
  color: var(--text);
  font-size: 19px;
  line-height: 1;
}

.trend-aggregate-count small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.trend-aggregate-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.trend-aggregate-actions .trend-aggregate-count {
  order: 2;
}

.trend-momentum-map-button {
  order: 1;
  white-space: nowrap;
}

#trendAggregateCanvas {
  display: block;
  width: 100%;
  min-height: 220px;
  height: 100%;
  border-radius: 6px;
}

.trend-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f6faf7, #edf5f1);
  padding: 10px 12px;
}

.trend-card header > div {
  flex: 1 1 auto;
  min-width: 0;
}

.trend-card header > .trend-identity {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

body[data-theme="dark"] .trend-card header,
body[data-theme="dark"] .pulse-card header,
body[data-theme="dark"] .analysis-top,
body[data-theme="dark"] .analysis-signal-strip,
body[data-theme="dark"] .criteria-header,
body[data-theme="dark"] .data-card header {
  background: linear-gradient(180deg, #142429, #102025);
}

body[data-theme="dark"] .quote-grid div,
body[data-theme="dark"] .criteria-grid div,
body[data-theme="dark"] .analysis-signal-card,
body[data-theme="dark"] .pulse-empty,
body[data-theme="dark"] .ownership-link-card,
body[data-theme="dark"] .trend-pagination button {
  background: #10181b;
}

body[data-theme="dark"] .analysis-top {
  background: #155b80;
  color: #f6fbff;
}

body[data-theme="dark"] table {
  color: var(--ink);
}

body[data-theme="dark"] thead th,
body[data-theme="dark"] table th,
body[data-theme="dark"] .quote-table th,
body[data-theme="dark"] .fscore-table th,
body[data-theme="dark"] .data-table th,
body[data-theme="dark"] .data-card .data-table th {
  border-color: rgba(116, 136, 140, 0.34);
  background: #142126;
  color: #f2f8f8;
}

body[data-theme="dark"] table td,
body[data-theme="dark"] .quote-table td,
body[data-theme="dark"] .fscore-table td,
body[data-theme="dark"] .data-table td,
body[data-theme="dark"] .data-card .data-table td {
  border-color: rgba(116, 136, 140, 0.28);
  background: #0f181b;
  color: #d8e4e4;
}

body[data-theme="dark"] .quote-table .quote-band,
body[data-theme="dark"] .fscore-table .section-row td {
  background: #18496e;
  color: #ffffff;
}

.trend-card h3 {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.12;
  overflow: visible;
  white-space: nowrap;
}

.trend-card .trend-identity {
  overflow: visible;
}

.trend-card h3 .trend-company-inline {
  display: inline;
  min-width: 0;
  margin: 0;
  color: #6a7978;
  font-size: inherit;
  font-weight: 800;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

body[data-theme="dark"] .trend-card h3 .trend-company-inline {
  color: #9aabad;
}

.trend-card .trend-identity > span {
  display: block;
  overflow: visible;
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.6px;
  font-weight: 400;
  line-height: 1.18;
  text-overflow: clip;
  white-space: nowrap;
}

.trend-compact-stats {
  display: grid;
  grid-template-columns: 74px 58px 34px 34px;
  align-items: end;
  justify-content: start;
  gap: 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.08;
  white-space: nowrap;
}

.trend-compact-stats > span,
.trend-compact-stats em,
.trend-compact-stats b {
  display: block;
  min-width: 0;
  font-style: normal;
  text-align: left;
}

.trend-compact-stats > span {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: start;
  align-items: start;
  gap: 2px;
  padding: 0;
  margin: 0;
}

.trend-compact-stats em {
  color: #7f9897;
}

.trend-compact-stats b {
  margin: 0;
  color: #178a72;
  overflow: visible;
  text-overflow: clip;
}

.trend-compact-stats .trend-current-price {
  color: #10a878;
}

.trend-compact-stats .trend-price-gain {
  color: #10a878;
}

.trend-compact-stats .trend-price-loss {
  color: #c43b3b;
}

.trend-compact-stats .trend-price-flat {
  color: #178a72;
}

body[data-theme="dark"] .trend-compact-stats b {
  color: #58dca4;
}

body[data-theme="dark"] .trend-compact-stats .trend-price-gain {
  color: #58dca4;
}

body[data-theme="dark"] .trend-compact-stats .trend-price-loss {
  color: #ff7770;
}

body[data-theme="dark"] .trend-compact-stats .trend-price-flat {
  color: #a5ddff;
}

body[data-theme="dark"] .trend-compact-stats em {
  color: #8fb4b9;
}

body[data-theme="dark"] .trend-compact-stats .trend-market-cap-value {
  color: #a5ddff !important;
}

.trend-meta-row {
  grid-column: 1;
  grid-row: 2;
  display: block;
  max-width: 255px;
  min-width: 0;
  margin-top: 1px;
  overflow: hidden;
}

.trend-meta-row small {
  flex: 0 0 auto;
  margin-top: 0 !important;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.trend-card header em {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px;
  color: var(--green);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.trend-card header em b {
  flex-basis: 100%;
  font-size: 13px;
  text-align: right;
}

.trend-card header em b.gain {
  color: #007b46;
}

.trend-card header em b.loss {
  color: #c43b3b;
}

body[data-theme="dark"] .trend-card header em b.gain {
  color: #3de08a;
}

body[data-theme="dark"] .trend-card header em b.loss {
  color: #ff7770;
}

.trend-card header em small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.trend-kpi-strip {
  display: inline-flex !important;
  align-items: stretch;
  align-self: auto;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: none !important;
  margin: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.trend-kpi-strip .trend-kpi-pair {
  box-sizing: border-box;
  display: grid !important;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px;
  flex: 0 0 116px;
  min-width: 116px;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 5px;
  background: rgba(18, 42, 47, 0.08);
  padding: 3px 8px;
  overflow: hidden !important;
  color: var(--muted) !important;
}

.trend-kpi-strip .trend-kpi-pair:first-child {
  flex-basis: 130px;
  min-width: 130px;
}

.trend-kpi-strip .trend-kpi-pair > span {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: inherit !important;
}

.trend-kpi-strip b {
  overflow: visible;
  flex-basis: auto !important;
  color: #1f88ff;
  font-size: inherit !important;
  text-align: inherit !important;
  text-overflow: clip;
}

.trend-kpi-strip .trend-market-cap-value {
  color: #113d5c !important;
}

.trend-kpi-strip .trend-price-gain {
  color: #007b46 !important;
}

.trend-kpi-strip .trend-price-loss {
  color: #c43b3b !important;
}

.trend-kpi-strip .trend-price-flat,
.trend-kpi-strip .trend-ratio-blue {
  color: #1976d2 !important;
}

body[data-theme="dark"] .trend-kpi-strip .trend-price-gain {
  color: #3de08a !important;
}

body[data-theme="dark"] .trend-kpi-strip .trend-price-loss {
  color: #ff7770 !important;
}

body[data-theme="dark"] .trend-kpi-strip .trend-price-flat,
body[data-theme="dark"] .trend-kpi-strip .trend-ratio-blue {
  color: #58b7ff !important;
}

body[data-theme="dark"] .trend-kpi-strip .trend-market-cap-value {
  color: #e8f4f3 !important;
}

body[data-theme="dark"] .trend-kpi-strip .trend-kpi-pair {
  background: rgba(9, 32, 39, 0.92);
  color: #9fb2b5 !important;
}

.trend-fundamentals-button {
  justify-self: end;
  min-height: 20px;
  border: 1px solid #8cc8ff;
  border-radius: 7px;
  background: linear-gradient(180deg, #f8fbff, #d8ecff);
  color: #0b5d9c;
  cursor: pointer;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 600;
}

.trend-fundamentals-button:hover {
  background: #ffffff;
}

body[data-theme="dark"] .trend-fundamentals-button {
  border-color: #2aa4ff;
  background: linear-gradient(180deg, #249eff, #1681e2);
  color: #d7e7f4;
}

.trend-card header small {
  display: block;
  margin-top: 3px;
  color: #7d8983;
  font-size: 10px;
  font-weight: 700;
}

.trend-canvas {
  display: block;
  width: 100%;
  height: 213px;
}

.trend-tooltip {
  position: fixed;
  z-index: 30;
  min-width: 168px;
  max-width: 208px;
  padding: 8px 9px;
  font-size: 11px;
}

.trend-tooltip strong {
  margin-bottom: 5px;
  font-size: 12px;
}

.trend-tooltip div {
  gap: 10px;
  margin-top: 2px;
}

.trend-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.trend-basket-info,
.trend-pagination {
  grid-column: 1 / -1;
}

.trend-basket-info {
  position: sticky;
  z-index: 12;
  top: 48px;
  display: grid;
  gap: 18px;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 243, 0.94)),
    #fff;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.trend-basket-toolbar,
.trend-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trend-basket-toolbar {
  justify-content: space-between;
}

.trend-toolbar-right {
  margin-left: auto;
}

.trend-basket-info span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-basket-info strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.trend-basket-info p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.trend-basket-info .refresh-status-line {
  color: #879894;
  font-size: 11px;
}

body[data-theme="dark"] .trend-basket-info .refresh-status-line {
  color: #8fb2bb;
}

.trend-sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trend-ticker-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

.trend-asset-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-asset-filter select {
  min-height: 32px;
  border: 1px solid rgba(35, 80, 116, 0.28);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 26px 0 9px;
  font-size: 11px;
  font-weight: 800;
}

.trend-ticker-form input,
.trend-ticker-form select {
  width: 190px;
  min-height: 32px;
  border: 1px solid rgba(35, 80, 116, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.trend-ticker-form select {
  width: 150px;
  text-transform: none;
}

.trend-ticker-form button {
  min-height: 32px;
  border: 1px solid rgba(35, 80, 116, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #2b5f8f;
  cursor: pointer;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 850;
}

.trend-sort-controls span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trend-sort-controls button {
  border: 1px solid rgba(35, 80, 116, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #2b5f8f;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 850;
}

.trend-sort-controls button:hover,
.trend-sort-controls button.active {
  border-color: #7eb5e4;
  background: #eaf4fd;
  color: #195e9b;
}

body[data-theme="dark"] .trend-sort-controls span {
  color: #8fa6aa;
}

body[data-theme="dark"] .trend-sort-controls button {
  border-color: rgba(63, 142, 206, 0.34);
  background: #142831;
  color: #b9d9f3;
}

body[data-theme="dark"] .trend-ticker-form input,
body[data-theme="dark"] .trend-ticker-form select {
  border-color: rgba(63, 142, 206, 0.34);
  background: #102126;
  color: #edf6f6;
}

body[data-theme="dark"] .trend-ticker-form button {
  border-color: rgba(63, 142, 206, 0.34);
  background: #142831;
  color: #b9d9f3;
}

body[data-theme="dark"] .trend-ticker-form button:hover {
  border-color: #2f99f1;
  background: #1f5e8f;
  color: #ffffff;
}

body[data-theme="dark"] .trend-sort-controls button:hover,
body[data-theme="dark"] .trend-sort-controls button.active {
  border-color: #2f99f1;
  background: #1f5e8f;
  color: #ffffff;
}

.trend-process-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  border: 1px solid rgba(94, 108, 101, 0.32);
  border-radius: 999px;
  color: #9aa6a0;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
  cursor: help;
}

.trend-watchlist-panel {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.trend-watchlist-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.trend-watchlist-panel h3 {
  margin: 0;
  font-size: 16px;
}

.trend-watchlist-panel header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.watchlist-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.watchlist-add-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.watchlist-add-form input {
  width: 108px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.watchlist-periods {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.watchlist-periods button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 850;
}

.watchlist-periods button:hover,
.watchlist-periods button.active {
  border-color: var(--blue);
  background: #e9f4ff;
  color: #155f9f;
}

.trend-watchlist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  padding: 14px;
}

.trend-watchlist-grid .pulse-empty {
  grid-column: 1 / -1;
}

.trend-watchlist-tile {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(128px, 0.85fr);
  gap: 4px 18px;
  align-items: center;
  min-height: 110px;
  border: 1px solid rgba(23, 33, 28, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.market-watchlist-tile {
  cursor: pointer;
}

.market-watchlist-tile.selected {
  border-color: #1d8fdf;
  box-shadow: inset 0 0 0 1px rgba(29, 143, 223, 0.7);
}

.trend-watchlist-tile strong {
  display: block;
  color: var(--blue);
  font-size: 13px;
}

.trend-watchlist-tile strong span {
  display: inline;
  margin: 0;
  color: var(--muted);
  font-size: inherit;
  font-weight: 800;
}

.trend-watchlist-tile span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.trend-watchlist-tile em {
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.watchlist-left,
.watchlist-right {
  display: grid;
  gap: 4px;
}

.watchlist-right {
  justify-items: end;
  text-align: right;
}

.watchlist-quadrant {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 850;
}

.watchlist-quadrant.dead {
  color: #5f7770;
}

.watchlist-quadrant.distribution {
  color: #b95e55;
}

.watchlist-quadrant.fading {
  color: #a87910;
}

.watchlist-quadrant.breakout {
  color: #16804a;
}

body[data-theme="dark"] .watchlist-quadrant.dead {
  color: #91a6a0;
}

body[data-theme="dark"] .watchlist-quadrant.distribution {
  color: #ff8c83;
}

body[data-theme="dark"] .watchlist-quadrant.fading {
  color: #ffd966;
}

body[data-theme="dark"] .watchlist-quadrant.breakout {
  color: #55d98f;
}

.trend-watchlist-tile em.gain {
  color: var(--green);
}

.trend-watchlist-tile em.loss {
  color: var(--red);
}

.watchlist-remove {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 10px;
  font-weight: 850;
}

.watchlist-remove:hover {
  color: var(--red);
}

.trend-watchlist-tile small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trend-watchlist-tile small b {
  color: var(--ink);
  font-weight: 900;
}

.trend-plot-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 0;
}

.trend-plot-actions button {
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(21, 93, 147, 0.35);
  border-radius: 7px;
  background: rgba(232, 244, 255, 0.9);
  color: #155d93;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.trend-plot-actions button:hover {
  border-color: #1b7fcc;
  background: #dcefff;
}

.trend-plot-actions .trend-watchlist-add {
  padding: 0;
}

.watch-eye-icon {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 70% 18% 70% 18%;
  transform: rotate(45deg);
}

.watch-eye-icon::after {
  position: absolute;
  inset: -3px;
  display: grid;
  place-items: center;
  background: transparent;
  color: currentColor;
  content: "+";
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-45deg);
}

.watch-eye-icon i {
  display: none;
}

.trend-plot-actions .trend-watchlist-add.active {
  border-color: #15945b;
  color: #15945b;
}

.map-size-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  margin-left: 4px;
  border: 1px solid rgba(89, 112, 107, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.map-size-control select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.map-actions #mapIndustryFilter {
  width: 148px;
}

body[data-theme="dark"] .map-size-control {
  border-color: #3b6c81;
  background: #17303a;
  color: #c5d7dc;
}

body[data-theme="dark"] .map-size-control select {
  color: #edf6f6;
}

.map-search-control {
  display: inline-flex;
  height: 26px;
  margin-left: 4px;
}

.map-search-control input {
  width: 170px;
  height: 26px;
  border: 1px solid rgba(89, 112, 107, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0 9px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  outline: none;
}

.map-search-control input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.14);
}

body[data-theme="dark"] .map-search-control input {
  border-color: #3b6c81;
  background: #17303a;
  color: #edf6f6;
}

body[data-theme="dark"] .map-search-control input::placeholder {
  color: #9fb6bd;
}

body[data-theme="dark"] .trend-watchlist-panel {
  border-color: #304a53;
  background: #13242a;
}

body[data-theme="dark"] .trend-watchlist-panel header {
  border-color: #304a53;
  background: #17303a;
}

body[data-theme="dark"] .watchlist-periods button {
  border-color: #42606a;
  background: #1b333c;
  color: #f5fbfc;
}

body[data-theme="dark"] .watchlist-add-form input {
  border-color: #42606a;
  background: #102126;
  color: #edf6f6;
}

body[data-theme="dark"] .watchlist-periods button:hover,
body[data-theme="dark"] .watchlist-periods button.active {
  border-color: #67bdff;
  background: linear-gradient(180deg, #1e93e7, #1266aa);
  color: #ffffff;
}

body[data-theme="dark"] .trend-watchlist-tile {
  border-color: #314e57;
  background: #102126;
}

body[data-theme="dark"] .trend-watchlist-tile.selected {
  border-color: #5fb5ff;
  background: #12313d;
}

body[data-theme="dark"] .trend-watchlist-tile small b {
  color: #e9f5f5;
}

body[data-theme="dark"] .trend-plot-actions button {
  border-color: #3b6c81;
  background: #17303a;
  color: #d8edf5;
}

body[data-theme="dark"] .trend-plot-actions button:hover {
  border-color: #5fb5ff;
  background: #1f4a60;
}

.trend-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  overflow: hidden;
  padding: 10px 0 4px;
}

.trend-pagination button {
  min-width: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 850;
}

.trend-pagination button.jump {
  min-width: 42px;
}

.trend-pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.trend-pagination button.active {
  border-color: #3268a8;
  background: #3268a8;
  color: #fff;
}

.pulse-card.wide {
  grid-column: span 3;
  min-height: 220px;
}

.pulse-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #f4f8f5);
  padding: 14px;
}

.pulse-card h3 {
  letter-spacing: 0;
}

.pulse-card header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.pulse-card-title {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  text-align: left;
}

.pulse-card-title:hover {
  color: var(--blue);
}

.pulse-bars {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.pulse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.pulse-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px 12px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.pulse-row-main[data-pulse-select] {
  cursor: pointer;
}

.pulse-row-main[data-pulse-select]:hover strong {
  color: var(--blue);
}

.pulse-row-main div:first-child {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
}

.pulse-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-row span,
.pulse-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.pulse-track {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: #e5ebe7;
  overflow: hidden;
}

body[data-theme="dark"] .pulse-track {
  background: rgba(226, 238, 235, 0.86);
}

body[data-theme="dark"] .pulse-row strong {
  color: #f8fbfb;
}

body[data-theme="dark"] .pulse-row span,
body[data-theme="dark"] .pulse-row em {
  color: #b7c8cb;
}

body[data-theme="dark"] .pulse-row-main[data-pulse-select]:hover strong,
body[data-theme="dark"] .pulse-card-title:hover {
  color: #42a5ff;
}

.pulse-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f83df, #19a460);
}

.watch-trend-button {
  min-width: 58px;
  min-height: 34px;
  border: 1px solid #9ec5f3;
  border-radius: 8px;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  color: #155ea8;
  cursor: pointer;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.watch-trend-button:hover {
  border-color: #1a73e8;
  background: #dcebff;
}

body[data-theme="dark"] .watch-trend-button {
  border-color: #68b1ff;
  background: linear-gradient(180deg, #1f8cff, #1269d0);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(88, 162, 255, 0.18), 0 5px 14px rgba(0, 0, 0, 0.22);
}

body[data-theme="dark"] .watch-trend-button:hover {
  border-color: #7ec9ff;
  background: linear-gradient(180deg, #3aa4ff, #167ce0);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(126, 201, 255, 0.26), 0 7px 18px rgba(0, 0, 0, 0.28);
}

.watch-trend-button.compact {
  align-self: flex-start;
}

.pulse-card-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.pulse-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pulse-toolbar-actions .watch-trend-button {
  min-height: 28px;
  padding: 5px 10px;
}

.pulse-cap-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.pulse-cap-filter button {
  min-height: 28px;
  border: 1px solid rgba(23, 33, 28, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.pulse-cap-filter button:hover,
.pulse-cap-filter button.active {
  border-color: rgba(25, 164, 96, 0.45);
  background: #eaf7ef;
  color: #127840;
}

body[data-theme="dark"] .pulse-cap-filter button {
  border-color: #3f5c65;
  background: #14272e;
  color: #c9dadd;
}

body[data-theme="dark"] .pulse-cap-filter button:hover,
body[data-theme="dark"] .pulse-cap-filter button.active {
  border-color: #70d7a8;
  background: #dff6eb;
  color: #0c7041;
}

.pulse-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  padding: 14px;
}

.pulse-table button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 3px 10px;
  align-items: center;
  min-height: 64px;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbf9);
  color: var(--ink);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

body[data-theme="dark"] .pulse-table button {
  border-color: rgba(116, 136, 140, 0.28);
  background: linear-gradient(180deg, #132126, #101a1d);
  color: #f5fbfb;
}

body[data-theme="dark"] .pulse-table button:hover {
  border-color: #4fa8ff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .pulse-table strong {
  color: #57b4ff;
}

body[data-theme="dark"] .pulse-table span,
body[data-theme="dark"] .pulse-table small,
body[data-theme="dark"] .pulse-table em b {
  color: #b8c9cc;
}

.pulse-table button:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.08);
  transform: translateY(-1px);
}

.pulse-table button.selected,
.pulse-table .leader-tile.selected {
  border-color: #1d8fdf;
  box-shadow: inset 0 0 0 1px rgba(29, 143, 223, 0.7), 0 10px 24px rgba(23, 33, 28, 0.08);
}

body[data-theme="dark"] .pulse-table button.selected,
body[data-theme="dark"] .pulse-table .leader-tile.selected {
  border-color: #4fa8ff;
  background: linear-gradient(180deg, #173040, #102128);
  box-shadow: inset 0 0 0 1px rgba(79, 168, 255, 0.75), 0 12px 26px rgba(0, 0, 0, 0.28);
}

.pulse-table strong {
  color: var(--blue);
  font-size: 12px;
}

.pulse-table span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-table em {
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.pulse-table .rel-volume-value.positive {
  color: #15945b;
}

.pulse-table .rel-volume-value.negative {
  color: #d54949;
}

body[data-theme="dark"] .pulse-table .rel-volume-value.positive {
  color: #45df92;
}

body[data-theme="dark"] .pulse-table .rel-volume-value.negative {
  color: #ff7770;
}

.pulse-table em b {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.pulse-table small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafcfa;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.intelligence-grid {
  display: grid;
  gap: 14px;
}

.intelligence-hero,
.intelligence-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intelligence-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(520px, 1.35fr);
  gap: 12px;
  align-items: stretch;
  padding: 18px;
}

.intelligence-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 8px;
}

.intelligence-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 14px;
}

.intelligence-filter-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.intelligence-filter-row button,
.intelligence-metric {
  cursor: pointer;
}

.intelligence-filter-row button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 850;
}

.intelligence-filter-row button.active,
.intelligence-metric.active {
  border-color: #1d8fdf;
  box-shadow: inset 0 0 0 1px rgba(29, 143, 223, 0.48);
}

.intelligence-hero > div:first-child span,
.intelligence-panel header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.intelligence-hero h3 {
  margin: 6px 0;
  font-size: 24px;
}

.intelligence-hero p {
  max-width: 760px;
  color: var(--muted);
}

.intelligence-metric {
  display: grid;
  width: 100%;
  text-align: left;
  gap: 3px;
  align-content: center;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #f6faf8);
}

.intelligence-metric span,
.intelligence-metric small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
}

.intelligence-metric strong {
  font-size: 21px;
}

.intelligence-panel {
  overflow: hidden;
}

.intelligence-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.intelligence-panel h3 {
  margin-bottom: 3px;
  font-size: 16px;
}

.intelligence-title-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.intelligence-title-info h3 {
  margin: 0;
}

.intelligence-panel-popover {
  max-width: 300px;
  font-size: 12px;
  line-height: 1.45;
}

.intelligence-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
}

.intelligence-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(23, 33, 28, 0.18);
  border-radius: 8px;
  padding: 24px 10px 10px;
  background: linear-gradient(180deg, #ffffff, #f7fbf9);
  cursor: pointer;
}

.intelligence-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: #e9f3ff;
  color: #1769b1;
  font-size: 11px;
  font-weight: 900;
}

.intelligence-main h4 {
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.2;
}

.intelligence-main h4 span,
.intelligence-main p,
.intelligence-risk {
  color: var(--muted);
}

.intelligence-main p {
  font-size: 10.5px;
}

.intelligence-main p b {
  color: var(--text);
}

.intelligence-flow,
.intelligence-chips,
.intelligence-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.intelligence-flow {
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.intelligence-chips {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  margin-right: 0;
}

.intelligence-flow > span:not(.quadrant-pill) {
  flex: 0 0 auto;
}

.intelligence-flow .quadrant-pill {
  min-height: 22px;
  max-width: 132px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
}

.intelligence-chips span {
  min-width: 0;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 999px;
  padding: 3px 5px;
  background: #f2f7f5;
  color: #52635d;
  font-size: 9.2px;
  font-weight: 800;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intelligence-chips span.positive {
  border-color: rgba(22, 128, 74, 0.28);
  background: rgba(22, 128, 74, 0.11);
  color: var(--green);
}

.intelligence-chips span.negative {
  border-color: rgba(196, 63, 55, 0.28);
  background: rgba(196, 63, 55, 0.11);
  color: var(--red);
}

.intelligence-chips span.neutral {
  color: var(--muted);
}

.intelligence-risk {
  margin-top: 8px;
  font-size: 12px;
}

.intelligence-brief {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.intelligence-brief p {
  margin: 0;
  color: var(--muted);
  font-size: 10.8px;
  line-height: 1.35;
}

.intelligence-brief b {
  color: var(--ink);
}

.intelligence-score {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.intelligence-score strong {
  color: var(--green);
  font-size: 17px;
}

.intelligence-score span,
.intelligence-score em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.intelligence-score em {
  color: var(--blue);
}

.intelligence-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 4px;
}

.intelligence-mini-metrics {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  text-align: right;
}

.intelligence-mini-metrics span {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: none;
}

.intelligence-mini-metrics b {
  color: var(--text);
  min-width: 48px;
}

.intelligence-mini-metrics b.gain {
  color: var(--green);
}

.intelligence-mini-metrics b.loss {
  color: var(--red);
}

.intelligence-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  min-width: 0;
  margin-top: 2px;
}

.intelligence-actions button {
  border: 1px solid rgba(32, 125, 207, 0.38);
  border-radius: 8px;
  background: #eef6ff;
  color: #1b67a6;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  padding: 6px 8px;
}

.intelligence-actions button:hover {
  border-color: #1d8fdf;
  background: #dfefff;
}

.intelligence-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.intelligence-card.selected {
  border-color: rgba(29, 143, 223, 0.72);
  box-shadow: 0 0 0 2px rgba(29, 143, 223, 0.16);
}

.projected-quadrant {
  border-width: 2px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.55);
}

.projected-quadrant.dead {
  border-color: #6d807a;
  background: rgba(169, 186, 181, 0.22);
}

.projected-quadrant.distribution {
  border-color: #df2d20;
  background: rgba(243, 98, 83, 0.14);
}

.projected-quadrant.fading {
  border-color: #e0a100;
  background: rgba(244, 197, 54, 0.18);
}

.projected-quadrant.breakout {
  border-color: #0d8d52;
  background: rgba(42, 174, 110, 0.16);
}

.intelligence-path-modes {
  display: inline-flex;
  gap: 4px;
  margin-left: 2px;
}

.intelligence-path-modes button {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf8;
  color: var(--text);
  cursor: pointer;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 850;
}

.intelligence-map-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 46px;
  padding: 10px 92px;
}

.intelligence-map-controls .map-size-control {
  margin-left: 0;
}

.intelligence-path-modes button.active {
  border-color: #1d8fdf;
  background: #e7f3ff;
  color: #0d5e9d;
}

body[data-theme="dark"] .mini-button {
  border-color: rgba(134, 171, 181, 0.42);
  background: #172a30;
  color: #e6f3f2;
}

body[data-theme="dark"] .mini-button.active {
  border-color: #67bdff;
  background: linear-gradient(180deg, #1e93e7, #1266aa);
  color: #fff;
}

.intelligence-map-panel #intelligenceMapCanvas {
  width: 100%;
  height: 840px;
  display: block;
}

.intelligence-map-legend {
  padding: 0 18px 14px;
}

.legend-size,
.legend-projection {
  display: inline-block;
  vertical-align: middle;
}

.legend-size {
  border: 2px solid rgba(50, 104, 168, 0.9);
  border-radius: 999px;
  background: rgba(50, 104, 168, 0.45);
}

.legend-size.small {
  width: 10px;
  height: 10px;
}

.legend-size.large {
  width: 19px;
  height: 19px;
}

.legend-projection {
  width: 28px;
  height: 14px;
  border: 2px dashed var(--green);
  border-radius: 999px;
  background: rgba(42, 174, 110, 0.16);
}

.intelligence-logic-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 10px;
  padding: 12px;
}

.intelligence-logic-table article {
  border: 1px solid rgba(23, 33, 28, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf9;
}

.intelligence-logic-table strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.intelligence-logic-table p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

body[data-theme="dark"] .intelligence-hero,
body[data-theme="dark"] .intelligence-panel {
  border-color: rgba(138, 160, 166, 0.42);
  background: linear-gradient(180deg, rgba(35, 52, 57, 0.98), rgba(25, 39, 43, 0.98));
}

body[data-theme="dark"] .intelligence-metric,
body[data-theme="dark"] .intelligence-card {
  border-color: rgba(150, 170, 176, 0.42);
  background: linear-gradient(180deg, #1b3035, #14262a);
}

body[data-theme="dark"] .intelligence-filter-row button,
body[data-theme="dark"] .intelligence-path-modes button {
  border-color: rgba(126, 151, 156, 0.42);
  background: #14252a;
  color: #d9e7e7;
}

body[data-theme="dark"] .intelligence-filter-row button.active,
body[data-theme="dark"] .intelligence-path-modes button.active,
body[data-theme="dark"] .intelligence-metric.active {
  border-color: #4fa8ff;
  background: #173040;
  color: #d8efff;
}

body[data-theme="dark"] .intelligence-rank {
  background: #18598f;
  color: #f5fbff;
}

body[data-theme="dark"] .intelligence-chips span {
  border-color: rgba(126, 151, 156, 0.26);
  background: rgba(255, 255, 255, 0.045);
  color: #b8c9cc;
}

body[data-theme="dark"] .intelligence-chips span.positive {
  border-color: rgba(66, 184, 120, 0.38);
  background: rgba(66, 184, 120, 0.12);
  color: #68d89b;
}

body[data-theme="dark"] .intelligence-chips span.negative {
  border-color: rgba(225, 102, 95, 0.38);
  background: rgba(225, 102, 95, 0.12);
  color: #ff8a83;
}

body[data-theme="dark"] .intelligence-actions button {
  border-color: rgba(79, 168, 255, 0.44);
  background: #173040;
  color: #a9d8ff;
}

body[data-theme="dark"] .intelligence-actions button:hover {
  background: #21445a;
  color: #ffffff;
}

body[data-theme="dark"] .intelligence-card.selected {
  border-color: rgba(72, 166, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(72, 166, 255, 0.22);
}

body[data-theme="dark"] .projected-quadrant {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .projected-quadrant.dead {
  border-color: #c5d3ce;
  background: rgba(169, 186, 181, 0.1);
}

body[data-theme="dark"] .projected-quadrant.distribution {
  border-color: #ff7b70;
  background: rgba(243, 98, 83, 0.1);
}

body[data-theme="dark"] .projected-quadrant.fading {
  border-color: #ffd35a;
  background: rgba(244, 197, 54, 0.12);
}

body[data-theme="dark"] .projected-quadrant.breakout {
  border-color: #54e096;
  background: rgba(42, 174, 110, 0.11);
}

body[data-theme="dark"] .intelligence-logic-table article {
  border-color: rgba(150, 170, 176, 0.36);
  background: linear-gradient(180deg, #1b3035, #14262a);
}

.analysis-card {
  min-width: 0;
  overflow: hidden;
}

.analysis-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  background: #000;
  padding: 12px;
  color: #f6fbff;
}

.score-badge {
  display: grid;
  min-width: 58px;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
}

.quote-grid,
.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}

.quote-grid div,
.criteria-grid div {
  min-height: 28px;
  background: #fff;
  padding: 7px 9px;
  font-size: 12px;
}

.quote-grid span,
.criteria-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.quote-grid strong,
.criteria-grid strong {
  color: var(--ink);
}

.chart-stack {
  display: grid;
  gap: 12px;
  background: transparent;
  padding: 12px;
}

.analysis-signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  border-bottom: 1px solid rgba(216, 223, 218, 0.8);
  background: #f9fbf9;
  padding: 10px 12px;
}

.analysis-signal-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.analysis-signal-card time {
  display: block;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.analysis-signal-card strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-signal-card p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.analysis-more-news {
  align-self: stretch;
  border: 1px solid #a9c9eb;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5faff, #e6f2ff);
  color: #1b66a8;
  cursor: pointer;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.analysis-more-news:hover {
  border-color: #3268a8;
  background: #ffffff;
}

body[data-theme="dark"] .analysis-more-news {
  border-color: #78b7f4;
  background: linear-gradient(180deg, #eaf5ff, #d8ecff);
  color: #1a68ab;
}

body[data-theme="dark"] .analysis-signal-strip {
  border-bottom-color: rgba(116, 136, 140, 0.28);
  background: #102126;
}

body[data-theme="dark"] .analysis-signal-card {
  border-color: #304a53;
  background: #102126;
}

body[data-theme="dark"] .analysis-signal-card strong {
  color: #f0f7f7;
}

body[data-theme="dark"] .analysis-signal-card p {
  color: #b8c8ca;
}

.mini-chart {
  position: relative;
  aspect-ratio: 2 / 1.3;
  min-height: 0;
  background: #000;
  border: 1px solid #555b56;
  border-radius: 4px;
  overflow: hidden;
}

body[data-theme="dark"] .mini-chart {
  background: #252f2b;
  border-color: #4d5c55;
}

.mini-chart.tall {
  aspect-ratio: 2 / 1.3;
}

.mini-chart header {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f5d04f;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.chart-actions {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}

.mini-button {
  min-width: 24px;
  height: 24px;
  border-color: rgba(43, 67, 74, 0.28);
  background: rgba(255, 255, 255, 0.92);
  color: #17211c;
  font-size: 12px;
  font-weight: 900;
}

.mini-button.active {
  border-color: rgba(29, 143, 223, 0.82);
  background: #17211c;
  color: #fff;
}

body[data-theme="dark"] .mini-button {
  border-color: rgba(134, 171, 181, 0.42);
  background: #172a30;
  color: #e6f3f2;
}

body[data-theme="dark"] .mini-button.active {
  border-color: #67bdff;
  background: linear-gradient(180deg, #1e93e7, #1266aa);
  color: #fff;
}

.mini-chart canvas {
  min-height: 0;
  cursor: grab;
}

.mini-chart canvas:active {
  cursor: grabbing;
}

.news-card {
  display: flex;
  min-height: 520px;
  flex-direction: column;
  overflow: hidden;
}

.market-news-card {
  min-height: 430px;
}

.news-card header {
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
  padding: 14px;
}

body[data-theme="dark"] .news-card header,
body[data-theme="dark"] .data-card header,
body[data-theme="dark"] .positioning-card header,
body[data-theme="dark"] .analysis-header,
body[data-theme="dark"] .pulse-card header,
body[data-theme="dark"] .trend-card header {
  border-bottom-color: rgba(116, 136, 140, 0.34);
  background: linear-gradient(180deg, #1b2a2f, #142126);
}

body[data-theme="dark"] .news-card header h3,
body[data-theme="dark"] .data-card h3,
body[data-theme="dark"] .positioning-card h3,
body[data-theme="dark"] .pulse-card h3,
body[data-theme="dark"] .pulse-card-title {
  color: #f5fbfb;
}

body[data-theme="dark"] .news-card header span,
body[data-theme="dark"] .data-card header span,
body[data-theme="dark"] .positioning-card header span,
body[data-theme="dark"] .pulse-card header span {
  color: #9fcfff;
}

.news-card header span {
  color: var(--muted);
  font-size: 12px;
}

.news-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.news-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.news-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.news-item.signal-copy {
  background: #f8fbf8;
}

.news-item time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.news-item h3 {
  margin-top: 6px;
  line-height: 1.25;
}

.news-item p {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

.news-more-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7fb;
  color: #155d93;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.news-more-button:hover {
  border-color: var(--blue);
  background: #dff0f8;
}

body[data-theme="dark"] .news-more-button {
  border-color: #315565;
  background: #16333c;
  color: #f4fbff;
}

body[data-theme="dark"] .news-more-button:hover {
  border-color: #5fb5ff;
  background: #1d4a59;
}

.source-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

body[data-theme="dark"] .source-pill,
body[data-theme="dark"] .news-item {
  border-color: rgba(116, 136, 140, 0.28);
  background: #101a1d;
}

body[data-theme="dark"] .news-item.signal-copy {
  background: #122024;
}

.quote-table,
.fscore-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.quote-table th,
.quote-table td,
.fscore-table th,
.fscore-table td,
.data-table th,
.data-table td {
  height: 24px;
  border: 1px solid #d6d6d6;
  padding: 4px 6px;
  text-align: left;
  white-space: normal;
}

.quote-table th {
  background: #35a852;
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.quote-table .quote-band {
  background: #18577e;
  color: #ffffff;
  text-align: center;
  font-weight: 900;
}

.quote-table td:first-child {
  width: 44%;
  background: #3f3f3f;
  color: #fff;
  font-weight: 800;
}

.quote-table td:last-child {
  background: #a7a7a7;
  color: #050505;
  text-align: center;
}

.quote-table td.gain {
  color: #078847;
  font-weight: 900;
}

.quote-table td.loss {
  color: #c72525;
  font-weight: 900;
}

body[data-theme="dark"] .quote-table th {
  background: #111d21;
  color: #ffd84d;
}

body[data-theme="dark"] .quote-table .quote-band {
  background: #111d21;
  color: #ffffff;
}

body[data-theme="dark"] .quote-table td:first-child {
  background: #111d21;
  color: #f4fbfb;
}

body[data-theme="dark"] .quote-table td:last-child {
  background: #172b31;
  color: #f4fbfb;
}

body[data-theme="dark"] .quote-table td.gain {
  color: #4de087;
}

body[data-theme="dark"] .quote-table td.loss {
  color: #ff706a;
}

.fscore-wrap {
  margin: 0 12px 12px;
  border: 1px solid #555;
  background: #aaa;
}

.fscore-table th {
  background: #303030;
  color: #fff;
}

.fscore-table .fscore-title {
  background: #303030;
  color: #00ff3c;
  font-size: 16px;
  font-weight: 900;
}

.fscore-table .section-row td {
  background: #ffc000;
  color: #111;
  font-weight: 900;
}

.fscore-table td {
  background: #b8b8b8;
  color: #050505;
  text-align: center;
}

.fscore-table td:first-child {
  text-align: left;
}

.legend-row {
  position: absolute;
  right: 4px;
  bottom: 6px;
  left: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: #fff;
  font-size: 9px;
  pointer-events: none;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.data-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.data-card h3 {
  margin-bottom: 10px;
}

.data-card a {
  color: var(--blue);
}

.data-card .data-table {
  table-layout: fixed;
}

.data-card .data-table th {
  width: 28%;
}

.data-card .data-table th,
.data-card .data-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-links {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.news-links a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
}

.chart-tooltip {
  position: fixed;
  z-index: 20;
  min-width: 168px;
  max-width: 218px;
  padding: 8px 9px;
  font-size: 11px;
}

.chart-tooltip strong {
  margin-bottom: 5px;
  font-size: 12px;
}

.chart-tooltip div {
  gap: 10px;
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .analysis-grid,
  .news-grid,
  .data-grid,
  .home-grid,
  .pulse-grid,
  .trend-grid {
    grid-template-columns: 1fr;
  }

  .trend-aggregate-layout {
    grid-template-columns: 1fr;
  }

  .strategy-hero,
  .strategy-primer-grid {
    grid-template-columns: 1fr;
  }

  .strategy-matrix-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .strategy-matrix-title span {
    max-width: none;
    text-align: left;
  }

  .strategy-table-scroll {
    overflow-x: visible;
  }

  .strategy-matrix-grid {
    grid-template-columns: 1fr;
  }

  .strategy-head {
    display: none;
  }

  .strategy-matrix {
    min-width: 0;
    border-spacing: 0;
  }

  .strategy-matrix,
  .strategy-matrix thead,
  .strategy-matrix colgroup,
  .strategy-matrix col,
  .strategy-matrix tbody,
  .strategy-matrix tr,
  .strategy-matrix th,
  .strategy-matrix td {
    display: block;
  }

  .strategy-matrix thead {
    display: none;
  }

  .strategy-matrix tr {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
  }

  .strategy-origin,
  .strategy-cell {
    width: 100%;
    min-height: 0;
  }

  .home-regime-card,
  .home-priority-panel,
  .home-map-panel,
  .home-watchlist-panel,
  .pulse-card.wide,
  .pulse-hero {
    grid-column: 1;
  }

  .home-watchlist-panel {
    grid-row: auto;
  }

  .home-portfolio-row {
    grid-template-columns: minmax(156px, 1fr) 64px 64px 72px 96px 126px 50px 54px;
    gap: 3px;
  }

  .home-regime-card,
  .pulse-hero {
    grid-template-columns: 1fr;
  }

  .home-regime-stats,
  .home-signal-grid,
  .pulse-stat-grid,
  .pulse-table,
  .trend-watchlist-grid,
  .intelligence-hero,
  .intelligence-list,
  .intelligence-logic-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intelligence-hero > div:first-child,
  .intelligence-panel {
    grid-column: 1 / -1;
  }

  .intelligence-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .trend-basket-info {
    top: 8px;
  }

  .trend-basket-toolbar,
  .trend-toolbar-right {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .trend-basket-toolbar {
    justify-content: flex-start;
  }

  .trend-toolbar-right {
    margin-left: 0;
  }

  .trend-sort-controls {
    justify-content: flex-start;
  }

  .trend-watchlist-panel header {
    align-items: flex-start;
    flex-direction: column;
  }

  .watchlist-actions,
  .watchlist-periods {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-toggle {
    right: 0;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    margin: -16px -16px 0;
    padding-right: 16px;
    padding-left: 16px;
  }

  .topbar,
  .toolbar,
  .analysis-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .selector-row {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .pulse-card-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-panel header,
  .home-quick-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-regime-stats,
  .home-signal-grid,
  .home-flow-columns {
    grid-template-columns: 1fr;
  }

  .home-portfolio-row {
    grid-template-columns: minmax(170px, 1fr) repeat(2, minmax(82px, 0.75fr));
  }

  .portfolio-field-row {
    flex-direction: column;
  }

  .pulse-stat-grid,
  .pulse-table,
  .intelligence-hero,
  .intelligence-list,
  .intelligence-logic-table {
    grid-template-columns: 1fr;
  }

  .intelligence-panel header,
  .intelligence-card {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .intelligence-rank,
  .intelligence-main,
  .intelligence-score,
  .intelligence-actions {
    grid-column: 1;
  }

  .framework-popover {
    width: calc(100vw - 48px);
    min-width: 0;
   }

  .bottom-legend {
    grid-template-columns: 58px auto;
  }

  .chart-wrap > .bottom-legend:not(.bubble-size-legend) {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .roc-color-legend {
    width: 100%;
  }

  .price-ring-key {
    width: 100%;
    padding-top: 4px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .bottom-legend.bubble-size-legend {
    grid-template-columns: 16px auto 22px auto 32px auto;
  }
}
.topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.topbar-account-email {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .topbar-account-email {
    display: none;
  }
}
