/* Inter font loaded via <link> in HTML for faster preconnect */

:root {
  --bg: #000000;
  --bg-elev: #000000;
  --bg-soft: #111111;
  --bg-hover: #111111;
  --accent: #f4b740;
  --accent-2: #00ff88;
  --danger: #ff4d4d;
  --text: #ffffff;
  --text-2: #d0d0d0;
  --text-3: #aaaaaa;
  --text-4: #777777;
  --muted: #aaaaaa;
  --border: rgba(255,255,255,0.10);
  --border-focus: rgba(255,255,255,0.18);
  --shadow: rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --green: #00ff88;
  --green-soft: rgba(0, 255, 136, 0.06);
  --green-border: rgba(0, 255, 136, 0.18);
  --red: #ff4d4d;
  --red-soft: rgba(255, 77, 77, 0.06);
  --red-border: rgba(255, 77, 77, 0.18);
  --analysis-panel-height: 967px;
  --chart-fixed-width: 1365px;
}

[data-theme="light"] {
  --bg: #f9f9fb;
  --bg-elev: #ffffff;
  --bg-soft: #f4f4f6;
  --bg-hover: #eaeaed;
  --text: #050505;
  --text-2: #374151;
  --text-3: #4b5563;
  --text-4: #6b7280;
  --muted: #6b7280;
  --border: rgba(0,0,0,0.08);
  --border-focus: rgba(0,0,0,0.18);
  --shadow: rgba(0,0,0,0.08);
  --green: #16a34a;
  --green-soft: rgba(22,163,74,0.08);
  --green-border: rgba(22,163,74,0.25);
  --red: #dc2626;
  --red-soft: rgba(220,38,38,0.06);
  --red-border: rgba(220,38,38,0.18);
  --accent: #d97706;
  --accent-2: #16a34a;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.ambient {
  display: none;
}

/* ===== HEADER (Genie-style) ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 32px;
  background: rgba(0,0,0,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
[data-theme="light"] .header {
  background: rgba(255,255,255,0.88);
  border-bottom-color: rgba(0,0,0,0.06);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}
.header-nav {
  display: flex;
  gap: 4px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clock-sep { color: var(--text-4); }
.market-badge {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--red-soft);
  color: var(--red);
}
.market-badge.open {
  background: var(--green-soft);
  color: var(--green);
}
.lang-toggle, .theme-toggle {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.lang-toggle:hover, .theme-toggle:hover {
  border-color: var(--border-focus);
  background: var(--bg-hover);
}
.search-input {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.8125rem;
  font-family: inherit;
  width: 120px;
}
.search-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.sort-select {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
}
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  cursor: pointer;
}

/* ===== INDEX BANNER ===== */
.index-banner {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.index-banner-inner {
  max-width: 100%;
}
.indices-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 24px;
  min-height: 44px;
  position: relative;
}
.banner-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.indices-bar .index-list {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.indices-bar .index-list::-webkit-scrollbar {
  display: none;
}
.indices-bar .indices-edit {
  font-size: 0.6875rem;
  color: var(--text-4);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}
[data-theme="light"] .brand { color: #000; }

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 0;
  padding: 0;
  background: transparent;
  border: none;
  object-fit: contain;
  box-shadow: none;
}

.brand-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
  white-space: nowrap;
}

.brand-accent {
  color: var(--green);
}
.header-subtitle {
  color: var(--text-3);
  font-size: 1.125rem;
  font-weight: 400;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.header-date {
  color: var(--text-1);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clock-tz-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.clock-tz-btn:hover {
  background: var(--bg-2);
}

.brand-sub {
  margin: 4px 0 0;
  color: var(--text-4);
  font-size: 12px;
}

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

.nav-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  height: 28px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.nav-btn:hover {
  border-color: var(--border-focus);
}

.nav-btn.active {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-soft);
  box-shadow: none;
}

.nav-btn.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-3);
}

.nav-popup {
  position: absolute;
  min-width: 120px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}

.nav-popup.show {
  display: flex;
}

.nav-popup button {
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.nav-popup button:hover {
  border-color: var(--border-focus);
  background: var(--bg-hover);
}

td[data-foa-ticker] {
  cursor: pointer;
}

.analysis-html .styled-table td:first-child,
.analysis-html .styled-table td:nth-child(3) {
  cursor: pointer;
}

.chart-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chart-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 14px;
  flex-shrink: 0;
}

.chart-header-main {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px 10px;
}

#chart-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.chart-header .chart-tabs {
  margin: 0 0 0 auto;
  flex-shrink: 0;
}

#tv-chart-container {
  position: relative;
  overflow: hidden;
}

.fib-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.fib-bands {
  position: absolute;
  inset: 0;
}

.fib-band {
  position: absolute;
  border-radius: 2px;
}

.fib-line {
  position: absolute;
  height: 2px;
  opacity: 0.95;
}

.fib-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.fib-label {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #101214;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.vp-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.vp-bars {
  position: absolute;
  inset: 0;
}

.vp-bar {
  position: absolute;
  border-radius: 2px;
}

.vp-labels {
  position: absolute;
  inset: 0;
}

.vp-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.chart-image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.fred-chart-split {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.fred-chart-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 160px;
}

.fred-chart-label {
  color: #b5b5b5;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fred-chart-canvas {
  flex: 1;
  min-height: 140px;
}

.buffett-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: 100%;
}
.buffett-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.buffett-panel-label {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 4px;
}
.buffett-chart-el {
  flex: 1;
  min-height: 120px;
}

