/* ── Fonts (self-hosted, variable) ───────────────────────────────────────────── */
@font-face {
  font-family: 'Geist';
  src: url('/static/vendor/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/vendor/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ───────────────────────────────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg:        #1A1A1F;
  --surface:   #222228;
  --surface2:  #2A2A32;
  --border:    rgba(255,255,255,0.07);
  --border-md: rgba(255,255,255,0.12);
  --accent:    #F7931A;
  --green:     #22C55E;
  --red:       #EF4444;
  --text:      #F4F4F5;
  --text-2:    #A1A1AA;
  --text-3:    #9696A0;
  --text-inv:  #0A0A0B;
  --font:      'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --accent-tint: rgba(247,147,26,0.12);
  --accent-glow: rgba(247,147,26,0.35);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.22);
  --shadow-pop:  0 8px 28px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  --bg:        #F5F5F7;
  --surface:   #FFFFFF;
  --surface2:  rgba(0,0,0,0.04);
  --border:    rgba(0,0,0,0.06);
  --border-md: rgba(0,0,0,0.10);
  --accent:    #F7931A;
  --green:     #16A34A;
  --red:       #DC2626;
  --text:      #18181B;
  --text-2:    #52525B;
  --text-3:    #67676F;
  --text-inv:  #FFFFFF;
  --font:      'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --accent-tint: rgba(247,147,26,0.12);
  --accent-glow: rgba(247,147,26,0.30);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.07);
  --shadow-pop:  0 8px 28px rgba(0,0,0,0.14);
}

[data-theme="midnight"] {
  --bg:        #060D18;
  --surface:   #0C1829;
  --surface2:  #132030;
  --border:    rgba(255,255,255,0.08);
  --border-md: rgba(255,255,255,0.15);
  --accent:    #00C8FF;
  --green:     #22C55E;
  --red:       #EF4444;
  --text:      #D0E8FF;
  --text-2:    #5A7A9F;
  --text-3:    #6489B0;
  --text-inv:  #060D18;
  --font:      'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --accent-tint: rgba(0,200,255,0.12);
  --accent-glow: rgba(0,200,255,0.40);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 4px 18px rgba(0,0,0,0.4);
  --shadow-pop:  0 8px 28px rgba(0,0,0,0.6);
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; scroll-behavior: smooth; }

/* Keyboard-only focus ring — buttons/nav/links have no indicator otherwise.
   Mouse clicks keep clean styling; only keyboard nav shows the ring. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  transition: background 0.2s, color 0.2s;
  overflow-x: hidden;
}

/* ── App shell ───────────────────────────────────────────────────────────────── */
#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
#sidebar {
  display: none;           /* hidden on mobile */
  width: 170px;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

@media (min-width: 1024px) {
  #sidebar { display: flex; }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.sidebar-brand svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: none;
  background: none;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
  width: 100%;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-tint);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-select-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 11px;
}

.sidebar-select-row svg { width: 12px; height: 12px; flex-shrink: 0; }

.sidebar-select-row select {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}

.sidebar-select-row select:hover { border-color: var(--border-md); }
.sidebar-select-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Main area ───────────────────────────────────────────────────────────────── */
#main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Mobile top bar ──────────────────────────────────────────────────────────── */
.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

@media (min-width: 1024px) { .mobile-topbar { display: none; } }

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.mobile-brand svg { width: 18px; height: 18px; }

.mobile-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Desktop top bar ─────────────────────────────────────────────────────────── */
#topbar {
  display: none;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

@media (min-width: 1024px) { #topbar { display: flex; } }

#topbar-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btc-price-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 11px;
}

.btc-price-widget .price-label { color: var(--text-3); }
.btc-price-widget .price-val { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
#btc-price { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ── Sub-tabs (Home page tabs) ───────────────────────────────────────────────── */
.sub-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) { .sub-tabs { padding: 0 24px; } }

