:root {
  --bg: #07080c;
  --panel: #0b0d13;
  --card: #12151e;
  --card-2: #171b26;
  --line: #262c3a;
  --text: #eef2f8;
  --muted: #8a93a6;
  --bull: #3ee08a;
  --bear: #ff5d73;
  --gold: #f0c14b;
  --arm: #ff9a3c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #3d4658 transparent;
}
html {
  scrollbar-width: thin;
  scrollbar-color: #3d4658 transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3d4658;
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 193, 75, 0.55);
}
::-webkit-scrollbar-corner { background: transparent; }
html, body { height: 100%; }
body {
  font-family: Outfit, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(240, 193, 75, 0.08), transparent 55%),
    radial-gradient(800px 400px at -10% 110%, rgba(62, 224, 138, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
}

.app { height: 100%; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.88);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 80;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #f6d365, #e08a2c);
  color: #14120c; font-weight: 800; font-size: 11px;
  letter-spacing: 0.4px;
  box-shadow: 0 0 18px rgba(240, 193, 75, 0.28);
}
.brand strong { font-size: 14px; letter-spacing: 0.2px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.live-pill {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  color: var(--bull); font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  padding: 5px 9px; border: 1px solid rgba(62, 224, 138, 0.25);
  border-radius: 999px; background: rgba(62, 224, 138, 0.08);
}
.live-pill i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bull); box-shadow: 0 0 8px var(--bull);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.alert-btn {
  flex-shrink: 0;
  background: rgba(240, 193, 75, 0.12);
  color: var(--gold);
  border: 1px solid rgba(240, 193, 75, 0.35);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
}
.alert-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.alert-mini {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
}
.alert-mini.on { color: var(--gold); border-color: rgba(240, 193, 75, 0.4); }
.news-banner {
  margin: 0 12px 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  font-size: 12px;
}
.fold {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 8px 10px;
}
.fold summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary h2 { margin: 0; font-size: 13px; }

.search { position: relative; flex: 0 1 320px; min-width: 180px; z-index: 81; }
.search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: Outfit, sans-serif;
  font-size: 13px;
  outline: none;
}
.search input:focus { border-color: rgba(240, 193, 75, 0.55); }
.search-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 90;
  background: #10141c;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: 360px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.search-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-family: Outfit, sans-serif;
}
.search-item:hover { background: #1a2030; }
.search-item b { font-size: 13px; }
.search-item small { color: var(--muted); font-size: 11px; }

.ticker {
  flex: 1; overflow: hidden; min-width: 0;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.ticker-track {
  display: inline-flex; gap: 28px;
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  animation: marquee 42s linear infinite;
}
.ticker-track span { color: var(--muted); }
.ticker-track .up { color: var(--bull); }
.ticker-track .dn { color: var(--bear); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.clock {
  flex-shrink: 0; text-align: right;
  font-family: "IBM Plex Mono", monospace;
}
.clock b { display: block; font-size: 12px; font-weight: 500; }
.clock small { color: var(--muted); font-size: 10px; }

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr) minmax(300px, 340px);
  overflow: hidden;
}

.radar {
  border-right: 1px solid var(--line);
  overflow: auto;
  background: rgba(8, 10, 16, 0.55);
}
.radar-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 14px 8px;
  color: var(--muted); font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase;
  background: linear-gradient(#0b0d13, rgba(11, 13, 19, 0.75));
}
.radar-filters { display: flex; gap: 4px; letter-spacing: 0; text-transform: none; }
.radar-filters button {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 9px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
}
.radar-filters button.on {
  color: var(--text);
  border-color: rgba(240, 193, 75, 0.45);
  background: rgba(240, 193, 75, 0.12);
}
.rcard {
  margin: 0 10px 8px;
  padding: 10px 10px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rcard:hover { transform: translateY(-1px); border-color: #3a4358; }
.rcard.active {
  border-color: rgba(240, 193, 75, 0.55);
  box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.12), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.rcard.hot { border-color: rgba(255, 93, 115, 0.4); }
.rank {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; color: var(--muted); padding-top: 2px;
}
.rcard-body { min-width: 0; }
.rcard-top { display: flex; justify-content: space-between; font-weight: 650; font-size: 13px; }
.chg { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500; }
.chg.up { color: var(--bull); }
.chg.dn { color: var(--bear); }
.heat {
  height: 3px; border-radius: 99px; background: #1c2230; margin: 8px 0 6px; overflow: hidden;
}
.heat > i { display: block; height: 100%; background: linear-gradient(90deg, #3ee08a, #f0c14b, #ff5d73); }
.rcard-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  color: var(--muted); font-size: 10px;
}
.radar-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.rchip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #1c2230;
  color: var(--muted);
}
.rchip.entry { color: var(--text); background: rgba(148, 163, 184, 0.16); }
.rchip.entry.long { color: var(--bull); background: rgba(62, 224, 138, 0.14); }
.rchip.entry.short { color: var(--bear); background: rgba(255, 93, 115, 0.14); }
.rchip.limit { color: var(--gold); background: rgba(240, 193, 75, 0.14); }
.bias-pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: #1c2230;
}
.hist-head {
  position: static;
  background: none;
  padding: 4px 4px 8px;
  border-top: 0;
  margin-top: 0;
}
.history-wrap,
.open-wrap {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0 12px 8px;
  display: flex;
  flex-direction: column;
}
#openList,
#historyList {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
#openList .hcard,
#historyList .hcard {
  flex: 0 0 240px;
  margin: 0;
}
.hcard {
  margin: 0 10px 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  cursor: pointer;
}
.hcard:hover { border-color: #3a4358; }
.hcard.active { border-color: rgba(240, 193, 75, 0.45); }
.hcard-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 650;
}
.hcard-top small {
  color: var(--muted); font-weight: 500; font-family: "IBM Plex Mono", monospace; font-size: 10px;
}
.hcard-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.hcard .out { font-weight: 650; }
.hcard .out.open { color: var(--gold); }
.hcard .out.tp { color: var(--bull); }
.hcard .out.sl { color: var(--bear); }
#historyEmpty,
#openEmpty {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  padding: 4px 0;
}

