/* ═══════════════════════════════════════════════════════════════
   Antigravity Predictor — Design System
   ═══════════════════════════════════════════════════════════════ */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Palette — Dark */
  --bg-app:        #0b0d10;
  --bg-panel:      rgba(16, 20, 26, 0.85);
  --bg-card:       rgba(24, 29, 38, 0.6);
  --bg-toolbar:    #0e1118;
  --bg-tool-hover: rgba(255,255,255,0.06);
  --bg-tool-active:rgba(0,229,255,0.12);

  --border-color:  rgba(255,255,255,0.06);
  --border-glow:   rgba(0,229,255,0.18);
  --border-tool:   rgba(0,229,255,0.35);

  --color-green:   #00e676;
  --color-red:     #ff3d00;
  --color-gold:    #ffc400;
  --color-blue:    #00e5ff;
  --color-orange:  #ff9100;
  --color-purple:  #b388ff;
  --color-text-main:  #eef0f3;
  --color-text-muted: #7a8494;

  --toolbar-w: 46px;
  --header-h:  56px;
  --radius:    6px;
}

/* Light mode */
body.light-mode {
  --bg-app:        #f0f2f7;
  --bg-panel:      rgba(255,255,255,0.9);
  --bg-card:       rgba(232,236,244,0.9);
  --bg-toolbar:    #e4e7ee;
  --bg-tool-hover: rgba(0,0,0,0.05);
  --bg-tool-active:rgba(0,184,212,0.12);
  --border-color:  rgba(0,0,0,0.08);
  --border-glow:   rgba(0,184,212,0.2);
  --border-tool:   rgba(0,184,212,0.4);
  --color-green:   #00a650;
  --color-red:     #e0311a;
  --color-gold:    #c97e00;
  --color-blue:    #008faa;
  --color-orange:  #d46400;
  --color-text-main:  #1a1e27;
  --color-text-muted: #606878;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-app);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Header ────────────────────────────────────────────────── */
.main-header {
  height: var(--header-h);
  background: rgba(11,13,16,0.97);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 20;
  gap: 12px;
  flex-shrink: 0;
}
body.light-mode .main-header { background: rgba(228,231,238,0.98); }

.header-left  { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.logo-icon {
  font-size: 1.35rem;
  color: var(--color-blue);
  text-shadow: 0 0 12px rgba(0,229,255,0.5);
  flex-shrink: 0;
}

.main-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.logo-sub { color: var(--color-blue); font-weight: 400; }

.divider {
  width: 1px;
  height: 22px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* Asset Selector Pills */
.asset-selector {
  display: flex;
  gap: 4px;
}

.asset-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.18s ease;
}
.asset-btn:hover {
  background: var(--bg-tool-hover);
  color: var(--color-text-main);
  border-color: rgba(255,255,255,0.15);
}
.asset-btn.active {
  background: var(--bg-tool-active);
  border-color: var(--border-tool);
  color: var(--color-blue);
  box-shadow: 0 0 10px rgba(0,229,255,0.1);
}
.asset-btn.active .asset-icon.btc { color: #f7931a; }
.asset-btn.active .asset-icon.eth { color: #627eea; }
.asset-btn.active .asset-icon.sol { color: #9945ff; }
.asset-btn.active .asset-icon.xau { color: var(--color-gold); }

.asset-btn-demo {
  border-color: rgba(255, 196, 0, 0.22);
}

.asset-icon {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--color-text-muted);
  transition: color 0.18s;
}

.market-source-label {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f141c;
  background: var(--color-gold);
}

.timeframe-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-card);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--color-blue);
  white-space: nowrap;
}

.ticker-group { display: flex; align-items: baseline; gap: 7px; }

.ticker-price {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  transition: color 0.15s;
}
.ticker-price.up   { color: var(--color-green); }
.ticker-price.down { color: var(--color-red); }

.ticker-change {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--color-text-muted);
}
.ticker-change.up   { color: var(--color-green); }
.ticker-change.down { color: var(--color-red); }

/* Theme Toggle */
.theme-toggle-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 18px;
  color: var(--color-text-main);
  transition: all 0.2s;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--color-blue); }

/* Connection Status */
.connection-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: rgba(255,255,255,0.03);
  padding: 5px 11px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}