/* mobile pill style */
@media (max-width: 1023px) {
  .sub-tabs { padding: 10px 16px; border-bottom: none; gap: 6px; }
  .sub-tab {
    padding: 6px 12px !important;
    border-radius: 8px !important;
    border-bottom: none !important;
  }
  .sub-tab.active {
    background: var(--accent-tint) !important;
    color: var(--accent) !important;
  }
  .sub-tab.active .sub-tab-indicator { display: none !important; }
}

.sub-tab {
  position: relative;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

.sub-tab:hover { color: var(--text); }
.sub-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Pages ───────────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Main scrollable content area ───────────────────────────────────────────── */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.page-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Constrain content on ultrawide so it doesn't stretch edge-to-edge */
@media (min-width: 1600px) {
  .page-body { max-width: 1520px; margin-inline: auto; width: 100%; }
}

/* Display text: tighter tracking + balanced wrapping */
h1, h2, h3, .page-title {
  letter-spacing: -0.012em;
  text-wrap: balance;
}

@media (max-width: 1023px) {
  .page-body {
    padding-bottom: 80px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
  }
}

@media (min-width: 1024px) {
  .page-body { padding: 24px; }
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

@media (min-width: 1024px) {
  .card:hover { border-color: var(--border-md); transform: translateY(-1px); }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
}

.badge-bull  { color: #22C55E; background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.25); }
.badge-bear  { color: #EF4444; background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.25); }
.badge-orange { color: #F7931A; background: rgba(247,147,26,0.10); border-color: rgba(247,147,26,0.25); }
.badge-neutral { color: var(--text-2); background: var(--surface2); border-color: var(--border); }
.badge-sky  { color: #38BDF8; background: rgba(56,189,248,0.10); border-color: rgba(56,189,248,0.25); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: var(--text-inv); }
.btn-primary:hover { opacity: 0.92; box-shadow: 0 0 0 1px var(--accent-glow), 0 0 12px var(--accent-glow); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-tint { background: var(--accent-tint); color: var(--accent); border: none; }
.btn-tint:hover { background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent-glow); }

.btn-danger { background: transparent; color: var(--red); border: none; }
.btn-danger:hover { background: rgba(239,68,68,0.10); }

.btn-green { background: transparent; border: 1px solid var(--green); color: var(--green); }
.btn-green:hover { background: rgba(34,197,94,0.10); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Scan toolbar ────────────────────────────────────────────────────────────── */
.scan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 500;
}

.live-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ── Status indicator ────────────────────────────────────────────────────────── */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-ok  { background: var(--green); box-shadow: 0 0 5px var(--green); }
.dot-run { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); animation: pulse 1s ease infinite; }

/* ── Filter pills ────────────────────────────────────────────────────────────── */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover { background: var(--surface2); color: var(--text); }
.pill.active { background: var(--accent); color: var(--text-inv); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow), 0 0 10px var(--accent-glow); }
.pill svg { width: 11px; height: 11px; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-md);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s ease, box-shadow 0.12s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--accent-tint); box-shadow: inset 2px 0 0 var(--accent); }

tbody td {
  padding: 10px 16px;
  color: var(--text);
  vertical-align: middle;
}

td.muted { color: var(--text-3); }
td.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.empty-row td {
  text-align: center;
  padding: 32px;
  color: var(--text-3);
}

.depo-val { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.depo-val svg { width: 11px; height: 11px; }
.depo-none { color: var(--text-3); }

/* ── Briefing content ────────────────────────────────────────────────────────── */
.briefing-content {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text);
  padding: 16px;
}

.briefing-content h1 { font-size: 14px; font-weight: 600; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }
.briefing-content h2 { font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
.briefing-content h3 { font-size: 12px; font-weight: 500; color: var(--text-2); margin: 10px 0 4px; }
.briefing-content p  { margin-bottom: 6px; color: var(--text-2); }
.briefing-content p strong, .briefing-content li strong { color: var(--text); }
.briefing-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.briefing-content ul { padding-left: 16px; margin-bottom: 8px; }
.briefing-content li { color: var(--text-2); margin-bottom: 3px; }

/* ── Home 2-col grid ─────────────────────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1024px) {
  .home-grid { grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
}

/* ── Trading layout ──────────────────────────────────────────────────────────── */
/* trading-content is a JS-toggled wrapper (inline display:block), so .page-body's
   flex gap doesn't reach its card children — space them with margin instead */
#trading-content > .card { margin-bottom: 16px; }
#trading-content > .card:last-child { margin-bottom: 0; }
@media (max-width: 639px) { #trading-content > .card { margin-bottom: 12px; } }

.trading-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1280px) {
  .trading-grid { grid-template-columns: 200px 1fr; }
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.setting-row:last-child { border-bottom: none; }

.setting-label { font-size: 12px; color: var(--text-2); }

/* ── Toggle ──────────────────────────────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 20px;
  align-items: center;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.toggle-knob {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  left: 3px;
  transition: transform 0.2s;
}

.toggle.on .toggle-knob { transform: translateX(16px); }

/* ── Settings inputs ─────────────────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 16px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-grid input,
.settings-grid select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-grid input:focus,
.settings-grid select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Settings page field helpers ─────────────────────────────────────────────── */
.s-section { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.s-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.s-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.s-field { display: flex; flex-direction: column; gap: 4px; }
.s-label { font-size: 11px; color: var(--text-3); letter-spacing: 0.04em; }
.s-input, .s-textarea, .s-select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font); font-size: 12px;
  padding: 7px 10px; outline: none; width: 100%; box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.s-textarea { resize: vertical; }
.s-input:focus, .s-textarea:focus, .s-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.s-footer { display: flex; align-items: center; gap: 10px; padding: 0 0 2px; }
.s-ok { font-size: 11px; color: var(--green); display: none; }
.s-err { font-size: 11px; color: var(--red); display: none; }
.s-checks { display: flex; gap: 16px; flex-wrap: wrap; }
.s-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; }
@media (max-width: 600px) {
  .s-row, .s-row-3 { grid-template-columns: 1fr; }
}

/* ── Levels bar ──────────────────────────────────────────────────────────────── */
.levels-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.level-item { white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.level-sep  { color: var(--text-3); padding: 0 8px; }

/* ── Trade section headers ───────────────────────────────────────────────────── */
.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Details/summary (settings accordion) ────────────────────────────────────── */
.trade-settings summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--text-3);
  font-size: 12px;
  padding: 8px 0 10px;
}

.trade-settings summary::-webkit-details-marker { display: none; }
.trade-settings[open] summary { color: var(--text-2); }

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 11px; height: 11px;
  border: 2px solid var(--border-md);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

/* ── Direction / phase ───────────────────────────────────────────────────────── */
.dir-long  { color: #22C55E; font-weight: 600; }
.dir-short { color: #EF4444; font-weight: 600; }
.pnl-pos   { color: #22C55E; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.pnl-neg   { color: #EF4444; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.phase-watch { color: var(--text-3); font-size: 11px; }
.phase-trail { color: var(--accent); font-size: 11px; font-weight: 600; }
.pattern-flag { color: #EAB308; }

/* ── Mobile bottom tab bar ───────────────────────────────────────────────────── */
.mobile-tabbar {
  display: flex;
  align-items: stretch;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(56px + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) { .mobile-tabbar { display: none; } }

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.tab-item svg { width: 20px; height: 20px; }
.tab-item.active { color: var(--accent); }

/* ── Mobile "More" sheet ─────────────────────────────────────────────────────── */
.more-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 101;
}
.more-sheet-overlay.open { display: block; }

.more-sheet {
  display: none;
  flex-direction: column;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  z-index: 102;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
.more-sheet.open { display: flex; }

.more-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 4px auto 10px;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.more-item:active { background: var(--surface2); }
.more-item svg { width: 20px; height: 20px; color: var(--text-3); }

@media (min-width: 1024px) {
  .more-sheet, .more-sheet-overlay { display: none !important; }
}

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes shimmer   { 100% { transform: translateX(100%); } }

/* ── Toasts ──────────────────────────────────────────────────────────────────── */
#toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border-md);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  animation: toast-in 0.18s ease;
}

.toast.ok   { border-left-color: var(--green); }
.toast.err  { border-left-color: var(--red); }
.toast.info { border-left-color: var(--accent); }
.toast.leaving { animation: toast-out 0.2s ease forwards; }
.toast-msg { flex: 1; min-width: 0; word-break: break-word; }

@media (max-width: 639px) {
  #toast-stack { left: 12px; right: 12px; bottom: auto; top: 12px; max-width: none; }
}

/* ── Loading skeletons ───────────────────────────────────────────────────────── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--border-md), transparent);
  animation: shimmer 1.2s infinite;
}
.skel-line { height: 12px; margin: 0; }
.skel-card { height: 64px; }
td .skel-line { width: 100%; max-width: 120px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
  .toast { animation: none; }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-glow); }

/* ── Mobile overrides ────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  body { overflow-x: hidden; }

  .page-body {
    padding: 12px;
    padding-bottom: 80px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
    gap: 12px;
  }

  .card-header { flex-wrap: wrap; gap: 6px; }

  table { display: block; overflow-x: auto; }

  .briefing-content { overflow-wrap: break-word; word-break: break-word; }

  /* scanner table: hide Direction (3), Bars Ago (4), Bar Open (5) */
  #scan-body td:nth-child(3), #scan-body td:nth-child(4), #scan-body td:nth-child(5),
  #scan-head th:nth-child(3), #scan-head th:nth-child(4), #scan-head th:nth-child(5) { display: none; }

  /* signals: hide SL (5), Expires (6) */
  #signals-head th:nth-child(5), #signals-head th:nth-child(6),
  #trade-signals-body td:nth-child(5), #trade-signals-body td:nth-child(6) { display: none; }

  /* positions: hide TF (2), Pattern (3), TP1 (6), Rem Qty (8), Opened (10) */
  #positions-head th:nth-child(2), #positions-head th:nth-child(3),
  #positions-head th:nth-child(6), #positions-head th:nth-child(8), #positions-head th:nth-child(10),
  #trade-positions-body td:nth-child(2), #trade-positions-body td:nth-child(3),
  #trade-positions-body td:nth-child(6), #trade-positions-body td:nth-child(8),
  #trade-positions-body td:nth-child(10) { display: none; }

  /* history: hide TF (2), Pattern (3), Qty (6), Closed (9) */
  #history-head th:nth-child(2), #history-head th:nth-child(3),
  #history-head th:nth-child(6), #history-head th:nth-child(9),
  #trade-history-body td:nth-child(2), #trade-history-body td:nth-child(3),
  #trade-history-body td:nth-child(6), #trade-history-body td:nth-child(9) { display: none; }

  .settings-grid { grid-template-columns: 1fr 1fr; }

  .trading-grid { grid-template-columns: 1fr; }

  /* Stacked tables: each row becomes a card, cells become label/value pairs.
     Opt-in via .stack-sm so the carefully column-hidden scanner/trading tables
     above are left untouched. Detail/expand rows (colspan) opt out via .stack-skip. */
  table.stack-sm { display: block; overflow-x: visible; }
  table.stack-sm thead { display: none; }
  table.stack-sm tbody { display: block; }
  table.stack-sm tbody tr {
    display: block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    margin-bottom: 10px;
  }
  table.stack-sm tbody tr:hover { background: var(--surface2); box-shadow: none; }
  table.stack-sm tbody tr:last-child { margin-bottom: 0; }
  table.stack-sm tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }
  table.stack-sm tbody td:last-child { border-bottom: none; }
  table.stack-sm tbody td::before {
    content: attr(data-label);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    flex-shrink: 0;
  }
  table.stack-sm tbody td[data-label=""]::before { content: none; }
  table.stack-sm tbody tr.empty-row { text-align: center; }
  table.stack-sm tbody tr.empty-row td { display: block; border: none; text-align: center; }
  table.stack-sm tbody tr.empty-row td::before { content: none; }
  table.stack-sm tbody tr.stack-skip td { display: table-cell; }
  table.stack-sm tbody tr.stack-skip td::before { content: none; }

  /* Manual Trade: stack the header, keep levels rows from clipping */
  .manual-page-head { flex-direction: column; align-items: flex-start; }
  .manual-head-controls { width: 100%; flex-wrap: wrap; }
  .manual-head-controls .btn { margin-left: auto; }
  .ml-row { flex-wrap: wrap; gap: 2px 8px; }
  .ml-row .ml-val { min-width: 0; }
  .ml-row.ml-liq .ml-bar { max-width: 60px; }

  /* BTCWEB-34: push the Open Positions card above the 56px fixed tab bar on
     mobile so the Edit/Close action row (last stacked cell) isn't occluded.
     Unconditional: the occlusion is toggle-independent — a bottom margin can't
     break anything, so gating it would only re-expose the bug when OFF. */
  #page-manual .manual-pos-card { margin-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 24px); }
}

/* ── Dashboard (home) ────────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px)  { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: repeat(4, 1fr); } }

.dash-stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.dash-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.dash-stat-val { font-size: 22px; font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.dash-stat-sub { font-size: 11px; color: var(--text-2); }
.dash-stat-val.pos { color: var(--green); }
.dash-stat-val.neg { color: var(--red); }
.dash-stat--acc { border-left: 3px solid var(--border-md); }
.dash-stat--acc.pos { border-left-color: var(--green); }
.dash-stat--acc.neg { border-left-color: var(--red); }

/* ── Data-viz: sparkline, mini-bars, equity curve ──────────────────────────── */
.btc-spark { display: inline-flex; width: 56px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.spark { display: block; width: 100%; height: 100%; }
.mini-bar { display: block; width: 44px; height: 3px; margin-left: auto; margin-top: 3px; opacity: 0.85; }
.equity-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 0; }
.equity-plot { position: relative; padding: 8px 12px 14px 34px; }
.equity-svg { display: block; width: 100%; height: 104px; }

/* equity overlay: % coords map to the SVG box — inset MUST match .equity-plot padding */
.equity-overlay { position: absolute; inset: 8px 12px 14px 34px; pointer-events: none; }
.eq-dot {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  transform: translate(-50%, -50%); opacity: 0.85;
  transition: width 0.12s ease, height 0.12s ease;
}
.eq-dot.win  { background: var(--green); }
.eq-dot.loss { background: var(--red); }
.eq-dot.end  { width: 6px; height: 6px; opacity: 1; }
.eq-dot.active { width: 8px; height: 8px; opacity: 1; box-shadow: 0 0 0 3px var(--surface), 0 0 6px currentColor; }
.eq-peak, .eq-mdd {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%); background: transparent;
}
.eq-peak { border: 1.5px solid var(--green); }
.eq-mdd  { border: 1.5px solid var(--red); }
.eq-crosshair {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--border-md); transform: translateX(-0.5px); display: none;
}
.eq-tip {
  position: absolute; display: none; z-index: 5; min-width: 96px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; font-size: 11px; color: var(--text-2); line-height: 1.5;
  box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,0.25)); white-space: nowrap; pointer-events: none;
}
.eq-tip-h { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.eq-tip .mono { font-variant-numeric: tabular-nums; }
.eq-yaxis { position: absolute; inset: 0; pointer-events: none; }
.eq-ytick {
  position: absolute; left: -32px; width: 28px; text-align: right;
  transform: translateY(-50%); font-size: 10px; color: var(--text-3);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.eq-xaxis {
  display: flex; justify-content: space-between;
  padding: 0 12px 12px 34px; font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .eq-dot { transition: none; }
}
.equity-toggle { display: inline-flex; gap: 2px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; }
.equity-toggle-btn {
  border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 500;
  color: var(--text-2); padding: 3px 10px; border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.equity-toggle-btn:hover { color: var(--text); }
.equity-toggle-btn.active { background: var(--accent-tint); color: var(--accent); }


/* ── OI Flow tab ───────────────────────────────────────────────────────────── */
.oi-stat-box { background:var(--surface2); border-radius:var(--radius); padding:10px 14px; }
.oi-stat-label { font-size:11px; color:var(--text-3); margin-bottom:4px; text-transform:uppercase; letter-spacing:.04em; }
.oi-stat-val { font-size:18px; font-weight:600; font-family:var(--font-mono); font-variant-numeric:tabular-nums; }

/* Last-5-bars OI history table (Pine + Native, aligned by candle time) */
.oi-hist-table { width:100%; border-collapse:collapse; font-size:12px; }
.oi-hist-table th {
  text-align:right; font-weight:500; color:var(--text-3); text-transform:uppercase;
  letter-spacing:.04em; font-size:10px; padding:6px 10px; border-bottom:1px solid var(--border);
}
.oi-hist-table th:first-child { text-align:left; }
.oi-hist-table td { text-align:right; padding:6px 10px; border-bottom:1px solid var(--border); }
.oi-hist-table td:first-child { text-align:left; color:var(--text-2); }
.oi-hist-table td:last-child { text-align:right; }
.oi-hist-table tbody tr:last-child td { border-bottom:none; }
.oi-hist-table tr:first-child td { background:var(--accent-tint); }   /* newest bar highlighted */

/* ── My Reports filter bar ─────────────────────────────────────────────────── */
.reports-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.rf-group { display: flex; flex-direction: column; gap: 5px; }
.rf-group > label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
}
.rf-group > select,
.rf-group > input[type="date"] {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-md);
  background: var(--surface2);
  color: var(--text);
  min-width: 120px;
  outline: none;
  cursor: pointer;
}
.rf-group > select:focus,
.rf-group > input[type="date"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.reports-filter-bar .rf-clear {
  align-self: flex-end;
  font-size: 12px;
  padding: 6px 14px;
}

/* ── Manual Trade desk ─────────────────────────────────────────────── */
.manual-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1023px) { .manual-grid { grid-template-columns: 1fr; } }

.manual-dir-row { display: flex; gap: 8px; margin-bottom: 16px; }
.manual-dir {
  flex: 1;
  justify-content: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-2);
  border-radius: 8px;
  transition: all .12s;
}
.manual-dir:hover { color: var(--text); }
.manual-dir.active-long  { background: rgba(34,197,94,0.14);  color: var(--green); border-color: var(--green); }
.manual-dir.active-short { background: rgba(239,68,68,0.14);  color: var(--red);   border-color: var(--red); }

