/* =========================================================
   NOX Portfolio AI — UI matching
   https://nox.sofinx.otso-dev.com/portfolio
   Light theme, blue primary, emerald profits, zinc neutrals.
   ========================================================= */

:root {
  /* Zinc palette (neutrals) */
  --zinc-50:  #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;

  /* Brand */
  --blue-50:   #eff6ff;
  --blue-100:  #dbeafe;
  --blue-300:  #93c5fd;
  --blue-500:  #3b82f6;
  --blue-600:  #2563eb;
  --blue-700:  #1d4ed8;
  --cyan-400:  #22d3ee;

  /* Semantic */
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --red-50:  #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.06);
  --shadow-blue: 0 8px 24px rgba(37,99,235,0.15);

  --font-sans: 'Inter', 'Geist', -apple-system, BlinkMacSystemFont,
               'Segoe UI', 'PingFang TC', 'Noto Sans TC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', 'SF Mono', Consolas, monospace;

  --dur-fast: 150ms;
  --dur-med:  250ms;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: #fff; color: var(--zinc-900);
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; overflow: hidden; }

button { font-family: inherit; background: transparent;
         border: 0; color: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============ Top-level shell ============ */
.app-shell {
  display: flex;
  height: 100vh;
  background: #fff;
}

/* ============ Sidebar (260px) ============ */
.sidebar {
  position: relative;
  width: 260px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--zinc-50);
  border-right: 1px solid var(--zinc-200);
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 6px;
}
.brand-logo {
  width: 28px; height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.brand-name {
  font-size: 16px; font-weight: 700; letter-spacing: 0.1em;
  background: linear-gradient(90deg, var(--blue-600) 0%, var(--cyan-400) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.icon-btn {
  padding: 6px;
  border-radius: var(--radius-md);
  color: var(--zinc-400);
  transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--zinc-200); color: var(--zinc-600); }
.icon-btn svg { width: 16px; height: 16px; }

.sidebar-new-btn {
  margin: 0 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  color: var(--zinc-700);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-fast) var(--ease);
}
.sidebar-new-btn:hover {
  border-color: var(--blue-300);
  background: var(--blue-50);
  color: var(--blue-700);
}
.sidebar-new-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-tabs {
  margin: 20px 12px 0;
  padding: 2px;
  display: flex; gap: 2px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-md);
}
.sidebar-tabs button {
  flex: 1; padding: 6px 10px;
  font-size: 12px; font-weight: 500;
  color: var(--zinc-500);
  border-radius: calc(var(--radius-md) - 2px);
  transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sidebar-tabs button.active {
  background: var(--blue-50);
  color: var(--blue-700);
}
.sidebar-tabs .count-pill {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  background: var(--blue-100);
  color: var(--blue-600);
  border-radius: 999px;
  font-size: 10px; line-height: 18px;
}

.sidebar-list {
  flex: 1; overflow-y: auto;
  margin-top: 12px;
  padding: 0 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.conversation-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.conversation-item:hover { background: rgba(228,228,231,0.5); }
.conversation-item.active { background: #fff; box-shadow: var(--shadow-sm); }
.conversation-item .msg-ic {
  width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px;
  color: var(--blue-600);
}
.conversation-item .info { flex: 1; min-width: 0; }
.conversation-item .title {
  font-size: 13px; font-weight: 600;
  color: var(--zinc-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conversation-item .meta {
  margin-top: 2px;
  font-size: 11px; color: var(--zinc-400);
}
.conversation-item .del {
  opacity: 0; padding: 4px; border-radius: 4px;
  color: var(--zinc-300);
  transition: all var(--dur-fast) var(--ease);
}
.conversation-item:hover .del { opacity: 1; }
.conversation-item .del:hover { background: var(--red-50); color: var(--red-500); }
.conversation-item.portfolio-item .msg-ic { color: var(--emerald-600); }
.conversation-item.portfolio-item .title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.portfolio-profit.up   { color: var(--emerald-600); font-weight: 600; }
.portfolio-profit.down { color: var(--red-500);     font-weight: 600; }
.conversation-item .del svg { width: 14px; height: 14px; }

.sidebar-user {
  border-top: 1px solid var(--zinc-200);
  padding: 12px;
}
.user-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease);
}
.user-btn:hover { background: var(--zinc-100); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--zinc-200);
  display: grid; place-items: center;
  color: var(--zinc-500);
}
.user-avatar svg { width: 16px; height: 16px; }
.user-info { flex: 1; text-align: left; min-width: 0; }
.user-email {
  font-size: 12px; font-weight: 500; color: var(--zinc-700);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-plan { margin-top: 2px; display: flex; align-items: center; gap: 4px;
             color: var(--zinc-500); font-size: 10px; font-weight: 600; }
.user-plan svg { width: 12px; height: 12px; }

/* ============ Center column: header + chat ============ */
.main-column {
  flex: 1 1 auto;
  display: flex; flex-direction: column; overflow: hidden;
}
.main-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--zinc-200);
  flex-shrink: 0;
}
.main-header-title {
  font-size: 14px; color: var(--zinc-400);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.main-header-actions { display: flex; align-items: center; gap: 12px; }
.lang-select {
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 4px 8px; border-radius: var(--radius-md);
  background: #fff; color: var(--zinc-700);
  border: 1px solid var(--zinc-200); cursor: pointer;
}
.lang-select:hover { border-color: var(--blue-300); color: var(--blue-700); }

.main-body {
  display: flex; flex: 1; overflow: hidden;
}

/* Chat column */
.chat-column {
  width: 460px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--zinc-200);
  min-width: 0;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 24px 20px 12px;
  gap: 20px;
}
.chat-messages > * { max-width: 100%; }

.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 92%;
  background: var(--blue-600); color: #fff;
  padding: 10px 14px; border-radius: var(--radius-2xl);
  font-size: 14px; line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.assistant { display: flex; justify-content: flex-start; }
.msg.assistant .bubble {
  max-width: 100%;
  color: var(--zinc-800); font-size: 14px; line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.system .bubble {
  margin: 0 auto;
  max-width: 90%; text-align: center;
  color: var(--zinc-400); font-size: 12px; font-style: italic;
  padding: 6px 12px; border: 1px dashed var(--zinc-200);
  border-radius: var(--radius-md);
}
.msg-meta {
  margin-top: 6px;
  font-size: 11px; color: var(--zinc-400);
  font-family: var(--font-mono);
}
.view-portfolio-cta {
  margin-top: 12px;
  display: block; width: 100%;
  padding: 8px 12px;
  background: var(--blue-600); color: #fff;
  border-radius: var(--radius-md);
  font-size: 12px; font-weight: 600;
  transition: background var(--dur-fast) var(--ease);
}
.view-portfolio-cta:hover { background: var(--blue-500); }
.view-portfolio-cta:active { background: var(--blue-700); }

.welcome-card {
  margin: auto;
  padding: 32px 16px; max-width: 420px; text-align: center;
  color: var(--zinc-500);
}
.welcome-title {
  font-size: 15px; line-height: 1.6;
  color: var(--zinc-700); margin-bottom: 20px;
}
.quick-prompts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.quick-prompt-card {
  padding: 12px;
  background: #fff; border: 1px solid var(--zinc-200);
  border-radius: var(--radius-md);
  font-size: 12px; color: var(--zinc-600); text-align: left;
  transition: all var(--dur-fast) var(--ease);
}
.quick-prompt-card:hover {
  border-color: var(--blue-300); background: var(--blue-50);
  color: var(--blue-700);
}

.typing {
  display: inline-flex; gap: 4px;
  padding: 10px 16px;
  border-radius: var(--radius-2xl);
  background: var(--zinc-100);
  align-self: flex-start;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-600);
  animation: bounce 1.4s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

/* Chat input */
.chat-input-wrap {
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--zinc-50) 100%);
  padding: 12px 16px 16px;
  border-top: 1px solid var(--zinc-100);
}
.chat-input-inner { max-width: 640px; margin: 0 auto; }
.chat-box {
  background: #fff; border: 1px solid var(--zinc-200);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.chat-box:focus-within { box-shadow: var(--shadow-md); }
.chat-textarea {
  display: block; width: 100%; max-height: 160px;
  padding: 12px 16px 4px;
  resize: none;
  background: transparent; border: 0; outline: 0;
  font-size: 14px; color: var(--zinc-800);
}
.chat-textarea::placeholder { color: var(--zinc-400); }
.chat-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 8px;
}
.chat-hint { padding: 0 8px; font-size: 11px; color: var(--zinc-400); }
.send-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--blue-600); color: #fff;
  display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease);
}
.send-btn:hover:not(:disabled) { background: var(--blue-500); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn svg { width: 14px; height: 14px; }

/* ============ Right column: portfolio detail ============ */
.portfolio-column {
  flex: 1; overflow-y: auto;
  background: var(--zinc-50);
}
.portfolio-inner { padding: 24px; }
.portfolio-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.portfolio-title { font-size: 20px; font-weight: 700; color: var(--zinc-800); }
.portfolio-section { margin-bottom: 24px; }

.empty-portfolio {
  padding: 48px 24px;
  text-align: center; color: var(--zinc-400); font-size: 13px;
}

/* Variant tab pills */
.variant-row {
  display: flex; gap: 8px;
  margin-bottom: 24px;
}
.variant-card {
  position: relative;
  flex: 1;
  padding: 12px 16px; text-align: left;
  border: 1px solid var(--zinc-200);
  background: #fff;
  border-radius: var(--radius-lg);
  transition: all var(--dur-fast) var(--ease);
}
.variant-card:hover { border-color: var(--zinc-300); }
.variant-card.active {
  border-color: var(--blue-300);
  background: var(--blue-50);
  box-shadow: var(--shadow-sm);
}
.variant-card.active::after {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  border: 2px solid var(--blue-500);
  pointer-events: none;
}
.variant-head {
  display: flex; align-items: center; gap: 8px;
}
.variant-head svg { width: 16px; height: 16px; color: var(--zinc-400); }
.variant-card.active .variant-head svg { color: var(--blue-600); }
.variant-head span {
  font-size: 14px; font-weight: 600; color: var(--zinc-600);
}
.variant-card.active .variant-head span { color: var(--blue-700); }
.variant-stats {
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 8px;
}
.variant-profit { font-size: 12px; font-weight: 500; color: var(--emerald-600); }
.variant-profit.neg { color: var(--red-500); }
.variant-sharpe { font-size: 10px; color: var(--zinc-400); }

/* Summary pill */
.summary-pill {
  padding: 16px 20px;
  background: rgba(219,234,254,0.4);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.6;
  color: var(--zinc-600);
  margin-bottom: 24px;
}

/* Metric cards grid */
.metric-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 24px;
}
.metric-card {
  padding: 20px;
  background: #fff; border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg);
}
.metric-card-label {
  margin-bottom: 12px;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--zinc-400);
}
.metric-card-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  font-size: 13px;
}
.metric-item-label { font-size: 11px; color: var(--zinc-400); margin-bottom: 2px; }
.metric-item-value {
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--zinc-800);
}
.metric-item-value.up { color: var(--emerald-600); }
.metric-item-value.down { color: var(--red-500); }
.metric-item-sub { font-size: 11px; color: var(--zinc-400); margin-top: 2px; }
.metric-item-sub.up { color: var(--emerald-500); }
.metric-item-sub.down { color: var(--red-500); }
.metric-item-secondary {
  font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--zinc-800);
}
.metric-item-secondary.down { color: var(--red-500); }

