:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #6f7a86;
  --line: #dfe4ea;
  --accent: #0f766e;
  --accent-2: #1d4ed8;
  --danger: #b42318;
  --good: #047857;
  --shadow: 0 14px 36px rgba(18, 28, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.deep-mode {
  grid-template-columns: 1fr;
}

body.deep-mode .sidebar {
  display: none;
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.brand h1,
.brand p,
h2,
p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p,
.panel-header p,
#selectedMeta,
.field span,
.sort-control span,
.stat span {
  color: var(--muted);
  font-size: 12px;
}

.field,
.sort-control {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

input:not([type="checkbox"]),
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.16);
  border-color: var(--accent);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: #a8b2bd;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.chat-assistant {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.chat-header h2 {
  font-size: 17px;
}

.chat-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.chat-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.chat-messages {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.chat-message {
  max-width: min(920px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.chat-message.user {
  justify-self: end;
  border-color: rgba(29, 78, 216, 0.22);
  background: #eff6ff;
}

.chat-message.assistant {
  justify-self: start;
}

.chat-message p,
.chat-message li {
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.chat-message ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0 18px;
  padding: 0;
}

.chat-message .chat-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.chat-message .chat-notice {
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-form input {
  margin: 0;
}

.chat-form button,
.chat-suggestions button,
.chat-actions button,
.chat-link {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.chat-suggestions,
.chat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-suggestions button,
.chat-actions button {
  border-color: rgba(15, 118, 110, 0.22);
  background: #f0fdfa;
  color: #115e59;
}

.chat-table-wrap {
  max-width: 100%;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #eef1f4;
  border-radius: 8px;
}

.chat-table {
  min-width: 760px;
  font-size: 12px;
}

.chat-table th,
.chat-table td {
  padding: 8px 9px;
}

.chat-link {
  border-color: rgba(29, 78, 216, 0.24);
  background: #eff6ff;
  color: #1d4ed8;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.dashboard-hero h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.15;
}

.dashboard-hero p {
  color: var(--muted);
  font-size: 14px;
}

.recommendations-link {
  min-height: 40px;
  padding: 0 14px;
  border-color: rgba(180, 83, 9, 0.28);
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
}

.recommendations-link:hover,
.recommendations-link:focus {
  border-color: #b45309;
  background: #fef3c7;
}

.advanced-link {
  min-width: 218px;
  border-color: rgba(124, 58, 237, 0.24);
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 12px;
  font-weight: 800;
}

.advanced-link:hover,
.advanced-link:focus {
  border-color: #7c3aed;
  background: #ede9fe;
}

.deep-dive {
  min-height: calc(100vh - 44px);
}

.deep-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: -22px -22px 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 248, 0.96);
}

.deep-topbar h2 {
  font-size: 24px;
}

.deep-actions {
  display: flex;
  gap: 8px;
}

.nav-button {
  min-width: 76px;
  padding: 0 14px;
}

.back-button {
  min-width: 154px;
  border-color: rgba(15, 118, 110, 0.3);
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.snapshot-card {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.snapshot-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.snapshot-card strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.topbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.ticker-tape {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #15202b;
  border-radius: 8px;
  background: #0b1118;
  box-shadow: var(--shadow);
}

.ticker-label {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 92px;
  padding: 0 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  background: #121a24;
  color: #e5edf5;
  font-size: 12px;
  font-weight: 800;
}

.ticker-window {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.ticker-window::before,
.ticker-window::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 42px;
  pointer-events: none;
}

.ticker-window::before {
  left: 0;
  background: linear-gradient(90deg, #0b1118, rgba(11, 17, 24, 0));
}

.ticker-window::after {
  right: 0;
  background: linear-gradient(270deg, #0b1118, rgba(11, 17, 24, 0));
}

.ticker-track {
  --ticker-duration: 120s;
  display: flex;
  align-items: stretch;
  width: max-content;
  min-height: 44px;
  animation: ticker-scroll var(--ticker-duration) linear infinite;
}

.ticker-tape:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
  color: #d8e1ea;
  white-space: nowrap;
}

.ticker-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.ticker-item .ticker-symbol {
  color: #ffffff;
  font-weight: 800;
}

.ticker-change {
  font-variant-numeric: tabular-nums;
}

.ticker-item.up .ticker-change {
  color: #6ee7b7;
}

.ticker-item.down .ticker-change {
  color: #fca5a5;
}

.ticker-empty {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: #9fb0c1;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.market-media {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  margin-bottom: 18px;
}

.momentum-panel,
.market-news-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.momentum-table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.momentum-table {
  min-width: 840px;
  font-size: 12px;
}

.momentum-table th,
.momentum-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.momentum-table th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.momentum-table tbody tr {
  cursor: pointer;
}

.momentum-table tbody tr:hover,
.momentum-table tbody tr:focus {
  background: #f8fafc;
}

.momentum-table td:nth-child(1) {
  width: 52px;
  color: var(--muted);
  font-weight: 800;
}

.momentum-table td:nth-child(2) strong,
.momentum-industry strong {
  display: block;
  font-size: 12px;
}

.momentum-table td:nth-child(2) span,
.momentum-industry span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.momentum-industry {
  max-width: 240px;
}

.open-button {
  min-height: 28px;
  padding: 0 10px;
  border-color: rgba(29, 78, 216, 0.24);
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.open-button:hover,
.open-button:focus {
  border-color: #1d4ed8;
  background: #dbeafe;
}

.sector-link {
  display: inline-block;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: inherit;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-decoration-color: rgba(29, 78, 216, 0.28);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.sector-link:hover,
.sector-link:focus {
  border: 0;
  color: #0f3ea4;
  outline: none;
  text-decoration-color: currentColor;
}

.momentum-industry .sector-link,
.group-list-block .sector-link {
  display: block;
}

.market-news-window {
  position: relative;
  height: 230px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.group-momentum-panel {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.group-momentum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.group-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.group-card h3 {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 12px;
}

.group-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.group-list-block h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.group-list-block ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-list-block li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: baseline;
}

.group-list-block li span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-list-block li strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.group-list-block li small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.market-news-window::before,
.market-news-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 28px;
  pointer-events: none;
}

.market-news-window::before {
  top: 0;
  background: linear-gradient(180deg, #fbfcfd, rgba(251, 252, 253, 0));
}

.market-news-window::after {
  bottom: 0;
  background: linear-gradient(0deg, #fbfcfd, rgba(251, 252, 253, 0));
}

.market-news-track {
  --news-duration: 80s;
  display: grid;
  animation: news-roll var(--news-duration) linear infinite;
}

.market-news-panel:hover .market-news-track {
  animation-play-state: paused;
}

.market-news-item {
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.market-news-item:hover {
  background: #ffffff;
}

.market-news-item strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.market-news-item p {
  display: -webkit-box;
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.market-news-empty {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

@keyframes news-roll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.chart-card {
  position: relative;
}

.enrichment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 16px 16px;
}

.insight-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.flag {
  min-width: 82px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.flag.buy {
  border-color: rgba(4, 120, 87, 0.25);
  background: #dcfce7;
  color: var(--good);
}

.flag.neutral {
  background: #f8fafc;
  color: var(--muted);
}

.mini-badge {
  display: inline-block;
  min-width: 38px;
  margin-right: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.mini-badge.high,
.mini-badge.above {
  border-color: rgba(4, 120, 87, 0.22);
  background: #ecfdf5;
  color: var(--good);
}

.mini-badge.low,
.mini-badge.below {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fef2f2;
  color: var(--danger);
}

.table-mini-wrap {
  max-height: 260px;
  overflow: auto;
}

.mini-table {
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 8px 10px;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}

.news-list {
  display: grid;
  gap: 0;
  max-height: 360px;
  overflow: auto;
}

.news-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-bottom: 1px solid #eef1f4;
  color: inherit;
  text-decoration: none;
}

.news-item:hover {
  background: #f8fafc;
}

.news-item strong {
  font-size: 13px;
}

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

.news-item p {
  color: #52606d;
  font-size: 12px;
  line-height: 1.35;
}

.rating-box {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rating-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.rating-box strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.sector-overview-grid {
  margin: 0 0 16px;
}

.sector-members-panel {
  margin-top: 16px;
}

.sector-table-wrap {
  max-height: 580px;
}

.sector-note {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.sector-note strong {
  color: var(--ink);
  font-size: 14px;
}

.recommendation-disclaimer {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
}

.recommendation-disclaimer strong {
  font-size: 14px;
}

.recommendation-disclaimer p {
  font-size: 13px;
}

.recommendation-disclaimer.advanced {
  border-color: rgba(124, 58, 237, 0.22);
  background: #f5f3ff;
  color: #4c1d95;
}

.recommendation-method,
.recommendation-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.recommendation-method {
  margin-bottom: 16px;
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.methodology-card {
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.methodology-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.methodology-card strong {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.recommendations-grid {
  display: grid;
  gap: 16px;
}

.recommendations-table-wrap {
  max-height: 560px;
}

.recommendations-table {
  min-width: 1180px;
  font-size: 12px;
}

.recommendations-table th,
.recommendations-table td {
  padding: 8px 9px;
}

.confidence {
  display: inline-block;
  min-width: 64px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.confidence.high {
  border-color: rgba(4, 120, 87, 0.22);
  background: #ecfdf5;
  color: var(--good);
}

.confidence.medium {
  border-color: rgba(180, 83, 9, 0.22);
  background: #fffbeb;
  color: #92400e;
}

.confidence.low {
  background: #f8fafc;
  color: var(--muted);
}

.recommendation-reason {
  max-width: 320px;
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
}

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

.panel-header h2,
.security-header h2 {
  font-size: 17px;
}

.table-wrap {
  max-height: calc(100vh - 176px);
  overflow: auto;
}

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f4;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #52606d;
  font-size: 11px;
  text-transform: uppercase;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sort-header:hover,
.sort-header:focus {
  color: var(--accent-2);
  outline: none;
}

.sort-header::after {
  content: "↕";
  color: #94a3b8;
  font-size: 10px;
}

.sort-header.active {
  color: var(--accent-2);
}

.sort-header.active::after {
  content: "↓";
  color: var(--accent-2);
}

.sort-header.active[data-direction="asc"]::after {
  content: "↑";
}

tbody tr {
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

tbody tr:hover,
tbody tr.active {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 var(--accent-2);
}

tbody tr:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  outline-offset: -2px;
}

.company-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-symbol {
  font-weight: 800;
}

.pos {
  color: var(--good);
}

.neg {
  color: var(--danger);
}

.trade-action {
  font-weight: 800;
}

.buy-text {
  color: var(--good);
}

.sell-text {
  color: var(--danger);
}

.detail-panel {
  min-width: 0;
  overflow: hidden;
}

.ticker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.quote-box {
  min-width: 126px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: right;
}

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

.quote-box strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
  flex-wrap: wrap;
}

.segmented,
.metric-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.segmented button,
.metric-strip button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.segmented button.active,
.metric-strip button.active {
  border-color: var(--accent);
  background: #ccfbf1;
  color: #134e4a;
}

.metric-strip {
  padding: 12px 16px;
}

.chart-card {
  position: relative;
  margin: 0 16px 16px;
  padding: 10px;
  box-shadow: none;
}

.deep-dive .chart-card,
.deep-dive .fundamentals,
.deep-dive .enrichment-grid {
  margin-left: 0;
  margin-right: 0;
}

.deep-dive .controls-row,
.deep-dive .metric-strip {
  padding-left: 0;
  padding-right: 0;
}

canvas {
  width: 100%;
  display: block;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  width: 190px;
  pointer-events: none;
  display: none;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  color: var(--text);
}

.chart-tooltip.visible {
  display: block;
}

.chart-tooltip header {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.chart-tooltip div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.chart-tooltip span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip strong {
  flex: 0 0 auto;
  font-size: 12px;
}

.empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
}

.empty.visible {
  display: grid;
}

.fundamentals {
  position: relative;
  margin: 0 16px 16px;
  box-shadow: none;
}

.panel-header.compact {
  padding: 12px;
}

.panel-header.compact select {
  max-width: 210px;
}

.mini-chart {
  position: relative;
  padding: 10px;
}

@media (max-width: 1120px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .snapshot-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .market-media {
    grid-template-columns: 1fr;
  }

  .group-momentum-grid {
    grid-template-columns: 1fr;
  }

  .methodology-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    width: 100%;
    overflow-x: auto;
    animation: none;
  }

  .market-news-track {
    animation: none;
  }

  .market-news-window {
    overflow-y: auto;
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: repeat(2, 1fr);
  }

  .enrichment-grid {
    grid-template-columns: 1fr;
  }

  .deep-topbar {
    grid-template-columns: 1fr;
  }

  .snapshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .controls-row {
    display: grid;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .methodology-grid {
    grid-template-columns: 1fr;
  }
}
