/* ==========================================================================
   FolioSquad 3D Pixel Office Dashboard — Modern Glassmorphism & Pixel Style
   ========================================================================== */

:root {
  /* Core Background & Surfaces */
  --bg-main: #0a0d14;
  --bg-surface: #111622;
  --bg-card: rgba(19, 25, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 52, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);

  /* Team Persona Accent Colors */
  --c-jihyeon: #f59e0b;      /* 지현 (데이터수집) - 에너지 오렌지 */
  --c-jaewoon: #38bdf8;      /* 재웅 (데이터분석) - 쿨 시안/블루 */
  --c-yubin: #10b981;        /* 유빈 (리스크 CRO) - 안전 에메랄드 */
  --c-eunbin: #eab308;       /* 은빈 (주문실행) - 번개 옐로우 */
  --c-yujin: #f43f5e;        /* 유진 (레드팀 저격수) - 저격 크림슨 로즈 */

  /* General Accents */
  --c-primary: #6366f1;
  --c-primary-glow: rgba(99, 102, 241, 0.35);
  --c-emerald: #10b981;
  --c-rose: #f43f5e;
  --c-text-main: #f1f5f9;
  --c-text-muted: #94a3b8;
  --c-text-dim: #64748b;

  /* Typography */
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;

  /* Elevations & Transitions */
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(16, 185, 129, 0.06) 0%, transparent 45%);
  color: var(--c-text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Top Global Header
   -------------------------------------------------------------------------- */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(17, 22, 34, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 20px;
}

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

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pixel-logo-icon {
  font-size: 26px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.logo-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--c-text-dim);
  font-weight: 500;
  display: block;
}

.system-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-emerald);
}

.mode-pill, .mock-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--c-text-muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--c-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--c-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-metrics {
  display: flex;
  align-items: center;
  gap: 24px;
}

.metric-box {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.metric-label {
  font-size: 11px;
  color: var(--c-text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.metric-value small {
  font-size: 11px;
  color: var(--c-text-muted);
}

.text-emerald { color: var(--c-emerald); }
.text-rose { color: var(--c-rose); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-glow {
  box-shadow: 0 0 16px var(--c-primary-glow);
}

.btn-glow:hover {
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Navigation Tabs
   -------------------------------------------------------------------------- */
.nav-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 28px;
  background: rgba(15, 19, 30, 0.5);
  border-bottom: 1px solid var(--border-subtle);
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--c-text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-item.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

/* --------------------------------------------------------------------------
   Main Content Layout & Panels
   -------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  padding: 24px 28px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-group h2, .panel-title-group h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-text-muted);
}

.badge-accent {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* --------------------------------------------------------------------------
   Tab 1: 3D Pixel Office & Terminal Layout
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Tab 1: Stock/Crypto Exchange Chart Terminal & Log Stream Layout
   -------------------------------------------------------------------------- */
.office-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 530px;
  gap: 16px;
  height: calc(100vh - 175px);
  min-height: 600px;
}

/* ==========================================================================
   Professional Trading Chart Terminal Panel
   ========================================================================== */
.chart-terminal-panel {
  display: flex;
  flex-direction: column;
  background: #0c101a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* 1. 상단 바: 종목 탭 & 타임프레임 툴바 */
.chart-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(14, 19, 32, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 12px;
  flex-wrap: wrap;
}

.symbol-tabs-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.symbol-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.symbol-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.symbol-tab-btn.active[data-symbol="BTCUSDT"] {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.15);
}

.symbol-tab-btn.active[data-symbol="ETHUSDT"] {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.15);
}

.sym-badge-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.btc-icon {
  background: #f59e0b;
  color: #111;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.eth-icon {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.sym-meta {
  display: flex;
  flex-direction: column;
}

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

.sym-code {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  color: #ffffff;
}

.sym-tag {
  font-size: 10px;
  color: var(--c-text-muted);
}

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

.sym-live-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  color: #cbd5e1;
}

.sym-chg-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.sym-chg-badge.up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.sym-chg-badge.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* 툴바 컨트롤 */
.chart-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-btn-group {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 2px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tool-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
}

.tool-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.chart-indicator-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ind-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--c-text-muted);
  cursor: pointer;
  user-select: none;
}

.ind-check input {
  accent-color: #6366f1;
  cursor: pointer;
}

