/* ─────────────────────────────────────────────────────────────
   FELIS — design tokens
   Modern crypto-trading dark, violet+cyan accents.
   ───────────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-0: #07070d;          /* deepest */
  --bg-1: #0c0c16;          /* page */
  --bg-2: #11111d;          /* panel */
  --bg-3: #181826;          /* raised */
  --bg-4: #20202f;          /* hover */
  --bg-inset: #050509;      /* inset / well */

  /* Borders */
  --line-1: rgba(255,255,255,0.04);
  --line-2: rgba(255,255,255,0.07);
  --line-3: rgba(255,255,255,0.12);

  /* Text */
  --t0: #f2f2f8;
  --t1: #b6b6c8;
  --t2: #6e6e85;
  --t3: #444459;
  --t4: #2a2a3a;

  /* Brand / accents */
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --violet-soft: rgba(139, 92, 246, 0.14);
  --violet-line: rgba(139, 92, 246, 0.35);

  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.13);

  --green: #2ce896;
  --green-soft: rgba(44, 232, 150, 0.12);
  --green-line: rgba(44, 232, 150, 0.35);

  --red: #ff4d6a;
  --red-soft: rgba(255, 77, 106, 0.13);
  --red-line: rgba(255, 77, 106, 0.35);

  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.13);

  --pink: #ec4899;

  /* Type */
  --f-sans: 'Geist', 'Geist Sans', -apple-system, 'SF Pro Display', system-ui, sans-serif;
  --f-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Radii */
  --r-sm: 4px;
  --r: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Shadows */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 0 0 1px var(--line-2);
  --shadow-pop: 0 12px 32px rgba(0,0,0,0.45), 0 0 0 1px var(--line-3);
  --glow-violet: 0 0 32px -8px rgba(139,92,246,0.6);
}

/* Phase color map — used by .ph-* helpers */
.ph-ALT_GROWTH_LINEAR    { --ph: var(--green); --ph-soft: var(--green-soft); --ph-line: var(--green-line); }
.ph-ALT_GROWTH_PARABOLIC { --ph: #5fffaa; --ph-soft: rgba(95,255,170,0.14); --ph-line: rgba(95,255,170,0.4); }
.ph-ZERO_PHASE           { --ph: var(--cyan); --ph-soft: var(--cyan-soft); --ph-line: rgba(34,211,238,0.35); }
.ph-DUMP_SHALLOW         { --ph: var(--amber); --ph-soft: var(--amber-soft); --ph-line: rgba(255,181,71,0.35); }
.ph-DUMP_DEEP            { --ph: var(--red); --ph-soft: var(--red-soft); --ph-line: var(--red-line); }
.ph-BTC_SOLO             { --ph: #ffb13a; --ph-soft: rgba(255,177,58,0.14); --ph-line: rgba(255,177,58,0.4); }
.ph-FLAT                 { --ph: #8e8fb8; --ph-soft: rgba(142,143,184,0.14); --ph-line: rgba(142,143,184,0.35); }
.ph-UNKNOWN              { --ph: #555670; --ph-soft: rgba(85,86,112,0.14); --ph-line: rgba(85,86,112,0.4); }

/* Base */
.felis {
  font-family: var(--f-sans);
  color: var(--t0);
  background: var(--bg-1);
  font-feature-settings: 'cv11','ss03','ss01';
  letter-spacing: -0.005em;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
}
.felis *, .felis *::before, .felis *::after { box-sizing: border-box; }
.felis .mono { font-family: var(--f-mono); font-feature-settings: 'zero','ss01'; letter-spacing: -0.01em; }
.felis .tnum { font-variant-numeric: tabular-nums; }
.felis .pos { color: var(--green); }
.felis .neg { color: var(--red); }
.felis .muted { color: var(--t1); }
.felis .dim { color: var(--t2); }
.felis .faint { color: var(--t3); }
.felis hr { border: 0; border-top: 1px solid var(--line-1); margin: 0; }

/* Tiny scroll */
.felis .scroll { overflow: auto; }
.felis .scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.felis .scroll::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 6px; }
.felis .scroll::-webkit-scrollbar-track { background: transparent; }

/* Panel — reused box */
.felis .panel {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  position: relative;
}
.felis .panel-inset {
  background: var(--bg-inset);
  border: 1px solid var(--line-1);
  border-radius: var(--r);
}

.felis .panel-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-1);
}
.felis .panel-hd .ttl {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t1);
  font-weight: 500;
}
.felis .panel-bd { padding: 14px; }
.felis .panel-bd.tight { padding: 10px; }
.felis .panel-bd.flush { padding: 0; }

