:root {
  --bg: #d9dee5;
  --card: #dde2e9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --rose-bg: #fff1f2;
  --rose-text: #881337;
  --amber-bg: #fffbeb;
  --amber-text: #92400e;
  --lime-bg: #f7fee7;
  --lime-text: #3f6212;
  --emerald-strong: #d1fae5;
  --emerald-text: #064e3b;
  --positive: #15803d;
  --negative: #b91c1c;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #b91c1c;
}

body.dark-mode {
  --bg: #0f172a;
  --card: #111827;
  --border: #334155;
  --text: #e5eefc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
  --rose-bg: #3f1720;
  --rose-text: #fecdd3;
  --amber-bg: #3b2a11;
  --amber-text: #fde68a;
  --lime-bg: #1f3321;
  --lime-text: #bef264;
  --emerald-strong: #123127;
  --emerald-text: #a7f3d0;
  --positive: #4ade80;
  --negative: #f87171;
  --error-bg: #3b1616;
  --error-border: #7f1d1d;
  --error-text: #fecaca;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.auth-loading .app {
  visibility: hidden;
}

body.auth-required .auth-gate {
  display: flex;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(8px);
  z-index: 2000;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
  padding: 26px;
}

.auth-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.auth-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.auth-field input {
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: #e5e7eb;
  outline: none;
}

.auth-field input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.auth-error {
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.app {
  width: min(100%, 1880px);
  max-width: none;
  margin: 0 auto;
  padding: 16px;
}

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

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

.app-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.app-tab {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.app-tab:hover {
  background: #dde3ea;
  color: var(--text);
}

.app-tab.is-active {
  background: #d1d5db;
  color: var(--text);
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.app-view {
  display: block;
}

.theme-toggle-btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.theme-toggle-btn:hover {
  background: #dde3ea;
}

body.dark-mode .theme-toggle-btn:hover {
  background: #172036;
}

body.dark-mode .app-tab:hover {
  background: #172036;
}

body.dark-mode .app-tab.is-active {
  background: #22304a;
  box-shadow: inset 0 0 0 1px #475569;
}

body.dark-mode .auth-card,
body.dark-mode .app-tabs,
body.dark-mode .theme-toggle-btn {
  background: var(--card);
}

body.dark-mode .total-badge,
body.dark-mode .muted-chip,
body.dark-mode .topbar-date,
body.dark-mode .market-actions,
body.dark-mode #nextExpirationLabel,
body.dark-mode #lastPriceUpdate,
body.dark-mode #lastEarningsRefresh,
body.dark-mode #lastMarketUpdate {
  color: var(--text);
}

body.dark-mode .total-badge,
body.dark-mode .muted-chip {
  background: #172036;
  border-color: var(--border);
}

body.dark-mode .auth-field input,
body.dark-mode .scout-control input,
body.dark-mode .scout-control select,
body.dark-mode .cap-bucket-dropdown summary,
body.dark-mode .expiry-select,
body.dark-mode .expiry-picker-btn,
body.dark-mode .expiry-calendar-popover,
body.dark-mode .expiry-calendar-nav,
body.dark-mode #positionsTable .contract-input,
body.dark-mode #positionsTable .premium-input,
body.dark-mode #positionsTable .strike-input,
body.dark-mode .pager-page-input {
  background: #0b1220;
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .custom-scout-range-group,
body.dark-mode .market-sentiment-card,
body.dark-mode .market-future-card,
body.dark-mode .health-card {
  background: #172036;
  border-color: var(--border);
}

body.dark-mode .expiry-picker-btn.is-open,
body.dark-mode .expiry-picker-btn:hover,
body.dark-mode .expiry-calendar-nav:hover,
body.dark-mode .expiry-calendar-day:hover {
  background: #172036;
}

body.dark-mode .expiry-calendar-day.is-selected {
  background: #22304a;
  border-color: #475569;
}

body.dark-mode .expiry-calendar-day.is-outside,
body.dark-mode .expiry-calendar-weekdays span,
body.dark-mode .expiry-select-label {
  color: var(--muted);
}

body.dark-mode table thead th {
  background: #162033;
  color: var(--text);
}

body.dark-mode table tbody td {
  background: var(--card);
}

body.dark-mode .total-col,
body.dark-mode td.total-cell {
  background: #172036;
  color: var(--text);
}

body.dark-mode #pricesTable th:not(:first-child),
body.dark-mode #pricesTable td:not(:first-child) {
  box-shadow: inset 1px 0 0 rgba(71, 85, 105, 0.65);
}

body.dark-mode #pricesTable td:nth-child(even):not(:last-child) {
  box-shadow:
    inset 1px 0 0 rgba(71, 85, 105, 0.65),
    inset 0 0 0 9999px rgba(148, 163, 184, 0.08);
}

body.dark-mode #pricesTable th:nth-child(even):not(:last-child) {
  box-shadow:
    inset 1px 0 0 rgba(71, 85, 105, 0.65),
    inset 0 0 0 9999px rgba(148, 163, 184, 0.13);
}

body.dark-mode #pricesTable thead th {
  background: #162033;
}

body.dark-mode #pricesTable tbody td.dynamic-tone {
  background: #111827;
}

body.dark-mode #pricesTable thead .dynamic-tone {
  background: var(--tone-bg) !important;
  color: var(--tone-text) !important;
  box-shadow: inset 1px 0 0 rgba(71, 85, 105, 0.65) !important;
}

body.dark-mode #pricesTable thead th.dynamic-tone:nth-child(even):not(:last-child),
body.dark-mode #pricesTable thead th.dynamic-tone:nth-child(odd):not(:last-child) {
  background: var(--tone-bg) !important;
  color: var(--tone-text) !important;
  box-shadow: inset 1px 0 0 rgba(71, 85, 105, 0.65) !important;
}

body.dark-mode #pricesTable td.ticker-cell,
body.dark-mode #positionsTable td.ticker-cell,
body.dark-mode .ticker-price-inline {
  color: var(--text);
}

body.dark-mode #pricesTable td.ticker-cell,
body.dark-mode #pricesTable td.total-cell {
  background: #172036;
}

body.dark-mode #pricesTable td.dynamic-tone .option-cell-layout {
  padding: 6px 8px 10px;
}

body.dark-mode .target-price {
  color: var(--text);
}

body.dark-mode .option-quote-block {
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(71, 85, 105, 0.55);
}

body.dark-mode .strike-line {
  color: #b7c3d8;
}

