:root {
  --bg: #0a0e12;
  --bg-panel: #121820;
  --bg-elevated: #1a222d;
  --bg-glass: rgba(18, 24, 32, 0.92);
  --border: #2a3544;
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #eef4fa;
  --muted: #8a9bb0;
  --accent: #2ee4b8;
  --accent-dim: #1a9d7a;
  --accent-glow: rgba(46, 228, 184, 0.15);
  --breakout: #4da8ff;
  --pullback: #f5c542;
  --weekly: #b794f6;
  --monthly: #f687b3;
  --danger: #ff6b7a;
  --ok: #2ee4b8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "IBM Plex Sans Thai", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: auto;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 90% 60% at 0% -20%, rgba(46, 228, 184, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(77, 168, 255, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0c1016 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.35), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 20px calc(88px + var(--safe-bottom));
}

/* ── Header ── */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -16px -20px 16px;
  padding: 16px 20px 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent) 0%, #1a8f72 100%);
  color: #04140f;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.tag {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.live-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(46, 228, 184, 0.25);
  background: rgba(46, 228, 184, 0.08);
  color: #9ee8d4;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.live-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(46, 228, 184, 0.5);
  animation: live-pulse 1.8s ease infinite;
}

.live-sync-badge.busy .live-sync-dot {
  background: var(--breakout);
  animation: live-pulse 0.9s ease infinite;
}

.live-sync-badge.offline {
  border-color: rgba(255, 107, 122, 0.35);
  background: rgba(255, 107, 122, 0.08);
  color: #ffb0b8;
}

