/* r19g dense — tabbar keep-alive companion; Brand+logo; TV-like TF dropdown. */

/* --- 0) Kill Binance TF row --- */
.phone .tf, .tf {
  display: none !important; height: 0 !important; min-height: 0 !important; max-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important; overflow: hidden !important;
  opacity: 0 !important; pointer-events: none !important;
}
.tf-more-sheet { display: none !important; }

/* --- 1) Remove duplicate status + symbol/price top bar --- */
.phone .status,
.phone .top {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
/* phone already has padding-top: env(safe-area-inset-top) — keep under notch */
.phone {
  padding-top: env(safe-area-inset-top, 0px) !important;
}
.phone .screen {
  padding-top: 0 !important;
}
.phone .chart-block {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  position: relative !important;
}

/* --- 2) Park alert --- */
#alert-block.hj-res-parked {
  position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important;
  padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; border: 0 !important;
  opacity: 0 !important; pointer-events: none !important;
}

.phone .ops { flex-shrink: 0 !important; }
.phone .ops:not(.hid) { max-height: 46% !important; }
.phone .ops.hid { display: none !important; height: 0 !important; padding: 0 !important; margin: 0 !important; }
.phone .split.collapsed {
  height: 44px !important; min-height: 44px !important; display: flex !important;
  align-items: center !important; justify-content: center !important;
  color: var(--yellow) !important; font-size: 14px !important; font-weight: 700 !important;
  letter-spacing: 0.04em !important; padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  border-top: 1px solid #2a2f36 !important; background: #0f1318 !important;
}
/* r19b: #ia-tabbar owns safe-area — don't double-pad 打开面板 above it */
.phone.ia-ready .split.collapsed {
  padding-bottom: 0 !important;
  height: 44px !important; min-height: 44px !important;
}
.phone .split.collapsed .knob { display: none !important; }
.phone .split.collapsed:after { content: "打开面板" !important; }

/* r19c: fab clears ind-bar (WR/网格); sits in 打开面板 band just above tabbar */
.phone.ia-ready .fab {
  /* 40px ball fits in 打开面板 band: clears ind WR and sits on tabbar top edge */
  bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  right: 10px !important;
  width: 40px !important;
  height: 40px !important;
  font-size: 11px !important;
  z-index: 32 !important;
}
.phone.ia-ready .fab span { font-size: 8px !important; }

/* --- 3) Brand row (logo + gold title + 我) --- */
#hj-brand-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 40px;
  min-height: 40px;
  max-height: 44px;
  padding: 0 0 0 10px;
  box-sizing: border-box;
  background: #0b0e11;
  border-bottom: 1px solid #1e2329;
  z-index: 6;
}
.hj-brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.hj-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex: none;
  object-fit: cover;
  background: #0b0e11;
}
.hj-brand-title {
  color: var(--yellow, #f0b90b);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

/* 「我」on brand bar right */
#ia-me-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  border-left: 1px solid #2a323c !important;
  background: transparent !important;
  color: var(--yellow, #f0b90b) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  display: none !important;
}
.phone.ia-ready #hj-brand-bar #ia-me-btn,
.phone.ia-ready #ia-me-btn.hj-in-brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.phone.ia-ready #hj-brand-bar:has(#ia-me-btn) {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
}
/* never leave me floating or on ind-bar in chart tab */
.phone.ia-ready .ind-bar #ia-me-btn { display: none !important; }
.phone.ia-ready:not(.ia-tab-quotes):not(.ia-tab-positions):not(.ia-tab-history) > #ia-me-btn:not(.hj-in-brand) {
  display: none !important;
}

/* --- 3b) Custom TF strip (TV-like) --- */
#hj-tf-bar {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  background: #0b0e11;
  border-bottom: 1px solid #1e2329;
  z-index: 5;
}
#hj-tf-bar .hj-tf-scroll {
  display: flex;
  align-items: stretch;
  height: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 0 4px;
  gap: 2px;
}
#hj-tf-bar .hj-tf-scroll::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
#hj-tf-bar .hj-tf-scroll button {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 10px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text, #eaecef);
  font-size: 13px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#hj-tf-bar .hj-tf-scroll button.on {
  background: #2a2f36; /* dark-theme equiv of TV gray selected */
  color: #eaecef;
}
#hj-tf-bar .hj-tf-more {
  color: var(--muted, #848e9c) !important;
  font-size: 16px !important;
  min-width: 44px !important;
  padding: 0 8px !important;
  transition: transform .15s ease;
  transform-origin: 50% 55%;
}

/* TF dropdown (TV-like) — replaces bottom sheet matrix */
#hj-tf-sheet { display: none !important; } /* legacy kill */
#hj-tf-bar .hj-tf-more.open {
  color: var(--yellow, #f0b90b) !important;
  transform: rotate(180deg);
}
#hj-tf-drop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}
#hj-tf-drop.on { display: block; pointer-events: auto; }
#hj-tf-drop .hj-tf-drop-mask {
  position: absolute; inset: 0; background: transparent;
}
#hj-tf-drop .hj-tf-menu {
  position: absolute;
  z-index: 1;
  width: 200px;
  max-height: 60%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  background: #1a1f27;
  border: 1px solid #2a323c;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  padding: 4px 0;
  box-sizing: border-box;
}
#hj-tf-drop .hj-tf-menu::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
#hj-tf-drop .hj-tf-group {
  padding: 6px 14px 2px;
  color: #848e9c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