.chart-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.chart-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 16px 4px; gap: 12px;
}
.pair-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chart-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.3px; }
.tf-pills { display: flex; gap: 4px; }
.tf-pills button {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
}
.tf-pills button.on {
  color: var(--text);
  border-color: rgba(240, 193, 75, 0.45);
  background: rgba(240, 193, 75, 0.12);
}
.ohlc {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.ohlc span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 7px; padding: 3px 7px;
}
.ohlc b { color: var(--text); font-weight: 500; }
.last-wrap { text-align: right; }
.last-wrap strong {
  display: block; margin-top: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 26px; font-weight: 500; letter-spacing: -0.6px;
}
.src { color: var(--muted); font-size: 11px; max-width: 280px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tv-toolbar button {
  background: #151922;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  font-family: Outfit, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tv-toolbar button.on {
  color: var(--gold);
  border-color: rgba(240, 193, 75, 0.45);
  background: rgba(240, 193, 75, 0.08);
}
.tv-toolbar button:focus { outline: none; }
.tv-toolbar button:focus-visible {
  outline: 2px solid rgba(240, 193, 75, 0.35);
  outline-offset: 2px;
}
.tv-box {
  flex: 1 1 0;
  min-height: 200px;
  height: auto;
  padding: 0 12px 8px;
  position: relative;
}
#tvHost {
  width: 100%; height: 100%; min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #0a0c12;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
#tvHost iframe, #tvHost table { width: 100%; height: 100%; min-height: 0; border: 0; }
.chart-signal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 12px 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
}
.chart-signal.hide { display: none; }
.chart-signal.long { border-color: rgba(62, 224, 138, 0.35); }
.chart-signal.pending { border-color: rgba(240, 193, 75, 0.4); }
.chart-signal.pending .tag { color: var(--gold); }
.chart-signal .tag {
  font-size: 10px;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.chart-signal.long .tag { color: var(--bull); }
.chart-signal.short .tag { color: var(--bear); }
.chart-signal .px {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}
.chart-signal .lvls,
.chart-signal .when {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.panel {
  border-left: 1px solid var(--line);
  padding: 12px;
  overflow: auto;
  min-width: 0;
  background: rgba(8, 10, 16, 0.7);
}
.status-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  margin-bottom: 10px;
  border-left-width: 3px;
}
.kicker { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.8px; }
.status-card strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.sig-time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}
.status-card.entry { border-left-color: var(--gold); box-shadow: 0 0 24px rgba(240, 193, 75, 0.08); }
.status-card.arm { border-left-color: var(--arm); }
.status-card.off { border-left-color: #3d4658; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cell {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 10px;
  min-width: 0;
}
.cell span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.4px; }
.cell b {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.3;
}
.bull { color: var(--bull) !important; }
.bear { color: var(--bear) !important; }

