:root {
  --bg: #071718;
  --panel: #0b2022;
  --line: #1d383b;
  --line2: #25484b;
  --text: #d7eeee;
  --muted: #86a2a5;
  --faint: #57777a;
  --cyan: #35d7cc;
  --cyan2: #1aa59d;
  --red: #ff5b68;
  --green: #16c99a;
  --yellow: #d3a61f;
  --pink: #e8a0b0;
  --shadow: rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line2);
  background: #10292b;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
}
button:hover { border-color: var(--cyan2); }
button.active, button[type="submit"] {
  background: #0f3b3b;
  border-color: var(--cyan);
  color: #dffffc;
}
button.ghost { background: transparent; }
button.danger { border-color: #7f2e39; color: #ff9aa3; background: #2a1116; }
button.link-btn { background: transparent; border: 0; color: var(--cyan); padding: 0; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.desktop-only { display: block; }

.login-shell {
  height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 0%, #123437 0%, #071718 55%);
}
.login-panel {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line2);
  background: #0b2022;
  border-radius: 8px;
  padding: 24px;
}
.brand-line { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 6px;
  background: #112f32; color: var(--cyan); font-weight: 800;
}
.login-panel h1 { margin: 0; font-size: 24px; }
.login-panel p { margin: 4px 0 0; color: var(--muted); }
label { display: grid; gap: 6px; color: var(--muted); margin: 13px 0; }
input, select, textarea {
  border: 1px solid var(--line2);
  background: #07191b;
  border-radius: 6px;
  outline: none;
}
input, select { height: 36px; padding: 0 10px; }
textarea { width: 100%; min-height: 80px; padding: 12px; resize: vertical; }
.error-text { min-height: 18px; color: var(--red); }
.helper-text { color: var(--muted); line-height: 1.3; }
.inline-check { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.app { display: flex; height: 100vh; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: #081b1d;
  flex-wrap: wrap;
  position: relative;
  z-index: 30;
}
.ticker-anchor { position: relative; flex-shrink: 0; }
.ticker-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0; padding: 4px 8px 4px 0;
  font-weight: 800;
}
.ticker-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  overflow: hidden;
}
.ticker-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticker-icon.fallback img:not([src]) { display: none; }
.ticker-icon.fallback::before { content: attr(data-fallback); }
.ticker-btn:hover { color: var(--cyan); }
.ticker-btn.switching { color: var(--cyan); }
.ticker-btn.switching .ticker-caret { animation: ticker-pulse 0.8s ease-in-out infinite; }
@keyframes ticker-pulse { 50% { opacity: 0.35; } }
.ticker-name { font-size: 22px; }
.ticker-caret { color: var(--muted); font-size: 14px; display: inline-flex; }
.ticker-caret svg, .timeframe-menu-btn svg { display: block; }
.tag {
  font-size: 11px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; background: #163a3d; color: var(--cyan);
}
.tag.lev { background: #1a3336; }
.topbar-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; flex: 1; }
.stat span { display: block; color: var(--muted); margin-bottom: 2px; font-size: 11px; }
.stat strong { font-size: 13px; white-space: nowrap; }
.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
#networkBadge {
  background: #0e4745; color: var(--cyan);
  border-radius: 5px; padding: 5px 7px; font-weight: 700;
}
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line2); background: #102729;
  color: var(--muted); border-radius: 5px; padding: 4px 7px; font-size: 11px;
}
.chip.ok { color: var(--cyan); border-color: #1b6b66; }
.chip.bad { color: var(--red); border-color: #76323b; }
.user-menu { position: relative; }
.user-menu-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #14383b;
  color: var(--cyan);
  font-weight: 800;
}
.user-caret { color: var(--muted); font-size: 11px; transform: translateY(1px); }
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 42;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #0b1e20;
  box-shadow: 0 14px 34px var(--shadow);
}
.user-menu-panel button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
}
.user-menu-panel button:hover { background: #10292b; }

/* Ticker popover */
.picker-backdrop {
  position: fixed; inset: 0; z-index: 28;
  background: transparent;
}
.picker-popover {
  position: fixed;
  z-index: 35;
  width: min(780px, calc(100vw - 20px));
  max-height: min(520px, calc(100vh - 100px));
  background: #0b1e20;
  border: 1px solid var(--line2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px var(--shadow);
}
.picker-head { padding: 10px 12px 0; }
.picker-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}
.picker-search-wrap { display: flex; gap: 8px; align-items: center; }
.picker-search-wrap input { flex: 1; height: 38px; background: #07191b; }
.picker-mode { height: 32px; font-size: 12px; padding: 0 10px; flex-shrink: 0; }
.picker-mode.active { background: #0f3b3b; border-color: var(--cyan); color: var(--cyan); }
.picker-cats {
  display: flex; gap: 2px; padding: 8px 12px 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; flex-shrink: 0;
}
.picker-cats button {
  border: 0; background: transparent; color: var(--muted);
  white-space: nowrap; padding: 6px 10px; flex-shrink: 0;
}
.picker-cats button.active { color: var(--text); border-bottom: 2px solid var(--cyan); border-radius: 0; }
.picker-subcats {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.picker-subcats:empty { display: none; }
.picker-subcats button {
  border: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 0;
  padding: 7px 0;
  flex-shrink: 0;
}
.picker-subcats button.active { color: var(--text); border-bottom: 2px solid var(--cyan); }
.picker-table-head {
  display: grid; gap: 8px; padding: 6px 14px;
  color: var(--muted); font-size: 11px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.picker-table-head.desktop-only {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
}
.picker-table-head.mobile-only {
  grid-template-columns: 1.4fr 1.2fr 1fr;
}
.picker-list { flex: 1; overflow: auto; min-height: 120px; }
.picker-row {
  display: grid; gap: 8px; padding: 8px 14px;
  align-items: center; cursor: pointer;
  border-bottom: 1px solid #122628;
}
.picker-row.desktop-only-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr; }
.picker-row.mobile-only-grid { grid-template-columns: 1.4fr 1.2fr 1fr; }
.picker-row:hover, .picker-row.focused { background: #102729; }
.picker-row .sym { display: flex; align-items: center; gap: 6px; font-weight: 700; flex-wrap: wrap; }
.picker-row .sym b { font-weight: 800; }
.picker-row .sym em { color: var(--muted); font-style: normal; font-weight: 600; }
.picker-row .star { color: var(--yellow); border: 0; background: transparent; padding: 0; }
.picker-row .star.off { color: var(--faint); }
.picker-row .cell-right { text-align: right; font-size: 12px; }
.picker-row .cell-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Panel grid */
.panel-grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 330px 300px;
  border-bottom: 1px solid var(--line);
}
.chart-panel, .book-panel {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  background: #081b1d; overflow: hidden;
}
.chart-panel { position: relative; }
.chart-panel.fullscreen {
  position: fixed; inset: 0; z-index: 20;
}
.toolbar {
  flex: 0 0 46px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.timeframes { display: flex; gap: 4px; }
.timeframes button, .tool { border: 0; background: transparent; color: var(--muted); }
.timeframes button.active { color: var(--cyan); border: 1px solid var(--line2); background: #102729; }
.timeframe-menu-anchor { position: relative; }
.timeframe-menu-btn { min-width: 28px; }
.timeframe-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 36;
  width: 180px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line2);
  background: #0b2022;
  box-shadow: 0 18px 42px var(--shadow);
}
.timeframe-group { border-bottom: 1px solid var(--line); padding: 6px 0; }
.timeframe-group-title {
  display: flex; justify-content: space-between;
  padding: 5px 12px 7px;
  color: var(--faint); font-size: 12px;
}
.timeframe-menu button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  color: var(--text);
}
.timeframe-menu button.active { background: var(--cyan); color: #062022; }
.timeframe-star { color: var(--yellow); }
.chart-main { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.chart-title { position: absolute; top: 10px; left: 18px; z-index: 2; color: var(--muted); pointer-events: none; }
#chart { flex: 1; min-height: 0; }
.chart-panel.loading-candles .chart-main::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 14px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(53, 215, 204, .2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.indicator-pane { height: 120px; border-top: 1px solid var(--line); flex-shrink: 0; }

/* Order book */
.book-panel { border-left: 1px solid var(--line); }
.book-controls {
  flex: 0 0 36px; display: flex; justify-content: space-between;
  align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); gap: 8px;
}
.book-controls select { flex: 1; height: 28px; font-size: 12px; }
.tabs { flex: 0 0 40px; display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; border: 0; border-radius: 0; background: transparent;
  color: var(--muted); height: 100%;
}
.tabs button.active { color: var(--text); border-bottom: 1px solid var(--cyan); }
.ladder, .trades {
  flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0;
}
.row3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  position: relative; padding: 3px 12px; min-height: 22px; font-size: 12px;
}
.row3.header { color: var(--muted); position: sticky; top: 0; background: #081b1d; z-index: 1; }
.row3 span { position: relative; z-index: 1; text-align: right; }
.row3 span:first-child { text-align: left; }
.ask { color: var(--red); }
.bid, .buy { color: var(--green); }
.bar { position: absolute; top: 1px; bottom: 1px; right: 0; opacity: .28; }
.bar.ask { background: var(--red); }
.bar.bid { background: var(--green); }
.spread {
  display: flex; justify-content: center; gap: 20px; padding: 6px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: #112528; font-weight: 700; font-size: 12px;
}
.depth-grid {
  padding: 0;
  overflow: hidden auto;
}
.depth-head {
  display: grid;
  grid-template-columns: 1.15fr .9fr .9fr 1.15fr;
  gap: 8px;
  padding: 4px 14px 8px;
  color: var(--muted);
}
.depth-head span:nth-child(2),
.depth-head span:nth-child(3) {
  text-align: right;
}
.depth-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.depth-row {
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 8px;
  position: relative;
  min-height: 30px;
  padding: 3px 14px;
  align-items: center;
  font-size: 15px;
}
.depth-row.ask { grid-template-columns: .9fr 1fr; }
.depth-row span,
.depth-row strong {
  position: relative;
  z-index: 1;
  font-weight: 500;
}
.depth-row span { color: var(--text); }
.depth-row strong { text-align: right; }
.depth-row.ask strong { text-align: left; }
.depth-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  opacity: .24;
}
.depth-bar.bid { right: 0; background: var(--green); }
.depth-bar.ask { left: 0; background: var(--red); }

/* Trade panel */
.trade-panel {
  min-width: 0; min-height: 0;
  border-left: 1px solid var(--line);
  background: #09191b; padding: 12px;
  overflow: auto; display: flex; flex-direction: column; gap: 10px;
}
.mobile-trade-head {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  min-height: 36px;
  align-items: center;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  margin: -6px -6px 2px;
  padding: 0 4px;
}
.mobile-trade-head button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: var(--text);
  border: 0;
  background: transparent;
  font-weight: 700;
}
.trade-row { display: flex; align-items: center; gap: 8px; }
.trade-row.three { display: grid; grid-template-columns: repeat(3, 1fr); }
.trade-pill { min-height: 42px; width: 100%; font-weight: 700; text-align: center; background: #17292d; }
.input-pill { padding: 0; border: 1px solid var(--line2); }
.trade-tabs, .side-switch { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.trade-tabs button, .side-switch button {
  border: 0; border-radius: 0; background: transparent; color: var(--muted); min-height: 40px; font-weight: 700;
}
.trade-tabs button.active { color: var(--text); border-bottom: 1px solid var(--cyan); }
.side-switch { grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.side-switch button.active { background: var(--cyan); color: #062022; }
.side-switch button[data-trade-side="sell"].active { background: var(--red); color: #fff; }
.trade-meta { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; color: var(--muted); }
.trade-meta strong { color: var(--text); text-align: right; }
.trade-panel label { margin: 0; }
.trade-panel input, .trade-panel select { width: 100%; height: 42px; }
.trade-panel input,
.trade-panel select {
  border-radius: 8px;
  background: #0a1e20;
}
.trade-panel input::placeholder { color: var(--muted); }
.trade-input-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #0a1e20;
  padding: 0 10px;
  color: var(--muted);
}
.trade-input-card input {
  border: 0;
  background: transparent;
  text-align: right;
  color: var(--text);
  padding: 0;
}
.size-row { display: grid; gap: 6px; }
.size-label { color: var(--muted); font-size: 12px; }
.size-input-wrap { display: grid; grid-template-columns: 1fr 72px; gap: 6px; }
.size-slider { display: grid; grid-template-columns: 1fr 62px; gap: 10px; align-items: center; }
.size-slider output {
  border: 1px solid var(--line2); border-radius: 6px; height: 36px;
  display: grid; place-items: center; font-weight: 700;
}
.tpsl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpsl-input-card {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #0a1e20;
  padding: 0 8px;
  color: var(--muted);
}
.tpsl-input-card input,
.tpsl-input-card select {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: right;
  color: var(--text);
}
.tpsl-input-card select {
  width: auto;
  min-width: 34px;
  color: var(--text);
  font-weight: 800;
}
.dual-input { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.input-suffix {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line2);
  border-radius: 8px;
  color: var(--muted);
}
.tif-label { color: var(--muted); border-bottom: 1px dashed currentColor; }
.tx-link { color: var(--cyan); margin-left: 5px; text-decoration: none; }
.submit-trade {
  min-height: 46px; background: var(--cyan); border-color: var(--cyan);
  color: #062022; font-weight: 800;
}
.trade-estimates { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.trade-estimates div { display: flex; justify-content: space-between; }
.trade-result {
  min-height: 60px; max-height: 140px; overflow: auto; margin: 0;
  border: 1px solid var(--line); border-radius: 6px; padding: 10px;
  background: #07191b; font-size: 11px; white-space: pre-wrap;
}

/* Bottom panel */
.bottom-panel {
  height: 280px; background: var(--panel);
  display: flex; flex-direction: column; min-height: 0;
}
.bottom-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.bottom-tabs {
  display: flex; justify-content: space-between;
  padding: 0 8px; gap: 8px; overflow-x: auto;
  min-height: 40px; align-items: stretch;
}
.bottom-tabs-left, .bottom-tabs-right {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.bottom-tabs-left { border-right: 1px solid var(--line); padding-right: 8px; }
.bottom-tabs button {
  border: 0; border-radius: 0; background: transparent;
  color: var(--muted); height: 40px; padding: 0 10px; white-space: nowrap;
}
.bottom-tabs button.active { color: var(--text); border-bottom: 1px solid var(--cyan); }
.bottom-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 6px 12px 8px; flex-wrap: wrap;
}
.bottom-actions button { font-size: 12px; padding: 5px 10px; }
.table-view { flex: 1; min-height: 0; overflow: auto; }
.hl-table-wrap { padding: 0; }

/* HL-style tables */
table.hl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.hl-table th, table.hl-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px; text-align: left; vertical-align: middle;
}
table.hl-table th {
  color: var(--muted); font-weight: 600; background: #0b2022;
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.hl-table td { white-space: nowrap; }
table.hl-table .mono { font-family: "SFMono-Regular", Consolas, monospace; }
.coin-cell { display: flex; align-items: center; gap: 6px; }
.coin-name { font-weight: 700; }
.coin-name.long-tone { color: var(--green); }
.coin-name.short-tone { color: var(--pink); }
.dir-long { color: var(--green); font-weight: 600; }
.dir-close-long, .dir-short { color: var(--pink); font-weight: 600; }
.editable-cell { display: inline-flex; align-items: center; gap: 4px; }
.editable-cell input {
  width: 88px; height: 28px; font-size: 12px; padding: 0 6px;
}
.icon-edit { color: var(--cyan); cursor: pointer; font-size: 12px; }
.action-link {
  background: transparent; border: 0; color: var(--cyan);
  padding: 0; font-weight: 600; cursor: pointer;
}
.action-link:hover { text-decoration: underline; }
.table-foot { padding: 10px 12px; }
.table-foot a { color: var(--cyan); text-decoration: none; margin-right: 16px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.toggle-on { color: var(--green); }
.toggle-off { color: var(--red); }
.mini-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Indicators popover */
.indicators-popover {
  position: fixed; z-index: 40;
  width: min(420px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 36px));
  background: #0b2022;
  border: 1px solid var(--line2);
  border-radius: 0;
  box-shadow: 0 20px 50px var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.indicators-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.indicators-head h3 { margin: 0; font-size: 22px; }
.indicators-search {
  margin: 10px 18px 14px; height: 42px; width: calc(100% - 36px);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.indicators-label { padding: 0 22px 8px; color: var(--muted); font-size: 11px; }
.indicator-list { overflow: auto; flex: 1; padding-bottom: 8px; }
.indicator-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 22px; cursor: pointer; border: 0; width: 100%;
  text-align: left; background: transparent; border-radius: 0;
  min-height: 32px;
}
.indicator-item:hover, .indicator-item.active { background: #102729; }
.indicator-item .star { color: var(--yellow); }
.indicator-item .star.off { color: var(--faint); }

/* Modals */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.58);
  display: grid; place-items: center; z-index: 50;
}
.modal-box {
  width: min(880px, calc(100vw - 28px));
  max-height: calc(100vh - 40px); overflow: auto;
  border: 1px solid var(--line2); border-radius: 8px;
  background: #0b2022; padding: 18px;
}
.modal-sm { width: min(420px, calc(100vw - 28px)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.icon-btn { width: 30px; height: 30px; padding: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.leverage-row { display: grid; grid-template-columns: 1fr 64px 20px; gap: 10px; align-items: center; margin: 16px 0; }
.risk-warn { margin-top: 12px; padding: 10px; border: 1px solid #7f2e39; border-radius: 6px; color: #ff9aa3; font-size: 12px; }
.kv-list { display: grid; gap: 8px; margin: 12px 0; }
.kv-list div { display: flex; justify-content: space-between; }
.tpsl-new { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.signal-modal { width: min(720px, calc(100vw - 28px)); }
.signal-form {
  display: grid; grid-template-columns: 120px 1fr;
  margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.signal-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #091a1c; }
.signal-sidebar button {
  border: 0; border-radius: 0; background: transparent; color: var(--muted);
  text-align: left; padding: 12px 14px;
}
.signal-sidebar button.active { color: var(--text); background: #0b2022; border-left: 2px solid var(--cyan); }
.signal-body { padding: 16px; overflow: auto; }
.webhook-config { padding: 12px; display: grid; gap: 12px; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(4, 10, 16, .74);
}
.trade-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 59;
  background: #081b1d;
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0));
  display: grid;
  gap: 16px;
  max-height: 72dvh;
  overflow: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { margin: 0; font-size: 24px; }
.sheet-head button { border: 0; background: transparent; color: var(--text); font-size: 26px; }
.sheet-body { display: grid; gap: 14px; }
.sheet-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.sheet-tabs button { border: 0; border-radius: 0; background: transparent; color: var(--muted); min-height: 44px; font-weight: 800; }
.sheet-tabs button.active { color: var(--text); border-bottom: 1px solid var(--cyan); }
.sheet-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px 12px;
  text-align: left;
  border: 1px solid var(--line2);
  background: #0a1e20;
  border-radius: 10px;
  padding: 16px;
}
.sheet-option .check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line2);
  border-radius: 4px;
  grid-row: 1 / span 2;
}
.sheet-option.active .check { border-color: var(--cyan); box-shadow: inset 0 0 0 3px #0a1e20; background: var(--cyan); }
.sheet-option b { color: var(--text); font-size: 17px; }
.sheet-option small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.sheet-copy { margin: 0; color: var(--text); }
.sheet-leverage { display: grid; grid-template-columns: 1fr 90px; gap: 12px; align-items: center; }
.sheet-leverage label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 0 10px;
}
.sheet-leverage input[type="text"],
.sheet-leverage input[inputmode] {
  border: 0;
  background: transparent;
  text-align: center;
}
.sheet-warning {
  margin: 0;
  border: 1px solid var(--red);
  background: rgba(255, 93, 120, .12);
  color: var(--red);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--line);
  background: #081b1d;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-bottom-nav button {
  flex: 1; border: 0; border-radius: 0; background: transparent;
  color: var(--muted); padding: 10px 0; display: grid; gap: 4px;
  place-items: center; font-size: 11px;
}
.mobile-bottom-nav button.active { color: var(--cyan); }
.mobile-bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  opacity: .58;
}
.mobile-bottom-nav button.active .nav-icon { opacity: 1; }
.mobile-bottom-nav .nav-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.mobile-main-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #081b1d;
}
.mobile-main-tabs button {
  flex: 1; border: 0; border-radius: 0; background: transparent;
  color: var(--muted); height: 40px;
}
.mobile-main-tabs button.active { color: var(--text); border-bottom: 1px solid var(--cyan); }

@media (max-width: 1100px) {
  body { overflow: auto; }
  .app { min-height: 100vh; height: auto; }
  .panel-grid { grid-template-columns: 1fr; }
  .book-panel, .trade-panel { border-left: 0; border-top: 1px solid var(--line); }
  .book-panel { height: 360px; }
  .trade-panel { min-height: 520px; }
  .bottom-panel { height: 360px; }
}

@media (max-width: 768px) {
  .mobile-only { display: flex !important; }
  .mobile-only.block { display: block !important; }
  .desktop-only { display: none !important; }
  body { overflow: hidden; }
  .app { height: 100vh; height: 100dvh; }
  .workspace { height: 100%; overflow: hidden; }
  .topbar-stats .stat.wide { display: none; }
  .topbar {
    height: 60px;
    min-height: 60px;
    gap: 8px;
    padding: 0 12px;
    background: #101d22;
    border-bottom: 1px solid var(--line);
    align-items: center;
    flex-wrap: nowrap;
  }
  .ticker-anchor { width: 50%; min-width: 0; order: 1; }
  .ticker-btn {
    width: 100%;
    min-height: 52px;
    align-items: center;
    padding: 0;
    gap: 7px;
  }
  .ticker-btn .tag { flex-shrink: 0; }
  .ticker-name {
    font-size: clamp(22px, 6.2vw, 30px);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
  }
  .ticker-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 12px;
  }
  .ticker-caret { font-size: 18px; }
  .tag { border-radius: 7px; font-size: 13px; padding: 3px 8px; }
  .topbar-stats {
    display: none;
  }
  .mobile-price-anchor {
    order: 2;
    width: 50%;
    flex: 0 0 50%;
    position: relative;
    justify-content: flex-end;
  }
  .mobile-price-btn {
    width: 100%;
    min-height: 52px;
    padding: 0 6px 0 0;
    border: 0;
    background: transparent;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    align-items: center;
    text-align: right;
    column-gap: 6px;
  }
  #mobileMarkPx {
    grid-column: 1;
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1;
    font-weight: 500;
    color: var(--text);
  }
  #mobileDayChange {
    grid-column: 1;
    font-size: 13px;
    line-height: 1.1;
    font-weight: 600;
  }
  .mobile-price-caret {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: var(--muted);
    font-size: 17px;
  }
  #mobileDayChange.pos,
  .mobile-stats-panel .pos { color: var(--green); }
  #mobileDayChange.neg,
  .mobile-stats-panel .neg { color: var(--red); }
  .mobile-stats-panel {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 34;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--line2);
    background: #101d22;
    box-shadow: 0 14px 30px var(--shadow);
  }
  .mobile-stats-panel div { min-width: 0; }
  .mobile-stats-panel span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 3px;
  }
  .mobile-stats-panel strong,
  .mobile-stats-panel b {
    font-size: 15px;
    font-weight: 700;
  }
  .topbar-right {
    order: 3;
    display: none;
  }
  #networkBadge,
  .topbar-right .ghost {
    min-height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
  }
  #networkBadge { padding: 0 14px; }
  .workspace.mode-market .topbar {
    height: 60px;
    min-height: 60px;
    padding: 0 12px;
    align-items: center;
  }
  .workspace.mode-market .topbar-right { display: none; }
  .workspace.mode-market .ticker-anchor {
    width: 50%;
    flex: 0 0 50%;
  }
  .workspace.mode-market .ticker-btn {
    min-height: 52px;
    align-items: center;
  }
  .workspace.mode-market .ticker-name { font-size: clamp(26px, 7vw, 34px); }
  .panel-grid {
    flex: 1; min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .panel-grid .mobile-pane { display: none; min-height: 0; }
  .panel-grid .mobile-pane.active { display: flex; flex: 1; }
  .panel-grid.mode-trade {
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1.42fr) minmax(132px, .95fr);
    grid-template-rows: minmax(0, 1fr);
    border-bottom: 4px solid #2a2d2e;
  }
  .panel-grid.mode-trade .trade-panel.active,
  .panel-grid.mode-trade .book-panel.active { display: flex; }
  .panel-grid.mode-trade .chart-panel,
  .panel-grid.mode-trade .book-panel:not(.active) { display: none !important; }
  .panel-grid.mode-market .trade-panel { display: none !important; }
  .workspace.mode-market .book-tabs { display: none; }
  .workspace.mode-trade .mobile-main-tabs { display: none !important; }
  .workspace.mode-trade .topbar { height: 60px; min-height: 60px; }
  .workspace.mode-trade .topbar-right { display: none; }
  .workspace.mode-trade .ticker-anchor { width: 50%; }
  .workspace.mode-trade .mobile-trade-head { display: grid !important; }
  .workspace.mode-trade .trade-row.three { display: none; }
  .workspace.mode-trade .trade-panel {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    padding: 10px;
    gap: 8px;
    border-top: 0;
    border-right: 1px solid var(--line);
    overflow: auto;
    box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line);
    font-size: 13px;
  }
  .workspace.mode-trade .book-panel {
    grid-column: 2;
    grid-row: 1;
    height: auto;
    border-top: 0;
    background: #0e1d21;
  }
  .workspace.mode-trade .book-tabs,
  .workspace.mode-trade .book-controls { display: none; }
  .workspace.mode-trade .row3 {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 3px 8px;
    font-size: 13px;
  }
  .workspace.mode-trade .row3 span:nth-child(3) { display: none; }
  .workspace.mode-trade .row3.header span:first-child,
  .workspace.mode-trade .row3 span:first-child { text-align: left; }
  .workspace.mode-trade .row3.header span:nth-child(2),
  .workspace.mode-trade .row3 span:nth-child(2) { text-align: right; }
  .workspace.mode-trade .row3.header span:nth-child(2)::after {
    content: "";
  }
  .workspace.mode-trade .spread {
    justify-content: flex-start;
    gap: 8px;
    padding: 7px 8px;
    background: transparent;
  }
  .workspace.mode-trade .spread span:first-child {
    color: var(--red);
    font-size: 18px;
  }
  .workspace.mode-trade .spread span:first-child::before { content: "$"; }
  .workspace.mode-trade .trade-tabs {
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 0;
    background: #202d31;
    border-radius: 7px;
    overflow: hidden;
  }
  .workspace.mode-trade .side-switch {
    min-height: 42px;
    flex: 0 0 auto;
    border-radius: 7px;
    background: #202d31;
  }
  .workspace.mode-trade .trade-tabs button,
  .workspace.mode-trade .side-switch button {
    min-height: 32px;
    font-size: 13px;
    line-height: 1.2;
    display: grid;
    place-items: center;
  }
  .workspace.mode-trade .trade-tabs button.active {
    background: transparent;
    border-bottom: 1px solid var(--cyan);
    color: var(--text);
  }
  .workspace.mode-trade .trade-meta {
    grid-template-columns: 1fr auto;
    font-size: 12px;
  }
  .workspace.mode-trade .trade-position-row,
  .workspace.mode-trade .trade-slippage-row,
  .workspace.mode-trade .live-check { display: none !important; }
  .workspace.mode-trade .trade-panel input,
  .workspace.mode-trade .trade-panel select {
    height: 36px;
    border-radius: 7px;
    background: #0a1e20;
    font-size: 13px;
  }
  .workspace.mode-trade .trade-panel input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    padding: 0;
    accent-color: var(--cyan);
  }
  .workspace.mode-trade .trade-panel input[type="range"] {
    height: auto;
    padding: 0;
  }
  .workspace.mode-trade .size-input-wrap { grid-template-columns: 1fr 70px; }
  .workspace.mode-trade .size-slider {
    grid-template-columns: 1fr 54px;
    gap: 7px;
  }
  .workspace.mode-trade .trade-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .workspace.mode-trade .trade-row:has(#tradeReduceOnly),
  .workspace.mode-trade .trade-row:has(#tradeTpslEnable) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-items: start;
    gap: 7px;
  }
  .workspace.mode-trade .inline-check {
    min-height: 22px;
    font-size: 13px;
    flex: 1 1 82px;
    white-space: nowrap;
    justify-content: flex-start;
  }
  .workspace.mode-trade .tpsl-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .workspace.mode-trade .tpsl-input-card {
    min-height: 40px;
    font-size: 12px;
    gap: 5px;
    padding: 0 7px;
  }
  .workspace.mode-trade .tpsl-input-card input,
  .workspace.mode-trade .tpsl-input-card select {
    height: 38px;
    font-size: 13px;
  }
  .workspace.mode-trade #tradeProRow {
    justify-content: flex-end;
    align-items: center;
  }
  .workspace.mode-trade #tradeProRow select {
    width: auto;
    min-width: 76px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 800;
  }
  .workspace.mode-trade .live-check {
    justify-content: flex-end;
    margin-top: -2px;
  }
  .workspace.mode-trade .submit-trade {
    min-height: 48px;
    border-radius: 9px;
    font-size: 15px;
  }
  .workspace.mode-trade .trade-estimates {
    gap: 5px;
    font-size: 12px;
    margin-top: 2px;
  }
  .workspace.mode-trade .trade-estimates div:nth-child(4) { display: none; }
  .workspace.mode-trade .trade-result {
    max-height: 82px;
    min-height: 42px;
  }
  .bottom-panel {
    flex: 1; min-height: 0; height: auto;
    display: none;
  }
  .bottom-panel.mobile-show { display: flex; }
  .bottom-panel.mobile-trade-dock {
    flex: 0 0 178px;
    min-height: 178px;
    background: #0d1d21;
  }
  .bottom-panel.mobile-trade-dock .bottom-header {
    border-bottom-color: #2a2d2e;
  }
  .bottom-panel.mobile-trade-dock .bottom-tabs {
    min-height: 42px;
    padding: 0;
  }
  .bottom-panel.mobile-trade-dock .bottom-tabs-left,
  .bottom-panel.mobile-trade-dock .bottom-tabs-right {
    border-right: 0;
    padding-right: 0;
  }
  .bottom-panel.mobile-trade-dock .bottom-tabs button {
    height: 42px;
    padding: 0 14px;
    font-size: 15px;
  }
  .bottom-panel.mobile-trade-dock .bottom-actions { display: none; }
  .bottom-panel.mobile-trade-dock .table-view { overflow: auto hidden; }
  .bottom-panel.mobile-trade-dock table.hl-table {
    min-width: 0;
    font-size: 13px;
  }
  .bottom-panel.mobile-trade-dock table.hl-table th,
  .bottom-panel.mobile-trade-dock table.hl-table td {
    padding: 7px 10px;
  }
  .bottom-panel.mobile-trade-dock table.hl-table th:nth-child(n+4),
  .bottom-panel.mobile-trade-dock table.hl-table td:nth-child(n+4) {
    display: none;
  }
  .bottom-panel.mobile-trade-dock table.hl-table th:nth-child(1),
  .bottom-panel.mobile-trade-dock table.hl-table td:nth-child(1),
  .bottom-panel.mobile-trade-dock table.hl-table th:nth-child(2),
  .bottom-panel.mobile-trade-dock table.hl-table td:nth-child(2),
  .bottom-panel.mobile-trade-dock table.hl-table th:nth-child(3),
  .bottom-panel.mobile-trade-dock table.hl-table td:nth-child(3) {
    width: 33.33%;
  }
  .workspace.mode-account .panel-grid { display: none; }
  .workspace.mode-account .bottom-panel { display: flex; flex: 1; }
  .workspace.mode-account .mobile-main-tabs { display: none; }
  .chart-panel { background: #071b1d; }
  .toolbar {
    flex-basis: 48px;
    padding: 0 14px;
    gap: 14px;
  }
  .timeframes {
    flex: 1;
    justify-content: space-between;
  }
  .timeframe-menu {
    right: -2px;
    width: 172px;
    max-height: min(70dvh, 560px);
  }
  .timeframes button,
  .tool {
    min-height: 38px;
    padding: 0 6px;
    font-size: 15px;
  }
  .timeframes button.active {
    border-radius: 9px;
    padding: 0 14px;
  }
  .chart-title {
    top: 12px;
    left: 14px;
    font-size: 14px;
  }
  .indicators-popover {
    inset: 0 0 0 auto !important;
    width: min(86vw, 420px);
    height: 100dvh;
    max-height: none;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .mobile-main-tabs {
    min-height: 48px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-main-tabs button {
    height: 48px;
    font-size: 16px;
  }
  .book-panel {
    height: auto;
    min-height: 0;
  }
  .book-tabs {
    flex-basis: 48px;
  }
  .book-tabs button { font-size: 16px; }
  .book-controls {
    flex-basis: 44px;
    padding: 0 10px;
  }
  .book-controls select {
    height: 34px;
    border-radius: 9px;
    font-size: 15px;
  }
  .row3 {
    min-height: 26px;
    font-size: 15px;
    padding: 4px 6px;
  }
  .row3.header {
    min-height: 34px;
    font-size: 14px;
  }
  .picker-popover {
    inset: 0 !important;
    width: 100vw !important;
    max-height: 100dvh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #1a2529;
  }
  .workspace.picker-open .signal-fab { display: none !important; }
  .picker-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 60px 12px 8px;
  }
  .picker-close {
    display: grid !important;
    grid-column: 2;
    grid-row: 1;
    place-items: center;
  }
  .picker-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
  }
  .picker-search-wrap input {
    height: 56px;
    border-radius: 9px;
    padding-left: 42px;
    font-size: 17px;
  }
  .picker-mode {
    height: 56px;
    border-radius: 9px;
    padding: 0 18px;
    font-size: 17px;
  }
  .picker-mode.active {
    background: #e86886;
    border-color: #e86886;
    color: white;
  }
  .picker-cats {
    padding: 12px 12px 0;
    gap: 24px;
  }
  .picker-cats button {
    font-size: 20px;
    padding: 8px 0 10px;
    font-weight: 800;
  }
  .picker-subcats {
    padding: 8px 12px 0;
    gap: 26px;
  }
  .picker-subcats button {
    font-size: 18px;
    padding: 8px 0 10px;
    font-weight: 800;
  }
  .picker-table-head.mobile-only {
    display: grid !important;
    grid-template-columns: 1.45fr 1.1fr 1fr;
    padding: 14px 12px 8px;
    font-size: 15px;
    line-height: 1.25;
  }
  .picker-row {
    min-height: 82px;
    padding: 12px;
    border-bottom-color: #3a4446;
  }
  .picker-row.mobile-only-grid {
    grid-template-columns: 1.45fr 1.1fr 1fr;
  }
  .picker-row .sym {
    font-size: 22px;
    gap: 6px;
  }
  .picker-row .star {
    font-size: 20px;
    color: #ffbf45;
  }
  .picker-row .cell-right {
    font-size: 21px;
    color: var(--text);
  }
  .picker-row .cell-sub {
    font-size: 16px;
  }
  .picker-row.desktop-only-grid { display: none; }
  .picker-row.mobile-only-grid { display: grid; }
  .mobile-bottom-nav {
    min-height: calc(68px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid #24383b;
  }
  .mobile-bottom-nav button {
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
    font-size: 14px;
    gap: 4px;
    font-weight: 700;
  }
  .mobile-bottom-nav .nav-icon { line-height: 1; }
  .signal-fab {
    position: fixed;
    right: 18px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0));
    z-index: 32;
    width: auto;
    min-width: 138px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(53, 215, 204, .55);
    border-radius: 999px;
    background: var(--cyan);
    color: #062022;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .38);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    align-items: center;
    justify-content: center;
    display: none !important;
  }
  .signal-fab.visible { display: flex !important; }
  #signalModal {
    place-items: end center;
    padding: 0;
  }
  #signalModal .signal-modal {
    width: 100vw;
    height: 70dvh;
    max-height: 70dvh;
    border-radius: 16px 16px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
  }
  #signalModal .modal-head {
    min-height: 38px;
    padding-bottom: 8px;
  }
  #signalModal.manage-mode .signal-form,
  #signalModal.manage-mode .modal-actions,
  #signalModal.manage-mode #signalError {
    display: none;
  }
  #signalModal.manage-mode .signal-manage-pane {
    display: block;
  }
  .signal-mobile-tabs {
    border: 1px solid var(--line2);
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 8px;
  }
  .signal-mobile-tabs button {
    flex: 1;
    border: 0;
    border-radius: 0;
    background: transparent;
    height: 38px;
    font-weight: 700;
  }
  .signal-mobile-tabs button.active {
    color: #062022;
    background: var(--cyan);
  }
  #signalModal .signal-form {
    grid-template-columns: 1fr;
    flex: 1;
    min-height: 0;
    max-height: none;
    margin-top: 4px;
  }
  #signalModal .signal-sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #signalModal .signal-sidebar button {
    white-space: nowrap;
    text-align: center;
    padding: 10px 12px;
  }
  #signalModal .signal-sidebar button.active {
    border-left: 0;
    border-bottom: 2px solid var(--cyan);
  }
  #signalModal .signal-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding: 12px 4px 4px;
  }
  .signal-manage-pane {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 2px 0 8px;
  }
  .signal-manage-list {
    display: grid;
    gap: 8px;
  }
  .signal-manage-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b2022;
    padding: 10px;
  }
  .signal-manage-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }
  .signal-manage-card h3 {
    margin: 0;
    font-size: 15px;
    overflow-wrap: anywhere;
  }
  .signal-manage-card .signal-status {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted);
  }
  .signal-manage-card .signal-status.on { color: var(--green); }
  .signal-manage-card p {
    margin: 4px 0;
    color: var(--muted);
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .signal-manage-card .mini-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
  }
  .signal-manage-card .mini-actions button {
    flex: 1;
    min-height: 36px;
  }
}

@media (min-width: 769px) {
  .picker-row.mobile-only-grid { display: none; }
  .picker-row.desktop-only-grid { display: grid; }
}