#hj-tf-drop .hj-tf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 12px 0 14px;
  margin: 0;
  border: 0;
  background: transparent;
  color: #eaecef;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#hj-tf-drop .hj-tf-row:active { background: #242b34; }
#hj-tf-drop .hj-tf-row.on {
  color: var(--yellow, #f0b90b);
  background: #2a2416;
}
#hj-tf-drop .hj-tf-lab { flex: 1; min-width: 0; }
#hj-tf-drop .hj-tf-star {
  flex: 0 0 44px;
  width: 44px;
  min-height: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5c6570;
  font-size: 18px;
  line-height: 1;
}
#hj-tf-drop .hj-tf-star.on { color: var(--yellow, #f0b90b); }

/* brand logo always visible box */
.hj-brand-logo {
  background: #0b0e11;
  object-fit: contain;
}

/* --- 4) Ribbon chip — same yellow as MACD .on --- */
#hj-ribbon-btn {
  flex: none !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 10px !important;
  color: var(--muted, #848e9c) !important;
  background: transparent !important;
  border: 0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}
#hj-ribbon-btn.on,
.ind-scroll #hj-ribbon-btn.on,
.ind-scroll button#hj-ribbon-btn.on {
  color: var(--yellow, #f0b90b) !important;
  font-weight: 800 !important;
}
.hj-ind-sep {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: #2a323c;
  align-self: center;
}

/* --- 5) Resonance rail — clear of TV logo (bottom-left) --- */
#hj-res-rail {
  position: absolute;
  left: 0;
  top: auto;
  bottom: 28%; /* upper MACD — clear of canvas TV logo */
  z-index: 14;
  width: 44px;
  height: 64px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#hj-res-rail .pill {
  width: 9px; height: 52px; border-radius: 0 10px 10px 0;
  background: #1a1f27; border: 1px solid #3a4450; border-left: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  color: #e8c07a; font-size: 9px; font-weight: 700; letter-spacing: .08em;
  writing-mode: vertical-rl; text-orientation: mixed; pointer-events: none;
}
#hj-res-rail:active .pill, #hj-res-rail.pressed .pill,
#hj-res-rail.open .pill { background: #2a2416; border-color: #f0b90b; color: #f0b90b; width: 12px; }
.phone.ia-tab-quotes #hj-res-rail,
.phone.ia-tab-positions #hj-res-rail,
.phone.ia-tab-history #hj-res-rail { display: none !important; }

/* --- 6) Resonance strip: no title; clear of time axis --- */
#hj-res-layer {
  position: absolute; left: 0; right: 0; z-index: 22; display: none; pointer-events: none;
}
#hj-res-layer.on { display: block; pointer-events: auto; }
#hj-res-layer .hj-res-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.18); opacity: 0; transition: opacity .16s ease;
}
#hj-res-layer.on .hj-res-mask { opacity: 1; }
#hj-res-layer .hj-res-panel {
  position: absolute; left: 0; top: auto; bottom: 0;
  width: var(--hj-res-w, 280px); max-width: 82%; height: auto; max-height: 100%;
  background: #12161c; border: 1px solid #2a323c; border-left: 0; border-radius: 0 10px 10px 0;
  box-shadow: 6px 0 18px rgba(0,0,0,.5);
  transform: translateX(-102%); transition: transform .16s ease;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 6px 36px 6px 10px; box-sizing: border-box;
}
#hj-res-layer.on .hj-res-panel { transform: translateX(0); }
#hj-res-layer .hj-res-hd { display: none !important; }
#hj-res-layer .hj-res-x {
  position: absolute; top: 0; right: 0; border: 0; background: transparent; color: #848e9c;
  width: 44px; height: 44px; font-size: 18px; display: flex; align-items: center; justify-content: center; z-index: 1;
}
#hj-res-layer .hj-res-body { flex: 0 1 auto; min-height: 0; overflow: hidden; padding: 0; margin: 0; }
#hj-res-layer .hj-c { display: flex; flex-direction: column; gap: 3px; }
#hj-res-layer .hj-line { font-size: 12px; line-height: 1.3; margin: 0; }
#hj-res-layer .hj-line .k { color: #848e9c; font-weight: 600; }
#hj-res-layer .hj-line .v { color: #e8a93a; font-weight: 700; }
#hj-res-layer .hj-warn { font-size: 11px; line-height: 1.3; color: #f0b90b; margin: 0; }
#hj-res-layer .hj-warn .k { color: #848e9c; font-weight: 600; }

/* --- 7) Ops toggles hot zone --- */
.ops .stat { min-height: 28px !important; position: relative; }
#hj-stat-hot { position: absolute; z-index: 6; display: flex; pointer-events: auto; }
#hj-stat-hot button {
  flex: 1 1 0; min-width: 0; min-height: 44px; height: 100%; margin: 0; padding: 0; border: 0;
  border-radius: 6px; background: transparent; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#hj-stat-hot button:active { background: rgba(26,31,39,.55); }
