:root {
  --bg: #000;
  --surface: #0a0a0a;
  --surface2: #161616;
  --text: #fff;
  --text2: #999;
  --text3: #555;
  --border: #1a1a1a;
  --r: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  overscroll-behavior: none;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
  min-height: 100vh;
}

/* Header */
.hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hdr-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.hdr-sub {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
  font-weight: 500;
}
.hdr-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  transition: background 0.3s;
  margin-top: 0;
  flex-shrink: 0;
}
.hdr-dot.online { background: #34c759; }
.hdr-dot.offline { background: #ff3b30; }

/* Tabs — compact icon bar */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: #111;
  border-radius: 10px;
  padding: 2px;
}
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #555;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  letter-spacing: 0.2px;
  -webkit-appearance: none;
  white-space: nowrap;
}
.tab:active { opacity: 0.7; }
.tab.active {
  color: #fff;
  background: #222;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.tab .tab-label {
  display: none;
}
.tab.active .tab-label {
  display: inline;
}
@media (min-width: 380px) {
  .tab .tab-label { display: inline; }
  .tab { font-size: 11px; gap: 4px; }
}

/* Input */
.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
#symbolInput {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  background: #111;
  border: 1px solid #222;
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
#symbolInput:focus { border-color: #444; }
#symbolInput::placeholder { color: #444; font-family: var(--font); }