/* Tags / chips */
.felis .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 7px 3px;
  border-radius: var(--r-sm);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-3);
  color: var(--t1);
  border: 1px solid var(--line-2);
  line-height: 1;
  font-family: var(--f-mono);
}
.felis .tag.solid { background: var(--violet); color: white; border-color: transparent; }
.felis .tag.ph { background: var(--ph-soft); color: var(--ph); border-color: var(--ph-line); }
.felis .tag.pos { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.felis .tag.neg { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.felis .tag.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(255,181,71,0.35); }
.felis .tag.dot::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

/* Buttons */
.felis .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: var(--r);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--t0);
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.felis .btn:hover { background: var(--bg-4); border-color: var(--line-3); }
.felis .btn.primary { background: var(--violet); border-color: var(--violet); color: white; }
.felis .btn.primary:hover { background: var(--violet-2); border-color: var(--violet-2); }
.felis .btn.ghost { background: transparent; }
.felis .btn.danger { background: var(--red); border-color: var(--red); color: white; }
.felis .btn.lg { height: 36px; padding: 0 16px; font-size: 13px; }
.felis .btn.sm { height: 24px; padding: 0 9px; font-size: 11px; }
.felis .btn.icon { padding: 0; width: 28px; }

/* Form */
.felis .input, .felis .select, .felis .textarea {
  background: var(--bg-inset);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  color: var(--t0);
  font-family: var(--f-sans);
  font-size: 12px;
  padding: 6px 10px;
  width: 100%;
}
.felis .input:focus, .felis .select:focus, .felis .textarea:focus {
  outline: none;
  border-color: var(--violet-line);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.felis .textarea { font-family: var(--f-mono); font-size: 11.5px; line-height: 1.55; resize: none; }
.felis .kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 3px; background: var(--bg-3); border: 1px solid var(--line-2);
  font-family: var(--f-mono); font-size: 10px; color: var(--t1);
}

/* Grids of stats */
.felis .row { display: flex; }
.felis .grid { display: grid; gap: 1px; background: var(--line-1); }

/* Phase tile */
.felis .tile-soft {
  background: var(--ph-soft);
  border: 1px solid var(--ph-line);
  color: var(--ph);
  border-radius: var(--r-md);
}

/* Heatmap cell ramp — used inline */
.felis .hm {
  display: block; border-radius: 3px;
  width: 100%; height: 100%;
}

/* Subtle dotted grid bg for charts */
.felis .chart-grid {
  background-image:
    linear-gradient(var(--line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-1) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

/* Pulse dot */
@keyframes felisPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 6px transparent; opacity: 0.55; }
}
.felis .pulse {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; animation: felisPulse 2s ease-in-out infinite;
}

/* Decision-log row hover */
.felis .row-hover:hover { background: var(--bg-3); }

/* Sidebar — wider with labels */
.felis .side {
  width: 220px;
  background: var(--bg-0);
  border-right: 1px solid var(--line-1);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  flex: 0 0 220px;
  gap: 2px;
}
.felis .side .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line-1);
  text-decoration: none;
}
.felis .side .brand .wm {
  font-weight: 600; font-size: 14px; letter-spacing: 0.1em; color: var(--t0);
}
.felis .side .nav-group-title {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--t3); padding: 12px 12px 6px; font-weight: 500;
}
.felis .side .nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 30px; padding: 0 10px;
  border-radius: 6px;
  color: var(--t1);
  cursor: pointer; text-decoration: none;
  font-size: 12.5px; font-weight: 500;
  transition: background .12s, color .12s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.felis .side .nav-item:hover { background: var(--bg-3); color: var(--t0); }
.felis .side .nav-item.active { background: var(--violet-soft); color: var(--violet-2); }
.felis .side .nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px;
  background: var(--violet); border-radius: 2px;
}
.felis .side .nav-item .ic { display: flex; flex: 0 0 18px; opacity: 0.85; }
.felis .side .nav-item .badge {
  margin-left: auto; font-family: var(--f-mono); font-size: 10px;
  background: var(--bg-3); color: var(--t1); padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--line-2);
}
.felis .side .nav-item.active .badge { background: var(--violet); color: white; border-color: var(--violet); }
.felis .side .side-foot {
  margin-top: auto; padding: 10px;
  border-top: 1px solid var(--line-1);
  display: flex; align-items: center; gap: 10px;
}
.felis .side .side-foot .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; font-weight: 600;
}

/* Topbar */
.felis .topbar {
  height: 48px;
  border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 16px;
  background: var(--bg-1);
  flex: 0 0 48px;
}

/* Page-title styling */
.felis h1.page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--t0);
}

/* Number stack */
.felis .stat-big {
  font-family: var(--f-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--t0);
  line-height: 1.1;
}
.felis .stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t2);
  font-weight: 500;
}

/* Live-pulse highlight for tickers */
@keyframes pulseUp { 0% { background: var(--green-soft); } 100% { background: transparent; } }
@keyframes pulseDn { 0% { background: var(--red-soft); } 100% { background: transparent; } }
.felis .pulse-up { animation: pulseUp .6s ease-out; }
.felis .pulse-dn { animation: pulseDn .6s ease-out; }