.fred-key-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  min-height: 200px;
  padding: 32px;
  text-align: center;
}
.fred-key-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.fred-key-desc {
  font-size: 13px;
  color: var(--text-3);
}
.fred-key-desc a {
  color: var(--accent);
}
.fred-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.fred-key-input {
  width: 280px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.fred-key-input:focus {
  outline: none;
  border-color: var(--accent);
}
.fred-key-btn {
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(244, 183, 64, 0.14);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.indices {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.indices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
}



.indices-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: var(--radius-xs);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.indices-edit:hover {
  border-color: var(--border-focus);
}

.index-list {
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.index-card {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.index-card:hover {
  border-color: var(--border-focus);
}

.index-arrow {
  font-size: 12px;
  font-weight: 700;
}

.index-arrow-box {
  width: 18px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.index-card.up .index-arrow-box {
  background: var(--green-soft);
  border-color: var(--green-border);
}

.index-card.down .index-arrow-box {
  background: var(--red-soft);
  border-color: var(--red-border);
}

.index-card.neutral .index-arrow-box {
  background: var(--bg-soft);
  border-color: var(--border);
}

.index-card.up .index-arrow {
  color: var(--green);
}

.index-card.down .index-arrow {
  color: var(--red);
}

.index-card.neutral .index-arrow {
  color: var(--text-4);
}

.index-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.index-name {
  font-weight: 700;
}

.index-price {
  font-size: 11px;
  color: var(--text-3);
}

.index-change {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
}

.index-card.up .index-change {
  color: var(--green);
}

.index-card.down .index-change {
  color: var(--red);
}

.index-card.editing {
  border-color: var(--accent);
  border-style: dashed;
  background: rgba(244, 183, 64, 0.05);
  cursor: default;
}

.index-delete-btn {
  background: rgba(255, 107, 107, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
}

.index-add-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  outline: none;
}

.index-add-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.index-add-btn {
  background: rgba(47, 210, 134, 0.15);
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  padding: 0;
}

.index-add-btn:hover {
  background: rgba(47, 210, 134, 0.25);
}

.index-card.history {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  color: var(--text);
}

.index-card.history:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.clock {
  font-size: clamp(10px, 0.95vw, 13px);
  color: var(--text-3);
  display: grid;
  gap: 4px;
  text-align: center;
  align-items: center;
}

.clock-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.clock-label {
  font-weight: 600;
  color: var(--text-2);
}

.clock-date {
  letter-spacing: 0.3px;
  color: var(--text-3);
}

.clock-time {
  font-weight: 600;
  color: var(--text);
}

.sidebar-toggles {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.sidebar-toggle-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
  padding: 0;
}

.sidebar-toggle-btn:hover {
  border-color: var(--border-focus);
}

.clock-panel {
  margin-top: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.clock .market {
  color: var(--danger);
}

.main {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-rows: auto 1fr;
  gap: 16px 24px;
  min-height: 0;
  height: calc(100vh - 56px - 50px);
  overflow: hidden;
  --panel-width: 100%;
}

.mobile-only {
  display: none;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.15);
  z-index: 900;
}

.mobile-view-tabs {
  display: none;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.mobile-view-tab {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-3);
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.mobile-view-tab.active {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-soft);
}

.topbar-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.topbar input,
.topbar select {
  font-size: 11px;
  padding: 6px 8px;
}

.topbar .toggle {
  font-size: 11px;
  padding: 3px 7px;
}

.topbar .cta {
  font-size: 11px;
  padding: 6px 12px;
}

.topbar .top-btn {
  font-size: 11px;
  padding: 5px 9px;
}

.ticker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticker-primary {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticker-input-wrap {
  position: relative;
  z-index: 200;
}

.ticker-input-wrap input {
  width: 120px;
}

.ticker-history-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ticker-input-wrap.is-open .ticker-history-list {
  display: flex;
}

.ticker-history-list .index-card.history {
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
  font-size: 11px;
  border-left: none;
}

input,
select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

#ticker {
  text-transform: uppercase;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.cta {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.cta.run-btn {
  position: relative;
  overflow: hidden;
  padding: 8px 16px;
  letter-spacing: 0.4px;
  font-weight: 700;
}

.cta.run-btn::after {
  content: none;
}

.cta:hover {
  transform: translateY(-1px);
  border-color: var(--green);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.top-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.top-btn:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

.top-btn[data-action="capture"] {
  position: relative;
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green);
  font-weight: 600;
  padding-left: 26px;
}

.top-btn[data-action="capture"]::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
}

.top-btn[data-action="capture"]:hover {
  border-color: var(--green);
}

.top-btn[data-action="capture"]:active {
  transform: translateY(0);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
  align-items: center;
}

.auto-countdown {
  margin-left: auto;
  align-self: center;
  order: 99;
  white-space: nowrap;
  height: 28px;
  display: flex;
  align-items: center;
  pointer-events: none;
  font-size: 11px;
  line-height: 1;
  color: #c0c0c0;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  position: relative;
  top: 1px;
}

.auto-countdown.is-hidden {
  display: none;
}

.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-3);
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.tab:hover {
  color: var(--text-2);
}

.chart-tab {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-3);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.chart-tab:hover {
  border-color: var(--border-focus);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

.chart-tab.active {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-soft);
}
.chart-tab.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: auto;
}

.chart-tab-dropdown {
  position: relative;
  display: inline-block;
}
.chart-tab-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  margin-top: 4px;
  padding: 4px 0;
  min-width: 160px;
  background: #1a2230;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.chart-tab-dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
}
.chart-tab-dropdown-menu button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.chart-tab-dropdown.open .chart-tab-dropdown-menu {
  display: block;
}
[data-theme="light"] .chart-tab-dropdown-menu {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.toggle-sep {
  color: #4a5568;
  font-weight: 700;
  user-select: none;
  margin: 0 2px;
}
/* Chart wrap: flex column fills remaining space after header, no overflow */
.tv-chart-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}
.tv-main-chart {
  flex: 14;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.indicator-pane {
  border-top: 1px solid var(--border);
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}
.tv-chart-wrap:not(.has-chart) .indicator-pane {
  border-top: none;
}
.indicator-pane.sub-vol {
  flex: 1.2;
}
.indicator-pane.sub-ind {
  flex: 1.5;
}
.indicator-pane.hidden {
  display: none;
}
.indicator-pane:empty {
  display: none;
}
.indicator-pane .indicator-label {
  position: absolute;
  top: 2px;
  left: 6px;
  font-size: 10px;
  color: #9eb0c9;
  z-index: 2;
  pointer-events: none;
  font-weight: 600;
}

/* Heatmap calendar */
.heatmap-wrap {
  padding: 12px;
  overflow-y: auto;
  height: 100%;
}
.heatmap-month-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.heatmap-month-block {
  background: rgba(17, 17, 17, 0.6);
  border-radius: 6px;
  padding: 8px 10px 6px;
  min-width: 160px;
}
.heatmap-month-label {
  font-size: 12px;
  font-weight: 600;
  color: #9eb0c9;
  margin-bottom: 6px;
  text-align: center;
}
.heatmap-month-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.heatmap-cell {
  border-radius: 3px;
  width: 28px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.heatmap-cell .heatmap-day {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
}
.heatmap-month-total {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
}
.heatmap-legend {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  font-size: 11px;
  color: #9eb0c9;
}

/* Option OI chart */
.option-chart-wrap {
  padding: 12px;
  overflow-y: auto;
  height: 100%;
}
.option-title {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #d1d4dc;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.option-bars-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.option-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 20px;
}
.option-bar-row.option-bar-maxpain {
  background: rgba(38, 166, 154, 0.08);
}
.option-bar-row.option-bar-current {
  background: rgba(74, 163, 255, 0.08);
}
.option-bar-label {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}
.option-strike {
  font-size: 11px;
  color: #9eb0c9;
  font-family: monospace;
}
.option-bar-pair {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
}
.option-bar {
  height: 8px;
  border-radius: 2px;
  min-width: 1px;
  transition: width 0.2s;
}
.option-bar.call {
  background: rgba(47, 210, 134, 0.7);
}
.option-bar.put {
  background: rgba(239, 83, 80, 0.7);
}
.option-bar-values {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  font-size: 10px;
  font-family: monospace;
}
.option-bar-values .call-val {
  color: #2fd286;
  min-width: 50px;
  text-align: right;
}
.option-bar-values .put-val {
  color: #ef5350;
  min-width: 50px;
  text-align: right;
}
.option-marker {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1;
}
.option-marker.maxpain {
  background: #26a69a;
  color: #fff;
}
.option-marker.current {
  background: #4aa3ff;
  color: #fff;
}
.option-marker.top-call {
  background: rgba(47, 210, 134, 0.3);
  color: #2fd286;
}
.option-marker.top-put {
  background: rgba(239, 83, 80, 0.3);
  color: #ef5350;
}
.option-marker-inline {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  line-height: 1;
  margin-right: 2px;
}
.option-marker-inline.maxpain {
  background: #26a69a;
  color: #fff;
}
.option-marker-inline.current {
  background: #4aa3ff;
  color: #fff;
}
.option-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: #9eb0c9;
  flex-wrap: wrap;
}
.option-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.option-swatch {
  width: 12px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.option-swatch.call {
  background: rgba(47, 210, 134, 0.7);
}
.option-swatch.put {
  background: rgba(239, 83, 80, 0.7);
}

.chart-note {
  font-size: 12px;
  color: var(--muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  min-height: 20px;
}

.chart-ohlc {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.chart-ohlc .ohlc-item {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.chart-ohlc .ohlc-value {
  color: #e6edf3;
  font-weight: 600;
}

.chart-ohlc.up .ohlc-value {
  color: #2fd286;
}

.chart-ohlc.down .ohlc-value {
  color: #ff6b6b;
}

.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chart-toggles .toggle {
  padding: 2px 8px;
  font-size: 11px;
}

.sma-color-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: 6px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #666;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.status-value {
  color: var(--accent-2);
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: floatIn 0.5s ease-out;
}

.analysis-shell {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border-color: transparent;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  box-shadow: none;
  margin: 0;
}

.analysis-html {
  width: 100%;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
}

:root:not([data-theme="light"]) .analysis-html {
  color: #e6edf8;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.analysis-html hr {
  border-color: rgba(255, 255, 255, 0.08);
}

.analysis-html .analysis-wrap {
  width: 100% !important;
  font-size: 13px !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-wrap {
  color: #e6edf8 !important;
}

[data-theme="light"] .analysis-html .analysis-wrap {
  color: #1a1a1a !important;
}

.analysis-html > *,
.additional-content > * {
  position: relative;
  z-index: 3;
}

.analysis-html .analysis-title {
  font-size: 20px !important;
  letter-spacing: 0.2px;
}

:root:not([data-theme="light"]) .analysis-html .analysis-title {
  color: #f2f5ff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="light"] .analysis-html .analysis-title {
  color: #111 !important;
  border-bottom: 1px solid #ddd !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-period {
  color: #c4cedd !important;
}

[data-theme="light"] .analysis-html .analysis-period {
  color: #555 !important;
}

.analysis-html .analysis-price {
  font-size: 14px !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-price {
  color: #e9f1ff !important;
}

[data-theme="light"] .analysis-html .analysis-price {
  color: #1a1a1a !important;
}

.analysis-html .analysis-card {
  font-size: 16px !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-card {
  color: #a9c7ff !important;
}

[data-theme="light"] .analysis-html .analysis-card {
  color: #1a4a8a !important;
}

.analysis-html .metric-chart-table {
  width: 100%;
  border-collapse: collapse;
  background-color: transparent;
  border: 0;
  table-layout: fixed;
}

.analysis-html .metric-chart-table td {
  border: 0;
  vertical-align: middle;
}

.analysis-html .metric-graph-cell,
.analysis-html .metric-value-cell {
  background-color: transparent !important;
}

.analysis-html .metric-graph-cell {
  padding-right: 15px;
  width: 65%;
  max-width: 65%;
}

.analysis-html .relvolume-text {
  font-size: 14px !important;
}

.analysis-html .metric-value-cell {
  width: 35%;
  background-color: transparent !important;
}

.analysis-html .analysis-badge {
  color: #cbd6e4 !important;
}

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

.kv-table th,
.kv-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.kv-table th {
  color: var(--muted);
  font-weight: 600;
  width: 160px;
}

.analysis-html .metric-table {
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.3;
  width: auto !important;
  table-layout: auto;
  display: inline-table;
}

.analysis-html .metric-table td {
  padding: 0;
  border: none;
  vertical-align: middle;
  white-space: nowrap;
}

.analysis-html .metric-table tr + tr td {
  padding-top: 2px;
}

.analysis-html .metric-label {
  padding-right: 6px;
  white-space: nowrap;
  text-align: left;
}

.analysis-html .metric-value {
  white-space: nowrap;
  text-align: left;
}

.analysis-html .hist-label {
  color: #a78bfa;
}

.analysis-html .hist-chips {
  display: inline-flex;
  gap: 1px;
  margin-left: 6px;
  vertical-align: middle;
}

.analysis-html .hist-chips .hist-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.analysis-html span.sma-sign-up,
.analysis-html span.sma-sign-down,
.analysis-html span.sma-sign-flat,
.analysis-html span.sma-sign-strong-buy,
.analysis-html span.sma-sign-buy,
.analysis-html span.sma-sign-neutral,
.analysis-html span.sma-sign-sell,
.analysis-html span.sma-sign-strong-sell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.analysis-html .hist-table {
  display: inline-table;
  border-collapse: separate;
  border-spacing: 1px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  width: auto !important;
  table-layout: fixed;
}

.analysis-html .hist-table td {
  padding: 0 !important;
  border: none !important;
  text-align: center !important;
}


.analysis-html .hist-cell {
  width: 16px;
  height: 16px;
  text-align: center;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  border-radius: 2px;
  min-width: 16px;
  max-width: 16px;
}

.analysis-html .hist-cell.sma-sign-up {
  background-color: #2fd286 !important;
  color: #0f1115 !important;
}

.analysis-html .hist-cell.sma-sign-down {
  background-color: #ff7aa2 !important;
  color: #0f1115 !important;
}

.analysis-html .hist-cell.sma-sign-flat {
  background-color: #505a66 !important;
  color: #e0e0e0 !important;
}

.analysis-html .analysis-table .hist-cell.sma-sign-up,
.analysis-html .styled-table .hist-cell.sma-sign-up {
  background-color: #2fd286 !important;
  color: #0f1115 !important;
}

.analysis-html .analysis-table .hist-cell.sma-sign-down,
.analysis-html .styled-table .hist-cell.sma-sign-down {
  background-color: #ff7aa2 !important;
  color: #0f1115 !important;
}

.analysis-html .analysis-table .hist-cell.sma-sign-flat,
.analysis-html .styled-table .hist-cell.sma-sign-flat {
  background-color: #505a66 !important;
  color: #e0e0e0 !important;
}


.analysis-html .analysis-block {
  margin-bottom: 12px !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-table,
:root:not([data-theme="light"]) .analysis-html .styled-table {
  background-color: #0a0a0a !important;
  color: #e6edf8 !important;
  font-size: 13px !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-table th,
:root:not([data-theme="light"]) .analysis-html .styled-table th {
  background-color: #161616 !important;
  color: #f4f7ff !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  letter-spacing: 0.4px;
  padding: 6px 8px;
}

:root:not([data-theme="light"]) .analysis-html .analysis-table td:not(.hist-cell):not([class*="sma-sign-"]):not([class*="curr-cell"]),
:root:not([data-theme="light"]) .analysis-html .styled-table td:not(.hist-cell):not([class*="sma-sign-"]):not([class*="curr-cell"]) {
  background-color: #0a0a0a !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e5edf9 !important;
  padding: 6px 8px;
}

.analysis-html .analysis-table .hist-table td,
.analysis-html .styled-table .hist-table td {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.analysis-html .analysis-table .hist-cell.sma-sign-up,
.analysis-html .styled-table .hist-cell.sma-sign-up {
  background-color: #2fd286 !important;
  color: #0f1115 !important;
}

.analysis-html .analysis-table .hist-cell.sma-sign-down,
.analysis-html .styled-table .hist-cell.sma-sign-down {
  background-color: #ff7aa2 !important;
  color: #0f1115 !important;
}

.analysis-html .analysis-table .hist-cell.sma-sign-flat,
.analysis-html .styled-table .hist-cell.sma-sign-flat {
  background-color: #505a66 !important;
  color: #e0e0e0 !important;
}

:root:not([data-theme="light"]) .analysis-html .analysis-table tr:nth-child(even) td:not(.hist-cell):not([class*="sma-sign-"]):not([class*="curr-cell"]),
:root:not([data-theme="light"]) .analysis-html .styled-table tr:nth-child(even) td:not(.hist-cell):not([class*="sma-sign-"]):not([class*="curr-cell"]) {
  background-color: #0d0d0d !important;
}


:root:not([data-theme="light"]) .analysis-html .analysis-table > tr > th:first-child,
:root:not([data-theme="light"]) .analysis-html .analysis-table > tr > td:first-child,
:root:not([data-theme="light"]) .analysis-html .analysis-table > thead > tr > th:first-child,
:root:not([data-theme="light"]) .analysis-html .analysis-table > tbody > tr > td:first-child,
:root:not([data-theme="light"]) .analysis-html .analysis-table > tbody > tr > th:first-child {
  color: #d6deea !important;
  font-weight: 700 !important;
  background-color: #0a0a0a !important;
}

.analysis-html .curr-cell {
  color: #ffd68a !important;
  background-color: rgba(244, 183, 64, 0.18) !important;
  font-weight: 700 !important;
}

.analysis-html .sma-order-table th.curr-cell,
.analysis-html .sma-order-table td.curr-cell,
.analysis-html .sma-mini th.curr-cell,
.analysis-html .sma-mini td.curr-cell {
  color: #ffd68a !important;
  background-color: rgba(244, 183, 64, 0.18) !important;
  font-weight: 700 !important;
  border-color: rgba(244, 183, 64, 0.35) !important;
  box-shadow: inset 0 0 0 1px rgba(244, 183, 64, 0.45);
}

.analysis-html .sma-order-table tr:nth-child(2) td.curr-cell {
  border-left-color: rgba(244, 183, 64, 0.35) !important;
}

.analysis-html .curr-col {
  color: #ffd68a !important;
  background-color: rgba(244, 183, 64, 0.18) !important;
  font-weight: 700 !important;
}

.sma-emph {
  font-weight: 800;
  color: #2fd286;
}

.sma-emph-inverse {
  color: #ff5c5c;
}

.analysis-html th.curr-col {
  background-color: rgba(244, 183, 64, 0.28) !important;
  border-color: rgba(244, 183, 64, 0.55) !important;
}

.analysis-html td.curr-col {
  box-shadow: inset 0 0 0 1px rgba(244, 183, 64, 0.25);
}

.analysis-html .sma-order-table tr:nth-child(3) td.curr-cell,
.analysis-html .sma-order-table tr:nth-child(3) td.curr-col {
  background-color: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(244, 183, 64, 0.45);
  border-color: rgba(244, 183, 64, 0.35) !important;
  border-left-color: rgba(244, 183, 64, 0.35) !important;
}

:root:not([data-theme="light"]) .analysis-html .sma-order-table,
:root:not([data-theme="light"]) .analysis-html .sma-mini {
  background-color: #0a0a0a !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

:root:not([data-theme="light"]) .analysis-html .sma-order-table th {
  background-color: #161616 !important;
  color: #ffd68a !important;
}

:root:not([data-theme="light"]) .analysis-html .sma-order-table th.head-dim {
  background-color: #111111 !important;
  color: #9aa6bb !important;
}

:root:not([data-theme="light"]) .analysis-html .sma-order-table td {
  background-color: #0a0a0a !important;
  color: #e6edf8 !important;
}

:root:not([data-theme="light"]) .analysis-html .sma-mini th,
:root:not([data-theme="light"]) .analysis-html .sma-mini td {
  background-color: #0a0a0a !important;
  color: #e6edf8 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  width: 75px !important;
}

:root:not([data-theme="light"]) .analysis-html .sma-mini th.head-dim {
  background-color: #111111 !important;
  color: #9aa6bb !important;
}

.analysis-html .sma-mini {
  table-layout: auto;
}

.analysis-html .sma-mini .curr-cell {
  width: 45px !important;
  min-width: 45px !important;
}


.is-hidden {
  display: none !important;
}

.badge-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chip.square {
  width: 20px;
  height: 20px;
  padding: 0;
  justify-content: center;
  border-radius: 2px;
  line-height: 1;
  aspect-ratio: 1 / 1;
  min-width: 20px;
  min-height: 20px;
}

.genie-detail {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.genie-detail.show {
  opacity: 1;
  pointer-events: auto;
}

.genie-detail-card {
  min-width: 240px;
  max-width: 340px;
  background: #1b2230;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  color: #dbe2ee;
  font-size: 12px;
}

.genie-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #f4b740;
  margin-bottom: 8px;
}

.genie-detail-header button {
  border: none;
  background: transparent;
  color: #aab3c4;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

.genie-detail-body {
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.genie-detail-section {
  background: rgba(12, 16, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px;
}

.genie-detail-title {
  font-weight: 700;
  color: #dbe2ee;
  margin-bottom: 6px;
}

.genie-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #b8c0cf;
}

.genie-detail-row span:last-child {
  font-weight: 600;
  color: #f1f4f9;
}

.genie-detail-row span:last-child.pos {
  color: #5dd69b;
}

.genie-detail-row span:last-child.neg {
  color: #ff8c8c;
}

.genie-detail-row span:last-child.neutral {
  color: #f4b740;
}

.genie-detail-raw {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  color: #c4ccda;
}

.genie-decision-card {
  border: 1px solid rgba(80, 90, 120, 0.45);
  background: rgba(18, 22, 31, 0.94);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

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

.genie-decision-label {
  font-weight: 700;
  color: #c9d6ff;
  letter-spacing: 0.02em;
}

.genie-decision-verdict {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.genie-decision-verdict.pos {
  color: #52d47a;
  text-shadow: 0 0 10px rgba(82, 212, 122, 0.35);
}

.genie-decision-verdict.neg {
  color: #ff6666;
  text-shadow: 0 0 10px rgba(255, 102, 102, 0.35);
}

.genie-decision-verdict.neutral {
  color: #b5bcc6;
  font-weight: 700;
}

.genie-decision-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #9aa3ad;
}

.genie-decision-section {
  margin-top: 10px;
}

.genie-decision-title {
  font-weight: 600;
  color: #cfe2ff;
  margin-bottom: 4px;
}

.genie-decision-title.risk {
  color: #f3b5b5;
}

.genie-decision-section ul {
  margin: 0 0 0 18px;
  padding: 0;
  color: #f2f2f2;
}

.genie-decision-banner {
  border: 1px solid rgba(245, 197, 66, 0.8);
  background: rgba(255, 255, 255, 0.05);
  color: #f5c542;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}

.genie-decision-banner.is-legacy {
  border-color: rgba(255, 102, 102, 0.9);
  color: #ff6666;
}

.genie-decision-banner .banner-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.genie-decision-banner summary {
  cursor: pointer;
}

.genie-decision-banner .banner-detail {
  margin-top: 6px;
  white-space: pre-wrap;
  color: #f2f2f2;
}

#viola-genie .chip-row {
  gap: 2px;
}

#viola-genie .chip.square {
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 2px;
}

.chip.pos {
  background: rgba(47, 210, 134, 0.18);
  border-color: rgba(47, 210, 134, 0.45);
  color: #5bf2a6;
}

.chip.neg {
  background: rgba(255, 107, 107, 0.16);
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff9a9a;
}

.chip.neutral {
  background: rgba(244, 183, 64, 0.18);
  border-color: rgba(244, 183, 64, 0.45);
  color: #ffd68a;
}

.chip.muted {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-tag.warn {
  color: #ffd68a;
  border-color: rgba(244, 183, 64, 0.6);
}

.status-tag.good {
  color: #5bf2a6;
  border-color: rgba(47, 210, 134, 0.6);
}

.status-tag.bad {
  color: #ff9a9a;
  border-color: rgba(255, 107, 107, 0.6);
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.status-table th,
.status-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 6px;
  text-align: center;
}

.status-table .is-highlight {
  background: rgba(244, 183, 64, 0.18);
  border-color: rgba(244, 183, 64, 0.55);
  color: #ffd68a;
  font-weight: 600;
}

.status-table th {
  color: var(--muted);
  font-weight: 500;
}

.status-table td.row-label {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}

.fibonacci-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.metric-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: center;
}

.mini-chart {
  height: 74px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 40px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(135deg, rgba(47, 210, 134, 0.25), rgba(244, 183, 64, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.mini-chart::after {
  content: "";
  position: absolute;
  inset: 18px 14px;
  border-top: 2px solid rgba(244, 183, 64, 0.65);
  border-bottom: 2px solid rgba(47, 210, 134, 0.45);
  opacity: 0.75;
}

.metric-lines {
  display: grid;
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
}

.metric-line {
  display: grid;
  grid-template-columns: 60px 1fr 70px;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
}

.metric-line strong {
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.metric-line .pos {
  color: #5bf2a6;
}

.metric-line .neg {
  color: #ff9a9a;
}

.metric-line .neutral {
  color: #ffd68a;
}

.analysis-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.table-panel {
  padding-top: 14px;
}

.genie-panel {
  padding: 16px;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
}

.genie-content {
  flex: 0 0 auto;
  overflow: visible;
  padding-right: 4px;
  position: relative;
  font-size: 0.8125rem;
}

.genie-content > * {
  position: relative;
  z-index: 2;
}

.genie-panel-stack {
  display: grid;
  gap: 10px;
}

.genie-source-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.genie-policy-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.genie-policy-label {
  font-size: 12px;
  font-weight: 700;
  color: #9eb0c9;
}

.genie-policy-select {
  min-width: 128px;
  border: 1px solid #374760;
  background: #212937;
  color: #d7e0ee;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.genie-policy-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.genie-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.genie-title-ticker {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #355176;
  background: #1b2534;
  color: #9bc2ff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.3px;
}

.genie-source-btn {
  border: 1px solid #374760;
  background: #212937;
  color: #9eb0c9;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.genie-source-btn.active[data-source="GENIE"] {
  background: #1e3f31;
  border-color: #2f8d69;
  color: #7de9ba;
}

.genie-source-btn.active[data-source="LEGACY"] {
  background: #3b2d22;
  border-color: #9e6e43;
  color: #ffd699;
}

.genie-lang-sep {
  color: #4a5568;
  font-weight: 700;
  user-select: none;
}

.genie-lang-btn {
  border: 1px solid #374760;
  background: #212937;
  color: #9eb0c9;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.genie-lang-btn.active[data-lang="en"] {
  background: #1e2f4f;
  border-color: #4a7ec5;
  color: #7db8e9;
}

.genie-lang-btn.active[data-lang="ko"] {
  background: #2f1e3f;
  border-color: #8a5ec5;
  color: #c9a0e9;
}

.genie-detail-inline {
  display: grid;
  gap: 8px;
}

.genie-history-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* -- Genie Score Box -- */
.gs-box {
  background: #161b22;
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.gs-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.gs-left { display: flex; align-items: baseline; gap: 12px; }
.gs-right { display: flex; align-items: baseline; gap: 10px; }
.gs-label { font-size: 13px; color: var(--text-3, #8b949e); font-weight: 600; }
.gs-value { font-size: 28px; font-weight: 800; }
.gs-max { font-size: 13px; color: var(--text-4, #484f58); }
.gs-verdict { font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 6px; }
.gs-buy { color: #56d364; }
.gs-sell { color: #f47067; }
.gs-hold { color: #f0b429; }
.gs-verdict.gs-buy { border: 1px solid #56d364; }
.gs-verdict.gs-sell { border: 1px solid #f47067; }
.gs-verdict.gs-hold { border: 1px solid #f0b429; }
.gs-price { font-size: 16px; font-weight: 700; }
.gs-chg { font-size: 13px; }
.gs-chg-up { color: #56d364; }
.gs-chg-down { color: #f47067; }
.gs-sector { margin-top: 6px; font-size: 12px; color: var(--text-4, #484f58); }

[data-theme="light"] .gs-box {
  background: #f4f4f6;
  border-color: #e5e7eb;
}
[data-theme="light"] .gs-buy { color: #16a34a; }
[data-theme="light"] .gs-sell { color: #dc2626; }
[data-theme="light"] .gs-hold { color: #b45309; }
[data-theme="light"] .gs-verdict.gs-buy { border-color: #16a34a; }
[data-theme="light"] .gs-verdict.gs-sell { border-color: #dc2626; }
[data-theme="light"] .gs-verdict.gs-hold { border-color: #b45309; }
[data-theme="light"] .gs-chg-up { color: #16a34a; }
[data-theme="light"] .gs-chg-down { color: #dc2626; }
[data-theme="light"] .gs-price { color: #1a1a1a; }

.genie-cc-wrap {
  border: 1px solid #2b2f36;
  border-radius: 12px;
  background: rgba(16, 19, 26, 0.96);
  padding: 12px 12px 14px;
}

.genie-cc-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.genie-cc-header {
  font-size: 20px;
  font-weight: 800;
  color: #d8e8ff;
  line-height: 1.3;
}

.genie-cc-source {
  border: 1px solid #3a4a62;
  border-radius: 7px;
  padding: 2px 8px;
  font-weight: 800;
  font-size: 12px;
}

.genie-cc-source.genie {
  background: #1e3f31;
  border-color: #2f8d69;
  color: #7de9ba;
}

.genie-cc-source.legacy {
  background: #3b2d22;
  border-color: #9e6e43;
  color: #ffd699;
}

.genie-cc-rule {
  margin-top: 6px;
  font-size: 14px;
  color: #9aa7bd;
  line-height: 1.5;
}

.genie-cc-body {
  margin-top: 8px;
  border: 1px solid #2b2f36;
  border-radius: 10px;
  background: #1a1d24;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.genie-cc-body > * {
  position: relative;
  z-index: 1;
}

.genie-cc-title {
  font-size: 26px;
  font-weight: 800;
  color: #d9e6ff;
  letter-spacing: 0.3px;
}

.genie-cc-title.risk {
  color: #ffe1a8;
}

.genie-cc-list {
  margin: 6px 0 0 20px;
  padding: 0;
  line-height: 1.95;
  color: #e2e8f0;
  font-size: 17px;
}

.genie-cc-list li {
  margin-bottom: 8px;
}

.genie-cc-list.risk li {
  margin-bottom: 12px;
}

.genie-cc-list li.genie-reason-block {
  color: #f0b429;
  opacity: 0.85;
}

.genie-cc-tech {
  margin-top: 4px;
  color: #98a6ba;
  font-size: 14px;
  line-height: 1.8;
}

.genie-cc-tech span {
  color: #a9b8cc;
}

.genie-cc-divider {
  border: none;
  border-top: 1px solid #3a4454;
  margin: 10px 0 8px;
}

.genie-quick-card {
  margin-top: 10px;
  padding: 12px 12px;
  border: 1px solid #2f3a4a;
  border-radius: 10px;
  background: transparent;
}

.genie-quick-title {
  font-size: 16px;
  font-weight: 800;
  color: #d8e8ff;
  margin-bottom: 4px;
}

.genie-quick-meta {
  font-size: 13px;
  color: #b9c6d9;
  margin-bottom: 8px;
}

.genie-scale-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #d9e4f3;
  font-weight: 800;
  font-size: 15px;
}

.genie-scale-head .zone {
  font-size: 13px;
  font-weight: 700;
}

.genie-scale-head .zone.low {
  color: #ffc5cf;
}

.genie-scale-head .zone.mid {
  color: #ffe09a;
}

.genie-scale-head .zone.high {
  color: #9ae8c2;
}

.genie-scale-wrap {
  margin-bottom: 8px;
}

.genie-scale-track {
  position: relative;
  height: 16px;
  border: 1px solid #4e596b;
  border-radius: 2px;
  overflow: visible;
  display: grid;
  grid-template-columns: 45fr 25fr 30fr;
}

.genie-scale-track .seg.low {
  background: #c15c71;
}

.genie-scale-track .seg.mid {
  background: #c2ab54;
}

.genie-scale-track .seg.high {
  background: #36af79;
}

.genie-scale-track .marker {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 3;
}

.genie-scale-track .marker-value {
  min-width: 36px;
  padding: 0 5px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #111922;
  background: #ffe38f;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.genie-scale-track .marker-line {
  width: 2px;
  height: 16px;
  background: #ffe38f;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.genie-scale-track .marker-dot {
  width: 10px;
  height: 10px;
  margin-top: -1px;
  border-radius: 50%;
  background: #ffe38f;
  border: 2px solid #1a2434;
  box-shadow: 0 0 0 1px rgba(255, 227, 143, 0.35);
}

.genie-scale-ticks,
.genie-scale-zones {
  display: grid;
  margin-top: 4px;
}

.genie-scale-ticks {
  position: relative;
  height: 14px;
  color: #b5c1d4;
  font-size: 12px;
  font-weight: 700;
}

.genie-scale-ticks span {
  position: absolute;
  top: 0;
  line-height: 14px;
  transform: translateX(-50%);
}

.genie-scale-ticks span:nth-child(1) {
  left: 0;
  transform: none;
  text-align: left;
}

.genie-scale-ticks span:nth-child(2) {
  left: 45%;
}

.genie-scale-ticks span:nth-child(3) {
  left: 70%;
}

.genie-scale-ticks span:nth-child(4) {
  left: 100%;
  transform: translateX(-100%);
  text-align: right;
}

.genie-scale-zones {
  grid-template-columns: 45fr 25fr 30fr;
  font-size: 14px;
  font-weight: 800;
}

.genie-scale-zones span:nth-child(1) { text-align: center; color: #ffc5cf; }
.genie-scale-zones span:nth-child(2) { text-align: center; color: #ffe09a; }
.genie-scale-zones span:nth-child(3) { text-align: center; color: #9ae8c2; }

.genie-quick-list {
  margin: 2px 0 0 18px;
  padding: 0;
  line-height: 1.9;
  color: #e2e8f0;
  font-size: 15px;
}

.genie-quick-list li {
  margin-bottom: 6px;
}

.genie-quick-note {
  margin-top: 8px;
  color: #b8c6d9;
  font-size: 14px;
}

.genie-quick-divider {
  border: none;
  border-top: 1px solid #324154;
  margin: 10px 0 8px 0;
}

.genie-quick-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #7a5b1f;
  color: #ffd27d;
  font-weight: 700;
  font-size: 12px;
}

.genie-quick-oneline {
  margin-top: 6px;
  color: #ffd27d;
  font-weight: 700;
  line-height: 1.8;
  font-size: 14px;
}

.genie-quick-muted {
  color: #9aa3ad;
  font-size: 13px;
}

/* Capture-only visual hardening for readability */
body.capture-mode .ambient,
body.capture-mode .mobile-overlay,
body.capture-mode .genie-detail {
  display: none !important;
}

body.capture-mode .panel,
body.capture-mode .analysis-shell,
body.capture-mode .genie-panel,
body.capture-mode .additional-panel,
body.capture-mode .performance-panel {
  animation: none !important;
  opacity: 1 !important;
}

body.capture-mode * {
  transition: none !important;
  animation: none !important;
}

body.capture-mode .genie-panel,
body.capture-mode .additional-panel,
body.capture-mode .performance-panel {
  background: #243246 !important;
  border-color: #3b4f69 !important;
}

body.capture-mode .genie-cc-wrap,
body.capture-mode .genie-cc-body {
  background: #0a0a0a !important;
  border-color: rgba(255,255,255,0.10) !important;
}

body.capture-mode .genie-quick-card {
  background: rgba(10, 10, 10, 0.48) !important;
  border-color: rgba(255,255,255,0.10) !important;
}


body.capture-mode .analysis-html,
body.capture-mode .additional-content {
  background: #0a0a0a !important;
  border-color: rgba(255,255,255,0.10) !important;
}

.additional-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 0;
  overflow-y: auto;
}

.additional-panel .section-header {
  flex-wrap: wrap;
  gap: 12px;
}

.additional-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.additional-tabs::-webkit-scrollbar {
  display: none;
}

.additional-tab {
  border: 1px solid var(--border);
  background: #1a2230;
  color: var(--muted);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.additional-tab.active {
  color: #ffd68a;
  border-color: rgba(244, 183, 64, 0.6);
  background: rgba(244, 183, 64, 0.12);
}

.additional-content {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0f141d;
  border-radius: 12px;
  padding: 12px;
  min-height: 120px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  box-sizing: border-box;
  position: relative;
}

.additional-content .news-title {
  color: #8ab4f8;
  font-weight: 600;
  margin-bottom: 8px;
}

.additional-content .news-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  align-items: baseline;
}

.additional-content .news-date {
  color: #f4b740;
  font-weight: 600;
}

.additional-content .news-sep {
  color: var(--muted);
}

.additional-content .news-link {
  color: #e6edf8;
  text-decoration: none;
}

.additional-content .news-link:hover {
  text-decoration: underline;
}

.additional-content .tab-wrap {
  color: #e6edf8;
}

.additional-content .tab-date {
  color: #e6edf8;
}

.additional-content .rating-text,
.additional-content .insider-body {
  color: #cbd6e4;
}

.additional-content .fundament-wrap {
  color: #e6edf8;
}

.additional-content .fundament-title {
  font-size: 15px;
  font-weight: 600;
  color: #8ab4f8;
  margin-bottom: 10px;
}

.performance-panel {
  padding: 16px;
  min-height: var(--analysis-panel-height, 520px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

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

.performance-controls label {
  color: #9fb0c9;
  font-size: 12px;
  font-weight: 700;
}

.performance-controls input[type="date"] {
  border: 1px solid #344864;
  background: #1a2332;
  color: #e4ecf8;
  border-radius: 8px;
  padding: 4px 8px;
  height: 30px;
}

.performance-refresh-btn {
  border: 1px solid rgba(244, 183, 64, 0.45);
  background: rgba(244, 183, 64, 0.14);
  color: #ffd670;
  border-radius: 8px;
  padding: 4px 10px;
  height: 30px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.performance-content {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0f141d;
  border-radius: 12px;
  padding: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.perf-head {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.perf-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.perf-strategy-badge,
.perf-tactic-badge,
.perf-mode-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.perf-strategy-badge {
  background: #173b1f;
  border: 1px solid #2d7a3d;
  color: #58e082;
}

.perf-tactic-badge {
  background: #1a2744;
  border: 1px solid #3a6ab5;
  color: #7db8ff;
}

.perf-mode-badge {
  background: #2a2e36;
  border: 1px solid #4a5060;
  color: #bcc5d4;
}

[data-theme="light"] .perf-strategy-badge {
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.3);
  color: #15803d;
}

[data-theme="light"] .perf-tactic-badge {
  background: rgba(37,99,235,0.1);
  border-color: rgba(37,99,235,0.3);
  color: #1d4ed8;
}

[data-theme="light"] .perf-mode-badge {
  background: rgba(107,114,128,0.1);
  border-color: rgba(107,114,128,0.25);
  color: #4b5563;
}

.perf-summary {
  font-size: 13px;
  color: #c8d4e6;
  font-weight: 600;
  line-height: 1.6;
}

[data-theme="light"] .perf-summary {
  color: #374151;
}

.perf-positive {
  color: #19d37d;
  font-weight: 700;
}

.perf-negative {
  color: #ff7070;
  font-weight: 700;
}

.perf-neutral {
  color: #cfd8e3;
  font-weight: 700;
}

[data-theme="light"] .perf-positive { color: #16a34a; }
[data-theme="light"] .perf-negative { color: #dc2626; }
[data-theme="light"] .perf-neutral { color: #6b7280; }

.perf-charts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perf-chart-pane {
  position: relative;
  height: 220px;
  border-radius: 8px;
  background: #000;
  border: 1px solid var(--border);
  overflow: hidden;
}

[data-theme="light"] .perf-chart-pane {
  background: #ffffff;
  border-color: #e5e7eb;
}

.perf-chart-pane .indicator-label {
  position: absolute;
  top: 6px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: #7a8ba6;
  pointer-events: none;
}

[data-theme="light"] .perf-chart-pane .indicator-label {
  color: #6b7280;
}

.additional-content .fundament-section-title {
  margin: 14px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fb3d3;
}

.additional-content .fundament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.additional-content .fundament-card {
  background: #121a26;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
}

.additional-content .fundament-card.highlight {
  border-color: rgba(244, 183, 64, 0.45);
  background: rgba(244, 183, 64, 0.08);
}

.additional-content .fundament-label {
  font-size: 11px;
  color: #b7c4d9;
}

.additional-content .fundament-value {
  font-size: 13px;
  font-weight: 600;
  color: #f2f6ff;
  margin-top: 4px;
}

.additional-content .fundament-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #1f2a3b;
  margin-top: 6px;
  overflow: hidden;
}

.additional-content .fundament-bar span {
  display: block;
  height: 100%;
  background: #2fd286;
}

.additional-content .fundament-bar.neg span {
  background: #ff8c8c;
}

.additional-content .fundament-range {
  margin: 10px 0 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #111925;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.additional-content .fundament-range-label {
  font-size: 11px;
  color: #b7c4d9;
}

.additional-content .fundament-range-values {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  color: #e6edf8;
}

.additional-content .fundament-range-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #1f2a3b;
  margin-top: 6px;
}

.additional-content .fundament-range-bar span {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: #f4b740;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

.output {
  background: #0d111a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 12px;
  color: var(--muted);
  min-height: 48px;
}

.table-wrap {
  overflow-x: auto;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #2b2b2b;
  color: #e8e8e8;
  border: 1px solid #3b3b3b;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--accent);
  font-weight: 600;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.muted {
  color: var(--muted);
}

.content-split {
  display: contents;
}

.split-left {
  grid-column: 1;
  grid-row: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.split-left > .panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.split-right {
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 400px;
  overflow: hidden;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TABLET ===== */
@media (max-width: 980px) {
  .header-subtitle {
    display: none;
  }

  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: calc(100vh - 100px);
    overflow: auto;
  }

  .content-split {
    display: flex;
    flex-direction: column;
  }

  .split-left {
    grid-column: auto;
    grid-row: auto;
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    overflow-y: auto;
  }

  .split-right {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    height: 500px;
    min-width: 0;
  }

  .analysis-shell {
    width: 100%;
    max-width: none;
  }
}

/* ===== MOBILE ===== */
@media (max-width: 720px) {
  /* -- Header compact -- */
  .header {
    height: auto;
    min-height: 44px;
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .header-left {
    gap: 8px;
    min-width: 0;
  }

  .header-subtitle {
    display: none;
  }

  .brand {
    font-size: 1.1rem;
  }

  .header-nav {
    gap: 2px;
  }

  .header-nav .nav-btn {
    height: 24px;
    font-size: 11px;
    padding: 4px 8px;
  }

  .header-right {
    gap: 6px;
  }

  .header-clock {
    font-size: 0.625rem;
    gap: 4px;
  }

  .header-date {
    display: none;
  }

  .clock-tz-btn {
    font-size: 0.625rem;
    padding: 1px 5px;
  }

  .lang-toggle, .theme-toggle {
    width: 26px;
    height: 26px;
    font-size: 0.625rem;
  }

  .mobile-menu-btn {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  /* -- Index banner compact -- */
  .index-banner {
    overflow: visible;
  }

  .indices-bar {
    flex-direction: column;
    height: auto;
    padding: 6px 10px;
    gap: 4px;
    align-items: stretch;
  }

  .indices-bar .index-list {
    order: -1;
    flex: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    font-size: 10px;
  }

  .indices-bar .index-card {
    grid-template-columns: auto auto;
    gap: 4px;
    padding: 3px 6px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .indices-bar .index-arrow-box {
    display: none;
  }

  .indices-bar .index-meta {
    flex-direction: row;
    gap: 4px;
    align-items: center;
  }

  .indices-bar .index-price {
    display: none;
  }

  .indices-bar .index-change {
    flex-direction: row;
    gap: 3px;
    font-size: 10px;
  }

  .banner-form {
    flex-shrink: 0;
    gap: 4px;
  }

  .banner-form .search-input {
    width: 90px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .banner-form .sort-select {
    font-size: 12px;
    padding: 6px 6px;
    min-width: 48px;
  }

  .banner-form .cta {
    padding: 6px 10px;
    font-size: 12px;
  }

  .indices-bar .indices-edit {
    display: none;
  }

  /* -- Main content -- */
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding: 8px;
    gap: 6px;
    height: auto;
    overflow: auto;
  }

  .mobile-view-tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: -2px;
  }

  .mobile-view-tabs .tabs {
    margin: 0;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .mobile-view-tabs .tab {
    padding: 6px 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  .mobile-view-tabs .tab[data-tab="dashboard"] {
    display: none;
  }

  .mobile-view-tab {
    padding: 6px 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  .mobile-view-tabs::-webkit-scrollbar {
    display: none;
  }

  .content-split {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
  }

  .split-left {
    grid-column: auto;
    grid-row: auto;
    flex: none;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
  }

  .split-right {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: 300px;
  }

  body.mobile-show-analysis .split-right {
    display: none;
  }

  body.mobile-show-charts .split-left {
    display: none;
  }

  /* -- Ticker controls (JS-moved auto group) -- */
  .ticker-controls {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
  }

  .mobile-auto-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
  }

  .mobile-auto-group #auto-interval {
    display: none;
  }

  .toggle-row {
    display: none;
  }

  /* -- Form elements -- */
  input,
  select {
    font-size: 12px;
    padding: 8px 10px;
  }

  .toggle {
    font-size: 11px;
    padding: 4px 8px;
  }

  .cta {
    padding: 8px 12px;
    font-size: 12px;
  }

  #fast_mode {
    display: none;
  }

  /* -- Chart panel -- */
  .chart-panel {
    overflow: hidden !important;
    padding: 8px !important;
    min-height: 0;
    height: 100% !important;
  }

  #tv-chart-container {
    min-height: 200px;
  }

  .chart-header {
    gap: 2px;
    margin: 0 0 8px;
  }

  .chart-header-main {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chart-header-main::-webkit-scrollbar {
    display: none;
  }

  .chart-header .chart-tabs {
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }

  .chart-header .chart-tabs::-webkit-scrollbar {
    display: none;
  }

  .chart-tab {
    font-size: 10px;
    padding: 3px 6px;
    white-space: nowrap;
  }

  .chart-tab[data-chart="RS"],
  .chart-tab[data-chart="Indicators"],
  .chart-tab[data-chart="PnF"],
  .chart-tab[data-chart="Option"],
  .chart-tab[data-chart="Heatmap"] {
    display: none;
  }

  .chart-image-wrap {
    align-items: flex-start;
    padding-top: 6px;
  }

  .chart-toggles {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 10px;
  }

  .chart-toggles::-webkit-scrollbar {
    display: none;
  }

  .chart-toggles .toggle {
    order: 1;
    padding: 2px 5px;
    font-size: 10px;
    white-space: nowrap;
  }

  .sma-color-legend {
    display: none;
  }

  /* -- Buffett grid: 1 column on mobile -- */
  .buffett-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 200px);
  }

  /* -- Genie panel -- */
  .genie-panel {
    height: auto;
    min-height: 240px;
    padding: 12px;
  }

  .genie-content {
    padding-right: 0;
  }

  .genie-source-toggle {
    gap: 4px;
  }

  .genie-policy-group {
    gap: 4px;
  }

  .genie-policy-label {
    font-size: 11px;
  }

  .genie-policy-select {
    min-width: 112px;
    font-size: 11px;
    padding: 3px 7px;
  }

  .genie-source-btn {
    font-size: 11px;
    padding: 3px 8px;
  }

  .genie-lang-btn {
    font-size: 11px;
    padding: 3px 6px;
  }

  .genie-history-wrap .chip.square {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .genie-cc-wrap {
    padding: 10px;
  }

  .genie-cc-header {
    font-size: 16px;
  }

  .genie-title-ticker {
    font-size: 14px;
    min-height: 18px;
    padding: 1px 8px;
  }

  .genie-cc-rule {
    font-size: 12px;
  }

  .genie-cc-body {
    padding: 8px 10px;
  }

  .genie-cc-title {
    font-size: 20px;
  }

  .genie-cc-list {
    font-size: 14px;
    line-height: 1.8;
  }

  .genie-cc-tech {
    font-size: 12px;
    line-height: 1.6;
  }

  .genie-quick-title {
    font-size: 14px;
  }

  .genie-quick-meta {
    font-size: 12px;
  }

  .genie-scale-head {
    font-size: 13px;
  }

  .genie-scale-head .zone {
    font-size: 11px;
  }

  .genie-scale-track .marker {
    top: -26px;
  }

  .genie-scale-track .marker-value {
    min-width: 32px;
    height: 16px;
    line-height: 16px;
    font-size: 10px;
  }

  .genie-scale-track .marker-line {
    height: 14px;
  }

  .genie-scale-track .marker-dot {
    width: 9px;
    height: 9px;
  }

  .genie-quick-list {
    font-size: 13px;
  }

  .genie-quick-note {
    font-size: 12px;
  }

  .genie-quick-oneline {
    font-size: 12px;
  }

  /* -- Analysis tables -- */
  .analysis-html {
    padding: 12px 14px;
    font-size: 12px;
    overflow-x: hidden;
  }

  .analysis-html .analysis-wrap {
    font-size: 12px !important;
  }

  .analysis-html .analysis-title {
    font-size: 16px !important;
  }

  .analysis-html .analysis-price {
    font-size: 12px !important;
  }

  .analysis-html .analysis-card {
    font-size: 14px !important;
  }

  .analysis-html .metric-chart-table {
    display: block;
    table-layout: auto;
  }

  .analysis-html .metric-chart-table tr {
    display: flex;
    align-items: center;
  }

  .analysis-html .metric-graph-cell {
    width: 60%;
    max-width: 60%;
    padding-right: 6px;
    flex: 0 0 60%;
    min-width: 0;
    overflow: hidden;
  }

  .analysis-html .metric-value-cell {
    width: 40%;
    flex: 1 1 40%;
    min-width: 0;
  }

  .analysis-html .metric-graph-cell svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }

  .analysis-html .metric-table {
    font-size: 9px;
    line-height: 1.2;
  }

  .analysis-html .metric-table td {
    font-size: 9px;
  }

  .analysis-html .metric-label,
  .analysis-html .metric-value,
  .analysis-html .metric-table span {
    font-size: 9px !important;
  }

  .analysis-html .relvolume-text {
    font-size: 9px !important;
  }

  .analysis-html .analysis-table th,
  .analysis-html .analysis-table td,
  .analysis-html .styled-table th,
  .analysis-html .styled-table td {
    padding: 3px 3px;
    font-size: 9px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .analysis-html .analysis-table th:first-child,
  .analysis-html .analysis-table td:first-child,
  .analysis-html .styled-table th:first-child,
  .analysis-html .styled-table td:first-child {
    font-size: 8px;
    padding: 3px 3px;
    width: 48px;
    white-space: nowrap;
  }

  .analysis-html th.curr-cell,
  .analysis-html th.curr-col {
    width: 24px !important;
    min-width: 24px;
    max-width: 24px;
    padding: 3px 2px !important;
    text-align: center;
  }

  .analysis-html td.curr-cell,
  .analysis-html td.curr-col {
    width: 24px !important;
    min-width: 24px;
    max-width: 24px;
    padding: 3px 2px !important;
    text-align: center;
  }

  .analysis-html .tvr-na {
    display: none;
  }

  .analysis-html .tvr-text {
    display: none !important;
  }

  .analysis-html .source-list {
    display: none !important;
  }

  .analysis-html .source-time {
    color: #888888;
    font-size: 10px;
    white-space: nowrap;
  }

  #source-badge {
    display: none !important;
  }

  .analysis-html .analysis-table,
  .analysis-html .styled-table,
  .analysis-html .metric-table,
  .analysis-html .hist-table {
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed;
  }

  .analysis-html .hist-table {
    width: auto !important;
    display: inline-table;
    table-layout: fixed;
    border-spacing: 1px;
  }

  .analysis-html .hist-table td {
    width: 10px !important;
    min-width: 10px;
    max-width: 10px;
    height: 10px;
    padding: 0 !important;
    line-height: 10px;
  }

  .analysis-html .hist-cell,
  .analysis-html .hist-chips .hist-chip {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    padding: 0 !important;
    line-height: 10px;
    border-radius: 2px;
  }

  .metric-block {
    grid-template-columns: 1fr;
  }

  .analysis-html .sma-order-table th,
  .analysis-html .sma-order-table td,
  .analysis-html .sma-mini th,
  .analysis-html .sma-mini td {
    font-size: 9px !important;
    padding: 3px 2px !important;
  }

  .analysis-html .sma-mini {
    table-layout: fixed !important;
    width: auto !important;
  }

  .analysis-html .sma-mini th,
  .analysis-html .sma-mini td {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }

  .analysis-html .sma-mini th.curr-cell,
  .analysis-html .sma-mini td.curr-cell {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    padding: 3px 1px !important;
  }

  /* -- Footer compact -- */
  .footer {
    padding: 16px 10px;
    font-size: 0.6875rem;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-3);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
}

.footer-links a {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-current {
  color: var(--text-2);
  font-weight: 600;
}

.footer-dot {
  color: var(--text-4);
  margin: 0 6px;
}

.footer-disclaimer {
  display: block;
  margin-top: 8px;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-weight: 500;
}

.visit-count {
  color: var(--text-3);
}

.build-hash {
  font-family: monospace;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.6875rem;
  color: var(--text-3);
}

/* TV Ticker Tape */
.tv-ticker-tape {
  display: none;
  width: 100%;
  height: 46px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  grid-column: 1 / -1;
}

.tv-ticker-tape.active {
  display: block;
}

/* Indices source toggle button */
.indices-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.indices-source-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: var(--radius-xs);
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.indices-source-btn:hover {
  border-color: var(--border-focus);
}

.indices-source-btn.active {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-soft);
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }

  .cta {
    transition: none;
  }
}

/* ── Light mode overrides for analysis & chart panels ── */
[data-theme="light"] .analysis-html {
  color: #1a1a1a !important;
  background: linear-gradient(180deg, rgba(245,245,248,0.9), rgba(245,245,248,0.6)) !important;
  border-color: rgba(0,0,0,0.1) !important;
}
[data-theme="light"] .analysis-html hr {
  border-color: rgba(0,0,0,0.1) !important;
}
[data-theme="light"] .analysis-html .analysis-wrap {
  color: #1a1a1a !important;
}
[data-theme="light"] .analysis-html .analysis-title {
  color: #111 !important;
}
[data-theme="light"] .analysis-html .analysis-title-meta,
[data-theme="light"] .analysis-html .analysis-price {
  color: #333 !important;
}
[data-theme="light"] .analysis-html .analysis-updated,
[data-theme="light"] .analysis-html .analysis-price-basis {
  color: #555 !important;
}
[data-theme="light"] .analysis-html .analysis-period {
  color: #666 !important;
}
[data-theme="light"] .analysis-html .analysis-body,
[data-theme="light"] .analysis-html .details-info {
  color: #1a1a1a !important;
}
[data-theme="light"] .analysis-html .analysis-card {
  color: #2563eb !important;
}
[data-theme="light"] .analysis-html .analysis-status,
[data-theme="light"] .analysis-html .analysis-table,
[data-theme="light"] .analysis-html .styled-table {
  background-color: #f9f9fb !important;
  border-color: #ccc !important;
}
[data-theme="light"] .analysis-html .analysis-table th,
[data-theme="light"] .analysis-html .styled-table th,
[data-theme="light"] .analysis-html .analysis-status th {
  background-color: #e8e8ec !important;
  color: #333 !important;
  border-color: #ccc !important;
}
[data-theme="light"] .analysis-html .analysis-table > tbody > tr > td,
[data-theme="light"] .analysis-html .styled-table > tbody > tr > td,
[data-theme="light"] .analysis-html .analysis-status {
  border-color: #ddd !important;
  color: #1a1a1a !important;
  background-color: transparent !important;
}
[data-theme="light"] .analysis-html .sma-order-table,
[data-theme="light"] .analysis-html .sma-mini {
  border-color: #ccc !important;
}
[data-theme="light"] .analysis-html .sma-order-table th,
[data-theme="light"] .analysis-html .sma-mini th {
  background-color: #e8e8ec !important;
  color: #b45309 !important;
  border-color: #ccc !important;
}
[data-theme="light"] .analysis-html .sma-order-table th.head-dim,
[data-theme="light"] .analysis-html .sma-mini th.head-dim {
  background-color: #f0f0f2 !important;
  color: #555 !important;
}
[data-theme="light"] .analysis-html .sma-order-table td,
[data-theme="light"] .analysis-html .sma-mini td {
  border-color: #ccc !important;
  color: #1a1a1a !important;
  background-color: transparent !important;
}
[data-theme="light"] .analysis-html .curr-cell {
  background-color: rgba(34,197,94,0.12) !important;
  color: #16a34a !important;
}
[data-theme="light"] .analysis-html .footer-badge,
[data-theme="light"] .analysis-html .source-list {
  color: #666 !important;
}
[data-theme="light"] .analysis-html .muted {
  color: #6b7280 !important;
}
[data-theme="light"] .analysis-html .title-row,
[data-theme="light"] .analysis-html .analysis-title-row {
  border-bottom-color: #ccc !important;
}
/* Light: target specific dark-bg tables, NOT chip cells */
[data-theme="light"] .analysis-html table {
  background-color: transparent !important;
  color: #1a1a1a !important;
}
[data-theme="light"] .analysis-html th {
  background-color: #e8e8ec !important;
  border-color: #ccc !important;
}
[data-theme="light"] .analysis-html .sma-order-table td,
[data-theme="light"] .analysis-html .sma-mini td {
  background-color: transparent !important;
  color: #1a1a1a !important;
  border-color: #ddd !important;
}
[data-theme="light"] .analysis-html .styled-table td {
  background-color: transparent !important;
  color: #1a1a1a !important;
  border-color: #ddd !important;
}
[data-theme="light"] .analysis-html .kv-wrap { background-color: #f9f9fb !important; color: #1a1a1a !important; }
[data-theme="light"] .indicator-pane {
  border-top-color: #ddd;
}
[data-theme="light"] .chart-ohlc .ohlc-value {
  color: #333;
}

/* ===== LIGHT THEME: Genie / Additional / Performance panels ===== */

/* -- Genie panel -- */
[data-theme="light"] .genie-title-ticker {
  background: #eef4ff;
  border-color: #a3bfed;
  color: #1d4ed8;
}
[data-theme="light"] .genie-cc-wrap {
  background: #ffffff;
  border-color: #e5e7eb;
}
[data-theme="light"] .genie-cc-header {
  color: #1a1a1a;
}
[data-theme="light"] .genie-cc-source.genie {
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.3);
  color: #15803d;
}
[data-theme="light"] .genie-cc-rule {
  color: #6b7280;
}
[data-theme="light"] .genie-cc-body {
  background: #f9f9fb;
  border-color: #e5e7eb;
}
[data-theme="light"] .genie-cc-title {
  color: #1a1a1a;
}
[data-theme="light"] .genie-cc-title.risk {
  color: #b45309;
}
[data-theme="light"] .genie-cc-list {
  color: #374151;
}
[data-theme="light"] .genie-cc-list li.genie-reason-block {
  color: #b45309;
}
[data-theme="light"] .genie-cc-tech {
  color: #6b7280;
}
[data-theme="light"] .genie-cc-divider {
  border-top-color: #e5e7eb;
}
[data-theme="light"] .genie-quick-card {
  border-color: #e5e7eb;
}

/* -- Additional (Info) panel -- */
[data-theme="light"] .additional-tab {
  background: #f4f4f6;
  color: #6b7280;
  border-color: #e5e7eb;
}
[data-theme="light"] .additional-tab.active {
  color: #b45309;
  border-color: rgba(180,83,9,0.4);
  background: rgba(180,83,9,0.08);
}
[data-theme="light"] .additional-content {
  background: #ffffff;
  border-color: #e5e7eb;
}
[data-theme="light"] .additional-content .news-title {
  color: #1d4ed8;
}
[data-theme="light"] .additional-content .news-date {
  color: #b45309;
}
[data-theme="light"] .additional-content .news-link {
  color: #1a1a1a;
}
[data-theme="light"] .additional-content .tab-wrap,
[data-theme="light"] .additional-content .tab-date {
  color: #1a1a1a;
}
[data-theme="light"] .additional-content .rating-text,
[data-theme="light"] .additional-content .insider-body {
  color: #374151;
}
[data-theme="light"] .additional-content .fundament-wrap {
  color: #1a1a1a;
}
[data-theme="light"] .additional-content .fundament-title {
  color: #1d4ed8;
}
[data-theme="light"] .additional-content .fundament-section-title {
  color: #6b7280;
}
[data-theme="light"] .additional-content .fundament-card {
  background: #f4f4f6;
  border-color: #e5e7eb;
}
[data-theme="light"] .additional-content .fundament-card.highlight {
  border-color: rgba(180,83,9,0.35);
  background: rgba(180,83,9,0.06);
}
[data-theme="light"] .additional-content .fundament-label {
  color: #6b7280;
}
[data-theme="light"] .additional-content .fundament-value {
  color: #1a1a1a;
}
[data-theme="light"] .additional-content .fundament-bar {
  background: #e5e7eb;
}
[data-theme="light"] .additional-content .fundament-range {
  background: #f4f4f6;
  border-color: #e5e7eb;
}
[data-theme="light"] .additional-content .fundament-range-label {
  color: #6b7280;
}
[data-theme="light"] .additional-content .fundament-range-values {
  color: #1a1a1a;
}
[data-theme="light"] .additional-content .fundament-range-bar {
  background: #e5e7eb;
}

/* -- Performance panel -- */
[data-theme="light"] .performance-controls label {
  color: #6b7280;
}
[data-theme="light"] .performance-controls input[type="date"] {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1a1a1a;
}
[data-theme="light"] .performance-refresh-btn {
  background: rgba(180,83,9,0.1);
  border-color: rgba(180,83,9,0.35);
  color: #b45309;
}
[data-theme="light"] .performance-content {
  background: #ffffff;
  border-color: #e5e7eb;
}

/* -- Auto countdown (light) -- */
[data-theme="light"] .auto-countdown {
  color: #6b7280;
  border-color: rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.04);
}
