:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-hover: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --accent-cyan: #00f0ff;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Outfit', sans-serif;

  --header-height: var(--inalive-gh-offset, 56px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* ==========================================================================
   Global & Neon Slim Scrollbar System (Antigravity Sleek Design)
   ========================================================================== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 240, 255, 0.06) 0%, transparent 45%);
}

/* ==========================================================================
   Header & Top Navigation (Portal Hub Common Header)
   ========================================================================== */
.trade-header {
  height: var(--header-height);
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

/* Portal Brand & Switcher */
.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.portal-brand-logo-img {
  height: 28px;
  width: auto;
}

.portal-badge-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}

.brand-separator {
  color: var(--text-dim);
  font-size: 14px;
}

/* App Switcher (1-Button Launcher) */
.app-switcher-wrapper {
  position: relative;
}

.btn-app-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 5px 12px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-app-switcher:hover, .btn-app-switcher.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.app-status-pill {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  padding: 1px 6px;
}

.switcher-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.btn-app-switcher.active .switcher-arrow {
  transform: rotate(180deg);
}

.app-launcher-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 340px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(24px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.app-launcher-dropdown.active {
  display: flex;
}

.launcher-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.launcher-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.launcher-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.launcher-badge {
  font-size: 10px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  padding: 2px 6px;
}

.launcher-grid {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launcher-app-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.launcher-app-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.launcher-app-item.active {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
}

.launcher-app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.launcher-app-info {
  flex: 1;
}

.launcher-app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.launcher-app-name {
  font-size: 13px;
  font-weight: 700;
}

.launcher-app-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
}

.launcher-app-tag.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.launcher-app-tag.coming-soon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.launcher-app-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.launcher-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
  color: var(--text-dim);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.select-model {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
}

.select-model:focus {
  border-color: var(--accent-cyan);
}

.metrics-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.portal-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-gradient {
  background: linear-gradient(135deg, #00f0ff 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tag-version {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(0, 240, 255, 0.15) 100%);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

/* Header HUD & User */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bridge-status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(13, 17, 23, 0.95);
  padding: 5px 14px 5px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bridge-status-badge:hover {
  background: rgba(22, 27, 34, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.bridge-status-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}

#bridgeStatusText {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

.bridge-sub-mode-text {
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.bridge-sub-mode-text.live {
  color: #34d399;
}

.bridge-sub-mode-text.demo {
  color: #38bdf8;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-online 2s infinite;
}

.status-dot.simulated {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

@keyframes pulse-online {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.account-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 12px;
}

.hud-item {
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hud-value {
  font-weight: 700;
  color: var(--text-main);
}

.hud-value.profit-pos {
  color: var(--accent-emerald);
}

.hud-value.profit-neg {
  color: var(--accent-rose);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Content Views
   ========================================================================== */
.view-container {
  display: none;
  padding: 20px 24px;
  min-height: calc(100vh - var(--header-height));
}

.view-container.active {
  display: block;
}

/* Dashboard View Workbench Container Fit */
#viewDashboard.view-container {
  padding: 0;
  height: calc(100vh - var(--header-height) - var(--kpi-strip-height, 62px));
  min-height: 0;
  overflow: hidden;
}

#viewDashboard.view-container.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Agent Dashboard Layout (agentProp UI/UX)
   ========================================================================== */
.agent-dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr 380px;
  gap: 20px;
  height: calc(100vh - var(--header-height) - 40px);
}

@media (max-width: 1400px) {
  .agent-dashboard-grid {
    grid-template-columns: 300px 1fr;
    height: auto;
  }
  .agent-dashboard-grid > .positions-panel {
    grid-column: span 2;
  }
}

@media (max-width: 1024px) {
  .agent-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .agent-dashboard-grid > .positions-panel {
    grid-column: span 1;
  }
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.panel-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.panel-body {
  padding: 18px;
  flex: 1;
  overflow-y: auto;
}

/* Manual Trade & Control Panel */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.symbol-selector {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.symbol-selector:focus {
  border-color: var(--accent-cyan);
}

.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-buy, .btn-sell {
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s, filter 0.2s;
}

.btn-buy:active, .btn-sell:active {
  transform: scale(0.98);
}

.btn-buy {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-sell {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
}

.order-price-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}

.lot-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lot-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
}

.lot-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.lot-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* AI Market Coach Box */
.ai-coach-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}

.ai-coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ai-coach-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-coach-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Chart Center Area */
.chart-center-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 160px);
  flex-shrink: 0;
  box-sizing: border-box;
}

.chart-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.tf-selector {
  display: flex;
  gap: 4px;
}

.tf-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
}

.tf-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tf-btn.active {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.4);
}

.canvas-container {
  flex: 1 1 auto;
  position: relative;
  min-height: calc(100vh - 350px);
  height: calc(100vh - 350px);
  background: #080c14;
}

#marketChartCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ADR Daily Range Progress */
.adr-container {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}

.adr-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.adr-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.adr-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 70%, #f43f5e 100%);
  width: 58%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Positions Table */
.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
}

.positions-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  text-transform: uppercase;
}