body.dark-mode .ticker-sub-line.is-neutral,
body.dark-mode .ticker-sub-line.is-neutral strong {
  color: var(--muted);
}

body.dark-mode .header-help summary {
  background: #172036;
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .scout-cell-add-link,
body.dark-mode .inline-refresh-link,
body.dark-mode .btn.secondary {
  background: #172036;
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .reorder-btn {
  background: #172036;
  border-color: var(--border);
  color: var(--text);
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topbar-title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.topbar-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.total-badge,
.muted-chip {
  border: 1px solid var(--border);
  background: #dde3ea;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: visible;
}

.card-header {
  padding: 16px 18px 8px;
}

.scout-panel {
  background: var(--card);
  overflow: hidden;
  clip-path: inset(0 round 20px);
}

#marketPanelDetails,
#pricesPanelDetails,
#boughtPanelDetails,
#tickersPanelDetails {
  border-radius: inherit;
  overflow: hidden;
}

.market-header,
.market-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.market-actions {
  color: var(--muted);
  font-size: 14px;
}

.scout-panel-summary > .market-actions {
  flex: 1;
  justify-content: flex-end;
  text-align: right;
  margin-left: auto;
  padding-right: 18px;
}

.market-actions .inline-refresh-link {
  white-space: nowrap;
}

.inline-refresh-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.inline-refresh-link:hover {
  color: var(--text);
}

.market-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px 18px 12px;
}

.market-grid.scout-panel-body {
  padding: 12px 18px 12px;
}

.market-sentiment-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 320px));
  gap: 14px;
  justify-content: start;
}

