:root {
  --mobile-tap-target: 44px;
  --mobile-padding: 16px;
  --mobile-gap: 12px;
  --mobile-header-height: 48px;
  --mobile-nav-height: 56px;
  --mobile-safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

@media screen and (max-width: 768px) {
  html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    overscroll-behavior: none;
    touch-action: pan-y;
  }

  .mobile-hidden {
    display: none !important;
  }

  .mobile-visible {
    display: block !important;
  }

  .touch-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
  }

  .no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
         user-select: none;
  }
}

@media screen and (min-width: 769px) {
  .desktop-hidden {
    display: none !important;
  }
}

@media screen and (max-width: 480px) {
  :root {
    --mobile-padding: 12px;
    --mobile-gap: 8px;
  }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
  .mobile-landscape-compact {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  
  .mobile-landscape-compact .mobile-header {
    height: 36px;
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .touch-only {
    display: block;
  }
  
  .hover-only {
    display: none;
  }
  
  button, 
  [role="button"],
  input[type="submit"],
  input[type="button"] {
    min-height: var(--mobile-tap-target);
    min-width: var(--mobile-tap-target);
  }
  
  a {
    min-height: var(--mobile-tap-target);
    display: inline-flex;
    align-items: center;
  }
}

@media (hover: hover) and (pointer: fine) {
  .touch-only {
    display: none;
  }
  
  .hover-only {
    display: block;
  }
}

.mobile-btn {
  min-height: var(--mobile-tap-target);
  min-width: var(--mobile-tap-target);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.mobile-btn:active {
  transform: scale(0.96);
}

.mobile-btn-primary {
  background-color: var(--color-green);
  color: var(--color-bg);
}

.mobile-btn-secondary {
  background-color: transparent;
  border: 1px solid var(--color-borderA);
  color: var(--color-text);
}

.mobile-input {
  width: 100%;
  min-height: var(--mobile-tap-target);
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid var(--color-borderA);
  background-color: var(--color-bg);
  color: var(--color-white);
}

.mobile-input:focus {
  outline: none;
  border-color: var(--color-green);
}

.mobile-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background-color: var(--color-bg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-panel.active {
  transform: translateX(0);
}

.mobile-panel-header {
  position: sticky;
  top: 0;
  height: var(--mobile-header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--mobile-padding);
  background-color: var(--color-panelH);
  border-bottom: 1px solid var(--color-border);
  z-index: 10;
}

.mobile-panel-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--mobile-padding);
  padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-area-bottom) + var(--mobile-padding));
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--mobile-nav-height) + var(--mobile-safe-area-bottom));
  padding-bottom: var(--mobile-safe-area-bottom);
  background-color: var(--color-panelH);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  min-height: var(--mobile-tap-target);
  color: var(--color-dim);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.mobile-nav-item.active {
  color: var(--color-green);
}

.mobile-nav-item:active {
  background-color: var(--color-greenBg);
}

.mobile-nav-icon {
  font-size: 20px;
  line-height: 1;
}

.pull-to-refresh {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  transition: transform 0.2s ease;
}

.pull-to-refresh.visible {
  transform: translateX(-50%) translateY(60px);
}

.pull-to-refresh.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: translateX(-50%) translateY(60px) rotate(0deg); }
  to { transform: translateX(-50%) translateY(60px) rotate(360deg); }
}

.swipe-indicator {
  position: absolute;
  bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-area-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.swipe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-muted);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.swipe-dot.active {
  background-color: var(--color-green);
  transform: scale(1.3);
}

.mobile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  background-color: var(--color-panel);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
  overflow: hidden;
}

.mobile-drawer.open {
  transform: translateY(0);
}

.mobile-drawer-handle {
  width: 36px;
  height: 4px;
  background-color: var(--color-borderA);
  border-radius: 2px;
  margin: 8px auto;
}

.mobile-drawer-content {
  max-height: calc(80vh - 20px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 55;
}

.mobile-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.mobile-context-menu {
  position: fixed;
  background-color: var(--color-panelH);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 160px;
  z-index: 70;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.mobile-context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: var(--mobile-tap-target);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
}

.mobile-context-menu-item:active {
  background-color: var(--color-greenBg);
}

.mobile-context-menu-item.danger {
  color: var(--color-red);
}

@media screen and (max-width: 768px) {
  .responsive-grid {
    display: flex;
    flex-direction: column;
    gap: var(--mobile-gap);
  }

  .responsive-grid > * {
    width: 100% !important;
  }

  .responsive-hide-sidebar {
    display: none !important;
  }

  .responsive-stack {
    flex-direction: column !important;
  }

  .responsive-full-width {
    width: 100% !important;
    max-width: 100% !important;
  }

  .responsive-text-sm {
    font-size: 12px !important;
  }

  .responsive-p-compact {
    padding: var(--mobile-padding) !important;
  }

  .responsive-gap-sm {
    gap: 8px !important;
  }

  .mobile-flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--mobile-gap);
  }

  .mobile-flex-col {
    display: flex;
    flex-direction: column;
    gap: var(--mobile-gap);
  }

  .mobile-justify-between {
    justify-content: space-between;
  }

  .mobile-items-center {
    align-items: center;
  }

  .mobile-overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-overflow-x-auto::-webkit-scrollbar {
    display: none;
  }

  .mobile-snap-x {
    scroll-snap-type: x mandatory;
  }

  .mobile-snap-center {
    scroll-snap-align: center;
  }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
  .mobile-portrait-col {
    flex-direction: column !important;
  }

  .mobile-portrait-full {
    width: 100% !important;
    height: auto !important;
  }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
  .mobile-landscape-row {
    flex-direction: row !important;
  }

  .mobile-landscape-half {
    width: 50% !important;
  }

  .mobile-landscape-compact-header {
    height: 36px !important;
    padding: 0 8px !important;
  }
}

.virtual-keyboard-active {
  position: fixed;
  bottom: 0;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .mobile-panel-content {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + var(--mobile-padding));
  }
}

.widget-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.widget-table-container::-webkit-scrollbar {
  display: none;
}

.widget-select {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-borderA);
  color: var(--color-text);
  cursor: pointer;
  touch-action: manipulation;
}

.widget-button {
  min-height: 32px;
  min-width: 32px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.widget-button:active {
  transform: scale(0.96);
}

.widget-input {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-borderA);
  color: var(--color-white);
  outline: none;
}

.widget-input:focus {
  border-color: var(--color-green);
}

.widget-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

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

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

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

