/* ═══════════════════════════════════════════════════════════════
   CryptoTrader Pro — Apex Terminal
   Luxury dark fintech · trading terminal aesthetic
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500;600&display=swap');

:root {
  --bg-void: #060818;
  --bg-base: #0a0d24;
  --bg-elevated: #0f1334;
  --bg-surface: #141938;
  --bg-surface-2: #1a2148;
  --bg-input: #0c102c;
  --bg-hover: #222a58;

  --violet: #6366f1;
  --violet-light: #a5b4fc;
  --violet-dim: #4f46e5;
  --violet-deep: #7c3aed;
  --violet-muted: rgba(99, 102, 241, 0.12);
  --violet-glow: rgba(99, 102, 241, 0.28);

  --accent: var(--violet);
  --accent-dim: var(--violet-dim);
  --accent-muted: var(--violet-muted);
  --accent-glow: var(--violet-glow);

  --green: #3ecf8e;
  --green-muted: rgba(62, 207, 142, 0.12);
  --green-glow: rgba(62, 207, 142, 0.35);
  --red: #ff6b6b;
  --red-muted: rgba(255, 107, 107, 0.12);
  --amber: #f0a030;

  --text-primary: #fafafa;
  --text-secondary: #a8a8ae;
  --text-muted: #7a82b8;
  --text-accent: var(--violet-light);

  --border: rgba(129, 140, 248, 0.08);
  --border-strong: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(129, 140, 248, 0.28);
  --border-gold: var(--border-accent);
  --border-focus: rgba(129, 140, 248, 0.55);

  --shadow-sm: 0 2px 8px rgba(4, 6, 24, 0.45);
  --shadow-md: 0 12px 40px rgba(4, 6, 28, 0.55);
  --shadow-lg: 0 32px 64px rgba(2, 4, 20, 0.7);

  --shadow-accent: 0 8px 32px var(--violet-glow);
  --shadow-gold: var(--shadow-accent);

  --glass: rgba(10, 13, 38, 0.92);
  --glass-border: rgba(129, 140, 248, 0.1);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 240ms;

  --header-h: 48px;
  --nav-h: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --bg-primary: var(--bg-base);
  --bg-secondary: var(--bg-elevated);
  --bg-card: var(--bg-surface);
  --bg-card-elevated: var(--bg-surface-2);
  --glass-bg: var(--glass);
  --surface: var(--bg-surface);
  --text: var(--text-primary);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-void);
}

body {
  font-family: var(--font);
  background: linear-gradient(165deg, var(--bg-void) 0%, var(--bg-base) 42%, #0d1038 100%);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* Ambient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% -20%, rgba(99, 102, 241, 0.18), transparent 58%),
    radial-gradient(ellipse 55% 45% at 100% 40%, rgba(124, 58, 237, 0.12), transparent 52%),
    radial-gradient(ellipse 45% 35% at 0% 85%, rgba(79, 70, 229, 0.1), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

a { color: var(--violet-light); text-decoration: none; }
a:hover { color: var(--violet); }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-inline: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10, 13, 38, 0.96) 0%, rgba(10, 13, 38, 0.65) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__mark {
  width: 32px;
  height: 32px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header__mark::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--violet-light) 0%, var(--violet-dim) 100%);
  opacity: 0.15;
}

.app-header__mark svg {
  width: 18px;
  height: 18px;
  stroke: var(--violet-light);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-header__brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-header__name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-header__tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-light);
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: all 400ms var(--ease);
}

.status-dot--lg {
  width: 8px;
  height: 8px;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 8px var(--green-glow); }
  50% { box-shadow: 0 0 20px var(--green-glow), 0 0 40px rgba(62, 207, 142, 0.15); }
}

/* ── Main ── */
.app-content {
  flex: 1;
  padding-top: calc(var(--header-h) + var(--safe-top) + 4px);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
  overflow-y: auto;
}

.tab-panel {
  display: none;
  padding: 12px 16px 32px;
  animation: panel-in 500ms var(--ease);
}

.tab-panel.active { display: block; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  margin-bottom: 20px;
  padding-inline: 4px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Terminal Hero ── */
.terminal-hero {
  position: relative;
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: var(--bg-surface);
  transition: border-color 600ms var(--ease), box-shadow 600ms var(--ease);
}

.terminal-hero.is-running {
  border-color: rgba(62, 207, 142, 0.35);
  box-shadow: 0 0 60px rgba(62, 207, 142, 0.08), inset 0 1px 0 rgba(62, 207, 142, 0.1);
}

.terminal-hero__mesh {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
    linear-gradient(220deg, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.14), transparent 50%);
  pointer-events: none;
}

