/* === Tab Navigation === */
.tab-nav { display: flex; gap: 4px; }
.tab-btn {
  flex: 1;
  padding: 7px 0;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { background: var(--surface3); color: var(--text); }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Capital Input === */
.capital-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
}
.dollar-prefix { color: var(--muted); font-size: 13px; margin-right: 4px; }
.capital-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  padding: 7px 0;
  outline: none;
  width: 100%;
}
.capital-input::-webkit-inner-spin-button,
.capital-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.capital-input { -moz-appearance: textfield; }

/* === Owned Stocks === */
.owned-stock-form { display: flex; gap: 4px; margin-bottom: 8px; }
.owned-input {
  flex: 1;
  padding: 6px 8px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  outline: none;
  min-width: 0;
}
.owned-input:focus { border-color: var(--accent); }
.owned-input.small { max-width: 58px; }
.owned-add-btn {
  padding: 6px 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.owned-add-btn:hover { opacity: 0.85; }

.owned-stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.owned-remove-btn {
  background: none;
  border: none;
  color: var(--red2);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
}
.owned-remove-btn:hover { color: var(--red); }

/* === Account Summary — Cyberpunk Theme === */
.acct-summary {
  background: linear-gradient(180deg, rgba(18, 20, 28, 1) 0%, rgba(15, 12, 25, 1) 100%);
  border-bottom: 1px solid rgba(108, 140, 255, 0.15);
}

.acct-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.acct-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.acct-value {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.acct-sublabel {
  font-size: 9px;
  color: var(--muted);
  opacity: 0.7;
}

.acct-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
  margin: 4px 0;
}

/* Plain — starting capital, clean white */
.acct-plain {
  color: var(--text);
  text-shadow: 0 0 8px rgba(232, 234, 246, 0.15);
}

/* Neutral — collateral, remaining: cool cyan */
.acct-neutral {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(76, 201, 240, 0.25);
}

/* Warm — collateral, shares committed: yellow-amber glow */
.acct-warm {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(233, 196, 106, 0.4), 0 0 22px rgba(233, 196, 106, 0.15);
}

/* Hot — trade count, warnings: neon pink-magenta */
.acct-hot {
  color: var(--pink);
  text-shadow: 0 0 12px rgba(247, 37, 133, 0.4), 0 0 24px rgba(247, 37, 133, 0.15);
}

/* Cash — total premium: money green glow */
.acct-cash {
  color: var(--green);
  text-shadow: 0 0 10px rgba(6, 214, 160, 0.4), 0 0 22px rgba(6, 214, 160, 0.15);
}

/* Danger — negative values: red glow */
.acct-danger {
  color: var(--red2);
  text-shadow: 0 0 10px rgba(231, 111, 81, 0.4), 0 0 22px rgba(231, 111, 81, 0.15);
}

/* === Planner View (main area) === */
.planner-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 28px;
}

/* === Planner Search === */
.planner-header { margin-bottom: 24px; position: relative; }
.planner-search-wrapper { position: relative; max-width: 520px; }
.planner-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.planner-search-input:focus { border-color: var(--accent); }
.planner-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.planner-search-dropdown.visible { display: block; }