@media screen and (max-width: 768px) {
  .widget-select {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .widget-button {
    min-height: 40px;
    min-width: 40px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .widget-input {
    min-height: 40px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .widget-filter-row {
    padding: 12px;
    gap: 10px;
  }

  .widget-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .widget-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .widget-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .widget-grid-2,
  .widget-grid-3,
  .widget-grid-4 {
    grid-template-columns: 1fr;
  }
}
/* ══════════════════════════════════════════════════════════════════════════════
   Global Search / Command Palette
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.gs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: gs-fade-in 0.12s ease-out;
}

@keyframes gs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal ── */
.gs-modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--dt-bg-secondary, #141820);
  border: 1px solid var(--dt-border-secondary, #2a3346);
  border-radius: var(--dt-radius-xl, 12px);
  box-shadow: var(--dt-shadow-xl, 0 20px 40px rgba(0,0,0,0.6));
  overflow: hidden;
  animation: gs-slide-in 0.15s ease-out;
}

@keyframes gs-slide-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Input area ── */
.gs-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--dt-space-3, 12px);
  padding: var(--dt-space-3, 12px) var(--dt-space-4, 16px);
  border-bottom: 1px solid var(--dt-border-primary, #1e2536);
}

.gs-input {
  flex: 1;
  height: 32px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--dt-text-primary, #e2e8f0);
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-md, 14px);
  caret-color: var(--dt-accent-blue, #3b82f6);
}

.gs-input::-moz-placeholder {
  color: var(--dt-text-disabled, #475569);
}

.gs-input::placeholder {
  color: var(--dt-text-disabled, #475569);
}

.gs-kbd {
  padding: 2px 6px;
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-xs, 11px);
  color: var(--dt-text-tertiary, #64748b);
  background: var(--dt-bg-tertiary, #1a1f2e);
  border: 1px solid var(--dt-border-primary, #1e2536);
  border-radius: var(--dt-radius-sm, 4px);
  line-height: 1;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* ── Results area ── */
.gs-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--dt-space-2, 8px) 0;
}

.gs-results::-webkit-scrollbar {
  width: 4px;
}

.gs-results::-webkit-scrollbar-thumb {
  background: var(--dt-border-secondary, #2a3346);
  border-radius: 2px;
}

.gs-empty {
  padding: 24px 16px;
  text-align: center;
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-sm, 12px);
  color: var(--dt-text-tertiary, #64748b);
}

/* ── Section ── */
.gs-section {
  margin-bottom: var(--dt-space-1, 4px);
}

.gs-section-label {
  padding: var(--dt-space-2, 8px) var(--dt-space-4, 16px) var(--dt-space-1, 4px);
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-xs, 11px);
  font-weight: 600;
  color: var(--dt-text-tertiary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Result item ── */
.gs-item {
  display: flex;
  align-items: center;
  gap: var(--dt-space-3, 12px);
  width: 100%;
  padding: var(--dt-space-2, 8px) var(--dt-space-4, 16px);
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.08s ease;
  text-align: left;
}

.gs-item:hover,
.gs-item--active {
  background: var(--dt-bg-hover, #1e2536);
}

.gs-item__symbol {
  font-family: var(--dt-font-mono);
  font-size: var(--dt-font-size-sm, 12px);
  font-weight: 600;
  color: var(--dt-text-primary, #e2e8f0);
  min-width: 80px;
}

.gs-item__name {
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-sm, 12px);
  color: var(--dt-text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-item__meta {
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-xs, 11px);
  color: var(--dt-text-tertiary, #64748b);
  margin-left: auto;
  flex-shrink: 0;
}

.gs-item__badge {
  font-family: var(--dt-font-sans);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--dt-radius-sm, 4px);
  flex-shrink: 0;
}

.gs-item__label {
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-sm, 12px);
  color: var(--dt-text-primary, #e2e8f0);
}

/* ── Footer ── */
.gs-footer {
  display: flex;
  align-items: center;
  gap: var(--dt-space-4, 16px);
  padding: var(--dt-space-2, 8px) var(--dt-space-4, 16px);
  border-top: 1px solid var(--dt-border-primary, #1e2536);
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-xs, 11px);
  color: var(--dt-text-tertiary, #64748b);
}

.gs-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 3px;
  font-family: var(--dt-font-sans);
  font-size: 10px;
  color: var(--dt-text-secondary, #94a3b8);
  background: var(--dt-bg-tertiary, #1a1f2e);
  border: 1px solid var(--dt-border-primary, #1e2536);
  border-radius: 3px;
  line-height: 1.3;
}
/* ══════════════════════════════════════════════════════════════════════════════
   Design System for dibsTERMINAL
   Dense, data-rich financial analytics dashboard aesthetic
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Color Palette ── */
  /* Backgrounds */
  --dt-bg-primary: #000000;
  --dt-bg-secondary: #0a0a0a;
  --dt-bg-tertiary: #141414;
  --dt-bg-hover: #1a1a1a;
  --dt-bg-active: #222222;
  --dt-bg-input: #050505;

  /* Borders */
  --dt-border-primary: #1f1f1f;
  --dt-border-secondary: #2a2a2a;
  --dt-border-focus: #3b82f6;

  /* Text */
  --dt-text-primary: #f0f0f0;
  --dt-text-secondary: #a0a0a0;
  --dt-text-tertiary: #6b6b6b;
  --dt-text-disabled: #4a4a4a;

  /* Accent colors */
  --dt-accent-blue: #3b82f6;
  --dt-accent-blue-hover: #2563eb;
  --dt-accent-green: #22c55e;
  --dt-accent-red: #ef4444;
  --dt-accent-yellow: #eab308;
  --dt-accent-orange: #f97316;
  --dt-accent-purple: #8b5cf6;
  --dt-accent-cyan: #06b6d4;

  /* Financial colors */
  --dt-positive: #22c55e;
  --dt-negative: #ef4444;
  --dt-neutral: #a0a0a0;
  --dt-unchanged: #6b6b6b;

  /* Color groups (for widget linking) */
  --dt-group-1: #3b82f6;
  --dt-group-2: #22c55e;
  --dt-group-3: #f97316;
  --dt-group-4: #8b5cf6;
  --dt-group-5: #06b6d4;
  --dt-group-6: #ec4899;

  /* Typography */
  --dt-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --dt-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --dt-font-size-xs: 0.6875rem;   /* 11px */
  --dt-font-size-sm: 0.75rem;     /* 12px */
  --dt-font-size-base: 0.8125rem; /* 13px */
  --dt-font-size-md: 0.875rem;    /* 14px */
  --dt-font-size-lg: 1rem;        /* 16px */
  --dt-font-size-xl: 1.25rem;     /* 20px */
  --dt-font-size-2xl: 1.5rem;     /* 24px */

  /* Spacing */
  --dt-space-1: 4px;
  --dt-space-2: 8px;
  --dt-space-3: 12px;
  --dt-space-4: 16px;
  --dt-space-5: 20px;
  --dt-space-6: 24px;
  --dt-space-8: 32px;

  /* Borders */
  --dt-radius-sm: 4px;
  --dt-radius-md: 6px;
  --dt-radius-lg: 8px;
  --dt-radius-xl: 12px;

  /* Shadows */
  --dt-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --dt-shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --dt-shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
  --dt-shadow-xl: 0 20px 25px rgba(0,0,0,0.6);
  --dt-shadow-glow-blue: 0 0 20px rgba(59,130,246,0.15);

  /* Theme-aware utility vars */
  --dt-grid-line: rgba(30,37,54,0.4);
  --dt-nav-scrolled-bg: rgba(11,14,17,0.92);
  --dt-feature-hover-bg: #1a1f2e;
  --dt-overlay: rgba(0,0,0,0.6);

  /* Layout */
  --dt-sidebar-width: 260px;
  --dt-sidebar-collapsed-width: 56px;
  --dt-topbar-height: 48px;
  --dt-widget-header-height: 36px;
  --dt-statusbar-height: 24px;

  /* Transitions */
  --dt-transition-fast: 100ms ease;
  --dt-transition-normal: 200ms ease;
  --dt-transition-slow: 300ms ease;

  /* ── Map design-token vars → existing --color-* vars for backward compat ── */
  --color-bg: var(--dt-bg-primary);
  --color-panel: var(--dt-bg-secondary);
  --color-panelH: var(--dt-bg-tertiary);
  --color-border: var(--dt-border-primary);
  --color-borderA: var(--dt-border-secondary);
  --color-borderF: var(--dt-accent-blue);
  --color-text: var(--dt-text-primary);
  --color-dim: var(--dt-text-secondary);
  --color-muted: var(--dt-text-tertiary);
  --color-white: #f8fafc;
  --color-green: var(--dt-positive);
  --color-greenD: #16a34a;
  --color-greenBg: rgba(34,197,94,0.10);
  --color-greenBgS: rgba(34,197,94,0.18);
  --color-red: var(--dt-negative);
  --color-redBg: rgba(239,68,68,0.10);
  --color-redBgS: rgba(239,68,68,0.18);
  --color-yellow: var(--dt-accent-yellow);
  --color-yellowBg: rgba(234,179,8,0.10);
  --color-yellowBgS: rgba(234,179,8,0.18);
  --color-cyan: var(--dt-accent-cyan);
  --color-blue: var(--dt-accent-blue);
  --color-purple: var(--dt-accent-purple);
  --color-orange: var(--dt-accent-orange);
  --color-accent: var(--dt-accent-blue);
  --color-titleActive: #131720;
  --color-titleInactive: var(--dt-bg-secondary);
  --color-bevelLight: rgba(255,255,255,0.05);
  --color-bevelDark: var(--dt-bg-primary);
  --color-statusBg: var(--dt-bg-secondary);

  /* Legacy sidebar/topbar vars → new design tokens */
  --dt-sidebar-bg: var(--dt-bg-secondary);
  --dt-sidebar-border: var(--dt-border-primary);
  --dt-sidebar-text: var(--dt-text-secondary);
  --dt-sidebar-text-active: var(--dt-text-primary);
  --dt-sidebar-hover: var(--dt-bg-hover);
  --dt-sidebar-active-bg: rgba(59,130,246,0.12);
  --dt-sidebar-active-accent: var(--dt-accent-blue);
  --dt-sidebar-section-label: var(--dt-text-tertiary);
  --dt-topbar-bg: var(--dt-bg-secondary);
  --dt-topbar-border: var(--dt-border-primary);
  --dt-topbar-text: var(--dt-text-primary);
  --dt-content-bg: var(--dt-bg-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Global Reset — Terminal Look
   ═══════════════════════════════════════════════════════════════════════════ */

body {
  background: var(--dt-bg-primary);
  color: var(--dt-text-primary);
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-moz-selection {
  background: rgba(59,130,246,0.25);
  color: var(--dt-text-primary);
}

::selection {
  background: rgba(59,130,246,0.25);
  color: var(--dt-text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Scrollbar Styling
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dt-border-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dt-text-tertiary); }
::-webkit-scrollbar-corner { background: transparent; }


/* ═══════════════════════════════════════════════════════════════════════════
   Data Table — Dense, terminal-style
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--dt-font-size-sm);
}

.dt-table th {
  padding: var(--dt-space-1) var(--dt-space-2);
  text-align: left;
  color: var(--dt-text-tertiary);
  font-weight: 500;
  font-size: var(--dt-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--dt-border-primary);
  position: sticky;
  top: 0;
  background: var(--dt-bg-secondary);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  cursor: pointer;
  white-space: nowrap;
}

.dt-table th:hover { color: var(--dt-text-secondary); }
.dt-table th.sorted { color: var(--dt-accent-blue); }

.dt-table td {
  padding: var(--dt-space-1) var(--dt-space-2);
  border-bottom: 1px solid var(--dt-border-primary);
  white-space: nowrap;
}

.dt-table tr:hover td { background: var(--dt-bg-hover); }
.dt-table tr.selected td { background: var(--dt-bg-active); }

.dt-table .positive { color: var(--dt-positive); }
.dt-table .negative { color: var(--dt-negative); }
.dt-table .neutral  { color: var(--dt-neutral); }

.dt-table .numeric {
  text-align: right;
  font-family: var(--dt-font-mono);
  font-size: var(--dt-font-size-xs);
  font-variant-numeric: tabular-nums;
}

.dt-table .symbol-col { font-weight: 600; color: var(--dt-text-primary); }

.dt-table .company-name {
  color: var(--dt-text-tertiary);
  font-size: var(--dt-font-size-xs);
  margin-left: var(--dt-space-1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Widget Container
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-widget {
  background: var(--dt-bg-secondary);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dt-widget:focus-within {
  border-color: var(--dt-accent-blue);
  box-shadow: var(--dt-shadow-glow-blue);
}

.dt-widget-header {
  height: var(--dt-widget-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--dt-space-3);
  border-bottom: 1px solid var(--dt-border-primary);
  font-size: var(--dt-font-size-sm);
  font-weight: 500;
  color: var(--dt-text-secondary);
  cursor: grab;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  gap: var(--dt-space-2);
}

.dt-widget-header:active { cursor: grabbing; }

.dt-widget-header-title {
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
  min-width: 0;
}

.dt-widget-header-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-widget-header-actions {
  display: flex;
  align-items: center;
  gap: var(--dt-space-1);
  flex-shrink: 0;
}

.dt-widget-body {
  flex: 1;
  overflow: auto;
  padding: var(--dt-space-2);
}

.dt-widget-body.no-pad { padding: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   App Shell (grid layout)
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-shell {
  display: grid;
  grid-template-columns: var(--dt-sidebar-width) 1fr var(--dt-right-rail-width, 34px);
  height: 100vh;
  overflow: hidden;
  background: var(--dt-content-bg);
  transition: grid-template-columns 0.2s ease;
}

.dt-shell--collapsed {
  grid-template-columns: var(--dt-sidebar-collapsed-width) 1fr var(--dt-right-rail-width, 34px);
}

.dt-shell__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-sidebar {
  display: flex;
  flex-direction: column;
  width: var(--dt-sidebar-width);
  background: var(--dt-sidebar-bg);
  border-right: 1px solid var(--dt-sidebar-border);
  overflow: hidden;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  height: 100vh;
  flex-shrink: 0;
}

.dt-sidebar.collapsed { width: var(--dt-sidebar-collapsed-width); }

.dt-sidebar__logo {
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--dt-topbar-height);
  padding: 0 16px;
  flex-shrink: 0;
}

.dt-sidebar__logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--dt-sidebar-active-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  margin-right: 4px;
}

.dt-sidebar__logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--dt-sidebar-text-active);
  position: relative;
  top: -1px; /* Optical adjustment for vertical centering */
  margin-left: 6px;
}

.dt-sidebar__logo span { color: var(--dt-sidebar-active-accent); font-weight: 800; }

.dt-sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}

.dt-sidebar__section { margin-bottom: 4px; }

.dt-sidebar__section + .dt-sidebar__section {
  border-top: 1px solid var(--dt-border-primary);
  padding-top: 4px;
}

.dt-sidebar__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dt-sidebar-section-label);
  white-space: nowrap;
}

.dt-sidebar__section-header--mixed-case {
  text-transform: none;
  letter-spacing: 0.02em;
}

.dt-sidebar__section-header button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--dt-sidebar-section-label);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dt-sidebar__section-header button:hover {
  background: var(--dt-sidebar-hover);
  color: var(--dt-sidebar-text-active);
}

.dt-sidebar-section { padding: var(--dt-space-2) 0; }

.dt-sidebar-title {
  padding: var(--dt-space-1) var(--dt-space-4);
  font-size: var(--dt-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dt-text-tertiary);
  font-weight: 600;
}

.dt-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
  padding: var(--dt-space-2) var(--dt-space-4);
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  font-size: var(--dt-font-size-sm);
  border-left: 2px solid transparent;
  text-decoration: none;
}

.dt-sidebar-item:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

.dt-sidebar-item.active {
  background: var(--dt-bg-active);
  color: var(--dt-accent-blue);
  border-left-color: var(--dt-accent-blue);
}

.dt-sidebar-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.dt-sidebar-item.active .icon { opacity: 1; }

.dt-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--dt-sidebar-text);
  cursor: pointer;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dt-sidebar__item:hover {
  background: var(--dt-sidebar-hover);
  color: var(--dt-sidebar-text-active);
}

.dt-sidebar__item--active {
  background: var(--dt-sidebar-active-bg);
  color: var(--dt-sidebar-active-accent);
  border-left: 2px solid var(--dt-sidebar-active-accent);
}

.dt-sidebar__item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 18px;
}

.dt-sidebar__item-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dt-sidebar__item-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.dt-sidebar__item-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--dt-text-tertiary);
}

.dt-sidebar__item-code {
  margin-left: auto;
  font-size: 10px;
  color: var(--dt-text-tertiary);
  font-family: var(--dt-font-mono);
  letter-spacing: 0.08em;
}

.dt-sidebar__empty {
  padding: 6px 16px 10px;
  font-size: 11px;
  color: var(--dt-text-tertiary);
}

.dt-sidebar__footer {
  border-top: 1px solid var(--dt-sidebar-border);
  padding: 8px;
  flex-shrink: 0;
}

.dt-sidebar__collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dt-sidebar-text);
  cursor: pointer;
  transition: background 0.15s;
}

.dt-sidebar__collapse-btn:hover { background: var(--dt-sidebar-hover); }

/* Collapsed sidebar overrides */
.dt-shell--collapsed .dt-sidebar__logo-text,
.dt-shell--collapsed .dt-sidebar__section-header,
.dt-shell--collapsed .dt-sidebar__item-label,
.dt-shell--collapsed .dt-sidebar__item-subtitle,
.dt-shell--collapsed .dt-sidebar__item-code {
  display: none !important;
}

.dt-shell--collapsed .dt-sidebar__logo {
  justify-content: center;
  padding: 0;
}

.dt-shell--collapsed .dt-sidebar__item {
  justify-content: center;
  padding: 8px 0;
}

.dt-shell--collapsed .dt-sidebar__section-header {
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════════════
   TopBar — terminal layout
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-topbar {
  height: var(--dt-topbar-height);
  background: var(--dt-topbar-bg);
  border-bottom: 1px solid var(--dt-topbar-border);
  display: flex;
  align-items: center;
  padding: 0 10px 0 0;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

/* Hamburger / sidebar toggle */
.dt-topbar__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dt-topbar__hamburger:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

/* Logo */
.dt-topbar__logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--dt-text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 4px;
}
.dt-topbar__logo-k { color: var(--dt-accent-blue); }

/* Search button — center-left, grows to fill space */
.dt-topbar__search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--dt-border-primary);
  border-radius: 5px;
  background: var(--dt-bg-input);
  color: var(--dt-text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 200px;
  max-width: 340px;
  flex: 1;
  text-align: left;
}
.dt-topbar__search-btn:hover {
  border-color: var(--dt-border-secondary);
  background: var(--dt-bg-hover);
  color: var(--dt-text-secondary);
}
.dt-topbar__search-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-topbar__search-kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--dt-border-secondary);
  background: rgba(255,255,255,0.04);
  color: var(--dt-text-tertiary);
  font-family: inherit;
  flex-shrink: 0;
}