.positions-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pos-type-buy {
  color: var(--accent-emerald);
  font-weight: 700;
}

.pos-type-sell {
  color: var(--accent-rose);
  font-weight: 700;
}

.btn-close-pos {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-pos:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-close-all {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid var(--accent-rose);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--accent-cyan); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   MT5 Bridge Connection Modal / Pop-up Dialog
   ========================================================================== */
.bridge-status-badge {
  cursor: pointer;
  transition: all 0.2s ease;
}

.bridge-status-badge:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: rgba(13, 18, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.1);
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-status-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-lead-msg {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
}

/* Steps Timeline */
.setup-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setup-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.step-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.step-code-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  margin-top: 4px;
}

/* Action Buttons inside Modal */
.modal-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.btn-modal-action {
  padding: 12px 16px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-modal-download {
  background: linear-gradient(135deg, #00f0ff 0%, #3b82f6 100%);
  color: #04070d;
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3);
}

.btn-modal-download:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-modal-retry {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-modal-retry:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-modal-sim {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.btn-modal-sim:hover {
  color: var(--text-main);
}

/* ==========================================================================
   AgentProp Top KPI Summary Strip
   ========================================================================== */
.kpi-summary-strip {
  background: rgba(8, 12, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 50;
}

.kpi-meta-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-badge-icon {
  font-size: 16px;
}

.kpi-title-main {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #67e8f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.kpi-badge-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 9999px;
}

.kpi-badge-pill.live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.news-guard-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.news-guard-badge.blackout {
  background: rgba(244, 63, 94, 0.2);
  color: #fca5a5;
  border-color: rgba(244, 63, 94, 0.5);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.reverse-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(217, 70, 239, 0.18);
  color: #f0abfc;
  border: 1px solid rgba(217, 70, 239, 0.45);
  padding: 2px 8px;
  border-radius: 9999px;
  animation: pulse-online 2s infinite;
}

.kpi-sub-desc {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* KPI Meters Grid */
.kpi-meters-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi-meter-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.kpi-meter-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.98);
}

.kpi-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-box.bg-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.kpi-icon-box.bg-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.kpi-icon-box.bg-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.kpi-icon-box.bg-cyan {
  background: rgba(0, 240, 255, 0.12);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.kpi-icon-box.bg-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.kpi-svg {
  width: 16px;
  height: 16px;
}

.kpi-meter-content {
  display: flex;
  flex-direction: column;
}

.kpi-meter-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.kpi-meter-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.kpi-meter-sub {
  font-size: 10px;
  opacity: 0.8;
  font-weight: normal;
  margin-left: 2px;
}

.text-amber { color: #f59e0b !important; }
.text-cyan { color: #00f0ff !important; }
.text-blue { color: #3b82f6 !important; }
.text-emerald { color: #10b981 !important; }
.text-rose { color: #f43f5e !important; }
.text-purple { color: #c084fc !important; }

/* KPI Actions */
.kpi-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-kpi-coach {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.5) 0%, rgba(30, 58, 138, 0.5) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #67e8f9;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.btn-kpi-coach:hover {
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}

.btn-kpi-reset {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-kpi-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
}

.icon-sm {
  width: 12px;
  height: 12px;
}

.btn-kpi-kill {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  border: 1px solid #f43f5e;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.35);
}

.btn-kpi-kill:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.55);
}

.btn-kpi-kill.active {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fca5a5;
  animation: pulse-border 1.5s infinite;
}

.kill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* ==========================================================================
   Left Column: AgentProp Controls
   ========================================================================== */
.agentprop-left-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--header-height) - 86px);
}

.left-panel-tabbar {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
  padding: 4px;
  gap: 4px;
}

.left-subtab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.left-subtab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.left-subtab-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.left-panel-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.left-subpanel-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.ctrl-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ctrl-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.grid-2-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.toggle-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.toggle-btn.active-real {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}

.toggle-btn.active-demo {
  background: #0891b2;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(8, 145, 178, 0.4);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

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

.sym-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 4px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sym-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.sym-btn.active {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.grid-4-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.grid-5-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

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

.preset-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 2px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.preset-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.preset-btn.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  color: #ffffff;
}

.ai-model-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
  font-family: var(--font-mono);
}

.ai-model-pill:hover {
  border-color: #c084fc;
  background: rgba(139, 92, 246, 0.15);
}

.live-dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.sub-arrow {
  color: var(--text-dim);
  font-size: 12px;
}

.lot-sizing-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
}

.lot-mode-tabs {
  display: flex;
  gap: 4px;
}

.lot-tab {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.lot-tab.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

.sub-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.manual-lot-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.manual-lot-field {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
}

.btn-step {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.preset-chip {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 5px 2px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.preset-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-chip.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fcd34d;
}

/* AI Guards */
.guards-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.guard-toggle-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.guard-toggle-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.guard-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.guard-status {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

.guard-toggle-btn.active {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.05);
}

.guard-status.active {
  background: rgba(0, 240, 255, 0.2);
  color: #67e8f9;
}

.tag-usdjpy {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.survival-mode-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.survival-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
}

.subrow-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.subrow-lbl {
  color: #22d3ee;
  font-weight: 700;
}

.sec-chip, .fee-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.sec-chip.active {
  background: #0891b2;
  color: #ffffff;
  border-color: #06b6d4;
}

.fee-chip.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: #10b981;
}

/* Auto Scan & Scan Button */
.auto-scan-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.auto-scan-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.scan-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.auto-scan-btn.active .scan-pulse-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-online 1.5s infinite;
}

.scan-countdown-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.countdown-val {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

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

.action-test-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-test-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.action-test-btn.approve {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
}

.action-test-btn.approve:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.action-test-btn.reject {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
  color: #fca5a5;
}

.action-test-btn.reject:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
}

.test-sub {
  font-size: 9px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.test-main {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.btn-main-scan {
  background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0284c7 100%);
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-main-scan:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.btn-main-scan.stop {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  border-color: #f43f5e;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.4);
  animation: pulse-border 1.5s infinite;
}

/* ==========================================================================
   MT5 Pro One-Click Deal Panel (画像1忠実再現デザイン)
   ========================================================================== */
.mt5-deal-panel {
  display: flex;
  align-items: stretch;
  position: relative;
  background: #08090d;
  border: 1px solid #1a1e27;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
  user-select: none;
  min-height: 58px;
}

/* SELL & BUY Half Buttons */
.deal-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6px 4px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, transform 0.05s ease;
  position: relative;
  text-decoration: none;
  outline: none;
}

.deal-btn:active {
  transform: scale(0.99);
}

.deal-sell {
  background: #2a0b0f;
  border-right: 1px solid #050608;
}

.deal-sell:hover {
  background: #381016;
}

.deal-buy {
  background: #09172c;
  border-left: 1px solid #050608;
}

.deal-buy:hover {
  background: #0e223f;
}

/* Side Labels (SELL / BUY) */
.deal-side-label {
  margin-bottom: 2px;
}

.deal-label-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Dealing Price Row */
.deal-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1;
}

.deal-price-row .price-base {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8; /* シアン系ベース */
  letter-spacing: -0.3px;
}

.deal-price-row .price-pips {
  font-size: 21px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 1px;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.deal-price-row .price-fraction {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  vertical-align: super;
  position: relative;
  top: -5px;
}

/* Center Controls */
.deal-center-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 5;
  pointer-events: none;
}

.deal-lot-pill {
  display: flex;
  align-items: center;
  background: #0a0c10;
  border: 1px solid #29303d;
  border-radius: 4px;
  padding: 1px 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.lot-step-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 9px;
  padding: 1px 3px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
  user-select: none;
}

.lot-step-btn:hover {
  color: #ffffff;
}

.deal-lot-value {
  width: 42px;
  background: transparent;
  border: none;
  color: #00f0ff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 0 1px;
  outline: none;
  -moz-appearance: textfield;
}

.deal-lot-value::-webkit-inner-spin-button,
.deal-lot-value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.deal-spread-badge {
  background: rgba(10, 12, 16, 0.95);
  border: 1px solid #1f242e;
  border-radius: 3px;
  padding: 0px 5px;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.3px;
  pointer-events: auto;
}

/* Manual Desk Backward Compatibility Styles */
.quote-display-grid {
  display: none;
}

.order-btn-title {
  font-size: 18px;
  font-weight: 900;
  font-family: var(--font-display);
}

.order-btn-sub {
  font-size: 11px;
  opacity: 0.9;
}

.btn-auto-atr {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #67e8f9;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-auto-atr:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
}

.rr-preview-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.rr-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.rr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manual-desk-emergency {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.btn-breakeven-sl {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-close-all-desk {
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: #fca5a5;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

/* ==========================================================================
   Right Column: Tabs & Views
   ========================================================================== */
.agentprop-right-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--header-height) - 86px);
}

.right-panel-tabbar {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
  padding: 4px;
  gap: 4px;
}

.right-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.right-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.right-tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.tab-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 9999px;
  color: #ffffff;
}

.tab-news-pill {
  font-size: 9px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 4px;
  border-radius: 4px;
}

.right-tab-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Positions Subbar */
.positions-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.sub-tab-group {
  display: flex;
  gap: 4px;
}

.pos-subtab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.pos-subtab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.btn-pos-close-all {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-pos-close-all:hover {
  background: #e11d48;
  color: #ffffff;
}

.pos-content-area {
  flex: 1;
  overflow-y: auto;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.agent-positions-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
}

.agent-positions-table th {
  padding: 8px 10px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.agent-positions-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-empty-row {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 16px !important;
  font-size: 11px;
}

/* Activity Feed */
.feed-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.feed-status-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.feed-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.feed-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feed-filter-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  outline: none;
}

.btn-feed-ctrl {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

.activity-feed-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed-item.decision {
  border-left-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}

.feed-item.success {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.feed-item.warn {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.feed-item.danger {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
}

.feed-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
}

.feed-time {
  color: var(--text-dim);
}

.agent-badge {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.agent-badge.macro {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.agent-badge.quant {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.agent-badge.cio {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.agent-badge.risk {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
  border-color: rgba(244, 63, 94, 0.3);
}

.agent-badge.execution {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.feed-message {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

/* News Blackout Guard */
.news-guard-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guard-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guard-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.guard-pill-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

.guard-sub-status {
  font-size: 11px;
  color: var(--text-dim);
}

.news-events-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-event-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
}

.news-event-card.blackout-active {
  border-color: rgba(244, 63, 94, 0.6);
  background: rgba(244, 63, 94, 0.1);
}

.news-event-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.news-event-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.news-time {
  color: var(--text-dim);
  font-weight: 700;
}

.news-curr {
  color: var(--accent-amber);
  font-weight: 800;
}

.news-stars {
  font-size: 11px;
}

.news-stars.high { color: #f43f5e; }
.news-stars.medium { color: #f59e0b; }
.news-stars.low { color: #94a3b8; }

.news-event-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-sans);
}

.news-event-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* AI Coach Modal */
.coach-modal-card {
  max-width: 680px;
  width: 90%;
}

.coach-icon {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
}

.coach-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coach-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.coach-metric-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cm-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.cm-value {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.coach-section {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.coach-sec-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.coach-sec-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.coach-action-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   Antigravity Workbench Layout & Activity Rails
   ========================================================================== */
.antigravity-workbench {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
}

/* Slim Activity Rails (Antigravity / VS Code style) */
.antigravity-rail {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 100%;
  background: #0b0e14;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  z-index: 30;
  user-select: none;
  flex-shrink: 0;
}

.antigravity-rail.right-rail {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.rail-top-actions,
.rail-bottom-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  padding: 0;
  margin: 0 auto;
}

.rail-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.rail-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.rail-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 22px;
  height: 22px;
}

.rail-label {
  display: none;
}

.rail-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #0284c7;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 1px 4px;
  border-radius: 10px;
  line-height: 1;
  border: 1px solid #0b0e14;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
}

.rail-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-online 1.5s infinite;
}

.rail-status-pip {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.rail-status-pip.safe {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}
.rail-status-pip.caution {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}
.rail-status-pip.blackout {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.rail-toggle-btn {
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rail-toggle-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.toggle-icon-svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsible Drawer Panels */
#leftDrawerPanel {
  width: 325px;
  min-width: 325px;
  max-width: 360px;
  height: 100%;
  max-height: 100%;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 17, 23, 0.95);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

#leftDrawerPanel.collapsed {
  display: none !important;
}

#rightDrawerPanel {
  width: 350px;
  min-width: 330px;
  max-width: 390px;
  height: 100%;
  max-height: 100%;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 17, 23, 0.95);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

#rightDrawerPanel.collapsed {
  display: none !important;
}

.panel-collapse-trigger-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.panel-collapse-trigger-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Center Workspace (Auto-expanding & Perfectly Scrollable) */
.center-workspace {
  flex: 1 1 0%;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 18px 60px 18px;
  overflow-y: auto !important;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Chart Center Wrapper Layout */
.chart-center-wrapper {
  min-height: 480px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.chart-center-wrapper .canvas-container {
  height: 380px;
  min-height: 320px;
  position: relative;
  width: 100%;
}

/* Quick Scroll Jump Button */
.btn-scroll-jump {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-scroll-jump:hover {
  background: rgba(6, 182, 212, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}

/* Explicit Antigravity Slim Scrollbars for Side Menus & Panels */
#leftDrawerPanel::-webkit-scrollbar,
#rightDrawerPanel::-webkit-scrollbar,
.pos-content-area::-webkit-scrollbar,
.activity-feed-stream::-webkit-scrollbar,
.news-guard-body::-webkit-scrollbar,
.center-workspace::-webkit-scrollbar,
.daily-currency-pills-bar::-webkit-scrollbar,
.history-chart-body::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

#leftDrawerPanel::-webkit-scrollbar-track,
#rightDrawerPanel::-webkit-scrollbar-track,
.pos-content-area::-webkit-scrollbar-track,
.activity-feed-stream::-webkit-scrollbar-track,
.news-guard-body::-webkit-scrollbar-track,
.center-workspace::-webkit-scrollbar-track,
.daily-currency-pills-bar::-webkit-scrollbar-track,
.history-chart-body::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

#leftDrawerPanel::-webkit-scrollbar-thumb,
#rightDrawerPanel::-webkit-scrollbar-thumb,
.pos-content-area::-webkit-scrollbar-thumb,
.activity-feed-stream::-webkit-scrollbar-thumb,
.news-guard-body::-webkit-scrollbar-thumb,
.center-workspace::-webkit-scrollbar-thumb,
.daily-currency-pills-bar::-webkit-scrollbar-thumb,
.history-chart-body::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

#leftDrawerPanel::-webkit-scrollbar-thumb:hover,
#rightDrawerPanel::-webkit-scrollbar-thumb:hover,
.pos-content-area::-webkit-scrollbar-thumb:hover,
.activity-feed-stream::-webkit-scrollbar-thumb:hover,
.news-guard-body::-webkit-scrollbar-thumb:hover,
.daily-currency-pills-bar::-webkit-scrollbar-thumb:hover,
.history-chart-body::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Dedicated Highly Visible Smooth Scrollbar for Center Workspace */
.center-workspace::-webkit-scrollbar {
  width: 8px;
}

.center-workspace::-webkit-scrollbar-track {
  background: rgba(10, 14, 23, 0.6);
  border-radius: 9999px;
}

.center-workspace::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}

.center-workspace::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* ==========================================================================
   各通貨 24時間値幅・過去14営業日分析 & 本日値幅予想 (Daily Range Forecaster)
   ========================================================================== */
.daily-range-panel {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  /* 重要: flex column 内で overflow 指定があると min-height が 0 になり潰れるため */
  flex-shrink: 0;
  min-height: min-content;
}

/* Header */
.daily-panel-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
  .daily-panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

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

.daily-title-badge-icon {
  padding: 8px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
  flex-shrink: 0;
}

.daily-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-title-text {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.3px;
  margin: 0;
}

.daily-feed-pill {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(6, 78, 59, 0.5);
  color: #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.daily-feed-pill.sim {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(8, 51, 68, 0.5);
  color: #67e8f9;
}

.feed-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

.feed-pip.online {
  animation: pulse-online 1.5s infinite;
}

.daily-sub-text {
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin: 3px 0 0 0;
}

/* Header Right Tools */
.daily-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-view-toggle-group {
  display: inline-flex;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 2px;
}

.daily-toggle-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.daily-toggle-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.daily-tool-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.daily-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.daily-tool-btn.active {
  background: rgba(6, 78, 59, 0.4);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.daily-tool-btn.icon-only {
  padding: 6px 8px;
}

.auto-refresh-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

.daily-updated-time {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

/* 2. Currency Selector Pills Bar */
.daily-currency-pills-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.currency-bar-label {
  font-size: 11px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.currency-pills-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.curr-pill-btn {
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11.5px;
  font-family: var(--font-mono);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.curr-pill-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.curr-pill-btn.active {
  background: rgba(8, 47, 73, 0.85);
  border-color: #38bdf8;
  color: #e0f2fe;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.curr-pill-btn.active .pill-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  animation: pulse-online 1.5s infinite;
}

.pill-sym {
  font-weight: 800;
}

.pill-sub-stat {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

/* 3. Multi-Currency 6-Card Overview Grid */
.daily-summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.daily-summary-card {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.daily-summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.daily-summary-card.active-sym {
  border-color: #0284c7;
  background: rgba(8, 47, 73, 0.5);
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.25);
}

.sum-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sum-card-sym {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.sum-card-price {
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #f1f5f9;
}

.sum-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: #94a3b8;
  margin-bottom: 4px;
}

.sum-card-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}

.sum-card-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
  transition: width 0.4s ease;
}

/* 4. Focused Currency Deep Dive */
.daily-focused-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

/* 4-1. Top 4 Metric Cards (Quad Grid) */
.daily-kpi-quad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.quad-metric-card {
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 0;
}

.quad-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.quad-accent-bar.blue { background: #3b82f6; }
.quad-accent-bar.cyan { background: #06b6d4; }
.quad-accent-bar.amber { background: #f59e0b; }
.quad-accent-bar.emerald { background: #10b981; }

.quad-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.quad-title-text {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.quad-title-text.blue { color: #60a5fa; }
.quad-title-text.cyan { color: #22d3ee; }
.quad-title-text.amber { color: #fbbf24; }
.quad-title-text.emerald { color: #34d399; }

.quad-tag-pill {
  font-size: 9.5px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}
.quad-tag-pill.blue { background: rgba(30, 58, 138, 0.5); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.quad-tag-pill.cyan { background: rgba(8, 51, 68, 0.5); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.quad-tag-pill.amber { background: rgba(120, 53, 15, 0.5); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.3); }
.quad-tag-pill.emerald { background: rgba(6, 78, 59, 0.5); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.3); }

.quad-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.quad-big-val {
  font-size: 22px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1;
}

.quad-unit {
  font-size: 12px;
  font-weight: 700;
}
.quad-unit.blue { color: #60a5fa; }
.quad-unit.cyan { color: #22d3ee; }
.quad-unit.amber { color: #fbbf24; }
.quad-unit.emerald { color: #34d399; }

.quad-extra-note {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  width: 100%;
  white-space: nowrap;
}

.quad-sub-desc {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono);
  margin-top: 6px;
  line-height: 1.4;
}

.quad-progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.quad-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 70%, #f59e0b 100%);
  transition: width 0.4s ease;
}

/* 4-2. Price Corridor Visual Gauge */
.corridor-gauge-card {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.corridor-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.corridor-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.corridor-title-txt {
  font-size: 11.5px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.corridor-meta-right {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.corridor-sep {
  color: #475569;
}

.corridor-track-container {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  margin: 10px 0;
}

.corridor-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 9999px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.corridor-expected-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.4) 0%, rgba(6, 78, 59, 0.4) 50%, rgba(120, 53, 15, 0.4) 100%);
}

.corridor-realized-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.7) 0%, rgba(6, 182, 212, 0.7) 100%);
  border-radius: 9999px;
  border-top: 1px solid rgba(52, 211, 153, 0.6);
  border-bottom: 1px solid rgba(52, 211, 153, 0.6);
  transition: all 0.3s ease;
}

/* Laser Current Price Needle */
.corridor-needle-indicator {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.needle-arrow-down {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #38bdf8;
  filter: drop-shadow(0 0 4px #38bdf8);
  margin-bottom: 1px;
}

.needle-core-line {
  width: 3px;
  height: 20px;
  background: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 0 10px #38bdf8, 0 0 2px #ffffff;
  border-left: 1px solid rgba(56, 189, 248, 0.8);
  border-right: 1px solid rgba(56, 189, 248, 0.8);
}

.needle-arrow-up {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid #38bdf8;
  filter: drop-shadow(0 0 4px #38bdf8);
  margin-top: 1px;
}

.corridor-markers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
}

.marker-item {
  display: flex;
  flex-direction: column;
  min-width: 110px;
}
.marker-item.left { text-align: left; }
.marker-item.center { text-align: left; }
.marker-item.center-right { text-align: left; }
.marker-item.right { text-align: right; }

@media (min-width: 640px) {
  .marker-item.center { text-align: center; }
  .marker-item.center-right { text-align: center; }
}

.marker-sub {
  font-size: 10px;
  margin-bottom: 2px;
  white-space: nowrap;
}

.marker-val {
  font-weight: 800;
  color: #f1f5f9;
}

.daily-commentary-box {
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.5;
  word-break: break-word;
}

.commentary-icon {
  font-size: 14px;
  color: #38bdf8;
  flex-shrink: 0;
}

/* 4-3. 14-Day Visual Range Bar Chart & Histogram */
.history-chart-card {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.history-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-chart-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.history-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  white-space: nowrap;
}

.legend-color-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-color-box.bullish { background: #10b981; }
.legend-color-box.bearish { background: #f43f5e; }

.legend-dash-line {
  width: 14px;
  border-top: 2px dashed #06b6d4;
  display: inline-block;
  flex-shrink: 0;
}

.history-chart-body {
  position: relative;
  height: 180px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.chart-avg-line-wrap {
  position: absolute;
  left: 0;
  right: 0;
  min-width: 520px;
  border-top: 1px dashed rgba(6, 182, 212, 0.6);
  pointer-events: none;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
}

.chart-avg-badge {
  background: rgba(8, 51, 68, 0.9);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: -12px;
  margin-right: 4px;
}

.history-bars-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 4px;
  height: 100%;
  align-items: flex-end;
  min-width: 520px;
}

.history-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
  min-width: 0;
}

.history-bar-col:hover .bar-tooltip {
  display: block;
}

.bar-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.6);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 10px;
  color: #f1f5f9;
  white-space: nowrap;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Prevent tooltip clipping on the first and last bars */
.history-bar-col:first-child .bar-tooltip,
.history-bar-col:nth-child(2) .bar-tooltip {
  left: 0;
  transform: none;
}
.history-bar-col:last-child .bar-tooltip,
.history-bar-col:nth-last-child(2) .bar-tooltip {
  left: auto;
  right: 0;
  transform: none;
}

.bar-pip-label {
  font-size: 8.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.history-bar-col:hover .bar-pip-label {
  color: #38bdf8;
  transform: scale(1.1);
}

.bar-pillar {
  width: 100%;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  transition: all 0.2s ease;
  min-height: 8px;
}

.bar-pillar.bullish {
  background: linear-gradient(180deg, #10b981 0%, rgba(6, 78, 59, 0.8) 100%);
  border-top: 1px solid #34d399;
}
.history-bar-col:hover .bar-pillar.bullish {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.bar-pillar.bearish {
  background: linear-gradient(180deg, #f43f5e 0%, rgba(136, 19, 55, 0.8) 100%);
  border-top: 1px solid #fb7185;
}
.history-bar-col:hover .bar-pillar.bearish {
  background: linear-gradient(180deg, #fb7185 0%, #f43f5e 100%);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.bar-date-label {
  font-size: 8px;
  color: #64748b;
  margin-top: 5px;
  text-align: center;
  white-space: nowrap;
}

.bar-day-label {
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.bar-day-label.mon { color: #38bdf8; }
.bar-day-label.fri { color: #f59e0b; }

/* 4-4. Detailed 14 Business Days Historical Table */
.history-table-card {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.history-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.table-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-title {
  font-size: 12px;
  letter-spacing: 0.3px;
}

.table-subtitle {
  font-size: 11px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.daily-breakdown-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.daily-breakdown-table thead {
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
}

.daily-breakdown-table th {
  padding: 9px 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.daily-breakdown-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  white-space: nowrap;
}

.daily-breakdown-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.daily-breakdown-table tr.today-row td {
  background: rgba(8, 47, 73, 0.25);
  font-weight: 700;
  border-left: 2px solid #38bdf8;
}

.table-mini-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-bar-track {
  width: 50px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.table-bar-fill {
  height: 100%;
  border-radius: 2px;
}
.table-bar-fill.bullish { background: #10b981; }
.table-bar-fill.bearish { background: #f43f5e; }
.table-bar-fill.today { background: #38bdf8; }

.badge-leg {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}
.badge-leg.bullish {
  background: rgba(6, 78, 59, 0.6);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-leg.bearish {
  background: rgba(136, 19, 55, 0.6);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   AgentProp Sub-Header TopBar & Right HUD Relocation Styles
   ========================================================================== */
.agentprop-topbar {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.agentprop-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.agentprop-nav-tabs .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agentprop-nav-tabs .tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.agentprop-nav-tabs .tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.2));
  border-color: rgba(99, 102, 241, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

/* Topbar Environment Switch (DEMO / REAL) */
.topbar-env-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.env-switch-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.env-toggle-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.env-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1;
}

.env-toggle-btn:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
}

.env-toggle-btn.active[data-env="simulation"] {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
}

.env-toggle-btn.active[data-env="live"] {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.18);
}

.env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.env-dot.demo {
  background: #38bdf8;
}

.env-dot.real {
  background: #34d399;
}

.env-toggle-btn.active .env-dot {
  opacity: 1;
  box-shadow: 0 0 6px currentColor;
}

.agentprop-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agentprop-topbar-right .select-model {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.right-hud-wrap {
  padding: 12px;
  margin: 8px 12px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.right-hud-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.right-account-hud {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.right-account-hud .hud-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.right-account-hud .hud-item:last-child {
  border-bottom: none;
}

.right-account-hud .hud-label {
  font-size: 11px;
  color: var(--text-dim);
}

.right-account-hud .hud-value {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Symbol Manager Modal & Triggers
   ========================================================================== */
.symbols-badge-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-manage-symbols-trigger {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-manage-symbols-trigger:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.symbol-manager-card {
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.symbol-manager-body {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.sym-manager-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sym-search-box .input-text {
  width: 100%;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.sym-search-box .input-text:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.sym-quick-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-filter-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-pill:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
}

.btn-filter-pill.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

.sym-manager-list-container {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.sym-manager-list-container::-webkit-scrollbar {
  width: 6px;
}

.sym-manager-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.sym-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.sym-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(20, 27, 45, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.sym-card-item:hover {
  background: rgba(30, 41, 69, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.sym-card-item.selected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.sym-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sym-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sym-card-name {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
  font-family: var(--font-mono);
}

.sym-tag-mw {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sym-card-desc {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.sym-checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 12px;
  font-weight: 700;
  color: transparent;
}

.sym-card-item.selected .sym-checkbox-custom {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.sym-manager-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #94a3b8;
}

.btn-sync-mt5 {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

.btn-sync-mt5:hover {
  color: #7dd3fc;
  text-decoration: underline;
}



