/* VibeFarsi Clean Native Document Scroll */
html {
  overflow-y: auto;
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ── Graphite Design System (VibeFarsi Official MCP Tokens) ── */
:root {
  color-scheme: dark;

  /* Official Palette */
  --background: oklch(0.115 0.002 285);
  --foreground: oklch(0.975 0 0);
  --card: oklch(0.14 0.002 285);
  --card-foreground: oklch(0.975 0 0);
  --popover: oklch(0.16 0.002 285);
  --popover-foreground: oklch(0.975 0 0);
  --primary: oklch(0.975 0 0);
  --primary-foreground: oklch(0.13 0 0);
  --secondary: oklch(0.2 0.002 285);
  --secondary-foreground: oklch(0.975 0 0);
  --muted: oklch(0.175 0.002 285);
  --muted-foreground: oklch(0.63 0.004 285);
  --accent: oklch(0.2 0.002 285);
  --accent-foreground: oklch(0.975 0 0);
  --destructive: oklch(0.65 0.2 25);
  --success: oklch(0.75 0.16 160);
  --warning: oklch(0.82 0.16 80);
  --border: oklch(1 0 0 / 8%);
  --input: oklch(1 0 0 / 11%);
  --ring: oklch(0.7 0 0);
  --brand: oklch(0.8 0.165 65);
  --brand-foreground: oklch(0.22 0.06 60);

  /* Design Tokens: 4px Grid, Radius, Line, Depth & Motion */
  --radius: 0.625rem;
  --type-display-weight: 700;
  --shape-control: 10px;
  --shape-field: 10px;
  --shape-surface: 20px;
  --shape-overlay: 14px;
  --line: 1px;
  --line-field: 1px;
  --line-style: solid;
  --depth-control: 0 0 #0000;
  --depth-press: 0 0 #0000;
  --depth-field: 0 0 #0000;
  --depth-surface: 0 1px 0 0 oklch(1 0 0 / 6%) inset;
  --depth-overlay: 0 20px 50px -20px oklch(0 0 0 / 80%);
  --press: scale(0.98);
  --motion: 200ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
  --spacing: 0.25rem;
}

/* Touch targets >= 44px on mobile & buttons */
button, .btn, .btn-action, .fchip, .b-chip, .view-btn, .search-box, .vibe-facet-chip {
  min-height: 38px;
  touch-action: manipulation;
  transition: transform var(--motion) var(--motion-ease), border-color var(--motion), background-color var(--motion);
}
button:active, .btn-action:active, .fchip:active, .b-chip:active {
  transform: var(--press);
}
@media (max-width: 768px) {
  button, .btn, .btn-action, .search-box {
    min-height: 44px;
  }
}

/* Four Dashboard Stats Cards */
.vibe-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.vibe-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--shape-surface);
  box-shadow: var(--depth-surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.vibe-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.vibe-stat-title {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  font-weight: 700;
}
.vibe-stat-delta {
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.vibe-stat-delta.up {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
}
.vibe-stat-delta.down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}
.vibe-stat-val {
  font-size: 1.35rem;
  font-weight: 950;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.vibe-stat-val small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-foreground);
}
.vibe-stat-trend {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
  margin-top: 10px;
  opacity: 0.85;
}
.vibe-stat-trend span {
  flex: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  min-height: 4px;
}
.vibe-stat-trend span.highlight {
  background: var(--brand);
}

/* VibeFarsi Design System Components (Native Vanilla Edition) */