.btn {
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  -webkit-appearance: none;
  flex-shrink: 0;
}
.btn:active { opacity: 0.7; transform: scale(0.97); }
.btn:disabled { opacity: 0.25; cursor: not-allowed; transform: none; }
.btn-primary { background: #fff; color: #000; }
.btn-best { background: #222; color: #fff; border: 1px solid #333; }

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #111;
  border: 1px solid #222;
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
  -webkit-overflow-scrolling: touch;
}
.dropdown.hidden { display: none; }
.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #1a1a1a;
}
.dd-item:active { background: #1a1a1a; }
.dd-item:last-child { border-bottom: none; }
.dd-sym { font-weight: 700; font-size: 14px; color: var(--text); min-width: 72px; font-family: var(--mono); }
.dd-name { font-size: 12px; color: var(--text3); flex: 1; }
.dd-badge { font-size: 9px; padding: 2px 6px; background: #1a1a1a; color: var(--text3); border-radius: 4px; font-weight: 600; }

/* Quick chips */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 12px;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 20px;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s;
  -webkit-appearance: none;
  flex-shrink: 0;
}
.chip:active { color: var(--text2); border-color: #444; background: #1a1a1a; }

/* Loading */
.loading { text-align: center; padding: 48px 0; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid #1a1a1a;
  border-top-color: #444;
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--text3); font-size: 13px; }

/* Error */
.error {
  padding: 16px;
  background: #1a0a0a;
  border: 1px solid #331a1a;
  border-radius: 12px;
  color: #ff6b6b;
  font-size: 13px;
  text-align: center;
}

/* Empty */
.empty-state {
  text-align: center;
  padding: 56px 0;
}
.empty-state p { color: #444; font-size: 14px; }
.empty-state .sub { font-size: 12px; margin-top: 4px; color: #333; }

/* Results */
.results { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Summary */
.summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1a1a1a;
}
.sym { font-size: 22px; font-weight: 800; font-family: var(--mono); letter-spacing: -0.5px; }
.spot { font-size: 13px; color: var(--text3); margin-top: 2px; }
.meta { text-align: right; }
.time { font-size: 10px; color: var(--text3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.updated-ago { font-size: 10px; color: var(--text3); background: var(--surface2); padding: 2px 6px; border-radius: 4px; }
.refresh-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 14px; cursor: pointer; color: var(--text2); transition: all 0.2s; }
.refresh-btn:hover { background: var(--surface3); border-color: var(--primary); color: var(--primary); }
.refresh-btn:active { transform: scale(0.95); }
.src {
  display: inline-block;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.3px;
}
.src.live { background: #1a2e1a; color: #34c759; }
.src.demo { background: #1a1a1a; color: var(--text3); }

/* GEX tag */
.gex-tag {
  display: inline-block;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.3px;
}
.gex-tag.longgamma { background: #1a2e1a; color: #34c759; }
.gex-tag.shortgamma { background: #2e1a1a; color: #ff3b30; }
.gex-tag.mixed { background: #1a1a1a; color: #666; }

/* Institutional activity tag */
.inst-tag {
  display: inline-block;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.3px;
}
.inst-tag.bullish { background: #1a2e1a; color: #34c759; }
.inst-tag.bearish { background: #2e1a1a; color: #ff3b30; }
.inst-tag.neutral { background: #1a1a1a; color: #666; }

/* S/R levels */
.levels {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.level {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 600;
}
.level.support { background: #1a2e1a; color: #34c759; }
.level.resistance { background: #2e1a1a; color: #ff3b30; }
.level.pin { background: #1a1a2e; color: #7c7cff; }
.level.small { font-size: 9px; padding: 1px 5px; }

.sr-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Idea card */
.idea {
  padding: 16px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 3px solid var(--text3);
}
.idea:not(.top-pick) {
  opacity: 0.75;
}
.idea:not(.top-pick) .conf {
  font-size: 18px;
}
.idea:not(.top-pick) .idea-name {
  font-size: 12px;
}
.idea.bullish { border-left-color: #34c759; }
.idea.bearish { border-left-color: #ff3b30; }
.idea.neutral { border-left-color: #444; }

.idea-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.idea-name { font-size: 14px; font-weight: 700; }
.dir {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-left: 6px;
  background: #1a1a1a;
  color: var(--text2);
}
.dir.bullish { color: #34c759; }
.dir.bearish { color: #ff3b30; }

.opt-tag {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-left: 6px;
  background: #fff;
  color: #000;
  font-family: var(--mono);
}

/* Top pick: lifted, but the left edge keeps its direction colour
   (green bullish / red bearish) rather than turning green for every pick. */
.idea.top-pick {
  border-color: #262626;
  background: #0d0d0d;
}
.idea.top-pick.bullish { border-left-color: #34c759; }
.idea.top-pick.bearish { border-left-color: #ff3b30; }
.idea.top-pick.neutral { border-left-color: #555; }
.idea.top-pick .idea-name { font-size: 16px; }
.idea.top-pick .conf { font-size: 28px; }
.top-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 6px;
  background: #34c759;
  color: #000;
  letter-spacing: 0.3px;
}

.top-badge.weak {
  background: #ff9500;
  color: #000;
}
.weak-warning {
  text-align: center;
  padding: 10px;
  margin: 0 0 10px;
  background: rgba(255, 149, 0, 0.15);
  border: 1px solid rgba(255, 149, 0, 0.3);
  border-radius: 8px;
  color: #ff9500;
  font-size: 13px;
  font-weight: 600;
}
.idea.weak-day {
  opacity: 0.65;
}
.idea.weak-day.top-pick {
  opacity: 0.85;
}

.conf { font-size: 24px; font-weight: 800; font-family: var(--mono); color: var(--text); }
.conf.high { color: #34c759; }
.conf.mid { color: #999; }
.conf.low { color: #555; }

/* Confidence bar */
.bar { height: 2px; background: #1a1a1a; border-radius: 1px; margin-bottom: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 1px; transition: width 0.4s; }
.bar-fill.high { background: #34c759; }
.bar-fill.mid { background: #666; }
.bar-fill.low { background: #333; }

/* Detail rows */
.row {
  display: flex;
  padding: 3px 0;
  font-size: 12px;
}
.lbl { width: 64px; color: var(--text3); flex-shrink: 0; }
.val { color: var(--text2); }
.val.hl { color: var(--text); font-weight: 500; }

.rationale {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #1a1a1a;
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
}
.simple-reason {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text1);
  line-height: 1.6;
}
.simple-reason strong {
  color: #ffc107;
}

/* Best pick header */
.bp-hdr {
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
  padding: 6px 0 4px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Runners up */
.runners-hdr {
  font-size: 9px;
  font-weight: 600;
  color: var(--text3);
  text-align: center;
  padding: 14px 0 6px;
  border-top: 1px solid #1a1a1a;
  margin-top: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.runners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.runner {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.1s;
  -webkit-appearance: none;
}
.runner:active { border-color: #333; }
.runner-sym { font-weight: 700; font-size: 14px; font-family: var(--mono); color: var(--text); }
.runner-info { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Disclaimer */
.disc {
  font-size: 9px;
  color: var(--text3);
  text-align: center;
  padding: 16px 0;
  opacity: 0.3;
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  z-index: 200;
}
.modal.hidden { display: none; }
.modal-content {
  background: #111;
  border-radius: 16px 16px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}
.modal-field {
  margin-bottom: 14px;
}
.modal-field label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}
.modal-field input, .modal-field select {
  width: 100%;
  padding: 12px 14px;
  background: #000;
  border: 1px solid #222;
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--mono);
  outline: none;
  -webkit-appearance: none;
}
.modal-field input:focus, .modal-field select:focus { border-color: #444; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions .btn { flex: 1; text-align: center; padding: 14px; }

/* Position cards */
.pos-card {
  padding: 14px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  margin-bottom: 10px;
}
.pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.pos-symbol {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--mono);
}
.pos-type {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 6px;
}
.pos-type.ce { background: #1a2e1a; color: #34c759; }
.pos-type.pe { background: #2e1a1a; color: #ff3b30; }
.pos-pnl {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--mono);
}
.pos-pnl.positive { color: #34c759; }
.pos-pnl.negative { color: #ff3b30; }
.pos-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 11px;
}
.pos-details .lbl { color: #555; }
.pos-details .val { color: #999; text-align: right; }
.pos-delete {
  margin-top: 10px;
  text-align: right;
}
.pos-delete button {
  font-size: 11px;
  color: #666;
  background: none;
  border: 1px solid #222;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  -webkit-appearance: none;
}
.pos-delete button:active { background: #1a1a1a; }
/* Expiry date tag */
.expiry-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  background: #1a1a2e;
  color: #7c7cff;
  margin-top: 4px;
  font-family: var(--mono);
}

.expiry-inline {
  color: #7c7cff !important;
  font-weight: 600;
  font-family: var(--mono);
}

/* Trade Guide */
.trade-guide {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid #222;
  border-radius: 10px;
}

.guide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #222;
}

.guide-section {
  margin-bottom: 10px;
}

.guide-section:last-child {
  margin-bottom: 0;
}

.guide-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 3px;
}

.guide-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0.85;
}

/* VIX tags */
.vix-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  margin-left: 4px;
}
.vix-tag.low { background: #0a2e0a; color: #4caf50; }
.vix-tag.normal { background: #0a1e2e; color: #4caf50; }
.vix-tag.elevated { background: #2e2e0a; color: #ff9800; }
.vix-tag.high { background: #2e0a0a; color: #f44336; }

/* Trading Box */
.trading-box {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid #222;
  border-radius: 10px;
}
.tb-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.tb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}
.tb-label { color: var(--text2); }
.tb-val { font-weight: 600; font-family: var(--mono); }
.tb-val.resistance { color: #f44336; }
.tb-val.support { color: #4caf50; }
.tb-sub { font-size: 10px; color: var(--text3); }
.tb-guide {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
  padding: 8px;
  background: var(--bg);
  border-radius: 6px;
}

/* Scenarios */
.scenarios {
  margin-top: 12px;
}
.sc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.sc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sc-card {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid #222;
}
.sc-card.scenario-up { border-left: 3px solid #4caf50; }
.sc-card.scenario-down { border-left: 3px solid #f44336; }
.sc-card.scenario-flat { border-left: 3px solid #ff9800; }
.sc-card.scenario-up_big { border-left: 3px solid #2e7d32; }
.sc-card.scenario-down_big { border-left: 3px solid #c62828; }
.sc-move {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--mono);
}
.scenario-up .sc-move, .scenario-up_big .sc-move { color: #4caf50; }
.scenario-down .sc-move, .scenario-down_big .sc-move { color: #f44336; }
.scenario-flat .sc-move { color: #ff9800; }
.sc-spot {
  font-size: 11px;
  color: var(--text2);
  font-family: var(--mono);
}
.sc-desc {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.3;
  margin-top: 4px;
}

/* Options Chain View */
.chain-view {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid #222;
  border-radius: 10px;
}
.chain-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.chain-table {
  font-size: 11px;
  font-family: var(--mono);
}
.chain-header {
  display: flex;
  padding: 4px 0;
  font-weight: 600;
  color: var(--text2);
  border-bottom: 1px solid #333;
}
.chain-header .ch-ce { flex: 1; text-align: right; }
.chain-header .ch-strike { flex: 0 0 70px; text-align: center; }
.chain-header .ch-pe { flex: 1; text-align: left; }
.chain-row {
  display: flex;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid #1a1a1a;
}
.chain-row.atm {
  background: #1a1a2e;
  font-weight: 600;
}
.chain-row .ch-ce {
  flex: 1;
  text-align: right;
  padding-right: 8px;
  position: relative;
  color: #f44336;
}
.chain-row .ch-strike {
  flex: 0 0 70px;
  text-align: center;
  color: var(--text);
  font-weight: 500;
}
.chain-row .ch-pe {
  flex: 1;
  text-align: left;
  padding-left: 8px;
  position: relative;
  color: #4caf50;
}
.oi-bar {
  display: inline-block;
  height: 8px;
  background: rgba(244,67,54,0.3);
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}
.oi-bar.pe {
  background: rgba(76,175,80,0.3);
  margin-left: 4px;
  margin-right: 0;
}

.hidden { display: none !important; }

/* iOS safe area adjustments */
@supports (padding-top: env(safe-area-inset-top)) {
  .app { padding-top: calc(16px + env(safe-area-inset-top)); }
  .app { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ── Price Targets Card ── */
.targets-loading { text-align: center; color: var(--text3); padding: 20px; }
.targets-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.targets-error { text-align: center; color: #ff6b6b; padding: 16px; font-size: 13px; }
.targets-card { background: var(--card); border-radius: 12px; padding: 16px; margin-top: 16px; }
.targets-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.targets-title { font-size: 16px; font-weight: 700; }
.targets-sub { font-size: 12px; color: var(--text3); margin-bottom: 12px; }
.bias-tag { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.bias-tag.bullish { background: rgba(0,200,83,0.15); color: #00c853; }
.bias-tag.bearish { background: rgba(255,82,82,0.15); color: #ff5252; }
.bias-tag.neutral { background: rgba(255,193,7,0.15); color: #ffc107; }
.targets-section { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.targets-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.section-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.targets-range { margin-bottom: 0; }
.range-bar { height: 8px; background: var(--border); border-radius: 4px; position: relative; overflow: hidden; }
.range-fill { position: absolute; top: 0; height: 100%; border-radius: 4px; }
.range-fill.bullish { background: linear-gradient(90deg, #00c853, #69f0ae); }
.range-fill.bearish { background: linear-gradient(90deg, #ff5252, #ff8a80); }
.range-fill.neutral { background: linear-gradient(90deg, #ffc107, #ffe082); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-top: 4px; }
.range-prob { font-weight: 600; color: var(--text1); }
.targets-probs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.prob-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.prob-row.up span:first-child { color: #69f0ae; }
.prob-row.down span:first-child { color: #ff8a80; }
.prob-row span:first-child { color: var(--text2); }
.prob-row span:last-child { font-weight: 600; color: var(--text1); font-family: var(--mono); }
.targets-levels { margin-bottom: 0; }
.target-level { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.target-level:last-child { border-bottom: none; }
.target-level.level-up .tl-strike { color: #00c853; }
.target-level.level-down .tl-strike { color: #ff5252; }
.tl-label { color: var(--text3); flex: 1; font-size: 11px; }
.tl-strike { font-weight: 600; font-family: var(--mono); margin: 0 8px; font-size: 12px; }
.tl-prob { color: var(--text2); font-family: var(--mono); font-size: 11px; }
.targets-directions { display: grid; gap: 8px; }
.dir-target { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px; border-left: 3px solid var(--border); }
.dir-target.bullish { border-left-color: #00c853; }
.dir-target.bearish { border-left-color: #ff5252; }
.dir-target.neutral { border-left-color: #ffc107; }
.dt-header { display: flex; justify-content: space-between; align-items: center; }
.dt-dir { font-weight: 700; font-size: 13px; }
.dir-target.bullish .dt-dir { color: #00c853; }
.dir-target.bearish .dt-dir { color: #ff5252; }
.dir-target.neutral .dt-dir { color: #ffc107; }
.dt-price { font-weight: 700; font-size: 15px; font-family: var(--mono); }
.dt-label { font-size: 12px; color: var(--text3); margin: 4px 0; }
.dt-bar { height: 4px; background: var(--border); border-radius: 2px; margin: 4px 0; overflow: hidden; }
.dt-fill { height: 100%; border-radius: 2px; }
.dt-fill.bullish { background: #00c853; }
.dt-fill.bearish { background: #ff5252; }
.dt-fill.neutral { background: #ffc107; }
.dt-prob { font-size: 11px; color: var(--text2); }

/* ── Watchlist ──────────────────────────────────── */
.watchlist-section { margin: 8px 0 4px; padding: 8px 12px; background: var(--surface2); border-radius: var(--r); }
.wl-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.wl-title { font-size: 12px; color: var(--text2); font-weight: 600; }
.wl-edit { background: none; border: none; color: var(--text3); font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.wl-edit:hover { background: rgba(255,255,255,0.05); }
.wl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 16px; padding: 4px 10px; font-size: 12px; color: var(--text); cursor: pointer; transition: all 0.15s; }
.wl-chip:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.wl-chip .wl-remove { font-size: 10px; color: var(--text3); margin-left: 2px; }
.wl-chip .wl-remove:hover { color: #ff5252; }
.wl-edit-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow-y: auto; }
.wl-edit-item { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 16px; padding: 6px 12px; font-size: 13px; }
.wl-edit-item button { background: none; border: none; color: #ff5252; font-size: 14px; cursor: pointer; padding: 0 2px; }

/* ── Price Alerts ────────────────────────────────── */
.alert-card { background: var(--surface2); border-radius: var(--r); padding: 12px; margin-bottom: 8px; border-left: 3px solid #ffc107; }
.alert-card.triggered { border-left-color: #69f0ae; opacity: 0.6; }
.alert-card .alert-top { display: flex; justify-content: space-between; align-items: center; }
.alert-card .alert-sym { font-weight: 700; font-size: 15px; }
.alert-card .alert-price { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.alert-card .alert-dir { font-size: 12px; color: var(--text2); margin-top: 2px; }
.alert-card .alert-dir.above { color: #69f0ae; }
.alert-card .alert-dir.below { color: #ff8a80; }
.alert-card .alert-delete { background: none; border: none; color: var(--text3); font-size: 18px; cursor: pointer; padding: 4px; }
.alert-card .alert-delete:hover { color: #ff5252; }
.alert-card .alert-time { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* ── Trade Journal ─────────────────────────────── */
.journal-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.j-stat { background: var(--surface2); border-radius: 8px; padding: 10px; text-align: center; }
.j-stat .j-val { font-size: 18px; font-weight: 700; font-family: var(--mono); }
.j-stat .j-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.j-stat.positive .j-val { color: #69f0ae; }
.j-stat.negative .j-val { color: #ff8a80; }
.j-stat.neutral .j-val { color: var(--text2); }
.journal-entry { background: var(--surface2); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.journal-entry .je-top { display: flex; justify-content: space-between; align-items: center; }
.journal-entry .je-sym { font-weight: 700; font-size: 14px; }
.journal-entry .je-pnl { font-weight: 700; font-family: var(--mono); font-size: 15px; }
.journal-entry .je-pnl.positive { color: #69f0ae; }
.journal-entry .je-pnl.negative { color: #ff8a80; }
.journal-entry .je-details { display: flex; gap: 12px; font-size: 11px; color: var(--text3); margin-top: 4px; flex-wrap: wrap; }
.journal-entry .je-lessons { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text2); font-style: italic; }

/* ── Close Position Modal ──────────────────────── */
.close-pos-info { background: var(--surface2); border-radius: 8px; padding: 10px; margin-bottom: 12px; font-size: 13px; }
.close-pos-info .cpi-row { display: flex; justify-content: space-between; padding: 2px 0; }
.close-pos-info .cpi-label { color: var(--text3); }
.close-pos-info .cpi-val { font-weight: 600; font-family: var(--mono); }

/* ── P&L Total ─────────────────────────────────── */
.total-pnl { display: flex; justify-content: space-between; align-items: center; background: var(--surface2); border-radius: var(--r); padding: 12px 16px; margin-bottom: 12px; }
.pnl-label { font-size: 13px; color: var(--text2); }
.pnl-value { font-size: 20px; font-weight: 700; font-family: var(--mono); }
.pnl-value.positive { color: #69f0ae; }
.pnl-value.negative { color: #ff8a80; }

/* ── P&L Sparkline ─────────────────────────────── */
.pnl-sparkline { margin: 6px 0; }
.pnl-sparkline svg { width: 100%; height: 36px; }

/* ── Position Card Enhanced ────────────────────── */
.pos-card .pos-actions { display: flex; gap: 6px; margin-top: 8px; }
.pos-card .pos-actions .btn { font-size: 11px; padding: 4px 10px; }
.btn-close-pos { background: rgba(255,82,82,0.15); color: #ff8a80; border: 1px solid rgba(255,82,82,0.2); }
.btn-close-pos:hover { background: rgba(255,82,82,0.25); }

/* ── Update Button ─────────────────────────────────────── */
.btn-update {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 16px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.btn-update:hover { background: rgba(255,255,255,0.1); transform: scale(1.1); }
.btn-update:active { transform: scale(0.95); }
.version-tag {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 22px);
  right: 68px;
  font-size: 10px;
  color: var(--text3);
  z-index: 100;
  opacity: 0.6;
}

/* ── SVG Icons ─────────────────────────────────────────── */
.icon-sm {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.icon-update {
  width: 20px;
  height: 20px;
}

/* ── Auth Bar ──────────────────────────────────────── */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.user-badge {
  font-size: 12px;
  font-weight: 600;
  color: #69f0ae;
  background: rgba(105,240,174,0.1);
  padding: 3px 8px;
  border-radius: 12px;
}
.btn-logout {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
}
.btn-logout:hover { background: rgba(255,82,82,0.15); color: #ff8a80; }
.login-error { color: #ff8a80; font-size: 12px; margin-bottom: 8px; min-height: 16px; }
/* Grade tag (analyser grade: best / better / good / no_trade) */
.conf-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.grade {
  font-size: 10px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.grade-best { background: #34c759; color: #000; }
.grade-better { background: #30b0c7; color: #000; }
.grade-good { background: #ffcc00; color: #000; }
.grade-no_trade { background: #3a3a3c; color: #c7c7cc; }
.grade-note { font-size: 12px; color: var(--text2, #aaa); margin: 6px 0 2px; }

/* Score breakdown */
.components { margin-top: 10px; font-size: 12px; }
.components summary { cursor: pointer; color: var(--text2, #aaa); padding: 4px 0; }
.comp-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.comp-name { text-transform: capitalize; color: var(--text, #eee); }
.comp-pts { font-family: var(--mono, monospace); color: var(--text2, #aaa); }

/* ── v5.4 Idea card layout: grade + confidence, key lines, why, breakdown, guide ── */
.idea-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.idea-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.idea-head .grade { font-size: 11px; padding: 3px 9px; }
.idea-head .top-badge { margin-left: 0; background: transparent; border: 1px solid #333; color: var(--text2); font-weight: 600; }
.idea-head .top-badge.weak { background: #ff9500; border-color: #ff9500; color: #000; }
.idea .grade-note { margin: 6px 0 10px; line-height: 1.45; }
.idea .idea-top { margin-bottom: 8px; }
.idea .idea-top > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 0; }
.conf.g-best, .sr-conf.g-best { color: #34c759; }
.conf.g-better, .sr-conf.g-better { color: #30b0c7; }
.conf.g-good, .sr-conf.g-good { color: #ffcc00; }
.conf.g-no_trade, .sr-conf.g-no_trade { color: #8e8e93; }
.bar-fill.g-best { background: #34c759; }
.bar-fill.g-better { background: #30b0c7; }
.bar-fill.g-good { background: #ffcc00; }
.bar-fill.g-no_trade { background: #48484a; }
.idea.top-pick .bar { height: 3px; }

.kv-list { display: grid; gap: 0; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: 12px; border-bottom: 1px solid #151515; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text3); flex-shrink: 0; }
.kv .v { color: var(--text2); text-align: right; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.kv .v.hl { color: var(--text); font-weight: 600; }
.kv .v.gain { color: #34c759; }
.kv .v.loss { color: #ff3b30; }
.kv-more { margin-top: 6px; padding-top: 4px; border-top: 1px solid #1a1a1a; }
.kv-more .kv { font-size: 11px; padding: 3px 0; border-bottom: none; }
.kv-more .sr-row { margin-top: 4px; }

.idea-sec { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.idea-why { margin-top: 12px; padding-top: 12px; border-top: 1px solid #1a1a1a; }
.idea-why .simple-reason { margin-top: 0; color: var(--text); background: var(--surface2); border: 1px solid #222; }
.idea-why .rationale { margin-top: 8px; padding-top: 0; border-top: none; }
.idea .components { margin-top: 12px; padding-top: 8px; border-top: 1px solid #1a1a1a; }

/* ── v5.4 Analyze home: watched-symbols list ── */
.scan-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 8px; }
.scan-status { font-size: 12px; color: var(--text2); min-width: 0; }
.scan-status.running { color: var(--text); }
.scan-refresh { width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: #111; border: 1px solid #222; border-radius: 10px; color: var(--text2); cursor: pointer; -webkit-appearance: none; }
.scan-refresh svg { width: 16px; height: 16px; }
.scan-refresh:active { background: #1a1a1a; }
.scan-refresh:disabled { opacity: 0.4; cursor: default; }
.scan-refresh.spinning svg { animation: spin 0.9s linear infinite; }
/* One line on a phone: the chips never wrap (they scroll sideways if a
   narrow screen needs it); "Hide No trade" sits on the count line below. */
.scan-filters { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scan-filters::-webkit-scrollbar { display: none; }
.scan-filters .chip { padding: 6px 11px; font-family: var(--font); flex-shrink: 0; white-space: nowrap; }
.scan-filters .chip.active { color: #000; background: #fff; border-color: #fff; }
.scan-subrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 6px; }
.scan-subrow .scan-count { margin: 0; }
.scan-subrow .chip.toggle { padding: 4px 10px; font-size: 11px; font-family: var(--font); }
.scan-subrow .chip.toggle.active { color: var(--text); background: #222; border-color: #444; }
.scan-filters .chip.toggle.active { color: var(--text); background: #222; border-color: #444; }
.scan-count { font-size: 10px; color: var(--text3); margin: 0 2px 6px; }

.scan-list { display: grid; gap: 6px; padding-bottom: 56px; /* clear the fixed update button */ }
.scan-row {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 11px 12px; background: #0a0a0a; border: 1px solid #1a1a1a; border-radius: 12px;
  cursor: pointer; outline: none; transition: border-color 0.1s, background 0.1s;
}
.scan-row:active { background: #111; border-color: #2a2a2a; }
.scan-row:focus-visible { border-color: #555; }
@media (hover: hover) { .scan-row:hover { border-color: #2a2a2a; } }
.scan-row.weak { opacity: 0.6; }
.sr-left, .sr-mid { min-width: 0; }
.sr-sym { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-idx { font-family: var(--font); font-size: 8px; font-weight: 700; padding: 1px 4px; margin-left: 5px; border-radius: 3px; background: #1a1a1a; color: var(--text3); vertical-align: 2px; letter-spacing: 0.3px; }
.sr-px { font-family: var(--mono); font-size: 11px; color: var(--text2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-chg { color: var(--text3); }
.sr-chg.up { color: #34c759; }
.sr-chg.down { color: #ff3b30; }
.sr-strat { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-arrow { display: inline-block; width: 12px; margin-right: 3px; font-weight: 800; }
.sr-arrow.bullish { color: #34c759; }
.sr-arrow.bearish { color: #ff3b30; }
.sr-arrow.neutral { color: var(--text3); }
.sr-age { font-size: 10px; color: var(--text3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 64px; }
.sr-conf { font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--text2); line-height: 1; }
.sr-right .grade { font-size: 9px; padding: 2px 6px; }
.scan-row.err .sr-nodata { color: #ff8a80; font-weight: 600; }
.scan-row.err .sr-errmsg { color: var(--text3); }
.scan-row.busy { opacity: 0.8; cursor: default; }
.sr-spin { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid #333; border-top-color: #aaa; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -1px; }
.scan-row.skeleton { height: 58px; cursor: default; display: block; }
.scan-row.skeleton .sk { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0f0f0f 0%, #161616 50%, #0f0f0f 100%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.scan-empty { text-align: center; padding: 40px 12px; }
.scan-empty p { color: #666; font-size: 13px; }
.scan-empty .sub { color: #444; font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.scan-empty .btn { margin-top: 14px; }

@media (max-width: 374px) {
  .scan-row { gap: 8px; padding: 10px; }
  .sr-sym { font-size: 13px; }
  .sr-conf { font-size: 16px; }
  .sr-right { min-width: 56px; }
  .sr-strat { white-space: normal; line-height: 1.25; }
}
.sr-mid.sr-wide { grid-column: 2 / 4; }

/* Detail bar: back to list + refresh this symbol */
.detail-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.detail-back { background: none; border: none; color: var(--text); font-size: 14px; font-weight: 600; font-family: var(--font); padding: 8px 4px 8px 0; cursor: pointer; white-space: nowrap; -webkit-appearance: none; }
.detail-back:active { opacity: 0.6; }
.detail-bar { flex-wrap: wrap; justify-content: space-between; }
.detail-age { order: 3; flex: 1 1 100%; font-size: 11px; color: var(--text3); }
.detail-age:empty { display: none; }
.detail-age.bad { color: #ff8a80; }
.summary .expiry-tag { margin-left: 0 !important; margin-right: 4px; }
.detail-refresh { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; background: #111; border: 1px solid #222; border-radius: 8px; color: var(--text2); font-size: 11px; font-weight: 600; font-family: var(--font); padding: 7px 10px; cursor: pointer; -webkit-appearance: none; }
.detail-refresh:active { background: #1a1a1a; }
.detail-refresh:disabled { opacity: 0.5; cursor: default; }
.detail-refresh:disabled svg { animation: spin 0.9s linear infinite; }

/* Keep the last list row and detail content clear of the floating update button. */
#tab-analyzer { padding-bottom: 88px; }

/* ── v5.5 Live prices (live-prices.js) ── */
.scan-head-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; min-width: 0; }
.live-ind { font-size: 11px; color: var(--text3); white-space: nowrap; }
.live-ind[hidden] { display: none; }
.live-ind.live { color: var(--text2); }
.live-ind .live-dot { color: #34c759; font-size: 9px; vertical-align: 1px; }
.sr-ltp, .lp-ltp, .lp-chg { font-variant-numeric: tabular-nums; }
.lp-ltp { border-radius: 3px; }
.sr-ltp { border-radius: 3px; }
.lp-chg { color: var(--text3); }
.lp-chg.up { color: #34c759; }
.lp-chg.down { color: #ff3b30; }
.kv.live-prem[hidden] { display: none; }
.kv.live-prem .lp-ltp { color: var(--text); }
@keyframes lp-flash-up { from { background-color: rgba(52, 199, 89, 0.3); } to { background-color: transparent; } }
@keyframes lp-flash-down { from { background-color: rgba(255, 59, 48, 0.3); } to { background-color: transparent; } }
.lp-up { animation: lp-flash-up 0.6s ease-out; }
.lp-down { animation: lp-flash-down 0.6s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .lp-up, .lp-down { animation: none; }
}

/* ── v5.7 Plain Buy Call / Buy Put confidence ── */
/* List row: one small line under the % and grade tag, on its own grid row so
   the symbol / price / strategy columns keep their width. */
.scan-row.has-plain { row-gap: 3px; }
.sr-plain { grid-column: 1 / -1; justify-self: end; margin-top: -2px; font-size: 10px; color: var(--text3); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sr-plain .pl-pct { font-family: var(--mono); font-weight: 700; color: var(--text2); }
.pl-pct.g-best { color: #34c759; }
.pl-pct.g-better { color: #30b0c7; }
.pl-pct.g-good { color: #ffcc00; }
.pl-pct.g-no_trade { color: #8e8e93; }
/* Detail / Best Pick: two-column strip above the ideas. */
.plain-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.pl-cell { display: block; width: 100%; min-width: 0; text-align: left; background: #0a0a0a; border: 1px solid #1a1a1a; border-radius: 10px; padding: 9px 8px; font-family: var(--font); color: var(--text); -webkit-appearance: none; }
.pl-link { cursor: pointer; }
.pl-link:active { border-color: #333; background: #111; }
.pl-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pl-name { font-size: 12px; font-weight: 600; color: var(--text); }
.pl-cell .pl-pct { font-family: var(--mono); font-size: 14px; font-weight: 800; color: var(--text2); font-variant-numeric: tabular-nums; }
.pl-cell .grade { font-size: 9px; padding: 2px 5px; letter-spacing: 0.2px; }
.pl-sub { font-size: 11px; color: var(--text3); margin-top: 3px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-null { opacity: 0.6; }
@keyframes pl-flash { from { box-shadow: 0 0 0 2px #555; } to { box-shadow: 0 0 0 2px transparent; } }
.idea[data-plain] { scroll-margin-top: 10px; }
.idea.pl-flash { animation: pl-flash 1.2s ease-out; }
@media (prefers-reduced-motion: reduce) { .idea.pl-flash { animation: none; } }
.runner-plain { font-variant-numeric: tabular-nums; }

/* ── v5.8 Short-term trend (last 2 sessions; decides Call vs Put) ── */
/* List row: chip on the Call/Put line, left; summary under it on tap. */
.sr-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -2px; min-width: 0; }
.sr-foot .sr-plain { grid-column: auto; margin: 0 0 0 auto; }
.st-chip { display: inline-block; font-size: 10px; font-weight: 600; line-height: 1.2; padding: 1px 6px; border-radius: 5px; border: 1px solid #222; background: #111; color: var(--text3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-chip.st-up { color: #34c759; border-color: rgba(52, 199, 89, 0.3); }
.st-chip.st-down { color: #ff3b30; border-color: rgba(255, 59, 48, 0.3); }
.st-chip.st-sideways { color: var(--text2); }
.sr-trend { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sr-trend:focus-visible { outline: 1px solid #555; outline-offset: 1px; }
.sr-trend-sum { grid-column: 1 / -1; font-size: 11px; color: var(--text2); line-height: 1.35; overflow-wrap: anywhere; }
/* Detail: card under the Call/Put strip with the four votes. */
.st-card { background: #0a0a0a; border: 1px solid #1a1a1a; border-radius: 10px; padding: 10px; margin: 0 0 12px; }
.st-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-title { font-size: 12px; font-weight: 600; color: var(--text); }
.st-votes { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text3); }
.st-summary { font-size: 12px; color: var(--text2); margin-top: 5px; line-height: 1.4; }
.st-sigs { display: grid; gap: 4px; margin-top: 8px; }
.st-sig { display: grid; grid-template-columns: 14px minmax(0, auto) minmax(0, 1fr); gap: 6px; align-items: baseline; font-size: 11px; }
.st-vote { font-weight: 800; text-align: center; color: var(--text3); }
.st-vote.st-up { color: #34c759; }
.st-vote.st-down { color: #ff3b30; }
.st-sig-name { color: var(--text2); white-space: nowrap; }
.st-sig-detail { color: var(--text3); overflow-wrap: anywhere; }