.terminal-hero.is-running .terminal-hero__mesh {
  background:
    linear-gradient(160deg, rgba(62, 207, 142, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 20%, rgba(62, 207, 142, 0.08), transparent 50%);
}

.terminal-hero__inner {
  position: relative;
  padding: 22px 20px 20px;
}

.terminal-hero__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.terminal-hero__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.terminal-hero__symbol {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-family: var(--font-mono);
}

.terminal-hero__pair {
  flex: 1;
  min-width: 0;
}

.terminal-hero__symbol-select {
  width: 100%;
  max-width: 220px;
  margin-top: 2px;
  padding: 8px 12px;
}

.markets-network-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 13px;
}

.markets-catalog-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--violet-light, #a5b4fc);
  white-space: nowrap;
}

.markets-selected {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input, #0c102c);
  border: 1px solid var(--border);
}

.markets-selected--inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.markets-selected__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.markets-selected__value {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary, #f1f5f9);
}

.markets-selected--inline .markets-selected__value {
  flex: 1;
  font-size: 15px;
}

.token-search-results--panel {
  position: static;
  max-height: 320px;
  margin-top: 8px;
  box-shadow: none;
}

.token-search-wrap {
  position: relative;
  margin-top: 8px;
}

.token-search-results {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-elevated, #12162a);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.token-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.token-hit:last-child {
  border-bottom: 0;
}

.token-hit:active,
.token-hit:hover {
  background: rgba(99, 102, 241, 0.12);
}

.token-hit__sym {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 13px;
}

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

.token-hit__src {
  margin-left: 6px;
  opacity: 0.7;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.06em;
}
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  background: rgba(12, 15, 42, 0.75);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8ae' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.terminal-hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.bot-status-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

.card--collapsible {
  padding-top: 0;
}

.card--collapsible > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  margin: 0 -18px 0;
}

.card--collapsible > summary::-webkit-details-marker {
  display: none;
}

.card__header--clickable {
  margin-bottom: 0;
}

.card--collapsible[open] > summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.card--collapsible .ai-card__hint,
.card--collapsible .form-group,
.card--collapsible .btn-row,
.card--collapsible .ai-result {
  padding-inline: 0;
}

.card--collapsible .ai-card__hint {
  padding-top: 0;
}

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