.market-sentiment-card,
.market-future-card {
  position: relative;
  border: 1px solid var(--market-card-border, var(--border));
  border-radius: 16px;
  background: var(--market-card-bg, #f8fafc);
  padding: 16px 14px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.market-sentiment-card[data-tone="fear"] {
  background: var(--market-card-bg, #fff7f7);
}

.market-sentiment-card[data-tone="greed"] {
  background: var(--market-card-bg, #f5fff7);
}

.market-sentiment-card[data-tone="neutral"] {
  background: var(--market-card-bg, #f1f5f9);
}

.market-sentiment-card-cnn {
  min-width: 0;
}

.market-sentiment-card {
  display: grid;
  grid-template-rows: auto auto auto;
  row-gap: 6px;
  align-content: start;
  min-height: 142px;
  width: 100%;
}

#marketFuturesGrid {
  grid-column: 1 / -1;
}

.market-card-label {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-sentiment-card .market-card-label,
.market-sentiment-card .market-sentiment-title,
.market-sentiment-card .market-sentiment-subtitle,
.market-sentiment-card .market-sentiment-meta,
.market-sentiment-card .market-sentiment-link {
  color: #0f172a;
}

body.dark-mode .market-sentiment-card .market-card-label,
body.dark-mode .market-sentiment-card .market-sentiment-title,
body.dark-mode .market-sentiment-card .market-sentiment-subtitle,
body.dark-mode .market-sentiment-card .market-sentiment-meta,
body.dark-mode .market-sentiment-card .market-sentiment-link {
  color: var(--text);
}

.market-sentiment-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  margin-top: 6px;
  margin-bottom: 6px;
}

.market-mini-gauge {
  width: 84px;
  min-width: 84px;
  height: 48px;
  margin-top: 0;
  margin-right: 6px;
  align-self: flex-start;
}

.market-mini-gauge svg {
  display: block;
  width: 100%;
  height: auto;
}

.market-mini-gauge-track {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 10;
  fill: none;
  stroke-linecap: round;
}

.market-mini-gauge-segment {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.market-mini-gauge-segment.is-extreme-fear {
  stroke: rgba(153, 27, 27, 0.92);
}

.market-mini-gauge-segment.is-fear {
  stroke: rgba(220, 38, 38, 0.78);
}

.market-mini-gauge-segment.is-neutral {
  stroke: rgba(148, 163, 184, 0.9);
}

.market-mini-gauge-segment.is-greed {
  stroke: rgba(34, 197, 94, 0.8);
}

.market-mini-gauge-segment.is-extreme-greed {
  stroke: rgba(21, 128, 61, 0.94);
}

.market-mini-gauge-needle {
  stroke: #0f172a;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.market-mini-gauge-hub {
  fill: #0f172a;
  stroke: #ffffff;
  stroke-width: 2;
}

.market-mini-gauge-score {
  fill: #0f172a;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.dark-mode .market-mini-gauge-track {
  stroke: rgba(148, 163, 184, 0.28);
}

body.dark-mode .market-mini-gauge-segment.is-extreme-fear {
  stroke: #f87171;
}

body.dark-mode .market-mini-gauge-segment.is-fear {
  stroke: #fb7185;
}

body.dark-mode .market-mini-gauge-segment.is-neutral {
  stroke: #fbbf24;
}

body.dark-mode .market-mini-gauge-segment.is-greed {
  stroke: #4ade80;
}

body.dark-mode .market-mini-gauge-segment.is-extreme-greed {
  stroke: #22c55e;
}

body.dark-mode .market-mini-gauge-needle {
  stroke: #e2e8f0;
}

body.dark-mode .market-mini-gauge-hub {
  fill: #e2e8f0;
  stroke: #0f172a;
}

body.dark-mode .market-mini-gauge-score {
  fill: #e2e8f0;
}

.market-sentiment-title {
  margin-top: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
}

.market-sentiment-subtitle,
.market-sentiment-meta {
  margin-top: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.25;
}

.market-sentiment-link {
  color: #334155;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.market-sentiment-link:hover {
  color: var(--text);
}

.market-sentiment-subtitle:empty {
  display: none;
}

.market-futures-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.market-overview-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(11, minmax(0, 1fr));
}

.market-shade-guide-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
}

.market-shade-guide-grid[hidden] {
  display: none !important;
}

.health-panel {
  overflow: hidden;
}

.health-panel details {
  width: 100%;
}

.health-panel-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

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

.health-panel-summary h2 {
  margin: 0;
  font-size: 22px;
}

.health-panel-subtitle {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.health-panel-body {
  background: #ffffff;
  padding: 0 18px 18px;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

.health-panel-actions {
  padding: 0 18px 12px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.health-grid + .health-grid,
.health-grid + .health-meta-grid,
.health-meta-grid + .health-grid {
  margin-top: 12px;
}

.health-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
}

.health-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.health-card-title {
  font-size: 15px;
  font-weight: 700;
}

.health-status-chip {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.health-status-chip.is-healthy {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.health-status-chip.is-degraded {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.health-status-chip.is-failed {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.health-status-chip.is-loading {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.health-status-chip.is-idle {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.health-card-meta {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.health-card-meta strong {
  color: var(--text);
  font-weight: 600;
}

.health-card-error {
  margin-top: 8px;
  color: var(--negative);
  font-size: 12px;
  line-height: 1.45;
}

.health-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
}

.health-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.health-list li + li {
  margin-top: 4px;
}

.health-rate-limit {
  margin-top: 8px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
}

.market-overview-grid .market-overview-card {
  display: grid;
  position: relative;
  grid-template-rows: 36px 26px 18px;
  padding: 10px 8px 16px;
  min-width: 0;
  min-height: 112px;
  align-content: start;
  row-gap: 6px;
}

.market-futures-grid .market-future-card {
  display: grid;
  grid-template-rows: auto auto auto;
  min-width: 0;
  align-content: center;
  row-gap: 5px;
  padding: 12px 14px;
}

.market-shade-guide-grid .market-shade-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 64px;
  padding: 6px;
}

.market-shade-guide-grid .market-card-label {
  display: flex;
  align-items: flex-start;
  line-height: 1.2;
  font-size: 10px;
}

.market-shade-guide-grid .market-future-symbol {
  margin-top: auto;
  font-size: 18px;
  text-align: center;
}

.market-overview-grid .market-overview-title {
  display: block;
  min-height: 20px;
  max-height: 20px;
  line-height: 1.15;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  align-self: start;
  text-align: left;
}

.market-futures-grid .market-future-symbol {
  margin-top: 0;
  font-size: 17px;
  line-height: 1.15;
}

.market-futures-grid .market-future-price {
  margin-top: 0;
  font-size: 17px;
  line-height: 1.15;
}

.market-overview-grid .market-overview-price {
  margin-top: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: -0.02em;
  align-self: start;
}

.market-overview-grid .market-overview-change {
  margin-top: 0;
  padding-top: 0;
  font-size: 13px;
  align-self: start;
}

.market-overview-grid .market-overview-status {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  margin-top: 0;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(71, 85, 105, 0.88);
  white-space: nowrap;
}

.market-futures-grid .market-future-change {
  margin-top: 0;
  padding-top: 0;
  align-self: start;
}

.market-overview-grid .market-overview-card.is-previous-session .market-overview-price,
.market-overview-grid .market-overview-card.is-previous-session .market-overview-change {
  color: rgba(71, 85, 105, 0.82);
}

.market-overview-grid .market-overview-card.is-previous-session .market-overview-change.is-positive,
.market-overview-grid .market-overview-card.is-previous-session .market-overview-change.is-negative,
.market-overview-grid .market-overview-card.is-previous-session .market-overview-status {
  color: rgba(71, 85, 105, 0.82);
}

.market-card-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  min-width: 170px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.market-card-tooltip-label {
  font-weight: 700;
}

.market-card-tooltip-label.is-delayed {
  color: #fca5a5;
}

.market-card-tooltip-label.is-realtime {
  color: #bbf7d0;
}

.market-card-tooltip-refresh {
  margin-top: 2px;
}

.market-card-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.has-market-tooltip:hover .market-card-tooltip,
.has-market-tooltip:focus-within .market-card-tooltip {
  display: block;
}

.market-future-symbol {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
}

.market-future-price {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
}

.market-future-change {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.market-future-change.is-positive {
  color: var(--positive);
}

.market-future-change.is-negative {
  color: var(--negative);
}

@media (max-width: 980px) {
  .market-sentiment-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-futures-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-overview-grid {
    grid-column: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .market-shade-guide-grid {
    grid-column: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .health-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .market-sentiment-row {
    grid-template-columns: 1fr;
  }
}

.prices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#nextExpirationLabel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  text-align: right;
}

.header-meta-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.expiry-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.expiry-select-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.expiry-select {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text);
  background: #e5e7eb;
  outline: none;
}

.expiry-picker-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.expiry-picker-btn {
  height: 34px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #e5e7eb;
  cursor: pointer;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.expiry-picker-btn.is-open {
  background: #dde3ea;
  border-color: #94a3b8;
}

.expiry-picker-btn:hover {
  background: #dde3ea;
}

.expiry-picker-icon {
  font-size: 16px;
}

.expiry-calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  z-index: 1200;
}

.expiry-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.expiry-calendar-month {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.expiry-calendar-nav {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e5e7eb;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.expiry-calendar-nav:hover {
  background: #dde3ea;
}

.expiry-calendar-weekdays,
.expiry-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.expiry-calendar-weekdays {
  margin-bottom: 6px;
}

.expiry-calendar-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.expiry-calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.expiry-calendar-day:hover {
  background: #dde3ea;
}

.expiry-calendar-day.is-outside {
  color: #94a3b8;
}

.expiry-calendar-day.is-selected {
  background: #d1d5db;
  border-color: #cbd5e1;
}

.expiry-calendar-day.is-today .expiry-calendar-day-number {
  font-weight: 800;
}

.expiry-calendar-day-number {
  font-size: 13px;
  font-weight: 600;
}

.expiry-calendar-dot {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2563eb;
  transform: translateX(-50%);
}

.expiry-calendar-dot.is-hidden {
  visibility: hidden;
}

.card-header h2 {
  margin: 0;
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 20px;
  clip-path: inset(0 round 20px);
}

#pricesTable,
#tickersTable,
#scoutTable,
#customScoutTable,
#positionsTable {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 20px;
}

#pricesTable thead th:first-child,
#tickersTable thead th:first-child,
#scoutTable thead th:first-child,
#customScoutTable thead th:first-child,
#positionsTable thead th:first-child {
  border-top-left-radius: 20px;
}

#pricesTable thead th:last-child,
#tickersTable thead th:last-child,
#scoutTable thead th:last-child,
#customScoutTable thead th:last-child,
#positionsTable thead th:last-child {
  border-top-right-radius: 20px;
}

#pricesTable tbody tr:last-child td:first-child,
#tickersTable tbody tr:last-child td:first-child,
#scoutTable tbody tr:last-child td:first-child,
#customScoutTable tbody tr:last-child td:first-child,
#positionsTable tbody tr:last-child td:first-child {
  border-bottom-left-radius: 20px;
}

#pricesTable tbody tr:last-child td:last-child,
#tickersTable tbody tr:last-child td:last-child,
#scoutTable tbody tr:last-child td:last-child,
#customScoutTable tbody tr:last-child td:last-child,
#positionsTable tbody tr:last-child td:last-child {
  border-bottom-right-radius: 20px;
}

.cap-bucket-dropdown {
  position: relative;
  min-width: 220px;
}

.cap-bucket-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.cap-bucket-summary-text {
  font-weight: 400;
}

.single-filter-summary-text {
  font-weight: 400;
}

.cap-bucket-dropdown summary::-webkit-details-marker {
  display: none;
}

.cap-bucket-dropdown summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
}

.cap-bucket-dropdown[open] summary::after {
  content: "▴";
}

.cap-bucket-dropdown .cap-bucket-group {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  min-width: 220px;
  box-shadow: var(--shadow);
}

.cap-bucket-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.cap-bucket-option input {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#pricesTable {
  min-width: 1020px;
}

#pricesTable th,
#pricesTable td {
  position: relative;
}

#pricesTable th:not(:first-child),
#pricesTable td:not(:first-child) {
  box-shadow: inset 1px 0 0 rgba(148, 163, 184, 0.18);
}

#pricesTable td:nth-child(even):not(:last-child) {
  box-shadow:
    inset 1px 0 0 rgba(148, 163, 184, 0.18),
    inset 0 0 0 9999px rgba(148, 163, 184, 0.08);
}

#pricesTable th:nth-child(even):not(:last-child) {
  box-shadow:
    inset 1px 0 0 rgba(148, 163, 184, 0.18),
    inset 0 0 0 9999px rgba(148, 163, 184, 0.13);
}

#tickersTable {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
}

#scoutTable {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
}

#customScoutTable {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
}