.live-sync-badge.offline .live-sync-dot {
  background: var(--danger);
  animation: none;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 228, 184, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(46, 228, 184, 0); }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.controls-primary {
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-height: 44px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(180deg, #3aefc4 0%, var(--accent) 100%);
  border-color: transparent;
  color: #04140f;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #4ff5cc 0%, #3aefc4 100%);
  box-shadow: 0 6px 24px rgba(46, 228, 184, 0.25);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.btn.icon-btn {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
}

.btn-sm {
  padding: 8px 12px;
  min-height: 36px;
  font-size: 0.8rem;
}

.btn-scan .btn-icon {
  margin-right: 6px;
  font-size: 0.75rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  min-height: 36px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ── Collapsible panels (mobile) ── */
.collapse-panel {
  margin-bottom: 0;
}

.collapse-summary {
  display: none;
  list-style: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.collapse-summary::-webkit-details-marker { display: none; }

.collapse-title { flex: 1; }

.collapse-chevron {
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.collapse-panel[open] .collapse-chevron { transform: rotate(180deg); }

.strategy-row { margin-top: 0; }

/* ── Toolbar card ── */
.toolbar-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toolbar-row + .toolbar-row { margin-top: 8px; }

.toolbar-row-secondary {
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.toolbar-label {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 52px;
}

.scroll-x {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex: 1;
  min-width: 0;
}

.scroll-x::-webkit-scrollbar { display: none; }

.chip,
.scan-chip,
.strategy-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.chip span,
.scan-chip span,
.strategy-chip span {
  padding: 8px 14px;
}

.chip input,
.scan-chip input,
.strategy-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chip:has(input:checked),
.scan-chip:has(input:checked),
.strategy-chip:has(input:checked) {
  border-color: var(--accent-dim);
  background: rgba(46, 228, 184, 0.1);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(46, 228, 184, 0.15);
}

/* ── Search ── */
.search-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.strategy-card,
.indicator-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.strategy-head h2,
.indicator-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.strategy-hint,
.indicator-hint {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.strategy-picker,
.indicator-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.strategy-search,
.indicator-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
}

.strategy-search:focus,
.indicator-search:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px rgba(46, 228, 184, 0.12);
}

.strategy-count,
.indicator-count {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.strategy-scroll-list,
.indicator-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.strategy-group-title,
.indicator-group-title {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 8px 10px 6px;
  background: var(--bg-elevated);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border-soft);
}

.strategy-option,
.indicator-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.strategy-option:hover,
.indicator-option:hover {
  background: rgba(255, 255, 255, 0.03);
}

.strategy-option:has(input:checked),
.indicator-option:has(input:checked) {
  border-color: rgba(46, 228, 184, 0.25);
  background: rgba(46, 228, 184, 0.08);
}

.strategy-option input,
.indicator-option input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.strategy-option-body,
.indicator-option-body {
  min-width: 0;
  flex: 1;
}

.strategy-option-name,
.indicator-option-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.strategy-option-desc,
.indicator-option-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.strategy-option-pane,
.indicator-option-pane {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.strategy-empty,
.indicator-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.search-wrap {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.92rem;
  padding: 12px 14px 12px 40px;
  min-height: 48px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-wrap .btn.primary {
  flex-shrink: 0;
  min-width: 88px;
}

.search-hint {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.strategy-bar { margin: 0; }

/* ── Suggest ── */
.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 280px;
  overflow-y: auto;
  z-index: 40;
  box-shadow: var(--shadow);
}

.suggest.hidden { display: none; }

.suggest-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--font);
  min-height: 44px;
}

.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover,
.suggest-item.active { background: rgba(46, 228, 184, 0.08); }

.suggest-item .sym {
  font-family: var(--mono);
  font-weight: 600;
  margin-right: 8px;
}

.suggest-item .name {
  color: var(--muted);
  font-size: 0.82rem;
}

.suggest-item .ex {
  float: right;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* ── Layout ── */
.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.15);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.panel-head select {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 36px;
  font-family: var(--font);
  font-size: 0.78rem;
  cursor: pointer;
}

.lookup-box {
  margin: 10px 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(46, 228, 184, 0.3);
  background: rgba(46, 228, 184, 0.06);
  font-size: 0.85rem;
}

.lookup-box.hidden { display: none; }
.lookup-box .title {
  font-family: var(--mono);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}

/* ── Signal list ── */
.signal-list {
  overflow-y: auto;
  flex: 1;
  max-height: calc(100vh - 280px);
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.signal-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: var(--bg-elevated);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.signal-card:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.signal-card.active {
  border-color: var(--accent-dim);
  border-left-color: var(--accent);
  background: rgba(46, 228, 184, 0.07);
  box-shadow: inset 0 0 0 1px rgba(46, 228, 184, 0.12);
}

.signal-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.signal-card .sym {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge.A { background: rgba(46, 228, 184, 0.2); color: #5eecc0; }
.badge.B { background: rgba(245, 197, 66, 0.15); color: #f5c542; }
.badge.C { background: rgba(138, 155, 176, 0.15); color: #8a9bb0; }

.type-tag {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

.type-tag.BREAKOUT { color: var(--breakout); }
.type-tag.PULLBACK_HOLD { color: var(--pullback); }
.type-tag.WEEKLY_CLOSE { color: var(--weekly); }
.type-tag.MONTHLY_CLOSE { color: var(--monthly); }

.target-line {
  font-size: 0.82rem;
  margin-top: 6px;
  color: var(--muted);
}

.pct-up {
  color: var(--accent);
  font-weight: 600;
}

.tf-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-left: 4px;
}

.tf-badge.weekly { color: var(--weekly); border-color: rgba(183, 148, 246, 0.4); }
.tf-badge.monthly { color: var(--monthly); border-color: rgba(246, 135, 179, 0.4); }
.tf-badge.daily { color: var(--breakout); border-color: rgba(77, 168, 255, 0.35); }

.reason {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-line {
  margin-top: 8px;
  font-size: 0.74rem;
  line-height: 1.5;
  font-family: var(--mono);
}

.sr-line .sup { color: var(--pullback); }
.sr-line .res { color: var(--breakout); }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.empty::before {
  content: "◇";
  display: block;
  font-size: 1.5rem;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* ── Chart ── */
.chart-panel { min-height: 560px; }

.chart-head {
  flex-wrap: wrap;
  gap: 10px;
}

.chart-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.chart-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.tf-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.tf-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 10px 12px;
  min-height: 40px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.12s, color 0.12s;
}

.tf-btn:last-child { border-right: 0; }
.tf-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tf-btn.active {
  background: rgba(46, 228, 184, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.live-toggle { font-size: 0.8rem; }

.live-price {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
  padding: 6px 12px;
  border: 1px solid rgba(46, 228, 184, 0.35);
  border-radius: 999px;
  background: rgba(46, 228, 184, 0.06);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.2s, border-color 0.2s;
}

.live-price.hidden { display: none; }
.live-price.up { color: var(--accent); }
.live-price.down { color: var(--danger); }
.live-price.up {
  border-color: rgba(46, 228, 184, 0.45);
}
.live-price.down {
  border-color: rgba(255, 107, 122, 0.4);
  background: rgba(255, 107, 122, 0.06);
}

.live-price.tick {
  background: rgba(46, 228, 184, 0.14);
}

.live-price .live-sym {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.live-price .live-sep {
  opacity: 0.55;
}

.live-price .live-val {
  font-weight: 600;
}

.live-price .chg {
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 2px;
  opacity: 0.9;
}

.chart-title-wrap.has-live .chart-symbol-title {
  display: none;
}

.tv-symbol-row.has-live .chart-symbol-title {
  display: none;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(46, 228, 184, 0.5);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 228, 184, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(46, 228, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 228, 184, 0); }
}

.chart {
  flex: 1;
  min-height: 400px;
  position: relative;
  background: #0d1117;
}

.chart-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.entry-box {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--bg-elevated);
  font-size: 0.88rem;
  line-height: 1.55;
}

.entry-box.hidden { display: none; }
.entry-box strong { color: var(--accent); }

.entry-plan-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.entry-plan-head .entry-rr {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.entry-reason {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.86rem;
}

.entry-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.entry-plan-cell {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.2);
}

.entry-plan-cell .ep-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.entry-plan-cell .ep-price {
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
}

.entry-plan-cell .ep-pct {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  margin-top: 2px;
}

.entry-plan-cell.entry { border-color: rgba(41, 98, 255, 0.35); }
.entry-plan-cell.entry .ep-price { color: #5b9cff; }
.entry-plan-cell.stop { border-color: rgba(239, 107, 107, 0.35); }
.entry-plan-cell.stop .ep-price { color: #ef6b6b; }
.entry-plan-cell.stop .ep-pct { color: #ef6b6b; }
.entry-plan-cell.target { border-color: rgba(232, 185, 35, 0.35); }
.entry-plan-cell.target .ep-price { color: var(--accent); }
.entry-plan-cell.target .ep-pct { color: var(--accent); }
.entry-plan-cell.level .ep-price { color: var(--muted); }

.entry-hint {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.entry-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.signal-trade-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.signal-trade-mini .stp {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.signal-trade-mini .stp.entry { color: #5b9cff; }
.signal-trade-mini .stp.stop { color: #ef6b6b; }
.signal-trade-mini .stp.target { color: var(--accent); }

.trade-plan-overlay {
  position: absolute;
  top: 10px;
  left: 48px;
  right: 10px;
  z-index: 5;
  pointer-events: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.trade-plan-overlay.hidden { display: none; }

.tp-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 8px;
}

.tp-head .tp-rr {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.tp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tp-price {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
}

.tp-pct {
  font-family: var(--mono);
  font-size: 0.68rem;
}

.tp-cell.tp-entry .tp-price { color: #5b9cff; }
.tp-cell.tp-stop .tp-price,
.tp-cell.tp-stop .tp-pct { color: #ef6b6b; }
.tp-cell.tp-target .tp-price,
.tp-cell.tp-target .tp-pct { color: var(--accent); }
.tp-cell.tp-level .tp-price { color: #9aa5b1; }

@media (max-width: 900px) {
  .trade-plan-overlay {
    left: 8px;
    right: 8px;
    top: 6px;
    padding: 8px 10px;
  }

  .tp-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tp-cell.tp-level {
    grid-column: 1 / -1;
  }
}

.levels-box {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.levels-box.hidden { display: none; }

.strategy-notes,
.indicator-notes {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.strategy-notes.hidden,
.indicator-notes.hidden { display: none; }
.strategy-notes div,
.indicator-notes div { margin: 2px 0; }

.levels-col h3 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.levels-col.support h3 { color: var(--pullback); }
.levels-col.resistance h3 { color: var(--breakout); }

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.level-row.nearest {
  outline: 1px solid rgba(46, 228, 184, 0.35);
  background: rgba(46, 228, 184, 0.05);
}

.level-row .price { font-weight: 600; }
.level-row .meta { color: var(--muted); font-size: 0.72rem; }
.levels-empty { color: var(--muted); font-size: 0.82rem; }

/* ── FAB (mobile) ── */
.fab-scan {
  display: none;
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 45;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #3aefc4, var(--accent));
  color: #04140f;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(46, 228, 184, 0.35);
  transition: transform 0.15s;
}

.fab-scan:active { transform: scale(0.96); }

/* ── Mobile bottom nav ── */
.mobile-nav {
  display: none;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 28px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #04140f;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.nav-badge.hidden { display: none; }

.landscape-exit { display: none; }

/* ── Toast & Modal ── */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  max-width: min(360px, calc(100vw - 32px));
  box-shadow: var(--shadow);
  z-index: 50;
  font-size: 0.88rem;
  text-align: center;
  animation: slideIn 0.25s ease;
}

.toast.ok { border-color: var(--accent-dim); }
.toast.err { border-color: var(--danger); }
.toast.hidden { display: none; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal.hidden { display: none; }

.modal-box {
  width: min(420px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal-box h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.modal-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

#apiBaseInput {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.modal-example {
  margin: 10px 0 16px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.modal-example code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.72rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Desktop ── */
@media (min-width: 901px) {
  .btn-scan { min-width: 140px; }
  .header-sticky {
    margin: -16px -20px 20px;
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* ── Tablet & mobile ── */
@media (max-width: 900px) {
  .app {
    padding: 10px 12px calc(128px + var(--safe-bottom));
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;
    padding: 6px 8px calc(6px + var(--safe-bottom));
    background: var(--bg-glass);
    border-top: 1px solid var(--border-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-nav-btn {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 0 2px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .mobile-nav-btn .nav-icon {
    font-size: 0.95rem;
    line-height: 1;
  }

  .mobile-nav-btn.active {
    color: var(--accent);
    background: rgba(46, 228, 184, 0.1);
  }

  .mobile-tab-panel {
    display: none !important;
  }

  .mobile-tab-panel.active {
    display: flex !important;
  }

  .search-card.mobile-tab-panel.active {
    display: block !important;
  }

  .strategy-card.mobile-tab-panel.active,
  .indicator-card.mobile-tab-panel.active {
    display: block !important;
  }

  .layout {
    display: block;
  }

  .layout .mobile-tab-panel.active {
    width: 100%;
  }

  .fab-scan {
    bottom: calc(68px + var(--safe-bottom));
  }

  .header-sticky {
    margin: -10px -12px 10px;
    padding: 10px 12px 8px;
  }

  .top {
    margin-bottom: 8px;
    gap: 8px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .signals-panel { order: unset; }
  .chart-panel { order: unset; }

  .signal-list {
    max-height: calc(100vh - 220px);
  }

  .chart {
    min-height: 280px;
  }

  .chart-panel {
    min-height: 380px;
  }

  .tag,
  .search-hint,
  #chartMeta,
  .live-toggle {
    display: none !important;
  }

  .live-sync-badge {
    display: inline-flex !important;
  }

  .btn-scan {
    display: none;
  }

  .fab-scan {
    display: inline-flex;
  }

  .toast {
    bottom: calc(108px + var(--safe-bottom));
  }

  .collapse-panel .toolbar-card,
  .collapse-panel .strategy-row {
    margin-top: 0;
  }

  #scanOpts .toolbar-card {
    margin-bottom: 0;
  }

  .search-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .strategy-card,
  .indicator-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .strategy-hint,
  .indicator-hint {
    display: none;
  }

  .strategy-scroll-list,
  .indicator-scroll-list {
    max-height: calc(100vh - 280px);
  }

  .search-wrap {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .search-wrap input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px 10px 36px;
    min-height: 44px;
    font-size: 0.88rem;
  }

  .search-icon {
    left: 12px;
    font-size: 1rem;
  }

  .search-wrap .btn.primary {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 10px 12px;
  }

  .suggest {
    right: 0;
  }

  .panel-head {
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
  }

  .panel-head h2 {
    font-size: 0.88rem;
  }

  .list-tools {
    width: auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 55%;
  }

  .list-tools::-webkit-scrollbar { display: none; }

  .list-tools select {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 6px 8px;
    min-height: 32px;
    font-size: 0.72rem;
  }

  .chart-head {
    gap: 6px;
  }

  .chart-tools {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .tf-group {
    flex: 1;
    justify-content: stretch;
  }

  .tf-btn {
    flex: 1;
    padding: 8px 4px;
    min-height: 36px;
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .brand h1 { font-size: 1rem; }
  .logo { width: 38px; height: 38px; font-size: 10px; border-radius: 11px; }
  .toolbar-label { display: none; }
  .levels-box {
    grid-template-columns: 1fr;
  }
  .chart-title-wrap h2 {
    font-size: 0.85rem;
  }
}

/* Landscape chart fullscreen (mobile) */
@media (max-width: 900px) and (orientation: landscape) {
  body.landscape-chart-mode .header-sticky,
  body.landscape-chart-mode .search-card,
  body.landscape-chart-mode .strategy-card,
  body.landscape-chart-mode .indicator-card,
  body.landscape-chart-mode .signals-panel,
  body.landscape-chart-mode .mobile-nav,
  body.landscape-chart-mode .fab-scan {
    display: none !important;
  }

  body.landscape-chart-mode .app {
    padding: 0;
    max-width: none;
  }

  body.landscape-chart-mode .layout {
    margin: 0;
  }

  body.landscape-chart-mode .chart-panel {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 200;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  body.landscape-chart-mode .chart {
    min-height: calc(100dvh - 48px);
    height: calc(100dvh - 48px);
  }

  body.landscape-chart-mode .chart-head {
    padding: 8px 12px;
    flex-shrink: 0;
  }

  body.landscape-chart-mode .landscape-exit {
    display: inline-flex;
  }

  body.landscape-chart-mode #indicatorNotes,
  body.landscape-chart-mode #chartDockHandle,
  body.landscape-chart-mode #chartDockBottom {
    display: none !important;
  }

  body.landscape-chart-mode #levelsBox,
  body.landscape-chart-mode #entryBox {
    display: none !important;
  }
}

/* Desktop: always show all panels + hide mobile chrome */
@media (min-width: 901px) {
  .collapse-summary { display: none !important; }
  .collapse-panel .toolbar-card,
  .collapse-panel .strategy-row {
    display: block;
  }

  .mobile-tab-panel {
    display: flex !important;
  }

  .search-card.mobile-tab-panel {
    display: block !important;
  }

  .strategy-card.mobile-tab-panel,
  .indicator-card.mobile-tab-panel {
    display: flex !important;
  }

  .tv-workspace {
    display: grid !important;
  }
}

/* legacy aliases */
.scan-modes { display: contents; }
.scan-modes-label { display: none; }
.strategy-label { display: none; }

/* ══════════════════════════════════════════════════════════
   TradingView-style layout (green / black theme)
   ══════════════════════════════════════════════════════════ */

.tv-theme {
  --tv-chart-bg: #131a22;
  --tv-toolbar-bg: #0f1419;
  --tv-border: #1e2a36;
  --tv-hover: rgba(46, 228, 184, 0.08);
}

.tv-theme,
.tv-theme body {
  background: var(--bg);
}

.tv-theme body::before {
  opacity: 0.25;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 50%);
}

.tv-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
}

.tv-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  background: var(--tv-toolbar-bg);
  border-bottom: 1px solid var(--tv-border);
  flex-shrink: 0;
}

.tv-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.tv-topbar-center {
  flex-shrink: 0;
}

.tv-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tv-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 11px;
}

.tv-search-slot {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.tv-search-slot .search-wrap {
  gap: 6px;
}

.tv-search-slot .search-wrap input {
  min-height: 36px;
  padding: 8px 12px 8px 36px;
  font-size: 0.85rem;
  border-radius: 4px;
  background: #0c1016;
  border-color: var(--tv-border);
}

.tv-search-slot .search-wrap .btn.primary {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.78rem;
  border-radius: 4px;
}

.tv-scan-bar {
  flex-shrink: 0;
  margin: 0;
  border-bottom: 1px solid var(--tv-border);
  background: var(--tv-toolbar-bg);
}

.tv-scan-bar .toolbar-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  min-height: 0;
  overflow: hidden;
}

.tv-workspace.hide-watchlist {
  grid-template-columns: 0 minmax(0, 1fr) 280px;
}

.tv-workspace.hide-watchlist .tv-watchlist {
  display: none;
}

.tv-workspace.hide-sidebar {
  grid-template-columns: 260px minmax(0, 1fr) 0;
}

.tv-workspace.hide-sidebar .tv-sidebar {
  display: none;
}

.tv-workspace.hide-watchlist.hide-sidebar {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.tv-watchlist,
.tv-sidebar,
.tv-chart-zone {
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  background: var(--bg-panel);
}

.tv-watchlist {
  border-right: 1px solid var(--tv-border);
  display: flex;
  flex-direction: column;
}

.tv-sidebar {
  border-left: 1px solid var(--tv-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tv-chart-zone {
  display: flex;
  flex-direction: column;
  background: var(--tv-chart-bg);
  min-height: 0;
}

.chart-dock {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chart-dock-main {
  flex: 1 1 auto;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-dock-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 4px 12px;
  border-top: 1px solid var(--tv-border);
  border-bottom: 1px solid var(--tv-border);
  background: var(--tv-toolbar-bg);
  cursor: row-resize;
  user-select: none;
  touch-action: none;
}

.chart-dock-handle.is-open {
  cursor: row-resize;
  background: rgba(232, 185, 35, 0.06);
  border-top-color: rgba(232, 185, 35, 0.2);
}

.chart-dock-grip {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.55;
  flex-shrink: 0;
}

.chart-dock-handle-label {
  flex: 1;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-dock-handle-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dock-mini-btn {
  width: 28px;
  height: 24px;
  border: 1px solid var(--tv-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.dock-mini-btn:hover {
  color: var(--text);
  border-color: rgba(232, 185, 35, 0.35);
}

.dock-mini-btn.hidden { display: none; }

.chart-dock-bottom {
  flex-shrink: 0;
  height: var(--dock-h, 0px);
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
  transition: height 0.12s ease-out;
}

.chart-dock-bottom.is-resizing {
  transition: none;
}

.chart-dock-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.chart-dock-bottom .indicator-notes,
.chart-dock-bottom .entry-box,
.chart-dock-bottom .levels-box {
  border-top: 0;
}

.levels-tf {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

body.dock-dragging {
  cursor: row-resize !important;
  user-select: none;
}

body.dock-dragging * {
  cursor: row-resize !important;
}

.levels-tf strong {
  color: var(--text);
}

.tv-panel-head {
  padding: 10px 12px;
  background: var(--tv-toolbar-bg);
  border-bottom: 1px solid var(--tv-border);
}

.tv-panel-head h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tv-signal-list {
  max-height: none;
  flex: 1;
  padding: 6px;
}

.tv-signal-list .signal-card {
  border-radius: 4px;
  padding: 10px 10px 10px 8px;
  margin-bottom: 4px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  box-shadow: none;
}

.tv-signal-list .signal-card:hover {
  background: var(--tv-hover);
  transform: none;
}

.tv-signal-list .signal-card.active {
  background: rgba(46, 228, 184, 0.1);
  border-left-color: var(--accent);
  box-shadow: none;
}

.tv-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--tv-toolbar-bg);
  border-bottom: 1px solid var(--tv-border);
}

.tv-symbol-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-width: 0;
}

.tv-symbol-row .chart-title-wrap {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.tv-symbol-row .chart-symbol-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tv-symbol-row.has-live .chart-symbol-title {
  display: none;
}

.tv-ohlc-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.tv-ohlc-bar.hidden { display: none; }

.tv-ohlc-bar .ohlc-item strong {
  color: var(--text);
  font-weight: 600;
}

.tv-ohlc-bar .ohlc-chg.up { color: var(--accent); }
.tv-ohlc-bar .ohlc-chg.down { color: var(--danger); }

.tv-chart-toolbar-right {
  flex-shrink: 0;
}

.tv-tf-group {
  border-radius: 4px;
  border-color: var(--tv-border);
  background: #0c1016;
}

.tv-tf-group .tf-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.tv-tf-group .tf-btn.active {
  background: rgba(46, 228, 184, 0.15);
  color: var(--accent);
}

.tv-live-toggle {
  font-size: 0.78rem;
}

.tv-tv-btn {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.72rem;
}

.tv-status-bar {
  padding: 4px 12px;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--tv-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-status-bar:empty { display: none; }

.tv-chart-meta {
  display: none;
}

.tv-chart-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.tv-chart-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 40px;
  flex-shrink: 0;
  padding: 8px 4px;
  background: var(--tv-toolbar-bg);
  border-right: 1px solid var(--tv-border);
}

.tv-rail-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: default;
  user-select: none;
}

.tv-rail-btn:first-child {
  color: var(--accent);
  background: rgba(46, 228, 184, 0.1);
}

.chart.tv-chart {
  flex: 1;
  min-height: 140px;
  height: auto;
  border-radius: 0;
}

.chart-dock-main .tv-chart-body {
  flex: 1;
  min-height: 0;
}

.tv-sidebar-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tv-border);
  background: var(--tv-toolbar-bg);
}

.tv-sidebar-head h2 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tv-indicator-picker {
  flex: 1;
  min-height: 0;
  padding: 8px;
}

.tv-indicator-list {
  max-height: none;
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.tv-desktop-only { display: inline-flex; }

.btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* Desktop: full TradingView workspace */
@media (min-width: 901px) {
  .tv-app {
    height: 100vh;
    height: 100dvh;
  }

  .tv-search-slot.mobile-tab-panel {
    display: block !important;
  }

  .tv-watchlist.mobile-tab-panel,
  .tv-sidebar.mobile-tab-panel,
  .tv-chart-zone.mobile-tab-panel {
    display: flex !important;
  }

  .tv-chart-zone {
    min-height: 0;
  }

  .mobile-nav,
  .fab-scan {
    display: none !important;
  }

  .collapse-summary {
    display: none !important;
  }

  .tv-scan-bar .toolbar-card,
  .tv-scan-bar .strategy-row,
  .collapse-panel .toolbar-card {
    display: block;
  }

  .tv-scan-bar[open] .toolbar-card {
    padding: 8px 12px;
  }
}

/* Mobile: keep tab panels */
@media (max-width: 900px) {
  .tv-app {
    padding-bottom: calc(60px + var(--safe-bottom));
  }

  .tv-workspace {
    display: block;
    flex: 1;
  }

  .tv-topbar {
    padding: 8px 10px;
    flex-wrap: wrap;
  }

  .tv-search-slot.mobile-tab-panel.active {
    flex: 1 1 100%;
    order: 10;
    width: 100%;
    max-width: none;
    padding: 8px 0 0;
    background: transparent;
    border: 0;
  }

  .tv-search-slot {
    display: none !important;
  }

  .tv-desktop-only {
    display: none !important;
  }

  .tv-chart-rail {
    display: none;
  }

  .tv-chart-toolbar {
    padding: 8px 10px;
  }

  .tv-status-bar {
    font-size: 0.68rem;
  }

  .tv-chart-zone.mobile-tab-panel.active {
    display: flex !important;
    min-height: calc(100vh - 120px);
  }

  .tv-watchlist.mobile-tab-panel.active,
  .tv-sidebar.mobile-tab-panel.active {
    display: flex !important;
  }

  .tv-search-slot.mobile-tab-panel.active {
    display: block !important;
    max-width: none;
    padding: 12px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--tv-border);
  }

  .tv-scan-bar {
    display: none;
  }
}

/* Landscape */
@media (max-width: 900px) and (orientation: landscape) {
  body.landscape-chart-mode .tv-topbar,
  body.landscape-chart-mode .tv-scan-bar,
  body.landscape-chart-mode .tv-watchlist,
  body.landscape-chart-mode .tv-sidebar,
  body.landscape-chart-mode .mobile-nav,
  body.landscape-chart-mode .fab-scan {
    display: none !important;
  }

  body.landscape-chart-mode .tv-app {
    padding: 0;
  }

  body.landscape-chart-mode .tv-chart-zone {
    display: flex !important;
    min-height: 100vh;
  }

  body.landscape-chart-mode .tv-chart-rail {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   Uhas Gold Intelligent theme
   ══════════════════════════════════════════════════════════ */

.gold-intelligent {
  --gold: #e8b923;
  --gold-bright: #f5c542;
  --gold-dim: #c49a12;
  --gold-glow: rgba(232, 185, 35, 0.18);
  --gold-soft: rgba(232, 185, 35, 0.08);
  --accent: var(--gold);
  --accent-dim: var(--gold-dim);
  --accent-glow: var(--gold-glow);
  --ok: var(--gold);
  --tv-hover: var(--gold-soft);
}

.gold-intelligent,
.gold-intelligent body {
  background:
    radial-gradient(ellipse 80% 55% at 50% -15%, rgba(232, 185, 35, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(196, 154, 18, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0a0806 0%, var(--bg) 100%);
}

.gold-intelligent body::before {
  background-image:
    linear-gradient(rgba(232, 185, 35, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 185, 35, 0.03) 1px, transparent 1px);
}

.gold-logo {
  background: linear-gradient(135deg, #f5c542 0%, #c49a12 50%, #8b6914 100%);
  color: #1a1204;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 20px rgba(232, 185, 35, 0.25);
}

.gold-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.gold-brand-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gold-brand-sub {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gold-quick-picks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.gold-quick-picks--mobile {
  display: none;
  width: 100%;
  padding-bottom: 4px;
}

.gold-chip {
  padding: 5px 10px;
  border: 1px solid rgba(232, 185, 35, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gold-chip:hover {
  color: var(--gold-bright);
  border-color: rgba(232, 185, 35, 0.45);
}

.gold-chip.active {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.gold-sync-badge .live-sync-dot {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.gold-sync-badge .live-sync-text {
  color: var(--gold-bright);
}

.gold-insight {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: linear-gradient(90deg, rgba(232, 185, 35, 0.1), rgba(0, 0, 0, 0.15));
  border-bottom: 1px solid rgba(232, 185, 35, 0.15);
  font-size: 0.78rem;
  color: var(--text);
}

.gold-insight.hidden { display: none; }

.gold-insight-icon {
  color: var(--gold-bright);
  font-size: 0.65rem;
  flex-shrink: 0;
}

.gold-insight-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gold-intelligent .btn.primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
  color: #1a1204;
  border-color: var(--gold);
  box-shadow: 0 2px 12px var(--gold-glow);
}

.gold-intelligent .btn.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(232, 185, 35, 0.3);
}

.gold-intelligent .live-price {
  border-color: rgba(232, 185, 35, 0.45);
  background: rgba(232, 185, 35, 0.08);
}

.gold-intelligent .live-price.up {
  color: var(--gold-bright);
  border-color: rgba(245, 197, 66, 0.5);
}

.gold-intelligent .live-price.up.tick {
  background: rgba(232, 185, 35, 0.18);
}

.gold-intelligent .live-price .live-dot {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
}

.gold-intelligent .tf-btn.active,
.gold-intelligent .tv-tf-group .tf-btn.active {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.gold-intelligent .tv-signal-list .signal-card.active {
  background: var(--gold-soft);
  border-left-color: var(--gold);
}

.gold-intelligent .tv-rail-btn:first-child {
  color: var(--gold);
  background: var(--gold-soft);
}

.gold-intelligent .mobile-nav-btn.active {
  color: var(--gold-bright);
}

.gold-intelligent .fab-scan {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
  color: #1a1204;
  box-shadow: 0 4px 20px var(--gold-glow);
}

.gold-intelligent .tv-theme {
  --tv-chart-bg: #14100c;
  --tv-toolbar-bg: #0d0a08;
  --tv-border: #2a2218;
}

@media (max-width: 900px) {
  .gold-intelligent .gold-brand-sub { display: none; }

  .gold-intelligent .gold-quick-picks--mobile {
    display: flex;
  }

  .gold-intelligent .tv-chart-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gold-intelligent .tv-symbol-row {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════
   TradingView Symbol Search modal
   ══════════════════════════════════════════════════════════ */

.sym-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 320px;
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sym-search-trigger:hover {
  border-color: rgba(232, 185, 35, 0.4);
  color: var(--text);
}

.sym-search-trigger .search-icon {
  position: static;
  transform: none;
  font-size: 1rem;
  opacity: 0.7;
}

.sym-search-trigger-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sym-search-kbd {
  padding: 2px 6px;
  border: 1px solid var(--tv-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
}

.sym-search-link {
  cursor: pointer;
}

.sym-search-link:hover {
  color: var(--accent);
}

body.sym-search-open {
  overflow: hidden;
}

.sym-search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: start center;
  padding: 48px 16px 24px;
}

.sym-search-modal.hidden {
  display: none;
}

.sym-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.sym-search-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(82vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #131722;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.sym-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
}

.sym-search-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #131722;
}

.sym-search-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #787b86;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.sym-search-close:hover {
  background: #f0f3fa;
  color: #131722;
}

.sym-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 0 12px;
  border: 1px solid #e0e3eb;
  border-radius: 10px;
  background: #fff;
}

.sym-search-input-wrap:focus-within {
  border-color: #2962ff;
  box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.12);
}

.sym-search-icon {
  color: #787b86;
  font-size: 1rem;
}

.sym-search-input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 0;
  font-family: var(--font);
  font-size: 0.95rem;
  color: #131722;
  outline: none;
}

.sym-search-clear {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: #f0f3fa;
  color: #787b86;
  font-size: 1rem;
  cursor: pointer;
}

.sym-search-clear.hidden { display: none; }

.sym-search-filters {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sym-search-filters::-webkit-scrollbar { display: none; }

.sym-filter {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: #f0f3fa;
  color: #131722;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.sym-filter.active {
  background: #131722;
  color: #fff;
}

.sym-search-results {
  flex: 1;
  min-height: 200px;
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid #e0e3eb;
}

.sym-search-empty {
  padding: 32px 18px;
  text-align: center;
  color: #787b86;
  font-size: 0.9rem;
}

.sym-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid #f0f3fa;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
}

.sym-row:hover,
.sym-row.active {
  background: #f8f9fd;
  outline: 1px solid #d1d4dc;
  outline-offset: -1px;
}

.sym-row-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}

.sym-icon-gold {
  background: linear-gradient(135deg, #f5c542, #c49a12);
  color: #1a1204;
}

.sym-icon-forex { background: #2962ff; }
.sym-icon-stock { background: #089981; }
.sym-icon-crypto { background: #f7931a; }
.sym-icon-futures { background: #9c27b0; }
.sym-icon-index { background: #5c6bc0; }
.sym-icon-fund { background: #26a69a; }

.sym-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sym-row-sym {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: #2962ff;
}

.sym-row-name {
  font-size: 0.82rem;
  color: #787b86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sym-row-class {
  font-size: 0.72rem;
  color: #b2b5be;
  text-transform: lowercase;
  white-space: nowrap;
}

.sym-row-provider {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.sym-row-ex {
  font-size: 0.82rem;
  font-weight: 600;
  color: #131722;
  white-space: nowrap;
}

.sym-row-ex-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0f3fa;
  color: #131722;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
}

.sym-search-footer {
  margin: 0;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 0.72rem;
  color: #b2b5be;
  border-top: 1px solid #f0f3fa;
}

@media (max-width: 900px) {
  .sym-search-modal {
    padding: 0;
    place-items: stretch;
  }

  .sym-search-dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .sym-row {
    grid-template-columns: 36px 1fr auto;
  }

  .sym-row-class {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   App brand + symbol chips (green / black)
   ══════════════════════════════════════════════════════════ */

.app-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.app-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.app-brand-sub {
  font-size: 0.68rem;
  color: var(--muted);
}

.symbol-quick-picks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.symbol-chip {
  padding: 5px 10px;
  border: 1px solid rgba(46, 228, 184, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.symbol-chip:hover {
  color: var(--accent);
  border-color: rgba(46, 228, 184, 0.4);
}

.symbol-chip.active {
  color: #04140f;
  background: linear-gradient(135deg, #3aefc4, var(--accent-dim));
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.market-insight {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(46, 228, 184, 0.06);
  border-bottom: 1px solid rgba(46, 228, 184, 0.12);
  font-size: 0.76rem;
  color: var(--muted);
}

.market-insight.hidden { display: none; }

.market-insight .gold-insight-icon { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   Mobile — clean & organized
   ══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .tv-topbar {
    min-height: 44px;
    padding: 6px 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .tv-topbar-left {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .tv-logo {
    width: 34px;
    height: 34px;
    font-size: 9px;
    border-radius: 10px;
  }

  .app-brand-title {
    font-size: 0.88rem;
  }

  .tv-topbar-center {
    display: none;
  }

  .tv-topbar-right {
    gap: 4px;
  }

  .tv-topbar-right .icon-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .tv-chart-toolbar {
    gap: 6px;
    padding: 6px 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .tv-symbol-row {
    flex: 1;
    min-width: 0;
    gap: 6px;
  }

  .tv-symbol-row .chart-symbol-title {
    font-size: 0.82rem;
  }

  .live-price {
    margin-top: 0;
    padding: 4px 10px;
    font-size: 0.82rem;
  }

  .tv-ohlc-bar {
    display: none !important;
  }

  .tv-chart-toolbar-right {
    flex-shrink: 0;
  }

  .tv-live-toggle,
  .tv-tv-btn {
    display: none !important;
  }

  .tv-tf-group {
    display: flex;
  }

  .tv-tf-group .tf-btn {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 0.65rem;
  }

  #tvSymbolLabel {
    display: none !important;
  }

  .trade-plan-overlay {
    left: 6px;
    right: 6px;
    top: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
  }

  .tp-head {
    margin-bottom: 4px;
    gap: 4px;
  }

  .tp-head .tp-rr {
    font-size: 0.65rem;
  }

  .tp-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .tp-label {
    font-size: 0.58rem;
  }

  .tp-price {
    font-size: 0.78rem;
  }

  .tp-pct {
    font-size: 0.6rem;
  }

  .tp-cell.tp-level {
    display: none;
  }

  .tv-chart-zone.mobile-tab-panel.active {
    min-height: calc(100dvh - 52px - 56px - var(--safe-bottom));
  }

  .tv-watchlist.mobile-tab-panel.active {
    min-height: calc(100dvh - 52px - 56px - var(--safe-bottom));
  }

  .tv-sidebar.mobile-tab-panel.active {
    min-height: calc(100dvh - 52px - 56px - var(--safe-bottom));
  }

  .tv-panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .tv-panel-head h2 {
    font-size: 0.82rem;
  }

  .list-tools {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .list-tools select {
    width: 100%;
    min-width: 0;
    font-size: 0.68rem;
    padding: 6px 6px;
  }

  .tv-signal-list {
    padding: 8px;
  }

  .tv-signal-list .signal-card {
    padding: 10px 10px 10px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    border-left: 3px solid transparent;
  }

  .tv-signal-list .signal-card.active {
    border-left-color: var(--accent);
    background: rgba(46, 228, 184, 0.08);
  }

  .signal-card .sr-line {
    display: none;
  }

  .signal-card .reason {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.72rem;
    margin-top: 4px;
  }

  .signal-trade-mini {
    gap: 4px 6px;
    font-size: 0.62rem;
  }

  .signal-trade-mini .stp {
    padding: 2px 6px;
  }

  .fab-scan {
    display: flex;
    bottom: calc(64px + var(--safe-bottom));
    right: 14px;
    padding: 12px 18px;
    font-size: 0.88rem;
  }

  .mobile-nav {
    padding: 4px 6px calc(4px + var(--safe-bottom));
    gap: 2px;
  }

  .mobile-nav-btn {
    min-height: 44px;
    font-size: 0.58rem;
    border-radius: 10px;
  }

  .mobile-nav-btn .nav-icon {
    font-size: 0.9rem;
  }

  .toast {
    bottom: calc(72px + var(--safe-bottom));
  }

  .chart.tv-chart {
    min-height: 240px;
  }
}

@media (max-width: 400px) {
  .tv-tf-group .tf-btn[data-tf="1m"] {
    display: none;
  }

  .tp-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