.terminal-hero__price-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.terminal-hero__price {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.terminal-hero__price-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.terminal-hero__pnl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.terminal-hero__pnl-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.terminal-hero__pnl-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.terminal-hero__pnl-value.positive,
.metric-value.positive,
.stats-list__value.positive { color: var(--green); -webkit-text-fill-color: var(--green); }
.terminal-hero__pnl-value.negative,
.metric-value.negative,
.stats-list__value.negative { color: var(--red); -webkit-text-fill-color: var(--red); }

.terminal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.terminal-stat {
  background: rgba(12, 15, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.terminal-stat__label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.terminal-stat__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.terminal-stat__value--sm {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
}

.rsi-bar {
  height: 3px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.rsi-bar__fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, var(--green), var(--violet-light));
  border-radius: var(--radius-full);
  transition: width 600ms var(--ease);
}

.terminal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Bottom Nav ── */
.app-nav {
  position: fixed;
  bottom: calc(10px + var(--safe-bottom));
  left: 12px;
  right: 12px;
  height: 68px;
  padding: 0 6px;
  background: rgba(12, 15, 42, 0.94);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.nav-item:active { transform: scale(0.92); }

.nav-item.active {
  color: var(--violet-light);
  background: var(--violet-muted);
}

.nav-item__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 300ms var(--ease-spring);
}

.nav-item.active .nav-item__icon svg { transform: scale(1.08); }

/* ── Cards & Panels ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card--flush { padding: 0; overflow: hidden; }
.card--flush::before { display: none; }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card__title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--violet-muted), transparent);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card__title-icon svg {
  width: 15px;
  height: 15px;
  stroke: var(--violet-light);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__title-text { flex: 1; }

.card__badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-light);
  padding: 4px 8px;
  background: var(--violet-muted);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-gold);
}

/* Metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 80px;
}

.metric-card--wide { grid-column: 1 / -1; }
.metric-card--highlight {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), var(--bg-surface));
  border-color: var(--border-gold);
}

.metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.metric-value.accent,
.stats-list__value.accent { color: var(--violet-light); }

.stats-list { margin: 0 0 16px; }
.stats-list__row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.stats-list__label { font-size: 13px; color: var(--text-secondary); }
.stats-list__value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats-list--compact .stats-list__row { padding: 10px 0; }

/* Balance */
.balance-network {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.balance-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
}

.balance-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 64px;
  transition: border-color var(--duration) var(--ease);
}

.balance-item:hover { border-color: var(--border-strong); }
.balance-item--zero { opacity: 0.45; }

.balance-item__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.balance-item__icon--btc { background: linear-gradient(135deg, #f7931a, #e8850e); }
.balance-item__icon--eth { background: linear-gradient(135deg, #627eea, #4c63d2); }
.balance-item__icon--sol { background: linear-gradient(135deg, #9945ff, #14f195); }
.balance-item__icon--bnb { background: linear-gradient(135deg, #f0b90b, #d4a20a); color: #111; }
.balance-item__icon--matic { background: linear-gradient(135deg, #8247e5, #6b3bc4); }
.balance-item__icon--avax { background: linear-gradient(135deg, #e84142, #c73637); }
.balance-item__icon--usdt { background: linear-gradient(135deg, #26a17b, #1e8a6a); }
.balance-item__icon--usdc { background: linear-gradient(135deg, #2775ca, #1f63ad); }
.balance-item__icon--dai { background: linear-gradient(135deg, #f5ac37, #d4922a); color: #111; }
.balance-item__icon--link { background: linear-gradient(135deg, #2a5ada, #234bb8); }
.balance-item__icon--uni { background: linear-gradient(135deg, #ff007a, #d90066); }
.balance-item__icon--arb { background: linear-gradient(135deg, #28a0f0, #1a8cd4); }
.balance-item__icon--doge { background: linear-gradient(135deg, #c2a633, #a88d28); color: #111; }
.balance-item__icon--busd { background: linear-gradient(135deg, #f0b90b, #d4a20a); color: #111; }
.balance-item__icon--default { background: linear-gradient(135deg, #3f3f46, #27272a); }

.balance-item__body { min-width: 0; flex: 1; }
.balance-item__sym {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.balance-item__amt {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.balance-item__amt.has-balance { color: var(--violet-light); }

@media (min-width: 520px) {
  .balance-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Connect card */
.connect-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  margin-bottom: 16px;
  background: linear-gradient(165deg, rgba(99, 102, 241, 0.12) 0%, var(--bg-surface) 45%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-gold);
  text-align: center;
}

.connect-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: var(--radius-lg);
  background: var(--violet-muted);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.connect-card__icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--violet-light);
  fill: none;
  stroke-width: 1.75;
}

.connect-card__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.connect-card__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.55;
}

.wallet-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.wallet-status__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.wallet-status__dot.connected {
  background: var(--green);
  box-shadow: 0 0 14px var(--green-glow);
}

.wallet-status__text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Power controls */
.power-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.power-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
  min-height: 120px;
}

.power-btn:active:not(:disabled) { transform: scale(0.97); }
.power-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.power-btn__ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-strong);
  transition: all var(--duration) var(--ease);
}

.power-btn__ring svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.power-btn__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.power-btn--start {
  color: var(--violet-light);
  border-color: var(--border-gold);
  background: linear-gradient(180deg, var(--violet-muted), var(--bg-input));
}

.power-btn--start .power-btn__ring {
  border-color: var(--violet);
  background: var(--violet-muted);
  color: var(--violet-light);
}

.power-btn--start:hover:not(:disabled) {
  box-shadow: var(--shadow-accent);
}

.power-btn--stop {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.2);
  background: linear-gradient(180deg, var(--red-muted), var(--bg-input));
}

.power-btn--stop .power-btn__ring {
  border-color: rgba(255, 107, 107, 0.4);
  background: var(--red-muted);
}

/* Forms */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  transition: all var(--duration) var(--ease);
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--violet-muted);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b73' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 88px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-suffix { position: relative; }
.form-suffix .form-input { padding-right: 48px; }
.form-suffix__unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0;
  cursor: pointer;
}

.form-check input { width: 18px; height: 18px; accent-color: var(--violet); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  white-space: nowrap;
  min-height: 48px;
}

.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn--gold {
  background: linear-gradient(135deg, var(--violet-light) 0%, var(--violet) 45%, var(--violet-deep) 100%);
  color: #f8fafc;
  box-shadow: var(--shadow-accent);
}

.btn--gold:hover:not(:disabled) {
  box-shadow: 0 12px 40px var(--violet-glow);
  filter: brightness(1.05);
}

.btn--stop {
  background: var(--red-muted);
  color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

.btn--primary {
  background: linear-gradient(135deg, var(--violet-light), var(--violet-deep));
  color: #f8fafc;
  box-shadow: var(--shadow-accent);
}

.btn--danger {
  background: var(--red-muted);
  color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn--outline:hover:not(:disabled) { background: var(--bg-hover); }

.btn--secondary {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  min-height: 36px;
  padding: 8px 12px;
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn--full { width: 100%; }
.btn--lg { min-height: 52px; font-size: 15px; }
.btn--sm {
  padding: 8px 14px;
  font-size: 12px;
  min-height: 38px;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.btn-row .btn { flex: 1; }

.control-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.data-table th {
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 9px;
  padding: 10px 12px;
  text-align: left;
}

.data-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.data-table .buy { color: var(--green); font-weight: 600; }
.data-table .sell { color: var(--red); font-weight: 600; }
.data-table .pnl-pos { color: var(--green); }
.data-table .pnl-neg { color: var(--red); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.visible { display: flex; animation: fade-in 250ms var(--ease); }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 400ms var(--ease);
}

.modal__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  text-align: center;
}

.modal__text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.65;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toasts */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 12px);
  left: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 350ms var(--ease);
}

.toast--success { border-left: 3px solid var(--green); }
.toast--error { border-left: 3px solid var(--red); }
.toast--info { border-left: 3px solid var(--violet); }

.toast.removing { animation: toast-out 300ms var(--ease) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-10px); }
}

/* Info banners */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.info-banner--ok {
  border-color: rgba(62, 207, 142, 0.25);
  background: var(--green-muted);
}

.info-banner--warn {
  border-color: rgba(240, 160, 48, 0.25);
  background: rgba(240, 160, 48, 0.08);
}

/* Settings */
.settings-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.settings-kv:last-of-type { border-bottom: none; }
.settings-kv__label { color: var(--text-muted); }
.settings-kv__value { color: var(--text-primary); font-weight: 500; text-align: right; }
.settings-kv__mono { font-family: var(--font-mono); font-size: 11px; }

.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.settings-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin: 24px 0 10px;
  padding-left: 4px;
}

.settings-section-label:first-of-type { margin-top: 8px; }

.wc-frame {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  min-height: 420px;
}

.wc-fallback { margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.wc-fallback summary {
  cursor: pointer;
  padding: 10px 0;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Charts */
.chart-container {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  height: 200px;
  position: relative;
  overflow: hidden;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-panel {
  padding: 16px;
}

.chart-panel .chart-container {
  border: none;
  background: transparent;
  margin: 0;
}

/* Spinner & badges */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge--live,
.status-chip.badge--live {
  background: var(--green-muted);
  color: var(--green);
  border: 1px solid rgba(62, 207, 142, 0.3);
}

.badge--paper {
  background: rgba(240, 160, 48, 0.12);
  color: var(--amber);
  border: 1px solid rgba(240, 160, 48, 0.3);
}

.badge--stopped,
.status-chip.badge--stopped {
  background: rgba(107, 107, 115, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.orders-box {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  line-height: 1.6;
}

/* Install */
.install-banner {
  display: none;
  background: linear-gradient(135deg, var(--violet-light), var(--violet-deep));
  color: #f8fafc;
  padding: 12px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.install-banner.visible { display: block; }

.install-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 24, 0.9);
  backdrop-filter: blur(12px);
}

.install-modal.hidden { display: none !important; }

.install-modal__card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  animation: modal-in 400ms var(--ease);
}

.install-modal__icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  margin: 0 auto 16px;
}

.install-modal__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.install-modal__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.install-modal__section { text-align: left; margin-bottom: 16px; }
.install-modal__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 8px;
}

.install-modal__steps {
  list-style: decimal;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.install-modal__skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px;
  cursor: pointer;
  width: 100%;
}

/* Responsive */
@media (min-width: 768px) {
  .app-content { max-width: 520px; margin: 0 auto; }
  .app-nav {
    max-width: 460px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (display-mode: standalone) {
  .install-banner,
  .install-modal { display: none !important; }
}

/* Assistant IA — chat conversationnel */
.ai-chat-card {
  padding-bottom: 14px;
}

.ai-chat-card__avatar {
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
}

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 12px 2px;
  margin-bottom: 12px;
}

.ai-chat__row {
  display: flex;
}

.ai-chat__row--user {
  justify-content: flex-end;
}

.ai-chat__row--assistant {
  justify-content: flex-start;
}

.ai-chat__bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.ai-chat__bubble--bot,
.ai-chat__bubble--assistant {
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.22);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.ai-chat__bubble--user {
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.25);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.ai-chat__bubble--system {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
}

.ai-chat__bubble--typing {
  padding: 14px 18px;
}

.ai-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-light);
  animation: ai-typing 1.2s infinite ease-in-out;
}

.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-typing {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.ai-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-quick-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.ai-quick-chip:active {
  border-color: var(--violet-light);
  color: var(--violet-light);
}

.ai-chat-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-chat-input {
  min-height: 56px;
  resize: none;
  margin: 0;
}

.ai-chat-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.ai-config-preview {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.ai-config-preview__sub {
  color: var(--text-muted);
  font-size: 12px;
}

.ai-chat__bubble--error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.preset-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.preset-row__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.preset-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-chip {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.preset-chip:active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
}
.ai-card__hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.55;
}
.ai-instruction {
  min-height: 72px;
  resize: vertical;
}
.ai-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.ai-result--error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.card__badge--ok {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.fade-in { animation: fade-in 300ms var(--ease); }
.slide-up { animation: panel-in 300ms var(--ease); }