#tickersTable th,
#tickersTable td {
  white-space: nowrap;
  padding: 8px 4px;
}

#tickersTable td:first-child {
  white-space: normal;
}

#scoutTable th,
#scoutTable td {
  white-space: nowrap;
  padding: 8px 4px;
}

#scoutTable td:first-child {
  white-space: normal;
}

#customScoutTable th,
#customScoutTable td {
  white-space: nowrap;
  padding: 8px 4px;
}

#customScoutTable td:first-child {
  white-space: normal;
}

#tickersTable th:nth-child(even):not(:last-child),
#tickersTable td:nth-child(even):not(:last-child),
#scoutTable th:nth-child(even):not(:last-child),
#scoutTable td:nth-child(even):not(:last-child),
#customScoutTable th:nth-child(even):not(:last-child),
#customScoutTable td:nth-child(even):not(:last-child),
#positionsTable th:nth-child(even):not(:last-child),
#positionsTable td:nth-child(even):not(:last-child) {
  background: rgba(148, 163, 184, 0.08);
}

#tickersTable th:nth-child(even):not(:last-child),
#scoutTable th:nth-child(even):not(:last-child),
#customScoutTable th:nth-child(even):not(:last-child),
#positionsTable th:nth-child(even):not(:last-child) {
  background: rgba(148, 163, 184, 0.13);
}

.scout-sort-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.scout-sort-btn:hover {
  color: var(--muted);
}

th,
td {
  border-bottom: 1px solid #edf2f7;
  padding: 10px 8px;
  font-size: 14px;
  vertical-align: middle;
}

thead th {
  background: #f1f5f9;
  position: relative;
  z-index: 1;
  text-align: left;
}

.header-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.header-with-resize {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  width: 100%;
}

.action-header-resize {
  min-height: 16px;
}

.action-header-spacer {
  display: inline-block;
  width: 1px;
  min-width: 1px;
  height: 1px;
}

.header-help {
  position: relative;
  display: inline-flex;
}

.header-help summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.header-help summary::-webkit-details-marker {
  display: none;
}

.header-help[open] .header-tooltip,
.header-help:hover .header-tooltip,
.header-help:focus-within .header-tooltip {
  display: block;
}

.header-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  white-space: normal;
  z-index: 30;
}

.floating-header-tooltip {
  display: none;
  position: fixed;
  width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  white-space: normal;
  pointer-events: none;
  z-index: 1000;
}

@media (hover: hover) and (pointer: fine) {
  .header-help summary {
    display: none;
  }

  .header-help {
    position: static;
    width: 0;
  }

  .header-help .header-tooltip {
    display: none !important;
  }

  .scout-link-row {
    display: none !important;
  }
}

.ticker-col {
  min-width: 180px;
}

.total-col {
  min-width: 90px;
  text-align: center;
  background: #dde3ea;
}

td.ticker-cell,
td.total-cell {
  font-weight: 700;
}

td.total-cell {
  text-align: center;
  background: #dde3ea;
}

.col-135,
.cell-135,
.col-tone-0,
.cell-tone-0 {
  background: var(--rose-bg);
  color: var(--rose-text);
}

.col-140,
.cell-140,
.col-tone-1,
.cell-tone-1 {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.col-145,
.cell-145,
.col-tone-2,
.cell-tone-2 {
  background: var(--lime-bg);
  color: var(--lime-text);
}

.col-150,
.cell-150,
.col-tone-3,
.cell-tone-3 {
  background: var(--emerald-strong);
  color: var(--emerald-text);
}

.col-135,
.col-140,
.col-145,
.col-150,
.col-tone-0,
.col-tone-1,
.col-tone-2,
.col-tone-3 {
  color: var(--text);
  text-align: center;
}

.dynamic-tone {
  background: var(--tone-bg);
  color: var(--tone-text);
  text-align: center;
  vertical-align: top;
}

#pricesTable td.dynamic-tone > * {
  margin-left: auto;
  margin-right: auto;
}

.dynamic-tone strong {
  color: inherit;
}

#pricesTable thead .dynamic-tone {
  font-weight: 800;
}

.target-price {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.option-cell-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-height: 100%;
}

.option-quote-block {
  width: 100%;
  margin-bottom: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.strike-cap-warning {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  color: #b91c1c;
  letter-spacing: 0.01em;
}

.option-trade-block {
  width: 100%;
}

.trade-inputs.is-empty-row {
  display: none;
}

.strike-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 12px;
  text-align: left;
  opacity: 0.95;
}

.strike-line:last-child {
  margin-bottom: 0;
}

.strike-line strong {
  color: inherit;
  font-weight: 800;
  text-align: right;
}

.trade-inputs,
.bought-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.trade-inputs input,
.strike-input {
  height: 28px;
  font-size: 12px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  outline: none;
}

