/* Initial Claude design; operator layout/readability repairs follow below. */

:root {
  --bg: #080c14;
  --panel: #0d1117;
  --panel2: #151c28;
  --panel3: #1a2332;
  --line: #212d3f;
  --text: #e6eaf2;
  --muted: #8b95a8;
  --accent: #00c9a7;
  --accent-dim: rgba(0, 201, 167, 0.15);
  --positive: #00d68f;
  --negative: #ff6b6b;
  --flat: #f0c040;
}

body.light {
  --bg: #f6f7fa;
  --panel: #ffffff;
  --panel2: #eef0f4;
  --panel3: #e4e7ed;
  --line: #d5d9e2;
  --text: #141924;
  --muted: #5f6b7a;
  --accent: #008f7a;
  --accent-dim: rgba(0, 143, 122, 0.09);
  --positive: #047857;
  --negative: #c5221f;
  --flat: #b45309;
}

/* Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, strong, b {
  font-weight: 650;
  letter-spacing: -0.02em;
}

h1#page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

/* Kickers: sentence case, low emphasis */
.section-kicker,
.eyebrow,
.nav-caption {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.panel-heading .section-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  opacity: 0.7;
}

/* Sidebar */
.sidebar {
  width: 210px;
  padding: 24px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.brand {
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.mark {
  width: 36px;
  height: 36px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
}

.brand>span:last-child {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.nav-caption {
  font-size: 12px;
  padding-left: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}

.sidebar nav a {
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 0;
  margin: 0;
  border-left: 2px solid transparent;
  color: var(--muted);
  transition: all 0.15s;
}

.sidebar nav a:hover {
  color: var(--text);
  background: var(--panel2);
}

.sidebar nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  box-shadow: none;
}

.sidebar-bottom {
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-bottom p {
  font-size: 13px;
  color: var(--muted);
}

.chip {
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0;
}

/* Workspace */
.workspace {
  margin-left: 210px;
  background: var(--bg);
}

main {
  max-width: 1920px;
  padding: 24px 28px;
}

/* Topbar */
.topbar {
  height: 64px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: none;
}

.search {
  gap: 10px;
}

.search label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.search input {
  width: 180px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 0;
  padding: 6px 10px;
  font-size: 14px;
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

.top-actions button {
  font-size: 14px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 6px 12px;
}

.top-actions button:hover {
  background: var(--panel3);
  border-color: var(--accent);
}

.connection {
  font-size: 13px;
  color: var(--muted);
}

button, input, select {
  font: inherit;
  min-height: 34px;
  border-radius: 0;
}

button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

button:hover:not(:disabled) {
  background: var(--panel3);
  border-color: var(--accent);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

input, select, textarea {
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

/* Main content */
main {
  padding: 24px 28px;
}

.heading {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.heading .eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.heading p {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0;
}

.source {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  margin-top: 8px;
}

.source span {
  font-size: 12px;
}

/* Panels - remove cards, use subtle backgrounds */
.panel {
  padding: 18px;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
  background: var(--panel);
  border-left: 3px solid transparent;
}

.panel:hover {
  border-left-color: var(--accent);
}

.panel-heading {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.panel-heading h2 {
  font-size: 16px;
  font-weight: 600;
}

.grid {
  gap: 1px;
  margin-bottom: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.metric {
  padding: 16px;
  border-radius: 0;
  background: var(--panel);
  border-left: 3px solid var(--accent);
}

.metric strong {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
  display: block;
  margin-bottom: 4px;
}

.metric small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.metrics {
  gap: 1px;
  margin-bottom: 16px;
  background: var(--line);
}

.empty {
  font-size: 14px;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}

.muted, p.muted {
  font-size: 13px;
  color: var(--muted);
}

.chip, .pill {
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 0;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* Index Ribbon */
.index-ribbon {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.index-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  text-align: left;
  background: var(--panel);
  padding: 14px 16px;
  gap: 4px;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: border-color 0.15s;
}

.index-tile:hover {
  border-left-color: var(--accent);
}

.index-tile>span {
  font-size: 13px;
  font-weight: 600;
  grid-column: 1/-1;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.index-tile>strong {
  font-size: 22px;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.index-tile>small {
  font-size: 13px;
  align-self: end;
  font-weight: 600;
  padding-bottom: 2px;
}

.index-tile:disabled {
  opacity: 1;
  cursor: default;
}

/* Market Hero */
.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0;
  align-items: start;
  margin-bottom: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.hero-panel {
  margin: 0;
  min-width: 0;
  background: var(--panel);
  padding: 20px;
}

.hero-panel h2 {
  font-size: 18px;
  margin: 3px 0 0;
  font-weight: 700;
}

.hero-quote {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 10px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.hero-quote>strong {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.hero-quote>span {
  font-size: 14px;
  font-weight: 600;
}

.market-hero-chart {
  height: 340px;
  width: 100%;
  min-width: 0;
  background: var(--panel);
}

.chart-bottom {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding-top: 10px;
  margin-top: 10px;
}

.segment {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
}

.segment button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  min-height: 28px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 0;
  font-weight: 500;
}

.segment button:hover {
  color: var(--text);
  background: var(--panel2);
}

.segment button.selected {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  box-shadow: none;
}

.hero-aside {
  min-width: 0;
  background: var(--panel);
}

.hero-aside .panel {
  margin: 0;
  border-radius: 0;
  border-left: none;
}

/* Compact Book */
.compact-book .panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.compact-book .panel-heading select {
  font-size: 13px;
  min-height: 28px;
  padding: 2px 8px;
  width: 90px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
}

.book-quote {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.book-quote>b {
  font-size: 14px;
  color: var(--muted);
}

.book-quote>strong {
  margin-left: auto;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.book-quote>small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.compact-book table {
  font-size: 13px;
  width: 100%;
}

.compact-book th {
  font-size: 12px;
  padding: 6px 4px;
  background: transparent;
  text-align: right;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.compact-book td {
  padding: 7px 4px;
  text-align: right;
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.compact-book td:nth-child(2) {
  color: var(--positive);
  font-weight: 600;
}

.compact-book td:nth-child(3) {
  color: var(--negative);
  font-weight: 600;
}

.compact-book p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 8px 0 0;
}

.compact-book>button {
  font-size: 13px;
  width: 100%;
  min-height: 30px;
  margin-top: 10px;
}

/* Breadth Panel */
.breadth-panel p {
  margin-bottom: 0;
  font-size: 14px;
  color: var(--muted);
}

.breadth-numbers {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin: 10px 0;
}

.breadth-numbers b {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.breadth-numbers span {
  text-align: center;
  flex: 1;
}

.breadth {
  height: 6px;
  border-radius: 0;
  margin: 8px 0;
  display: flex;
  overflow: hidden;
}

.breadth .positive {
  background: var(--positive);
}

.breadth .negative {
  background: var(--negative);
}

.breadth .flat {
  background: var(--flat);
}

/* Movers - remove rank circles */
.wide-movers .movers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.wide-movers .mover-row {
  border: 0;
  background: var(--panel);
  padding: 14px 16px;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: border-color 0.15s;
}

.wide-movers .mover-row:hover {
  border-left-color: var(--accent);
}

.wide-movers .mover-rank {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  min-width: 20px;
}

.mover-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 11px 0;
  text-align: left;
  border-radius: 0;
}

.mover-row:last-child {
  border-bottom: 0;
}

.mover-row b {
  font-size: 14px;
  font-weight: 600;
}

.mover-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  max-width: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mover-values {
  text-align: right;
}

/* Market Discovery Shortcut */
.market-discovery-shortcut {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 16px;
  padding: 16px 20px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
}

.market-discovery-shortcut h2 {
  font-size: 19px;
  margin: 4px 0;
  font-weight: 700;
}

.market-discovery-shortcut button {
  font-size: 14px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 600;
  border-radius: 0;
}

.market-discovery-shortcut button:hover {
  background: var(--text);
  color: var(--bg);
}

/* Sector Map */
.sector-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.sector-tile {
  text-align: left;
  background: var(--panel);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: border-color 0.15s;
}

.sector-tile:hover {
  border-left-color: var(--accent);
}

.sector-tile b {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.sector-tile strong {
  font-size: 22px;
  letter-spacing: -0.03em;
  margin: 6px 0;
  font-weight: 700;
}

.sector-tile small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.sector-tile.positive {
  border-left-color: var(--positive);
}

.sector-tile.negative {
  border-left-color: var(--negative);
}

/* Watch Fold */
.watch-fold {
  padding: 16px 18px;
  border-radius: 0;
  background: var(--panel);
}

.watch-fold summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.watch-fold summary::after {
  content: '▼';
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s;
}

.watch-fold[open] summary::after {
  transform: rotate(180deg);
}

.product-watchlist {
  box-shadow: none;
  border: 0;
  margin: 14px 0 0;
  padding: 0;
  background: transparent;
}

.product-watchlist h2 {
  display: none;
}

.watch-item {
  font-size: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.watch-item:last-child {
  border-bottom: 0;
}

/* Discovery Panel */
.discovery-panel {
  padding: 20px;
  border-radius: 0;
  background: var(--panel);
}

.section-heading {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  font-size: 20px;
  margin: 4px 0;
  font-weight: 700;
}

.section-heading p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.discovery-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.discovery-toolbar label {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 5px;
  margin: 0;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.discovery-toolbar input,
.discovery-toolbar select {
  font-size: 14px;
  min-width: 125px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 6px 10px;
}

.discovery-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.discovery-presets button {
  font-size: 13px;
  min-height: 30px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  border-radius: 0;
  font-weight: 500;
}

.discovery-presets button:hover {
  color: var(--text);
  background: var(--panel2);
  border-color: var(--line);
}

.discovery-presets button.selected {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
}

#discover-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

/* Universe Table */
.universe-table {
  font-size: 14px;
  width: 100%;
  border-collapse: collapse;
}

.universe-table th {
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  height: 38px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0;
}

.universe-table th button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
  min-height: 24px;
  font-weight: 600;
}

.universe-table th button:hover {
  color: var(--text);
}

.universe-table td {
  padding: 10px 12px;
  height: 53px;
}

.universe-table td:nth-child(n+4) {
  text-align: right;
}

.universe-table th:nth-child(n+4) {
  text-align: right;
}

.symbol-link {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  padding: 0;
  min-height: 34px;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}

.symbol-link b {
  font-size: 14px;
  display: block;
  font-weight: 600;
}

.symbol-link small {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* Remove round monograms, use text-based indicator */
.symbol-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0;
}

.score-dot {
  background: var(--panel2);
  border-radius: 0;
  font-size: 13px;
  padding: 3px 8px;
  display: inline-block;
  min-width: 35px;
  font-weight: 500;
  border-left: 2px solid var(--accent);
}

.spark {
  width: 86px;
  height: 28px;
  display: block;
  margin-left: auto;
}

.star-button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  padding: 0;
  width: 26px;
  min-height: 28px;
  cursor: pointer;
  font-weight: 700;
}

.star-button:hover {
  color: var(--flat);
}

.table-footer {
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 1px;
}

.table-footer .inline {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.table-footer button {
  font-size: 13px;
  min-height: 28px;
}

.no-results {
  padding: 45px 20px;
  text-align: center;
}

.no-results p {
  font-size: 14px;
  color: var(--muted);
}

.compare-tray {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 0;
  z-index: 3;
}

.compare-tray span {
  margin-right: auto;
  font-size: 14px;
  font-weight: 600;
}

.comparison-dialog {
  width: min(960px, calc(100vw - 36px));
  padding: 22px;
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 0;
  border: 1px solid var(--line);
}

#comparison-chart {
  height: 360px;
  background: var(--panel2);
}

.comparison-key {
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.comparison-key:before {
  content: '';
  height: 8px;
  width: 8px;
  border-radius: 0;
  background: var(--series);
}

.skeleton {
  color: var(--muted);
  padding: 16px;
  background: var(--panel2);
  border-radius: 0;
}

.auxiliary-nav {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.auxiliary-nav summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* Stock Section */
.stock-sections {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.stock-sections button {
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--muted);
  border-radius: 0;
  white-space: nowrap;
  padding: 10px 16px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.stock-sections button:hover {
  color: var(--text);
  background: var(--panel2);
}

.stock-sections button.selected {
  color: var(--accent);
  border-bottom-color: var(--accent);
  box-shadow: none;
  background: var(--accent-dim);
}

#original-chart {
  height: 470px !important;
  background: var(--panel2);
}

.chart-tabs button {
  min-width: 0;
  font-size: 13px;
  border-radius: 0;
}

.chart-tabs {
  margin-bottom: 8px;
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.stock-primary-grid {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stock-primary-grid>.panel.wide {
  grid-column: auto;
}

.stock-primary-grid>.panel:nth-child(2) {
  grid-column: auto !important;
}

.checks-grid {
  gap: 6px;
}

.check-pill {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.stock-primary-grid .inline {
  gap: 8px;
}

.stock-primary-grid .inline button {
  font-size: 12px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 0;
}

.stock-primary-grid .inline label {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.key-values td {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

#original-report {
  max-height: 430px;
  background: var(--panel2);
}

.method-card {
  font-size: 14px;
  padding: 14px;
  background: var(--panel);
}

.method-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.method-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

footer {
  font-size: 12px;
  padding: 12px 28px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* Primary Button */
.primary-button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-weight: 600;
  border-radius: 0;
}

.primary-button:hover {
  background: var(--text);
  color: var(--bg);
}

#search, #compare-open, #ask-ai {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: 0;
}

#search:hover, #compare-open:hover, #ask-ai:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* Heatmap */
.heat-sector {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.heat-sector-heading {
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  text-align: left;
  gap: 6px;
  min-height: 32px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-radius: 0;
  cursor: pointer;
}

.heat-sector-heading>b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.heat-stocks {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  height: 126px;
  overflow: hidden;
  background: var(--panel2);
}

.heat-stock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-basis: 25%;
  border: 0;
  min-height: 48px;
  min-width: 44px;
  border-radius: 0;
  font-size: 12px;
  padding: 6px 4px;
  color: white;
  font-weight: 500;
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.heat-stock b {
  font-size: 14px;
  font-weight: 600;
}

.heat-stock.positive {
  background: #17ad77;
}

.heat-stock.negative {
  background: #e75b68;
}

.heat-stock.flat, .heat-stock.muted {
  background: #dce0e6;
  color: #141924;
}

.heat-stock:hover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  filter: brightness(1.1);
}

.flat {
  color: var(--flat);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (min-width: 1550px) {
  .market-hero-chart {
    height: 380px;
  }
  .market-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1150px) {
  .sidebar {
    width: 180px;
  }
  .workspace {
    margin-left: 180px;
  }
  main {
    padding: 20px;
  }
  .topbar {
    padding: 10px 20px;
  }
  .index-tile {
    padding: 10px 12px;
  }
  .index-tile>strong {
    font-size: 18px;
  }
  .market-hero {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 0;
  }
  .stock-primary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stock-primary-grid>.panel {
    grid-column: auto !important;
  }
}

@media (max-width: 850px) {
  .market-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  .hero-aside .panel {
    margin: 0;
    border-radius: 0;
  }
  .index-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sector-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: relative;
    width: 100%;
    padding: 12px 16px;
  }
  .sidebar .brand {
    margin-bottom: 10px;
  }
  .sidebar .nav-caption {
    display: none;
  }
  .sidebar nav {
    gap: 0;
    overflow-x: auto;
  }
  .sidebar nav a {
    font-size: 13px;
    padding: 8px 10px;
    margin: 0;
    white-space: nowrap;
  }
  .sidebar nav>a[href="#strategy"],
  .sidebar nav>a[href="#derivatives"],
  .sidebar nav>a[href="#alerts"],
  .sidebar nav .auxiliary-nav {
    display: none !important;
  }
  .workspace {
    margin-left: 0;
  }
  .auxiliary-nav {
    display: contents;
  }
  .auxiliary-nav summary {
    display: none;
  }
  .topbar {
    padding: 10px 16px;
    height: auto;
    min-height: 0;
  }
  .top-actions {
    gap: 6px;
  }
  .top-actions button {
    font-size: 13px;
  }
  .search label {
    font-size: 13px;
  }
  .search input {
    width: 100px;
    min-width: 0;
  }
  .search button {
    font-size: 13px;
  }
  .heading {
    margin-bottom: 14px;
  }
  h1#page-title {
    font-size: 22px;
  }
  .heading .source {
    display: none;
  }
  main {
    padding: 16px;
  }
  .index-ribbon {
    gap: 0;
    margin-bottom: 0;
  }
  .index-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
  }
  .index-tile>strong {
    font-size: 17px;
  }
  .index-tile>small {
    align-self: start;
  }
  .index-tile:nth-child(n+4) {
    display: none;
  }
  .market-hero-chart {
    height: 260px;
  }
  .hero-panel {
    padding: 14px;
  }
  .hero-quote>strong {
    font-size: 26px;
  }
  .hero-quote {
    flex-wrap: wrap;
    gap: 8px;
  }
  .chart-bottom {
    flex-wrap: wrap;
  }
  .hero-aside {
    grid-template-columns: 1fr;
  }
  .market-discovery-shortcut {
    align-items: flex-start;
    flex-direction: column;
    align-items: stretch;
  }
  .market-discovery-shortcut h2 {
    font-size: 16px;
  }
  .market-discovery-shortcut button {
    font-size: 13px;
    padding: 6px 12px;
    align-self: flex-start;
  }
  .sector-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }
  .sector-tile {
    padding: 10px 12px;
  }
  .discovery-toolbar {
    gap: 8px;
  }
  .discovery-toolbar label {
    flex: 1;
    min-width: 120px;
  }
  .discovery-toolbar .search-filter {
    flex-basis: 100%;
  }
  .discovery-toolbar select {
    width: 100%;
    min-width: 0;
  }
  .discovery-presets {
    gap: 2px;
  }
  .discovery-presets button {
    padding: 5px 8px;
    font-size: 12px;
  }
  #discover-count {
    font-size: 12px;
  }
  .universe-table {
    min-width: 850px;
  }
  .table-footer {
    flex-wrap: wrap;
  }
  .table-footer>span {
    font-size: 12px;
  }
  .compare-tray {
    flex-wrap: wrap;
  }
  .compare-tray span {
    flex-basis: 100%;
  }
  #comparison-chart {
    height: 280px;
  }
  .stock-sections button {
    padding: 9px 12px;
    font-size: 13px;
  }
  #original-chart {
    height: 350px !important;
  }
  .stock-primary-grid .checks-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section-heading h2 {
    font-size: 18px;
  }
  .hero-quote #hero-date {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .sector-map {
    grid-template-columns: 1fr;
  }
  .heat-stocks {
    height: 112px;
  }
}

@media (max-width: 1000px) {
  .wide-movers .movers {
    grid-template-columns: 1fr 1fr;
  }
  .heat-stocks {
    height: 120px;
  }
  .heat-stock b {
    font-size: 13px;
  }
  .heat-sector-heading {
    font-size: 12px;
  }
}

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Mobile theme button — injected by JS into .top-actions; hidden on desktop */
#claude-mobile-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
}

#claude-mobile-theme:hover {
  border-color: var(--accent);
}

@media (min-width: 850px) {
  #claude-mobile-theme {
    display: none !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Hide panels marked with [hidden] */
[hidden] {
  display: none !important;
}

/* Mobile expert button left as authored — visible on narrow viewports */

.mobile-tool-links {
  display: grid;
  gap: 8px;
}

.mobile-tool-links a {
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.mobile-tool-links a:hover {
  border-left-color: var(--accent);
  border-left-width: 3px;
}
/* Readability and stock workspace repair, 2026-11-20 (Vietnam). */
:root { --bg:#0e1522; --panel:#151e2e; --panel2:#1b2638; --line:#2a364a; --muted:#a5b2c5; --accent:#45c6af; }
body.light { --bg:#f5f7fa; --panel:#fff; --panel2:#f3f6f9; --panel3:#eaf0f5; --line:#e1e7ee; --text:#1b293c; --muted:#63748a; --accent:#007f70; }
body { font-size:16px; line-height:1.55; }
.sidebar { width:232px; padding:24px 16px; overflow-y:auto; height:100dvh; }
.workspace { margin-left:232px; }
.sidebar nav a { font-size:14px; padding:11px 12px; border-radius:7px; margin:2px 0; }
.sidebar-bottom { position:static; margin-top:28px; }
.brand { margin-bottom:28px; gap:10px; }
.brand small { font-size:12px; margin-top:4px; }
.brand>span:last-child { font-size:13px; }
.nav-caption { font-size:12px; }
.topbar { min-height:76px; height:auto; padding:16px 28px; }
.search input { width:160px; background:var(--panel2); border-radius:8px; }
button,input,select { min-height:38px; border-radius:7px; }
textarea { border-radius:8px; }
.top-actions button { border-radius:7px; background:var(--panel); }
.search button { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600; }
main { padding:28px; max-width:1800px; margin:0 auto; }
.heading { border-bottom:0; padding-bottom:0; margin-bottom:24px; }
h1#page-title { font-size:30px; letter-spacing:-.035em; }
.heading p { font-size:14px; margin-top:6px; }
.heading .eyebrow { display:none; }
h2,.panel-heading h2 { font-size:17px; font-weight:650; }
h3 { font-size:15px; }
.panel { padding:22px; border:1px solid var(--line); border-radius:12px; margin-bottom:18px; background:var(--panel); box-shadow:0 2px 5px #14243b03; }
.panel:hover { border-left-color:var(--line); }
.panel-heading { align-items:center; border-bottom:0; padding-bottom:0; margin-bottom:18px; }
.grid,.stock-primary-grid { gap:18px; margin-bottom:18px; background:transparent; border:0; align-items:start; }
.grid>.panel { margin-bottom:0; }
.metrics { gap:12px; background:transparent; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); margin-bottom:20px; }
.metric { padding:18px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.metric strong { font-size:25px; margin-top:8px; margin-bottom:0; font-variant-numeric:tabular-nums; }
.metric small { font-size:13px; }
.metric .detail { font-size:12px; margin-top:6px; }
.muted,p.muted { font-size:13px; line-height:1.65; }
.empty { font-size:14px; line-height:1.65; }
.index-ribbon { gap:12px; border:0; background:transparent; margin-bottom:20px; }
.index-tile { border:1px solid var(--line); border-radius:10px; padding:16px; }
.index-tile:hover { border-left-color:var(--line); border-color:var(--accent); }
.index-tile>span { font-size:13px; }
.index-tile>small { font-size:13px; }
.market-hero { gap:18px; background:transparent; border:0; margin-bottom:18px; grid-template-columns:minmax(0,1fr) 300px; }
.hero-panel { border:1px solid var(--line); border-radius:12px; padding:22px; }
.hero-aside { background:transparent; }
.hero-aside .panel { margin-bottom:14px; border:1px solid var(--line); border-radius:12px; padding:18px; }
.hero-aside .panel:last-child { margin-bottom:0; }
.market-discovery-shortcut { border-radius:10px; padding:20px; margin:18px 0; }
.sector-map { gap:12px; background:transparent; }
.sector-tile { border:1px solid var(--line); border-radius:10px; }
.wide-movers { gap:18px; }
.chip,.pill { border-radius:5px; font-size:12px; }
.table-wrap table { font-size:14px; }
.universe-table th,.universe-table th button { font-size:12px; }
.universe-table td { height:64px; }
.symbol-link b { font-size:14px; }
.symbol-link small { font-size:12px; }
.symbol-monogram { border-radius:7px!important; width:32px; height:32px; }
.stock-sections { gap:12px; margin-bottom:20px; }
.stock-sections button { font-size:14px; padding:12px 16px; }
.stock-primary-grid { grid-template-columns:minmax(0,1fr) 290px; }
.stock-primary-grid>.panel { padding:20px; }
.stock-primary-grid .inline button,.stock-primary-grid .inline label { font-size:13px; }
.stock-primary-grid .inline button { min-height:34px; border-radius:6px; }
.stock-primary-grid .inline { gap:8px; }
.stock-primary-grid .inline label { display:inline-flex; align-items:center; gap:6px; margin:0; }
.stock-primary-grid .inline input[type=checkbox] { flex:none; width:16px; min-width:16px; height:16px; min-height:16px; margin:0; }
.chart-tools-drawer { margin:12px 0; border:1px solid var(--line); border-radius:7px; }
.chart-tools-drawer>summary { padding:9px 12px; font-size:13px; color:var(--muted); cursor:pointer; }
.chart-tools-drawer[open]>summary { border-bottom:1px solid var(--line); margin-bottom:12px; }
.chart-tools-drawer>.inline,.chart-tools-drawer>p { margin:12px; }
#original-chart { background:var(--panel)!important; border-radius:8px; overflow:hidden; }
/* Original charts resize correctly; the global canvas cap must not shrink their drawing surface. */
#original-chart canvas,.market-hero-chart canvas,#comparison-chart canvas { max-height:none; }
.chart-tabs { gap:8px; border:0; margin:16px 0; }
.chart-tabs button { font-size:13px; border:1px solid var(--line); border-radius:6px; }
.native-intervals { margin:14px 0; gap:6px; }
.checks-grid { gap:8px; }
.check-pill { font-size:12px; padding:9px 10px; border-radius:6px; }
#signal-explanation { font-size:14px; text-align:left; padding:16px 0; }
#stock-watch { width:100%; margin-top:18px; min-height:42px; border-radius:7px; color:var(--accent); background:var(--accent-dim); }
#ssi-profile .metrics { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); background:transparent; }
#ssi-profile .metric strong { font-size:22px; }
#ssi-profile #ssi-summary-cards { grid-template-columns:repeat(4,minmax(0,1fr)); }
#ssi-profile h3 { margin-top:24px; margin-bottom:14px; }
footer { font-size:12px; }
@media(max-width:1250px) and (min-width:761px) {
  .sidebar { width:210px; }
  .workspace { margin-left:210px; }
  main { padding:22px; }
  .stock-primary-grid { grid-template-columns:minmax(0,1fr); }
  .stock-primary-grid>.panel:nth-child(2) { display:grid; grid-template-columns:1fr 1fr; gap:12px 22px; }
  .stock-primary-grid>.panel:nth-child(2)>h2 { grid-column:1/-1; }
  #signal-explanation { padding:0; margin:0; }
  #stock-watch { margin:0; }
  .market-hero { grid-template-columns:minmax(0,1fr) 270px; }
}
@media(max-width:850px) {
  .market-hero { grid-template-columns:minmax(0,1fr); }
  .hero-aside { gap:14px; border:0; background:transparent; }
}
@media(max-width:760px) {
  .sidebar { width:100%; height:auto; overflow:visible; padding:16px; }
  .sidebar-bottom { display:none; }
  .workspace { margin-left:0; }
  .sidebar nav a { font-size:13px; padding:9px; margin:0; }
  .topbar { padding:12px 16px; }
  .top-actions button { font-size:13px; }
  .search input { width:100px; }
  main { padding:20px 14px; }
  h1#page-title { font-size:26px; }
  .panel,.hero-panel { padding:16px; border-radius:10px; }
  .index-ribbon { gap:8px; }
  .index-tile { padding:12px; }
  .index-tile>strong { font-size:19px; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .metric { padding:14px; }
  .metric strong { font-size:23px; }
  #stock-metrics .metric { padding:10px 12px; }
  #stock-metrics .metric strong { margin-top:4px; font-size:20px; }
  .stock-primary-grid { grid-template-columns:minmax(0,1fr); }
  .stock-primary-grid>.panel { padding:14px; }
  .stock-sections { gap:0; }
  .stock-sections button { font-size:13px; padding:10px; }
  #ssi-profile .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #ssi-profile #ssi-summary-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stock-primary-grid .inline label { font-size:12px; }
  .sector-map { gap:8px; }
}