.status-indicator-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 0 7px var(--color-red);
}
.connection-status.active .status-indicator-dot {
  background: var(--color-green);
  box-shadow: 0 0 7px var(--color-green);
  animation: pulse-dot 2s ease infinite;
}
.connection-status.active { color: var(--color-text-main); border-color: rgba(0,230,118,0.2); }

@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Workspace (toolbar + content) ────────────────────────── */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── LEFT TOOLBAR ──────────────────────────────────────────── */
.toolbar-left {
  width: var(--toolbar-w);
  background: var(--bg-toolbar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
  z-index: 15;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0 5px;
}

.toolbar-sep {
  width: 28px;
  height: 1px;
  background: var(--border-color);
  margin: 5px 0;
  flex-shrink: 0;
}

.tool-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.tool-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.tool-btn:hover {
  background: var(--bg-tool-hover);
  color: var(--color-text-main);
  border-color: var(--border-color);
}

.tool-btn.active {
  background: var(--bg-tool-active);
  border-color: var(--border-tool);
  color: var(--color-blue);
  box-shadow: 0 0 8px rgba(0,229,255,0.12);
}

.tool-btn.danger:hover {
  background: rgba(255,61,0,0.12);
  border-color: rgba(255,61,0,0.35);
  color: var(--color-red);
}

/* Tooltip via title — enhanced with pseudo for larger targets */
.tool-btn::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(14,17,24,0.95);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s 0.5s;
  z-index: 100;
}
.tool-btn:hover::after { opacity: 1; }
body.light-mode .tool-btn::after { background: rgba(240,242,247,0.98); }

/* ── Dashboard Grid ────────────────────────────────────────── */
.dashboard-grid {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.grid-left-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  min-width: 0;
}

.grid-right-pane {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: rgba(11,13,16,0.4);
}

/* ── Panels ────────────────────────────────────────────────── */
.panel {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-color);
}
.panel:last-child { border-bottom: none; }
.chart-panel { flex: 1; min-height: 0; }

/* ── Split chart row (main + secondary reference chart) ─────── */
.charts-split-row {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
}
.charts-split-row .chart-panel {
  flex: 1;
  min-width: 0;
  border-bottom: none;
}
.charts-split-row .chart-panel:first-child {
  border-right: 1px solid var(--border-color);
}
/* Secondary chart toggle: when .split-off is on the row, hide the secondary
   pane. The primary pane's flex:1 auto-expands to fill; its ResizeObserver
   (initChart in app.js) picks up the width change and calls chart.resize().
   Also drop the vertical border since there's no second panel to divide. */
.charts-split-row.split-off .chart-panel-secondary { display: none; }
.charts-split-row.split-off .chart-panel:first-child { border-right: none; }

.chart-panel-secondary .panel-header { flex-wrap: wrap; gap: 8px; }
.asset-selector-compact { gap: 4px; }
.asset-selector-compact .asset-btn { padding: 4px 8px; font-size: 0.7rem; }

.panel-header {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.asset-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tool-active);
  border: 1px solid var(--border-tool);
  color: var(--color-blue);
}

.chart-legend {
  display: flex; gap: 12px; align-items: center;
  font-size: 0.78rem; color: var(--color-text-muted);
}
.advisory-bubble {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  transition: color 0.15s ease;
}
.advisory-bubble.signal-active { color: var(--color-green); }
.advisory-bubble.signal-sell   { color: var(--color-red); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-dot.green  { background: var(--color-green); }
.legend-dot.orange { background: var(--color-orange); }
.legend-dot.red    { background: var(--color-red); }

.drawing-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-blue);
  opacity: 0;
  transition: opacity 0.2s;
}
.drawing-hint.visible { opacity: 1; }

.panel-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.chart-container-wrapper {
  position: absolute; inset: 0;
}

/* Drawing Canvas overlay */
.drawing-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 5;
}
.drawing-canvas.active { pointer-events: all; cursor: crosshair; }

/* Scrollable */
.scrollable { overflow-y: auto; flex: 1; }

