:root {
  --bg: #ffffff;
  --ink: #171717;
  --ink-hover: #333333;
  --ink-sub: #525252;
  --ink-mute: #a3a3a3;
  --line: #f0f0f0;
  --line-soft: #f2f2f2;
  --stonebg: #f7f7f7;
  --amber: #d97706;
  --ok: #10b981;
  --bad: #ef4444;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: -0.005em;
}

.font-mono, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.tabular { font-variant-numeric: tabular-nums; }
h1, h2, h3, .tracking-tight-titles { letter-spacing: -0.02em; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-slide-up { animation: fadeSlideUp 0.25s ease-out both; }

@keyframes pop {
  0%   { transform: scale(0.96); opacity: 0; }
  60%  { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.animate-pop { animation: pop 0.2s ease-out both; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.animate-shake { animation: shake 0.4s ease; }

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.animate-slide-in-right { animation: slideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes rowFlash {
  0%   { background-color: rgba(217, 119, 6, 0.14); }
  100% { background-color: transparent; }
}
.row-flash { animation: rowFlash 1.2s ease-out; }

@keyframes breatheOk {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}
.breathe-ok { animation: breatheOk 2s ease-in-out infinite; }

@keyframes rowEnter {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.row-enter { animation: rowEnter 0.3s ease-out both; }

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(23, 23, 23, 0); }
  50%      { box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08); }
}
.glow-pulse { animation: glowPulse 2.4s ease-in-out infinite; }

@keyframes frameBreathe {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 0 rgba(23,23,23,0); }
  50%      { box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 24px 1px rgba(23,23,23,0.04); }
}
.frame-breathe { animation: frameBreathe 4s ease-in-out infinite; }

@keyframes dotBreathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.dot-breathe { animation: dotBreathe 1.8s ease-in-out infinite; }

.stagger-item { opacity: 0; animation: fadeSlideUp 0.3s ease-out forwards; }

.card-hover { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card-hover:hover { transform: translateY(-3px); }

.thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #d1d4d8; border-radius: 3px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

.tab-active { border-bottom: 2px solid var(--ink); }

.avatar-0 { background: #f5f5f5; color: #525252; }
.avatar-1 { background: #ebebeb; color: #4a4a4a; }
.avatar-2 { background: #e0e0e0; color: #404040; }
.avatar-3 { background: #d6d6d6; color: #333333; }
.avatar-4 { background: #ededed; color: #525252; }
.avatar-5 { background: #e4e4e4; color: #444444; }
.avatar-6 { background: #dcdcdc; color: #3a3a3a; }
.avatar-7 { background: #e8e8e8; color: #4e4e4e; }

.empty-state {
  border: 1.5px dashed #d4d4d4;
  background: #fafafa;
  color: var(--ink-mute);
}

.codeblock {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #525252;
  overflow-x: auto;
  position: relative;
}
.codeblock::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #a3a3a3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.codeblock .tok-key { color: #171717; font-weight: 500; }
.codeblock .tok-str { color: #0e7c5e; }
.codeblock .tok-num { color: #c2410c; }
.codeblock .tok-kw  { color: #6b21a8; font-weight: 500; }

.input-focus { transition: border-color 0.15s, box-shadow 0.15s; }
.input-focus:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.06);
}

/* Explicit custom-color utilities (Tailwind CDN doesn't reliably generate bg/border for custom ink colors) */
.bg-ink { background-color: #171717; }
.bg-ink-sub { background-color: #525252; }
.bg-ink-mute { background-color: #a3a3a3; }
.bg-ink-hover:hover { background-color: #333333; }
.hover\:bg-ink-hover:hover { background-color: #333333; }
.border-ink { border-color: #171717; }
.border-ink-sub { border-color: #525252; }
.border-ink-mute { border-color: #a3a3a3; }
.border-t-ink { border-top-color: #171717; }
.border-t-ink-sub { border-top-color: #525252; }
.border-t-ink-mute { border-top-color: #a3a3a3; }
.border-l-ink { border-left-color: #171717; }
.border-l-ink-mute { border-left-color: #a3a3a3; }
.hover\:bg-stonebg:hover { background-color: #f5f5f5; }

/* Small-area semantic colors (amounts, status dots only) */
.text-amount-in { color: #10b981; }
.text-amount-out { color: #ef4444; }
.text-amount-pos { color: #10b981; }
.text-amount-neg { color: #ef4444; }
.bg-status-ok { background-color: #10b981; }
.bg-status-out { background-color: #ef4444; }
.bg-ok { background-color: #10b981; }
.bg-bad { background-color: #ef4444; }
.bg-amber-cta { background-color: #d97706; }
.border-l-ok { border-left-color: #10b981; }
.border-l-bad { border-left-color: #ef4444; }
.border-l-amber-cta { border-left-color: #d97706; }
.hover\:text-bad:hover { color: #ef4444; }