.score-card {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.check-card {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  margin-top: 8px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  min-width: 0;
}
.check-item.on { color: var(--bull); }
.check-item.off { color: var(--bear); }
.check-item i {
  width: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-style: normal;
  font-weight: 700;
}
.score-head {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 8px;
}
.score-bar { display: grid; grid-template-columns: 16px 1fr 22px; align-items: center; gap: 8px; margin-top: 6px; }
.score-bar em {
  font-style: normal; font-size: 11px; color: var(--bull); font-family: "IBM Plex Mono", monospace;
}
.score-bar.short em { color: var(--bear); }
.score-bar .track { height: 6px; background: #1c2230; border-radius: 99px; overflow: hidden; }
.score-bar i { display: block; height: 100%; width: 0; background: var(--bull); border-radius: 99px; }
.score-bar.short i { background: var(--bear); }
.score-bar b { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500; text-align: right; }
.wr {
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.levels, .ai { margin-top: 14px; }
.levels h2, .ai h2 { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 7px; }
.lvl-rows { display: grid; gap: 6px; margin-top: 8px; }
.lvl {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 12px;
}
.lvl span { flex: 0 0 auto; color: var(--muted); }
.lvl b {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  text-align: right;
  min-width: 0;
  line-height: 1.35;
}
.hide { display: none; }

.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }

.setup-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.setup-banner {
  padding: 12px 12px 11px;
  background: linear-gradient(180deg, #1a1e28, #12151e);
  border-bottom: 1px solid var(--line);
}
.setup-kicker {
  display: inline-flex;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
}
.setup-banner strong {
  display: block;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
  line-height: 1.25;
}
.setup-pair {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
}
.setup-card.long .setup-banner {
  background: linear-gradient(180deg, rgba(62, 224, 138, 0.16), #12151e);
  border-bottom-color: rgba(62, 224, 138, 0.25);
}
.setup-card.long .setup-banner strong { color: var(--bull); }
.setup-card.short .setup-banner {
  background: linear-gradient(180deg, rgba(255, 93, 115, 0.16), #12151e);
  border-bottom-color: rgba(255, 93, 115, 0.25);
}
.setup-card.short .setup-banner strong { color: var(--bear); }
.setup-card.arm-long .setup-banner,
.setup-card.arm-short .setup-banner {
  background: linear-gradient(180deg, rgba(255, 154, 60, 0.16), #12151e);
  border-bottom-color: rgba(255, 154, 60, 0.28);
}
.setup-card.pending-long .setup-banner,
.setup-card.pending-short .setup-banner {
  background: linear-gradient(90deg, rgba(240, 193, 75, 0.14), transparent);
}
.setup-card.pending-long .setup-banner strong,
.setup-card.pending-short .setup-banner strong { color: var(--gold); }
.plan-block .setup-card { margin-top: 10px; }
.setup-card.plan-dim { opacity: 0.72; }
.chart-signal .tag.limit { color: var(--gold); }

.reason-list {
  list-style: none;
  display: grid;
  gap: 0;
}
.reason-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  align-items: start;
}
.reason-list li:first-child { border-top: 0; }
.reason-list .n {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--gold);
  padding-top: 2px;
}
.reason-list p {
  font-size: 12.5px;
  line-height: 1.5;
  color: #d5dbe8;
}
.reason-list li.skeleton p { color: var(--muted); }

@media (max-width: 1280px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr) 280px; }
}

html.narrow,
html.narrow body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}
html.narrow .app {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
}
html.narrow .topbar {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px 10px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
html.narrow .brand { min-width: 0; padding-right: 88px; }
html.narrow .brand small { display: none; }
html.narrow .live-pill,
html.narrow .ticker { display: none; }
html.narrow .clock {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 12px;
  margin: 0;
  text-align: right;
  line-height: 1.2;
}
html.narrow .clock b { font-size: 11px; white-space: nowrap; }
html.narrow .clock small { display: none; }
html.narrow .search {
  -webkit-box-flex: 0;
  flex: none;
  width: 100%;
  min-width: 0;
  max-width: none;
}
html.narrow .search input {
  font-size: 16px;
  height: 42px;
}
html.narrow .search-list {
  left: 0;
  right: 0;
  width: 100%;
  max-height: 240px;
}
html.narrow .alert-wrap {
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  width: 100%;
}
html.narrow .alert-btn,
html.narrow .alert-mini {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
}

html.narrow .layout {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
  overflow: visible;
  min-height: 0;
}
html.narrow .radar {
  -webkit-box-ordinal-group: 2;
  order: 1;
  max-height: none;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: rgba(8, 10, 16, 0.88);
}
html.narrow .radar-head {
  position: static;
  padding: 10px 12px 6px;
}
html.narrow #radarList {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 0 12px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  font-size: 0;
}
html.narrow .rcard {
  display: inline-block;
  vertical-align: top;
  white-space: normal;
  font-size: 13px;
  width: 156px;
  min-width: 156px;
  max-width: 156px;
  margin: 0 8px 0 0;
  overflow: hidden;
  -webkit-transform: none;
  transform: none;
}
html.narrow .rcard:hover {
  -webkit-transform: none;
  transform: none;
}
html.narrow .chart-wrap {
  -webkit-box-ordinal-group: 3;
  order: 2;
  overflow: visible;
  min-height: 0;
}
html.narrow .chart-head {
  -webkit-box-orient: vertical;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px 6px;
}
html.narrow .pair-row {
  -webkit-box-orient: vertical;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}
html.narrow .chart-head h1 { font-size: 18px; }
html.narrow .tf-pills {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  font-size: 0;
}
html.narrow .tf-pills button {
  display: inline-block;
  font-size: 11px;
  margin-right: 4px;
}
html.narrow .last-wrap {
  text-align: left;
  width: 100%;
  min-width: 0;
}
html.narrow .last-wrap strong { font-size: 22px; }
html.narrow .src {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.narrow .tv-toolbar { justify-content: flex-start; }
html.narrow .chart-signal {
  margin: 0 12px 8px;
  gap: 6px 10px;
}
html.narrow .chart-signal .lvls,
html.narrow .chart-signal .when {
  -webkit-box-flex: 1;
  flex: 1 1 100%;
  white-space: normal;
  word-break: break-word;
}
html.narrow .tv-box {
  -webkit-box-flex: 0;
  flex: none;
  width: 100%;
  height: 300px;
  min-height: 280px;
  max-height: 340px;
  padding: 0 8px 10px;
}
html.narrow #tvHost {
  width: 100%;
  height: 300px;
}
html.narrow #tvHost iframe,
html.narrow #tvHost table {
  height: 100%;
}
html.narrow .open-wrap,
html.narrow .history-wrap { padding: 0 12px 12px; }
html.narrow #openList,
html.narrow #historyList {
  display: block;
  overflow: visible;
  white-space: normal;
  padding-bottom: 8px;
  font-size: 13px;
}
html.narrow #openList .hcard,
html.narrow #historyList .hcard {
  display: block;
  vertical-align: top;
  white-space: normal;
  font-size: 13px;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0 0 8px;
  overflow: hidden;
}
html.narrow .hist-head {
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 8px;
}
html.narrow .panel {
  -webkit-box-ordinal-group: 4;
  order: 3;
  border-left: 0;
  border-top: 1px solid var(--line);
  overflow: visible;
  padding: 12px 12px 24px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
html.narrow .panel .grid { grid-template-columns: 1fr 1fr; }
html.narrow .ohlc span { font-size: 10px; padding: 3px 6px; }
html.narrow .tv-toolbar button { padding: 8px 10px; }

@media (max-width: 900px) {
  html, body, .app {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    max-width: 100%;
  }
  .layout {
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: vertical;
    flex-direction: column;
    overflow: visible;
  }
  .radar { -webkit-box-ordinal-group: 2; order: 1; overflow: hidden; border-right: 0; }
  .chart-wrap {
    -webkit-box-ordinal-group: 3;
    order: 2;
    overflow: visible;
  }
  .panel { -webkit-box-ordinal-group: 4; order: 3; border-left: 0; }
  .live-pill, .ticker { display: none; }
  #radarList {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    font-size: 0;
    -webkit-overflow-scrolling: touch;
  }
  .rcard {
    display: inline-block;
    vertical-align: top;
    white-space: normal;
    font-size: 13px;
    margin: 0 8px 0 0;
    overflow: hidden;
    -webkit-transform: none;
    transform: none;
    width: 156px;
    min-width: 156px;
    max-width: 156px;
  }
  #openList,
  #historyList {
    display: block;
    overflow: visible;
    white-space: normal;
    font-size: 13px;
  }
  #openList .hcard,
  #historyList .hcard {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0 0 8px;
    overflow: hidden;
    white-space: normal;
    font-size: 13px;
    -webkit-transform: none;
    transform: none;
  }
  .tv-box, #tvHost { height: 280px; min-height: 260px; }
  .src {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