.manual-entrytype-row { display: flex; gap: 8px; margin-bottom: 14px; }
.manual-etype {
  flex: 1;
  justify-content: center;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-2);
  border-radius: 8px;
  transition: all .12s;
}
.manual-etype:hover { color: var(--text); }
.manual-etype.active { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }

.manual-field { display: block; margin-bottom: 14px; font-size: 12px; color: var(--text-2); }
.manual-field > span { display: block; margin-bottom: 5px; }
.manual-field > input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
}
.manual-field input:focus,
.manual-input-group input:focus,
.manual-input-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Inline SL/TP edit input inside the open-positions table cell. */
.pos-edit-input {
  width: 90px;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
}
.pos-edit-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.manual-input-group { display: flex; gap: 0; }
.manual-input-group select {
  flex: 0 0 auto;
  padding: 9px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--surface2);
  color: var(--text-2);
  outline: none;
  cursor: pointer;
}
.manual-input-group input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.manual-resolved {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface2);
  font-size: 12px;
  min-height: 18px;
}
.manual-resolved .mr-row { display: flex; justify-content: space-between; }
.manual-resolved .mr-row .mr-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.manual-resolved .mr-sl .mr-val { color: var(--red); }
.manual-resolved .mr-tp .mr-val { color: var(--green); }