/* Flexible spacer */
.dt-topbar__spacer { flex: 1; min-width: 8px; }

/* Help Center link */
.dt-topbar__help-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--dt-text-secondary);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}
.dt-topbar__help-link:hover {
  color: var(--dt-text-primary);
  background: var(--dt-bg-hover);
}

/* Icon buttons */
.dt-topbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dt-topbar__icon-btn:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

/* User avatar circle */
.dt-topbar__avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--dt-accent-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.12s, transform 0.12s;
}
.dt-topbar__avatar:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

/* Legacy breadcrumb/code (kept for compatibility) */
.dt-topbar__breadcrumb {
  font-size: 14px;
  font-weight: 500;
  color: var(--dt-topbar-text);
  white-space: nowrap;
}
.dt-topbar__title-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.dt-topbar__subline {
  color: var(--dt-text-tertiary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-topbar__code {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--dt-border-secondary);
  color: var(--dt-accent-blue);
  background: rgba(59,130,246,0.08);
  font-size: 11px;
  font-family: var(--dt-font-mono);
  letter-spacing: 0.08em;
}
.dt-topbar__menu-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dt-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.dt-topbar__menu-btn:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

.dt-topbar-logo {
  font-weight: 700;
  font-size: var(--dt-font-size-md);
  color: var(--dt-text-primary);
  letter-spacing: -0.3px;
}

.dt-topbar-search {
  flex: 1;
  max-width: 420px;
}

.dt-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
  margin-left: auto;
}