.contract-input {
  width: 40px;
}

.premium-wrap,
.bought-strike-wrap {
  position: relative;
}

.premium-wrap span,
.bought-strike-wrap span {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.premium-input {
  width: 50px;
  padding-left: 16px;
}

.strike-input {
  width: 64px;
  padding-left: 16px;
}

.trade-inputs input.is-empty,
.strike-input.is-empty {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.xmark {
  color: var(--muted);
  font-size: 12px;
  min-width: 10px;
  text-align: center;
}

.hidden {
  color: transparent;
}

.table-footer,
.tickers-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 18px 16px;
  color: var(--muted);
  font-size: 14px;
}

.checkbox-row,
.tickers-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-refresh-help-wrap {
  cursor: help;
}

.auto-refresh-help-details summary {
  width: 15px;
  height: 15px;
  font-size: 10px;
}

.table-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pager-page-input {
  width: 84px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text);
  background: #e5e7eb;
  outline: none;
  text-align: center;
}

.pager-page-input::placeholder {
  color: var(--muted);
}

#tickersTable input {
  width: 100%;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 14px;
  color: var(--text);
  background: #e5e7eb;
  outline: none;
}

#tickersTable input::placeholder {
  color: var(--muted);
}

#tickersTable input.earnings-risk-input {
  color: var(--negative);
  border-color: #fca5a5;
  background: #fff5f5;
  font-weight: 700;
}

body.dark-mode #tickersTable input {
  border-color: rgba(148, 163, 184, 0.34);
  background: #243047;
  color: #f8fafc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(15, 23, 42, 0.22);
}

body.dark-mode #tickersTable input::placeholder {
  color: #94a3b8;
}

body.dark-mode #tickersTable input.earnings-risk-input {
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(127, 29, 29, 0.34);
  color: #fecaca;
}

.btn {
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.btn.secondary {
  background: #e5e7eb;
  color: var(--text);
}

.delete-btn {
  border: none;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 999px;
}

.delete-btn:hover {
  color: var(--text);
  background: #f1f5f9;
}

.delete-btn.confirming {
  color: #b91c1c;
  background: #fef2f2;
  font-size: 12px;
  font-weight: 700;
}

.ticker-actions-cell {
  white-space: nowrap;
  text-align: center;
}

.ticker-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
}

.reorder-btn {
  border: 1px solid var(--border);
  background: #e5e7eb;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.reorder-btn:hover:not(:disabled) {
  background: #dde3ea;
}

.reorder-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.error {
  margin: 0 18px 18px;
  padding: 10px 12px;
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 12px;
  font-size: 14px;
}

#lastPriceUpdate,
#lastEarningsRefresh {
  margin-left: auto;
  text-align: right;
}

#pricesTable td.ticker-cell,
#tickersTable thead th:nth-child(1),
#positionsTable td.ticker-cell {
  padding-left: 12px;
}

#tickersTable .range-cell {
  min-width: 92px;
}

#tickersTable .ma-cell {
  min-width: 58px;
}

#tickersTable .atr-band-cell {
  min-width: 82px;
}

.row-total-value {
  margin-top: 0;
}

.ticker-main-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.ticker-main-line.earnings-risk-text,
.ticker-main-line.earnings-risk-text .ticker-price-inline {
  color: var(--negative);
}

.ticker-price-inline {
  font-size: 13px;
  font-weight: 600;
  color: #000000;
}

.ticker-iv-inline {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

#tickersTable td.ticker-metric-cell {
  white-space: nowrap;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.ticker-sub-line {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}

.ticker-sub-line.is-positive,
.ticker-sub-line.is-positive strong {
  color: var(--positive);
}

.ticker-sub-line.is-negative,
.ticker-sub-line.is-negative strong {
  color: var(--negative);
}

.ticker-sub-line.is-neutral strong {
  color: var(--muted);
}

.premium-quote-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 60px;
}

.premium-quote-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text);
  font-weight: 500;
}

.premium-quote-label {
  color: inherit;
  font-weight: inherit;
}

.premium-quote-row strong {
  color: inherit;
  font-weight: inherit;
}

#tickersTable th[data-col-key="premium140"] .header-with-resize,
#tickersTable th[data-col-key="premium145"] .header-with-resize,
#tickersTable th[data-col-key="premium150"] .header-with-resize,
#scoutTable th[data-col-key="premium140"] .header-with-resize,
#scoutTable th[data-col-key="premium145"] .header-with-resize,
#scoutTable th[data-col-key="premium150"] .header-with-resize,
#customScoutTable th[data-col-key="premium140"] .header-with-resize,
#customScoutTable th[data-col-key="premium145"] .header-with-resize,
#customScoutTable th[data-col-key="premium150"] .header-with-resize {
  justify-content: center;
}

#tickersTable th[data-col-key="premium140"] .header-with-help,
#tickersTable th[data-col-key="premium145"] .header-with-help,
#tickersTable th[data-col-key="premium150"] .header-with-help,
#scoutTable th[data-col-key="premium140"] .header-with-help,
#scoutTable th[data-col-key="premium145"] .header-with-help,
#scoutTable th[data-col-key="premium150"] .header-with-help,
#customScoutTable th[data-col-key="premium140"] .header-with-help,
#customScoutTable th[data-col-key="premium145"] .header-with-help,
#customScoutTable th[data-col-key="premium150"] .header-with-help {
  justify-content: center;
}

#tickersTable td:nth-child(5),
#tickersTable td:nth-child(6),
#tickersTable td:nth-child(7),
#scoutTable td:nth-child(5),
#scoutTable td:nth-child(6),
#scoutTable td:nth-child(7),
#customScoutTable td:nth-child(5),
#customScoutTable td:nth-child(6),
#customScoutTable td:nth-child(7) {
  text-align: center;
}

.positions-section {
  border-top: 1px solid #edf2f7;
}

.scout-header,
.scout-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.scout-header,
.scout-footer {
  justify-content: flex-start;
}

.scout-panel details {
  width: 100%;
}

.scout-panel-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

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

.scout-panel-summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.scout-panel details[open] > .scout-panel-summary::after {
  content: "▴";
}

.scout-panel-summary h2 {
  margin: 0;
  font-size: 22px;
}

.scout-panel-summary-copy {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scout-panel-body {
  background: #ffffff;
  padding: 0 0 18px;
}

#scoutPanelDetails > .scout-panel-body,
#customScoutPanelDetails > .scout-panel-body {
  background: #ffffff;
  padding: 12px 18px 18px;
}