.planner-search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.planner-search-result:hover,
.planner-search-result.selected { background: var(--surface2); }
.planner-search-result .result-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}
.planner-search-result .result-ticker {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.planner-search-result .result-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.planner-search-result .result-right {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.planner-search-result .result-price {
  font-size: 12px;
  color: var(--text2);
}
.planner-search-result .result-perf {
  font-size: 11px;
  font-weight: 600;
}
.planner-search-result.search-yahoo {
  border-top: 1px solid var(--border2);
  background: var(--surface2);
}
.planner-search-result.search-yahoo .result-name {
  color: var(--accent);
}

/* === Paper Trades === */
.planner-trades-section { flex: 1; }
.planner-trades-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.planner-trades-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.planner-trades-actions { display: flex; gap: 8px; }
.battle-btn {
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--green2), var(--red2));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.battle-btn:hover { opacity: 0.85; }
.clear-trades-btn {
  padding: 6px 12px;
  background: var(--surface2);
  color: var(--red2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.clear-trades-btn:hover { background: var(--surface3); border-color: var(--red2); }

.trades-subsection { margin-bottom: 28px; }
.trades-subsection-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.trades-subsection-title.put-title { color: var(--red2); }
.trades-subsection-title.call-title { color: var(--green); }

.trades-table {
  width: 100%;
  border-collapse: collapse;
}
.trades-table th {
  padding: 6px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border2);
}
.trades-table td {
  padding: 8px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.trades-table tr:hover td { background: var(--surface2); }

.trade-qty-input {
  width: 50px;
  padding: 3px 4px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.trade-qty-input::-webkit-inner-spin-button,
.trade-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.trade-qty-input:focus { border-color: var(--accent); }

.trade-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.trade-remove-btn:hover { color: var(--red2); }

.trades-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 20px 0;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* === Chain Modal === */
.chain-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.chain-modal-overlay.visible { display: flex; }

.chain-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 720px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.chain-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.chain-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chain-ticker { font-size: 20px; font-weight: 700; }
.chain-price { font-size: 14px; color: var(--text2); }
.chain-exp-select {
  padding: 4px 8px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.chain-exp-select:focus { border-color: var(--accent); }
.chain-dte { font-size: 12px; color: var(--muted); }
.chain-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}
.chain-close:hover { color: var(--text); }

.chain-body { padding: 16px 20px; }
.chain-section { margin-bottom: 24px; }
.chain-section:last-child { margin-bottom: 0; }
.chain-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.chain-strike-header,
.chain-strike-row {
  display: grid;
  grid-template-columns: 70px 60px 55px 60px 50px 60px 70px 50px;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  padding: 0 4px;
}
.chain-strike-header {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border2);
}
.chain-strike-row {
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.chain-strike-row:hover { background: var(--surface2); }
.chain-strike-row.itm { opacity: 0.5; }

.chain-qty-input {
  width: 44px;
  padding: 3px 4px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  text-align: center;
  outline: none;
}
.chain-qty-input:focus { border-color: var(--accent); }

.chain-add-btn {
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chain-add-btn:hover { opacity: 0.85; }

.chain-loading {
  color: var(--muted);
  font-size: 12px;
  padding: 20px 0;
  text-align: center;
}

/* === Battle Modal === */
.battle-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.battle-modal-overlay.visible { display: flex; }

.battle-modal {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 820px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.battle-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.battle-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--green), var(--red2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.battle-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.battle-close:hover { color: var(--text); }

.battle-body { padding: 20px 24px; }

.battle-section { margin-bottom: 28px; }
.battle-section:last-child { margin-bottom: 0; }
.battle-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 12px;
}

/* Overview grid */
.battle-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.battle-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.battle-stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.battle-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Trade analysis card */
.battle-trade {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.battle-trade-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.battle-trade-ticker {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.battle-trade-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.battle-trade-detail {
  font-size: 11px;
  color: var(--muted);
}

/* News section */
.battle-news {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.battle-news-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.battle-news-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.battle-news-item:last-child { border-bottom: none; }
.battle-news-date {
  color: var(--muted);
  font-size: 10px;
  flex-shrink: 0;
  min-width: 70px;
}
.battle-news-headline {
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}
.battle-news-pub {
  color: var(--muted);
  font-size: 10px;
  flex-shrink: 0;
}

/* Bull vs Bear columns */
.battle-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.battle-column {
  border-radius: var(--radius);
  padding: 12px 14px;
}
.bull-column { background: rgba(6, 214, 160, 0.06); border: 1px solid rgba(6, 214, 160, 0.15); }
.bear-column { background: rgba(231, 111, 81, 0.06); border: 1px solid rgba(231, 111, 81, 0.15); }

.battle-column-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.bull-header { color: var(--green); }
.bear-header { color: var(--red2); }

.battle-point {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text2);
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}
.battle-point:last-child { margin-bottom: 0; }
.battle-icon {
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 14px;
}
.bull-point .battle-icon { color: var(--green); }
.bear-point .battle-icon { color: var(--red2); }

/* Verdict */
.battle-verdict {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.verdict-bull { background: rgba(6, 214, 160, 0.1); border: 1px solid rgba(6, 214, 160, 0.25); }
.verdict-neutral { background: rgba(233, 196, 106, 0.1); border: 1px solid rgba(233, 196, 106, 0.25); }
.verdict-bear { background: rgba(231, 111, 81, 0.1); border: 1px solid rgba(231, 111, 81, 0.25); }

.battle-verdict-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
}
.battle-verdict-stats {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text2);
}

/* Risk flags */
.battle-warnings { margin-top: 12px; }
.battle-warnings-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red2);
  margin-bottom: 8px;
}
.battle-warning-item {
  font-size: 12px;
  color: var(--text2);
  padding: 8px 12px;
  background: rgba(231, 111, 81, 0.08);
  border-left: 3px solid var(--red2);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 6px;
  line-height: 1.5;
}

/* === Heatmap View wrapper === */
.heatmap-view {
  position: relative;
  width: 100%;
  height: 100%;
}