:root {
  --vibe-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --vibe-motion-duration: 240ms;
  --vibe-radius-control: 10px;
  --vibe-radius-card: 16px;
  --vibe-font-sans: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Category Chips ── */
.fchip {
  background: var(--surface-2, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  color: var(--text-muted, #94a3b8);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--vibe-motion-duration) var(--vibe-motion-ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.fchip:hover {
  border-color: #3b82f6;
  color: var(--text, #fff);
}

.fchip.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ── Star / Pin Button ── */
.star-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-dim, #64748b);
  transition: transform 140ms ease, color 140ms ease;
  padding: 4px;
}

.star-btn:hover {
  transform: scale(1.25);
  color: #fbbf24;
}

.star-btn.is-pinned {
  color: #f59e0b !important;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* ── Drag & Drop Zone ── */
.vibe-dropzone {
  border: 2px dashed var(--border, rgba(148, 163, 184, 0.3));
  border-radius: 14px;
  background: var(--surface-2, rgba(255,255,255,0.02));
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 200ms var(--vibe-motion-ease);
  margin: 12px 0;
}

.vibe-dropzone:hover, .vibe-dropzone.dragover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}

.vibe-dropzone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1;
}

.vibe-dropzone-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text, #EAF0FA);
  margin-bottom: 4px;
}

.vibe-dropzone-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

/* ── Smart Bargaining Box ── */
.vibe-bargain-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.vibe-bargain-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.vibe-bargain-content h4 {
  font-size: 0.95rem;
  font-weight: 900;
  color: #34d399;
  margin-bottom: 4px;
}

.vibe-bargain-content p {
  font-size: 0.82rem;
  color: var(--text, #EAF0FA);
  margin: 0;
  line-height: 1.5;
}

/* ── OTP Field Group ── */
.vibe-otp-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.vibe-otp-boxes {
  display: inline-flex;
  gap: 8px;
  direction: ltr !important;
  justify-content: center;
}

.vibe-otp-box {
  width: 46px;
  height: 52px;
  border-radius: var(--vibe-radius-control);
  border: 1.5px solid var(--border, rgba(148, 163, 184, 0.25));
  background: var(--surface, #0f172a);
  color: var(--text, #f8fafc);
  font-family: var(--vibe-font-sans);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all var(--vibe-motion-duration) var(--vibe-motion-ease);
  caret-color: transparent;
  user-select: all;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) inset;
}

.vibe-otp-box:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.vibe-otp-box.filled {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.05);
}

/* ── Odometer Rolling Counter ── */
.vibe-odometer {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  direction: rtl;
}

.vibe-odometer-digits {
  display: inline-flex;
  direction: ltr !important;
  line-height: 1;
  vertical-align: baseline;
}

.vibe-odometer-col {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  vertical-align: baseline;
  line-height: 1;
}

.vibe-odometer-strip {
  display: flex;
  flex-direction: column;
  transition: transform 700ms var(--vibe-motion-ease);
  line-height: 1;
}

.vibe-odometer-strip > span {
  display: block;
  height: 1em;
  line-height: 1;
  text-align: center;
}

.vibe-odometer-sep {
  display: inline-block;
  line-height: 1;
  vertical-align: baseline;
  padding: 0 1px;
}

.vibe-odometer-unit {
  font-size: 0.72em;
  opacity: 0.8;
  margin-inline-start: 4px;
}

/* ── Standard Persian Price Display ── */
.vibe-price {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 800;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.vibe-price-unit {
  font-size: 0.75em;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
}

/* ── Toast Notification ── */
.vibe-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  direction: rtl;
}

.vibe-toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  background: var(--surface, #121D33);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  color: var(--text, #EAF0FA);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  transform: translateY(20px);
  opacity: 0;
  transition: all 260ms var(--vibe-motion-ease);
}

.vibe-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.vibe-toast-success {
  border-right: 4px solid #10b981;
}

.vibe-toast-error {
  border-right: 4px solid #ef4444;
}

.vibe-toast-info {
  border-right: 4px solid #3b82f6;
}

/* ── Command Palette (Cmd+K) ── */
.vibe-cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  direction: rtl;
}

.vibe-cmd-palette {
  background: var(--surface, #121D33);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: vibeCmdIn 180ms var(--vibe-motion-ease);
}

@keyframes vibeCmdIn {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.vibe-cmd-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.16));
  gap: 12px;
}

.vibe-cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text, #EAF0FA);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
}