.dt-topbar__breadcrumb {
  font-size: 14px;
  font-weight: 500;
  color: var(--dt-topbar-text);
  white-space: nowrap;
}

.dt-topbar__title-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.dt-topbar__subline {
  color: var(--dt-text-tertiary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dt-topbar__code {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--dt-border-secondary);
  color: var(--dt-accent-blue);
  background: rgba(59, 130, 246, 0.08);
  font-size: 11px;
  font-family: var(--dt-font-mono);
  letter-spacing: 0.08em;
}

.dt-topbar__spacer { flex: 1; }

.dt-topbar__search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--dt-border-primary);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--dt-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dt-topbar__search-btn:hover {
  border-color: var(--dt-border-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.dt-topbar__search-btn kbd {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dt-text-tertiary);
  font-family: inherit;
}

.dt-topbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dt-topbar__icon-btn:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

.dt-topbar__menu-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dt-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.dt-topbar__menu-btn:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

.dt-topbar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--dt-accent-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.dt-topbar__avatar:hover {
  opacity: 0.85;
  transform: scale(1.05);
}


/* ═══════════════════════════════════════════════════════════════════════════
   StatusBar
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-statusbar {
  height: var(--dt-statusbar-height);
  background: var(--dt-bg-secondary);
  border-top: 1px solid var(--dt-border-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--dt-space-3);
  gap: var(--dt-space-4);
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-tertiary);
  flex-shrink: 0;
}

.dt-statusbar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dt-positive);
  animation: dt-live-pulse 2s ease-in-out infinite;
}

@keyframes dt-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Content Area
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}
.dt-content--no-pad {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--dt-space-2);
  padding: var(--dt-space-2) var(--dt-space-3);
  border-radius: var(--dt-radius-md);
  font-size: var(--dt-font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
  font-family: var(--dt-font-sans);
  text-decoration: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.dt-btn:focus-visible {
  outline: 2px solid var(--dt-accent-blue);
  outline-offset: 2px;
}

.dt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.dt-btn:active:not(:disabled) {
  transform: translateY(1px);
}

/* Primary Button */
.dt-btn-primary {
  background: var(--dt-accent-blue);
  color: #fff;
  border-color: var(--dt-accent-blue);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.dt-btn-primary:hover:not(:disabled) {
  background: var(--dt-accent-blue-hover);
  border-color: var(--dt-accent-blue-hover);
  box-shadow: 0 2px 4px rgba(59,130,246,0.25);
}

.dt-btn-primary:active:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

/* Secondary Button */
.dt-btn-secondary {
  background: var(--dt-bg-tertiary);
  color: var(--dt-text-primary);
  border-color: var(--dt-border-secondary);
}

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

.dt-btn-secondary:active:not(:disabled) {
  background: var(--dt-bg-active);
  border-color: var(--dt-border-secondary);
}

/* Ghost Button */
.dt-btn-ghost {
  background: transparent;
  color: var(--dt-text-secondary);
  border-color: var(--dt-border-primary);
}

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

.dt-btn-ghost:active:not(:disabled) {
  background: var(--dt-bg-active);
}

/* Danger Button */
.dt-btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--dt-negative);
  border-color: rgba(239,68,68,0.4);
}

.dt-btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.6);
  color: #fff;
}

.dt-btn-danger:active:not(:disabled) {
  background: rgba(239,68,68,0.35);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.dt-btn-icon {
  padding: var(--dt-space-1);
  border-radius: var(--dt-radius-sm);
  background: transparent;
  color: var(--dt-text-tertiary);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dt-transition-fast);
}
.dt-btn-icon:hover { background: var(--dt-bg-hover); color: var(--dt-text-primary); }

.dt-btn-sm { padding: 2px var(--dt-space-2); font-size: var(--dt-font-size-xs); }
.dt-btn-lg { padding: var(--dt-space-2) var(--dt-space-5); font-size: var(--dt-font-size-md); }


/* ═══════════════════════════════════════════════════════════════════════════
   Inputs
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-input {
  background: var(--dt-bg-input);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  padding: var(--dt-space-2) var(--dt-space-3);
  color: var(--dt-text-primary);
  font-size: var(--dt-font-size-sm);
  font-family: var(--dt-font-sans);
  outline: none;
  transition: all var(--dt-transition-fast);
  width: 100%;
}

.dt-input:hover:not(:disabled) {
  border-color: var(--dt-border-secondary);
}

.dt-input:focus {
  border-color: var(--dt-accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.dt-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--dt-bg-tertiary);
}

.dt-input::-moz-placeholder { color: var(--dt-text-disabled); }

.dt-input::placeholder { color: var(--dt-text-disabled); }
.dt-input-sm { padding: 2px var(--dt-space-2); font-size: var(--dt-font-size-xs); }

.dt-input-search {
  background: var(--dt-bg-input);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  padding: var(--dt-space-2) var(--dt-space-3) var(--dt-space-2) 36px;
  color: var(--dt-text-primary);
  font-size: var(--dt-font-size-sm);
  font-family: var(--dt-font-sans);
  outline: none;
  width: 100%;
  transition: all var(--dt-transition-fast);
}

.dt-input-search:hover {
  border-color: var(--dt-border-secondary);
}

.dt-input-search:focus {
  border-color: var(--dt-accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.dt-select {
  background: var(--dt-bg-input);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  padding: var(--dt-space-2) var(--dt-space-3);
  padding-right: 32px;
  color: var(--dt-text-primary);
  font-size: var(--dt-font-size-sm);
  font-family: var(--dt-font-sans);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
     -moz-appearance: none;
          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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all var(--dt-transition-fast);
}

.dt-select:hover {
  border-color: var(--dt-border-secondary);
}

.dt-select:focus {
  border-color: var(--dt-accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.dt-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--dt-bg-tertiary);
}

/* Toggle Switch */
.dt-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.dt-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dt-toggle-track {
  width: 44px;
  height: 24px;
  background: var(--dt-bg-tertiary);
  border: 1px solid var(--dt-border-primary);
  border-radius: 12px;
  position: relative;
  transition: all var(--dt-transition-fast);
}

.dt-toggle input:checked + .dt-toggle-track {
  background: var(--dt-positive);
  border-color: var(--dt-positive);
}

.dt-toggle input:focus + .dt-toggle-track {
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}

.dt-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dt-transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.dt-toggle input:checked + .dt-toggle-track .dt-toggle-thumb {
  transform: translateX(20px);
}

.dt-toggle-label {
  margin-left: var(--dt-space-2);
  font-size: var(--dt-font-size-sm);
  color: var(--dt-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Badges / Chips / Tags
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: var(--dt-font-size-xs);
  font-weight: 500;
  line-height: 1.3;
}

.dt-badge-green  { background: rgba(34,197,94,0.15);  color: var(--dt-positive); }
.dt-badge-red    { background: rgba(239,68,68,0.15);  color: var(--dt-negative); }
.dt-badge-blue   { background: rgba(59,130,246,0.15); color: var(--dt-accent-blue); }
.dt-badge-yellow { background: rgba(234,179,8,0.15);  color: var(--dt-accent-yellow); }
.dt-badge-orange { background: rgba(249,115,22,0.15); color: var(--dt-accent-orange); }
.dt-badge-purple { background: rgba(139,92,246,0.15); color: var(--dt-accent-purple); }
.dt-badge-cyan   { background: rgba(6,182,212,0.15);  color: var(--dt-accent-cyan); }
.dt-badge-gray   { background: rgba(148,163,184,0.12); color: var(--dt-text-secondary); }

.dt-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--dt-space-1);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: var(--dt-font-size-xs);
  font-weight: 500;
  background: var(--dt-bg-tertiary);
  color: var(--dt-text-secondary);
  border: 1px solid var(--dt-border-primary);
}

.dt-chip.active {
  background: rgba(59,130,246,0.15);
  color: var(--dt-accent-blue);
  border-color: rgba(59,130,246,0.3);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Tabs — Underline Style
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--dt-border-primary);
}

.dt-tab {
  padding: var(--dt-space-2) var(--dt-space-4);
  font-size: var(--dt-font-size-sm);
  color: var(--dt-text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--dt-transition-fast);
  font-weight: 500;
  white-space: nowrap;
}

.dt-tab:hover { color: var(--dt-text-primary); }

.dt-tab.active {
  color: var(--dt-accent-blue);
  border-bottom-color: var(--dt-accent-blue);
}

.dt-tabs-pill {
  display: flex;
  gap: var(--dt-space-1);
  padding: var(--dt-space-1);
  background: var(--dt-bg-primary);
  border-radius: var(--dt-radius-md);
}

.dt-tab-pill {
  padding: var(--dt-space-1) var(--dt-space-3);
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-tertiary);
  cursor: pointer;
  border-radius: var(--dt-radius-sm);
  transition: all var(--dt-transition-fast);
  font-weight: 500;
}

.dt-tab-pill:hover { color: var(--dt-text-primary); }