/* ── Agent Report ──────────────────────────────────────────── */
.agent-report-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px;
  background: var(--bg-panel);
  margin: 0 12px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.agent-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-report-mode {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.agent-report-status {
  font-size: 0.72rem;
  color: var(--color-gold);
  border: 1px solid rgba(255, 196, 0, 0.18);
  background: rgba(255, 196, 0, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
}

.agent-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.agent-report-note {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.stat-label { font-size: 0.7rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 0.9rem; font-weight: 600; }
.stat-value.up   { color: var(--color-green); }
.stat-value.down { color: var(--color-red); }
.text-gold  { color: var(--color-gold); }
.text-muted { color: var(--color-text-muted); }

/* ── Stats & Metrics ───────────────────────────────────────── */
.stats-panel .panel-body { padding: 0 12px 12px; }

.metrics-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color 0.2s;
}
.metric-card:hover { border-color: var(--border-glow); }

.metric-label {
  font-size: 0.62rem; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.metric-value {
  font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600;
}
.metric-value.positive { color: var(--color-green); }
.metric-value.negative { color: var(--color-red); }

/* ── Trade Log ─────────────────────────────────────────────── */
/* Bounded height + internal scroll: this panel sits last in
   .grid-right-pane, which has no fixed height of its own (it just grows
   and lets the whole sidebar scroll) -- without a max-height here, the
   trade history table had nothing to clamp against, so its .scrollable
   body (overflow-y:auto) never actually had to scroll; it just grew
   forever and pushed the panel below the fold instead. Fixed 2026-07-23. */
.logs-panel { flex: 1; min-height: 200px; max-height: 340px; display: flex; flex-direction: column; }
.logs-panel .panel-body { padding: 0 12px 12px; min-height: 0; }
/* Explicit inner scroll: the parent .grid-right-pane already overflows and
   .logs-panel is capped at 340px, but the .panel-body's flex:1 inside a
   flex-column parent was collapsing to content height in some layouts, so
   the 50-row trade table never got clipped and never scrolled internally.
   Force the body to a bounded height so overflow-y: auto (from .scrollable)
   actually engages — matches the sidebar-scroll pattern noted in §7.14. */
.logs-panel .panel-body.scrollable { max-height: 290px; overflow-y: auto; }

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.78rem; text-align: left;
}
.data-table th {
  color: var(--color-text-muted); font-weight: 500;
  padding: 8px 8px; border-bottom: 1px solid var(--border-color);
  font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.5px;
  position: sticky; top: 0; background: var(--bg-app); z-index: 1;
}
.data-table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.012); }
.data-table td.pnl-cell { font-family: var(--font-mono); font-weight: 600; }
.data-table td.pnl-cell.up   { color: var(--color-green); }
.data-table td.pnl-cell.down { color: var(--color-red); }
.data-table td.time-cell { font-family: var(--font-mono); color: var(--color-text-muted); font-size: 0.72rem; }

.empty-state { color: var(--color-text-muted); font-style: italic; padding: 36px 0 !important; }
.text-center { text-align: center; }

/* ── Scrollbars ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Sidebar (right pane) gets a wider, more visible scrollbar because it
   holds the whole set of panels (watchlist → agent report → trade log →
   scorecard when added) and typically overflows below the fold on
   anything under a very tall screen. A 5px near-invisible thumb was
   enough of a discoverability problem that a client demo missed the
   Trade Estimations section entirely (§7.14). Overrides the site-wide
   thin scrollbar rule above only for .grid-right-pane. */
.grid-right-pane::-webkit-scrollbar { width: 10px; }
.grid-right-pane::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); }
.grid-right-pane::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }
/* Firefox equivalent (Firefox ignores the ::-webkit- pseudo-elements). */
.grid-right-pane { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.22) transparent; }

/* Scroll-shadow cue: a subtle gradient masked into the bottom edge of
   the sidebar when there's content below the fold. Default
   background-attachment (scroll) keeps the gradient anchored to the
   pane's viewport rather than its content, so it stays at the bottom
   edge regardless of scroll position — reads as a natural border when
   scrolled to the very bottom, no JS to hide it. */
.grid-right-pane {
  background-image: linear-gradient(to bottom, transparent 0, transparent calc(100% - 24px),
                                    rgba(11,13,16,0.85) 100%);
  background-repeat: no-repeat;
}
body.light-mode .grid-right-pane {
  background-image: linear-gradient(to bottom, transparent 0, transparent calc(100% - 24px),
                                    rgba(228,231,238,0.9) 100%);
}

/* ── Right Column (panel + icon rail) ──────────────────────── */
.right-column {
  display: flex;
  flex-direction: row;
  height: 100%;
  flex-shrink: 0;
  border-left: 1px solid var(--border-color);
}

/* shrink the existing right pane to fill remaining space */
.right-column .grid-right-pane {
  width: 400px;
  flex-shrink: 0;
  border-left: none;   /* border is on .right-column now */
}