.vibe-cmd-badge {
  font-size: 0.72rem;
  background: var(--surface-2, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-muted, #94a3b8);
}

.vibe-cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.vibe-cmd-item {
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 120ms;
}

.vibe-cmd-item:hover, .vibe-cmd-item.active {
  background: rgba(59, 130, 246, 0.14);
}

.vibe-cmd-item.active .vibe-cmd-title {
  color: #60a5fa;
}

.vibe-cmd-title {
  font-weight: 700;
  font-size: 0.88rem;
}

.vibe-cmd-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

/* ── Pure SVG Chart / Sparkline ── */
.vibe-chart-wrap {
  background: var(--surface-2, #17233D);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.16));
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  direction: rtl;
}

.vibe-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.vibe-chart-svg {
  width: 100%;
  height: 160px;
  overflow: visible;
}

.vibe-chart-axis-text {
  font-size: 11px;
  fill: var(--text-muted, #94a3b8);
  font-family: inherit;
}

/* ── Facet / Filter Chips ── */
.vibe-facet-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0 14px;
}

.vibe-facet-chip {
  background: var(--surface-2, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  color: var(--text-muted, #94a3b8);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms var(--vibe-motion-ease);
  user-select: none;
}

.vibe-facet-chip:hover {
  border-color: #3b82f6;
  color: var(--text, #fff);
}

.vibe-facet-chip.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Mobile responsive constraints */
@media (max-width: 480px) {
  .vibe-otp-box {
    width: 40px;
    height: 48px;
    font-size: 1.15rem;
    gap: 6px;
  }
  .vibe-toast-container {
    right: 12px;
    left: 12px;
    bottom: 16px;
  }
  .vibe-cmd-overlay {
    padding-top: 20px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ── Market Heartbeat Bar ── */
.vibe-heartbeat-bar {
  background: rgba(16, 185, 129, 0.08);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--text, #EAF0FA);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-wrap: wrap;
}

.vibe-heartbeat-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: vibeBlink 1.4s infinite ease-in-out;
}

@keyframes vibeBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

/* ── Arbitrage Spotlight Card ── */
.vibe-arbitrage-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}

.vibe-arbitrage-badge {
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

/* ── Signal Badges ── */
.vibe-signal {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}

.vibe-signal-floor {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.vibe-signal-demand {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.vibe-signal-bubble {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Inline Miniature Sparkline ── */
.sparkline-mini {
  width: 54px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 6px;
}

/* ── ROI Calculator Box ── */
.vibe-roi-box {
  background: var(--surface, #121D33);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  border-radius: 18px;
  padding: 32px 24px;
  max-width: 820px;
  margin: 40px auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.vibe-range-slider {
  width: 100%;
  max-width: 480px;
  margin: 20px auto;
  accent-color: #2563eb;
  cursor: pointer;
}

.vibe-roi-result {
  font-size: 2.2rem;
  font-weight: 950;
  color: #10b981;
  font-variant-numeric: tabular-nums;
  margin: 10px 0;
}

/* ── Before vs After Workflow Grid ── */
.vibe-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 30px auto;
}

@media (max-width: 768px) {
  .vibe-compare-grid { grid-template-columns: 1fr; }
}

.vibe-compare-card {
  border-radius: 14px;
  padding: 24px 20px;
}

.vibe-compare-before {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.vibe-compare-after {
  background: rgba(16, 185, 129, 0.06);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
}

.vibe-compare-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
  text-align: start;
}

/* ── Phone Mockup Frame ── */
.vibe-phone-mockup {
  width: 290px;
  background: #0f172a;
  border: 8px solid #1e293b;
  border-radius: 36px;
  padding: 18px 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  margin: 0 auto;
  position: relative;
}

.vibe-phone-notch {
  width: 90px;
  height: 14px;
  background: #1e293b;
  border-radius: 0 0 10px 10px;
  margin: 0 auto 12px;
}

@media (prefers-reduced-motion: reduce) {
  .vibe-odometer-strip {
    transition: none !important;
  }
  .vibe-otp-box, .vibe-toast, .vibe-cmd-palette {
    transition: none !important;
    animation: none !important;
  }
}


/* ── Floating Telegram Support Button ── */
.floating-tg-support {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  background: #2563eb;
  color: #fff;
  border-radius: 99px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.floating-tg-support:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
  color: #fff;
}
.floating-tg-support svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
@media (max-width: 768px) {
  .floating-tg-support {
    bottom: 74px;
    left: 14px;
    padding: 8px 14px;
    font-size: 0.78rem;
  }
}


/* DESKTOP HIGH-PERFORMANCE RENDERING OPTIMIZATION */
.m-row, .details-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 54px;
}
.dense-table {
  contain: paint layout style;
}