.dt-tab-pill.active {
  background: var(--dt-bg-tertiary);
  color: var(--dt-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Dropdown / Menu
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-dropdown {
  background: var(--dt-bg-tertiary);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-md);
  box-shadow: var(--dt-shadow-lg);
  padding: var(--dt-space-1) 0;
  min-width: 180px;
  z-index: 1000;
}

.dt-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
  padding: var(--dt-space-2) var(--dt-space-3);
  font-size: var(--dt-font-size-sm);
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: all var(--dt-transition-fast);
}

.dt-dropdown-item:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}

.dt-dropdown-item.active { color: var(--dt-accent-blue); }

.dt-dropdown-divider {
  height: 1px;
  background: var(--dt-border-primary);
  margin: var(--dt-space-1) 0;
}

.dt-dropdown-header {
  padding: var(--dt-space-1) var(--dt-space-3);
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Tooltip
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-tooltip {
  background: var(--dt-bg-tertiary);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  padding: var(--dt-space-1) var(--dt-space-2);
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-primary);
  box-shadow: var(--dt-shadow-md);
  max-width: 300px;
  z-index: 1100;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Modal / Dialog
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-overlay {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.dt-modal {
  background: var(--dt-bg-secondary);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-lg);
  box-shadow: var(--dt-shadow-xl);
  max-width: 560px;
  width: 90vw;
}

.dt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--dt-space-4);
  border-bottom: 1px solid var(--dt-border-primary);
  font-size: var(--dt-font-size-md);
  font-weight: 600;
  color: var(--dt-text-primary);
}

.dt-modal-body { padding: var(--dt-space-4); }

.dt-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--dt-space-2);
  padding: var(--dt-space-3) var(--dt-space-4);
  border-top: 1px solid var(--dt-border-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Card
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-card {
  background: var(--dt-bg-secondary);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  padding: var(--dt-space-4);
}

.dt-card-header {
  font-size: var(--dt-font-size-sm);
  font-weight: 600;
  color: var(--dt-text-secondary);
  margin-bottom: var(--dt-space-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dt-card-metric {
  font-size: var(--dt-font-size-2xl);
  font-weight: 700;
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--dt-text-primary);
}

.dt-card-metric-sm {
  font-size: var(--dt-font-size-lg);
  font-weight: 600;
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Financial Data Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-price {
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--dt-font-size-sm);
}

.dt-price-lg { font-size: var(--dt-font-size-xl); font-weight: 700; }

.dt-pct-change {
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--dt-font-size-xs);
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 2px;
}

.dt-pct-change.up   { color: var(--dt-positive); background: rgba(34,197,94,0.1); }
.dt-pct-change.down { color: var(--dt-negative); background: rgba(239,68,68,0.1); }
.dt-pct-change.flat { color: var(--dt-unchanged); }

.dt-volume {
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-tertiary);
}

.dt-sparkline-container {
  display: inline-flex;
  align-items: center;
  height: 24px;
  width: 80px;
}

.dt-heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--dt-font-mono);
  font-size: var(--dt-font-size-xs);
  font-weight: 500;
  border-radius: 2px;
  padding: 2px 4px;
}

.dt-ticker-strip {
  display: flex;
  gap: var(--dt-space-4);
  overflow: hidden;
  white-space: nowrap;
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-secondary);
  padding: var(--dt-space-1) var(--dt-space-3);
  background: var(--dt-bg-primary);
  border-bottom: 1px solid var(--dt-border-primary);
}

.dt-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: var(--dt-space-2);
  flex-shrink: 0;
}