/* ── RIGHT TOOLBAR RAIL ─────────────────────────────────────── */
.toolbar-right {
  width: var(--toolbar-w);
  flex-shrink: 0;
  background: var(--bg-toolbar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
  overflow: hidden;
}

/* push last group to the bottom */
.rtool-bottom {
  margin-top: auto;
}

.rtool-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.rtool-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.rtool-btn:hover {
  background: var(--bg-tool-hover);
  color: var(--color-text-main);
  border-color: var(--border-color);
}

.rtool-btn.active {
  background: var(--bg-tool-active);
  border-color: var(--border-tool);
  color: var(--color-blue);
  box-shadow: 0 0 8px rgba(0,229,255,0.12);
}

/* Tooltip — opens to the LEFT (opposite of left toolbar) */
.rtool-btn::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(14,17,24,0.95);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s 0.5s;
  z-index: 100;
}
.rtool-btn:hover::after { opacity: 1; }
body.light-mode .rtool-btn::after { background: rgba(240,242,247,0.98); }

/* Disabled / future button */
.rtool-dim { opacity: 0.3; cursor: not-allowed; }
.rtool-dim:hover { background: transparent !important; border-color: transparent !important; color: var(--color-text-muted) !important; }
.rtool-dim::after { display: none; }

/* ── MODAL OVERLAY ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.18s ease;
}
.modal-overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-main);
  letter-spacing: 0.02em;
}
.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--color-text-main); background: var(--bg-tool-hover); }

.modal-body { padding: 14px 18px 18px; }

.shortcut-section { margin-bottom: 14px; }
.shortcut-section:last-child { margin-bottom: 0; }
.shortcut-section h4 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  align-items: center;
}
.shortcut-grid kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-main);
}
.shortcut-grid span {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ── DATA WINDOW ────────────────────────────────────────────── */
.data-window {
  position: fixed;
  top: 56px;
  right: calc(var(--toolbar-w) + 8px);
  background: rgba(14,17,24,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  min-width: 120px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.data-window[hidden] { display: none; }
.dw-row { display: flex; justify-content: space-between; gap: 16px; line-height: 1.7; }
.dw-lbl { color: var(--color-text-muted); font-weight: 600; }
.dw-val { color: var(--color-text-main); }

/* ── Widget Panel Layout ────────────────────────────────────── */
.widget-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}
.widget-panel[hidden] {
  display: none !important;
}

/* ── Watchlist Table ────────────────────────────────────────── */
.watchlist-table tr:hover {
  background: rgba(255,255,255,0.03) !important;
}
.watchlist-row.active {
  background: rgba(0, 229, 255, 0.04) !important;
  border-left: 2px solid var(--color-blue);
}

/* ── Alerts & Logs list ──────────────────────────────────────── */
.alerts-list, .news-list, .calendar-list, .notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert-item, .news-item, .calendar-item, .notification-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  transition: border-color 0.2s;
}
.alert-item:hover, .news-item:hover, .calendar-item:hover, .notification-item:hover {
  border-color: var(--border-glow);
}
.alert-item .alert-time, .news-item .news-time, .calendar-item .event-time, .notification-item .notif-time {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.alert-item.buy { border-left: 3px solid var(--color-green); }
.alert-item.sell { border-left: 3px solid var(--color-red); }

/* ── DOM Depth of Market ────────────────────────────────────── */
.dom-level-row {
  display: flex;
  align-items: center;
  position: relative;
  height: 20px;
  line-height: 20px;
  font-family: var(--font-mono);
}
.dom-size {
  width: 35%;
  text-align: left;
  z-index: 2;
  padding-left: 4px;
}
.dom-price {
  width: 30%;
  text-align: right;
  z-index: 2;
  font-weight: 500;
}
.dom-depth-pct {
  width: 35%;
  text-align: right;
  z-index: 2;
  padding-right: 4px;
  color: var(--color-text-muted);
}
.dom-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.12;
  transition: width 0.2s ease;
}
.dom-bar.ask { background: var(--color-red); }
.dom-bar.bid { background: var(--color-green); }