.manual-submit {
  width: 100%;
  justify-content: center;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text-inv);
  cursor: pointer;
  transition: opacity .12s, box-shadow .12s;
}
.manual-submit:hover { box-shadow: 0 0 0 1px var(--accent-glow), 0 0 14px var(--accent-glow); }
.manual-submit:disabled { opacity: .5; cursor: default; box-shadow: none; }
.manual-submit.is-long  { background: var(--green); color: #fff; }
.manual-submit.is-short { background: var(--red);   color: #fff; }

.manual-status { min-height: 16px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.manual-warn { margin: 12px 0 0; font-size: 11px; line-height: 1.5; color: var(--text-3); }

.ml-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin: 14px 0 6px;
}
.ml-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.ml-row:last-child { border-bottom: none; }
.ml-row .ml-label { color: var(--text-2); }
.ml-row .ml-val { font-variant-numeric: tabular-nums; color: var(--text); }
/* Highlighted (named structure) rows: tint the background by side, bold the text,
   keep the side color so above=green / below=red still reads correctly. */
.ml-row.ml-hot { border-radius: 6px; padding: 6px 8px; border-bottom: none; }
.ml-row.ml-hot.ml-above { background: rgba(34,197,94,0.10); }
.ml-row.ml-hot.ml-below { background: rgba(239,68,68,0.10); }
.ml-row.ml-hot .ml-label,
.ml-row.ml-hot .ml-val { font-weight: 700; }
.ml-row.ml-hot.ml-above .ml-label,
.ml-row.ml-hot.ml-above .ml-val { color: var(--green); }
.ml-row.ml-hot.ml-below .ml-label,
.ml-row.ml-hot.ml-below .ml-val { color: var(--red); }
.ml-row .ml-sub { font-size: 11px; color: var(--text-3); margin-left: 8px; }
.manual-empty { font-size: 13px; color: var(--text-3); padding: 20px 0; text-align: center; }

/* R:R weak warning */
.manual-resolved .mr-rr-weak .mr-val { color: var(--red); }
.manual-resolved .mr-warn { font-size: 11px; color: var(--red); margin-top: 4px; }

/* TP preset buttons */
.manual-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.manual-preset {
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text-2);
  cursor: pointer;
  transition: all .12s;
}
.manual-preset:hover { border-color: var(--green); color: var(--green); }

/* Current-price divider in the merged levels list (mirrors Liquidity page) */
.ml-price-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-tint);
  border-radius: 6px;
  letter-spacing: .02em;
}

/* Above-price rows lean green, below-price lean red (price text tint).
   Hot target rows keep their own highlight — exclude them here. */
.ml-row.ml-above:not(.ml-hot) .ml-label { color: var(--green); }
.ml-row.ml-below:not(.ml-hot) .ml-label { color: var(--red); }

/* Liquidity row: distance tag + notional heatbar */
.ml-row .ml-above { color: var(--green); }
.ml-row .ml-below { color: var(--red); }
.ml-row.ml-liq .ml-val { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.ml-bar {
  display: inline-block;
  height: 4px;
  min-width: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-tint), var(--accent));
}

/* Open-positions dir + pnl colors */
.dir-long  { color: var(--green); font-weight: 600; }
.dir-short { color: var(--red);   font-weight: 600; }
.pos-up   { color: var(--green); }
.pos-down { color: var(--red); }
