/* Loading/error overlays need no expensive blur of the chart underneath. */
#chart-loading, #chart-loading-4h { backdrop-filter:none; background:#0b0e14; }
#chart-loading button { min-height:40px; padding:6px 12px; border:1px solid #46566c; border-radius:5px; background:#202c3e; color:#dce5ef; cursor:pointer; }
:root {
  /* Values are supplied by ui-config.js. Fallbacks keep the page usable if
     that file is unavailable. Change the config, not individual selectors. */
  --fd-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fd-base-font-size: 14px;
  --fd-topbar-height: 56px;
  --fd-market-strip-height: 52px;
  --fd-statusbar-height: 30px;
  --fd-tool-rail-width: 46px;
  --fd-signal-panel-width: 65vw;
  --fd-signal-collapsed-width: 42px;
  --fd-signal-font-body: 13.5px;
  --fd-signal-font-small: 12px;
  --fd-signal-font-heading: 15.5px;
  --fd-signal-font-title: 16.5px;
  --fd-price-pane-min-height: 220px;
  --fd-indicator-pane-min-height: 82px;
  --fd-price-axis-width: 80px;
  --fd-indicator-dock-height: 32px;
  --drag-cursor: grab;
  --surface-soft: #121824;
  --surface-hover: #192131;
  --indicator-count: 3;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
  font-family: var(--fd-font-family);
  font-size: var(--fd-base-font-size);
}

body {
  position: fixed;
  inset: 0;
}

.app {
  height: 100%;
  height: 100dvh;
  grid-template-rows: var(--fd-topbar-height) var(--fd-market-strip-height) minmax(0, 1fr) var(--fd-statusbar-height);
}