.scout-controls {
  background: transparent;
  padding: 10px 18px 14px;
  align-items: flex-end;
}

#scoutPanelDetails > .scout-panel-body > .scout-controls,
#customScoutPanelDetails > .scout-panel-body > .scout-controls {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.scout-inline-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.scout-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.scout-control > span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.custom-scout-top-filters .scout-control > span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.custom-scout-sector-control,
.custom-scout-sector-control .cap-bucket-dropdown,
.custom-scout-sector-control .cap-bucket-dropdown summary,
.custom-scout-sector-control .cap-bucket-summary-text {
  font-weight: 400;
}

.scout-control-compact {
  min-width: 120px;
}

.custom-scout-search-control {
  flex: 0 1 260px;
  width: 100%;
  max-width: 320px;
}

.custom-scout-sector-control {
  flex: 0 0 220px;
}

.custom-scout-top-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.custom-scout-inline-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.custom-scout-sector-control .cap-bucket-dropdown {
  min-width: 220px;
  width: 100%;
}

.custom-scout-range-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.custom-scout-range-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
}

.custom-scout-range-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.custom-scout-range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.price-filter-pair {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

.scout-control select {
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.scout-control input {
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.scout-checkbox {
  min-height: 38px;
  color: var(--text);
  font-weight: 600;
}

.scout-action-cell {
  text-align: center;
}

.scout-add-btn {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.scout-ticker-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  padding-right: 56px;
}

.scout-hover-trigger {
  position: relative;
  cursor: pointer;
}

.scout-ticker-line {
  font-size: 14px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.scout-ticker-line.scout-hover-trigger {
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
}

.scout-company-name {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.scout-company-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.scout-industry {
  overflow-wrap: anywhere;
}

.scout-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scout-hover-source {
  display: none;
}

.scout-info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: var(--text);
  background: #e5e7eb;
  text-decoration: none;
  font-weight: 700;
}

.scout-info-link:hover {
  background: #dde3ea;
}

.scout-cell-add-link {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 56px;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  border-color: #cbd5e1;
  background: #dde3ea;
  color: #334155;
}

.scout-cell-add-link:hover {
  background: #eef2f7;
  border-color: #94a3b8;
}

.scout-cell-add-link.is-added {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.scout-cell-add-link.is-added:hover {
  border-color: #86efac;
  background: #dcfce7;
}

.scout-cell-add-link.is-disabled,
.scout-inline-add-link.is-disabled,
.floating-scout-popover .scout-popover-add-btn.is-disabled {
  border-color: #93c5fd;
  background: #bfdbfe;
  color: #eff6ff;
  cursor: default;
  pointer-events: none;
}

.floating-scout-popover {
  display: none;
  position: fixed;
  min-width: 168px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #e5e7eb;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 1000;
}

.floating-scout-popover .scout-hover-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.floating-scout-popover .scout-hover-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.floating-scout-popover .scout-hover-description {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.floating-scout-popover .scout-hover-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.floating-scout-popover .scout-popover-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.floating-scout-popover .scout-popover-add-btn:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.floating-scout-popover .scout-popover-add-btn:disabled {
  border-color: #93c5fd;
  background: #bfdbfe;
  color: #eff6ff;
  cursor: default;
}

.floating-scout-popover .scout-popover-add-btn.is-disabled {
  border-color: #93c5fd;
  background: #bfdbfe;
  color: #eff6ff;
  cursor: default;
  pointer-events: none;
}

#scoutTable .range-cell {
  min-width: 92px;
}

#customScoutTable .range-cell {
  min-width: 92px;
}

#scoutTable .ma-cell {
  min-width: 58px;
}

#customScoutTable .ma-cell {
  min-width: 58px;
}

#scoutTable .atr-band-cell {
  min-width: 82px;
}

#customScoutTable .atr-band-cell {
  min-width: 82px;
}

.range-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 108px;
}

.range-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fecaca 0%, #fef3c7 50%, #bbf7d0 100%);
  overflow: visible;
}

.range-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #0f172a;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transform: translate(-50%, -50%);
}

.range-cell-text {
  font-size: 12px;
  color: var(--muted);
}

body.dark-mode .range-bar {
  background: linear-gradient(90deg, #b91c1c 0%, #f59e0b 50%, #16a34a 100%);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

body.dark-mode .range-marker {
  background: #dde3ea;
  border-color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45);
}

body.dark-mode .range-cell-text {
  color: #cbd5e1;
}

.ma-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 86px;
}

.ma-line {
  font-size: 12px;
  color: var(--muted);
}

.ma-line-single {
  white-space: nowrap;
}

.atr-band-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 92px;
}

.atr-band-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fecaca 0%, #f8fafc 50%, #bbf7d0 100%);
  overflow: visible;
}

.atr-band-midline {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
}

.atr-band-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #0f172a;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transform: translate(-50%, -50%);
}

.atr-band-text {
  font-size: 12px;
  color: var(--muted);
}

body.dark-mode .atr-band-bar {
  background: linear-gradient(90deg, #b91c1c 0%, #f59e0b 50%, #16a34a 100%);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

body.dark-mode .atr-band-midline {
  background: rgba(248, 250, 252, 0.42);
}

body.dark-mode .atr-band-marker {
  background: #dde3ea;
  border-color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45);
}

body.dark-mode .atr-band-text {
  color: #cbd5e1;
}

/* Light-mode table surfaces stay crisp white inside the gray page shell. */
#pricesTable,
#tickersTable,
#scoutTable,
#customScoutTable,
#positionsTable {
  background: #ffffff;
}

.table-wrap,
.positions-section,
.market-grid,
.health-panel-body {
  background: #ffffff;
}

#tickersTable th,
#tickersTable td,
#scoutTable th,
#scoutTable td,
#customScoutTable th,
#customScoutTable td,
#positionsTable th,
#positionsTable td {
  background-color: #ffffff;
}

#tickersTable th:nth-child(even):not(:last-child),
#tickersTable td:nth-child(even):not(:last-child),
#scoutTable th:nth-child(even):not(:last-child),
#scoutTable td:nth-child(even):not(:last-child),
#customScoutTable th:nth-child(even):not(:last-child),
#customScoutTable td:nth-child(even):not(:last-child) {
  background: rgba(148, 163, 184, 0.08);
}

#tickersTable th:nth-child(even):not(:last-child),
#scoutTable th:nth-child(even):not(:last-child),
#customScoutTable th:nth-child(even):not(:last-child) {
  background: rgba(148, 163, 184, 0.13);
}