/* Strategies table */
.strategies-card {
  background: #fff; border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 24px;
}
.strategies-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.strategies-table thead tr {
  background: var(--zinc-50);
  border-bottom: 1px solid var(--zinc-100);
}
.strategies-table th {
  padding: 12px 16px; text-align: left;
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--zinc-400);
}
.strategies-table td { padding: 12px 16px; border-bottom: 1px solid rgba(244,244,245,0.8); }
.strategies-table tbody tr:nth-child(even) { background: rgba(250,250,250,0.5); }
.strategies-table tbody tr:last-child td { border-bottom: 0; }
.strategies-table tbody tr.excluded td {
  opacity: 0.35; text-decoration: line-through;
}
.strategy-name {
  max-width: 200px;
  font-weight: 500; color: var(--zinc-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.strategy-cat { font-size: 11px; color: var(--zinc-400); margin-top: 2px; }
.td-right { text-align: right; }
.td-weight { font-weight: 500; color: var(--blue-600);
             font-variant-numeric: tabular-nums;
             white-space: nowrap; }
.td-weight .raw-weight     { color: var(--zinc-400); font-size: 11px; }
.td-weight .arrow          { color: var(--zinc-400); margin: 0 2px; font-size: 11px; }
.td-weight .adapted-weight { color: var(--blue-600); font-weight: 600; }
.td-weight .zero-weight    { color: var(--zinc-400); font-weight: 500; }
.strategies-table tbody tr.zero-row { opacity: 0.55; }
.strategies-table tbody tr.zero-row .strategy-name { color: var(--zinc-500); }
.summary-pill .adapt-hint  { color: var(--zinc-500); font-size: 12px; }
.td-alloc { color: var(--zinc-600); font-variant-numeric: tabular-nums; }
.strategies-table input[type="checkbox"] {
  accent-color: var(--blue-600);
  cursor: pointer;
}

/* Deploy button */
.deploy-btn {
  display: flex; width: 100%;
  align-items: center; justify-content: center; gap: 8px;
  padding: 14px;
  background: var(--blue-600); color: #fff;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--dur-fast) var(--ease);
}
.deploy-btn:hover:not(:disabled) {
  background: var(--blue-500);
  box-shadow: var(--shadow-blue);
}
.deploy-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.deploy-btn svg { width: 16px; height: 16px; }

.confirm-banner {
  margin-top: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(34,211,238,0.08));
  border: 1px solid var(--blue-300);
  border-radius: var(--radius-lg);
}
.confirm-title { font-size: 15px; font-weight: 700; color: var(--blue-700); margin-bottom: 4px; }
.confirm-body  { font-size: 13px; color: var(--zinc-600); line-height: 1.5; margin-bottom: 12px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-yes {
  flex: 1; padding: 11px;
  background: var(--blue-600); color: #fff; font-weight: 600;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--dur-fast) var(--ease);
}
.confirm-yes:hover { background: var(--blue-500); box-shadow: var(--shadow-blue); }
.confirm-yes svg { width: 16px; height: 16px; }
.confirm-no {
  flex: 0 0 auto; padding: 11px 20px;
  background: transparent; color: var(--zinc-600);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-md);
}
.confirm-no:hover { border-color: var(--zinc-300); background: var(--zinc-100); }

/* =========== Performance chart =========== */
.chart-card {
  margin-bottom: 16px;
  padding: 12px 16px 4px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg);
}
.chart-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--zinc-400); margin-bottom: 4px;
}
.chart-container { width: 100%; height: 180px; }