/* ── Live Signal Chat ───────────────────────────────────────── */
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.01);
}
.chat-msg.system {
  border-left: 2px solid var(--color-blue);
  background: rgba(0, 229, 255, 0.02);
}
.chat-msg.user {
  border-left: 2px solid var(--color-text-muted);
}
.chat-msg.advisory {
  border-left: 2px solid var(--color-gold);
  background: rgba(255, 196, 0, 0.04);
}
.chat-msg .msg-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--color-text-muted);
}
.chat-msg .msg-sender { font-weight: 600; }
.chat-msg .msg-sender.system { color: var(--color-blue); }
.chat-msg .msg-sender.trader { color: var(--color-gold); }

/* ── Object Tree Draw ───────────────────────────────────────── */
.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 0.75rem;
}
.tree-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tree-item-name {
  font-family: var(--font-sans);
}
.tree-item-btns {
  display: flex;
  gap: 6px;
}
.tree-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: all 0.15s;
}
.tree-btn:hover {
  background: var(--bg-tool-hover);
  color: var(--color-text-main);
}
.tree-btn.active {
  color: var(--color-blue);
}
.tree-btn.danger-btn:hover {
  color: var(--color-red);
  background: rgba(255,61,0,0.1);
}

/* Utilities */
.text-right { text-align: right; }
.text-green { color: var(--color-green) !important; }
.text-red { color: var(--color-red) !important; }
.text-gold { color: var(--color-gold) !important; }

@media (max-width: 1100px) {
  .market-source-label {
    display: none;
  }

  .agent-report-grid {
    grid-template-columns: 1fr;
  }

}

/* ── LEFT TOOLBAR FLYOUT MENUS ──────────────────────────────── */
.tool-category-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sub-arrow {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 0 4px;
  border-color: transparent transparent transparent var(--color-text-muted);
  transform: rotate(45deg);
  opacity: 0.5;
  transition: border-color 0.15s, opacity 0.15s;
}
.tool-btn:hover .sub-arrow, .tool-btn.active .sub-arrow {
  border-color: transparent transparent transparent var(--color-blue);
  opacity: 1;
}

.flyout-menu {
  display: none;
  position: absolute;
  left: calc(var(--toolbar-w) + 1px);
  top: -4px;
  flex-direction: column;
  min-width: 200px;
  background: rgba(18, 22, 33, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 1000;
  animation: fadeInFlyout 0.15s ease-out;
}

@keyframes fadeInFlyout {
  from { opacity: 0; transform: translateX(5px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Open flyout on category wrapper hover */
.tool-category-wrapper:hover .flyout-menu {
  display: flex;
}

.flyout-header {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  padding: 4px 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.8;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  margin-bottom: 4px;
}

.flyout-item {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 10px;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  transition: all 0.15s ease;
}

.flyout-item svg {
  width: 16px;
  height: 16px;
  color: inherit;
  flex-shrink: 0;
}

.flyout-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-main);
}

.flyout-item.active {
  color: var(--color-blue) !important;
  background: rgba(0, 229, 255, 0.03);
}

.flyout-item kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1px 4px;
  border-radius: 3px;
  opacity: 0.7;
}

/* Danger sub-items */
.flyout-item.text-red {
  color: rgba(255, 61, 0, 0.85);
}
.flyout-item.text-red:hover {
  background: rgba(255, 61, 0, 0.08);
  color: var(--color-red) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Agent Report — Signal + Probability + Enriched Context
   ═══════════════════════════════════════════════════════════════ */

/* Signal + confidence header row */
.agent-signal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.agent-signal-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  min-width: 72px;
  text-align: center;
  transition: background 0.3s, color 0.3s;
}
.agent-signal-badge.neutral  { background: rgba(122,132,148,0.15); color: var(--color-text-muted); border: 1px solid rgba(122,132,148,0.25); }
.agent-signal-badge.buy      { background: rgba(0,230,118,0.15);   color: var(--color-green);      border: 1px solid rgba(0,230,118,0.35); box-shadow: 0 0 8px rgba(0,230,118,0.2); }
.agent-signal-badge.sell     { background: rgba(255,145,0,0.15);   color: var(--color-orange);     border: 1px solid rgba(255,145,0,0.35); box-shadow: 0 0 8px rgba(255,145,0,0.2); }
.agent-signal-badge.exit     { background: rgba(255,61,0,0.15);    color: var(--color-red);        border: 1px solid rgba(255,61,0,0.35); }

.agent-confidence-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.05);
  color: var(--color-text-muted);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}