#pricesTable td.ticker-cell,
#pricesTable td.total-cell,
.total-col {
  background: #ffffff;
}

#pricesTable td.dynamic-tone {
  background: var(--tone-bg);
}

#pricesTable thead .dynamic-tone {
  background: var(--tone-bg);
}

.option-quote-block {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

#tickersTable input,
.bought-marker {
  background: #ffffff;
}

.btn.secondary,
.reorder-btn,
.theme-toggle-btn,
.app-tabs,
.total-badge,
.muted-chip,
.health-card,
.header-help summary,
.pager-page-input,
.expiry-picker-btn,
.expiry-calendar-popover,
.expiry-calendar-nav,
.scout-info-link,
.scout-cell-add-link,
.scout-hover-card,
.custom-scout-range-group,
.auth-card,
.auth-field input {
  background: #ffffff;
}

.app-tab:hover,
.theme-toggle-btn:hover,
.reorder-btn:hover:not(:disabled),
.expiry-picker-btn.is-open,
.expiry-picker-btn:hover,
.expiry-calendar-nav:hover,
.expiry-calendar-day:hover,
.scout-info-link:hover,
.scout-cell-add-link:hover {
  background: #f8fafc;
}

.app-tab.is-active,
.expiry-calendar-day.is-selected {
  background: #e2e8f0;
}

body.dark-mode #pricesTable,
body.dark-mode #tickersTable,
body.dark-mode #scoutTable,
body.dark-mode #customScoutTable,
body.dark-mode #positionsTable,
body.dark-mode .table-wrap,
body.dark-mode .positions-section,
body.dark-mode .market-grid,
body.dark-mode .health-panel-body,
body.dark-mode .scout-panel-body {
  background: #111827;
}

body.dark-mode #tickersTable th,
body.dark-mode #tickersTable td,
body.dark-mode #scoutTable th,
body.dark-mode #scoutTable td,
body.dark-mode #customScoutTable th,
body.dark-mode #customScoutTable td,
body.dark-mode #positionsTable th,
body.dark-mode #positionsTable td {
  background-color: #111827;
}

body.dark-mode #tickersTable th:nth-child(even):not(:last-child),
body.dark-mode #tickersTable td:nth-child(even):not(:last-child),
body.dark-mode #scoutTable th:nth-child(even):not(:last-child),
body.dark-mode #scoutTable td:nth-child(even):not(:last-child),
body.dark-mode #customScoutTable th:nth-child(even):not(:last-child),
body.dark-mode #customScoutTable td:nth-child(even):not(:last-child),
body.dark-mode #positionsTable th:nth-child(even):not(:last-child),
body.dark-mode #positionsTable td:nth-child(even):not(:last-child) {
  background: rgba(148, 163, 184, 0.08);
}

body.dark-mode #tickersTable th:nth-child(even):not(:last-child),
body.dark-mode #scoutTable th:nth-child(even):not(:last-child),
body.dark-mode #customScoutTable th:nth-child(even):not(:last-child),
body.dark-mode #positionsTable th:nth-child(even):not(:last-child) {
  background: rgba(148, 163, 184, 0.13);
}

body.dark-mode #pricesTable td.ticker-cell,
body.dark-mode #pricesTable td.total-cell,
body.dark-mode .total-col {
  background: #172036;
}

body.dark-mode .option-quote-block,
body.dark-mode #tickersTable input,
body.dark-mode .bought-marker,
body.dark-mode .btn.secondary,
body.dark-mode .reorder-btn,
body.dark-mode .theme-toggle-btn,
body.dark-mode .app-tabs,
body.dark-mode .total-badge,
body.dark-mode .muted-chip,
body.dark-mode .health-card,
body.dark-mode .header-help summary,
body.dark-mode .pager-page-input,
body.dark-mode .expiry-picker-btn,
body.dark-mode .expiry-calendar-popover,
body.dark-mode .expiry-calendar-nav,
body.dark-mode .scout-info-link,
body.dark-mode .scout-cell-add-link,
body.dark-mode .scout-hover-card,
body.dark-mode .custom-scout-range-group,
body.dark-mode .auth-card,
body.dark-mode .auth-field input {
  background: #172036;
}

body.dark-mode .app-tab:hover,
body.dark-mode .theme-toggle-btn:hover,
body.dark-mode .reorder-btn:hover:not(:disabled),
body.dark-mode .expiry-picker-btn.is-open,
body.dark-mode .expiry-picker-btn:hover,
body.dark-mode .expiry-calendar-nav:hover,
body.dark-mode .expiry-calendar-day:hover,
body.dark-mode .scout-info-link:hover,
body.dark-mode .scout-cell-add-link:hover {
  background: #22304a;
}

body.dark-mode .app-tab.is-active,
body.dark-mode .expiry-calendar-day.is-selected {
  background: #2b3b57;
}

body.dark-mode thead th,
body.dark-mode #tickersTable thead th,
body.dark-mode #scoutTable thead th,
body.dark-mode #customScoutTable thead th,
body.dark-mode #positionsTable thead th,
body.dark-mode #pricesTable thead th {
  background: #162033 !important;
  color: var(--text);
}

body.dark-mode .scout-panel-summary,
body.dark-mode .health-panel-summary {
  background: #162033 !important;
  color: var(--text);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .scout-panel {
  background: #111827;
}

body.dark-mode .scout-panel-summary h2,
body.dark-mode .health-panel-summary h2,
body.dark-mode .scout-panel-summary-copy,
body.dark-mode .health-panel-subtitle,
body.dark-mode #lastMarketUpdate,
body.dark-mode #lastPriceUpdate,
body.dark-mode #lastPriceUpdate * {
  color: var(--text) !important;
}

body.dark-mode .scout-panel-summary::after,
body.dark-mode .health-panel-summary::after {
  color: rgba(226, 232, 240, 0.82);
}

body.dark-mode .scout-panel-body,
body.dark-mode .scout-controls,
body.dark-mode .custom-scout-controls,
body.dark-mode .table-wrap.scout-panel-body,
body.dark-mode .scout-panel .table-wrap {
  background: #111827 !important;
}

body.dark-mode #scoutPanelDetails > .scout-panel-body,
body.dark-mode #customScoutPanelDetails > .scout-panel-body {
  background: #111827 !important;
}