.dt-ticker-item .symbol {
  font-weight: 600;
  color: var(--dt-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Watchlist
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-watchlist-row {
  display: flex;
  align-items: center;
  padding: var(--dt-space-1) var(--dt-space-3);
  gap: var(--dt-space-3);
  cursor: pointer;
  transition: background var(--dt-transition-fast);
  border-bottom: 1px solid var(--dt-border-primary);
}

.dt-watchlist-row:hover { background: var(--dt-bg-hover); }

.dt-watchlist-row.selected {
  background: var(--dt-bg-active);
  border-left: 2px solid var(--dt-accent-blue);
}

.dt-watchlist-symbol {
  font-weight: 600;
  font-size: var(--dt-font-size-sm);
  color: var(--dt-text-primary);
  min-width: 70px;
}

.dt-watchlist-price {
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--dt-font-size-sm);
  min-width: 80px;
  text-align: right;
}

.dt-watchlist-change {
  font-family: var(--dt-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--dt-font-size-xs);
  min-width: 60px;
  text-align: right;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Color Group Indicators (widget linking)
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dt-color-dot-1 { background: var(--dt-group-1); }
.dt-color-dot-2 { background: var(--dt-group-2); }
.dt-color-dot-3 { background: var(--dt-group-3); }
.dt-color-dot-4 { background: var(--dt-group-4); }
.dt-color-dot-5 { background: var(--dt-group-5); }
.dt-color-dot-6 { background: var(--dt-group-6); }

.dt-color-border-1 { border-left: 2px solid var(--dt-group-1); }
.dt-color-border-2 { border-left: 2px solid var(--dt-group-2); }
.dt-color-border-3 { border-left: 2px solid var(--dt-group-3); }
.dt-color-border-4 { border-left: 2px solid var(--dt-group-4); }
.dt-color-border-5 { border-left: 2px solid var(--dt-group-5); }
.dt-color-border-6 { border-left: 2px solid var(--dt-group-6); }


/* ═══════════════════════════════════════════════════════════════════════════
   Layout Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.dt-layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dt-layout-content {
  flex: 1;
  overflow: auto;
}

.dt-grid {
  display: grid;
  gap: 1px;
  background: var(--dt-border-primary);
}

.dt-grid > * { background: var(--dt-bg-secondary); }

.dt-split-h { display: flex; height: 100%; }
.dt-split-v { display: flex; flex-direction: column; height: 100%; }

.dt-divider-h {
  width: 1px;
  background: var(--dt-border-primary);
  cursor: col-resize;
  flex-shrink: 0;
}
.dt-divider-h:hover { background: var(--dt-accent-blue); }

.dt-divider-v {
  height: 1px;
  background: var(--dt-border-primary);
  cursor: row-resize;
  flex-shrink: 0;
}
.dt-divider-v:hover { background: var(--dt-accent-blue); }


/* ═══════════════════════════════════════════════════════════════════════════
   Typography Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-mono { font-family: var(--dt-font-mono); font-variant-numeric: tabular-nums; }

.dt-text-xs   { font-size: var(--dt-font-size-xs); }
.dt-text-sm   { font-size: var(--dt-font-size-sm); }
.dt-text-base { font-size: var(--dt-font-size-base); }
.dt-text-md   { font-size: var(--dt-font-size-md); }
.dt-text-lg   { font-size: var(--dt-font-size-lg); }
.dt-text-xl   { font-size: var(--dt-font-size-xl); }
.dt-text-2xl  { font-size: var(--dt-font-size-2xl); }

.dt-text-primary   { color: var(--dt-text-primary); }
.dt-text-secondary { color: var(--dt-text-secondary); }
.dt-text-tertiary  { color: var(--dt-text-tertiary); }
.dt-text-disabled  { color: var(--dt-text-disabled); }
.dt-text-positive  { color: var(--dt-positive); }
.dt-text-negative  { color: var(--dt-negative); }
.dt-text-accent    { color: var(--dt-accent-blue); }

.dt-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dt-label {
  font-size: var(--dt-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dt-text-tertiary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Loading / Skeleton
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-skeleton {
  background: linear-gradient(
    90deg,
    var(--dt-bg-tertiary) 0%,
    var(--dt-bg-hover) 50%,
    var(--dt-bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: dt-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--dt-radius-sm);
}

@keyframes dt-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dt-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--dt-border-secondary);
  border-top-color: var(--dt-accent-blue);
  border-radius: 50%;
  animation: dt-spin 0.6s linear infinite;
}

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

.dt-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--dt-space-8);
  color: var(--dt-text-tertiary);
  text-align: center;
  gap: var(--dt-space-2);
}

.dt-empty-state-icon { font-size: 2rem; opacity: 0.4; }


/* ═══════════════════════════════════════════════════════════════════════════
   Alert / Toast
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--dt-space-2);
  padding: var(--dt-space-3);
  border-radius: var(--dt-radius-md);
  font-size: var(--dt-font-size-sm);
  border-left: 3px solid;
}

.dt-alert-info    { background: rgba(59,130,246,0.08);  border-left-color: var(--dt-accent-blue); color: var(--dt-text-primary); }
.dt-alert-success { background: rgba(34,197,94,0.08);   border-left-color: var(--dt-positive);    color: var(--dt-text-primary); }
.dt-alert-warning { background: rgba(234,179,8,0.08);   border-left-color: var(--dt-accent-yellow); color: var(--dt-text-primary); }
.dt-alert-error   { background: rgba(239,68,68,0.08);   border-left-color: var(--dt-negative);    color: var(--dt-text-primary); }


/* ═══════════════════════════════════════════════════════════════════════════
   Price Flash Animations
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-flash-up   { animation: dt-flash-green 0.5s ease-out; }
.dt-flash-down { animation: dt-flash-red 0.5s ease-out; }

@keyframes dt-flash-green {
  0% { color: var(--dt-positive); background: rgba(34,197,94,0.12); }
  100% { color: inherit; background: transparent; }
}

@keyframes dt-flash-red {
  0% { color: var(--dt-negative); background: rgba(239,68,68,0.12); }
  100% { color: inherit; background: transparent; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Resizer Handle (panel splitters)
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-resize-handle {
  position: relative;
  background: var(--dt-border-primary);
  transition: background var(--dt-transition-fast);
  z-index: 10;
}

.dt-resize-handle:hover,
.dt-resize-handle:active { background: var(--dt-accent-blue); }

.dt-resize-handle-h { width: 3px; cursor: col-resize; }
.dt-resize-handle-v { height: 3px; cursor: row-resize; }


/* ═══════════════════════════════════════════════════════════════════════════
   Light Mode — [data-color-mode="light"]
   Clean white background, slate text, same blue accent
   ═══════════════════════════════════════════════════════════════════════════ */

[data-color-mode="light"] {
  /* Backgrounds */
  --dt-bg-primary: #ffffff;
  --dt-bg-secondary: #f9f9f9;
  --dt-bg-tertiary: #f0f0f0;
  --dt-bg-hover: #f0f0f0;
  --dt-bg-active: #e5e5e5;
  --dt-bg-input: #ffffff;

  /* Borders */
  --dt-border-primary: #e5e5e5;
  --dt-border-secondary: #d4d4d4;
  --dt-border-focus: #3b82f6;

  /* Text */
  --dt-text-primary: #0a0a0a;
  --dt-text-secondary: #525252;
  --dt-text-tertiary: #737373;
  --dt-text-disabled: #a3a3a3;

  /* Shadows — subtle in light mode */
  --dt-shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --dt-shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --dt-shadow-lg: 0 10px 15px rgba(0,0,0,0.08);
  --dt-shadow-xl: 0 20px 25px rgba(0,0,0,0.10);
  --dt-shadow-glow-blue: 0 0 20px rgba(59,130,246,0.10);

  /* Theme-aware utility vars */
  --dt-grid-line: rgba(100,116,139,0.12);
  --dt-nav-scrolled-bg: rgba(255,255,255,0.92);
  --dt-feature-hover-bg: #f1f5f9;
  --dt-overlay: rgba(0,0,0,0.4);
}

/* Scrollbar in light mode */
[data-color-mode="light"] ::-webkit-scrollbar-thumb {
  background: var(--dt-border-secondary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Sidebar — Group & Security Block additions
   ═══════════════════════════════════════════════════════════════════════════ */

/* Grouped section with border-top divider */
.dt-sidebar__group { }
.dt-sidebar__group--bordered {
  border-top: 1px solid var(--dt-border-primary);
  padding-top: 2px;
  margin-top: 2px;
}

/* Indented sub-item (for watchlist/screen/dashboard sub-items) */
.dt-sidebar__item--indent {
  padding-left: 36px !important;
  font-size: 12px !important;
  color: var(--dt-text-tertiary);
}
.dt-sidebar__item--indent:hover { color: var(--dt-sidebar-text-active); }
.dt-sidebar__item--indent.dt-sidebar__item--active { color: var(--dt-sidebar-active-accent); }

/* View all link */
.dt-sidebar__view-all {
  display: block;
  width: 100%;
  padding: 4px 16px 4px 36px;
  font-size: 11px;
  font-family: var(--dt-font-sans);
  font-weight: 500;
  color: var(--dt-sidebar-active-accent, #10b981);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  opacity: 0.8;
  transition: opacity 0.12s ease;
}
.dt-sidebar__view-all:hover { opacity: 1; }

/* Security Symbol Block */
.dt-sidebar__security-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px;
  min-height: 36px;
}
.dt-sidebar__security-ticker {
  font-size: 13px;
  font-weight: 600;
  color: var(--dt-text-primary);
  flex-shrink: 0;
}
.dt-sidebar__security-name {
  font-size: 11px;
  color: var(--dt-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.dt-sidebar__security-search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--dt-text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.dt-sidebar__security-search:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Right Rail — vertical icon strip
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-right-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--dt-right-rail-width, 34px);
  background: var(--dt-bg-secondary);
  border-left: 1px solid var(--dt-border-primary);
  padding: 8px 0;
  gap: 2px;
  flex-shrink: 0;
  overflow: hidden;
}

.dt-right-rail__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--dt-text-tertiary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.dt-right-rail__btn:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Today's Markets — 3-column dense data grid
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-now-grid {
  display: grid;
  grid-template-columns: 280px 1fr 220px;
  gap: 0;
  height: 100%;
  overflow: hidden;
}

.dt-now-col {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--dt-border-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}
.dt-now-col:last-child { border-right: none; }

.dt-now-panel {
  border-bottom: 1px solid var(--dt-border-primary);
  flex-shrink: 0;
}
.dt-now-panel:last-child { border-bottom: none; }

.dt-now-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--dt-text-secondary);
  border-bottom: 1px solid var(--dt-border-primary);
  gap: 6px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.dt-now-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dt-now-panel-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--dt-text-tertiary);
  cursor: pointer;
  transition: background 0.1s;
}
.dt-now-panel-header-btn:hover { background: var(--dt-bg-hover); }

/* Dense data table in NOW grid */
.dt-now-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.dt-now-table th {
  padding: 3px 6px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  color: var(--dt-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--dt-border-primary);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--dt-bg-secondary);
}
.dt-now-table th:not(:first-child) { text-align: right; }
.dt-now-table td {
  padding: 3px 6px;
  border-bottom: 1px solid rgba(30,37,54,0.5);
  white-space: nowrap;
  font-size: 11px;
  color: var(--dt-text-secondary);
}
.dt-now-table td:not(:first-child) { text-align: right; }
.dt-now-table tr:hover td { background: var(--dt-bg-hover); }
.dt-now-table .symbol-cell {
  font-weight: 500;
  color: var(--dt-text-primary);
}
.dt-now-table .subheader td {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--dt-text-tertiary);
  padding-top: 6px;
  background: var(--dt-bg-tertiary);
}

/* Performance chart area */
.dt-now-chart-area {
  padding: 0;
  position: relative;
}
.dt-now-chart-tabs {
  display: flex;
  gap: 0;
  padding: 4px 8px;
  border-bottom: 1px solid var(--dt-border-primary);
}
.dt-now-chart-tab {
  padding: 2px 6px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--dt-text-tertiary);
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}
.dt-now-chart-tab:hover { color: var(--dt-text-secondary); }
.dt-now-chart-tab--active {
  color: var(--dt-accent-blue);
  background: rgba(59,130,246,0.1);
}

/* Factors heatmap grid */
.dt-now-factors {
  padding: 8px;
}
.dt-now-factors-grid {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  gap: 2px;
  font-size: 11px;
}
.dt-now-factors-label {
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--dt-text-tertiary);
  padding-right: 4px;
}
.dt-now-factors-header {
  text-align: center;
  font-size: 10px;
  color: var(--dt-text-tertiary);
  font-weight: 500;
  padding: 2px 0;
}
.dt-now-factor-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 4px;
  font-family: var(--dt-font-mono);
}

/* News list items */
.dt-now-news-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(30,37,54,0.5);
  cursor: pointer;
  transition: background 0.1s;
}
.dt-now-news-item:hover { background: var(--dt-bg-hover); }
.dt-now-news-title {
  font-size: 11px;
  color: var(--dt-text-primary);
  line-height: 1.4;
}
.dt-now-news-meta {
  display: flex;
  gap: 6px;
  font-size: 10px;
  color: var(--dt-text-tertiary);
}

/* Yields table in middle col */
.dt-now-yields-header {
  display: grid;
  grid-template-columns: 1fr repeat(4, 50px);
  padding: 3px 8px;
  font-size: 10px;
  color: var(--dt-text-tertiary);
  border-bottom: 1px solid var(--dt-border-primary);
}
.dt-now-yields-row {
  display: grid;
  grid-template-columns: 1fr repeat(4, 50px);
  padding: 3px 8px;
  font-size: 11px;
  border-bottom: 1px solid rgba(30,37,54,0.5);
  align-items: center;
  transition: background 0.1s;
}
.dt-now-yields-row:hover { background: var(--dt-bg-hover); }
.dt-now-yields-flag {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--dt-text-secondary);
}
.dt-now-yields-val {
  text-align: right;
  font-family: var(--dt-font-mono);
  font-size: 11px;
  color: var(--dt-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Today's Markets — Checkbox & Selection Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Checkbox cell in table header */
.dt-now-table th:first-child {
  width: 28px;
  padding-left: 6px;
  text-align: center;
}

/* Checkbox cell in table rows */
.dt-now-table td:first-child {
  width: 28px;
  padding-left: 6px;
  text-align: center;
}

/* Custom checkbox styling */
.dt-now-checkbox {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--dt-border-secondary);
  border-radius: 3px;
  background: var(--dt-bg-input);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.dt-now-checkbox:hover {
  border-color: var(--dt-accent-blue);
  background: var(--dt-bg-hover);
}

.dt-now-checkbox:checked {
  background: var(--dt-accent-blue);
  border-color: var(--dt-accent-blue);
}

.dt-now-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.dt-now-checkbox:indeterminate {
  background: var(--dt-accent-blue);
  border-color: var(--dt-accent-blue);
}

.dt-now-checkbox:indeterminate::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 8px;
  height: 2px;
  background: white;
}

/* Selected row styling */
.dt-now-table tr.selected td {
  background: rgba(59, 130, 246, 0.15) !important;
}

.dt-now-table tr.selected:hover td {
  background: rgba(59, 130, 246, 0.25) !important;
}

/* Selected row in yields panel */
.dt-now-yields-row.selected {
  background: rgba(59, 130, 246, 0.15);
}

.dt-now-yields-row.selected:hover {
  background: rgba(59, 130, 246, 0.25);
}

/* Floating action bar for selected symbols */
.dt-now-selection-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dt-bg-secondary);
  border: 1px solid var(--dt-border-secondary);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--dt-shadow-lg);
  z-index: 1000;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dt-now-selection-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--dt-text-primary);
}