.agent-confidence-badge.high   { background: rgba(0,230,118,0.1);  color: var(--color-green);  border-color: rgba(0,230,118,0.25); }
.agent-confidence-badge.medium { background: rgba(255,196,0,0.1);  color: var(--color-gold);   border-color: rgba(255,196,0,0.25); }
.agent-confidence-badge.low    { background: rgba(122,132,148,0.1);color: var(--color-text-muted); }

/* Probability bars */
.prob-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.prob-bar-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
}
.prob-label {
  color: var(--color-text-muted);
  width: 32px;
  flex-shrink: 0;
  font-size: 0.68rem;
}
.prob-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.prob-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.prob-fill.long-fill  { background: linear-gradient(90deg, rgba(0,230,118,0.6), var(--color-green)); }
.prob-fill.short-fill { background: linear-gradient(90deg, rgba(255,145,0,0.6), var(--color-orange)); }
.prob-pct {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-text-muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Enriched context section */
.enriched-context {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.enriched-section { display: flex; flex-direction: column; gap: 2px; }
.enriched-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.enriched-text {
  font-size: 0.72rem;
  color: var(--color-text-main);
  line-height: 1.45;
  margin: 0;
  opacity: 0.85;
}
.enriched-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}
.enriched-timestamp {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════
   Hermes Chat — Floating Action Button + Chat Panel
   ═══════════════════════════════════════════════════════════════ */

/* FAB — small pill button, bottom-right */
.hermes-fab {
  position: fixed;
  bottom: 20px;
  right: 22px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px 0 10px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--border-tool);
  background: var(--bg-tool-active);
  color: var(--color-blue);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,229,255,0.18);
  transition: all 0.2s ease;
}
.hermes-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.hermes-fab:hover {
  background: rgba(0,229,255,0.22);
  box-shadow: 0 6px 24px rgba(0,229,255,0.3);
  transform: translateY(-1px);
}
.hermes-fab.open {
  background: rgba(0,229,255,0.22);
  border-color: var(--color-blue);
}
.hermes-fab-label {
  line-height: 1;
}

/* Chat panel */
.hermes-chat-panel {
  position: fixed;
  bottom: 70px;
  right: 22px;
  width: min(520px, calc(100vw - 44px));
  height: min(680px, calc(100vh - 112px));
  max-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-tool);
  border-radius: 14px;
  z-index: 41;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,229,255,0.05);
  overflow: hidden;
  animation: hermesPanelIn 0.22s cubic-bezier(0.34,1.4,0.64,1);
}
.hermes-chat-panel[hidden] { display: none !important; }
.hermes-chat-panel.full {
  top: 20px;
  right: 22px;
  bottom: 20px;
  width: min(760px, calc(100vw - 44px));
  height: auto;
  max-height: none;
}

@keyframes hermesPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* Header */
.hermes-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: rgba(0,229,255,0.04);
}
.hermes-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hermes-chat-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hermes-chat-icon {
  font-size: 1.1rem;
  color: var(--color-blue);
  text-shadow: 0 0 10px rgba(0,229,255,0.5);
}
.hermes-chat-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.02em;
}
.hermes-chat-subtitle {
  font-size: 0.62rem;
  color: var(--color-blue);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.hermes-chat-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 4px;
  transition: all 0.15s;
}
.hermes-chat-close:hover {
  color: var(--color-text-main);
  background: var(--bg-tool-hover);
}
.hermes-chat-lang {
  min-width: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(0,229,255,0.22);
  border-radius: 999px;
  background: rgba(0,229,255,0.05);
  color: var(--color-blue);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
}
.hermes-chat-lang:hover {
  background: rgba(0,229,255,0.12);
}