/* 2. 시세 지표 티커 리본 */
.market-ticker-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: rgba(16, 22, 36, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 12px;
}

.ticker-headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ticker-active-symbol {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  letter-spacing: 0.5px;
}

.ticker-active-price {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  letter-spacing: -0.4px;
}

.ticker-active-change {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.ticker-active-change.up { color: #10b981; }
.ticker-active-change.down { color: #ef4444; }

.ticker-metrics-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10.5px;
}

.metric-cell .cell-label {
  color: var(--c-text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-cell .cell-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #f1f5f9;
}

.status-cell {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* 3. 메인 전문 차트 뷰포트 (TradingView Lightweight Charts) */
.trading-chart-viewport {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 340px;
  background: #090d16;
  overflow: hidden;
}

#tradingview-chart-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* 십자선 호버 툴팁 오버레이 */
.crosshair-ohlc-overlay {
  position: absolute;
  top: 10px;
  left: 16px;
  background: rgba(13, 18, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
  backdrop-filter: blur(8px);
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.ohlc-item strong {
  color: #f8fafc;
  font-weight: 700;
}

/* 4. 하단 5인 AI 스쿼드 실시간 전술 브리핑 바 */
.agent-tactical-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(13, 17, 28, 0.95);
  padding: 8px 16px;
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--c-text-muted);
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.brief-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.brief-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

.badge-role {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-analyst .badge-role { color: #f59e0b; }
.agent-risk .badge-role { color: #ec4899; }
.agent-exec .badge-role { color: #10b981; }
.agent-collect .badge-role { color: #38bdf8; }
.agent-retro .badge-role { color: #a855f7; }

.brief-text {
  font-size: 9.5px;
  color: #cbd5e1;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Office Wall Realtime Trading Monitors (BTC & ETH)
   -------------------------------------------------------------------------- */
.wall-chart-monitor {
  position: absolute;
  z-index: 12;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(13, 17, 28, 0.94) 0%, rgba(7, 10, 18, 0.97) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  user-select: none;
}

.wall-chart-monitor:hover {
  transform: translateY(-2px) scale(1.02);
  z-index: 25;
}

.wall-chart-monitor.btc-monitor {
  border-color: rgba(245, 158, 11, 0.35);
}

.wall-chart-monitor.btc-monitor:hover {
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25), 0 0 12px rgba(245, 158, 11, 0.15);
}

.wall-chart-monitor.eth-monitor {
  border-color: rgba(99, 102, 241, 0.35);
}

.wall-chart-monitor.eth-monitor:hover {
  border-color: rgba(129, 140, 248, 0.8);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25), 0 0 12px rgba(99, 102, 241, 0.15);
}

.monitor-bezel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 10px 4px 10px;
  box-sizing: border-box;
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.coin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-btc {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: dotPulseBtc 1.8s infinite;
}

.pulse-eth {
  background: #818cf8;
  box-shadow: 0 0 8px #818cf8;
  animation: dotPulseEth 1.8s infinite;
}

@keyframes dotPulseBtc {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes dotPulseEth {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.coin-symbol {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f1f5f9;
}

.price-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.coin-change {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.coin-change.up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.coin-change.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.chart-canvas-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  position: relative;
}

.monitor-sparkline {
  width: 100%;
  height: 100%;
  display: block;
}

.btc-line {
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
}

.eth-line {
  filter: drop-shadow(0 0 4px rgba(129, 140, 248, 0.5));
}

.pulse-point-btc {
  animation: pointPulse 1.5s infinite;
}

.pulse-point-eth {
  animation: pointPulse 1.5s infinite;
}

@keyframes pointPulse {
  0%, 100% { transform: scale(1); transform-origin: center; }
  50% { transform: scale(1.4); transform-origin: center; }
}

.monitor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 9px;
  color: var(--c-text-muted);
}

.monitor-footer .meta-label strong {
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Agent Hotspots & Interactive Overlay
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Living Autonomous Agent Sprites & Motion System
   -------------------------------------------------------------------------- */
.living-agent {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 18;
  /* 부드러운 자율 걷기 이동 */
  transition: left 2.8s cubic-bezier(0.4, 0, 0.2, 1), top 2.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: left, top, transform;
}

.living-agent:hover {
  z-index: 30;
}

/* Agent Body Container */
.agent-character-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

/* LimeZu Pixel Art Sprite Characters Mapping */
.sprite-jihyeon {
  --char-idle: url('assets/characters/Amelia_idle_16x16.png');
  --char-run: url('assets/characters/Amelia_run_16x16.png');
  --char-sit: url('assets/characters/Amelia_sit_16x16.png');
  --char-phone: url('assets/characters/Amelia_phone_16x16.png');
}

.sprite-jaewoon {
  --char-idle: url('assets/characters/Adam_idle_16x16.png');
  --char-run: url('assets/characters/Adam_run_16x16.png');
  --char-sit: url('assets/characters/Adam_sit_16x16.png');
  --char-phone: url('assets/characters/Adam_phone_16x16.png');
}

.sprite-yubin {
  --char-idle: url('assets/characters/Bob_idle_16x16.png');
  --char-run: url('assets/characters/Bob_run_16x16.png');
  --char-sit: url('assets/characters/Bob_sit_16x16.png');
  --char-phone: url('assets/characters/Bob_phone_16x16.png');
}

.sprite-eunbin {
  --char-idle: url('assets/characters/Alex_idle_16x16.png');
  --char-run: url('assets/characters/Alex_run_16x16.png');
  --char-sit: url('assets/characters/Alex_sit_16x16.png');
  --char-phone: url('assets/characters/Alex_phone_16x16.png');
}

.sprite-yujin {
  --char-idle: url('assets/characters/Yujin_idle_16x16.png');
  --char-run: url('assets/characters/Yujin_run_16x16.png');
  --char-sit: url('assets/characters/Yujin_sit_16x16.png');
  --char-phone: url('assets/characters/Yujin_phone_16x16.png');
}

/* 픽셀 스프라이트 프레임 (2배 스케일: 16x32 -> 32x64) */
.agent-sprite-frame {
  width: 32px;
  height: 64px;
  background-image: var(--char-idle);
  background-size: 128px 64px;
  background-repeat: no-repeat;
  background-position: -96px 0; /* 정면(Down) 응시 */
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  transition: filter 0.2s ease, transform 0.2s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.75));
  user-select: none;
}

/* 캐릭터 바닥 픽셀 타원 그림자 */
.agent-character-body::after {
  content: '';
  position: absolute;
  bottom: 12px;
  width: 26px;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  z-index: -1;
  filter: blur(1px);
}

/* 방향 전환 (좌/우 바라보기) - 명찰은 유지하고 스프라이트만 반전 */
.living-agent.facing-left .agent-sprite-frame {
  transform: scaleX(-1);
}

.living-agent.facing-right .agent-sprite-frame {
  transform: scaleX(1);
}

/* 걷는/뛰는 중 모션 (LimeZu run 6프레임 루프 애니메이션) */
.living-agent.is-walking .agent-sprite-frame {
  background-image: var(--char-run);
  background-size: 768px 64px;
  animation: spriteWalkRun 0.6s steps(6) infinite;
}

@keyframes spriteWalkRun {
  from { background-position: 0 0; }
  to { background-position: -192px 0; } /* 6프레임 x 32px = 192px */
}

/* 의자에 착석했을 때 (책상 앞 안착 & 미세 호흡) */
.living-agent.is-sitting .agent-sprite-frame {
  background-image: var(--char-idle);
  background-size: 128px 64px;
  background-position: -96px 0;
  animation: sittingBreathe 2.4s infinite ease-in-out;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85));
}

@keyframes sittingBreathe {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(0px); }
}

/* 키보드 맹렬히 타이핑 / 파이프라인 가동 통화 모션 */
.living-agent.is-working .agent-sprite-frame {
  background-image: var(--char-phone);
  background-size: 288px 64px;
  animation: spriteWorkingTyping 0.4s steps(2) infinite alternate;
}

@keyframes spriteWorkingTyping {
  from { background-position: 0 0; }
  to { background-position: -64px 0; }
}

/* 커피 마시는 모션 */
.living-agent.is-sipping .agent-sprite-frame {
  background-image: var(--char-phone);
  background-size: 288px 64px;
  background-position: -64px 0;
  animation: sipTilt 1.2s infinite ease-in-out;
}

@keyframes sipTilt {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-6deg); }
}

/* Active Work Aura (파이프라인 가동 시 타오르는 픽셀 오라) */
.active-work-aura {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.living-agent.is-working .active-work-aura {
  opacity: 1;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 75%);
  animation: workPulse 1.2s infinite ease-in-out;
}

@keyframes workPulse {
  0%, 100% { transform: translateX(-50%) scale(0.9); opacity: 0.6; }
  50% { transform: translateX(-50%) scale(1.2); opacity: 1; filter: drop-shadow(0 0 10px #818cf8); }
}

/* Agent Name Plate (Retro RPG Style) */
.agent-name-plate {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
  margin-top: 2px;
}

/* Speech Bubble (Retro JRPG Pixel Dialogue Box) 
   - 화면을 가리지 않도록 평상시에는 닫혀있고, 호버 또는 발언 활성 시 부드럽게 팝업 */
.speech-bubble {
  position: absolute;
  bottom: 82px;
  background: #ffffff;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  width: 190px;
  box-shadow: 
    0 0 0 2px #0f172a,
    0 6px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 35;
}

/* 마우스 호버 시 또는 새 대화 이벤트 발생 시 표시 */
.living-agent:hover .speech-bubble,
.speech-bubble.active-speech {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 7px 0 7px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.bubble-sender {
  display: block;
  font-family: var(--font-pixel);
  font-size: 7.5px;
  margin-bottom: 3px;
  letter-spacing: -0.5px;
}

.bubble-jihyeon .bubble-sender { color: #d97706; }
.bubble-jaewoon .bubble-sender { color: #0284c7; }
.bubble-yubin .bubble-sender { color: #059669; }
.bubble-eunbin .bubble-sender { color: #b45309; }
.bubble-yujin .bubble-sender { color: #7c3aed; }

.bubble-text {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.35;
  word-break: keep-all;
  color: #1e293b;
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Status Tag (WORKING, IDLE) */
.status-tag {
  font-family: var(--font-pixel);
  font-size: 6.5px;
  padding: 1px 4px;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 2px;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: -0.5px;
}

.status-tag.WORKING {
  background: #4f46e5;
  color: #fff;
  border-color: #818cf8;
  animation: pulse 1s infinite;
}

.status-tag.COMPLETED {
  background: #059669;
  color: #fff;
  border-color: #34d399;
}

/* --------------------------------------------------------------------------
   Interactive Office Props Hotspots
   -------------------------------------------------------------------------- */
.prop-hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 12;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.prop-hotspot:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.prop-indicator {
  opacity: 0;
  transform: translateY(4px);
  font-size: 16px;
  transition: all 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.prop-hotspot:hover .prop-indicator {
  opacity: 1;
  transform: translateY(0);
}

/* Prop Interaction Toast */
.prop-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 2px solid #eab308;
  padding: 10px 18px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 40;
  white-space: nowrap;
}

.prop-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.viewport-footer {
  padding: 10px 20px;
  background: rgba(15, 19, 30, 0.6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-text-dim);
}

/* --------------------------------------------------------------------------
   Office Right: Real-time Terminal Log Stream
   -------------------------------------------------------------------------- */
.office-log-panel {
  display: flex;
  flex-direction: column;
  background: #090c13;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.office-log-panel .panel-header {
  padding: 14px 18px;
  background: #0f141f;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.log-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sse-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--c-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 6px;
  border-radius: 4px;
}

.terminal-cols-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(13, 17, 28, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  user-select: none;
}

.terminal-cols-bar .col-time {
  width: 62px;
  flex-shrink: 0;
}

.terminal-cols-bar .col-tag {
  width: 82px;
  flex-shrink: 0;
  text-align: center;
}

.terminal-cols-bar .col-msg {
  flex: 1;
  min-width: 0;
}

.terminal-container {
  flex: 1;
  padding: 10px 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
  scroll-behavior: smooth;
}

.terminal-stream {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  animation: fadeIn 0.15s ease-out;
}

.log-line:hover {
  background: rgba(255, 255, 255, 0.02);
}

.log-time {
  color: #64748b;
  font-size: 11px;
  font-family: var(--font-mono);
  width: 62px;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: -0.3px;
  padding-top: 1px;
}

.log-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 0;
  font-size: 10px;
  width: 82px;
  flex-shrink: 0;
  white-space: nowrap;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  letter-spacing: -0.2px;
}

.tag-system { color: #94a3b8; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.tag-collector { color: #38bdf8; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.25); }
.tag-analyst { color: #f59e0b; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); }
.tag-risk { color: #ec4899; background: rgba(236, 72, 153, 0.12); border: 1px solid rgba(236, 72, 153, 0.25); }
.tag-execution { color: #10b981; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); }
.tag-retro { color: #a855f7; background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(168, 85, 247, 0.25); }

.log-msg {
  flex: 1;
  min-width: 0;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  word-break: break-word;
}

.terminal-footer {
  padding: 8px 16px;
  background: #0c1018;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-dim);
}

.terminal-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-footer-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.scheduler-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.scheduler-timer-badge .timer-badge-clock {
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.scheduler-timer-badge.active-running {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}
.scheduler-timer-badge.active-running .timer-badge-clock {
  color: #6ee7b7;
}

.scheduler-timer-badge.paused {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
.scheduler-timer-badge.paused .timer-badge-clock {
  color: #fde68a;
}

.scheduler-timer-badge.killed {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}
.scheduler-timer-badge.killed .timer-badge-clock {
  color: #fca5a5;
}

.prompt-cursor {
  color: var(--c-primary);
  font-weight: bold;
}

/* 상단 헤더 스케줄러 타이머 메트릭 박스 */
.metric-scheduler {
  border-color: rgba(99, 102, 241, 0.3) !important;
  background: rgba(99, 102, 241, 0.06);
}

.timer-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
  animation: timerPulse 2s infinite ease-in-out;
  display: inline-block;
  margin-right: 2px;
}

.timer-live-dot.running {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.timer-live-dot.paused {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: none;
}

.timer-live-dot.killed {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: none;
}

@keyframes timerPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}


/* --------------------------------------------------------------------------
   Tab 2: Portfolio Grid
   -------------------------------------------------------------------------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 20px;
}

.stat-card-highlight {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.stat-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0;
}

.stat-large {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
}

.stat-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

.stat-bar-container {
  margin-top: 12px;
}

.stat-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* Allocation Simulation */
.allocation-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.allocation-donut-sim {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(var(--c-emerald) 0% 100%, var(--c-jaewoon) 100% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-inner {
  width: 66px;
  height: 66px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-pct {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}

.donut-sub {
  font-size: 9px;
  color: var(--c-text-dim);
}

.allocation-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.color-dot.usdt { background: var(--c-emerald); }
.color-dot.btc { background: #f59e0b; }

/* Market Tickers List */
.market-tickers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.ticker-sym {
  font-weight: 700;
  font-size: 13px;
}

.ticker-price {
  font-family: var(--font-mono);
  font-weight: 700;
}

.ticker-rsi {
  font-size: 11px;
  color: var(--c-text-muted);
}

/* Tables */
.mt-4 { margin-top: 20px; }

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.data-table th {
  padding: 12px 14px;
  color: var(--c-text-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-side-buy {
  background: rgba(16, 185, 129, 0.15);
  color: var(--c-emerald);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.badge-side-sell {
  background: rgba(244, 63, 94, 0.15);
  color: var(--c-rose);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Tab 4: Analytics & Retrospective
   -------------------------------------------------------------------------- */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.retro-score-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.2);
  border: 2px solid var(--c-yujin);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.score-label {
  font-size: 9px;
  color: #e9d5ff;
}

.score-summary h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #f1f5f9;
}

.score-summary p {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

.actionable-lesson-box {
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--c-jihyeon);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 18px;
}

.lesson-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-jihyeon);
  margin-bottom: 4px;
}

.lesson-content {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
}

.retro-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.retro-col {
  padding: 14px;
  border-radius: var(--radius-sm);
}

.retro-col.good {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.retro-col.missed {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.15);
}

.retro-col h4 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.retro-col ul {
  padding-left: 18px;
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* Decision Timeline */
.decision-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.timeline-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.timeline-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.chain-step {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.timeline-empty {
  text-align: center;
  padding: 40px;
  color: var(--c-text-dim);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   4-Agent Autonomous Thought & Log Archive Section (지현, 재웅, 유빈, 은빈)
   -------------------------------------------------------------------------- */
.agent-logs-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(10px);
}

.title-text-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.title-text-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text-main);
  margin: 0;
}

.section-subtitle {
  font-size: 11px;
  color: var(--c-text-dim);
}

.section-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auto-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
}

.pulse-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  animation: timerPulse 2s infinite;
}

.agent-logs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1400px) {
  .agent-logs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .agent-logs-grid {
    grid-template-columns: 1fr;
  }
}

.agent-log-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.agent-log-card:hover {
  transform: translateY(-2px);
}

.card-jihyeon {
  border-top: 3px solid var(--c-jihyeon);
}
.card-jaewoon {
  border-top: 3px solid var(--c-jaewoon);
}
.card-yujin {
  border-top: 3px solid var(--c-yujin);
}
.card-yubin {
  border-top: 3px solid var(--c-yubin);
}
.card-eunbin {
  border-top: 3px solid var(--c-eunbin);
}

.agent-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.agent-avatar-badge {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.agent-name-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agent-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text-main);
}

.agent-role {
  font-size: 10px;
  font-weight: 600;
}
.role-jihyeon { color: var(--c-jihyeon); }
.role-jaewoon { color: var(--c-jaewoon); }
.role-yujin { color: var(--c-yujin); }
.role-yubin { color: var(--c-yubin); }
.role-eunbin { color: var(--c-eunbin); }

.agent-log-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-text-dim);
}

.agent-log-terminal {
  height: 420px;
  overflow-y: auto;
  background: #060910;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* 스크롤바 미세 스타일 */
.agent-log-terminal::-webkit-scrollbar {
  width: 5px;
}
.agent-log-terminal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.feed-empty-state {
  margin: auto;
  text-align: center;
  color: var(--c-text-dim);
  font-size: 11px;
  padding: 20px;
}

.agent-log-item {
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.agent-log-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.agent-log-item.new-arrival {
  animation: highlightNew 2s ease-out;
}

@keyframes highlightNew {
  0% { background: rgba(99, 102, 241, 0.25); border-color: rgba(99, 102, 241, 0.6); }
  100% { background: rgba(255, 255, 255, 0.02); border-color: rgba(255, 255, 255, 0.04); }
}

.agent-log-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.agent-log-time {
  color: var(--c-text-dim);
}

.agent-log-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-clear, .badge-buy, .badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-caution, .badge-sell {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-trap {
  background: rgba(244, 63, 94, 0.25);
  color: #ff4d6d;
  border: 1px solid rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.2);
}

.badge-hold {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-audit {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-info {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.agent-log-headline {
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
}

.agent-log-body {
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.agent-log-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.indicator-chip {
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  font-size: 9px;
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--c-text-dim);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
  .office-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================== */
/* 듀얼 파이프라인 (가드레일 표준 vs AI 순수 자율) 모드 선택기 & 로그 분리 스타일 */
/* ========================================================================== */
.pipeline-mode-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.pipeline-mode-selector-wrapper.mode-wild {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
  animation: pulseWildBorder 2.5s infinite;
}

@keyframes pulseWildBorder {
  0%, 100% { border-color: rgba(245, 158, 11, 0.6); box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
  50% { border-color: rgba(239, 68, 68, 0.8); box-shadow: 0 0 18px rgba(239, 68, 68, 0.35); }
}

.mode-select-label {
  font-size: 11px;
  color: var(--c-text-dim);
  font-weight: 600;
}

.mode-select-dropdown {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
}

.mode-select-dropdown option {
  background: #0f172a;
  color: #f1f5f9;
  font-size: 12px;
  padding: 6px;
}

.pipeline-mode-selector-wrapper.mode-wild .mode-select-dropdown {
  color: #fbbf24;
}

/* 4인 아카이브 헤더 모드 태그 */
.archive-mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--c-emerald);
  transition: all 0.3s ease;
}

.archive-mode-tag.mode-wild {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* 에이전트 로그 항목 내 모드 뱃지 */
.agent-log-mode-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: -0.2px;
}

.agent-log-mode-badge.mode-standard {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.agent-log-mode-badge.mode-wild {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* 의사결정 타임라인 내 모드 알약 */
.decision-mode-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.decision-mode-pill.mode-standard {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.decision-mode-pill.mode-wild {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Bybit 자금 계정 (Funding Account) 안내 카드 스타일 */
.funding-account-card {
  border-top: 2px solid rgba(245, 158, 11, 0.6);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.funding-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