.dt-now-selection-actions {
  display: flex;
  gap: 8px;
}

.dt-now-selection-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--dt-border-secondary);
  border-radius: 4px;
  background: var(--dt-bg-tertiary);
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dt-now-selection-btn:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-primary);
  border-color: var(--dt-border-primary);
}

.dt-now-selection-btn.primary {
  background: var(--dt-accent-blue);
  color: white;
  border-color: var(--dt-accent-blue);
}

.dt-now-selection-btn.primary:hover {
  background: var(--dt-accent-blue-hover);
}

.dt-now-selection-btn.clear {
  border: none;
  background: transparent;
  color: var(--dt-text-tertiary);
}

.dt-now-selection-btn.clear:hover {
  color: var(--dt-negative);
}

/* Chart container */
.dt-now-chart-container {
  padding: 8px;
  height: 280px;
}

.dt-now-chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--dt-text-tertiary);
  font-size: 13px;
}

/* Legend styling for chart */
.dt-now-chart-legend {
  display: flex;
  gap: 16px;
  padding: 4px 8px 8px;
  font-size: 11px;
}

.dt-now-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.dt-now-chart-legend-item:hover {
  opacity: 0.8;
}

.dt-now-chart-legend-item.disabled {
  opacity: 0.4;
}

.dt-now-chart-legend-color {
  width: 16px;
  height: 2px;
  border-radius: 1px;
}

.dt-now-chart-legend-label {
  color: var(--dt-text-secondary);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .dt-now-grid {
    grid-template-columns: 240px 1fr 200px;
  }
}

@media (max-width: 900px) {
  .dt-now-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  
  .dt-now-col {
    border-right: none;
    border-bottom: 1px solid var(--dt-border-primary);
  }
  
  .dt-now-col:last-child {
    border-bottom: none;
  }
}
.react-grid-layout {
  position: relative;
  transition: height 200ms ease;
}
.react-grid-item {
  transition: all 200ms ease;
  transition-property: left, top, width, height;
}
.react-grid-item img {
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-grid-item.cssTransforms {
  transition-property: transform, width, height;
}
.react-grid-item.resizing {
  transition: none;
  z-index: 1;
  will-change: width, height;
}

.react-grid-item.react-draggable-dragging {
  transition: none;
  z-index: 3;
  will-change: transform;
}

.react-grid-item.dropping {
  visibility: hidden;
}

.react-grid-item.react-grid-placeholder {
  background: red;
  opacity: 0.2;
  transition-duration: 100ms;
  z-index: 2;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.react-grid-item.react-grid-placeholder.placeholder-resizing {
  transition: none;
}

.react-grid-item > .react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 0;
}

.react-grid-item:hover > .react-resizable-handle {
  opacity: 1;
}

.react-grid-item > .react-resizable-handle::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-right: 2px solid rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid rgba(0, 0, 0, 0.4);
}

.react-resizable-hide > .react-resizable-handle {
  display: none;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w,
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n,
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}
.react-resizable {
  position: relative;
}
.react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-origin: content-box;
  box-sizing: border-box;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');
  background-position: bottom right;
  padding: 0 3px 3px 0;
}
.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-resizable-handle-se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
}
.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-resizable-handle-w,
.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-resizable-handle-n,
.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}/*
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: var(--font-sans); /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: var(--font-mono); /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/
dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
.\!container {
  width: 100% !important;
}
.container {
  width: 100%;
}
@media (min-width: 640px) {

  .\!container {
    max-width: 640px !important;
  }

  .container {
    max-width: 640px;
  }
}
@media (min-width: 768px) {

  .\!container {
    max-width: 768px !important;
  }

  .container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {

  .\!container {
    max-width: 1024px !important;
  }

  .container {
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {

  .\!container {
    max-width: 1280px !important;
  }

  .container {
    max-width: 1280px;
  }
}
@media (min-width: 1536px) {

  .\!container {
    max-width: 1536px !important;
  }

  .container {
    max-width: 1536px;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.\!visible {
  visibility: visible !important;
}
.visible {
  visibility: visible;
}
.collapse {
  visibility: collapse;
}
.static {
  position: static;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.sticky {
  position: sticky;
}
.-left-12 {
  left: -3rem;
}
.bottom-0 {
  bottom: 0px;
}
.left-6 {
  left: 1.5rem;
}
.top-0 {
  top: 0px;
}
.top-4 {
  top: 1rem;
}
.z-10 {
  z-index: 10;
}
.col-span-2 {
  grid-column: span 2 / span 2;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.ml-12 {
  margin-left: 3rem;
}
.ml-2 {
  margin-left: 0.5rem;
}
.ml-4 {
  margin-left: 1rem;
}
.mr-1 {
  margin-right: 0.25rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.inline {
  display: inline;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.contents {
  display: contents;
}
.hidden {
  display: none;
}
.h-12 {
  height: 3rem;
}
.h-2 {
  height: 0.5rem;
}
.h-3 {
  height: 0.75rem;
}
.h-4 {
  height: 1rem;
}
.h-6 {
  height: 1.5rem;
}
.min-h-24 {
  min-height: 6rem;
}
.min-h-screen {
  min-height: 100vh;
}
.w-0\.5 {
  width: 0.125rem;
}
.w-11 {
  width: 2.75rem;
}
.w-12 {
  width: 3rem;
}
.w-2 {
  width: 0.5rem;
}
.w-3 {
  width: 0.75rem;
}
.w-4 {
  width: 1rem;
}
.w-40 {
  width: 10rem;
}
.w-6 {
  width: 1.5rem;
}
.w-64 {
  width: 16rem;
}
.w-full {
  width: 100%;
}
.min-w-0 {
  min-width: 0px;
}
.max-w-6xl {
  max-width: 72rem;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.shrink {
  flex-shrink: 1;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.cursor-pointer {
  cursor: pointer;
}
.resize {
  resize: both;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-6 {
  gap: 1.5rem;
}
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-x-3 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.75rem * var(--tw-space-x-reverse));
  margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}
.overflow-x-auto {
  overflow-x: auto;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.break-all {
  word-break: break-all;
}
.rounded {
  border-radius: 0.25rem;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-md {
  border-radius: 0.375rem;
}
.border {
  border-width: 1px;
}
.border-2 {
  border-width: 2px;
}
.border-t {
  border-top-width: 1px;
}
.border-gray-600 {
  --tw-border-opacity: 1;
  border-color: rgb(75 85 99 / var(--tw-border-opacity, 1));
}
.border-gray-700 {
  --tw-border-opacity: 1;
  border-color: rgb(55 65 81 / var(--tw-border-opacity, 1));
}
.bg-gray-600 {
  --tw-bg-opacity: 1;
  background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));
}
.bg-gray-700 {
  --tw-bg-opacity: 1;
  background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
}
.bg-gray-800 {
  --tw-bg-opacity: 1;
  background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
}
.bg-gray-800\/50 {
  background-color: rgb(31 41 55 / 0.5);
}
.bg-gray-900 {
  --tw-bg-opacity: 1;
  background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));
}
.p-2 {
  padding: 0.5rem;
}
.p-4 {
  padding: 1rem;
}
.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}
.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}
.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}
.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.pt-4 {
  padding-top: 1rem;
}
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.font-mono {
  font-family: var(--font-mono);
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.uppercase {
  text-transform: uppercase;
}
.lowercase {
  text-transform: lowercase;
}
.capitalize {
  text-transform: capitalize;
}
.tabular-nums {
  --tw-numeric-spacing: tabular-nums;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.text-gray-300 {
  --tw-text-opacity: 1;
  color: rgb(209 213 219 / var(--tw-text-opacity, 1));
}
.text-gray-400 {
  --tw-text-opacity: 1;
  color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}
.text-gray-500 {
  --tw-text-opacity: 1;
  color: rgb(107 114 128 / var(--tw-text-opacity, 1));
}
.text-white {
  color: var(--color-white);
}
.underline {
  text-decoration-line: underline;
}
.overline {
  text-decoration-line: overline;
}
.line-through {
  text-decoration-line: line-through;
}
.placeholder-gray-500::-moz-placeholder {
  --tw-placeholder-opacity: 1;
  color: rgb(107 114 128 / var(--tw-placeholder-opacity, 1));
}
.placeholder-gray-500::placeholder {
  --tw-placeholder-opacity: 1;
  color: rgb(107 114 128 / var(--tw-placeholder-opacity, 1));
}
.outline {
  outline-style: solid;
}
.ring-1 {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.blur {
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.backdrop-filter {
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.delay-200 {
  transition-delay: 200ms;
}
.delay-300 {
  transition-delay: 300ms;
}
.delay-500 {
  transition-delay: 500ms;
}
.ease-in-out {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

/* ── TradingRiot-inspired dark theme ───────────────────────────────────────── */
:root,
:root.win2019 {
  --color-bg: #09090b;
  --color-panel: #111113;
  --color-panelH: #1a1a1e;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-borderA: rgba(255, 255, 255, 0.10);
  --color-borderF: #10b981;
  --color-text: #e4e4e7;
  --color-dim: #a1a1aa;
  --color-muted: #71717a;
  --color-white: #fafafa;
  --color-green: #10b981;
  --color-greenD: #059669;
  --color-greenBg: rgba(16, 185, 129, 0.10);
  --color-greenBgS: rgba(16, 185, 129, 0.18);
  --color-red: #ef4444;
  --color-redBg: rgba(239, 68, 68, 0.10);
  --color-redBgS: rgba(239, 68, 68, 0.18);
  --color-yellow: #eab308;
  --color-yellowBg: rgba(234, 179, 8, 0.10);
  --color-yellowBgS: rgba(234, 179, 8, 0.18);
  --color-cyan: #06b6d4;
  --color-blue: #3b82f6;
  --color-purple: #8b5cf6;
  --color-orange: #f97316;
  --color-accent: #10b981;
  --color-titleActive: #18181b;
  --color-titleInactive: #111113;
  --color-bevelLight: rgba(255, 255, 255, 0.06);
  --color-bevelDark: #09090b;
  --color-statusBg: #111113;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --transition-theme: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

* {
  transition: var(--transition-theme);
}

html,
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  scroll-behavior: smooth;
}