.topbar,
.subbar { background: linear-gradient(180deg, #111722 0%, #0d121b 100%); }
.topbar {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 1px 0 #ffffff06;
  scrollbar-width: none;
  white-space: nowrap;
}
.topbar::-webkit-scrollbar { display: none; }
.symbol-button { flex: 0 0 230px; height: 44px; min-width: 230px; }
.symbol-button strong { font-size: 15px; line-height: 17px; }
.symbol-button small { font-size: 11px; }
.top-action,
.icon-button { height: 37px; }
.top-action { padding-inline: 13px; }
.icon-button { width: 39px; }
.topbar .timeframes { flex: 0 0 auto; min-width: 0; overflow: visible; }
.timeframes { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.timeframes::-webkit-scrollbar { display: none; }
.timeframes button { position: relative; min-width: 48px; height: 33px; padding-inline: 12px; transition: color .15s ease, background .15s ease; }
.timeframes button.active { color: #e8efff; background: #24375f; box-shadow: inset 0 -2px 0 #5f8cff; }
.main-view-label { padding-inline: 12px; color: #dbe5ff !important; background: #1d2c4b !important; font-weight: 700; letter-spacing: .2px; }
.topbar .top-spacer { min-width: 8px; }
.topbar .session-label { flex: 0 0 auto; }

.mobile-market-dock, .mobile-signal-tabs, .mobile-chart-selector { display: none; }

.token-logo {
  --logo-a: #2962ff;
  --logo-b: #82a5ff;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border: 1px solid #ffffff24;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--logo-a), var(--logo-b));
  box-shadow: inset 0 1px 0 #ffffff2a, 0 4px 12px #0005;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.5px;
  text-shadow: 0 1px 2px #0007;
}
.selected-token-logo { width: 29px; height: 29px; font-size: 14px; }
.list-token-logo { width: 29px; height: 29px; }
.mini-token-logo { width: 19px; height: 19px; font-size: 8px; box-shadow: inset 0 1px 0 #ffffff24; }
.micro-token-logo { width: 15px; height: 15px; font-size: 6px; border-width: 0; box-shadow: none; }
.symbol-identity { display: flex; align-items: center; min-width: 0; gap: 9px; }
.symbol-identity > span:last-child { min-width: 0; }

.statusbar a[href*="tradingview.com"] {
  color: #4d5665;
  opacity: .55;
  font-size: 8px;
  transition: opacity .15s ease, color .15s ease;
}

.statusbar a[href*="tradingview.com"]:hover {
  color: #8792a5;
  opacity: .9;
}

.workspace {
  grid-template-columns: var(--fd-tool-rail-width) minmax(0, 1fr) var(--fd-signal-panel-width);
  transition: grid-template-columns .18s ease;
}

.workspace.is-resizing-signal { transition: none; }

.workspace.signal-collapsed {
  grid-template-columns: var(--fd-tool-rail-width) minmax(500px, 1fr) var(--fd-signal-collapsed-width);
}

.chart-stack {
  position: relative;
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(var(--fd-price-pane-min-height), 2.2fr) repeat(var(--indicator-count), minmax(var(--fd-indicator-pane-min-height), 1fr));
  overflow: hidden;
  overscroll-behavior: none;
}

/* Double-click pane maximize.  The selected pane stays mounted so its data,
   visible range and renderer state remain intact; only sibling panes are
   temporarily removed from layout. */
.chart-stack.is-pane-maximized {
  grid-template-rows: minmax(0, 1fr) !important;
}

.chart-stack.is-pane-maximized > .chart-panel:not(.is-pane-maximized),
.chart-stack.is-pane-maximized > .indicator-panel:not(.is-pane-maximized) {
  display: none !important;
}

.chart-stack.is-pane-maximized > .is-pane-maximized {
  display: block !important;
  min-height: 0;
}

.custom-time-axis {
  position: absolute;
  z-index: 7;
  right: var(--fd-price-axis-width);
  bottom: var(--fd-indicator-dock-height);
  left: 0;
  height: 23px;
  overflow: hidden;
  pointer-events: none;
  color: #7d8799;
  background: linear-gradient(180deg, transparent 0, #0b0e14 5px, #0b0e14 100%);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-stack { padding-bottom: var(--fd-indicator-dock-height); }

.indicator-control-dock {
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: var(--fd-indicator-dock-height);
  min-width: 0;
  border-top: 1px solid #293243;
  background: #0f141d;
  box-shadow: 0 -3px 10px #0004;
}

.indicator-control-list {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 100%;
  padding: 3px 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.indicator-control-list::-webkit-scrollbar { display: none; }
.indicator-dock-empty { padding: 0 8px; color: #657186; font-size: 10px; white-space: nowrap; }

.indicator-dock-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 25px;
  overflow: hidden;
  border: 1px solid #2b3547;
  border-radius: 5px;
  color: #c8d0de;
  background: #151c28;
  transition: border-color .12s ease, background .12s ease, opacity .12s ease;
}
.indicator-dock-chip:hover,
.indicator-dock-chip:focus-within { border-color: #435474; background: #1b2535; }
.indicator-dock-chip.is-hidden { opacity: .55; border-style: dashed; }
.indicator-dock-chip.is-dragging { opacity: .72; border-color: #6c8fe0; background: #233554; }
.indicator-dock-drag,
.indicator-dock-name,
.indicator-dock-action {
  height: 23px;
  padding: 0;
  color: inherit;
}
.indicator-dock-drag {
  width: 17px;
  color: #647087;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.indicator-dock-drag:active { cursor: grabbing; }
.indicator-dock-name {
  max-width: 190px;
  padding: 0 6px 0 2px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.indicator-dock-action {
  display: grid;
  place-items: center;
  width: 21px;
  border-left: 1px solid #283244;
  color: #7f8ca2;
  font-size: 11px;
}
.indicator-dock-action:hover { color: #fff; background: #27334a; }
.indicator-dock-remove { font-size: 15px; }
.indicator-dock-clock {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 82px;
  padding: 0 9px;
  border-left: 1px solid #2a3343;
  color: #d7dee9;
  background: #111823;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .25px;
}

/* Indicator controls now live in the bottom dock. */
.price-panel .main-indicator-control,
.main-indicator-stack-toggle,
.indicator-actions-pane { display: none !important; }

.custom-time-axis span {
  position: absolute;
  bottom: 3px;
  transform: translateX(-50%);
  line-height: 12px;
}

.custom-time-axis span::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 1px;
  height: 4px;
  background: #343c4c;
}

.crosshair-time-label {
  position: absolute;
  z-index: 2;
  bottom: 0;
  min-width: max-content;
  height: 23px;
  padding: 3px 10px 0;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #30343b;
  color: #f4f5f7;
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04);
  white-space: pre;
}

.crosshair-time-label[hidden] { display: none; }

.price-panel {
  cursor: crosshair;
}

.liquidity-indicator-panel {
  border-top: 1px solid var(--line);
}

.indicator-values .red b {
  color: var(--red);
}

.indicator-values .purple b {
  color: #d28bff;
}

.indicator-panel {
  border-top: 1px solid var(--line);
}

.price-chart-left { position: relative; width: 100%; height: 100%; min-width: 0; overflow: hidden; }
.price-chart-right, .desktop-chart-mode, .dual-price-time-axis { display: none; }
#shared-chart-readout { display: none; }
/* Controls remain in the indicator dock; titles must not cover candles. */
#chart-stack .indicator-legend, #chart-stack .main-indicator-control,
#chart-stack .main-indicator-stack-toggle { display: none !important; }
@media (min-width: 681px) {
  .chart-stack { --fd-shared-readout-height: 44px; padding-top: var(--fd-shared-readout-height); box-sizing: border-box; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0,2.2fr) minmax(0,1fr) minmax(0,2.2fr) minmax(0,1fr); }
  #shared-chart-readout { display: flex; flex-direction: column; justify-content: center; gap: 3px; position: absolute; top: 0; left: 0; right: 0; height: var(--fd-shared-readout-height); padding: 3px 10px; box-sizing: border-box; background: #101722; border-bottom: 1px solid #30394a; font-size: 11px; pointer-events: none; }
  #shared-chart-readout > div { display: flex; gap: 8px; min-width: 0; white-space: nowrap; }
  #shared-chart-interval, #shared-chart-time { color: #97a7bf; }
  #shared-chart-ohlc { overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  #chart-stack .chart-legend, #chart-stack .dual-chart-heading, #chart-stack .dual-chart-ohlc { display: none !important; }
  .chart-stack > .price-panel { grid-column: 1 / -1; grid-row: 1; }
  .chart-stack > .price-panel-4h { grid-column: 1; grid-row: calc(var(--indicator-count) + 2); }
  #custom-time-axis { right: var(--fd-price-axis-width); bottom: calc(50% + (var(--fd-indicator-dock-height) - var(--fd-shared-readout-height)) / 2); }
  #indicator-time-axis-4h { display: block; left: 0; right: var(--fd-price-axis-width); bottom: var(--fd-indicator-dock-height); }
  .indicator-panel::after { content: attr(data-chart-timeframe); position: absolute; right: 88px; top: 5px; z-index: 5; color: #8691a5; font-size: 11px; pointer-events: none; }
  .chart-stack.is-pane-maximized > .is-pane-maximized { grid-column: 1 / -1 !important; grid-row: 1 !important; }
  .chart-stack.is-pane-maximized #custom-time-axis { bottom: var(--fd-indicator-dock-height); }
  .chart-stack[data-maximized-side="left"] #indicator-time-axis-4h { display: none; }
  .chart-stack[data-maximized-side="right"] #custom-time-axis { display: none; }
  .chart-stack[data-maximized-side="right"] #indicator-time-axis-4h { left: 0; }
  #timeframes { display: none; }
  .desktop-chart-mode { display: inline-block; white-space: nowrap; color: #d7dce7; padding: 0 12px; }
  .price-chart-left { width: 100%; }
  .price-chart-right { display: block; position: relative; min-height: 0; border-top: 1px solid #30394a; overflow: hidden; }
  .dual-chart-heading { position: absolute; top: 10px; left: 14px; z-index: 4; pointer-events: none; display: flex; gap: 8px; }
  .dual-chart-heading span { color: #8691a5; }
  .dual-chart-ohlc { position: absolute; top: 33px; left: 14px; right: 80px; z-index: 4; pointer-events: none; color: #a7b2c6; font-size: 11px; white-space: nowrap; overflow: hidden; }
  .dual-price-time-axis { display: block; position: absolute; bottom: 0; left: 0; right: 80px; height: 26px; z-index: 5; pointer-events: none; overflow: hidden; background: #0b0e14; border-top: 1px solid #242a38; color: #8691a5; font-size: 11px; }
  .dual-price-time-axis span { position: absolute; top: 5px; transform: translateX(-50%); white-space: nowrap; }
}
#indicator-time-axis-4h { pointer-events: none; }
#indicator-time-axis-4h[hidden] { display: none; }
.ttm-main-background {
  position: absolute;
  z-index: 1;
  inset: 0 var(--fd-price-axis-width) 27px 0;
  width: calc(100% - var(--fd-price-axis-width));
  height: calc(100% - 27px);
  pointer-events: none;
}

#ratio-chart { z-index: 1; }
.ratio-band {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.icon-button:disabled {
  opacity: .28;
  cursor: default;
}

.history-button svg,
.layout-save-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-button svg { display: block; }
.redo-button svg { transform: scaleX(-1); }
.layout-save-action { gap: 5px; }
.layout-save-action svg { width: 14px; height: 14px; stroke-width: 1.55; }

.indicator-legend {
  gap: 14px;
  align-items: flex-start;
}

.chart-legend,
.indicator-legend { top: 10px; left: 14px; }
.symbol-large { font-size: 15px; }
.chart-legend .instrument-line { display: flex; align-items: center; gap: 5px; }
.chart-legend .legend-info { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend-toggle { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 2px; border: 0; border-radius: 4px; color: #7f8da4; background: transparent; font-size: 13px; line-height: 1; opacity: 0; pointer-events: none; transform: translateY(2px); transition: opacity .14s ease, transform .14s ease, color .14s ease, background .14s ease; }
.chart-legend:hover .chart-legend-toggle,
.chart-legend:focus-within .chart-legend-toggle { opacity: 1; pointer-events: auto; transform: translateY(0); }
.chart-legend-toggle:hover { color: #fff; background: #252d3e; }
.chart-legend.is-collapsed .legend-info,
.chart-legend.is-collapsed .legend-details { display: none; }
.chart-legend.is-collapsed .chart-legend-toggle { opacity: 1; pointer-events: auto; transform: none; }
.ohlc-line { margin-top: 5px; font-size: 11px; }
.indicator-legend > div:first-child b { font-size: 10px; font-weight: 650; }
.indicator-legend > div:first-child span { font-size: 8px; }
.indicator-values { display: none; }
.indicator-values em { font-size: 10px; padding: 4px 6px; }

.indicator-actions,
.main-indicator-control {
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: auto;
}

.indicator-actions,
.main-indicator-control button {
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity .14s ease, transform .14s ease;
}

.indicator-panel:hover .indicator-actions,
.indicator-panel:focus-within .indicator-actions,
.price-panel:hover .main-indicator-control button,
.main-indicator-control:focus-within button {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.indicator-values span i {
  font-style: normal;
  color: inherit;
}

.indicator-actions button,
.main-indicator-control button {
  width: 23px;
  height: 22px;
  border-radius: 4px;
  color: #7d8799;
  font-size: 12px;
}

.indicator-actions button:hover,
.main-indicator-control button:hover {
  color: #fff;
  background: #252d3e;
}

/* Indicator picker is an add menu, not an on/off switch. */
.indicator-list .indicator-choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid #202634;
  text-align: left;
  cursor: pointer;
}
.indicator-list .indicator-choice:hover { background: #181e2a; }
.indicator-list .indicator-choice.is-active { background: #151e31; }
.indicator-list .indicator-choice b,
.indicator-list .indicator-choice small { display: block; }
.indicator-list .indicator-choice b { font-size: 12px; }
.indicator-list .indicator-choice small { margin-top: 4px; color: #6f798d; font-size: 9px; }
.indicator-list .indicator-choice > strong { color: #79a0ff; font-size: 20px; font-weight: 500; }
.indicator-actions button[data-indicator-action="move-up"],
.indicator-actions button[data-indicator-action="move-down"] { color: #94a7d7; }

.indicator-actions button.is-hidden,
.main-indicator-control button.is-hidden {
  color: #ffb74d;
  background: #3d2d1b;
}

.main-indicator-control {
  position: absolute;
  z-index: 5;
  pointer-events: auto;
  top: 8px;
  right: 84px;
  min-height: 25px;
  padding: 2px 4px 2px 8px;
  border: 1px solid #252c3a;
  border-radius: 5px;
  background: #10151ddd;
}

.main-indicator-stack-toggle {
  position: absolute;
  z-index: 6;
  top: 42px;
  left: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid #3a4353;
  border-radius: 4px;
  color: #d7dce6;
  background: #0c1017e8;
  font-size: 13px;
  line-height: 1;
  opacity: .88;
}
.main-indicator-stack-toggle:hover { color: #fff; border-color: #66738a; background: #1b2230; }
.price-panel.main-indicators-collapsed .main-indicator-control { display: none !important; }

@media (max-width: 680px) {
  .main-indicator-stack-toggle { top: 70px; }
}

.close-level-control { right: 220px; }
.pullback-control { right: 352px; }
.capitulation-control { right: 484px; }
.squeeze-chase-control { right: 616px; }
.relative-breakout-control { right: 748px; }

.main-indicator-control span {
  color: #8993a7;
  font-size: 9px;
  margin-right: 4px;
}

.settings-modal {
  width: min(440px, 92vw);
}

.settings-section-title {
  margin: 8px 0 0;
  padding: 8px 2px 3px;
  border-top: 1px solid #273044;
  color: #ffd54f;
  font-size: 11px;
}

.layout-modal { width: min(480px, 92vw); }
.layout-editor { display: grid; gap: 7px; padding: 17px 18px 13px; }
.layout-editor label { color: #8e98aa; font-size: 10px; }
.layout-editor input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #30394d;
  border-radius: 5px;
  outline: 0;
  color: #e0e5ed;
  background: #0b0e15;
}
.layout-editor input:focus { border-color: #2962ff; box-shadow: 0 0 0 1px #2962ff44; }
.layout-list { max-height: 260px; overflow: auto; padding: 0 18px 8px; }
.layout-empty { padding: 25px 10px; text-align: center; color: #657086; font-size: 10px; border: 1px dashed #293244; border-radius: 6px; }
.layout-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: stretch; border-bottom: 1px solid #202735; }
.layout-row.active { background: #17243a; }
.layout-load { min-width: 0; padding: 10px; text-align: left; }
.layout-load span, .layout-load small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.layout-load span { color: #d6dce7; font-size: 11px; }
.layout-load small { margin-top: 3px; color: #69768b; font-size: 8px; }
.layout-rename { margin: 8px 5px; border-radius: 4px; color: #7f8ba0; font-size: 9px; }
.layout-load:hover, .layout-rename:hover { color: #fff; background: #222c3f; }

.telegram-action span { margin-right: 4px; color: #63a5ff; }
.telegram-action.is-active { color: #8fc0ff; background: #1c3152; }
.telegram-modal { width: min(620px, 94vw); max-height: min(820px, 92vh); }
#telegram-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
#telegram-dialog > .modal-head,#telegram-dialog > .settings-footer { flex-shrink:0; }
#telegram-dialog > .telegram-fields { min-height:0; overflow-y:auto; }
.telegram-fields { display: grid; gap: 14px; max-height: calc(92vh - 132px); overflow-y: auto; padding: 18px; }
.telegram-preview { height: 150px; overflow: hidden; border: 1px solid #2c3445; border-radius: 6px; background: #080b10; }
.telegram-preview img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.telegram-fields > label { display: grid; grid-template-columns: 1fr 180px; align-items: center; gap: 20px; }
.telegram-fields small, .telegram-fields p { color: #758095; font-size: 10px; line-height: 1.55; }
.telegram-fields small { display: block; margin-top: 4px; }
.telegram-fields p { margin: 0; padding: 11px; border-left: 2px solid #2962ff; background: #171d29; }
.telegram-fields select { height: 35px; padding: 0 9px; border: 1px solid #30394d; border-radius: 5px; outline: 0; color: #d7dce7; background: #0b0e15; }
.telegram-schedule { padding: 8px 10px; border: 1px solid #2c3b52; border-radius: 5px; color: #9fc0f3; background: #142038; font-size: 10px; }
.telegram-modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.telegram-modes label { display: flex; align-items: flex-start; gap: 7px; min-width: 0; padding: 9px; border: 1px solid #293246; border-radius: 6px; cursor: pointer; background: #101620; }
.telegram-modes label:has(input:checked) { border-color: #4779df; background: #172743; }
.telegram-modes input { margin-top: 2px; accent-color: #4b83f5; }
.telegram-modes b, .telegram-modes small { display: block; }
.telegram-modes b { color: #dbe2ed; font-size: 10px; }
.telegram-auto-alert { padding: 10px 11px; border: 1px solid #35435a; border-radius: 6px; background: #121b29; }
.telegram-auto-alert b { color: #e3e9f3; font-size: 11px; }
.telegram-auto-alert input { justify-self: end; accent-color: #4b83f5; }
.telegram-signal-picker { display: grid; gap: 8px; padding: 11px; border: 1px solid #35435a; border-radius: 6px; background: #101824; }
.telegram-signal-picker header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.telegram-signal-picker header b { color: #e3e9f3; font-size: 11px; }
.telegram-signal-picker header small { display: block; margin-top: 3px; }
.telegram-signal-picker header button { padding: 5px 8px; border: 1px solid #3d537a; border-radius: 4px; color: #bcd0f6; background: #17253b; font-size: 9px; }
.telegram-signal-options { display: flex; flex-wrap: wrap; gap: 6px; }
.telegram-signal-options label { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid #303c52; border-radius: 4px; color: #9eabc0; background: #0c121c; cursor: pointer; font-size: 9px; }
.telegram-signal-options label:has(input:checked) { border-color: #4b79cf; color: #e2eaff; background: #182944; }
.telegram-signal-options input { margin: 0; accent-color: #4b83f5; }
.telegram-text-preview { min-height: 150px; max-height: 240px; margin: 0; overflow: auto; white-space: pre-wrap; padding: 12px; border: 1px solid #2c3445; border-radius: 6px; color: #c8d1df; background: #080b10; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.telegram-resonance-options { display: flex; gap: 8px; }
.telegram-resonance-options label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid #2d3950; border-radius: 5px; color: #aeb9ca; font-size: 10px; background: #131b28; }
.telegram-resonance-options input { accent-color: #4b83f5; }
#telegram-start:disabled { opacity: .45; cursor: default; }
.telegram-composer { display: grid; gap: 9px; padding: 11px; border: 1px solid #2c3445; border-radius: 7px; background: #0d121b; }
.telegram-ticker-lock { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #7e899c; font-size: 10px; }
.telegram-ticker-lock b { padding: 5px 8px; border: 1px solid #36517d; border-radius: 4px; color: #9dc1ff; background: #14233b; font-size: 11px; }
.telegram-template-field { display: grid; gap: 7px; }
.telegram-template-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.telegram-template-field textarea { width: 100%; min-height: 112px; resize: vertical; padding: 10px; border: 1px solid #30394d; border-radius: 5px; outline: 0; color: #d9e0eb; background: #080b10; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.telegram-template-field textarea:focus { border-color: #4779df; box-shadow: 0 0 0 2px rgba(71,121,223,.13); }
.telegram-token-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.telegram-token-buttons button { padding: 6px 8px; border: 1px solid #33415a; border-radius: 4px; color: #aebbd0; background: #151e2c; font-size: 9px; }
.telegram-token-buttons button:hover { border-color: #4f79c7; color: #dce8fa; background: #1c2a40; }
#telegram-template-reset { margin-left: auto; color: #7f8999; }

.signal-monitor {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #101620 0%, #0d121a 100%);
}

.signal-resize-handle {
  position: absolute;
  z-index: 12;
  top: 0;
  bottom: 0;
  left: 0;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}
.signal-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: transparent;
  transition: background .15s, box-shadow .15s;
}
.signal-resize-handle:hover::after,
.signal-resize-handle:focus-visible::after,
.signal-panel-resizing .signal-resize-handle::after { background: #5f8cff; box-shadow: 0 0 8px #5f8cff66; }
.signal-monitor.is-collapsed .signal-resize-handle { display: none; }
.signal-panel-resizing, .signal-panel-resizing * { cursor: col-resize !important; user-select: none !important; }

.signal-monitor-head {
  height: 38px;
  display: grid;
  grid-template-columns: 28px 28px;
  justify-content: end;
  align-items: center;
  gap: 2px;
  padding: 0 7px;
  border-bottom: 1px solid var(--line);
}

.signal-monitor-head > div { display: none; }
.signal-monitor-head b,
.signal-monitor-head span { display: block; }
.signal-monitor-head b { font-size: 14px; color: #eef2f9; letter-spacing: .15px; }
.signal-monitor-head span { margin-top: 3px; color: #7c879b; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal-monitor-head button { width: 27px; height: 27px; border-radius: 5px; color: #7e899d; font-size: 15px; }
.signal-monitor-head button:hover { color: #fff; background: #222a39; }

.signal-view-rail {
  position: absolute;
  z-index: 11;
  top: 38px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  padding-top: 7px;
  border-left: 1px solid #252d3b;
  background: #0d121a;
}
.signal-view-rail button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 34px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #7d8798;
}
.signal-view-rail button:hover { color: #edf2f8; background: #1c2330; }
.signal-view-rail button.active { border-color: #3b4658; color: #f4f7fb; background: #252d3a; }
.signal-view-rail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.signal-monitor.is-collapsed .signal-view-rail { display: none; }

.signal-monitor-body {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  height: calc(100% - 38px);
  padding: 8px 48px 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #30394a transparent;
}

.relay-visibility-control { display: flex; justify-content: flex-end; padding: 5px 10px 1px; }
.relay-visibility-control button { display: grid; place-items: center; width: 27px; height: 25px; border: 1px solid #384153; border-radius: 5px; background: #151b25; }
.relay-visibility-control button:hover,
.relay-visibility-control button.active { border-color: #c65358; background: #321d23; box-shadow: 0 0 8px rgba(226, 87, 92, .18); }
.relay-visibility-control i { width: 9px; height: 9px; border-radius: 50%; background: #e2575c; box-shadow: 0 0 5px rgba(226, 87, 92, .48); }
#relay-short-toggle { display: flex; align-items: center; justify-content: center; gap: 5px; width: auto; padding: 4px 7px; color: #cbd5e1; white-space: nowrap; }
#relay-short-toggle:not(.active) i { opacity: .35; box-shadow: none; }
#relay-visibility-control { gap: 6px; }
#stock-perp-only-toggle { width: auto; padding: 4px 7px; color: #cbd5e1; white-space: nowrap; }
#stock-perp-only-toggle.active { border-color: #e5c34b; background: #433b21; color: #ffe382; box-shadow: none; }
#relay-visibility-control[hidden] { display: none; }

.strategy-state-pairs { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; }
.strategy-state-pairs .c1-relay-state-dot:nth-of-type(3) { margin-right: 3px; }
.strategy-direction-marker { display: inline-flex; align-items: center; justify-content: center; width: 10px; height: 14px; font-size: 12px; font-weight: 950; line-height: 1; }
.strategy-direction-marker.long { color: #39dc9d; text-shadow: 0 0 5px rgba(57, 220, 157, .48); }
.strategy-direction-marker.short { color: #ef6267; text-shadow: 0 0 5px rgba(239, 98, 103, .42); }
.strategy-direction-marker.close { color: #f3f5f8; text-shadow: 0 0 4px rgba(255, 255, 255, .28); }

.signal-watchlist-section { padding-bottom: 8px; }
.signal-watchlist-head { display: flex; align-items: baseline; justify-content: space-between; min-height: 42px; padding: 0 10px; }
.signal-watchlist-head b { color: #f0d979; font-size: 14px; }
.signal-watchlist-head small { color: #748095; font-size: 9px; }
.signal-watchlist-table { overflow: hidden; border: 1px solid #273143; border-radius: 7px; background: #0d131c; font-variant-numeric: tabular-nums; }
.signal-watchlist-columns,
.signal-watchlist-row { display: grid; grid-template-columns: minmax(78px, 1fr) minmax(78px, .9fr) 58px; align-items: center; min-height: 31px; padding: 0 8px; gap: 6px; }
.signal-watchlist-columns { min-height: 27px; color: #657186; background: #111925; font-size: 9px; }
.signal-watchlist-columns span:nth-child(n+2) { text-align: right; }
.signal-watchlist-row { width: 100%; border-top: 1px solid #1e2735; color: #cbd2dd; text-align: left; content-visibility: auto; contain-intrinsic-size: 31px; }
.signal-watchlist-row:hover { background: #182232; }
.signal-watchlist-row > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.signal-watchlist-row b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.signal-watchlist-row em,
.signal-watchlist-row strong { text-align: right; font-size: 10px; font-style: normal; font-weight: 600; white-space: nowrap; }
.signal-watchlist-row strong.up { color: #25bfa7; }
.signal-watchlist-row strong.down { color: #ef5d62; }
.signal-watchlist-row strong.flat { color: #9aa4b4; }


@media (min-width: 681px) {
  .signal-view-hidden { display: none !important; }
}

.signal-monitor.is-collapsed .signal-monitor-head {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 7px 5px;
}
.signal-monitor.is-collapsed .signal-monitor-head > div,
.signal-monitor.is-collapsed #signal-refresh,
.signal-monitor.is-collapsed .signal-monitor-body { display: none; }
.signal-monitor.is-collapsed #signal-collapse { transform: rotate(180deg); }
.signal-monitor small[hidden] { display: none !important; }

.market-movers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 4px 14px;
  min-width: 0;
  height: var(--fd-market-strip-height);
  padding: 4px 10px;
  overflow-x: hidden;
  overflow-y: hidden;
  border-bottom: 1px solid #202736;
  background: #0c1119;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
.market-movers::-webkit-scrollbar { display: none; }
.market-movers[hidden] { display: none; }
.market-movers[aria-hidden="true"] { padding-block: 0; border-bottom: 0; }
.market-movers .market-consensus-strip { grid-column: 1; grid-row: 1; }
.mover-line { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.mover-line[hidden] { display: none !important; }
.mover-line > b { flex: 0 0 auto; color: #8995a8; font-size: 12px; white-space: nowrap; }
.market-movers .mover-track { overflow-x: auto; }
.mover-track {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}
.mover-track::-webkit-scrollbar { display: none; }
.mover-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; min-height: 27px; padding: 3px 7px; border: 1px solid #283244; border-radius: 14px; color: #cbd3df; background: #141b27; font-size: 10px; }
.mover-chip:hover { border-color: #40516d; background: #1b2535; }
.mover-chip b { font-size: 10px; }
.mover-chip span:last-child { font-variant-numeric: tabular-nums; }
.mover-chip.up span:last-child { color: #66d9b0; }
.mover-chip.down span:last-child { color: #f27c7a; }
.mover-chip.strong { border-color: #304f68; background: #10202d; }
.mover-chip.strong span:last-child { color: #65c9ff; }
.mover-empty { color: #667286; font-size: 11px; }

.sidebar-block { min-width: 0; overflow: hidden; border: 1px solid #293448; border-radius: 9px; background: #0f151f; box-shadow: 0 6px 18px #0002; }
.sidebar-block-title { padding: 8px 11px; border-bottom: 1px solid #252f40; color: #93a1b6; background: #131b28; font-size: 9px; font-weight: 700; letter-spacing: .25px; }
.sidebar-block .signal-section:last-child { border-bottom: 0; }

.mainstream-signal-overview { flex: 0 0 auto; border-color: #3d4654; background: #111722; }
.mainstream-signal-head { display: flex; align-items: baseline; justify-content: space-between; min-height: 38px; padding: 0 10px; border-bottom: 1px solid #293244; background: #151c28; }
.mainstream-signal-head b { color: #f0d979; font-size: 14px; letter-spacing: .25px; }
.mainstream-signal-head small { color: #8490a4; font-size: 9px; font-variant-numeric: tabular-nums; }
.mainstream-signal-body { display: grid; gap: 9px; padding: 9px 10px 10px; font-variant-numeric: tabular-nums; }
.mainstream-signal-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 8px; }
.mainstream-signal-row-title { color: #aab5c6; font-size: 10px; font-weight: 850; white-space: nowrap; }
.mainstream-signal-metrics { display: grid; min-width: 0; gap: 4px; }
.mainstream-signal-metrics.cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mainstream-signal-metrics.strategy { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mainstream-signal-metric { display: flex; align-items: center; justify-content: center; min-width: 0; gap: 4px; min-height: 25px; padding: 2px 4px; border: 1px solid #303b4f; border-radius: 5px; color: #9da9bb; background: #151d29; }
.mainstream-signal-metric b { min-width: 0; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mainstream-signal-metric strong { font-size: 10px; }
.mainstream-signal-metric.rising,
.mainstream-signal-metric.long { border-color: #25624f; color: #70dfb7; background: #122820; }
.mainstream-signal-metric.falling,
.mainstream-signal-metric.short { border-color: #6a3539; color: #ff8584; background: #2d191d; }
.mainstream-signal-metric.flat { border-color: #566070; color: #f0f2f5; background: #242b35; }
.mainstream-signal-track { grid-column: 1 / -1; display: flex; width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: #252d3a; }
.mainstream-signal-track i { display: block; height: 100%; min-width: 0; }
.mainstream-signal-track .rising,
.mainstream-signal-track .long { background: #39c995; }
.mainstream-signal-track .falling,
.mainstream-signal-track .short { background: #e1555a; }
.mainstream-signal-track .flat { background: #eef1f5; }
.mainstream-signal-track .unknown { background: #596274; }
.mainstream-signal-waiting { color: #7d899d; font-size: 8px; text-align: right; }
.mainstream-volume-ranking { border-top: 1px solid #293244; background: #101722; }
.mainstream-volume-ranking > header { display: flex; align-items: center; justify-content: space-between; min-height: 31px; padding: 0 10px; }
.mainstream-volume-ranking > header b { color: #f0d979; font-size: 11px; }
.mainstream-volume-ranking > header small { color: #7f8ba0; font-size: 8px; font-variant-numeric: tabular-nums; }
.mainstream-volume-list { gap: 5px; padding: 0 8px 9px; }
.mainstream-volume-list > .funding-rank-more { flex-basis: 100%; width: 100%; }
.funding-rank-more > summary { cursor: pointer; padding: 5px; border: 1px dashed #303b4e; border-radius: 5px; color: #8390a5; font-size: 11px; text-align: center; }
.mainstream-volume-symbol { max-width: 100%; border-color: #344157; background: #151d29; }
.mainstream-volume-symbol.negative-funding { border-color: #2f8d68; background: #123126; box-shadow: inset 0 0 0 1px rgba(83, 218, 163, .12); }
.mainstream-volume-symbol > span:nth-of-type(1) { font-size: 10px; }
.mainstream-volume-funding { color: #82a8d8; font-size: 8px; font-style: normal; font-weight: 850; font-variant-numeric: tabular-nums; }
.mainstream-volume-symbol.negative-funding .mainstream-volume-funding { color: #6ee0b3; }
.mainstream-volume-states,
.mainstream-volume-arrows,
.mainstream-volume-cycles { display: inline-flex; align-items: center; gap: 2px; }
.mainstream-volume-states { gap: 5px; }
.mainstream-volume-cycle { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 14px; padding: 0 2px; border-radius: 3px; font-size: 7px; font-weight: 900; line-height: 1; }
.mainstream-volume-cycle.rising { color: #171307; background: #f1cf43; }
.mainstream-volume-cycle.falling { color: #ffe5e3; background: #a83f43; }

.long-trigger-block { border-color: #3b644f; background: #0e1717; }
.long-trigger-list { display: grid; gap: 4px; padding: 6px 8px 8px; }
.long-trigger-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 4px 6px; border: 1px solid #285240; border-radius: 6px; color: #d4e6dc; background: #11231f; text-align: left; }
.long-trigger-row:hover { border-color: #4b9a76; background: #16352c; }
.long-trigger-row span { min-width: 0; }
.long-trigger-row b { display: block; color: #8ce0b8; font-size: 10px; }
.long-trigger-row small { display: block; margin-top: 2px; overflow: hidden; color: #718e82; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.long-trigger-row strong { color: #9aeac2; font-size: 10px; font-variant-numeric: tabular-nums; }
.long-trigger-empty { padding: 9px 4px; color: #6d7f7a; font-size: 9px; text-align: center; }
.volume-movers-block { border-color: #2e3b53; background: #0e141e; }
.volume-movers-list { display: grid; gap: 6px; padding: 0 8px 9px; }
.volume-mover-timeframe { overflow: hidden; border: 1px solid #273349; border-radius: 7px; background: #111824; }
.volume-mover-timeframe-head { display: flex; align-items: center; justify-content: space-between; min-height: 25px; padding: 0 7px; border-bottom: 1px solid #222d40; }
.volume-mover-timeframe-head b { color: #cbd5e4; font-size: 10px; }
.volume-mover-timeframe-head small { color: #69778e; font-size: 8px; }
.volume-mover-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px; padding: 5px; }
.volume-mover-column { min-width: 0; }
.volume-mover-column-title { display: block; padding: 2px 3px 4px; color: #68768c; font-size: 8px; font-weight: 800; letter-spacing: .3px; }
.volume-mover-column.up .volume-mover-column-title { color: #65d3ac; }
.volume-mover-column.down .volume-mover-column-title { color: #f07e7b; }
.volume-mover-row { display: grid; grid-template-columns: 15px 16px minmax(0, 1fr) auto; align-items: center; gap: 3px; width: 100%; min-height: 24px; padding: 2px 3px; border-radius: 4px; color: #cbd3df; background: transparent; text-align: left; }
.volume-mover-row:hover { background: #222d40; }
.volume-mover-row .volume-mover-rank { color: #66748a; font-size: 8px; font-variant-numeric: tabular-nums; }
.volume-mover-row b { min-width: 0; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.volume-mover-row strong { font-size: 8px; font-variant-numeric: tabular-nums; }
.volume-mover-row small { grid-column: 3 / 5; color: #68768c; font-size: 7px; font-variant-numeric: tabular-nums; }
.volume-mover-row.up strong { color: #72d8b5; }
.volume-mover-row.down strong { color: #ff8c88; }
.volume-movers-empty { padding: 8px 4px; color: #69768a; font-size: 9px; text-align: center; }
.direction-ranking-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  padding: 7px;
  border-bottom: 1px solid #252f40;
  background: #101722;
  font-variant-numeric: tabular-nums;
}
.direction-ranking-strip[hidden] { display: none !important; }
.direction-ranking-group { min-width: 0; }
.direction-ranking-group.up { border-color: #2c8f6e; background: #11271f; }
.direction-ranking-group.down { border-color: #9a4648; background: #2b181b; }
.direction-ranking-group.up .signal-card-head > span { color: #69dfb7; }
.direction-ranking-group.down .signal-card-head > span { color: #ff8583; }
.direction-ranking-group .signal-members { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.direction-ranking-group .signal-members::-webkit-scrollbar { display: none; }
.direction-ranking-group .signal-members > i { color: #6f7c90; font-size: 8px; font-style: normal; }
.direction-rank-chip { flex: 0 0 auto; border: 1px solid; }
.direction-rank-chip.up { border-color: #2f9d77; color: #c9f5e4; background: #17382d; }
.direction-rank-chip.down { border-color: #b65154; color: #ffd0ce; background: #402124; }
.direction-rank-chip.up:hover { border-color: #62ddb0; background: #20513f; }
.direction-rank-chip.down:hover { border-color: #ff8583; background: #5a2b2e; }
.direction-rank-chip strong { font-size: 9px; }
.direction-rank-chip.up strong { color: #69dfb7; }
.direction-rank-chip.down strong { color: #ff8583; }

.market-consensus-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 42px;
  padding-top: 3px;
  border-top: 1px solid #1d2635;
}
.market-consensus-strip[hidden] { display: none !important; }
.market-consensus-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.market-consensus-label b { color: #aab5c7; font-size: 10px; }
.market-consensus-label em { padding: 2px 5px; border-radius: 4px; color: #cfdaea; background: #1a2331; font-size: 9px; font-style: normal; font-weight: 800; }
.market-consensus-bar { display: flex; min-width: 0; height: 23px; overflow: hidden; border: 1px solid #323c4d; border-radius: 999px; background: #171e2a; box-shadow: inset 0 1px 3px #0008; }
.market-consensus-bar > span { display: flex; align-items: center; justify-content: center; width: 0; height: 100%; overflow: hidden; transition: width .22s ease; }
.market-consensus-bar strong { min-width: 0; overflow: hidden; color: #fff; font-size: 8px; font-weight: 800; line-height: 1; text-align: center; text-overflow: clip; text-shadow: 0 1px 2px #000a; white-space: nowrap; }
.market-consensus-bar .long { background: #26a69a; }
.market-consensus-bar .short { background: #ef5350; }
.market-consensus-bar .flat { background: #e2e7ef; }
.market-consensus-bar .flat strong { color: #26303e; text-shadow: none; }

.universe-summary-row b em,
.consensus-detail-section summary b em {
  margin-left: 5px;
  color: #8cb0ff;
  font-style: normal;
  font-size: 10px;
}
.universe-summary-row {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
}
.universe-summary-row > span { min-width: 0; }
.universe-summary-row b,
.universe-summary-row small { display: block; }
.universe-summary-row b { color: #f0d979; font-size: 14px; }
.universe-summary-row small { margin-top: 3px; color: #778297; font-size: 10px; }
.universe-summary-row > button {
  flex: 0 0 auto;
  min-width: 52px;
  height: 29px;
  padding: 0 10px;
  border: 1px solid #3a527d;
  border-radius: 5px;
  color: #a9c3ff;
  background: #192944;
  font-size: 11px;
  font-weight: 750;
}
.universe-summary-row > button:hover { color: #fff; border-color: #5c7db5; background: #243a60; }
#stock-perp-toggle { margin-left: auto; white-space: nowrap; }
#stock-perp-toggle.active { color: #fff; border-color: #60a5fa; background: #234269; }
#stock-perp-toggle[hidden] { display: none; }

.universe-manager-dialog { width: min(820px, 94vw); height: min(690px, 88vh); }
.universe-manager-body { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; height: calc(100% - 120px); padding: 14px 16px 10px; }
.universe-manager-body .universe-thresholds { grid-row: 1; margin: 0; }
.universe-manager-body .universe-thresholds[hidden] { display: none; }
.universe-manager-search {
  grid-row: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 38px;
  align-items: center;
  height: 38px;
  overflow: hidden;
  border: 1px solid #30394d;
  border-radius: 7px;
  color: #7d8799;
  background: #0b0e15;
}
.universe-manager-search:focus-within { border-color: #466ed9; }
.universe-manager-search > span { padding-left: 11px; font-size: 14px; }
.universe-manager-search input { min-width: 0; height: 100%; padding: 0 9px; border: 0; outline: 0; color: #dce2eb; background: transparent; font-size: 12px; }
.universe-manager-search button { height: 100%; color: #8fb1ff; border-left: 1px solid #30394d; background: #182844; font-size: 18px; }
.universe-manager-search button:hover { color: #fff; background: #29467b; }
.universe-manager-columns { grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 0; }
.universe-manager-pane { display: grid; grid-template-rows: 39px minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #293245; border-radius: 8px; background: #0b1018; }
.universe-manager-pane > header { display: flex; align-items: center; justify-content: space-between; padding: 0 11px; border-bottom: 1px solid #293245; background: #111925; }
.universe-manager-pane > header b { color: #d7deea; font-size: 12px; }
.universe-manager-pane > header em { min-width: 27px; padding: 3px 6px; border-radius: 10px; color: #9bb7ef; background: #1d2c47; text-align: center; font-size: 9px; font-style: normal; font-weight: 800; }
.universe-selected-actions { display: flex; align-items: center; gap: 7px; }
.universe-selected-actions button {
  min-width: 42px;
  height: 25px;
  padding: 0 8px;
  border: 1px solid #70404a;
  border-radius: 5px;
  color: #ff9cab;
  background: #2a171d;
  font-size: 10px;
  font-weight: 800;
}
.universe-selected-actions button:hover:not(:disabled) { color: #fff; border-color: #a65361; background: #49232b; }
.universe-selected-actions button:disabled { cursor: default; opacity: .42; }
.universe-selected-actions button[hidden] { display: none; }
.universe-manager-list,
.universe-manager-body .universe-list,
.universe-manager-body .universe-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  align-content: start;
  gap: 6px;
  max-height: none;
  min-height: 0;
  margin: 0;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #38445a transparent;
}
.universe-manager-list .universe-row { min-height: 34px; }
.universe-manager-body .universe-suggestions .universe-symbol { display: flex; grid-template-columns: none; padding: 0 6px; }
.universe-manager-body .universe-suggestions .universe-add-one { display: block; padding: 0; text-align: center; }
.universe-manager-list .universe-symbol b { font-size: 11px; }
.universe-add-one { color: #65d8ad; font-size: 17px; }
.universe-add-one:hover { color: #fff; background: #173a31; }
.universe-manager-body .universe-remove { color: #ff8d9d; font-size: 17px; }
.universe-manager-body .universe-remove:hover { color: #fff; background: #46242d; }
.universe-editor { padding: 0 9px 10px; }
.universe-thresholds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-bottom: 7px; }
.universe-threshold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  padding: 7px 8px;
  border: 1px solid #293245;
  border-radius: 5px;
  color: #8d98aa;
  background: #101620;
  font-size: 11px;
}
.universe-threshold > span:last-child { display: flex; align-items: center; gap: 5px; }
.universe-threshold input {
  width: 68px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid #344159;
  border-radius: 4px;
  outline: 0;
  color: #e1e6ef;
  background: #090d14;
  text-align: right;
}
.universe-threshold input:focus { border-color: #4b75d6; }
.universe-threshold i { color: #6f7b90; font-style: normal; }
.universe-threshold-apply {
  grid-column: 1 / -1;
  height: 28px;
  min-width: 66px;
  padding: 0 9px;
  border: 1px solid #365795;
  border-radius: 5px;
  color: #a9c3ff;
  background: #1b3159;
  font-size: 11px;
  font-weight: 700;
}
.universe-threshold-apply:hover { color: #fff; background: #27477e; }
.universe-add { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 5px; }
.universe-add input {
  min-width: 0;
  height: 29px;
  padding: 0 8px;
  border: 1px solid #2a3345;
  border-radius: 5px;
  outline: 0;
  color: #d6dce6;
  background: #0a0e15;
  font-size: 11px;
}
.universe-add input:focus { border-color: #3f6bcf; }
.universe-add button { border-radius: 5px; color: #8fb1ff; background: #1d3156; font-size: 11px; }
.universe-add button:hover { color: #fff; background: #29467b; }
.universe-suggestions { display: none; gap: 3px; margin-top: 5px; padding: 5px; border: 1px solid #293245; border-radius: 5px; background: #0b1018; }
.universe-suggestions.visible { display: grid; }
.universe-suggestions button { display: grid; grid-template-columns: 19px minmax(0, 1fr) 15px; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 3px; text-align: left; }
.universe-suggestions button:hover { background: #202a3b; }
.universe-suggestions b { color: #d5dbe6; font-size: 10px; }
.universe-suggestions i { color: #79a1ff; font-style: normal; }
.universe-list-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: #aeb8c8; font-size: 10px; font-weight: 700; }
.universe-list-label small { color: #66748a; font-size: 9px; font-weight: 500; }
.universe-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; max-height: 104px; margin-top: 6px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; border: 0; border-radius: 5px; scrollbar-width: thin; scrollbar-color: #30394a transparent; }
.universe-row { display: grid; grid-template-columns: minmax(0, 1fr) 24px; min-height: 29px; overflow: hidden; border: 1px solid #252e3e; border-radius: 5px; background: #0c1119; }
.universe-symbol { display: flex; align-items: center; min-width: 0; padding: 0 6px; text-align: left; }
.universe-symbol:hover { background: #182131; }
.universe-identity { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.universe-symbol b { color: #d1d7e2; font-size: 10px; }
.universe-remove { color: #667286; font-size: 14px; }
.universe-remove:hover { color: #ff8d9d; background: #3a2029; }

#mtf-ratio-4 { color: #8faeff; font-variant-numeric: tabular-nums; }

.signal-section { border-bottom: 1px solid #202736; }
.signal-section summary { min-height: 51px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; cursor: pointer; list-style: none; }
.signal-section summary::-webkit-details-marker { display: none; }
.signal-section summary:hover { background: #151b26; }
.signal-section summary b,
.signal-section summary small { display: block; }
.signal-section summary b { color: #e1e6ef; font-size: 13px; }
.signal-section summary small { margin-top: 3px; color: #778297; font-size: 11px; }
.signal-section summary i { color: #657086; font-style: normal; transition: transform .15s; }
.signal-section:not([open]) summary i { transform: rotate(-90deg); }
.signal-list { display: grid; gap: 7px; padding: 0 9px 10px; }
.signal-empty { padding: 16px 8px; text-align: center; color: #717d92; font-size: 12px; border: 1px dashed #2d384c; border-radius: 7px; }
.signal-card { padding: 9px; border: 1px solid #2a3549; border-radius: 8px; background: linear-gradient(145deg, #151c29, #111722); box-shadow: 0 5px 18px #0002; }
.signal-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.signal-direction { padding: 4px 7px; border-radius: 5px; font-size: 11px; font-weight: 800; letter-spacing: .2px; }
.signal-direction.buy { color: #75dbc2; background: #173b35; }
.signal-direction.sell { color: #ff8986; background: #472421; }
.signal-card-head small { color: #8792a6; font-size: 9px; }
.signal-members { display: flex; flex-wrap: wrap; gap: 5px; }
.signal-symbol { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 5px; color: #c8cfda; background: #202a3b; font-size: 11px; }
.c1-relay-symbol { border: 1px solid transparent; }
.c1-relay-member { display: inline-flex; align-items: stretch; }
.c1-relay-member > .c1-relay-symbol { border-radius: 5px 0 0 5px; }
.c1-relay-symbol.ttm-overlap-1 { border-color: rgba(255, 255, 255, .36); }
.c1-relay-symbol.ttm-overlap-2 { border-color: rgba(255, 255, 255, .68); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.c1-relay-symbol.ttm-overlap-3 { border-color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 0 7px rgba(255, 255, 255, .22); }
.c1-relay-positions { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; }
.c1-relay-state-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid transparent; }
.c1-relay-state-dot.long { background: #39dc9d; box-shadow: 0 0 5px rgba(57, 220, 157, .45); }
.c1-relay-state-dot.short { background: #e2575c; box-shadow: 0 0 5px rgba(226, 87, 92, .38); }
.c1-relay-state-dot.flat { border-color: #dfe4ec; background: #f4f6f8; box-shadow: 0 0 4px rgba(255, 255, 255, .28); }
.one-hour-white-cycle-card { border-color: rgba(255, 255, 255, .38); }
.one-hour-white-cycle-card .signal-card-head > span { color: #f3f5f8; }
.one-hour-white-cycle-symbol { border: 1px solid rgba(255, 255, 255, .42); background: rgba(255, 255, 255, .07); }
.one-hour-white-cycle-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 16px; margin-left: 2px; padding: 0 4px; border-radius: 4px; color: #171308; background: #f1cf43; font-size: 9px; font-weight: 900; line-height: 1; }
.one-hour-white-cycle-badge.cycle-2,
.one-hour-white-cycle-badge.cycle-3,
.one-hour-white-cycle-badge.cycle-4 { color: #ffe5e3; background: #a83f43; }
.one-hour-squeeze-release-card { border-color: rgba(72, 214, 158, .48); }
.one-hour-squeeze-release-card .signal-card-head > span { color: #69e0ad; }
.one-hour-squeeze-release-symbol { border: 1px solid rgba(72, 214, 158, .5); background: rgba(31, 121, 87, .14); }
.c56-long-card { border-color: rgba(73, 220, 164, .32); }
.friction-count-box { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 3px; border-radius: 2px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.friction-count-box.red { background: #ef5350; color: #fff; }
.friction-count-box.orange { background: #ff9800; color: #151b25; }
.low-cluster-band { z-index: 2; }
.friction-count-box.relay { background: #244d60; color: #8ce2f6; }
.friction-count-box.benchmark { background: #49401e; color: #ffe174; }
.friction-merged-symbol { flex-wrap: wrap; max-width: 100%; }
.merged-long-badge { color: #34d399; }
.merged-white-badge { color: #fff; font-size: 20px; line-height: 1; }
.c56-long-card .signal-card-head > span { color: #6fe0b8; }
.c56-long-symbol { border: 1px solid rgba(73, 220, 164, .46); border-radius: 5px; background: rgba(25, 80, 65, .24); }
.recent-relay-exit-symbol { border-color: rgba(255, 184, 77, .5); background: rgba(255, 153, 51, .08); }
.recent-relay-exit-symbol em { color: #ffbf69; font-size: 9px; font-style: normal; font-weight: 800; }
.signal-resonance-rank { padding: 2px 4px; border-radius: 4px; color: #93a6c5; background: #111926; font-size: 8px; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.signal-resonance-rank.supportive { color: #74dfc0; background: #153b34; }
.signal-resonance-rank.opposite { color: #ff8f8b; background: #4a2424; }
.signal-resonance-extra { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; height: 14px; border-radius: 3px; font-size: 8px; font-weight: 900; line-height: 1; }
.signal-resonance-extra.cycle { min-width: 19px; padding: 0 3px; color: #181408; background: #f1cf43; }
.signal-resonance-extra.falling-cycle { min-width: 19px; padding: 0 3px; color: #ffe1df; background: #a83f43; }
.signal-resonance-extra.counter { min-width: 31px; padding: 0 3px; color: #c9d1de; background: #313a49; }
.signal-resonance-extra.air-cushion { min-width: 24px; padding: 0 4px; color: #8ff0c8; background: #173b35; border: 1px solid #2e806c; }
.signal-resonance-extra.ttm { min-width: 17px; padding: 0 3px; border: 1px solid #fff; color: #202631; background: #f4f6f8; box-shadow: inset 0 0 0 1px #cfd4dc; }
.relative-strategy-list { display: grid; gap: 6px; padding: 8px; }
.cycle-sync-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 16px; padding: 0 4px; border-radius: 4px; font-size: 9px; font-weight: 900; }
.cycle-sync-badge.relative-cycle-group { min-width: 44px; }
.cycle-sync-badge.relative-cycle-group.rising { color: #151307; background: #ffd400; }
.cycle-sync-badge.relative-cycle-group.falling { color: #ffeceb; background: #b23b42; }
.relative-cycle-item-badge { margin-left: 1px; padding: 1px 4px; border-radius: 3px; font-size: 8px; font-style: normal; font-weight: 900; }
.relative-cycle-item-badge.cycle-6,
.relative-cycle-item-badge.cycle-1 { color: #171307; background: #f1cf43; }
.relative-cycle-item-badge.cycle-2,
.relative-cycle-item-badge.cycle-4 { color: #ffe9e7; background: #9e353b; }
.signal-symbol.featured { padding: 3px 5px; background: transparent; font-weight: 700; }
button.signal-symbol:hover { color: #fff; background: #2a3954; }
.signal-symbol i { margin-left: 2px; color: #7f8da4; font-style: normal; font-size: 8px; }
.leverage-flow-symbol { border: 1px solid transparent; }
.leverage-flow-symbol { border-color: #334156; background: transparent; }
#perp-spot-list .signal-symbol { max-width: 100%; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
#perp-spot-list .signal-symbol small { font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
.leverage-flow-symbol em { margin-left: 2px; color: #9aa8bd; font-size: 8px; font-style: normal; font-weight: 850; }
.friction-cycle-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 16px; margin-left: 2px; padding: 0 3px; border-radius: 3px; font-size: 8px; font-weight: 900; line-height: 1; }
.friction-cycle-badge.rising { color: #171307; background: #f1cf43; }
.friction-cycle-badge.falling { color: #ffe9e7; background: #9e353b; }
.latest-signals-grid { display: grid; gap: 8px; padding: 0 8px 10px; }
.latest-direction-group { overflow: hidden; border: 1px solid #293448; border-radius: 8px; background: #101722; }
.latest-direction-group > header { display: flex; align-items: center; min-height: 29px; padding: 0 8px; border-bottom: 1px solid #222c3d; }
.latest-direction-group > header b { color: #f0d979; font-size: 13px; letter-spacing: .35px; }
.latest-direction-group.complete > header b { color: #f0d979; }
.latest-direction-group > header small { margin-left: auto; overflow: hidden; color: #718e82; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.white-long-overlap-block > header b { color: #f0d979; }
.white-long-overlap-list { display: grid; gap: 4px; min-height: 42px; padding: 5px 7px 7px; }
.white-long-confluence-group { min-width: 0; }
.white-long-confluence-group .signal-card-head > span { color: #f0d979; font-size: 11px; font-weight: 850; }
.white-long-confluence-symbol { border: 1px solid #344157; color: #d1d8e3; background: #202a3b; }
.white-long-confluence-symbol:hover { border-color: #5b6d8b; color: #fff; background: #29364a; }
.latest-opportunity-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 42px; padding: 7px; }
.latest-opportunity-list .signal-empty { width: 100%; padding: 7px; border: 0; font-size: 9px; }
.latest-opportunity-card { display: grid; width: 100%; min-width: 0; max-width: 100%; gap: 5px; padding: 7px; border: 1px solid #38445a; border-radius: 7px; color: #d7deea; background: #182130; text-align: left; }
.latest-opportunity-card:hover { color: #fff; background: #222e41; }
.latest-opportunity-card.buy { border-color: #3bbd82; background: #123329; }
.latest-opportunity-card.buy.same-timeframe { border-color: #6aefae; box-shadow: inset 0 0 0 1px #62e7a544, 0 0 11px #35cf8030; }
.latest-opportunity-card.sell { border-color: #c65452; background: #351b20; }
.latest-opportunity-card.sell.same-timeframe { border-color: #ff8d88; box-shadow: inset 0 0 0 1px #ff8d8838, 0 0 11px #d74d4d25; }
.opportunity-symbol { display: flex; align-items: center; gap: 5px; }
.opportunity-symbol b { font-size: 10px; }
.opportunity-hl-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 14px; padding: 0 3px; border: 1px solid #4fca98; border-radius: 3px; color: #9af2c7; background: #123d30; font-size: 7px; font-style: normal; font-weight: 850; letter-spacing: .15px; line-height: 1; }
.opportunity-symbol em { margin-left: auto; padding: 2px 5px; border-radius: 4px; color: #9eabbf; background: #111824; font-size: 8px; font-style: normal; font-weight: 800; }
.latest-opportunity-card.buy .opportunity-symbol em { color: #b4f8d4; background: #1c5c43; }
.latest-opportunity-card.sell .opportunity-symbol em { color: #ffb0ad; background: #612d30; }
.opportunity-frames { display: flex; flex-wrap: wrap; gap: 4px; }
.opportunity-frame { padding: 3px 5px; border-radius: 4px; color: #9ba9bc; background: #101722; font-size: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opportunity-frame.with-squeeze { color: #f0f3f8; background: #2a3444; box-shadow: inset 0 0 0 1px #ffffff1c; }
.opportunity-frame.cycle-supportive { color: #141820; background: #eef1f5; box-shadow: inset 0 0 0 1px #ffffff; }
.opportunity-frame.cycle-conflict { color: #8f98a8; background: #101319; box-shadow: inset 0 0 0 1px #2a303a; }
.opportunity-frame.cycle-neutral { color: #f1f3f6; background: #59616d; box-shadow: inset 0 0 0 1px #747d8b; }
.signal-section .signal-list-more { display: grid; min-width: 0; }
.signal-section .signal-list-more > summary { min-height: 26px; padding: 0 6px; border: 1px dashed #303b4e; border-radius: 5px; color: #8390a5; background: #111824; font-size: 9px; justify-content: center; }
.signal-section .signal-list-more > summary::-webkit-details-marker { display: none; }
.signal-section .signal-list-more > summary:hover { color: #c7d1df; background: #1b2432; }
.signal-section .signal-list-more[open] > summary { border-style: solid; color: #9eacc0; }
.signal-list-more-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin-top: 5px; }
.relative-breakout-list { display: grid; min-height: 42px; gap: 6px; }
.relative-breakout-list .signal-card { padding: 7px; }
.relative-breakout-symbol.strong { border-color: #43f4a9; color: #e1fff2; background: #0d5a3e; box-shadow: inset 0 0 0 1px #43f4a966; }
.relative-breakout-symbol.confirmed { border-color: #28c981; color: #b9f7d8; background: #12382c; }
.relative-breakout-symbol.short { border-color: #e65b5b; color: #ffd2d2; background: #421f24; }
.relative-breakout-symbol.base-strength { border-color: #35c7ff; color: #d9f6ff; background: #12354a; }
.relative-breakout-symbol.watch { border-color: #d8a927; color: #ffe59a; background: #3b3015; }
.relative-breakout-symbol em { color: inherit; font-size: 8px; font-style: normal; opacity: .78; }
.consensus-detail-section { margin-top: 2px; border-top: 1px solid #263044; }
.consensus-sidebar-block .consensus-detail-section { margin-top: 0; border-top: 0; }
.consensus-detail-section summary { min-height: 51px; }
.consensus-detail-section summary > span { min-width: 0; flex: 1; }
.consensus-detail-metrics { display: flex; gap: 6px; margin-top: 7px; }
.consensus-detail-metrics em { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid #2a3549; border-radius: 6px; background: #111722; color: #8d98aa; font-size: 9px; font-style: normal; text-align: center; white-space: nowrap; }
.consensus-detail-metrics strong { margin-left: 2px; color: #dce3ee; font-size: 10px; }
.consensus-detail-metrics .long { border-color: #214b46; color: #75dbc2; }
.consensus-detail-metrics .short { border-color: #54302f; color: #ff8986; }
.consensus-detail-metrics .flat { color: #9ba5b5; }
.consensus-overview-grid { display: grid; gap: 4px; margin-top: 7px; }
.consensus-overview-grid > span { display: grid; grid-template-columns: 28px repeat(3, minmax(0, 1fr)); align-items: center; gap: 4px; }
.consensus-overview-grid em { color: #bac7da; font-size: 10px; font-style: normal; font-weight: 800; }
.consensus-overview-grid > span > span { min-width: 0; padding: 4px 3px; border: 1px solid #2c374a; border-radius: 5px; color: #8e9aad; background: #111824; font-size: 8px; text-align: center; white-space: nowrap; }
.consensus-overview-grid strong { margin-left: 1px; color: #dce4ef; font-size: 9px; font-variant-numeric: tabular-nums; }
.consensus-overview-grid .long { border-color: #214b46; color: #75dbc2; }
.consensus-overview-grid .short { border-color: #54302f; color: #ff8986; }
.consensus-overview-grid .flat { color: #9ba5b5; }
.consensus-universe-editor { padding-top: 8px; border-top: 1px solid #202736; }
.consensus-universe-editor .universe-list { max-height: 104px; }
.consensus-timeframe-details { display: grid; gap: 9px; padding: 8px; }
.consensus-timeframe-block { overflow: hidden; border: 1px solid #2a3549; border-radius: 9px; background: #0e141f; }
.consensus-timeframe-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid #252f41; }
.consensus-timeframe-head > b { min-width: 34px; color: #dce5f3; font-size: 12px; }
.consensus-timeframe-head > span { min-width: 0; color: #8290a5; font-size: 9px; text-align: right; }
.consensus-timeframe-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.consensus-timeframe-metrics em { padding: 4px 3px; border: 1px solid #2a3549; border-radius: 5px; background: #111926; color: #8d98aa; font-size: 9px; font-style: normal; text-align: center; white-space: nowrap; }
.consensus-timeframe-metrics strong { color: #dce3ee; font-size: 9px; }
.consensus-timeframe-metrics .long { border-color: #214b46; color: #75dbc2; }
.consensus-timeframe-metrics .short { border-color: #54302f; color: #ff8986; }
.consensus-timeframe-groups { display: grid; gap: 6px; padding: 7px; }
.consensus-detail-groups { display: grid; gap: 7px; padding: 8px; }
.consensus-detail-group { display: grid; gap: 7px; padding: 8px; border: 1px solid #283448; border-radius: 8px; background: #111722; }
.consensus-detail-group > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.consensus-detail-group b { font-size: 10px; letter-spacing: .3px; }
.consensus-detail-group small { color: #8490a4; font-size: 9px; }
.consensus-detail-group.long b { color: #75dbc2; }
.consensus-detail-group.short b { color: #ff8986; }
.consensus-detail-group.flat b { color: #9ba5b5; }
.consensus-detail-group.flat .signal-symbol { opacity: .72; }
.consensus-none { color: #667287; font-size: 11px; }

.stock-sector-consensus { border-top: 1px solid #263044; background: #0b111a; }
.stock-sector-consensus-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; }
.stock-sector-consensus-head b { color: #dce5f3; font-size: 11px; }
.stock-sector-consensus-head small { color: #748198; font-size: 9px; text-align: right; }
.stock-sector-consensus-grid { display: grid; gap: 7px; padding: 0 8px 9px; }
.stock-sector-timeframe { overflow: hidden; border: 1px solid #293549; border-radius: 7px; background: #101722; }
.stock-sector-timeframe > summary { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 6px 8px; cursor: pointer; list-style: none; }
.stock-sector-timeframe > summary::-webkit-details-marker { display: none; }
.stock-sector-timeframe > summary b { color: #b9c9e1; font-size: 10px; }
.stock-sector-timeframe > summary small { color: #728098; font-size: 9px; }
.stock-sector-cards { display: grid; gap: 5px; padding: 0 6px 7px; }
.stock-sector-card { overflow: hidden; border: 1px solid #263246; border-radius: 6px; background: #0c121c; }
.stock-sector-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); align-items: center; gap: 5px; min-height: 34px; padding: 5px 7px; cursor: pointer; list-style: none; }
.stock-sector-card > summary::-webkit-details-marker { display: none; }
.stock-sector-card > summary b { overflow: hidden; color: #d4dce8; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.stock-sector-card > summary span { padding: 3px 4px; border-radius: 4px; color: #8f9bad; background: #171f2c; font-size: 8px; font-variant-numeric: tabular-nums; }
.stock-sector-card > summary .long { color: #72d8bd; background: #15352f; }
.stock-sector-card > summary .short { color: #ff8986; background: #3d211f; }
.stock-sector-card-members { display: grid; gap: 5px; padding: 6px; border-top: 1px solid #222d3f; }
.stock-sector-card-members > div { display: grid; grid-template-columns: 33px minmax(0, 1fr); align-items: start; gap: 4px; }
.stock-sector-card-members em { padding-top: 5px; color: #718097; font-size: 8px; font-style: normal; }

.stock-sector-flow-list { display: grid; gap: 5px; padding: 0 8px 9px; }
.peer-rotation-list { display: grid; gap: 6px; padding: 0 8px 9px; }
.peer-rotation-ranking { display: grid; gap: 6px; }
.peer-rotation-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) 52px; gap: 5px 7px; align-items: center; padding: 7px; border: 1px solid #33405a; border-radius: 7px; background: #101927; }
.peer-rotation-card:hover { background: #17243a; }
.peer-rotation-card.is-current { box-shadow: inset 2px 0 0 #6b9eff; }
.peer-rotation-rank { color: #73839a; font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.peer-rotation-card button { min-width: 0; overflow: hidden; padding: 0; color: #e7eef9; font-size: 12px; font-weight: 800; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.peer-rotation-card button:hover { color: #94b8ff; }
.peer-rotation-score { display: grid; place-items: center; min-height: 30px; border-radius: 6px; color: #c9addf; background: #211a32; font-size: 14px; font-weight: 850; font-variant-numeric: tabular-nums; }
.peer-rotation-score.high { color: #f1dcff; background: #422a63; }
.peer-rotation-score.medium { color: #d9b4ff; background: #2c2142; }
.peer-rotation-card .peer-rotation-returns { grid-column: 2 / 4; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.peer-rotation-return { padding: 3px 2px; border-radius: 4px; color: #aeb9c9; background: #172132; font-size: 9px; font-variant-numeric: tabular-nums; text-align: center; }
.peer-rotation-return b { display: block; color: #7d8ba1; font-size: 7px; }
.peer-rotation-return.up { color: #6fe0bd; }
.peer-rotation-return.down { color: #f28e89; }
.peer-rotation-proof { grid-column: 2 / 4; overflow: hidden; color: #8b9ab1; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.peer-rotation-proof b { color: #d8b3fb; font-size: 9px; }
.stock-sector-flow-row { display: grid; grid-template-columns: minmax(0, 1fr) 45px 55px; align-items: center; gap: 6px; min-height: 40px; padding: 6px 7px; border: 1px solid #293448; border-radius: 7px; background: #101722; }
.stock-sector-flow-row b, .stock-sector-flow-row small { display: block; }
.stock-sector-flow-row b { color: #d8e0ec; font-size: 10px; }
.stock-sector-flow-row small { margin-top: 2px; color: #748197; font-size: 8px; }
.stock-sector-flow-row strong { color: #9aa7ba; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.stock-sector-flow-row em { padding: 4px 5px; border-radius: 5px; color: #aeb8c8; background: #202939; font-size: 8px; font-style: normal; text-align: center; }
.stock-sector-flow-row.inflow { border-color: #245147; }
.stock-sector-flow-row.inflow strong, .stock-sector-flow-row.inflow em { color: #72d8bd; }
.stock-sector-flow-row.outflow { border-color: #57302e; }
.stock-sector-flow-row.outflow strong, .stock-sector-flow-row.outflow em { color: #ff8986; }

/* Right strategy panel typography. These four sizes and the panel width are
   supplied by ui-config.js so the whole sidebar can be tuned in one place. */
.signal-monitor { font-size: var(--fd-signal-font-body); }
.signal-monitor-head b { font-size: var(--fd-signal-font-title); }
.signal-monitor-head span,
.sidebar-block-title,
.signal-section summary small,
.signal-card-head small,
.opportunity-frame,
.universe-list-label small,
.consensus-timeframe-head > span,
.consensus-detail-group small,
.stock-sector-consensus-head small,
.stock-sector-timeframe > summary small,
.stock-sector-card > summary span,
.stock-sector-card-members em,
.stock-sector-flow-row small,
.stock-sector-flow-row em { font-size: var(--fd-signal-font-small); }
.signal-section summary b { font-size: var(--fd-signal-font-heading); }
.universe-threshold,
.universe-threshold input,
.universe-threshold-apply,
.universe-add input,
.universe-add button,
.universe-suggestions b,
.universe-list-label,
.universe-symbol b,
.signal-empty,
.signal-direction,
.signal-symbol,
.latest-opportunity-list .signal-empty,
.latest-opportunity-card,
.opportunity-symbol b,
.opportunity-symbol em,
.consensus-overview-grid em,
.consensus-overview-grid > span > span,
.consensus-overview-grid strong,
.consensus-timeframe-head > b,
.consensus-timeframe-metrics em,
.consensus-timeframe-metrics strong,
.consensus-detail-group b,
.consensus-none,
.stock-sector-consensus-head b,
.stock-sector-timeframe > summary b,
.stock-sector-card > summary b,
.stock-sector-flow-row b,
.stock-sector-flow-row strong { font-size: var(--fd-signal-font-body); }
.statusbar { height: 30px; font-size: 10px; }
.drawing-tools button { width: 36px; height: 36px; font-size: 18px; }
.signal-monitor.is-loading #signal-refresh { animation: spin .8s linear infinite; }
.signal-monitor.is-scanning #signal-refresh { animation: spin 1.2s linear infinite; color: #77a6ff; }

.symbol-list-head,
.symbol-row { grid-template-columns: minmax(0, 1fr) 175px; min-height: 54px; }
.market-cell { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.market-activity { display: grid; gap: 2px; text-align: right; font-style: normal; font-size: 8px; color: #8d98aa; }
.market-activity .up { color: #58d6aa; }
.market-activity .down { color: #ef6d6b; }
.market-activity .stock-sector { color: #8fa0ba; font-weight: 500; }
.market-tags i.stock { border-color: #2f7e67; color: #68d8b6; }
.market-tags i.venue-binance {
  border-color: #786421;
  color: #f3cf42;
  background: #2a240e;
  font-weight: 800;
}
.market-tags i.venue-hyperliquid {
  border-color: #28755d;
  color: #65d9ad;
  background: #102b23;
  font-weight: 800;
}
.symbol-row[data-market="stock"] .list-token-logo { border-radius: 7px; }

.workspace-switch { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #293246; border-radius: 7px; background: #0b1018; }
.workspace-switch button { min-width: 55px; height: 27px; padding: 0 9px; border-radius: 5px; color: #7f8ba0; font-size: 11px; font-weight: 700; }
.workspace-switch button:hover { color: #dce3ef; background: #1b2433; }
.workspace-switch button.active { color: #fff; background: #274170; box-shadow: inset 0 -2px #5f8eff; }
.signal-monitor.stock-workspace .universe-thresholds { display: none; }
.signal-monitor.stock-workspace .universe-add { grid-template-columns: minmax(0, 1fr) 52px; }

@media (max-width: 760px) {
  .workspace-switch button { min-width: 48px; padding: 0 6px; }
}

.settings-fields {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.settings-fields label {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 16px;
  color: #aab2c0;
}

.settings-fields label small {
  display: block;
  margin-top: 3px;
  color: #697487;
  font-size: 9px;
}

.settings-fields input[type="number"] {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #30394d;
  border-radius: 5px;
  outline: 0;
  background: #0b0e15;
}

.settings-fields select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #30394d;
  border-radius: 5px;
  outline: 0;
  color: #d7dce7;
  background: #0b0e15;
}

.settings-fields input[type="checkbox"] {
  justify-self: end;
  width: 17px;
  height: 17px;
  accent-color: #2962ff;
}

.setting-color-toggle { display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.settings-fields .setting-color-toggle input[type="checkbox"] { justify-self: auto; }
.settings-fields input[type="color"] {
  width: 42px;
  height: 28px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid #364157;
  border-radius: 6px;
  background: #0b0e15;
  cursor: pointer;
}
.settings-fields input[type="color"]::-webkit-color-swatch-wrapper { padding: 1px; }
.settings-fields input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.setting-fixed-color { width: 42px; height: 28px; border: 1px solid #465268; border-radius: 6px; background: var(--setting-fixed-color); box-shadow: inset 0 0 0 2px #0b0e15; }
.breadth-color-key { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 50%; background: var(--breadth-key); box-shadow: 0 0 5px color-mix(in srgb, var(--breadth-key) 55%, transparent); }
#breadth-source > b { color: #596477; font-weight: 400; }

.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 17px;
  border-top: 1px solid var(--line);
}

.settings-footer button {
  padding: 8px 15px;
  border-radius: 5px;
  color: #8d97aa;
  background: #202635;
}

.settings-footer button.primary {
  color: #fff;
  background: #2962ff;
}

@media (max-width: 950px) {
  .workspace {
    grid-template-columns: 40px minmax(0, 1fr) var(--fd-signal-panel-width);
  }

  .workspace.signal-collapsed { grid-template-columns: 40px minmax(480px, 1fr) 40px; }
}

@media (max-width: 680px) {
  :root { --fd-mobile-nav-height: 64px; --fd-market-strip-height: 36px; }

  html,
  body,
  .app { width: 100%; height: 100dvh; min-height: 0; overflow: hidden; }

  .app {
    position: relative;
    grid-template-rows: minmax(0, 1fr) var(--fd-mobile-nav-height);
  }

  .topbar { display: none; }
  .market-movers {
    position: absolute;
    z-index: 14;
    right: 0;
    bottom: calc(var(--fd-mobile-nav-height) + var(--fd-indicator-dock-height));
    left: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 2px;
    width: 100%;
    height: var(--fd-market-strip-height);
    padding: 2px 7px;
    box-shadow: 0 -3px 10px #0005;
  }
  .market-movers[aria-hidden="true"] { display: none; }
  .market-movers .market-consensus-strip { grid-column: 1; grid-row: 1; width: 100%; }
  .market-consensus-strip { grid-template-columns: auto minmax(0, 1fr); gap: 5px; }
  .market-consensus-label { gap: 4px; }
  .market-consensus-label b { font-size: 9px; }
  .market-consensus-bar strong { font-size: 7px; }
  .topbar .symbol-button,
  .topbar .timeframes { display: none; }
  .topbar .top-action { display: inline-flex; align-items: center; flex: 0 0 auto; }
  .topbar #indicator-button,
  .topbar #layout-save-button,
  .topbar #telegram-button { display: none; }
  .topbar #undo-button,
  .topbar #redo-button,
  .topbar #fullscreen-button { display: none; }
  .live-pill { padding-left: 7px; margin-left: 0; }

  .timeframes { flex: 0 0 auto; }
  .session-label { display: none; }

  .workspace {
    position: relative;
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .workspace.signal-collapsed { grid-template-columns: minmax(0, 1fr) 38px; }
  .drawing-tools { display: none; }

  .chart-stack {
    grid-column: 1 / 3;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    grid-template-rows: minmax(170px, 1.9fr) repeat(var(--indicator-count), minmax(82px, 1fr));
    padding-bottom: calc(var(--fd-indicator-dock-height) + var(--fd-market-strip-height));
  }

  .custom-time-axis { bottom: calc(var(--fd-indicator-dock-height) + var(--fd-market-strip-height)); }

  /* Mobile already exposes the active ticker and every indicator in the
     bottom controls. Remove duplicate in-chart titles to maximise plot area. */
  .price-panel .chart-legend,
  .indicator-panel .indicator-legend { display: none !important; }

  .signal-monitor {
    position: absolute;
    z-index: 20;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(58dvh, calc(100% - 8px));
    max-height: 58dvh;
    border-top: 1px solid #384459;
    border-left: 0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -16px 38px #000c;
    transform: translateY(0);
    visibility: visible;
    transition: transform .22s ease, visibility 0s;
  }

  .signal-resize-handle { display: none; }

  .signal-monitor.is-collapsed {
    width: 100%;
    box-shadow: none;
    transform: translateY(calc(100% + 2px));
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility 0s .22s;
  }

  .signal-monitor-head {
    grid-template-columns: minmax(0, 1fr) 32px 32px;
    justify-content: stretch;
    height: 42px;
    padding: 0 9px 0 12px;
  }
  .signal-monitor-head > div { display: block; min-width: 0; }
  .signal-monitor-head b { font-size: 13px; }
  .signal-monitor-head span { margin-top: 1px; font-size: 9px; }
  .signal-view-rail { display: none; }
  .signal-watchlist-section { display: none !important; }
  .signal-monitor-body { height: calc(100% - 42px); padding: 8px 8px 14px; }
  .signal-monitor.is-collapsed .signal-monitor-head { height: 42px; display: grid; padding: 0 9px 0 12px; }
  .signal-monitor.is-collapsed #signal-collapse { transform: none; }

  .main-indicator-control { right: 74px; }
  .price-panel .close-level-control { top: 70px; }
  .price-panel .pullback-control { top: 98px; }
  .price-panel .capitulation-control { top: 126px; }
  .price-panel .squeeze-chase-control { top: 154px; }
  .price-panel .relative-breakout-control { top: 182px; }
  .ohlc-line { gap: 5px; font-size: 8px; }
  .statusbar { display: none; }

  .indicator-legend > div:first-child span { display: none; }
  .indicator-legend > div:first-child b { font-size: 9px; }
  .indicator-values em { font-size: 9px; }
  .custom-time-axis { font-size: 10px; }
  .indicator-control-list { gap: 3px; padding-inline: 4px; }
  .indicator-dock-chip { height: 24px; }
  .indicator-dock-drag,
  .indicator-dock-name,
  .indicator-dock-action { height: 22px; }
  .indicator-dock-name { max-width: 126px; padding-inline: 3px; font-size: 9px; }
  .indicator-dock-drag { width: 14px; }
  .indicator-dock-action { width: 19px; font-size: 10px; }
  .indicator-dock-remove { font-size: 14px; }
  .indicator-dock-clock { min-width: 88px; padding-inline: 6px; font-size: 9px; }

  .mobile-market-dock {
    position: relative;
    z-index: 24;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    height: var(--fd-mobile-nav-height);
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid #313948;
    background: linear-gradient(180deg, #10151f 0%, #080b11 100%);
    box-shadow: 0 -8px 24px #0008;
    backdrop-filter: blur(10px);
  }

  .mobile-wheel-column {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }


  .mobile-wheel-column button {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0 7px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-wheel-neighbor { display: none; }
  .mobile-wheel-current {
    height: 100%;
    color: #f0f3f8;
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .1px;
    transform: translate3d(0, var(--mobile-wheel-offset, 0px), 0);
    transition: transform .18s cubic-bezier(.22, .8, .3, 1), color .15s ease, background .15s ease;
    will-change: transform;
  }
  .mobile-wheel-column.is-dragging .mobile-wheel-current { transition: none; }
  .mobile-wheel-column.is-settling .mobile-wheel-current { transition-duration: .16s; }
  .mobile-wheel-column.is-dragging .mobile-wheel-current { color: #8fb0ff; }

  .mobile-dock-action {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 0;
    border-left: 1px solid #252c39;
    color: #aab5c7;
    background: transparent;
    transition: color .15s ease, background .15s ease, transform .12s ease;
  }
  .mobile-dock-action:active { color: #fff; background: #1d2c4b; transform: scale(.94); }
  .mobile-dock-action span { font-size: 17px; font-weight: 750; line-height: 1; }
  .mobile-indicator-action span { color: #8fb0ff; font-family: Georgia, serif; }
  .mobile-workspace-action span { color: #f5bf42; font-size: 16px; }
  .mobile-workspace-action.stock-workspace span { color: #76a7ff; }
  .mobile-save-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  .mobile-telegram-action span { color: #68a3ff; font-size: 18px; transform: translateX(-1px); }
  .mobile-reset-action span { font-size: 20px; font-weight: 500; }

}

/* -------------------------------------------------------------------------
   TradingView-style indicator toolbars

   The pane title is a compact overlay row.  The title stays readable at all
   times, while controls appear only when the pane is hovered/focused (and are
   always available on touch devices, where hover does not exist).  Keeping
   the toolbar over the chart preserves the existing synchronized time scale.
   ------------------------------------------------------------------------- */
.indicator-panel {
  isolation: isolate;
}

.peer-line-label-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.peer-line-label {
  position: absolute;
  min-width: 28px;
  height: 13px;
  padding: 0 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  color: #081019;
  background: var(--peer-label-color, #d7dce7);
  box-shadow: 0 0 0 1px #05080dbd, 0 1px 3px #0008;
  font-size: 9px;
  font-weight: 850;
  line-height: 13px;
  text-align: center;
  white-space: nowrap;
}

.indicator-legend {
  z-index: 6;
  top: 0;
  right: 0;
  left: 0;
  width: auto;
  height: 30px;
  min-width: 0;
  padding: 4px 9px 4px 12px;
  gap: 0;
  align-items: center;
  border-bottom: 1px solid #1d2532;
  background: linear-gradient(180deg, #111721f2 0%, #0e131ce8 100%);
  box-shadow: 0 2px 10px #0003;
  pointer-events: none;
  transition: background .14s ease, border-color .14s ease;
}

.indicator-panel:hover .indicator-legend,
.indicator-panel:focus .indicator-legend,
.indicator-panel:focus-within .indicator-legend {
  border-bottom-color: #2d3b54;
  background: linear-gradient(180deg, #151c29f5 0%, #101722ef 100%);
}

/* Keep indicator titles readable without covering the chart underneath.  The
   title text and hover controls remain visible; only the title container's
   fill/shadow are transparent. */
.indicator-legend,
.indicator-panel:hover .indicator-legend,
.indicator-panel:focus .indicator-legend,
.indicator-panel:focus-within .indicator-legend {
  background: transparent;
  box-shadow: none;
}

.indicator-legend > div:first-child {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.indicator-legend > div:first-child b {
  display: block;
  min-width: 0;
  max-width: min(52vw, 430px);
  overflow: hidden;
  color: #d8dee9;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: .05px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-legend > div:first-child span { display: none; }
.indicator-values { display: none !important; }

.indicator-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 23px;
  margin-left: 7px;
  flex: 0 0 auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(3px);
  transition: opacity .14s ease, transform .14s ease;
}

.indicator-actions-pane {
  margin-left: auto;
  padding-left: 6px;
  border-left: 1px solid #2a3342;
}

.indicator-panel:hover .indicator-actions,
.indicator-panel:focus .indicator-actions,
.indicator-panel:focus-within .indicator-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.indicator-actions button,
.main-indicator-control button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #8b96a9;
  font-size: 13px;
  line-height: 1;
  pointer-events: auto;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}

.indicator-actions button:hover,
.indicator-actions button:focus-visible,
.main-indicator-control button:hover,
.main-indicator-control button:focus-visible {
  outline: none;
  color: #f1f4fa;
  border-color: #3b4b69;
  background: #253149;
}

/* Icon treatment mirrors TradingView's eye / settings / remove / more row. */
.indicator-actions button[data-indicator-action="hide"] {
  font-size: 0;
}
.indicator-actions button[data-indicator-action="hide"]::before {
  content: "◉";
  color: currentColor;
  font-size: 14px;
  line-height: 1;
}
.indicator-actions button[data-indicator-action="hide"].is-hidden::before { content: "◎"; }
.indicator-actions button[data-indicator-action="settings"] { font-size: 14px; }
.indicator-actions button[data-indicator-action="duplicate"] { font-size: 0; }
.indicator-actions button[data-indicator-action="duplicate"]::before {
  content: "⋯";
  color: currentColor;
  font-size: 18px;
  line-height: 12px;
  transform: translateY(-2px);
}
.indicator-actions button[data-indicator-action="close"] {
  font-size: 0;
}
.indicator-actions button[data-indicator-action="close"]::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 9px;
  height: 10px;
  border: 1.25px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
  transform: translateX(-50%);
}
.indicator-actions button[data-indicator-action="close"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 1.25px;
  background: currentColor;
  box-shadow: 0 -2px 0 -0.1px currentColor;
  transform: translateX(-50%);
}

.indicator-actions-pane button {
  color: #98a9ce;
  font-size: 13px;
}
.indicator-actions-pane button:disabled { opacity: .35; cursor: default; }

/* Main-chart overlays use the same compact control language. */
.main-indicator-control {
  min-height: 27px;
  padding: 2px 4px 2px 8px;
  gap: 2px;
  border-color: #2a3342;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
}
.main-indicator-control span {
  color: #a1aabd;
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}
.main-indicator-control button[data-indicator-action="hide"] { order: 1; }
.main-indicator-control button[data-indicator-action="settings"] { order: 2; }
.main-indicator-control button[data-indicator-action="close"] { order: 3; }
.main-indicator-control button[data-indicator-action="hide"] { font-size: 0; }
.main-indicator-control button[data-indicator-action="hide"]::before {
  content: "◉";
  font-size: 14px;
}
.main-indicator-control button[data-indicator-action="hide"].is-hidden::before { content: "◎"; }
.main-indicator-control button[data-indicator-action="close"] { font-size: 0; }
.main-indicator-control button[data-indicator-action="close"]::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 9px;
  height: 10px;
  border: 1.25px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
  transform: translateX(-50%);
}
.main-indicator-control button[data-indicator-action="close"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 1.25px;
  background: currentColor;
  box-shadow: 0 -2px 0 -0.1px currentColor;
  transform: translateX(-50%);
}

@media (hover: none), (pointer: coarse) {
  .indicator-actions {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

@media (max-width: 680px) {
  .indicator-legend {
    height: 27px;
    padding: 3px 6px 3px 8px;
  }
  .indicator-legend > div:first-child b {
    max-width: 42vw;
    font-size: 10px;
  }
  .indicator-actions {
    height: 21px;
    margin-left: 4px;
    gap: 1px;
  }
  .indicator-actions-pane { padding-left: 3px; }
  .indicator-actions button,
  .main-indicator-control button {
    width: 21px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .indicator-legend,
  .indicator-actions,
  .indicator-actions button,
  .main-indicator-control button { transition: none; }
}

@media (max-width: 680px) {
  .universe-manager-dialog { width: calc(100vw - 18px); height: min(720px, calc(100dvh - 20px)); }
  .universe-manager-body { gap: 8px; padding: 10px; }
  .universe-manager-body .universe-thresholds { grid-template-columns: 1fr; }
  .universe-manager-body .universe-threshold-apply { grid-column: 1; }
  .universe-manager-columns { gap: 7px; }
  .universe-manager-list,
  .universe-manager-body .universe-list,
  .universe-manager-body .universe-suggestions { grid-template-columns: 1fr; padding: 6px; }
  .universe-manager-pane > header { padding: 0 8px; }
  .universe-manager-list .universe-row { grid-template-columns: minmax(0, 1fr) 30px; }
}

/* Overlay indicators on the main chart follow the same left-aligned stack
   used by TradingView: instrument/OHLC first, then each indicator row. */
@media (min-width: 681px) {
  .price-panel .main-indicator-control {
    top: 42px;
    right: auto;
    left: 31px;
  }
  .price-panel .close-level-control { top: 70px; }
  .price-panel .pullback-control { top: 98px; }
  .price-panel .capitulation-control { top: 126px; }
  .price-panel .squeeze-chase-control { top: 154px; }
  .price-panel .relative-breakout-control { top: 182px; }
}

/* Module names use one consistent, high-contrast accent so the active
   workspace is easy to scan.  Keep this separate from body/ticker typography. */
.signal-monitor-head b,
.sidebar-block-title,
.signal-section summary b,
.latest-direction-group > header b,
.indicator-legend > div:first-child b {
  color: #f0d979 !important;
}
.signal-monitor-head b { font-size: 18px !important; }
.sidebar-block-title { font-size: 13px !important; }
.signal-section summary b { font-size: 14px !important; }
.latest-direction-group > header b { font-size: 14px !important; }
.indicator-legend > div:first-child b { font-size: 13px !important; }

@media (max-width: 680px) {
}
/* HL settings are demand-loaded, never part of the market polling path. */
.hl-wallet-dialog { width: min(620px, 94vw); max-height: 88dvh; overflow-y: auto; }
.hl-wallet-dialog p { font-size: 13px; line-height: 1.6; color: #aeb8ca; }
.hl-wallet-dialog input:not([type="checkbox"]) { max-width: 100%; background: #101720; color: #e5e9f0; border: 1px solid #394557; border-radius: 5px; padding: 8px; }
.hl-wallet-row { display: grid; gap: 8px; border-bottom: 1px solid #394557; padding: 12px 0; }
.hl-wallet-row a { overflow-wrap: anywhere; font-size: 12px; color: #8eb4ff; }
.hl-wallet-controls, #hl-wallet-add { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hl-wallet-controls label { display: flex; align-items: center; gap: 5px; }
#hl-wallet-add { padding-top: 16px; }
.liquidity-notice { position:absolute; left:10px; bottom:25px; right:65px; z-index:3; pointer-events:none; color:#b7c3d5; font-size:11px; text-shadow:0 1px 3px #000; }

/* Inline mobile signals: share the screen, never cover the chart. */
@media (max-width: 680px) {
  .workspace, .workspace.signal-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 50dvh) minmax(0, 1fr);
    min-height: 0;
  }
  .chart-stack {
    grid-column: 1; grid-row: 1;
    grid-template-rows: minmax(0, 1.9fr) repeat(var(--indicator-count), minmax(0, 1fr));
    min-height: 0;
  }
  .chart-stack > .price-panel, .chart-stack > .indicator-panel { min-height: 0 !important; }
  .market-movers {
    top: calc(50dvh - var(--fd-indicator-dock-height) - var(--fd-market-strip-height));
    bottom: auto;
  }
  .signal-monitor, .signal-monitor.is-collapsed {
    position: relative; grid-column: 1; grid-row: 2;
    display: grid; grid-template-rows: 44px 32px 38px minmax(0, 1fr);
    inset: auto; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; height: 100%; max-height: none; min-height: 0;
    transform: none; visibility: visible; pointer-events: auto;
    border-radius: 0; box-shadow: none; transition: none;
  }
  .signal-monitor .signal-monitor-head, .signal-monitor.is-collapsed .signal-monitor-head {
    display: grid; grid-template-columns: minmax(0, 1fr) 30px;
    height: 32px; min-height: 0; padding: 0 8px;
  }
  .mobile-chart-selector {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(176px, 1.5fr);
    align-items: stretch; gap: 6px; min-width: 0; padding: 3px 7px;
    border-bottom: 1px solid #303949; background: #111823;
  }
  .mobile-chart-selector .mobile-wheel-column {
    border: 1px solid #364052; border-radius: 5px; background: #1b2534;
  }
  .mobile-timeframe-buttons {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
    min-width: 0;
  }
  .mobile-timeframe-buttons button {
    min-width: 0; padding: 0 3px; border: 1px solid #364052; border-radius: 5px;
    color: #a7b2c4; font-size: 13px; font-weight: 700; touch-action: manipulation;
  }
  .mobile-timeframe-buttons button.active {
    color: #edf3ff; border-color: #638bff; background: #263a61;
  }
  .signal-monitor-head span, #signal-collapse { display: none; }
  .mobile-signal-tabs {
    display: flex;
    align-items: stretch; gap: 5px; min-width: 0; width: 100%; box-sizing: border-box;
    overflow-x: auto; overflow-y: hidden; padding: 3px 7px;
    scrollbar-width: none; border-bottom: 1px solid #303949;
    touch-action: pan-x;
  }
  .mobile-signal-tabs::-webkit-scrollbar { display: none; }
  .mobile-signal-tabs button { flex:0 0 auto; min-width:0; box-sizing:border-box; padding:0 5px; border:1px solid #364052; border-radius:5px; color:#a7b2c4; font-size:12px; white-space:nowrap; }
  .signal-confluence-enabled .mobile-signal-tabs { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
  .signal-confluence-enabled .mobile-signal-tabs button { width:100%; }
  .mobile-signal-tabs button[aria-pressed="true"] { color: #f4da72; border-color: #f4da72; background: #29261b; }
  .signal-monitor-body { height: auto; min-height: 0; min-width: 0; max-width: 100%; box-sizing: border-box; overflow-x: hidden; overflow-y: auto; padding: 4px 6px 12px; touch-action: auto; overscroll-behavior: contain; }
  .signal-monitor .mobile-signal-page-hidden { display: none !important; }
  .signal-monitor .signal-watchlist-section:not(.mobile-signal-page-hidden) { display: block !important; }
  .signal-section summary { min-height: 40px; }
  .sidebar-block { margin-bottom: 0; }
}
/* Mainstream settings share one server-side universe on desktop and mobile. */
.mainstream-manager-dialog { width: min(660px, calc(100vw - 24px)); max-height: 90dvh; overflow: auto; padding: 16px; box-sizing: border-box; }
.mainstream-manager-dialog p { color: #aab7cb; font-size: 13px; line-height: 1.5; }
.mainstream-manager-dialog input { box-sizing: border-box; width: 100%; min-width: 0; padding: 10px; background: #101722; color: #edf2fa; border: 1px solid #37465d; border-radius: 6px; }
.mainstream-manager-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.mainstream-manager-columns section { min-width: 0; }
.mainstream-manager-columns h3 { font-size: 14px; margin: 0 0 8px; }
.mainstream-manager-columns section > div { height: min(36dvh, 320px); overflow: auto; border: 1px solid #37465d; border-radius: 7px; padding: 6px; }
.mainstream-manager-columns button { display: block; width: 100%; min-height: 38px; text-align: left; overflow-wrap: anywhere; white-space: normal; padding: 7px; }
.mainstream-signal-head { flex-wrap: wrap; gap: 6px; }
.mainstream-signal-head [data-open-mainstream] { font-size: 12px; padding: 4px 8px; }
#mainstream-message { min-height: 38px; }

/* Consolidation is display-only: original renderers remain the source of truth. */
.signal-confluence-enabled .signal-confluence-source,
.signal-confluence-enabled #mainstream-signal-overview > .mainstream-signal-head,
.signal-confluence-enabled #mainstream-signal-body,
.signal-confluence-enabled #consensus-sidebar-block,
.signal-confluence-enabled [data-signal-panel-view="confirmation"] { display: none !important; }
.signal-confluence-enabled .mainstream-volume-ranking { border-top: 0; margin-top: 0; padding-top: 0; }
.confluence-controls { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px; color: #8e9aae; font-size: 11px; line-height: 1.5; }
.confluence-controls #relay-visibility-control { margin: 0; padding: 0; flex: 0 0 auto; }
.confluence-group { border: 1px solid #354052; border-radius: 8px; margin-bottom: 10px; min-width: 0; overflow: hidden; }
.confluence-group-head, .confluence-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.confluence-group-head { padding: 9px; background: #192230; color: #f2d870; }
.confluence-group-head small { color: #9ca9bd; font-size: 11px; }
.confluence-row { border-top: 1px solid #293344; padding: 4px 9px; min-width: 0; }
.confluence-ticker { background: transparent; border: 0; padding: 2px 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.confluence-ticker { flex-wrap: wrap; font-weight: 400; }
.confluence-market-metrics { color: #aab7c9; font-size: inherit; font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
.confluence-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.confluence-star { flex: 0 0 36px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: #96a4ba; font-size: 23px; line-height: 1; cursor: pointer; }
.confluence-star[aria-pressed="true"] { color: #ffd447; }
.confluence-star:hover { background: #273246; color: #ffe38c; }
.confluence-star:focus-visible { outline: 2px solid #ffd447; outline-offset: 1px; }
.confluence-favorites { border-color: #65592f; }
.confluence-favorites .signal-empty { min-height: 0; padding: 10px; }
.confluence-favorites-warning { color: #ffd47b; font-size: 12px; padding: 6px 9px; margin: 0; }
#confluence-preset-results { display: grid; gap: 6px; margin-bottom: 8px; min-width: 0; }
.confluence-preset-lane { min-width:0; }
.confluence-preset-lane[hidden] { display:none !important; }
.confluence-preset-column, .confluence-all-column { display: contents; }
#confluence-result-tabs { display: none; }
@media (max-width: 680px) {
  /* Do not trap the sticky switcher inside a non-scrolling overflow ancestor. */
  .monitor-resonance-block { overflow: clip; }
  #confluence-result-tabs { display: flex; gap: 6px; position: sticky; top: 0; z-index: 3; height:52px; box-sizing:border-box; padding: 6px 0; background: #0f151f; }
  #signal-monitor .preset-result-head { position:sticky; top:52px; z-index:2; }
  #confluence-result-tabs button { flex: 1; min-width: 0; min-height: 40px; border: 1px solid #46536a; border-radius: 6px; background: #192230; color: #c5cfde; font: inherit; font-size: 14px; touch-action: manipulation; }
  #confluence-result-tabs button[aria-pressed="true"] { color: #ffe17c; border-color: #d6b94e; background: #443c21; }
  #confluence-result-tabs button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
  #signal-confluence-section:not([data-result-view="presets"]) > .confluence-preset-column,
  #signal-confluence-section[data-result-view="presets"] > .confluence-all-column { display: none; }
  #signal-confluence-section[data-result-view="presets"] #confluence-preset-results:empty::before { content: '尚未設定常用訊號，請選擇組合後按「儲存預設」。'; display: block; padding: 12px; color: #96a5ba; font-size: 12px; }
}
.preset-result-panel { min-width: 0; padding: 0; overflow:clip; }
.preset-result-head { display: flex; justify-content: space-between; gap: 4px; }
.preset-result-name { min-width:0; flex:1; overflow-wrap:anywhere; color:#f0d979; }
.preset-result-name { border:0; padding:3px 0; background:transparent; text-align:left; font:inherit; font-weight:600; cursor:pointer; }
.preset-result-name::before { content:'▾'; margin-right:4px; }
.preset-result-name[aria-expanded="false"]::before { content:'▸'; }
.preset-result-name:focus-visible { outline:2px solid #ffe17c; outline-offset:2px; }
.preset-result-members[hidden] { display:none !important; }
.confluence-preset-layout { display:none; }
.preset-result-count { color: #96a5ba; font-size: 11px; }
.preset-result-unpin { flex:0 0 28px; min-height:28px; padding:0; border:0; border-radius:4px; background:transparent; color:#aebbd0; font-size:18px; cursor:pointer; }
.preset-result-members { display:block; min-width:0; }
.preset-result-members .signal-empty { padding:8px; min-height:0; font-size:11px; }
#confluence-save-result-preset { margin-top:6px; padding:6px 10px; border:1px solid #8e7c39; border-radius:5px; background:#29291e; color:#ffe17c; cursor:pointer; }
#confluence-save-result-preset:disabled { opacity:.6; cursor:default; }
#confluence-pin-dialog { max-width:min(420px,90vw); border:1px solid #46536a; border-radius:8px; background:#111a26; color:#e4eaf4; padding:18px; }
#confluence-pin-dialog::backdrop { background:#0009; }
#confluence-pin-dialog button { display:block; width:100%; margin-top:8px; padding:10px; border:1px solid #46536a; border-radius:5px; background:#202b3d; color:#e4eaf4; cursor:pointer; }
.preset-result-more { flex-basis: 100%; min-width: 0; color: #96a5ba; font-size: 11px; }
.preset-result-more summary { cursor: pointer; min-height: 0; padding: 4px 0; }
.preset-result-warning { flex-basis: 100%; color: #ffd47b; }
.confluence-similar-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 7px; border: 1px solid #455267; border-radius: 5px; background: transparent; color: #aebdd1; cursor: pointer; }
.confluence-similar-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.confluence-similar-button[aria-pressed="true"] { color: #ffe17c; border-color: #d6b94e; background: #443c21; }
.confluence-similar-button:hover { border-color: #c1cddd; }
.confluence-similar-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#confluence-similar { display: flex; align-items: center; gap: 8px; margin: 0 8px 8px; padding: 4px 8px; border: 1px solid #8e7c39; border-radius: 5px; background: #29291e; color: #ffe17c; font-size: 12px; }
#confluence-similar[hidden] { display: none !important; }
#confluence-similar-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#confluence-similar-clear { flex: 0 0 32px; min-height: 32px; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
#confluence-similar-clear:focus-visible { outline: 2px solid #fff; }
.confluence-count { white-space: nowrap; color: #f0d365; font-size: 12px; }
.confluence-holdings { display:flex; flex-wrap:nowrap; gap:6px; margin:2px 0 4px; }
.confluence-holding { display:inline-flex; flex:0 0 auto; align-items:center; gap:2px; padding:0; color:#fff; font-size:11px; line-height:20px; white-space:nowrap; }
.confluence-holding small { font-size:9px; color:#aebbd0; }
.confluence-holding .holding-arrow { font-size:16px; font-weight:500; }
.confluence-holding.bullish { color:#70dfb3; }
.confluence-holding.bearish { color:#ff949a; }
.confluence-holding.unknown { color:#8a96a8; }
#current-symbol-signals-list > .confluence-holdings { flex:0 0 100%; margin:0; }
.confluence-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.confluence-badge { display: inline-block; font-size: 11px; line-height: 1.5; padding: 1px 5px; border-radius: 3px; border: 1px solid #455267; color: #bbc6d7; background: #202a39; }
.confluence-badge.bullish { color: #70dfb3; border-color: #355c51; background: #17332b; }
.confluence-badge.bearish, .confluence-badge.warning { color: #ff949a; border-color: #78454c; background: #3b222a; }
.confluence-badge.condition-gate { color: #ffe17c; border-color: #8e7c39; background: #29291e; }
.confluence-badge.condition-excluded { color: #d7bcc0; border-style: dashed; border-color: #795e64; background: transparent; }
.confluence-badge.condition-unmatched { color: #9aa7b9; border-style: dashed; background: transparent; }
.confluence-badge.reference-match { box-shadow: inset 0 -1px 0 #f0d365; }
.confluence-badge { max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-align: left; }
.signal-section .confluence-more > summary { min-height: 0; padding: 5px 0; font-size: 11px; color: #9ba9bc; cursor: pointer; }
.signal-section .confluence-more > summary { padding: 9px; text-align: center; border-top: 1px dashed #3c485b; }
.signal-confluence-enabled #signal-confluence-list { min-width: 0; }
#confluence-filter-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 8px 8px; }
#confluence-selected-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 8px 10px; }
#confluence-selected-buttons[hidden] { display: none; }
.confluence-selected-condition { padding: 3px 5px; border: 1px solid #bda346; border-radius: 4px; background: #443c21; color: #ffe17c; font-size: 11px; text-align: left; }
.confluence-selected-condition.excluded { border-color: #c5606a; background: #3b222a; color: #ff949a; }
.universe-summary-row { flex-wrap: wrap; }
.confluence-quick-presets { display: flex; gap: 6px; flex: 1 0 100%; min-width: 0; }
.confluence-quick-presets select { flex: 1; width: 0; min-width: 0; min-height: 32px; padding: 5px 8px; background: #192331; color: #e4eaf4; border: 1px solid #46536a; border-radius: 5px; }
.confluence-quick-presets button { flex: 0 0 34px; }
.signal-combinations-head { display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding: 2px 4px; color: #f0d365; }
.signal-combinations-head > span { color: #95a3b8; font-size: 11px; font-weight: normal; }
#confluence-selection-area { display: contents; }
/* Compact market breadth; member lists open in a dialog, never push filters. */
#market-resonance { flex:0 0 auto; min-width:0; margin:0 4px 5px; padding:5px; border:1px solid #35445b; border-radius:6px; background:#111b28; }
#market-resonance[hidden] { display:none !important; }
#market-resonance header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px; }
#market-resonance header b { color:#e4cf75; font-size:12px; }
.market-resonance-controls, .market-resonance-controls > div { display:flex; gap:3px; }
.market-resonance-controls { flex-wrap:wrap; }
.market-resonance-controls button, .market-resonance-detail-options button { border:1px solid #40506a; border-radius:4px; padding:3px 5px; color:#b9c4d7; background:#1c283a; }
.market-resonance-controls [aria-pressed="true"], .market-resonance-detail-options [aria-pressed="true"] { border-color:#d9bd47; color:#ffe389; background:#433d24; }
.market-resonance-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin-top:4px; }
.market-resonance-metrics button { display:flex; align-items:center; flex-wrap:wrap; gap:2px 5px; padding:4px; min-width:0; text-align:left; border:1px solid #294b43; border-radius:4px; background:#142922; }
.market-resonance-metrics span { flex:0 0 100%; font-size:11px; color:#c1d4cd; }
.market-resonance-metrics strong { font-weight:500; color:#85d9b8; font-size:14px; }
.market-resonance-metrics small { color:#b1bdce; font-size:10px; }
.market-resonance-meta { display:block; color:#92a0b6; font-size:10px; line-height:1.5; margin-top:3px; overflow-wrap:anywhere; }
.market-resonance-more { font-size:11px; padding:1px 0; color:#a5bfee; text-decoration:underline; }
.market-resonance-dialog { width:min(600px,94vw); max-height:85dvh; overflow:auto; }
.market-resonance-detail { padding:0 14px 14px; line-height:1.6; color:#b9c6d8; }
.market-resonance-detail-options, .market-resonance-symbols { display:flex; flex-wrap:wrap; gap:6px; }
.market-resonance-symbols button { border:1px solid #3e5961; border-radius:4px; background:#192934; color:#bee2d5; padding:6px 8px; }
@media(max-width:680px) { .market-resonance-controls button { min-height:32px; padding:4px 8px; } #market-resonance { margin:0 0 6px; } }
@media (min-width: 681px) {
  /* Independent vertical columns: filters never push results below the fold. */
  .signal-monitor.combinations-split:not(.is-collapsed) .signal-monitor-body {
    display: block; overflow: hidden; min-height: 0; padding: 4px 44px 4px 4px;
  }
  .combinations-split .monitor-resonance-block {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr); min-height: 0; height: 100%;
    margin-bottom: 0; overflow: hidden; gap: 6px;
  }
  .combinations-split #confluence-selection-area {
    display: flex; flex-direction: column; min-height: 0; min-width: 0; height: 100%; overflow: hidden;
  }
  .combinations-split #universe-summary-row { flex: 0 0 auto; }
  .combinations-split #current-symbol-signals {
    display: flex; flex-direction: column; flex: 0 0 auto; min-height: 48px; max-height: var(--fd-current-signal-height,min(18vh,140px)); overflow: hidden;
  }
  .combinations-split #current-symbol-signals header { flex: 0 0 auto; }
  .combinations-split #current-symbol-signals-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin;
  }
  .combinations-split #current-symbol-signals .current-symbol-badge { padding: 2px 5px; line-height: 1.45; font-weight: 400; }
  .combinations-split #current-symbol-signals-list { gap: 3px; padding-bottom: 2px; align-content: flex-start; }
  .combinations-split #signal-combinations-section { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; margin-bottom: 0; }
  .combinations-split .signal-combinations-head,
  .combinations-split #confluence-filter-tabs { flex: 0 0 auto; }
  .combinations-split #confluence-selected-buttons { flex: 0 0 auto; max-height: none; overflow: visible; }
  .combinations-split #confluence-preset-status { flex: 0 0 auto; max-height: 58px; overflow-y: auto; scrollbar-width: thin; }
  .combinations-split #confluence-filter-panel,
  .combinations-split #common-combinations-section { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .combinations-split .confluence-filter-toolbar,
  .combinations-split #confluence-save-result-preset { flex: 0 0 auto; }
  .combinations-split .confluence-filter-options,
  .combinations-split #confluence-quick-preset.preset-filter-options {
    flex: 1 1 auto; min-height: 0; align-content: flex-start; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin;
  }
  .combinations-split #signal-confluence-section {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px;
    min-height: 0; min-width: 0; height: 100%; max-height: none; margin: 0; overflow: hidden;
  }
  .combinations-split #signal-confluence-section.preset-double-column { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
  .combinations-split .preset-double-column #confluence-preset-results { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .combinations-split .confluence-preset-layout { display:flex; justify-content:flex-end; position:sticky; top:0; z-index:2; padding:0 0 5px; background:#0f151f; }
  #confluence-preset-columns { min-height:30px; padding:4px 7px; border:1px solid #46536a; border-radius:5px; background:#192230; color:#dbe4f3; cursor:pointer; }
  .combinations-split .confluence-preset-column, .combinations-split .confluence-all-column {
    display: block; min-width: 0; min-height: 0; height: 100%; overflow: auto;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #46536a transparent;
  }
  .combinations-split .confluence-preset-column { display:flex; flex-direction:column; overflow:hidden; }
  .combinations-split .confluence-preset-layout { flex:0 0 auto; }
  .combinations-split #confluence-preset-results { flex:1 1 auto; min-height:0; grid-template-rows:minmax(0,1fr); margin-bottom:0; overflow:hidden; }
  .combinations-split .confluence-preset-lane { min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#46536a transparent; }
  .combinations-split #confluence-preset-results:empty::before { content: '常用訊號尚未設定，請選擇組合後按「儲存預設」。'; display: block; padding: 10px; font-size: 12px; line-height: 1.6; color: #96a5ba; border: 1px dashed #354052; border-radius: 6px; }
  .combinations-split #signal-confluence-list { padding: 0; }
  .combinations-split .confluence-group-head { position: sticky; top: 0; z-index: 1; padding: 6px; }
  .combinations-split .preset-result-head { position:sticky; top:0; }
  .combinations-split .confluence-row { padding: 3px 6px; }
  .combinations-split .universe-summary-row { padding: 4px; gap: 4px; }
}
.signal-combinations-head button { padding: 6px 8px; border: 1px solid #46536a; border-radius: 5px; color: #e4eaf4; background: #192331; }
@media (min-width: 681px) and (max-height: 700px) {
  .combinations-split #confluence-filter-tabs { gap: 3px; margin-bottom: 5px; }
  .combinations-split #confluence-filter-tabs button,
  .combinations-split #confluence-filter-frames button,
  .combinations-split #confluence-filter-sources button { min-height: 24px; padding: 3px 5px; font-size: 11px; }
  /* Give expanded preset conditions room on short desktop windows. */
  .combinations-split #confluence-selection-area:has(#common-combinations-section:not([hidden])):has(#confluence-selected-buttons:not([hidden])) #confluence-filter-tabs { gap: 3px; margin-bottom: 5px; }
  .combinations-split #confluence-selection-area:has(#common-combinations-section:not([hidden])):has(#confluence-selected-buttons:not([hidden])) #confluence-filter-tabs button { min-height: 24px; padding: 3px 5px; font-size: 11px; }
}
@media (max-width: 680px) {
  .signal-combinations-section:not(.mobile-signal-page-hidden) { display: block !important; }
}
#confluence-filter-tabs button { flex: 1 0 auto; min-width: 0; min-height: 32px; padding: 5px 8px; border: 1px solid #485670; border-radius: 5px; background: #202b3d; color: #dbe4f3; font: inherit; font-size: 12px; cursor: pointer; }
#confluence-filter-tabs button[aria-pressed="true"] { color: #ffe17c; border-color: #d6b94e; background: #443c21; }
#confluence-filter-tabs button[data-selected="true"] { box-shadow: inset 0 -2px 0 #f0d365; }
.confluence-filter-toolbar { display: flex; align-items: flex-start; gap: 8px; height: 44px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#confluence-filter-frames, #confluence-filter-sources { display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; }
#confluence-filter-frames button, #confluence-filter-sources button { white-space: nowrap; }
#confluence-filter-sources[hidden] { display: none; }
#desktop-morning-strip[hidden] { display: none !important; }
@media (min-width: 681px) {
  .app.has-morning-strip { grid-template-rows: var(--fd-topbar-height) 44px var(--fd-market-strip-height) minmax(0, 1fr) var(--fd-statusbar-height); }
  #desktop-morning-strip { min-width: 0; overflow: hidden; border-bottom: 1px solid #293344; background: #101722; }
  #desktop-morning-strip #morning-gainers-section:not([hidden]) { display: flex !important; align-items: center; gap: 12px; height: 44px; margin: 0; padding: 0 12px; border: 0; }
  #desktop-morning-strip #morning-gainers-section > summary { flex: 0 0 auto; font-size: 12px; list-style: none; pointer-events: none; }
  #desktop-morning-strip #morning-gainers-section > summary::marker { content: ''; }
  #desktop-morning-strip #morning-gainers-section::details-content { flex: 1; min-width: 0; height: 100%; overflow: hidden; }
  #desktop-morning-strip #morning-gainers-meta { display: none; }
  #desktop-morning-strip #morning-gainers-list { display: flex; flex: 1; min-width: 0; flex-wrap: nowrap; align-items: center; overflow-x: auto; overflow-y: hidden; gap: 6px; height: 100%; scrollbar-width: thin; }
  #desktop-morning-strip .morning-gainer, #desktop-morning-strip .signal-empty { flex: 0 0 auto; white-space: nowrap; }
  /* details has an internal content box: display:contents does not reliably
     flatten its children into the outer flex row when many tickers overflow. */
  #desktop-morning-strip .morning-gainers-more { display: block; flex: 0 0 auto; width: auto; margin: 0; padding: 0; }
  #desktop-morning-strip .morning-gainers-more > .signal-members { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin: 0; padding: 0; }
  #desktop-morning-strip .morning-gainers-more > summary { display: none; }
}
#current-symbol-signals { margin: 0 4px 4px; padding: 5px; border: 1px solid #46536a; border-radius: 5px; background: #111a26; }
#current-symbol-signals header { display: flex; flex-wrap: nowrap; gap: 6px; align-items: baseline; margin-bottom: 3px; white-space: nowrap; overflow: hidden; }
#current-symbol-signals header small { color: #95a3b8; font-size: 11px; }
#current-symbol-signals-list { display: flex; flex-direction: row; gap: 4px; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 5px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.current-symbol-signal-row { display: contents; }
.current-symbol-signal-row .current-symbol-badge { flex: 0 0 auto; max-width: none; white-space: nowrap; overflow-wrap: normal; }
#current-symbol-signals .signal-empty { min-height: 0; padding: 3px; }
.current-symbol-badge { max-width: 100%; overflow-wrap: anywhere; padding: 4px 6px; border: 1px solid #3b806a; border-radius: 4px; background: #17322b; color: #94e4c7; font-size: 11px; cursor: pointer; }
.current-symbol-badge.bearish, .current-symbol-badge.warning { color: #ffb0b4; border-color: #884652; background: #3d252e; }
.current-symbol-badge.neutral { color: #d3deed; border-color: #536174; background: #202c3c; }
.current-symbol-badge.preset, .confluence-badge.preset { color: #ffe47d; border-color: #9b853a; background: #38321d; }
#morning-gainers-section { margin-bottom: 10px; }
#morning-gainers-section > summary { color: #ffe17c; font-weight: 700; }
#morning-gainers-meta { display: block; color: #95a3b8; margin: 5px 0 9px; }
#morning-gainers-list .morning-gainer { display: inline-flex; align-items: center; gap: 8px; }
#morning-gainers-list .morning-gainer b { color: #34d399; }
#morning-gainers-list .morning-gainer b, #morning-gainers-list .morning-gainer-funding, #morning-gainers-list .morning-gainer-volume { font-family: inherit; font-size: 1em; font-weight: 700; }
#morning-gainers-list .morning-gainer-funding, #morning-gainers-list .morning-gainer-volume { color: #fff; white-space: nowrap; border-left: 1px solid #46536a; padding-left: 6px; }
#morning-gainers-list .morning-gainer-funding[data-sign="negative"] { color: #34d399; }
#morning-gainers-list .morning-gainer-funding[data-sign="positive"] { color: #ff5b6e; }
@media (max-width: 680px) {
  #morning-gainers-list .morning-gainer { max-width: 100%; flex-wrap: wrap; gap: 4px 8px; }
}
.morning-gainers-more { width: 100%; color: #95a3b8; }
#confluence-filter-frames button, #confluence-filter-sources button { min-height: 32px; padding: 5px 12px; border: 1px solid #485670; border-radius: 5px; background: #202b3d; color: #dbe4f3; font: inherit; cursor: pointer; }
#confluence-filter-frames button[aria-pressed="true"], #confluence-filter-sources button[aria-pressed="true"] { color: #ffe17c; border-color: #d6b94e; background: #443c21; }
#confluence-filter-frames button:focus-visible, #confluence-filter-sources button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#confluence-filter-panel { margin: 0 8px 8px; padding: 8px; border: 1px solid #46536a; border-radius: 7px; background: #141e2b; }
#confluence-filter-panel[hidden] { display: none !important; }
.confluence-filter-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #aab7ca; }
.confluence-filter-head small { flex: 1; min-width: 0; font-size: 11px; }
.confluence-filter-head button { flex-shrink: 0; padding: 5px 8px; }
.confluence-filter-options { --filter-row-count: 1; display: grid; grid-template-rows: repeat(var(--filter-row-count),32px); grid-auto-columns: max-content; gap: 5px; height: calc(var(--filter-row-count) * 37px + 7px); min-width: 0; overflow-x: auto; overflow-y: hidden; align-content: start; justify-content: start; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #65738a transparent; }
.confluence-filter-options .confluence-filter-item { max-width: none; justify-self: start; }
.confluence-filter-options .confluence-filter-option { white-space: nowrap; }
#common-combinations-section { margin: 0 4px 4px; padding: 3px; border: 1px solid #46536a; border-radius: 5px; background: #141e2b; }
#common-combinations-section[hidden] { display: none !important; }
#confluence-quick-preset.preset-filter-options { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; padding: 2px 0 5px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; overscroll-behavior-x: contain; }
.preset-lane { display: flex; flex-wrap: nowrap; gap: 5px; width: max-content; }
.preset-chip { display: inline-flex; position: relative; flex: 0 0 auto; width: max-content; }
#confluence-quick-preset .preset-apply { max-width: none; white-space: nowrap; padding: 5px 22px 5px 7px; height: 32px; }
#confluence-quick-preset .preset-apply[data-preset-id=""] { padding-right: 7px; }
#confluence-quick-preset .preset-remove { position: absolute; top: 0; right: 0; width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: #9ba9bc; font-size: 15px; line-height: 20px; }
#confluence-quick-preset .preset-remove:hover { color: #ff949a; background: #3b222a; }
.confluence-presets { margin: 0 8px 8px; min-width: 0; }
.combination-buttons { display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.combination-buttons button { max-width:100%; min-width:0; padding:7px 9px; border:1px solid #46536a; border-radius:5px; background:#202a39; color:#d8e2ef; font-size:12px; cursor:pointer; white-space:normal; overflow-wrap:anywhere; }
.combination-buttons button[aria-pressed="true"] { border-color:#e5ca54; color:#fff1aa; background:#49401b; }
.combination-buttons button:focus-visible { outline:2px solid #e4edf9; outline-offset:2px; }
@media (min-width: 681px) {
  /* Use the full filter column height; no desktop horizontal option scrolling. */
  #confluence-quick-preset.preset-filter-options { flex-direction: row; flex-wrap: wrap; gap: 5px; overflow: visible; padding: 2px 0; }
  #confluence-quick-preset .preset-chip { max-width: 100%; }
  #confluence-quick-preset .preset-apply { min-height: 32px; height: auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .confluence-filter-options { display: flex; flex-wrap: wrap; height: auto; overflow: visible; }
  .confluence-filter-options .confluence-filter-item { max-width: 100%; min-width: 0; }
  .confluence-filter-options .confluence-filter-option { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .confluence-filter-toolbar { height: auto; flex-wrap: wrap; overflow: visible; margin-bottom: 8px; }
  #confluence-filter-frames, #confluence-filter-sources { flex: 0 1 auto; flex-wrap: wrap; min-width: 0; }
  #current-symbol-signals header { flex-wrap: wrap; white-space: normal; overflow: visible; }
  #current-symbol-signals-list { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
  .current-symbol-signal-row .current-symbol-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}
.confluence-preset-actions { display:flex; gap:5px; margin:6px 0; }
.combination-notification-bar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:9px; }
.combination-notification-bar small,.combination-retention-note,.combination-retention { color:#96a6bd; font-size:11px; line-height:1.5; }
.combination-notification-bar button,.combination-notification-row button { padding:6px 9px; border:1px solid #46536a; border-radius:5px; background:#202a39; color:#d8e2ef; cursor:pointer; }
.combination-retention-note { display:block; margin-top:6px; }
.combination-retention { display:block; padding:0 7px; }
.combination-notifications-dialog { width:min(520px,calc(100vw - 24px)); max-height:85vh; overflow-y:auto; }
.combination-trade-settings { margin:0 0 9px; padding:7px; border:1px solid #45516a; border-radius:5px; background:#111b28; }
.combination-trade-settings summary { cursor:pointer; color:#d9c577; font-size:12px; }
.combination-trade-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin:9px 0; }
#telegram-dialog .combination-trade-fields label { display:flex; flex-direction:column; gap:4px; color:#abbad0; }
#telegram-dialog .combination-trade-fields input,#telegram-dialog .combination-trade-fields select { display:block; width:100%; min-width:0; padding:6px; border:1px solid #43516a; border-radius:4px; background:#182232; color:#e0e6f0; }
#telegram-dialog .combination-trade-fields input[type="checkbox"] { appearance:auto; width:20px; height:20px; }
.combination-trade-settings small { display:block; color:#a6b5cb; line-height:1.5; margin:6px 0; }
.combination-trade-settings > button { padding:6px 10px; background:#26334c; border:1px solid #536584; border-radius:4px; color:#dce6f4; }
.trade-auth-dialog { padding:18px; width:min(380px,92vw); }
.trade-auth-dialog label { display:flex; flex-direction:column; gap:10px; }
.trade-auth-dialog input { padding:9px; background:#121e30; border:1px solid #536584; border-radius:4px; }
.trade-auth-dialog button { margin:12px 8px 0 0; padding:8px; color:#dce6f4; background:#26334c; border-radius:4px; }
.combination-notification-body { padding:12px 16px; }
.combination-notification-body input { width:100%; box-sizing:border-box; padding:8px; margin:8px 0; background:#121b28; border:1px solid #46536a; color:#e4edf9; }
.combination-notification-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-bottom:1px solid #354258; }
.combination-notification-row small { display:block; color:#96a6bd; font-size:11px; margin-top:3px; }
.combination-notification-row button { flex-shrink:0; }
.telegram-fields > #combination-notifications-list { display:block; width:100%; }
#telegram-dialog .combination-notification-row { display:flex; flex-direction:row; cursor:pointer; }
#telegram-dialog .combination-notification-row > span { min-width:0; overflow-wrap:anywhere; }
#telegram-dialog .combination-notification-row input { width:20px; height:20px; flex:0 0 20px; accent-color:#35cfa4; }
#telegram-dialog #combination-notifications-message { overflow-wrap:anywhere; color:#f3d36b; }
.combination-notification-row button[aria-pressed=true] { color:#7addb8; border-color:#388167; }
.combination-notification-body select { width:100%; min-width:0; max-width:100%; padding:8px; color:#e4edf9; background:#121b28; border:1px solid #46536a; }
#combination-notifications-help,#combination-notifications-selection { color:#96a6bd; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.combination-notification-body button,#combination-notifications-add { padding:6px 9px; border:1px solid #46536a; border-radius:5px; background:#202a39; color:#d8e2ef; cursor:pointer; }
.combination-notification-body button:disabled { opacity:.5; cursor:default; }
.confluence-preset-save { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; max-width: 100%; }
.signal-combinations-head .confluence-presets { margin: 0; }
.signal-combinations-head #relay-visibility-control { padding: 0; align-items: center; }
.confluence-save-dialog { width: min(360px,calc(100vw - 24px)); }
#confluence-save-form { padding: 16px; display: grid; gap: 10px; }
#confluence-save-form label { color: #c7d3e4; font-size: 13px; }
#confluence-preset-name { box-sizing: border-box; width: 100%; min-width: 0; padding: 9px; border: 1px solid #46536a; border-radius: 5px; background: #202a39; color: #d8e2ef; }
#confluence-save-message { margin: 0; font-size: 12px; color: #f0d365; }
#confluence-save-message:empty, #confluence-preset-status:empty { display: none; }
.confluence-preset-save button { flex: 0 0 auto; }
.confluence-preset-save button[hidden] { display: none; }
.confluence-presets input, .confluence-presets select, .confluence-presets button { min-width: 0; max-width: 100%; box-sizing: border-box; background: #202a39; color: #d8e2ef; border: 1px solid #46536a; border-radius: 5px; padding: 7px; font-size: 12px; }
.confluence-presets button { cursor: pointer; white-space: nowrap; }
.confluence-presets .combination-buttons button { white-space: normal; }
.confluence-presets button:disabled { opacity: .4; cursor: default; }
.confluence-presets small { display: block; margin-top: 5px; color: #9daec4; font-size: 10px; line-height: 1.5; }
#confluence-preset-status { color: #f0d365; font-size: 11px; line-height: 1.5; margin: 4px 8px; overflow-wrap: anywhere; }
.confluence-presets :focus-visible { outline: 2px solid #e4edf9; outline-offset: 1px; }
.confluence-filter-option { border: 1px solid #46536a; border-radius: 5px; padding: 6px 8px; background: #202a39; color: #c7d3e4; font-size: 12px; cursor: pointer; }
.confluence-filter-option.bearish, .confluence-filter-option.warning { color: #ff949a; }
.confluence-filter-option.bullish { color: #70dfb3; }
.confluence-filter-option[aria-pressed="true"] { border-color: #f0d365; background: #443c21; color: #ffe58a; box-shadow: inset 0 0 0 1px #f0d365; }
.confluence-filter-option[data-confluence-filter^="price-above-"][data-filter-action="include"][aria-pressed="true"] { color: #70dfb3; background: #17332b; }
.confluence-filter-option[data-filter-state="exclude"] { border-color: #ef7b86; background: #45252d; color: #ffb3bb; box-shadow: inset 0 0 0 1px #ef7b86; }
.confluence-filter-option:disabled { opacity: .4; cursor: default; }
.confluence-badge.filter-match { outline: 1px solid #f0d365; }
.confluence-badge { cursor: help; font-family: inherit; font-weight: inherit; }
.confluence-badge:hover, .confluence-badge:focus-visible { outline: 1px solid #e4edf9; outline-offset: 1px; }
.confluence-filter-item { display: inline-flex; max-width: 100%; align-items: stretch; }
.confluence-filter-item[hidden] { display: none !important; }
.confluence-filter-item .confluence-filter-option { border-radius: 5px 0 0 5px; }
.confluence-filter-help { flex: 0 0 28px; border: 1px solid #46536a; border-left: 0; border-radius: 0 5px 5px 0; background: #192331; color: #cbd8ea; padding: 4px; cursor: help; }
.confluence-filter-help:hover, .confluence-filter-help:focus-visible { color: #fff; outline: 1px solid #fff; }
.signal-condition-dialog { box-sizing: border-box; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 16px; overflow-y: auto; overflow-wrap: anywhere; }
.signal-condition-dialog .modal-head { gap: 12px; align-items: flex-start; }
.signal-condition-dialog .modal-head h2 { margin: 0; font-size: 17px; }
.signal-condition-dialog .modal-head button { flex: 0 0 36px; min-height: 36px; }
.signal-condition-body p { font-size: 14px; line-height: 1.65; color: #d0daea; white-space: pre-wrap; }
.signal-condition-body h3 { font-size: 13px; margin: 18px 0 5px; color: #f0d365; }
.signal-condition-body .signal-condition-detail { background: #131e2d; border: 1px solid #38475f; padding: 10px; border-radius: 6px; font-size: 12px; }
.signal-condition-body small { display: block; font-size: 11px; line-height: 1.5; color: #91a1b8; }
#confluence-filter-tabs button:focus-visible, .confluence-filter-option:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.session-flow-row .session-flow-period-badge { display: block; font-size: 10px; color: #f0d365; margin-top: 2px; }

/* Phone charts above signals, with navigation pinned below both. */
@media (max-width: 680px) {
  #app { grid-template-rows:minmax(0,1fr); padding-top:env(safe-area-inset-top,0px); padding-bottom:calc(52px + env(safe-area-inset-bottom,0px)); box-sizing:border-box; }
  #workspace,#workspace.signal-collapsed { grid-row:1; grid-template-rows:minmax(0,42%) minmax(0,1fr); grid-template-columns:minmax(0,1fr); min-width:0; }
  #chart-stack { display:grid; grid-column:1; grid-row:1; padding-bottom:0; }
  #chart-stack .custom-time-axis { bottom:0; }
  #mobile-chart-selector { display:contents; }
  #mobile-chart-selector .mobile-wheel-column { grid-column:auto; min-width:0; height:44px; border:0; background:transparent; }
  #mobile-chart-selector .mobile-timeframe-buttons { display:contents; }
  #mobile-chart-selector .mobile-timeframe-buttons button { height:44px; }
  #market-movers,#desktop-morning-strip,
  #mobile-indicator-button,#mobile-layout-save-button,#mobile-reset-button { display:none !important; }
  #signal-monitor,#signal-monitor.is-collapsed { grid-row:2; grid-template-rows:minmax(0,1fr); border:0; }
  #signal-monitor .signal-monitor-head { display:none !important; }
  #signal-monitor .signal-monitor-head { grid-row:2; height:36px; padding:2px 10px; grid-template-columns:minmax(0,1fr) 34px; gap:4px; box-sizing:border-box; }
  #signal-monitor .signal-monitor-head > div { min-width:0; }
  #signal-title { display:block; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #signal-scan-meta { display:none; }
  #signal-refresh { width:34px; height:32px; font-size:22px; }
  /* Flatten the timeframe/page groups so every visible control shares one
     equal-width track, including the extra Stock page. Respect device edges. */
  #mobile-market-dock { position:fixed; top:auto; right:0; bottom:0; left:0; grid-row:auto; width:100%; height:calc(52px + env(safe-area-inset-bottom,0px)); padding:3px max(8px,env(safe-area-inset-right,0px)) calc(3px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px)); gap:3px; box-sizing:border-box; grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); align-items:start; border:0; border-top:1px solid #303949; border-radius:0; box-shadow:none; background:#111823; overflow:visible; }
  #mobile-market-dock .mobile-dock-action { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; min-width:0; height:44px; padding:2px; }
  #mobile-market-dock .mobile-dock-action small { display:block; font-size:10px; line-height:1.2; }
  #mobile-market-dock .mobile-dock-action span { font-size:19px; line-height:1.2; }
  #mobile-signal-tabs { display:contents; }
  #mobile-signal-tabs button { width:100%; min-width:0; height:44px; padding:0; font-size:20px; font-weight:650; touch-action:manipulation; }
  #mobile-symbol-current { max-width:100%; padding-inline:2px; border:1px solid #364052; border-radius:5px; background:#1b2534; font-size:12px; text-overflow:ellipsis; overflow:hidden; white-space:nowrap; }
  #signal-monitor .signal-monitor-body { grid-row:1; padding:6px 8px 14px; gap:8px; }
  #signal-monitor .confluence-group-head { padding:10px; background:#141e2b; }
  #signal-monitor .confluence-row { padding:8px 10px; }
  #signal-monitor .confluence-ticker { min-height:36px; font-size:16px; }
  #signal-monitor .confluence-badges { gap:5px; }
  #signal-monitor .confluence-badge { font-size:12px; line-height:1.5; padding:4px 6px; }
  #signal-monitor .confluence-more > summary { min-height:44px; padding:10px; box-sizing:border-box; }
  #current-symbol-signals { margin:0 0 8px; }
  #signal-monitor #current-symbol-signals:not(.mobile-current-signals-open) { display:none !important; }
  #signal-monitor #current-symbol-signals.mobile-current-signals-open { display:block !important; position:fixed; z-index:30; bottom:calc(56px + env(safe-area-inset-bottom,0px)); left:6px; right:6px; margin:0; padding:10px; max-height:50dvh; overflow-y:auto; box-shadow:0 -8px 24px #0008; }
  #current-symbol-signals-title { font-size:14px; }
  #current-symbol-signals header { flex-wrap:wrap; white-space:normal; overflow:visible; }
  #current-symbol-signals-list { flex-wrap:wrap; overflow:visible; padding-bottom:0; }
  .current-symbol-signal-row .current-symbol-badge { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
  #morning-gainers-section { padding:0; overflow:hidden; }
  #morning-gainers-section > summary,#morning-gainers-meta { display:none; }
  #morning-gainers-list { display:flex; flex-wrap:nowrap; gap:6px; overflow-x:auto; overflow-y:hidden; min-width:0; height:40px; align-items:center; scrollbar-width:none; touch-action:pan-x; }
  #morning-gainers-list .morning-gainer { width:auto; max-width:none; flex:0 0 auto; flex-wrap:nowrap; white-space:nowrap; min-height:34px; padding:6px; font-size:12px; box-sizing:border-box; }
  #morning-gainers-list .signal-empty { min-height:0; padding:6px; white-space:nowrap; font-size:11px; }
  #morning-gainers-list .morning-gainers-more { display:block; flex:0 0 auto; width:auto; margin:0; }
  #morning-gainers-list .morning-gainers-more > summary { display:none; }
  #morning-gainers-list .morning-gainers-more > .signal-members { display:flex; flex-wrap:nowrap; align-items:center; gap:6px; margin:0; }
}
