Skip to content

"Vibe-Trading: Your Personal Trading Agent"

6.4 KB
Raw Blame
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Light mode surfaces */
    --background: 38 24% 97%;
    --foreground: 28 18% 14%;
    --card: 40 30% 99%;
    --card-foreground: 28 18% 14%;

    /* Popover: a slightly elevated surface used for floating menus,
       tooltips, and the language switcher dropdown. Falls back to a
       solid white (light) or surface-1 (dark) so dropdowns never
       appear transparent and let underlying content bleed through. */
    --popover: 40 30% 99%;
    --popover-foreground: 28 18% 14%;

    /* Brand accent */
    --primary: 24 45% 38%;
    --primary-foreground: 0 0% 100%;

    --muted: 36 16% 92%;
    --muted-foreground: 28 10% 46%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --border: 32 16% 85%;
    --radius: 0.5rem;

    /* Semantic colors */
    --success: 142 71% 45%;
    --danger: 0 84% 60%;
    --warning: 38 92% 50%;
    --info: 217 91% 60%;

    /* Chart tokens */
    --chart-grid: 32 16% 89%;
    --chart-text: 28 10% 46%;
    --chart-axis: 32 16% 79%;
    --chart-compare-a: #3b82f6;
    --chart-compare-b: #f59e0b;
  }

  .dark {
    /* Dark mode: 4-level surface system. Keep >=5 lightness points between
       adjacent surfaces — smaller deltas are indistinguishable on most
       panels (sidebar vs main blended at 5%/8%). */
    --background: 28 16% 6%;       /* bg-base */
    --foreground: 32 20% 93%;
    --card: 28 15% 11%;            /* surface-1 */
    --card-foreground: 32 20% 93%;

    --popover: 28 15% 13%;         /* surface-1.5 (slightly lighter than card) */
    --popover-foreground: 32 20% 93%;

    --primary: 28 52% 65%;
    /* Dark ink, not white: white on this light umber measures 2.3:1, below
       the 3:1 floor for a control; this ink measures 7.7:1. */
    --primary-foreground: 28 30% 10%;

    --muted: 28 14% 17%;           /* surface-2 */
    --muted-foreground: 32 12% 64%;
    --destructive: 0 62% 50%;
    --destructive-foreground: 0 0% 100%;
    --border: 28 12% 25%;          /* surface-3 */

    /* Semantic colors */
    --success: 142 71% 45%;
    --danger: 0 62% 50%;
    --warning: 38 92% 50%;
    --info: 217 91% 60%;

    /* Chart tokens */
    --chart-grid: 28 16% 15%;
    --chart-text: 32 12% 55%;
    --chart-axis: 28 16% 27%;
    --chart-compare-a: #60a5fa;
    --chart-compare-b: #fbbf24;
  }

  * { @apply border-border; }
  body { @apply bg-background text-foreground; }

  /* Prose table enhancements */
  .prose table { border-collapse: collapse; width: 100%; }
  .prose th, .prose td { border: 1px solid hsl(var(--border)); }
  .prose tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.3); }

  /* Smooth scrollbar for webkit */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground)); }
}

/* Streaming pulse-slide animation for the "running" bar */
@keyframes pulse-slide {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(200%); }
  100% { transform: translateX(-100%); }
}

.chat-scroll-container[data-streaming="true"] {
  overflow-anchor: none;
}

.katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Lightweight office sprites used by the native Pixel Office management view. */
.pixel-office-floor {
  background-color: hsl(var(--card));
  background-image:
    linear-gradient(hsl(var(--border) / 0.22) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
}
.pixel-desk {
  background: hsl(var(--background) / 0.82);
  box-shadow: inset 0 -10px 0 hsl(var(--muted) / 0.32);
}
.pixel-character {
  position: relative;
  width: 66px;
  height: 70px;
  image-rendering: pixelated;
}
.pixel-character__shadow {
  position: absolute;
  left: 8px;
  bottom: 3px;
  width: 48px;
  height: 8px;
  background: hsl(var(--foreground) / 0.14);
  border-radius: 50%;
}
.pixel-character__body {
  position: absolute;
  left: 16px;
  top: 6px;
  width: 34px;
  height: 55px;
  filter: drop-shadow(2px 3px 0 hsl(var(--foreground) / 0.2));
}
.pixel-character__head {
  position: absolute;
  left: 6px;
  top: 0;
  width: 24px;
  height: 24px;
  background: #f1b48b;
  box-shadow: 0 -5px 0 #3b2a24, 5px -5px 0 #3b2a24, 10px -5px 0 #3b2a24, 0 5px 0 #f1b48b, 24px 5px 0 #f1b48b;
}
.pixel-character__torso {
  position: absolute;
  left: 5px;
  top: 29px;
  width: 25px;
  height: 20px;
  background: var(--pixel-color);
}
.pixel-character__arm,
.pixel-character__leg {
  position: absolute;
  width: 7px;
  background: var(--pixel-color);
}
.pixel-character__arm { top: 30px; height: 18px; }
.pixel-character__arm--left { left: 0; }
.pixel-character__arm--right { right: 0; }
.pixel-character__leg { top: 49px; height: 12px; background: #334155; }
.pixel-character__leg--left { left: 7px; }
.pixel-character__leg--right { right: 7px; }
.pixel-character__typing {
  position: absolute;
  right: 0;
  top: 2px;
  color: var(--pixel-color);
  font-weight: 800;
  letter-spacing: 1px;
  animation: pixel-typing 900ms steps(2, end) infinite;
}
@keyframes pixel-typing {
  0%, 100% { opacity: 0.25; transform: translateY(2px); }
  50% { opacity: 1; transform: translateY(0); }
}

/* Message/hero entrance — one subtle rise per mount; removed under reduced motion */
@keyframes msg-enter {
  from { opacity: 0; transform: translateY(10px); }
}
.msg-enter { animation: msg-enter 300ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .msg-enter { animation: none; }
}

/* RTL: mirror directional icons (chevrons, arrows) automatically */
[dir="rtl"] .rtl\:flip-x { transform: scaleX(-1); }

/* ===== Bidi/RTL support for chat content =====
   Each markdown block auto-detects its own base direction (first-strong,
   like Telegram) instead of inheriting the LTR document direction.
   Unlayered on purpose: unlayered author rules win over @layer utilities,
   so these override prose-* / Tailwind alignment classes. */
.vt-bidi :is(p, li, h1, h2, h3, h4, h5, h6, blockquote, td, th, figcaption, dd, dt) {
  unicode-bidi: plaintext;
  text-align: start;
}
.vt-bidi table {
  unicode-bidi: plaintext;
}
.vt-bidi pre {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
.vt-bidi :not(pre) > code {
  direction: ltr;
  unicode-bidi: isolate;
}
.vt-bidi .katex,
.vt-bidi .katex * {
  direction: ltr;
}