/* ─── Animation Keyframes ─────────────────────────────────────────────── */

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

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.25); }
  50% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.45), 0 0 80px rgba(16, 185, 129, 0.15); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes spinBorder {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes textReveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(16, 185, 129, 0.35); }
  50% { border-color: rgba(16, 185, 129, 0.65); }
}

@keyframes bgPulse {
  0%, 100% { background-color: rgba(16, 185, 129, 0.08); }
  50% { background-color: rgba(16, 185, 129, 0.18); }
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Animation Utility Classes ───────────────────────────────────────── */

.animate-fade-in { animation: fadeIn 0.6s ease-out both; }
.animate-fade-in-up { animation: fadeInUp 0.7s ease-out both; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease-out both; }
.animate-fade-in-scale { animation: fadeInScale 0.5s ease-out both; }
.animate-slide-in-left { animation: slideInLeft 0.6s ease-out both; }
.animate-slide-in-right { animation: slideInRight 0.6s ease-out both; }
.animate-scale-in { animation: scaleIn 0.4s ease-out both; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-glow-pulse { animation: glowPulse 3s ease-in-out infinite; }
.animate-border-glow { animation: borderGlow 2s ease-in-out infinite; }
.animate-bg-pulse { animation: bgPulse 3s ease-in-out infinite; }

.animate-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.15) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.animate-gradient-text {
  background: linear-gradient(270deg, #10b981, #34d399, #6ee7b7, #10b981);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease-in-out infinite;
}

/* Stagger delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* Scroll-triggered animation (hidden by default, revealed via JS) */
.scroll-animate {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ─── Interactive Effects ─────────────────────────────────────────────── */

.hover-glow {
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.25), 0 0 120px rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.3) !important;
  transform: translateY(-2px);
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.btn-press {
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-press:active {
  transform: scale(0.97);
}

.input-focus-glow:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 30%, transparent);
  border-color: var(--color-accent) !important;
  outline: none;
}

/* Animated gradient border wrapper */
.gradient-border {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 280deg, rgba(16,185,129,0.9) 320deg, rgba(16,185,129,1) 340deg, rgba(58,150,221,0.9) 355deg, transparent 360deg);
  animation: spinBorder 3.6s linear infinite;
}
.gradient-border > span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #09090b;
  border: 1px solid rgba(255,255,255,0.06);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ─── Premium Landing Animations ──────────────────────────────────────── */

.animated-grid-bg {
  background-image:
    linear-gradient(rgba(16,185,129,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.06) 1px, transparent 1px);
  background-size: 64px 64px;
}
.animated-grid-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, rgba(16,185,129,0.05), transparent);
  animation: scanLine 8s linear infinite;
  pointer-events: none;
}
@keyframes scanLine {
  0% { transform: translateY(-200px); }
  100% { transform: translateY(100vh); }
}

.animated-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.word-reveal {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(12px);
  animation: wordReveal 0.6s ease-out forwards;
  display: inline-block;
}
@keyframes wordReveal {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

.card-3d-enter {
  opacity: 0;
  transform: translateY(32px) rotateX(4deg);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.card-3d-enter.visible {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

.spotlight-card {
  --mx: 50%;
  --my: 50%;
  --spotlight: 0;
}
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(600px circle at var(--mx) var(--my), rgba(16,185,129,0.06), transparent 40%);
  opacity: var(--spotlight);
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 3;
}

.price-flash-up { animation: flashGreen 0.5s ease-out; }
.price-flash-down { animation: flashRed 0.5s ease-out; }
@keyframes flashGreen {
  0% { color: #22c55e; text-shadow: 0 0 8px rgba(34,197,94,0.5); }
  100% { color: inherit; text-shadow: none; }
}
@keyframes flashRed {
  0% { color: #ef4444; text-shadow: 0 0 8px rgba(239,68,68,0.5); }
  100% { color: inherit; text-shadow: none; }
}

::-moz-selection {
  background: var(--color-greenBgS);
  color: var(--color-text);
}

::selection {
  background: var(--color-greenBgS);
  color: var(--color-text);
}

/* ─── Terminal panel animations ───────────────────────────────────────── */

.terminal-panel-focused {
  box-shadow: 0 0 0 1px rgba(16,185,129,0.4);
}

@keyframes terminal-tab-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Terminal grid background ───────────────────────────────────────── */
.terminal-grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

.terminal-hover-glow {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* ─── Research UI styles ──────────────────────────────────────────────── */

.ask-suggested-card:hover {
  background: #18181b !important;
  border-color: rgba(16,185,129,0.2) !important;
  transform: translateY(-1px);
}

.ask-recent-card:hover {
  background: #18181b !important;
  border-color: rgba(255,255,255,0.12) !important;
}

.ask-header-link:hover {
  color: #e4e4e7 !important;
  background: rgba(255,255,255,0.06) !important;
}

.ask-back-btn:hover {
  color: #e4e4e7 !important;
  background: rgba(255,255,255,0.06) !important;
}

.ask-followup-btn:hover {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(16,185,129,0.2) !important;
  color: #e4e4e7 !important;
}

.ask-workspace-btn:hover {
  background: rgba(16,185,129,0.18) !important;
  border-color: rgba(16,185,129,0.4) !important;
  box-shadow: 0 0 20px rgba(16,185,129,0.1);
}

.ask-submit-btn:hover:not(:disabled) {
  background: #059669 !important;
  transform: scale(1.04);
}

.evidence-card:hover {
  border-color: rgba(255,255,255,0.12) !important;
}

.after\:absolute::after {
  content: var(--tw-content);
  position: absolute;
}

.after\:left-\[2px\]::after {
  content: var(--tw-content);
  left: 2px;
}

.after\:top-\[2px\]::after {
  content: var(--tw-content);
  top: 2px;
}

.after\:h-5::after {
  content: var(--tw-content);
  height: 1.25rem;
}

.after\:w-5::after {
  content: var(--tw-content);
  width: 1.25rem;
}

.after\:rounded-full::after {
  content: var(--tw-content);
  border-radius: 9999px;
}

.after\:border::after {
  content: var(--tw-content);
  border-width: 1px;
}

.after\:border-gray-300::after {
  content: var(--tw-content);
  --tw-border-opacity: 1;
  border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
}

.after\:bg-white::after {
  content: var(--tw-content);
  background-color: var(--color-white);
}

.after\:transition-all::after {
  content: var(--tw-content);
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.after\:content-\[\'\'\]::after {
  --tw-content: '';
  content: var(--tw-content);
}

.hover\:bg-gray-700:hover {
  --tw-bg-opacity: 1;
  background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
}

.hover\:text-white:hover {
  color: var(--color-white);
}

.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

.peer:checked ~ .peer-checked\:after\:translate-x-full::after {
  content: var(--tw-content);
  --tw-translate-x: 100%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.peer:checked ~ .peer-checked\:after\:border-white::after {
  content: var(--tw-content);
  border-color: var(--color-white);
}

.peer:focus ~ .peer-focus\:outline-none {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

@media (min-width: 768px) {

  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
