:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #162033;
  --muted: #6d7788;
  --line: #dce3ec;
  --blue: #006fb9;
  --red: #f23b2e;
  --green: #15945b;
  --orange: #d97706;
  --purple: #7c3aed;
  --shadow: 0 10px 28px rgba(24, 39, 75, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1500px; margin: 0 auto; padding: 18px; }
.topbar {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 4px 4px 14px;
}
h1 { margin: 0; font-size: 29px; letter-spacing: -0.6px; }
.blue { color: var(--blue); }
.red { color: var(--red); }
.muted { color: #758096; }
.subtitle { color: var(--muted); margin-top: 4px; font-size: 13px; }
.connection-box {
  display: flex; align-items: center; gap: 10px; min-width: 260px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
}
.connection-box strong, .connection-box small { display: block; }
.connection-box small { color: var(--muted); margin-top: 2px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #9aa4b2; box-shadow: 0 0 0 4px rgba(154,164,178,.15); }
.status-dot.live { background: var(--green); box-shadow: 0 0 0 4px rgba(21,148,91,.15); }
.status-dot.demo { background: var(--orange); box-shadow: 0 0 0 4px rgba(217,119,6,.15); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px rgba(242,59,46,.15); }
.quote-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.quote-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; box-shadow: var(--shadow);
}
.quote-card span, .quote-card small { display: block; color: var(--muted); }
.quote-card strong { display: block; font-size: 28px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.futures-card strong { color: var(--blue); }
.index-card strong { color: var(--red); }
.basis-card strong { color: var(--purple); }
.volume-card strong { color: var(--green); }
.alert-card.near { border-color: #f59e0b; background: #fffbeb; }
.alert-card.hit { border-color: var(--red); background: #fff1f2; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 rgba(242,59,46,0); } to { box-shadow: 0 0 18px rgba(242,59,46,.24); } }
.levels-panel, .chart-panel, .settings-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.levels-panel { padding: 12px; margin-bottom: 12px; }
.levels-grid { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)) auto; gap: 9px; align-items: end; }
.level-input { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: #fbfcfe; }
.level-input span { display: block; font-size: 12px; font-weight: 800; margin-bottom: 3px; }
.level-input input { width: 100%; border: 0; outline: 0; background: transparent; font-weight: 700; font-variant-numeric: tabular-nums; }
.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 9px; padding: 9px 13px; border: 1px solid transparent; transition: .15s ease;
}
.primary-btn { background: #0b6aa7; color: #fff; font-weight: 700; }
.primary-btn:hover { background: #075a8e; }
.secondary-btn { background: #eef5fb; color: #075d94; border-color: #c9dfef; font-weight: 650; }
.ghost-btn { background: #fff; color: #4b5563; border-color: var(--line); }
.compact { padding: 6px 9px; font-size: 12px; }
.level-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 13px; }
.level-tools input { width: 72px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; }
.pivot-box { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; margin-top: 10px; padding: 10px; background: #f8fafc; border-radius: 10px; border: 1px dashed #cbd5e1; }
.pivot-box label { color: var(--muted); font-size: 12px; }
.pivot-box input { display: block; width: 135px; margin-top: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.hidden { display: none !important; }
.chart-panel { overflow: hidden; }
.chart-toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); gap: 10px; }
.legend, .toolbar-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.legend span { font-size: 13px; }
.legend-line { display: inline-block; width: 24px; height: 3px; border-radius: 3px; vertical-align: middle; margin-right: 5px; }
.legend-candle {
  display: inline-block; width: 9px; height: 15px; border-radius: 1px;
  vertical-align: middle; margin: 0 7px 0 2px; position: relative;
}
.legend-candle::before {
  content: ""; position: absolute; left: 4px; top: -4px; bottom: -4px; width: 1px; background: currentColor; z-index: 0;
}
.legend-candle.candle-up { background: #16a36b; color: #16a36b; border: 1px solid #16a36b; }

.futures-line { background: var(--blue); }
.index-line { background: var(--red); }
.volume-ma-line { background: var(--orange); }
.legend-volume { display: inline-block; width: 10px; height: 12px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.volume-up { background: rgba(22, 163, 107, .65); }
.range-btn { border: 0; background: transparent; color: var(--muted); padding: 6px 8px; border-radius: 7px; }
.range-btn.active { background: #e8f2f9; color: #075d94; font-weight: 700; }
.chart-wrap { position: relative; height: min(68vh, 720px); min-height: 500px; background: #fff; }
#chart { display: block; width: 100%; height: 100%; user-select: none; }
.chart-wrap { cursor: crosshair; touch-action: none; }
.chart-wrap.is-panning { cursor: grabbing; }
.zoom-btn { min-width: 34px; font-size: 17px; font-weight: 800; line-height: 1; }
.view-window-label {
  display: inline-flex; align-items: center; min-height: 29px; padding: 4px 8px;
  border: 1px solid #d8e1e8; border-radius: 8px; background: #f8fafc;
  color: #475569; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chart-mode-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 29px; padding: 4px 9px;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155;
  font-size: 12px; font-weight: 700; cursor: pointer; user-select: none; white-space: nowrap;
}
.chart-mode-toggle:hover { background: #f8fafc; border-color: #94a3b8; }
.chart-mode-toggle input { width: 15px; height: 15px; margin: 0; accent-color: #0b6aa7; cursor: pointer; }
.legend-line.future-line-icon { background: var(--blue); }
.tooltip { position: absolute; z-index: 3; pointer-events: none; min-width: 170px; padding: 8px 10px; border-radius: 8px; background: rgba(17,24,39,.92); color: white; font-size: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.tooltip strong { display: inline-block; min-width: 78px; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.settings-panel { margin-top: 12px; padding: 12px; }
.settings-row { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.settings-row label, .credentials-grid label { color: var(--muted); font-size: 12px; }
.settings-row input, .credentials-grid input { display: block; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; min-width: 190px; }
details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 700; color: #334155; }
.credentials-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 10px; }
.credentials-grid input { width: 100%; }
.note { color: var(--muted); font-size: 12px; }
footer { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; padding: 10px 3px 0; }
@media (max-width: 1150px) {
  .quote-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 950px) {
  .quote-strip { grid-template-columns: repeat(2, 1fr); }
  .levels-grid { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .connection-box { width: 100%; }
  .credentials-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .app-shell { padding: 8px; }
  .quote-strip { grid-template-columns: 1fr 1fr; gap: 7px; }
  .quote-card strong { font-size: 22px; }
  .levels-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-wrap { min-height: 470px; height: 68vh; }
  .chart-toolbar { align-items: flex-start; flex-direction: column; }
}

.source-note {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.source-note strong { color: #075d94; }

.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-logo {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(145deg, #075d94, #008acb); color: #fff; font-size: 18px;
  font-weight: 900; box-shadow: 0 7px 17px rgba(0,111,185,.24); flex: 0 0 auto;
}
.chart-wrap:fullscreen { width: 100vw; height: 100vh; min-height: 100vh; background: #fff; }
.chart-wrap:fullscreen #chart { background: #fff; }
code { font-family: Consolas, "Courier New", monospace; font-size: 11px; color: #334155; }
@media (min-width: 1200px) {
  .app-shell { padding-top: 14px; }
  .chart-wrap { height: calc(100vh - 390px); min-height: 500px; max-height: 780px; }
}


.futures-card.missing-data {
  border-color: #f59e0b;
  background: #fffaf0;
}
.futures-card.missing-data strong { color: #b45309; }
.partial-state {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 8px 12px;
  border: 1px solid #f2c46d;
  border-radius: 8px;
  background: rgba(255, 248, 230, 0.96);
  color: #8a4b08;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(80, 50, 10, 0.12);
  pointer-events: none;
}


.analysis-panel {
  margin-top: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.analysis-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; margin-bottom:12px; }
.analysis-head h2 { margin:0 0 4px; font-size:17px; color:#0f3550; }
.analysis-head p { margin:0; color:var(--muted); font-size:12px; }
.analysis-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.auto-analysis-toggle { display:flex; gap:6px; align-items:center; font-size:12px; color:#475569; }
.analysis-layout { display:grid; grid-template-columns:minmax(320px,.9fr) minmax(420px,1.4fr); gap:12px; }
.analysis-summary { min-height:150px; border:1px solid #cfe0ec; background:#f7fbfe; border-radius:11px; padding:12px; font-size:13px; line-height:1.55; color:#263746; }
.analysis-summary .analysis-title { font-weight:800; color:#075d94; margin-bottom:7px; }
.analysis-summary ul { margin:6px 0 0 18px; padding:0; }
.analysis-summary li { margin:4px 0; }
.analysis-tag { display:inline-block; border-radius:999px; padding:3px 8px; margin:0 5px 5px 0; font-size:11px; font-weight:700; background:#e8f2f9; color:#075d94; }
.analysis-tag.positive { background:#e9f8f1; color:#087f5b; }
.analysis-tag.negative { background:#fff0f0; color:#b42318; }
.analysis-tag.warning { background:#fff7e6; color:#9a5b00; }
.quick-prompts { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.quick-prompts button { border:1px solid #d6e2ea; background:#fff; color:#475569; border-radius:999px; padding:6px 9px; font-size:11px; }
.quick-prompts button:hover { background:#eef6fb; color:#075d94; }
.chat-box { border:1px solid var(--line); border-radius:11px; overflow:hidden; background:#fff; display:flex; flex-direction:column; min-height:238px; }
.chat-messages { height:320px; overflow:auto; padding:10px; background:#fbfcfe; }
.chat-message { max-width:92%; margin:0 0 8px; padding:10px 12px; border-radius:10px; font-size:12px; line-height:1.55; white-space:pre-line; overflow-wrap:anywhere; }
.chat-message.assistant { background:#eaf4fb; color:#173b52; border-bottom-left-radius:3px; }
.chat-message.user { margin-left:auto; background:#075d94; color:#fff; border-bottom-right-radius:3px; }
.chat-message small { display:block; opacity:.65; margin-top:4px; font-size:10px; }
.chat-form { display:grid; grid-template-columns:1fr auto; gap:7px; padding:8px; border-top:1px solid var(--line); }
.chat-form input { border:1px solid var(--line); border-radius:8px; padding:9px; min-width:0; }
.analysis-disclaimer { margin-top:9px; color:#7b8794; font-size:10.5px; }
@media (max-width: 1000px) { .analysis-layout { grid-template-columns:1fr; } .analysis-head { flex-direction:column; } }

/* Bản 3.5.1 · nến 1 phút · zoom và kéo ngang */
.alert-only-box { min-height: 220px; }
.alert-messages { height: 220px; }
.alert-messages .chat-message.assistant { max-width: 96%; border-left: 4px solid #d97706; background: #fff8e8; color: #573a00; }


/* Bản 3.6.1 · Biểu đồ VN30F1M 30 phiên + chat đọc nến */
.history30-panel {
  margin-top: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.history30-head {
  min-height: 62px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 11px 13px; border-bottom: 1px solid var(--line);
}
.history30-head h2 { margin: 0 0 4px; font-size: 17px; color: #0f3550; }
.history30-head p { margin: 0; color: var(--muted); font-size: 12px; }
.history30-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.history30-status {
  display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px;
  border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 700;
}
.history30-status.loading { background: #fff7e6; color: #9a5b00; }
.history30-status.ok { background: #e9f8f1; color: #087f5b; }
.history30-status.error { background: #fff0f0; color: #b42318; }
.history30-body { padding: 10px 12px 11px; }
.history30-chart-wrap {
  position: relative; height: min(50vh, 520px); min-height: 360px; background: #fff;
  border: 1px solid #e3eaf0; border-radius: 10px; overflow: hidden; cursor: crosshair;
}
#history30Chart { display: block; width: 100%; height: 100%; user-select: none; }
.history30-note { margin-top: 7px; color: #718096; font-size: 10.5px; line-height: 1.45; }
@media (max-width: 800px) {
  .history30-head { align-items: flex-start; flex-direction: column; }
  .history30-actions { justify-content: flex-start; }
  .history30-chart-wrap { min-height: 330px; height: 48vh; }
}

/* 3.6.1: lệnh chat đọc nến theo yêu cầu */
.candle-prompts { padding:8px 9px 2px; margin-top:0; border-top:1px solid var(--line); background:#fff; }
.candle-prompts button { cursor:pointer; }
.alert-only-box .chat-form { background:#fff; }
.alert-only-box .chat-form .primary-btn { min-width:88px; }
.chat-message.assistant.manual-analysis { border-left:4px solid #075d94; background:#edf7fd; color:#173b52; }
@media (max-width:640px) { .chat-form { grid-template-columns:1fr; } .alert-only-box .chat-form .primary-btn { width:100%; } }


/* Bản 3.6.2 · F1M / VN30 / VN-Index ẩn hiện độc lập */
.vnindex-line { background: #7c3aed; }
.vnindex-card strong { color: #7c3aed; }
.series-toggles { display:inline-flex; align-items:center; gap:4px; padding:3px 5px; border:1px solid #cbd5e1; border-radius:8px; background:#f8fafc; white-space:nowrap; }
.series-toggles label { display:inline-flex; align-items:center; gap:4px; padding:2px 5px; font-size:11px; font-weight:700; color:#334155; cursor:pointer; }
.series-toggles input { width:14px; height:14px; margin:0; cursor:pointer; }
#showFutures { accent-color:#006fb9; }
#showVn30 { accent-color:#ef4444; }
#showVnindex { accent-color:#7c3aed; }
@media (max-width:720px) { .series-toggles { flex-wrap:wrap; } }

/* Bản 3.6.5 · PP/R/S riêng và đồng màu cho F1M, VN30 và VN-Index */
.levels-panel-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px;
}
.levels-panel-head h2 { margin:0 0 3px; font-size:16px; color:#0f3550; }
.levels-panel-head p { margin:0; color:var(--muted); font-size:11.5px; line-height:1.45; }
.level-series-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.level-series-card { border:1px solid var(--line); border-radius:11px; padding:9px; background:#fbfcfe; min-width:0; }
.level-series-card.futures-level-card { border-top:3px solid #006fb9; }
.level-series-card.vn30-level-card { border-top:3px solid #ef4444; }
.level-series-card.vnindex-level-card { border-top:3px solid #7c3aed; }
.level-series-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
.level-series-head > div { display:flex; flex-direction:column; min-width:0; }
.level-series-head strong { font-size:13px; color:#1f3344; }
.level-series-head small { font-size:10px; color:var(--muted); }
.level-visibility-toggle { display:inline-flex; align-items:center; gap:5px; padding:4px 7px; border:1px solid #d4dee7; border-radius:999px; background:#fff; font-size:10.5px; font-weight:700; color:#334155; cursor:pointer; white-space:nowrap; }
.level-visibility-toggle input { margin:0; width:14px; height:14px; cursor:pointer; }
#showLevelsFutures { accent-color:#006fb9; }
#showLevelsVn30 { accent-color:#ef4444; }
#showLevelsVnindex { accent-color:#7c3aed; }
.levels-grid-series { grid-template-columns:repeat(5,minmax(56px,1fr)); gap:6px; }
.levels-grid-series .level-input { padding:6px 7px; }
.levels-grid-series .level-input span { font-size:10.5px; }
.levels-grid-series .level-input input { min-width:0; font-size:12px; }
.pivot-box select { display:block; min-width:130px; margin-top:3px; padding:7px; border:1px solid var(--line); border-radius:7px; background:#fff; }
@media (max-width:1180px) { .level-series-list { grid-template-columns:1fr; } }
@media (max-width:700px) {
  .levels-panel-head { flex-direction:column; }
  .levels-panel-head .primary-btn { width:100%; }
  .levels-grid-series { grid-template-columns:repeat(5,minmax(48px,1fr)); }
  .level-series-head { align-items:flex-start; flex-direction:column; }
}
@media (max-width:470px) {
  .levels-grid-series { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 720px) { .chat-messages { height:380px; } .chat-message { max-width:98%; } }


/* Bản 3.6.5 · PP/R/S đồng màu với từng chuỗi; phân biệt mức bằng kiểu nét */
.level-style-guide {
  display:flex; align-items:center; flex-wrap:wrap; gap:7px 11px; margin-top:7px;
  color:#475569; font-size:10.5px; font-weight:700;
}
.level-style-guide > span { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
.series-key i { width:18px; height:3px; border-radius:3px; display:inline-block; }
.futures-key i { background:#006fb9; }
.vn30-key i { background:#ef4444; }
.vnindex-key i { background:#7c3aed; }
.level-pattern i { width:22px; height:0; display:inline-block; border-top:2px solid #64748b; }
.level-pattern.r-pattern i { border-top-style:dashed; }
.level-pattern.s-pattern i { border-top-style:dotted; }
.level-pattern.pp-pattern i { border-top-width:3px; }
.futures-level-card .level-input span { color:#006fb9; }
.vn30-level-card .level-input span { color:#ef4444; }
.vnindex-level-card .level-input span { color:#7c3aed; }
.futures-level-card .level-input:focus-within { border-color:#006fb9; box-shadow:0 0 0 2px rgba(0,111,185,.10); }
.vn30-level-card .level-input:focus-within { border-color:#ef4444; box-shadow:0 0 0 2px rgba(239,68,68,.10); }
.vnindex-level-card .level-input:focus-within { border-color:#7c3aed; box-shadow:0 0 0 2px rgba(124,58,237,.10); }
.level-series-card .level-input.pp { border-width:2px; }
.level-series-card .level-input.r1,
.level-series-card .level-input.r2 { border-style:dashed; }
.level-series-card .level-input.s1,
.level-series-card .level-input.s2 { border-style:dotted; }


/* 3.6.6: chế độ hiển thị mức gọn */
.level-mode-select {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:3px 6px;
  border:1px solid #d4dee7;
  border-radius:8px;
  background:#fff;
  color:#475569;
  font-size:10.5px;
  font-weight:800;
  white-space:nowrap;
}
.level-mode-select select {
  border:0;
  outline:0;
  background:transparent;
  color:#0f3550;
  font-size:10.5px;
  font-weight:800;
  cursor:pointer;
}
.level-display-hint {
  padding:5px 10px 6px;
  border-top:1px solid #eef2f6;
  background:#fbfcfe;
  color:#64748b;
  font-size:10.5px;
  line-height:1.35;
}
@media (max-width: 900px) {
  .level-display-hint { font-size:10px; }
}


/* 3.7.0 - Dấu chân dòng tiền lớn */
.whale-panel { margin-top:12px; padding:14px; background:var(--panel); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.whale-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
.whale-head h2 { margin:0 0 4px; font-size:17px; color:#0f3550; }
.whale-head p { margin:0; color:var(--muted); font-size:11.5px; line-height:1.45; }
.whale-overview { display:grid; grid-template-columns:minmax(250px,1.6fr) repeat(5,minmax(105px,.72fr)); gap:8px; }
.whale-main-card,.whale-metric { border:1px solid #dce6ed; border-radius:10px; background:#fbfdff; padding:10px; min-width:0; }
.whale-main-card span,.whale-metric span { display:block; font-size:10.5px; color:#64748b; margin-bottom:4px; }
.whale-main-card strong { display:block; font-size:14px; line-height:1.3; }
.whale-main-card small,.whale-metric small { display:block; margin-top:5px; color:#718096; font-size:9.8px; line-height:1.35; }
.whale-metric strong { display:block; font-size:14px; color:#1f3342; overflow-wrap:anywhere; }
.whale-score.positive,.whale-behavior.positive { color:#087f5b; }
.whale-score.negative,.whale-behavior.negative { color:#b42318; }
.whale-score.warning,.whale-behavior.warning { color:#9a5b00; }
.whale-details { display:grid; grid-template-columns:minmax(300px,1.4fr) minmax(330px,1fr); gap:10px; margin-top:9px; }
.whale-details > ul { margin:0; padding:10px 10px 10px 28px; border:1px solid #e4ebf0; border-radius:10px; background:#fff; font-size:11.5px; line-height:1.5; color:#324a5b; }
.whale-details > ul li { margin:3px 0; }
.oi-manual-box { display:grid; grid-template-columns:minmax(160px,1.5fr) minmax(100px,.7fr) minmax(100px,.7fr) auto; gap:7px; align-items:end; border:1px solid #e4ebf0; border-radius:10px; background:#fff; padding:9px; }
.oi-manual-box > div strong { display:block; font-size:11.5px; color:#334155; }
.oi-manual-box > div small { display:block; color:#7b8794; font-size:9.5px; line-height:1.35; margin-top:3px; }
.oi-manual-box label { font-size:10px; color:#64748b; }
.oi-manual-box input { width:100%; box-sizing:border-box; margin-top:3px; border:1px solid var(--line); border-radius:7px; padding:7px; }
.whale-note { margin-top:8px; color:#7b8794; font-size:9.8px; }
@media (max-width:1100px) { .whale-overview { grid-template-columns:repeat(3,1fr); } .whale-main-card { grid-column:span 3; } .whale-details { grid-template-columns:1fr; } }
@media (max-width:640px) { .whale-head { flex-direction:column; } .whale-overview { grid-template-columns:1fr 1fr; } .whale-main-card { grid-column:span 2; } .oi-manual-box { grid-template-columns:1fr 1fr; } .oi-manual-box > div { grid-column:span 2; } }


/* 3.7.1 · ONE-SCREEN DESKTOP: chart + whale + chat trong cùng một viewport */
.topbar-quick-actions { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.whale-head-actions { display:flex; align-items:center; gap:5px; flex-wrap:wrap; justify-content:flex-end; }
.dashboard-workspace { display:block; }
.workspace-chart, .workspace-side { min-width:0; }
.whale-panel.show-details .whale-details { display:grid; }

@media (min-width: 1100px) {
  .app-shell { max-width:1920px; padding:7px 10px 8px; }
  .topbar { gap:8px; padding:0 0 6px; align-items:center; }
  .brand-block { gap:8px; flex:1 1 auto; }
  .app-logo { width:34px; height:34px; border-radius:9px; font-size:14px; }
  h1 { font-size:21px; letter-spacing:-.35px; }
  .subtitle { display:none; }
  .connection-box { min-width:205px; max-width:285px; padding:5px 8px; border-radius:8px; gap:7px; }
  .connection-box strong { font-size:11px; }
  .connection-box small { max-width:235px; font-size:9px; }
  .status-dot { width:9px; height:9px; }
  .topbar-quick-actions .ghost-btn { padding:5px 7px; font-size:10px; }

  .quote-strip { grid-template-columns:repeat(6,minmax(0,1fr)); gap:5px; margin-bottom:6px; }
  .quote-card { padding:5px 7px; border-radius:8px; box-shadow:none; min-height:53px; }
  .quote-card span, .quote-card small { font-size:9px; line-height:1.15; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .quote-card strong { font-size:19px; line-height:1.05; margin:2px 0 1px; }

  .dashboard-workspace {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(365px,27vw);
    gap:6px;
    height:calc(100vh - 103px);
    min-height:590px;
    overflow:hidden;
  }
  .workspace-chart { height:100%; min-height:0; }
  .workspace-chart > .chart-panel { height:100%; min-height:0; display:flex; flex-direction:column; border-radius:10px; box-shadow:none; }
  .chart-toolbar { min-height:35px; padding:4px 7px; gap:5px; }
  .legend, .toolbar-actions { gap:5px 7px; }
  .legend span { font-size:10px; }
  .legend-line { width:17px; }
  .range-btn { padding:3px 5px; font-size:9.5px; }
  .view-window-label, .chart-mode-toggle, .series-toggles, .level-mode-select { min-height:23px; padding:2px 5px; font-size:9.5px; border-radius:6px; }
  .series-toggles label { font-size:9.5px; padding:1px 3px; }
  .series-toggles input, .chart-mode-toggle input { width:12px; height:12px; }
  .toolbar-actions .ghost-btn.compact { padding:3px 5px; font-size:9.5px; min-width:auto; }
  .toolbar-actions .zoom-btn { font-size:13px; }
  .level-display-hint { display:none; }
  .chart-wrap { flex:1 1 auto; height:auto !important; min-height:0 !important; max-height:none !important; }

  .workspace-side { display:grid; grid-template-rows:auto minmax(0,1fr); gap:6px; height:100%; min-height:0; overflow:hidden; }
  .whale-panel, .analysis-panel { margin:0; padding:7px; border-radius:10px; box-shadow:none; min-height:0; }
  .whale-head, .analysis-head { margin-bottom:5px; gap:6px; align-items:center; }
  .whale-head h2, .analysis-head h2 { margin:0; font-size:12.5px; }
  .whale-head p, .analysis-head p, .whale-note, .analysis-disclaimer { display:none; }
  .whale-head-actions .compact, .analysis-actions .compact { padding:3px 5px; font-size:9px; }
  .whale-overview { grid-template-columns:minmax(145px,1.55fr) repeat(2,minmax(72px,1fr)); gap:4px; }
  .whale-main-card { grid-row:span 2; }
  .whale-main-card, .whale-metric { padding:5px; border-radius:7px; }
  .whale-main-card span, .whale-metric span { font-size:8.5px; margin-bottom:1px; }
  .whale-main-card strong, .whale-metric strong { font-size:11.5px; line-height:1.15; }
  .whale-main-card small, .whale-metric small { margin-top:2px; font-size:7.7px; line-height:1.2; }
  .whale-details { display:none; grid-template-columns:1fr; gap:4px; margin-top:5px; max-height:125px; overflow:auto; }
  .whale-details > ul { padding:5px 6px 5px 20px; font-size:9px; line-height:1.25; border-radius:7px; }
  .whale-details > ul li { margin:1px 0; }
  .oi-manual-box { padding:5px; gap:4px; grid-template-columns:1fr 62px 62px auto; }
  .oi-manual-box > div strong { font-size:9.5px; }
  .oi-manual-box > div small { display:none; }
  .oi-manual-box label { font-size:8.5px; }
  .oi-manual-box input { padding:4px; font-size:9px; }

  .analysis-panel { display:flex; flex-direction:column; overflow:hidden; }
  .analysis-head { flex:0 0 auto; }
  .chat-box.alert-only-box { flex:1 1 auto; min-height:0; border-radius:8px; }
  .chat-messages.alert-messages { height:auto; flex:1 1 auto; min-height:0; padding:5px; overflow:auto; }
  .chat-message { max-width:98%; margin:0 0 4px; padding:5px 6px; border-radius:7px; font-size:9.6px; line-height:1.3; }
  .chat-message small { margin-top:2px; font-size:8px; }
  .quick-prompts.candle-prompts { padding:4px 4px 2px; gap:3px; }
  .quick-prompts button { padding:3px 5px; font-size:8.7px; }
  .chat-form { grid-template-columns:1fr auto; gap:4px; padding:4px; }
  .chat-form input { padding:5px 6px; font-size:9.5px; border-radius:6px; }
  .chat-form .primary-btn { min-width:0; padding:5px 7px; font-size:9.5px; border-radius:6px; }

  .history30-panel, .levels-panel, .settings-panel { margin-top:6px; box-shadow:none; }
  footer { display:none; }
}

@media (max-width:1099px) {
  .dashboard-workspace { display:block; }
  .workspace-side { display:block; }
  .workspace-side .whale-panel, .workspace-side .analysis-panel { margin-top:12px; }
  .topbar-quick-actions { width:100%; }
}

/* 3.7.1 fine-tune: 1 main signal card + 5 compact metrics in two rows */
@media (min-width:1100px) {
  .whale-overview { grid-template-columns:minmax(135px,1.5fr) repeat(3,minmax(58px,1fr)); }
  .whale-main-card { grid-column:auto; grid-row:span 2; }
}


/* 3.8.0 · BIG VOL STATE MACHINE */
.whale-main-card strong { font-weight:900; }
.whale-main-card small { font-weight:600; }
@media (min-width:1100px) {
  .whale-main-card { border-left:4px solid #d97706; }
}


/* 3.8.2 · BIG VOL RESEARCH JOURNAL */
.research-action-long { border-color:#86efac !important; color:#15803d !important; }
.research-action-short { border-color:#fca5a5 !important; color:#b91c1c !important; }
.research-modal { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; padding:18px; }
.research-modal.hidden { display:none; }
.research-modal-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.52); backdrop-filter:blur(2px); }
.research-modal-card { position:relative; width:min(1540px,97vw); max-height:92vh; overflow:hidden; background:#fff; border:1px solid #cbd5e1; border-radius:14px; box-shadow:0 24px 80px rgba(15,23,42,.28); display:flex; flex-direction:column; }
.research-modal-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:14px 16px 10px; border-bottom:1px solid #e2e8f0; }
.research-modal-head h2 { margin:0; font-size:15px; color:#0f172a; }
.research-modal-head p { margin:4px 0 0; font-size:11.5px; color:#64748b; }
.research-modal-actions { display:flex; gap:6px; }
.research-summary { padding:8px 16px; background:#f8fafc; color:#475569; font-size:12px; border-bottom:1px solid #e2e8f0; }
.research-table-wrap { overflow:auto; flex:1; }
.research-table { width:100%; border-collapse:separate; border-spacing:0; font-size:11px; white-space:nowrap; }
.research-table th { position:sticky; top:0; z-index:2; background:#f1f5f9; color:#475569; font-weight:800; padding:7px 8px; border-bottom:1px solid #cbd5e1; text-align:left; }
.research-table td { padding:6px 8px; border-bottom:1px solid #eef2f7; color:#334155; vertical-align:middle; }
.research-table tr:hover td { background:#f8fafc; }
.research-table tr.selected td { background:#fff7ed; }
.research-table .long { color:#15803d; font-weight:800; }
.research-table .short { color:#b91c1c; font-weight:800; }
.research-table .pending { color:#b45309; font-weight:800; }
.research-table input { min-width:150px; max-width:240px; border:1px solid #cbd5e1; border-radius:6px; padding:4px 6px; font-size:11px; }
.research-help { padding:8px 16px; border-top:1px solid #e2e8f0; background:#fffbeb; color:#92400e; font-size:11px; }
.bigvol-hit { cursor:pointer; }
/* VN30F1M 3.8.2 · MOBILE FOCUS PATCH */
.mobile-bottom-nav{display:none}.mobile-landscape-btn{display:none}
@media(max-width:720px){
html,body{width:100%;overflow-x:hidden}body{padding-bottom:calc(66px + env(safe-area-inset-bottom))}.app-shell{padding:6px 6px 10px;max-width:none}
.topbar{padding:2px 2px 6px;gap:5px;flex-direction:row;align-items:center;flex-wrap:wrap}.brand-block{gap:7px;flex:1 1 auto}.app-logo{width:31px;height:31px;border-radius:8px;font-size:12px}h1{font-size:18px;letter-spacing:-.3px}.subtitle{display:none}.connection-box{order:3;min-width:0;width:100%;padding:5px 8px;border-radius:8px;gap:6px;box-shadow:none}.connection-box strong{font-size:10.5px}.connection-box small{font-size:8.5px;max-width:calc(100vw - 52px)}.status-dot{width:8px;height:8px}.topbar-quick-actions{width:auto;margin-left:auto;gap:3px;flex-wrap:nowrap}.topbar-quick-actions .ghost-btn{padding:4px 5px;font-size:9px;border-radius:6px}
.quote-strip{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-bottom:5px}.quote-card{padding:5px;min-height:48px;border-radius:7px;box-shadow:none}.quote-card span,.quote-card small{font-size:8px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quote-card strong{font-size:16px;line-height:1.05;margin:2px 0 1px}.volume-card,.alert-card{display:none}
.dashboard-workspace{display:block;margin:0}.workspace-chart,.workspace-side{min-width:0;width:100%}.workspace-side .whale-panel,.workspace-side .analysis-panel{margin:0}.chart-panel,.whale-panel,.analysis-panel{border-radius:9px;box-shadow:none}
body:not(.mobile-view-shark):not(.mobile-view-chat) .workspace-side{display:none!important}body.mobile-view-shark .workspace-chart{display:none!important}body.mobile-view-shark .analysis-panel{display:none!important}body.mobile-view-shark .workspace-side{display:block!important}body.mobile-view-shark .whale-panel{display:block!important}body.mobile-view-chat .workspace-chart{display:none!important}body.mobile-view-chat .whale-panel{display:none!important}body.mobile-view-chat .workspace-side{display:block!important}body.mobile-view-chat .analysis-panel{display:flex!important}
.chart-toolbar{min-height:0;padding:5px;gap:4px;flex-direction:column;align-items:stretch;border-bottom:1px solid #e7edf3}.legend{gap:4px 8px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:1px 0 3px}.legend::-webkit-scrollbar,.toolbar-actions::-webkit-scrollbar{display:none}.legend span{font-size:10px;white-space:nowrap;flex:0 0 auto}.legend span:nth-child(4),.legend span:nth-child(5){display:none}.legend-line{width:17px}.toolbar-actions{display:flex;flex-wrap:nowrap;gap:4px;overflow-x:auto;padding:1px 0 2px;scrollbar-width:none}.toolbar-actions>*{flex:0 0 auto}.range-btn{padding:4px 6px;font-size:10px}.view-window-label,.chart-mode-toggle,.series-toggles,.level-mode-select{min-height:28px;padding:3px 6px;font-size:10px;border-radius:7px}.series-toggles{gap:3px;flex-wrap:nowrap}.series-toggles label{padding:1px 2px;font-size:10px;white-space:nowrap}.series-toggles input,.chart-mode-toggle input{width:13px;height:13px}.toolbar-actions .ghost-btn.compact{padding:4px 7px;min-height:28px;font-size:10px}.toolbar-actions .zoom-btn,#resetZoom{display:none}.mobile-landscape-btn{display:inline-flex!important;align-items:center;justify-content:center;border:1px solid #0ea5e9;background:#e0f2fe;color:#075985;border-radius:7px;min-height:28px;padding:4px 8px;font-size:10px;font-weight:800;white-space:nowrap}.level-display-hint{display:none}.chart-wrap{height:calc(100dvh - 238px)!important;min-height:430px!important;max-height:none!important;border-radius:0 0 9px 9px;touch-action:none}.tooltip{min-width:145px;max-width:78vw;font-size:10px;padding:6px 7px}.tooltip strong{min-width:62px}
.whale-panel{padding:8px;min-height:calc(100dvh - 150px)}.whale-head{flex-direction:column;gap:5px;margin-bottom:7px}.whale-head h2{font-size:13px}.whale-head p,.whale-note{display:none}.whale-head-actions{width:100%;display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.whale-head-actions .compact{padding:6px 4px;font-size:9px;min-width:0}.whale-overview{grid-template-columns:1fr 1fr;gap:5px}.whale-main-card{grid-column:span 2;padding:8px}.whale-main-card span,.whale-metric span{font-size:9px}.whale-main-card strong{font-size:14px}.whale-main-card small{font-size:9px}.whale-metric{padding:7px;min-height:63px}.whale-metric strong{font-size:13px}.whale-metric small{font-size:8.5px}.whale-details{grid-template-columns:1fr;max-height:none}.oi-manual-box{grid-template-columns:1fr 1fr}.oi-manual-box>div{grid-column:span 2}
.analysis-panel{padding:8px;min-height:calc(100dvh - 150px);flex-direction:column}.analysis-head{margin-bottom:5px}.analysis-head h2{font-size:13px}.analysis-head p,.analysis-disclaimer{display:none}.chat-box.alert-only-box{display:flex;flex-direction:column;flex:1 1 auto;min-height:calc(100dvh - 220px)}.chat-messages.alert-messages{height:auto;min-height:280px;flex:1 1 auto;padding:7px}.chat-message{max-width:98%;font-size:11px;line-height:1.38}.quick-prompts.candle-prompts{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:5px;scrollbar-width:none}.quick-prompts.candle-prompts::-webkit-scrollbar{display:none}.quick-prompts button{flex:0 0 auto;font-size:9px;padding:5px 7px}.chat-form{grid-template-columns:1fr auto;gap:4px;padding:5px}.chat-form input{min-width:0;font-size:11px;padding:7px}.chat-form .primary-btn{width:auto;padding:7px 9px;font-size:10px}
.levels-panel,.history30-panel,.settings-panel{margin-top:6px;margin-bottom:6px;border-radius:9px;box-shadow:none}.levels-grid{grid-template-columns:1fr 1fr;gap:5px}.level-series-list{grid-template-columns:1fr}footer{display:none}
.mobile-bottom-nav{position:fixed;z-index:9000;left:8px;right:8px;bottom:calc(7px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:5px;background:rgba(255,255,255,.94);border:1px solid #cbd5e1;border-radius:14px;box-shadow:0 10px 35px rgba(15,23,42,.20);backdrop-filter:blur(12px)}.mobile-nav-btn{border:0;background:transparent;color:#64748b;border-radius:10px;padding:8px 4px;font-size:11px;font-weight:800}.mobile-nav-btn.active{background:#e7f2fa;color:#075d94}.mobile-nav-btn span{margin-left:3px}
.research-modal{padding:6px;padding-bottom:calc(70px + env(safe-area-inset-bottom));align-items:flex-end}.research-modal-card{width:100%;max-height:88dvh;border-radius:14px 14px 8px 8px}.research-modal-head{padding:9px}.research-modal-head h2{font-size:12px}.research-modal-head p{display:none}.research-table{font-size:9.5px}.research-table th,.research-table td{padding:5px}
}
@media(max-width:390px){.quote-card strong{font-size:14px}.topbar-quick-actions .ghost-btn{font-size:8px;padding:4px}.chart-wrap{height:calc(100dvh - 232px)!important;min-height:410px!important}.mobile-nav-btn{font-size:10px}}

/* LANDSCAPE TRADING MODE: chart left + live chat/alerts right */
@media (max-width:1100px) and (orientation:landscape){
html,body{width:100%;height:100%;overflow:hidden!important}body{padding:0!important}.app-shell{height:100dvh;max-width:none!important;padding:3px!important;overflow:hidden}.topbar,.quote-strip,.levels-panel,.history30-panel,.settings-panel,footer,.mobile-bottom-nav{display:none!important}.dashboard-workspace{display:grid!important;grid-template-columns:minmax(0,2.35fr) minmax(245px,.85fr)!important;gap:4px!important;height:calc(100dvh - 6px);margin:0!important;align-items:stretch}.workspace-chart,.workspace-side,body.mobile-view-chat .workspace-chart,body.mobile-view-shark .workspace-chart{display:block!important;width:auto!important;min-width:0!important;height:100%!important}.workspace-side,body:not(.mobile-view-shark):not(.mobile-view-chat) .workspace-side,body.mobile-view-chat .workspace-side,body.mobile-view-shark .workspace-side{display:block!important;min-width:0!important;height:100%!important}.workspace-side .whale-panel,body.mobile-view-shark .whale-panel{display:none!important}.workspace-side .analysis-panel,body.mobile-view-chat .analysis-panel,body.mobile-view-shark .analysis-panel{display:flex!important;height:100%!important;min-height:0!important;margin:0!important;border-radius:8px!important;padding:5px!important;overflow:hidden}.chart-panel{height:100%!important;display:flex!important;flex-direction:column!important;border-radius:8px!important;overflow:hidden}.chart-toolbar{flex:0 0 auto!important;padding:3px 4px!important;gap:2px!important;display:flex!important;flex-direction:row!important;align-items:center!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important}.legend{max-width:34%;flex:0 0 auto!important;padding:0!important}.legend span{font-size:8px!important}.toolbar-actions{flex:1 1 auto!important;overflow-x:auto!important;padding:0!important;gap:2px!important}.toolbar-actions>*{min-height:23px!important;font-size:8px!important;padding:2px 4px!important}.toolbar-actions .range-btn:nth-of-type(n+3),.toolbar-actions .zoom-btn,#resetZoom{display:none!important}.mobile-landscape-btn{display:inline-flex!important;min-height:23px!important;font-size:8px!important;padding:2px 5px!important}.level-display-hint{display:none!important}.chart-wrap{flex:1 1 auto!important;height:auto!important;min-height:0!important;max-height:none!important;border-radius:0 0 8px 8px!important;touch-action:none}.analysis-head{flex:0 0 auto;margin:0 0 3px!important}.analysis-head h2{font-size:10px!important}.analysis-head p,.analysis-disclaimer{display:none!important}.chat-box.alert-only-box{display:flex!important;flex-direction:column!important;min-height:0!important;height:auto!important;flex:1 1 auto!important;overflow:hidden}.chat-messages.alert-messages{flex:1 1 auto!important;height:auto!important;min-height:0!important;padding:4px!important;overflow-y:auto!important}.chat-message{font-size:9px!important;line-height:1.25!important;margin:2px 0!important;padding:4px 5px!important;max-width:100%!important}.quick-prompts.candle-prompts{flex:0 0 auto!important;padding:2px!important;gap:2px!important;overflow-x:auto!important}.quick-prompts button{font-size:7.5px!important;padding:3px 4px!important}.chat-form{flex:0 0 auto!important;padding:3px!important;gap:3px!important}.chat-form input{font-size:9px!important;padding:5px!important}.chat-form .primary-btn{font-size:8px!important;padding:5px 7px!important}.research-modal{z-index:12000}
}
@media (max-width:740px) and (orientation:landscape){.dashboard-workspace{grid-template-columns:minmax(0,2fr) minmax(210px,.9fr)!important}.legend{display:none!important}.analysis-head{display:none!important}.quick-prompts.candle-prompts{display:none!important}}
/* Mobile v2: AUTO 60m + LIVE ALERTS */
.mobile-live-alerts{display:none}
@media(max-width:720px){
.mobile-live-alerts{display:block;margin:0 0 7px;padding:7px;border:1px solid #dbe5ee;border-radius:9px;background:#f8fbfd}
.live-alert-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.live-alert-header>div{display:flex;flex-direction:column;gap:1px}.live-alert-header strong{font-size:11px;color:#0f172a}.live-alert-header small{font-size:8.5px;color:#64748b}.live-alert-mode{font-size:8px;font-weight:900;color:#075985;background:#e0f2fe;border:1px solid #bae6fd;border-radius:999px;padding:3px 6px;white-space:nowrap}.live-alert-feed{display:grid;gap:5px}.live-alert-card{display:flex;flex-direction:column;gap:2px;padding:7px 8px;border-radius:8px;border-left:4px solid #94a3b8;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.04)}.live-alert-card b{font-size:10.5px;line-height:1.2}.live-alert-card span{font-size:9px;line-height:1.32;color:#475569}.live-alert-card.long{border-left-color:#16a34a;background:#f0fdf4}.live-alert-card.long b{color:#166534}.live-alert-card.short{border-left-color:#ef4444;background:#fef2f2}.live-alert-card.short b{color:#991b1b}.live-alert-card.warn{border-left-color:#f59e0b;background:#fffbeb}.live-alert-card.warn b{color:#92400e}.live-alert-card.neutral{border-left-color:#64748b;background:#f8fafc}
}
@media(max-width:1100px) and (orientation:landscape){
.dashboard-workspace{grid-template-columns:minmax(0,2.55fr) minmax(230px,.95fr)!important}
.workspace-side .analysis-panel{background:#fff!important}
.workspace-side .analysis-panel>.analysis-head{display:none!important}
.mobile-live-alerts{display:flex!important;flex-direction:column!important;flex:1 1 auto!important;min-height:0!important;margin:0!important;padding:5px!important;border:0!important;border-radius:7px!important;background:#f8fafc!important;overflow:hidden!important}
.live-alert-header{flex:0 0 auto!important;margin-bottom:4px!important;padding-bottom:4px!important;border-bottom:1px solid #dbe5ee}.live-alert-header strong{font-size:10px!important}.live-alert-header small{font-size:7.5px!important}.live-alert-mode{font-size:7px!important;padding:2px 5px!important}.live-alert-feed{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;display:flex!important;flex-direction:column!important;gap:4px!important;padding-right:1px!important}.live-alert-card{padding:5px 6px!important;border-radius:6px!important;border-left-width:3px!important}.live-alert-card b{font-size:8.8px!important}.live-alert-card span{font-size:7.7px!important;line-height:1.25!important}
.workspace-side .chat-box.alert-only-box,.workspace-side .quick-prompts.candle-prompts,.workspace-side .chat-form,.workspace-side .analysis-disclaimer{display:none!important}
.toolbar-actions .range-btn[data-range="0"],.toolbar-actions .range-btn[data-range="15"]{display:none!important}.toolbar-actions .range-btn[data-range="60"],.toolbar-actions .range-btn[data-range="30"]{display:inline-flex!important}.toolbar-actions #fullscreenBtn{display:none!important}.toolbar-actions .view-window-label{max-width:125px!important;overflow:hidden!important;text-overflow:ellipsis!important}
}
@media(max-width:740px) and (orientation:landscape){
.dashboard-workspace{grid-template-columns:minmax(0,2.15fr) minmax(205px,.95fr)!important}.live-alert-card span{font-size:7.2px!important}.live-alert-card b{font-size:8.2px!important}.toolbar-actions .level-mode-select{display:none!important}
}
/* VN30 SHARK · MOBILE TRADE UI v3 */
@media (max-width:1100px) and (orientation:landscape){
  body.mobile-landscape-trading{background:#07111f!important}
  body.mobile-landscape-trading .app-shell{padding:4px!important;background:#07111f!important}
  body.mobile-landscape-trading .dashboard-workspace{
    grid-template-columns:minmax(0,3.15fr) minmax(255px,1fr)!important;
    gap:6px!important;height:calc(100dvh - 8px)!important
  }
  body.mobile-landscape-trading .chart-panel{
    border:1px solid #253349!important;border-radius:12px!important;background:#fff!important;
    box-shadow:0 10px 30px rgba(0,0,0,.22)!important
  }
  body.mobile-landscape-trading .chart-toolbar{
    min-height:42px!important;padding:4px 6px!important;background:#f8fafc!important;
    border-bottom:1px solid #dbe3ee!important;display:flex!important;align-items:center!important;
    gap:4px!important;overflow:hidden!important
  }
  body.mobile-landscape-trading .legend{display:none!important}
  body.mobile-landscape-trading .toolbar-actions{
    display:flex!important;align-items:center!important;gap:4px!important;overflow-x:auto!important;
    overflow-y:hidden!important;white-space:nowrap!important;scrollbar-width:none!important
  }
  body.mobile-landscape-trading .toolbar-actions::-webkit-scrollbar{display:none!important}
  body.mobile-landscape-trading .toolbar-actions>*{
    min-height:30px!important;height:30px!important;padding:4px 7px!important;border-radius:8px!important;
    font-size:10px!important;font-weight:700!important;line-height:1!important
  }
  body.mobile-landscape-trading .range-btn{font-size:10px!important}
  body.mobile-landscape-trading .series-toggles{gap:4px!important;background:#fff!important;border:1px solid #d7e0eb!important}
  body.mobile-landscape-trading .series-toggles label{font-size:10px!important;font-weight:800!important;padding:0 2px!important}
  body.mobile-landscape-trading .series-toggles input{width:14px!important;height:14px!important}
  body.mobile-landscape-trading .view-window-label{display:none!important}
  body.mobile-landscape-trading .level-mode-select{display:none!important}
  body.mobile-landscape-trading .toolbar-actions .ghost-btn.compact{display:none!important}
  body.mobile-landscape-trading .mobile-landscape-btn{
    display:inline-flex!important;margin-left:auto!important;background:#0f172a!important;color:#fff!important;
    border:1px solid #334155!important;padding:4px 8px!important;font-size:9px!important
  }
  body.mobile-landscape-trading .chart-wrap{
    background:#fff!important;border-radius:0 0 12px 12px!important;overflow:hidden!important
  }

  /* right terminal */
  body.mobile-landscape-trading .workspace-side .analysis-panel{
    padding:0!important;border-radius:12px!important;border:1px solid #24344b!important;
    background:linear-gradient(180deg,#0c1728 0%,#07111f 100%)!important;color:#e5edf7!important;
    box-shadow:0 10px 30px rgba(0,0,0,.28)!important
  }
  body.mobile-landscape-trading .analysis-head,
  body.mobile-landscape-trading .chat-box,
  body.mobile-landscape-trading .quick-prompts,
  body.mobile-landscape-trading .chat-form,
  body.mobile-landscape-trading .analysis-disclaimer{display:none!important}
  body.mobile-landscape-trading .mobile-live-alerts{
    display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;
    min-height:0!important;overflow:hidden!important
  }
  body.mobile-landscape-trading .live-alert-header{
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    padding:11px 12px 9px!important;border-bottom:1px solid #213149!important;background:#101d31!important;
    flex:0 0 auto!important
  }
  body.mobile-landscape-trading .live-alert-header>div{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important}
  body.mobile-landscape-trading .live-alert-header strong{
    color:#fff!important;font-size:13px!important;letter-spacing:.25px!important;white-space:nowrap!important
  }
  body.mobile-landscape-trading .live-alert-header small{
    color:#7f91a9!important;font-size:8.5px!important;white-space:nowrap!important
  }
  body.mobile-landscape-trading .live-alert-mode{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    padding:4px 7px!important;border-radius:999px!important;background:#123b32!important;color:#77f2bd!important;
    border:1px solid #1c5d4d!important;font-size:8px!important;font-weight:900!important;letter-spacing:.5px!important
  }
  body.mobile-landscape-trading .live-alert-feed{
    flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding:8px!important;
    display:flex!important;flex-direction:column!important;gap:7px!important;scrollbar-width:none!important
  }
  body.mobile-landscape-trading .live-alert-feed::-webkit-scrollbar{display:none!important}
  body.mobile-landscape-trading .live-alert-card{
    position:relative!important;display:flex!important;flex-direction:column!important;gap:5px!important;
    padding:10px 11px!important;border-radius:10px!important;background:#111f33!important;
    border:1px solid #223550!important;border-left:4px solid #64748b!important;
    box-shadow:0 5px 14px rgba(0,0,0,.16)!important;color:#dbe7f5!important
  }
  body.mobile-landscape-trading .live-alert-card b{
    display:block!important;color:#fff!important;font-size:11px!important;line-height:1.25!important;letter-spacing:.05px!important
  }
  body.mobile-landscape-trading .live-alert-card span{
    display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:3!important;
    overflow:hidden!important;color:#9fb0c6!important;font-size:9px!important;line-height:1.42!important
  }
  body.mobile-landscape-trading .live-alert-card.long{border-left-color:#22c55e!important;background:linear-gradient(135deg,#102b27,#112033)!important}
  body.mobile-landscape-trading .live-alert-card.short{border-left-color:#ef4444!important;background:linear-gradient(135deg,#321b24,#112033)!important}
  body.mobile-landscape-trading .live-alert-card.warn{border-left-color:#f59e0b!important;background:linear-gradient(135deg,#332817,#112033)!important}
  body.mobile-landscape-trading .live-alert-card.neutral{border-left-color:#38bdf8!important}

  /* primary signal card */
  body.mobile-landscape-trading .live-alert-card:first-child{
    min-height:102px!important;padding:12px!important;justify-content:center!important
  }
  body.mobile-landscape-trading .live-alert-card:first-child b{
    font-size:14px!important;line-height:1.22!important;text-transform:uppercase!important
  }
  body.mobile-landscape-trading .live-alert-card:first-child span{
    font-size:10px!important;color:#c6d4e5!important;-webkit-line-clamp:2!important
  }
  body.mobile-landscape-trading .live-alert-card:nth-child(2) b::before{content:'⚡ ';}
  body.mobile-landscape-trading .live-alert-card:nth-child(3) b::before{content:'◎ ';}
  body.mobile-landscape-trading .live-alert-card:nth-child(4){opacity:.9!important}
}

@media (max-width:780px) and (orientation:landscape){
  body.mobile-landscape-trading .dashboard-workspace{grid-template-columns:minmax(0,2.8fr) minmax(225px,1fr)!important}
  body.mobile-landscape-trading .chart-toolbar{min-height:38px!important;padding:3px 5px!important}
  body.mobile-landscape-trading .toolbar-actions>*{height:27px!important;min-height:27px!important;font-size:9px!important;padding:3px 5px!important}
  body.mobile-landscape-trading .series-toggles label{font-size:9px!important}
  body.mobile-landscape-trading .live-alert-header{padding:8px 9px!important}
  body.mobile-landscape-trading .live-alert-header strong{font-size:11px!important}
  body.mobile-landscape-trading .live-alert-header small{display:none!important}
  body.mobile-landscape-trading .live-alert-feed{padding:6px!important;gap:5px!important}
  body.mobile-landscape-trading .live-alert-card{padding:8px 9px!important;gap:3px!important}
  body.mobile-landscape-trading .live-alert-card:first-child{min-height:86px!important;padding:10px!important}
  body.mobile-landscape-trading .live-alert-card:first-child b{font-size:12px!important}
  body.mobile-landscape-trading .live-alert-card span{font-size:8px!important;-webkit-line-clamp:2!important}
}
/* VN30 SHARK · MOBILE CHART v4 */
@media (max-width:1100px) and (orientation:landscape){
  body.mobile-landscape-trading .chart-toolbar{
    min-height:36px!important;height:36px!important;padding:3px 5px!important;overflow:hidden!important
  }
  body.mobile-landscape-trading .toolbar-actions{
    flex-wrap:nowrap!important;height:30px!important;min-height:30px!important;overflow-x:auto!important;overflow-y:hidden!important
  }
  body.mobile-landscape-trading #volumeToggle{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    min-width:62px!important;height:28px!important;min-height:28px!important;padding:3px 7px!important;
    border-radius:8px!important;border:1px solid #94a3b8!important;background:#fff!important;color:#0f172a!important;
    font-size:9px!important;font-weight:900!important;white-space:nowrap!important
  }
  body.mobile-landscape-trading #volumeToggle[aria-pressed="true"]{
    background:#fff7ed!important;border-color:#fb923c!important;color:#9a3412!important
  }
  body.mobile-landscape-trading .chart-wrap{
    flex:1 1 auto!important;height:calc(100dvh - 44px)!important;min-height:0!important;max-height:none!important;
    padding:0!important;margin:0!important;overflow:hidden!important
  }
  body.mobile-landscape-trading #chart{display:block!important;width:100%!important;height:100%!important}
}

@media (max-width:780px) and (orientation:landscape){
  body.mobile-landscape-trading .chart-toolbar{min-height:34px!important;height:34px!important;padding:2px 4px!important}
  body.mobile-landscape-trading .toolbar-actions{height:28px!important;min-height:28px!important}
  body.mobile-landscape-trading #volumeToggle{height:26px!important;min-height:26px!important;min-width:58px!important;font-size:8px!important}
  body.mobile-landscape-trading .chart-wrap{height:calc(100dvh - 40px)!important}
}