body.dark-mode .scout-control,
body.dark-mode .scout-control > span,
body.dark-mode .custom-scout-range-title,
body.dark-mode .custom-scout-range-inputs .price-filter-pair,
body.dark-mode .custom-scout-range-inputs .price-filter-pair label {
  color: var(--text) !important;
}

body.dark-mode .scout-control select,
body.dark-mode .scout-control input,
body.dark-mode .custom-scout-top-filters input,
body.dark-mode .custom-scout-range-group input,
body.dark-mode .cap-bucket-dropdown summary,
body.dark-mode .cap-bucket-dropdown .cap-bucket-group,
body.dark-mode .custom-scout-range-group {
  background: #172036 !important;
  color: var(--text) !important;
  border-color: rgba(71, 85, 105, 0.9) !important;
}

body.dark-mode .custom-scout-range-group {
  box-shadow: inset 0 0 0 1px rgba(30, 41, 59, 0.2);
}

body.dark-mode .scout-control input::placeholder,
body.dark-mode .custom-scout-range-group input::placeholder {
  color: rgba(148, 163, 184, 0.9) !important;
}

body.dark-mode .cap-bucket-dropdown summary::after,
body.dark-mode .cap-bucket-dropdown .cap-bucket-group label,
body.dark-mode .cap-bucket-summary-text {
  color: var(--text) !important;
}

body.dark-mode #tickersTable th:nth-child(even):not(:last-child),
body.dark-mode #scoutTable th:nth-child(even):not(:last-child),
body.dark-mode #customScoutTable th:nth-child(even):not(:last-child),
body.dark-mode #positionsTable th:nth-child(even):not(:last-child),
body.dark-mode #pricesTable th:nth-child(even):not(:last-child) {
  background: #1a263c !important;
}

.scout-add-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.scout-empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 18px 12px;
  font-weight: 600;
}

.positions-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.positions-footer {
  justify-content: flex-start;
}

#positionsTable th,
#positionsTable td {
  text-align: center;
}

#positionsTable {
  table-layout: fixed;
}

#positionsTable td.ticker-cell,
#positionsTable th.ticker-col {
  text-align: left;
  width: 160px;
}

#positionsTable th:not(.ticker-col),
#positionsTable td:not(.ticker-cell) {
  width: calc((100% - 160px) / 3);
}

#positionsTable th:nth-child(even),
#positionsTable td:nth-child(even) {
  background: rgba(148, 163, 184, 0.08) !important;
}

#positionsTable th:nth-child(even) {
  background: rgba(148, 163, 184, 0.13) !important;
}

body.dark-mode #positionsTable th:nth-child(even),
body.dark-mode #positionsTable td:nth-child(even) {
  background: rgba(148, 163, 184, 0.08) !important;
}

body.dark-mode #positionsTable th:nth-child(even) {
  background: #1a263c !important;
}

#tickersTable thead th[data-col-key],
#scoutTable thead th[data-col-key],
#customScoutTable thead th[data-col-key] {
  position: relative;
}

.table-col-resize-handle {
  position: absolute;
  top: 0;
  right: -8px;
  width: 16px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 5;
}

.table-col-resize-handle::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.28);
}

#tickersTable thead th:hover .table-col-resize-handle::after,
#scoutTable thead th:hover .table-col-resize-handle::after,
#customScoutTable thead th:hover .table-col-resize-handle::after,
.table-col-resize-handle:hover::after {
  background: rgba(15, 23, 42, 0.48);
}

body.is-resizing-columns {
  cursor: col-resize;
  user-select: none;
}

.position-cell {
  min-width: 220px;
  text-align: center;
}

.bought-position-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 128px;
  margin: 0 auto;
}

.bought-strike-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  width: 40px;
  text-align: right;
}

.bought-strike-line {
  display: grid;
  grid-template-columns: 40px 64px;
  align-items: center;
  column-gap: 6px;
  width: 100%;
}

.bought-input-row {
  display: grid;
  grid-template-columns: 40px 10px 50px;
  align-items: center;
  column-gap: 4px;
  width: 100%;
}

.bought-strike-wrap {
  width: 64px;
}

.premium-wrap {
  width: 50px;
}

#positionsTable .contract-input,
#positionsTable .premium-input,
#positionsTable .strike-input {
  display: block;
  width: 100%;
  height: 28px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

#positionsTable .contract-input {
  padding: 0;
}

#positionsTable .premium-input,
#positionsTable .strike-input {
  padding-right: 6px;
}

#positionsTable .contract-input.is-empty,
#positionsTable .premium-input.is-empty,
#positionsTable .strike-input.is-empty {
  text-align: left;
  padding-left: 8px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#positionsTable .contract-input:not(.is-empty),
#positionsTable .premium-input:not(.is-empty),
#positionsTable .strike-input:not(.is-empty) {
  text-align: center;
  padding-left: 0;
  border-color: #cbd5e1;
  background: transparent;
}

#positionsTable input:-webkit-autofill,
#positionsTable input:-webkit-autofill:hover,
#positionsTable input:-webkit-autofill:focus,
#positionsTable input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
  background-color: transparent !important;
  border-color: #cbd5e1;
  transition: background-color 9999s ease-out 0s;
}

.bought-marker-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
}

.bought-marker {
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  padding: 4px 6px;
  border-radius: 8px;
  color: #0f172a;
  font-weight: 700;
  background: #e5e7eb;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.dark-mode .bought-marker {
  color: #f8fafc;
  background: #243047;
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(15, 23, 42, 0.22);
}

.hidden {
  display: none;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-tabs {
    display: flex;
    width: 100%;
  }

  .app-tab {
    flex: 1 1 0;
    text-align: center;
  }

  .theme-toggle-btn {
    margin-left: 0;
    width: 100%;
  }

  .topbar-title {
    font-size: 28px;
  }

  .topbar-date {
    font-size: 13px;
  }

  .scout-control {
    min-width: 100%;
  }

  .custom-scout-range-grid {
    grid-template-columns: 1fr;
  }

  .custom-scout-inline-filters {
    width: 100%;
  }

  .scout-inline-controls {
    width: 100%;
  }

  .custom-scout-range-inputs {
    grid-template-columns: 1fr 1fr;
  }

  .price-filter-pair {
    width: 100%;
    flex-wrap: wrap;
  }

  .cap-bucket-dropdown {
    width: 100%;
  }

  .cap-bucket-dropdown .cap-bucket-group {
    min-width: 100%;
  }

  .scout-control-compact {
    min-width: calc(50% - 6px);
  }

  .scout-action-cell {
    text-align: left;
  }

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