/* =========== Deploy Modal =========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(24, 24, 27, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 180ms var(--ease);
}
/* Critical: `display: flex` above otherwise overrides the browser default
   `[hidden] { display: none }`, making the close buttons appear non-functional. */
.modal-overlay[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  position: relative;
  width: 100%; max-width: 720px;
  max-height: calc(100vh - 40px);
  background: #fff; border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  color: var(--zinc-400);
}
.modal-close:hover { background: var(--zinc-100); color: var(--zinc-600); }
.modal-close svg { width: 16px; height: 16px; }
.modal-header {
  padding: 20px 24px 12px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--zinc-100);
}
.modal-header h2 { font-size: 18px; font-weight: 700; color: var(--zinc-900); }
.modal-header svg { width: 20px; height: 20px; color: var(--blue-600); }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.modal-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--zinc-400); margin: 16px 0 8px;
}
.modal-section-title:first-child { margin-top: 0; }
.modal-meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 8px;
}
.modal-form-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px;
  margin-bottom: 8px;
}
.modal-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.modal-field > span { color: var(--zinc-500); font-size: 11px; }
.modal-field input, .modal-field select {
  padding: 8px 10px;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-md);
  font-size: 13px; color: var(--zinc-800);
  background: #fff;
  font-family: inherit;
}
.modal-field input:focus, .modal-field select:focus {
  outline: none; border-color: var(--blue-300);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.modal-meta-item { font-size: 12px; }
.modal-meta-item .label { color: var(--zinc-400); }
.modal-meta-item .value {
  font-size: 14px; font-weight: 600; color: var(--zinc-800);
  font-variant-numeric: tabular-nums;
}
.modal-strategies {
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--zinc-200); border-radius: var(--radius-md);
}
.modal-strategies table { width: 100%; font-size: 12px; }
.modal-strategies thead tr {
  background: var(--zinc-50); border-bottom: 1px solid var(--zinc-100);
}
.modal-strategies th {
  padding: 8px 12px; text-align: left;
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--zinc-400);
}
.modal-strategies td { padding: 8px 12px; border-bottom: 1px solid var(--zinc-100); }
.modal-strategies tbody tr:last-child td { border-bottom: 0; }
.modal-chart-section { padding-bottom: 12px; }
.modal-chart-container { width: 100%; height: 200px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--zinc-100);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--zinc-50);
}
.modal-cancel {
  padding: 10px 20px; background: transparent;
  border: 1px solid var(--zinc-200); border-radius: var(--radius-md);
  color: var(--zinc-700); font-weight: 500;
}
.modal-cancel:hover { background: var(--zinc-100); border-color: var(--zinc-300); }
.modal-confirm {
  padding: 10px 22px; background: var(--blue-600); color: #fff;
  border-radius: var(--radius-md); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast) var(--ease);
}
.modal-confirm:hover { background: var(--blue-500); box-shadow: var(--shadow-blue); }
.modal-confirm svg { width: 14px; height: 14px; }

/* ============ animations ============ */
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.5; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* ============ responsive ============ */
@media (max-width: 1280px) {
  .chat-column { width: 420px; }
}
@media (max-width: 1100px) {
  .chat-column { width: 380px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .chat-column { width: 340px; }
}
@media (max-width: 720px) {
  .main-body { flex-direction: column; }
  .chat-column { width: 100%; border-right: 0;
                 border-bottom: 1px solid var(--zinc-200); max-height: 50vh; }
}