/* Live signal context inside Hermes chat */
.hermes-signal-context {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255,255,255,0.018);
}
.hermes-signal-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hermes-signal-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid rgba(122,132,148,0.28);
  color: var(--color-text-muted);
  background: rgba(122,132,148,0.14);
}
.hermes-signal-badge.buy { color: var(--color-green); border-color: rgba(0,230,118,0.34); background: rgba(0,230,118,0.12); }
.hermes-signal-badge.sell { color: var(--color-orange); border-color: rgba(255,145,0,0.34); background: rgba(255,145,0,0.12); }
.hermes-signal-badge.exit { color: var(--color-red); border-color: rgba(255,61,0,0.34); background: rgba(255,61,0,0.12); }
.hermes-signal-mode {
  color: var(--color-gold);
  font-size: 0.66rem;
  font-weight: 700;
}
.hermes-signal-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hermes-signal-bar-row {
  display: grid;
  grid-template-columns: 42px 1fr 52px;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--color-text-muted);
}
.hermes-signal-bar-row b {
  text-align: right;
  color: var(--color-text-main);
  font-weight: 600;
}
.hermes-signal-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.hermes-signal-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--color-green);
}
.hermes-signal-track.short i { background: var(--color-orange); }
.hermes-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.hermes-signal-grid div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--bg-card);
}
.hermes-signal-grid span {
  display: block;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hermes-signal-grid b {
  display: block;
  margin-top: 3px;
  color: var(--color-text-main);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hermes-proposals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hermes-proposals button {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(0,229,255,0.04);
  color: var(--color-blue);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}
.hermes-proposals button:hover {
  border-color: var(--border-tool);
  background: rgba(0,229,255,0.12);
}

/* Message list */
.hermes-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hermes-chat-messages::-webkit-scrollbar { width: 4px; }
.hermes-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* Individual messages */
.hermes-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.775rem;
  line-height: 1.5;
  max-width: 88%;
}
.hermes-msg p { margin: 0; }
.hermes-msg-sender {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* System / Hermes reply */
.hermes-msg--system {
  align-self: flex-start;
}
.hermes-msg--system .hermes-msg-sender {
  color: var(--color-blue);
}
.hermes-msg--system p {
  background: rgba(0,229,255,0.05);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: 4px 12px 12px 12px;
  padding: 8px 10px;
  color: var(--color-text-main);
}

/* User messages */
.hermes-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}
.hermes-msg--user .hermes-msg-sender {
  color: var(--color-gold);
}
.hermes-msg--user p {
  background: rgba(255,196,0,0.08);
  border: 1px solid rgba(255,196,0,0.15);
  border-radius: 12px 4px 12px 12px;
  padding: 8px 10px;
  color: var(--color-text-main);
}

/* Typing indicator */
.hermes-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  flex-shrink: 0;
}
.hermes-chat-typing[hidden] { display: none; }
.hermes-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-blue);
  opacity: 0.5;
  animation: hermesTypeDot 1.2s ease-in-out infinite;
}
.hermes-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.hermes-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes hermesTypeDot {
  0%,80%,100% { transform: scale(0.7); opacity: 0.4; }
  40%         { transform: scale(1.1); opacity: 1; }
}

/* Footer / input bar */
.hermes-chat-footer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-toolbar);
  flex-shrink: 0;
}
.hermes-chat-input {
  flex: 1;
  min-height: 42px;
  max-height: 132px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 13px;
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-size: 0.775rem;
  line-height: 1.45;
  outline: none;
  resize: none;
  overflow-y: auto;
  transition: border-color 0.15s;
}
.hermes-chat-input:focus {
  border-color: var(--border-glow);
}
.hermes-chat-input::placeholder { color: var(--color-text-muted); }

.hermes-chat-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-tool);
  background: var(--bg-tool-active);
  color: var(--color-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.hermes-chat-send svg { width: 14px; height: 14px; }
.hermes-chat-send:hover {
  background: rgba(0,229,255,0.22);
  box-shadow: 0 2px 8px rgba(0,229,255,0.3);
}

/* Light mode adjustments */
body.light-mode .hermes-chat-panel {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
body.light-mode .hermes-msg--system p {
  background: rgba(0,184,212,0.06);
}
body.light-mode .hermes-msg--user p {
  background: rgba(201,126,0,0.07);
}

@media (max-width: 1100px) {
  .hermes-chat-panel {
    width: calc(100vw - 44px);
    height: min(680px, calc(100vh - 112px));
    right: 12px;
  }
  .hermes-chat-panel.full {
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
  .hermes-fab {
    right: 12px;
  }
  .hermes-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.timeframe-selector {
  display: flex;
  gap: 4px;
  align-items: center;
}
.timeframe-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--color-text-muted);
  border-radius: 6px;
  padding: 4px 7px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
}
.timeframe-btn:hover {
  color: var(--color-text-main);
  border-color: rgba(255,255,255,0.18);
}
.timeframe-btn.active {
  background: var(--bg-tool-active);
  color: var(--color-cyan);
  border-color: var(--border-tool);
}
.history-depth-control {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}
.history-depth-control select {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--color-text-main);
  border-radius: 6px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
}
