/* brain_terminal.css — AI Trading Terminal (Brain Sprint 8).
   Bloomberg × TradingView × Apple: dark, rounded, high-contrast, minimal.
   All classes are btt-/bt- prefixed; nothing here can restyle existing UI.
   Rides on the terminal's dark theme; local fallbacks keep it standalone. */

/* ------------------------------ layout ------------------------------ */
.btt { display: flex; flex-direction: column; gap: 14px; }
.btt-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 14px; align-items: start;
}
.btt-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.btt-tables { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 1100px) { .btt-grid { grid-template-columns: 1fr; } }

/* ------------------------------- cards ------------------------------- */
.bt-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 16px 18px;
  animation: bt-enter 0.35s ease-out both;
}
@keyframes bt-enter { from { opacity: 0; transform: translateY(6px); } }
.bt-card--fresh { box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.25); transition: box-shadow 0.4s; }
.bt-card.hidden { display: none; }
.bt-card__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.bt-card__title {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  opacity: 0.65;
}
.bt-card__hint {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35); opacity: 0.7;
}
.bt-empty { font-size: 13px; opacity: 0.55; padding: 4px 0; }
.bt-empty.ok { color: #2EE5C8; opacity: 0.9; }
.btt-foot { margin-top: 10px; font-size: 10.5px; opacity: 0.5; line-height: 1.5; }
.btt-sec {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  opacity: 0.6; margin: 12px 0 6px;
}
.btt-sec.risk { color: #ffb3b8; opacity: 0.95; }

@media (prefers-reduced-motion: reduce) {
  .bt-card, .bt-gauge__fill, .bt-meter__fill, .bt-prob__fill { animation: none !important; transition: none !important; }
}

/* ------------------------------- header ------------------------------- */
.btt-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(10px);
  background: rgba(13, 17, 23, 0.85);
}
.btt-h__row1 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.btt-h__symbol { font-size: 28px; font-weight: 800; letter-spacing: 0.02em; }
.btt-h__ltp { font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 700; }
.btt-h__chg { font-size: 15px; font-weight: 700; }
.btt-h__row2 { display: flex; gap: 14px; margin-top: 4px; font-size: 12px; opacity: 0.75; }
.btt-h__status.open { color: #2EE5C8; }
.btt-h__status.pre { color: #f0b90b; }
.btt-h__status.closed { color: #94a3b8; }
.pos { color: #2EE5C8; } .neg { color: #FF6B8A; }

/* --------------------------- decision badge --------------------------- */
.bt-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: 0.08em; border-radius: 12px;
  border: 1px solid transparent; white-space: nowrap;
}
.bt-badge.lg { font-size: 16px; padding: 10px 20px; }
.bt-badge.sm { font-size: 10px; padding: 2px 9px; border-radius: 6px; gap: 5px; }
.bt-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  animation: bt-pulse 2s ease-in-out infinite; }
.bt-badge.sm .bt-badge__dot { width: 5px; height: 5px; }
@keyframes bt-pulse { 50% { opacity: 0.35; } }
.bt-badge.strongbuy { background: rgba(46,229,200,.22); border-color: #2EE5C8; color: #d9ffe9; }
.bt-badge.buy       { background: rgba(46,229,200,.12); border-color: rgba(46,229,200,.55); color: #a7f3cf; }
.bt-badge.watch     { background: rgba(240,185,11,.12); border-color: rgba(240,185,11,.55); color: #ffe9ad; }
.bt-badge.wait      { background: rgba(148,163,184,.10); border-color: rgba(148,163,184,.4); color: #cbd5e1; }
.bt-badge.sell      { background: rgba(255,107,138,.12); border-color: rgba(255,107,138,.55); color: #ffc9cd; }
.bt-badge.strongsell{ background: rgba(255,107,138,.24); border-color: #FF6B8A; color: #ffe1e3; }

/* ------------------------------- gauges ------------------------------- */
.btt-gauges { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.btt-gauges__pair { display: flex; gap: 18px; justify-content: center; }
.bt-gauge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bt-gauge__stage { position: relative; width: 100%; }
.bt-gauge__svg { width: 100%; height: auto; display: block; }
.bt-gauge__track { stroke: rgba(148, 163, 184, 0.14); }
.bt-gauge__fill { transition: stroke-dashoffset 0.7s cubic-bezier(.22,1,.36,1), stroke 0.4s; }
.bt-gauge__fill.good { stroke: #2EE5C8; }
.bt-gauge__fill.mid  { stroke: #f0b90b; }
.bt-gauge__fill.low  { stroke: #FF6B8A; }
.bt-gauge__value {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace; font-weight: 800; font-size: 26px;
}
.bt-gauge.primary .bt-gauge__value { font-size: 34px; }
.bt-gauge__label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; opacity: 0.6; }

/* ------------------------------ mini meters ------------------------------ */
.btt-summary {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px 18px;
}
.bt-meter.na { opacity: 0.35; }
.bt-meter__top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.bt-meter__label { font-size: 11px; font-weight: 600; opacity: 0.75; }
.bt-meter__val { font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700; }
.bt-meter__track { height: 6px; border-radius: 4px; background: rgba(148,163,184,.12); overflow: hidden; }
.bt-meter__fill { height: 100%; border-radius: 4px; width: 0; transition: width .6s cubic-bezier(.22,1,.36,1); }
.bt-meter__fill.good { background: linear-gradient(90deg, #0FA98F, #2EE5C8); }
.bt-meter__fill.mid  { background: linear-gradient(90deg, #c99a09, #f0b90b); }
.bt-meter__fill.low  { background: linear-gradient(90deg, #b32e36, #FF6B8A); }

/* -------------------------------- WHY -------------------------------- */
.btt-why__title { font-size: 15px; font-weight: 800; letter-spacing: 0.05em; margin-bottom: 10px; }
.btt-why__title.pos { color: #2EE5C8; } .btt-why__title.neg { color: #FF6B8A; }
.btt-why__title.warn { color: #f0b90b; } .btt-why__title.flat { color: #cbd5e1; }
.btt-why__list { list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px; }
.btt-why__list li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.btt-why__check { font-weight: 800; }
.btt-why__check.pos { color: #2EE5C8; } .btt-why__check.neg { color: #FF6B8A; }
.btt-why__check.warn { color: #f0b90b; } .btt-why__check.flat { color: #94a3b8; }

/* ------------------------------ warnings ------------------------------ */
.btt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bt-chip {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.bt-chip.warn-info     { border-color: rgba(148,163,184,.45); color: #cbd5e1; }
.bt-chip.warn-caution  { border-color: rgba(240,185,11,.6); color: #ffe9ad; }
.bt-chip.warn-critical { border-color: #FF6B8A; color: #ffc9cd; }
.bt-chip.sig        { border-color: rgba(91,141,239,.5); color: #b9c8ff; }
.bt-chip.sig-strong { border-color: #5b8def; color: #dbe4ff; background: rgba(91,141,239,.12); }
.bt-chip.rr { border-color: rgba(46,229,200,.55); color: #a7f3cf; font-size: 11px; }
.bt-chip.pos { border-color: rgba(46,229,200,.55); color: #a7f3cf; }
.bt-chip.warn { border-color: rgba(240,185,11,.55); color: #ffe9ad; }
.bt-chip.flat { border-color: rgba(148,163,184,.45); color: #cbd5e1; }
.bt-chip.advice-pos { border-color: #2EE5C8; color: #d9ffe9; background: rgba(46,229,200,.14); font-size: 12px; }
.bt-chip.advice-neg { border-color: #f0b90b; color: #ffe9ad; background: rgba(240,185,11,.1); font-size: 12px; }
.btt-warnlist { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; opacity: 0.85; }

/* ------------------------------ reasoning ------------------------------ */
.btt-reasonlist { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.8; }
.btt-risklist { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; color: #ffc9cd; }
.btt-explain { margin: 0; font-size: 13px; line-height: 1.65; opacity: 0.9; }

/* ------------------------------ timeline ------------------------------ */
.btt-timeline { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.bt-tl { display: flex; gap: 12px; animation: bt-enter 0.3s ease-out both; }
.bt-tl__rail { display: flex; flex-direction: column; align-items: center; width: 20px; }
.bt-tl__icon { font-size: 12px; line-height: 20px; }
.bt-tl__line { flex: 1; width: 2px; background: rgba(148,163,184,.18); border-radius: 2px; }
.bt-tl:last-child .bt-tl__line { display: none; }
.bt-tl__body { padding-bottom: 14px; min-width: 0; }
.bt-tl__head { display: flex; gap: 10px; align-items: baseline; }
.bt-tl__ts { font-family: "JetBrains Mono", monospace; font-size: 11px; opacity: 0.6; }
.bt-tl__sym { font-size: 11px; font-weight: 700; opacity: 0.85; }
.bt-tl__txt { font-size: 13px; line-height: 1.45; margin-top: 2px; }
.bt-tl.decision   .bt-tl__icon { color: #2EE5C8; }
.bt-tl.confidence .bt-tl__icon { color: #5b8def; }
.bt-tl.target_hit .bt-tl__icon { color: #2EE5C8; }
.bt-tl.target_hit .bt-tl__txt  { color: #a7f3cf; font-weight: 600; }
.bt-tl.stop_risk  .bt-tl__icon { color: #FF6B8A; }
.bt-tl.stop_risk  .bt-tl__txt  { color: #ffc9cd; font-weight: 600; }
.bt-tl.warning    .bt-tl__icon { color: #f0b90b; }

/* ------------------------------ trade plan ------------------------------ */
.btt-plan__row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.btt-plan__row .k { opacity: 0.7; }
.btt-plan__row .v { font-family: "JetBrains Mono", monospace; font-weight: 700; }
.btt-plan__row.pos .v { color: #2EE5C8; } .btt-plan__row.neg .v { color: #FF6B8A; }
.btt-plan__sep { height: 1px; background: rgba(148,163,184,.14); margin: 8px 0; }
.btt-plan__rr { margin: 10px 0 4px; }
.btt-advice { margin: 4px 0 8px; }

/* price ladder */
.btt-ladder { position: relative; height: 34px; margin-top: 14px;
  border-top: 2px solid rgba(148,163,184,.2); }
.btt-ladder__pt { position: absolute; top: -5px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px; }
.btt-ladder__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.btt-ladder__lbl { font-size: 9px; font-weight: 800; opacity: 0.8; }
.btt-ladder__pt.pos { color: #2EE5C8; } .btt-ladder__pt.neg { color: #FF6B8A; }
.btt-ladder__pt.flat { color: #cbd5e1; }

/* ----------------------------- probability ----------------------------- */
.bt-prob { display: grid; grid-template-columns: 64px 1fr 44px; gap: 10px;
  align-items: center; padding: 5px 0; }
.bt-prob__label { font-size: 12px; opacity: 0.75; }
.bt-prob__track { height: 8px; border-radius: 5px; background: rgba(148,163,184,.12); overflow: hidden; }
.bt-prob__fill { height: 100%; border-radius: 5px; width: 0;
  transition: width .6s cubic-bezier(.22,1,.36,1); }
.bt-prob__fill.pos { background: linear-gradient(90deg,#0FA98F,#2EE5C8); }
.bt-prob__fill.neg { background: linear-gradient(90deg,#b32e36,#FF6B8A); }
.bt-prob__val { font-family: "JetBrains Mono", monospace; font-size: 12px;
  font-weight: 700; text-align: right; }

/* --------------------------- multi timeframe --------------------------- */
.btt-tfstrip { display: flex; gap: 8px; flex-wrap: wrap; }
.bt-tf { display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 44px; padding: 8px 6px; border-radius: 10px; border: 1px solid; }
.bt-tf.bull { border-color: rgba(46,229,200,.5); background: rgba(46,229,200,.1); color: #2EE5C8; }
.bt-tf.bear { border-color: rgba(255,107,138,.5); background: rgba(255,107,138,.1); color: #FF6B8A; }
.bt-tf.flat { border-color: rgba(148,163,184,.35); color: #94a3b8; }
.bt-tf__arrow { font-size: 13px; font-weight: 800; }
.bt-tf__label { font-size: 10px; font-weight: 700; opacity: 0.85; }

/* ---------------------------- market context ---------------------------- */
.btt-ctx__row { display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 13px; }
.btt-ctx__row .k { opacity: 0.7; }
.btt-ctx__row .v { font-family: "JetBrains Mono", monospace; font-weight: 700; }
.btt-breadth { position: relative; width: 130px; height: 16px; border-radius: 5px;
  background: rgba(255,107,138,.25); overflow: hidden; }
.btt-breadth__fill { height: 100%; background: rgba(46,229,200,.55); }
.btt-breadth__txt { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 800; }

/* ------------------------------- tables ------------------------------- */
.btt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.btt-table th { text-align: left; font-size: 10px; letter-spacing: 0.08em;
  opacity: 0.55; padding: 6px 10px; border-bottom: 1px solid rgba(148,163,184,.14); }
.btt-table td { padding: 8px 10px; border-bottom: 1px solid rgba(148,163,184,.07); }
.btt-table td.num { font-family: "JetBrains Mono", monospace; font-weight: 700; }
.btt-table td.sym { font-weight: 800; }
.btt-table td.rank { font-size: 15px; width: 40px; }
.btt-table td.sec { opacity: 0.7; }
.btt-rowlink { cursor: pointer; transition: background 0.15s; }
.btt-rowlink:hover { background: rgba(91,141,239,.08); }
.btt-tabs { display: flex; gap: 6px; margin-left: auto; }
.btt-tabs button {
  font-size: 10.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(148,163,184,.3); background: transparent;
  color: inherit; cursor: pointer; transition: all 0.15s;
}
.btt-tabs button.active { border-color: #5b8def; background: rgba(91,141,239,.14); color: #dbe4ff; }

/* ------------------------------ skeleton ------------------------------ */
.bt-skel { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.bt-skel__line { height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(148,163,184,.08) 25%,
    rgba(148,163,184,.18) 50%, rgba(148,163,184,.08) 75%);
  background-size: 200% 100%; animation: bt-shimmer 1.4s infinite; }
@keyframes bt-shimmer { to { background-position: -200% 0; } }

/* --------------------------- header search --------------------------- */
.btt-search { position: relative; }
.btt-search input {
  width: 220px; padding: 7px 12px 7px 30px; border-radius: 999px;
  border: 1px solid rgba(148,163,184,.25); background: rgba(255,255,255,.04);
  color: inherit; font-size: 12px; outline: none; transition: all .2s;
}
.btt-search input:focus { width: 280px; border-color: #5b8def; }
.btt-search::before { content: "🔍"; position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); font-size: 11px; opacity: .6; }

/* EOD-cache analysis indicator (integration fix) */
.btt-eod {
  margin-top: 8px; text-align: center; font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(240,185,11,.55); color: #ffe9ad;
  background: rgba(240,185,11,.08);
}

/* Tomorrow's AI Watchlist (Sprint 9) */
.btt-livechip { margin-left: 8px; font-size: 8px; padding: 1px 6px; vertical-align: 2px; }

/* TradingView chart links (workflow: AI pick -> verify chart -> trade) */
.bt-tv { text-decoration: none; font-size: 13px; opacity: 0.75; transition: opacity .15s; }
.bt-tv:hover { opacity: 1; }
.bt-tv.big {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(91,141,239,.55); color: #dbe4ff;
  background: rgba(91,141,239,.10); opacity: 1;
}
.bt-tv.big:hover { background: rgba(91,141,239,.22); }
.btt-table td.tv { width: 30px; text-align: center; }
