: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: var(--space-4);
    padding-bottom: var(--space-4);
  }
  
  .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: var(--space-5) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--dt-radius-sm);
  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: var(--space-6) var(--space-8);
  font-size: 16px;
  border-radius: var(--dt-radius-sm);
  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: var(--space-2);
  padding: var(--space-4) var(--space-2);
  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) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-3);
}

.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: var(--dt-radius-sm);
  margin: var(--space-4) 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: var(--dt-radius-sm);
  padding: var(--space-4) 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: var(--space-6);
  padding: var(--space-6) var(--space-8);
  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: var(--space-4) !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 var(--space-4) !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: var(--space-2) var(--space-4);
  font-size: 11px;
  border-radius: var(--dt-radius-sm);
  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: var(--space-2) var(--space-5);
  font-size: 11px;
  border-radius: var(--dt-radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

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

.widget-input {
  min-height: 32px;
  padding: var(--space-2) var(--space-4);
  font-size: 11px;
  border-radius: var(--dt-radius-sm);
  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: var(--space-4);
  align-items: center;
  padding: var(--space-4);
}

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

.widget-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

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

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

  .widget-button {
    min-height: 40px;
    min-width: 40px;
    padding: var(--space-5) var(--space-7);
    font-size: 12px;
  }

  .widget-input {
    min-height: 40px;
    padding: var(--space-5) var(--space-6);
    font-size: 14px;
  }

  .widget-filter-row {
    padding: var(--space-6);
    gap: var(--space-5);
  }

  .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 — Koyfin-style
   ══════════════════════════════════════════════════════════════════════════════ */

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

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

/* ── Modal ── */
.gs-modal {
  width: 780px;
  max-width: calc(100vw - 32px);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--dt-bg-secondary, #1a1d23);
  border: 1px solid var(--dt-border-secondary, #3a4050);
  border-radius: var(--dt-radius-lg, 8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: gs-slide-in 0.18s ease-out;
}

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

/* ── Header ── */
.gs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-9) var(--space-10) 0;
}

.gs-header__title {
  font-family: var(--dt-font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--dt-text-primary, var(--dt-text-light));
  margin: 0;
  line-height: 1.3;
}

.gs-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--dt-radius-sm, 4px);
  background: transparent;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.gs-close-btn:hover {
  background: var(--dt-bg-hover, rgba(255, 255, 255, 0.06));
  color: var(--dt-text-primary, var(--dt-text-light));
}

/* ── Input area ── */
.gs-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin: var(--space-8) var(--space-10) 0;
  padding: var(--space-5) var(--space-7);
  border: 1px solid var(--dt-border-primary, #2a2d35);
  border-radius: var(--dt-radius-md, 6px);
  background: var(--dt-bg-secondary, var(--dt-bg-alt));
  transition: border-color 0.15s ease;
}

.gs-input-wrap:focus-within {
  border-color: var(--dt-accent-blue, var(--dt-accent-blue-soft));
}

.gs-input {
  flex: 1;
  height: 28px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--dt-text-primary, var(--dt-text-light));
  font-family: var(--dt-font-sans);
  font-size: 15px;
  caret-color: var(--dt-accent-blue, var(--dt-accent-blue-soft));
}

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

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


.gs-kbd {
  padding: var(--space-1) var(--space-3);
  font-family: var(--dt-font-sans);
  font-size: var(--dt-font-size-xs, 11px);
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  background: var(--dt-bg-tertiary, var(--dt-bg-panel-alt));
  border: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  border-radius: var(--dt-radius-sm, 4px);
  line-height: 1;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* ── Filter chips (pill style) ── */
.gs-filters {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-10) 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.gs-filters::-webkit-scrollbar { display: none; }

.gs-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px var(--space-7);
  border-radius: var(--dt-radius-sm, 4px);
  border: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  background: transparent;
  color: var(--dt-text-secondary, var(--dt-text-muted));
  font-size: 13px;
  font-family: var(--dt-font-sans);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
  line-height: 1.4;
}
.gs-filter-chip:hover {
  background: var(--dt-bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--dt-text-primary, var(--dt-text-light));
  border-color: var(--dt-text-tertiary, var(--dt-text-slate));
}
.gs-filter-chip--active {
  background: var(--dt-accent-blue, var(--dt-accent-blue-soft));
  color: #ffffff;
  border-color: var(--dt-accent-blue, var(--dt-accent-blue-soft));
}

/* ── Results area ── */
.gs-results {
  flex: 1;
  overflow-y: auto;
  margin-top: var(--space-4);
}

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

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

.gs-empty {
  padding: var(--space-12) var(--space-10);
  text-align: center;
  font-family: var(--dt-font-sans);
  font-size: 13px;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
}

/* ── Section ── */
.gs-section {
  margin-bottom: 0;
}

.gs-section-label {
  padding: var(--space-6) var(--space-10) var(--space-3);
  font-family: var(--dt-font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Result item ── */
.gs-item {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  padding: var(--space-6) var(--space-10);
  border: none;
  border-bottom: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  outline: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.1s ease;
  text-align: left;
}

.gs-item:last-child {
  border-bottom: none;
}

.gs-item:hover,
.gs-item--active {
  background: var(--dt-bg-hover, rgba(255, 255, 255, 0.04));
}

/* Two-line symbol result layout */
.gs-item__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.gs-item__top-line {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.gs-item__symbol {
  font-family: var(--dt-font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--dt-text-primary, var(--dt-text-light));
}

.gs-item__flag {
  font-size: 13px;
  line-height: 1;
}

.gs-item__exchange {
  font-family: var(--dt-font-sans);
  font-size: 12px;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  font-weight: 400;
}

.gs-item__bottom-line {
  display: flex;
  align-items: center;
}

.gs-item__name {
  font-family: var(--dt-font-sans);
  font-size: 13px;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-item__type {
  font-family: var(--dt-font-sans);
  font-size: 13px;
  color: var(--dt-text-secondary, var(--dt-text-muted));
  flex-shrink: 0;
  margin-left: auto;
}

/* Single-line items (pages, actions, history, etc.) */
.gs-item__label {
  font-family: var(--dt-font-sans);
  font-size: 14px;
  color: var(--dt-text-primary, var(--dt-text-light));
}

.gs-item__meta {
  font-family: var(--dt-font-sans);
  font-size: 12px;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  margin-left: auto;
  flex-shrink: 0;
}

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

/* ── Footer ── */
.gs-footer {
  display: flex;
  align-items: center;
  padding: var(--space-5) var(--space-10);
  border-top: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  font-family: var(--dt-font-sans);
  font-size: 12px;
  color: var(--dt-text-tertiary, var(--dt-text-slate));
  background: var(--dt-bg-tertiary, rgba(255, 255, 255, 0.02));
}

.gs-footer kbd {
  display: inline-block;
  padding: 1px var(--space-3);
  margin: 0 var(--space-1);
  font-family: var(--dt-font-mono);
  font-size: 11px;
  color: var(--dt-text-secondary, var(--dt-text-muted));
  background: var(--dt-bg-secondary, var(--dt-bg-alt));
  border: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  border-radius: var(--dt-radius-sm, 4px);
  line-height: 1.4;
}

.gs-footer__tip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.gs-footer__tip strong {
  color: var(--dt-text-secondary, var(--dt-text-muted));
  margin-right: var(--space-1);
}

/* ══════════════════════════════════════════════════════════════════════════════
   Step 2: Drill-Down / Function Picker
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Drill-down header (selected security) ── */
.gs-drilldown-header {
  display: flex;
  align-items: center;
  gap: var(--dt-space-2, var(--space-4));
  padding: var(--space-6) var(--space-10);
  background: var(--dt-bg-tertiary, var(--dt-bg-panel-alt));
  border-bottom: 1px solid var(--dt-border-primary, var(--dt-border-muted));
}

.gs-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--dt-border-secondary, #3a4050);
  border-radius: var(--dt-radius-sm, 4px);
  background: transparent;
  color: var(--dt-text-tertiary, var(--dt-text-dim));
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.gs-back-btn:hover {
  background: var(--dt-bg-hover, rgba(255, 255, 255, 0.06));
  color: var(--dt-text-primary, var(--dt-text-light));
  border-color: var(--dt-accent-blue, var(--dt-accent-blue-soft));
}

.gs-drilldown-symbol {
  font-family: var(--dt-font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--dt-text-primary, var(--dt-text-light));
}

.gs-drilldown-name {
  font-family: var(--dt-font-sans);
  font-size: 13px;
  color: var(--dt-text-secondary, var(--dt-text-muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Function code badge ── */
.gs-fn-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: var(--space-1) var(--space-4);
  font-family: var(--dt-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid;
  border-radius: var(--dt-radius-sm, 4px);
  flex-shrink: 0;
}
/* ── Instrument Header Bar ────────────────────────────────────────────── */
/* Two-row header: Row 1 = name + buttons, Row 2 = ticker/price/stats    */

.ih-bar {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-9) var(--space-3);
  background: var(--dt-bg-secondary, var(--dt-bg-alt));
  border-bottom: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  flex-shrink: 0;
}

/* ── Row 1: Name + Actions ─────────────────────────────────────────── */

.ih-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-2);
}

.ih-name-group {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.ih-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dt-text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ih-flag {
  font-size: 14px;
  line-height: 1;
}

.ih-exchange-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px var(--space-3);
  border-radius: var(--dt-radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--dt-accent-blue, var(--dt-accent-blue-soft));
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Row 2: Ticker + Price + Info Blocks ────────────────────────────── */

.ih-row-bottom {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  flex-wrap: wrap;
}

.ih-price-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.ih-ticker {
  font-size: 13px;
  font-weight: 700;
  color: var(--dt-text-secondary, var(--dt-text-muted));
  letter-spacing: 0.04em;
}

.ih-price {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--dt-text-primary, #ffffff);
  border-radius: var(--dt-radius-sm);
  padding: 1px 3px;
}

.ih-currency {
  font-size: 10px;
  font-weight: 500;
  color: var(--dt-text-tertiary, var(--dt-text-dim));
  text-transform: uppercase;
}

.ih-change {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dt-text-tertiary, var(--dt-text-dim));
}
.ih-change--up { color: var(--dt-positive, #16A34A); }
.ih-change--down { color: var(--dt-negative, #DC2626); }

/* Separator between info blocks */
.ih-sep {
  width: 1px;
  height: 28px;
  background: var(--dt-border-primary, var(--dt-border-muted));
  flex-shrink: 0;
}

/* Info blocks (e.g. Earnings, Sector, Industry) */
.ih-info-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

.ih-info-value {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dt-text-primary, #ffffff);
  white-space: nowrap;
}

.ih-info-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--dt-text-tertiary, var(--dt-text-dim));
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* Stat blocks (Mkt Cap, P/E, Volume) */
.ih-stat {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

.ih-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--dt-text-primary, #ffffff);
  font-variant-numeric: tabular-nums;
}

.ih-stat-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--dt-text-tertiary, var(--dt-text-dim));
  letter-spacing: 0.02em;
}

.ih-stat-value--up { color: var(--dt-positive, #16A34A); }
.ih-stat-value--down { color: var(--dt-negative, #DC2626); }

/* ── Quick Actions ───────────────────────────────────────────────────── */

.ih-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.ih-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--dt-bg-tertiary, #1F1E23);
  border: 1px solid var(--dt-border-primary, var(--dt-border-muted));
  border-radius: var(--dt-radius-sm);
  color: var(--dt-text-secondary, var(--dt-text-muted));
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.ih-action-btn:hover {
  background: var(--dt-bg-hover, rgba(255,255,255,0.08));
  color: var(--dt-text-primary, #ffffff);
}

.ih-action-btn--accent {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--dt-accent-blue, var(--dt-accent-blue-mid));
}

.ih-action-btn--accent:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--dt-accent-blue, var(--dt-accent-blue-mid));
}

.ih-extended-hours {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 1px;
}
.ih-extended-hours__label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dt-text-tertiary);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 0 var(--space-2);
  line-height: 14px;
}
.ih-extended-hours__price {
  font-size: 11px;
  font-weight: 500;
  font-family: var(--dt-font-mono);
  color: var(--dt-text-secondary);
}
.ih-extended-hours__pct {
  font-size: 11px;
  font-family: var(--dt-font-mono);
  color: var(--dt-text-tertiary);
}
.ih-extended-hours__pct--up  { color: var(--dt-color-positive, #16A34A); }
.ih-extended-hours__pct--down { color: var(--dt-color-negative, #DC2626); }
/* ============================================================
   copilot.css — dibsTERMINAL Copilot UI (OpenBB-Inspired Rebuild)
   ============================================================
   Modular CSS with three-section layout: Header / Body / Footer
   All new classes use dt-ai-* prefix.
   Legacy classes preserved at bottom for kept sub-components.
   ============================================================ */

/* ==========================================================
   Section 1: Design Tokens (CSS Custom Properties)
   ========================================================== */
:root {
  /* Layout */
  --ai-panel-min-w: 360px;
  --ai-panel-max-w: 900px;
  --ai-panel-default-w: 440px;
  --ai-header-h: 48px;
  --ai-footer-max-h: 280px;
  --ai-radius: var(--dt-radius-md);
  --ai-radius-sm: var(--dt-radius-sm);
  --ai-radius-xs: var(--dt-radius-sm);

  /* Surfaces — inherit from terminal theme (navy panel hierarchy) */
  --ai-bg: var(--dt-bg-secondary);
  --ai-bg-elevated: var(--dt-bg-tertiary);
  --ai-bg-hover: var(--dt-bg-hover);
  --ai-bg-active: var(--dt-bg-active);
  --ai-bg-input: var(--dt-bg-input);
  --ai-bg-user-msg: var(--dt-bg-tertiary);
  --ai-bg-assistant-msg: transparent;
  --ai-bg-code: var(--dt-bg-tertiary);
  --ai-bg-card: var(--dt-bg-tertiary);
  --ai-bg-overlay: rgba(0,0,0,0.6);
  --ai-bg-badge: var(--dt-bg-tertiary);

  /* Borders — inherit from terminal theme */
  --ai-border: var(--dt-border-secondary);
  --ai-border-light: var(--dt-border-primary);
  --ai-border-focus: var(--dt-border-focus);
  --ai-border-error: var(--dt-negative);

  /* Text — inherit from terminal theme */
  --ai-text: var(--dt-text-primary);
  --ai-text-secondary: var(--dt-text-secondary);
  --ai-text-tertiary: var(--dt-text-tertiary);
  --ai-text-link: var(--dt-accent-blue);
  --ai-text-success: var(--dt-positive);
  --ai-text-warning: var(--dt-accent-yellow);
  --ai-text-error: var(--dt-negative);

  /* Accent — inherit from terminal theme */
  --ai-accent: var(--dt-accent-blue);
  --ai-accent-hover: var(--dt-accent-blue-hover);
  --ai-accent-subtle: var(--dt-accent-muted);

  /* Shadows — subtle depth to match terminal */
  --ai-shadow-sm: var(--dt-shadow-sm);
  --ai-shadow-md: var(--dt-shadow-md);
  --ai-shadow-lg: var(--dt-shadow-lg);

  /* Focus glow — match terminal */
  --ai-focus-ring: 0 0 0 2px var(--dt-accent-glow);

  /* Typography — inherit from terminal theme */
  --ai-font: var(--dt-font-sans);
  --ai-font-mono: var(--dt-font-mono);
  --ai-fs-xs: 11px;
  --ai-fs-sm: var(--dt-font-size-xs);
  --ai-fs-base: var(--dt-font-size-base);
  --ai-fs-md: var(--dt-font-size-md);
  --ai-fs-lg: var(--dt-font-size-lg);
  --ai-fs-xl: var(--dt-font-size-xl);
  --ai-lh: 1.5;

  /* Spacing — inherit from terminal theme */
  --ai-sp-xs: var(--dt-space-1);
  --ai-sp-sm: var(--dt-space-2);
  --ai-sp-md: var(--dt-space-3);
  --ai-sp-lg: var(--dt-space-4);
  --ai-sp-xl: var(--dt-space-6);

  /* Transitions — match terminal */
  --ai-transition: var(--dt-transition-fast);
  --ai-transition-slow: var(--dt-transition-slow);
}

/* ==========================================================
   Section 2: Panel Shell (DibsAIPanel)
   ========================================================== */
.dt-ai-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--ai-bg);
  border-left: 1px solid var(--ai-border);
  font-family: var(--ai-font);
  font-size: var(--ai-fs-base);
  color: var(--ai-text);
  overflow: hidden;
  contain: layout style;
}

.dt-ai-panel--expanded {
  position: fixed;
  inset: 0;
  z-index: 1200;
  width: 100vw !important;
  max-width: none;
  height: 100dvh;
  border-left: none;
  border-radius: var(--dt-radius-sm);
  box-shadow: none;
}

/* Resize handle */
.dt-ai-panel__resize-handle {
  position: absolute;
  top: 0;
  left: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background var(--ai-transition);
}
.dt-ai-panel__resize-handle:hover,
.dt-ai-panel__resize-handle--active {
  background: var(--ai-accent);
}

/* ==========================================================
   Section 3: Header
   ========================================================== */
.dt-ai-header {
  display: flex;
  align-items: center;
  height: var(--ai-header-h);
  min-height: var(--ai-header-h);
  padding: 0 var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border);
  background: var(--ai-bg);
  gap: var(--ai-sp-sm);
  flex-shrink: 0;
  z-index: 5;
  position: relative;
}
.dt-ai-header__title {
  flex: 1;
  min-width: 0;
  font-size: var(--ai-fs-md);
  font-weight: 600;
  color: var(--ai-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: var(--ai-sp-sm);
}
.dt-ai-header__title-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ai-radius-xs);
  color: var(--ai-text);
  font-size: var(--ai-fs-md);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  width: 100%;
  outline: none;
  transition: border-color var(--ai-transition);
}
.dt-ai-header__title-input:focus {
  border-color: var(--ai-border-focus);
  background: var(--ai-bg-input);
}
.dt-ai-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}
.dt-ai-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--ai-radius-sm);
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: 0;
}
.dt-ai-header__btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-header__btn--active {
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
}
.dt-ai-header__btn svg {
  width: 18px;
  height: 18px;
}
.dt-ai-header__agent-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  font-weight: 500;
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
  white-space: nowrap;
}

/* ==========================================================
   Section 4: Body (Chat Area)
   ========================================================== */
.dt-ai-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--ai-sp-md) var(--ai-sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-xs);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.dt-ai-body::-webkit-scrollbar {
  width: 6px;
}
.dt-ai-body::-webkit-scrollbar-track {
  background: transparent;
}
.dt-ai-body::-webkit-scrollbar-thumb {
  background: var(--ai-border);
  border-radius: var(--dt-radius-sm);
}
.dt-ai-body::-webkit-scrollbar-thumb:hover {
  background: var(--ai-text-tertiary);
}

/* Loading state */
.dt-ai-body__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-sm);
}
.dt-ai-body__loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ai-border);
  border-top-color: var(--ai-accent);
  border-radius: 50%; /* functional: spinner */
  animation: dt-ai-spin 0.6s linear infinite;
  margin-right: var(--ai-sp-sm);
}

/* ==========================================================
   Section 5: Empty State
   ========================================================== */
.dt-ai-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: var(--ai-sp-xl);
  text-align: center;
  gap: var(--ai-sp-lg);
}
.dt-ai-empty__icon {
  width: 48px;
  height: 48px;
  color: var(--ai-text-tertiary);
  opacity: 0.6;
}
.dt-ai-empty__title {
  font-size: var(--ai-fs-lg);
  font-weight: 600;
  color: var(--ai-text);
  margin: 0;
}
.dt-ai-empty__subtitle {
  font-size: var(--ai-fs-sm);
  color: var(--ai-text-secondary);
  max-width: 280px;
  line-height: var(--ai-lh);
  margin: 0;
}
.dt-ai-empty__prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ai-sp-sm);
  width: 100%;
  max-width: 360px;
  margin-top: var(--ai-sp-sm);
}
.dt-ai-empty__prompt {
  display: flex;
  align-items: flex-start;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-bg-elevated);
  cursor: pointer;
  text-align: left;
  font-size: var(--ai-fs-sm);
  color: var(--ai-text-secondary);
  line-height: var(--ai-lh);
  transition: all var(--ai-transition);
}
.dt-ai-empty__prompt:hover {
  border-color: var(--ai-accent);
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-empty__prompt-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--ai-accent);
}

/* ==========================================================
   Section 6: Messages
   ========================================================== */
.dt-ai-msg {
  display: flex;
  gap: var(--ai-sp-md);
  padding: var(--ai-sp-md) 0;
  position: relative;
  animation: dt-ai-fadeIn 200ms ease;
}
.dt-ai-msg--user {
  flex-direction: row-reverse;
}
.dt-ai-msg--assistant {
  flex-direction: row;
}

/* Avatar */
.dt-ai-msg__avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--ai-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ai-fs-xs);
  font-weight: 600;
}
.dt-ai-msg__avatar--user {
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
}
.dt-ai-msg__avatar--assistant {
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
}
.dt-ai-msg__avatar svg {
  width: 16px;
  height: 16px;
}

/* Message Content */
.dt-ai-msg__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-xs);
}
.dt-ai-msg__bubble {
  padding: var(--ai-sp-md) var(--ai-sp-lg);
  border-radius: var(--ai-radius);
  line-height: var(--ai-lh);
  font-size: var(--ai-fs-base);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.dt-ai-msg__bubble--user {
  background: var(--ai-bg-user-msg);
  border: 1px solid var(--ai-border-light);
  border-radius: var(--ai-radius) var(--ai-radius-xs) var(--ai-radius) var(--ai-radius);
  max-width: 85%;
  margin-left: auto;
}
.dt-ai-msg__bubble--assistant {
  background: var(--ai-bg-assistant-msg);
  max-width: 100%;
}

/* Message meta */
.dt-ai-msg__meta {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  padding: 0 var(--space-1);
}
.dt-ai-msg__meta--user {
  justify-content: flex-end;
}
.dt-ai-msg__timestamp {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
}

/* Action bar (copy, thumbs, regenerate) */
.dt-ai-msg__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--ai-transition);
  margin-top: var(--ai-sp-xs);
}
.dt-ai-msg:hover .dt-ai-msg__actions,
.dt-ai-msg__actions--visible {
  opacity: 1;
}
.dt-ai-msg__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: 0;
}
.dt-ai-msg__action-btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-msg__action-btn--active {
  color: var(--ai-accent);
}
.dt-ai-msg__action-btn--positive:hover {
  color: var(--ai-text-success);
}
.dt-ai-msg__action-btn--negative:hover {
  color: var(--ai-text-error);
}
.dt-ai-msg__action-btn svg {
  width: 14px;
  height: 14px;
}

/* Error message */
.dt-ai-msg__error {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-radius: var(--ai-radius-sm);
  background: rgba(199, 80, 80,0.1);
  border: 1px solid rgba(199, 80, 80,0.2);
  color: var(--ai-text-error);
  font-size: var(--ai-fs-sm);
}

/* ==========================================================
   Section 7: Streaming / Typing Indicator
   ========================================================== */
.dt-ai-streaming {
  display: flex;
  gap: var(--ai-sp-md);
  padding: var(--ai-sp-md) 0;
}
.dt-ai-streaming__cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ai-accent);
  animation: dt-ai-blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}
.dt-ai-streaming__thinking {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-sm);
  font-style: italic;
  padding: var(--ai-sp-sm) 0;
}
.dt-ai-streaming__dots {
  display: inline-flex;
  gap: 3px;
}
.dt-ai-streaming__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ai-text-secondary);
  animation: dt-ai-bounce 1.4s ease-in-out infinite;
}
.dt-ai-streaming__dot:nth-child(2) { animation-delay: 0.16s; }
.dt-ai-streaming__dot:nth-child(3) { animation-delay: 0.32s; }

/* ==========================================================
   Section 8: Citations (OpenBB-style)
   ========================================================== */
.dt-ai-citations {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ai-sp-xs);
  margin-top: var(--ai-sp-sm);
}
.dt-ai-citation {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ai-transition);
  text-decoration: none;
  border: 1px solid transparent;
}
.dt-ai-citation--widget {
  background: rgba(74,144,217,0.12);
  color: var(--ai-accent);
  border-color: rgba(74,144,217,0.2);
}
.dt-ai-citation--widget:hover {
  background: rgba(74,144,217,0.2);
}
.dt-ai-citation--document {
  background: rgba(90, 154, 110,0.12);
  color: var(--ai-text-success);
  border-color: rgba(90, 154, 110,0.2);
}
.dt-ai-citation--document:hover {
  background: rgba(90, 154, 110,0.2);
}
.dt-ai-citation--web {
  background: rgba(251, 191, 36,0.12);
  color: var(--ai-text-warning);
  border-color: rgba(251, 191, 36,0.2);
}
.dt-ai-citation--web:hover {
  background: rgba(251, 191, 36,0.2);
}
.dt-ai-citation__icon {
  width: 12px;
  height: 12px;
}
.dt-ai-citation__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: var(--ai-radius-sm);
  font-size: 10px;
  font-weight: 600;
  background: var(--ai-bg-badge);
  color: var(--ai-text-secondary);
  vertical-align: super;
  cursor: pointer;
  margin: 0 1px;
}

/* ==========================================================
   Section 9: Follow-up Suggestions
   ========================================================== */
.dt-ai-followups {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) 0;
}
.dt-ai-followup {
  display: inline-flex;
  align-items: center;
  gap: var(--ai-sp-xs);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-elevated);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-sm);
  cursor: pointer;
  transition: all var(--ai-transition);
  line-height: 1.3;
}
.dt-ai-followup:hover {
  border-color: var(--ai-accent);
  color: var(--ai-text);
  background: var(--ai-bg-hover);
}
.dt-ai-followup svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==========================================================
   Section 10: Footer
   ========================================================== */
.dt-ai-footer {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--ai-border);
  background: var(--ai-bg);
  flex-shrink: 0;
  z-index: 5;
}

/* ==========================================================
   Section 11: Context Bar
   ========================================================== */
.dt-ai-context {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
  overflow-x: auto;
  flex-shrink: 0;
}
.dt-ai-context:empty {
  display: none;
}
.dt-ai-context::-webkit-scrollbar {
  height: 3px;
}
.dt-ai-context__label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}
.dt-ai-context__scope {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.dt-ai-context__scope-label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
}
.dt-ai-context__scope-select {
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border-light);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-xs);
  padding: 4px 8px;
  min-width: 110px;
}
.dt-ai-context__scope-select:focus {
  outline: none;
  border-color: var(--ai-accent);
}
.dt-ai-context__chips {
  display: flex;
  gap: var(--ai-sp-xs);
  flex-wrap: nowrap;
  overflow-x: auto;
}
.dt-ai-context__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  background: var(--ai-bg-badge);
  color: var(--ai-text-secondary);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--ai-border-light);
}
.dt-ai-context__chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  padding: 0;
  border-radius: var(--ai-radius-sm);
  flex-shrink: 0;
  transition: all var(--ai-transition);
}
.dt-ai-context__chip-close:hover {
  background: var(--ai-bg-active);
  color: var(--ai-text);
}
.dt-ai-context__chip--mention {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.3);
  color: var(--ai-accent);
}
.dt-ai-context__chip--memory {
  background: rgba(14,165,233,0.1);
  border-color: rgba(14,165,233,0.25);
}
.dt-ai-context__chip--memory-pinned {
  background: rgba(250,204,21,0.12);
  border-color: rgba(250,204,21,0.3);
  color: var(--ai-text);
}
.dt-ai-context__clear {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  padding: var(--space-1) var(--space-2);
  flex-shrink: 0;
}
.dt-ai-context__clear:hover {
  color: var(--ai-text-error);
}

/* ==========================================================
   Section 12: Input Area
   ========================================================== */
.dt-ai-input {
  display: flex;
  flex-direction: column;
  padding: var(--ai-sp-md);
  gap: var(--ai-sp-sm);
}
.dt-ai-input__wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--ai-sp-sm);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-bg-input);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  transition: border-color var(--ai-transition);
}
.dt-ai-input__wrapper:focus-within {
  border-color: var(--ai-border-focus);
}
.dt-ai-input__wrapper--error {
  border-color: var(--ai-border-error);
}
.dt-ai-input__textarea {
  flex: 1;
  min-height: 20px;
  max-height: 150px;
  border: none;
  background: transparent;
  color: var(--ai-text);
  font-family: var(--ai-font);
  font-size: var(--ai-fs-base);
  line-height: var(--ai-lh);
  resize: none;
  outline: none;
  padding: var(--ai-sp-xs) 0;
}
.dt-ai-input__textarea::-moz-placeholder {
  color: var(--ai-text-tertiary);
}
.dt-ai-input__textarea::placeholder {
  color: var(--ai-text-tertiary);
}
.dt-ai-input__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  padding-bottom: var(--ai-sp-xs);
}
.dt-ai-input__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--ai-radius-sm);
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: 0;
}
.dt-ai-input__btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-input__btn--send {
  background: var(--ai-accent);
  color: var(--color-white);
  border-radius: var(--ai-radius-sm);
}
.dt-ai-input__btn--send:hover {
  background: var(--ai-accent-hover);
}
.dt-ai-input__btn--send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dt-ai-input__btn--stop {
  background: var(--ai-text-error);
  color: var(--color-white);
  border-radius: var(--ai-radius-sm);
}
.dt-ai-input__btn--stop:hover {
  opacity: 0.85;
}
.dt-ai-input__btn svg {
  width: 16px;
  height: 16px;
}
.dt-ai-input__char-count {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-align: right;
  padding-right: var(--space-1);
}

/* Slash Command Palette */
.dt-ai-input__palette {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: var(--space-2);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
}
.dt-ai-input__palette-item {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  cursor: pointer;
  transition: background var(--ai-transition);
}
.dt-ai-input__palette-item:hover,
.dt-ai-input__palette-item--active {
  background: var(--ai-bg-hover);
}
.dt-ai-input__palette-cmd {
  font-weight: 600;
  font-size: var(--ai-fs-sm);
  color: var(--ai-accent);
}
.dt-ai-input__palette-desc {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
}

/* Mention Dropdown */
.dt-ai-input__mentions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: var(--space-2);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
}
.dt-ai-input__mention-item {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  cursor: pointer;
  font-size: var(--ai-fs-sm);
  color: var(--ai-text);
  transition: background var(--ai-transition);
}
.dt-ai-input__mention-item:hover,
.dt-ai-input__mention-item--active {
  background: var(--ai-bg-hover);
}

/* File drop zone */
.dt-ai-input__dropzone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-bg-overlay);
  border: 2px dashed var(--ai-accent);
  border-radius: var(--ai-radius);
  color: var(--ai-accent);
  font-size: var(--ai-fs-sm);
  font-weight: 500;
  z-index: 25;
  pointer-events: none;
}

/* ==========================================================
   Section 13: Model Selector
   ========================================================== */
.dt-ai-model-selector {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: 0 var(--ai-sp-md) var(--ai-sp-sm);
}
.dt-ai-model-selector__select {
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text);
  font-size: var(--ai-fs-xs);
  padding: var(--space-2) var(--space-4);
  outline: none;
  cursor: pointer;
  max-width: 140px;
  transition: border-color var(--ai-transition);
}
.dt-ai-model-selector__select:focus {
  border-color: var(--ai-border-focus);
}
.dt-ai-model-selector__select option {
  background: var(--ai-bg-elevated);
  color: var(--ai-text);
}
.dt-ai-model-selector__label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
}

/* ==========================================================
   Section 14: History View
   ========================================================== */
.dt-ai-history {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--ai-bg);
  z-index: 50;
  animation: dt-ai-slideIn 200ms ease;
}
.dt-ai-history__header {
  display: flex;
  align-items: center;
  height: var(--ai-header-h);
  padding: 0 var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border);
  gap: var(--ai-sp-sm);
}
.dt-ai-history__title {
  flex: 1;
  font-size: var(--ai-fs-md);
  font-weight: 600;
}
.dt-ai-history__search {
  display: flex;
  align-items: center;
  margin: 0 var(--ai-sp-md);
  padding: var(--ai-sp-sm);
}
.dt-ai-history__search-input {
  width: 100%;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  outline: none;
}
.dt-ai-history__search-input:focus {
  border-color: var(--ai-border-focus);
}
.dt-ai-history__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--ai-sp-sm);
}
.dt-ai-history__group {
  margin-bottom: var(--ai-sp-md);
}
.dt-ai-history__group-label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--ai-sp-xs) var(--ai-sp-sm);
  margin-bottom: var(--ai-sp-xs);
}
.dt-ai-history__item {
  display: flex;
  align-items: center;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-radius: var(--ai-radius-sm);
  cursor: pointer;
  transition: background var(--ai-transition);
  gap: var(--ai-sp-sm);
}
.dt-ai-history__item:hover {
  background: var(--ai-bg-hover);
}
.dt-ai-history__item--active {
  background: var(--ai-accent-subtle);
}
.dt-ai-history__item-title {
  flex: 1;
  font-size: var(--ai-fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-ai-history__item-date {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  flex-shrink: 0;
}
.dt-ai-history__item-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--ai-transition);
}
.dt-ai-history__item:hover .dt-ai-history__item-actions {
  opacity: 1;
}
.dt-ai-history__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--ai-sp-xl);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-sm);
}

/* ==========================================================
   Section 15: Scroll Anchor / Scroll-to-Bottom Button
   ========================================================== */
.dt-copilot-scroll-btn {
  position: sticky;
  bottom: var(--ai-sp-sm);
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-elevated);
  color: var(--ai-text-secondary);
  cursor: pointer;
  box-shadow: var(--ai-shadow-sm);
  transition: all var(--ai-transition);
  z-index: 10;
}
.dt-copilot-scroll-btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
  border-color: var(--ai-accent);
}

/* ==========================================================
   Section 16: Error Banner
   ========================================================== */
.dt-ai-error-banner {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  background: rgba(199, 80, 80,0.1);
  border-bottom: 1px solid rgba(199, 80, 80,0.2);
  color: var(--ai-text-error);
  font-size: var(--ai-fs-sm);
}
.dt-ai-error-banner__text {
  flex: 1;
}
.dt-ai-error-banner__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--ai-text-error);
  cursor: pointer;
  border-radius: var(--ai-radius-xs);
  padding: 0;
}
.dt-ai-error-banner__close:hover {
  background: rgba(199, 80, 80,0.15);
}

/* ==========================================================
   Section 17: Queue Status Indicator
   ========================================================== */
.dt-ai-queue {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-xs);
  padding: var(--ai-sp-xs) var(--ai-sp-md);
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
  background: var(--ai-bg-elevated);
  border-bottom: 1px solid var(--ai-border-light);
}
.dt-ai-queue__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ai-text-warning);
  animation: dt-ai-pulse 2s ease-in-out infinite;
}

/* ==========================================================
   Section 18: Animations
   ========================================================== */
@keyframes dt-ai-spin {
  to { transform: rotate(360deg); }
}
@keyframes dt-ai-blink {
  50% { opacity: 0; }
}
@keyframes dt-ai-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
@keyframes dt-ai-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dt-ai-slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes dt-ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ==========================================================
   Section 19: Utility Classes
   ========================================================== */
.dt-ai-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.dt-ai-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-ai-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.dt-ai-visually-hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ==========================================================
   Section 20: LEGACY — Tool Activity (CopilotToolActivity)
   ========================================================== */
.dt-ai-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ai-sp-xs);
  margin-bottom: var(--ai-sp-sm);
}
.dt-ai-panel__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-5);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  background: var(--ai-bg-badge);
  color: var(--ai-text-secondary);
  border: 1px solid var(--ai-border-light);
  cursor: default;
  transition: all var(--ai-transition);
}
.dt-ai-panel__chip:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-panel__activity {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) 0;
}
.dt-ai-panel__activity-progress {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-xs);
}
.dt-ai-panel__activity-progress__label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
}
.dt-ai-panel__activity-progress__bar {
  height: 4px;
  background: var(--ai-bg-active);
  border-radius: var(--dt-radius-sm);
  overflow: hidden;
}
.dt-ai-panel__activity-progress__fill {
  height: 100%;
  background: var(--ai-accent);
  border-radius: var(--dt-radius-sm);
  transition: width var(--ai-transition-slow);
}
.dt-ai-panel__activity-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-left: var(--ai-sp-sm);
}
.dt-ai-panel__activity-step {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: 3px 0;
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
}
.dt-ai-panel__activity-step--completed {
  color: var(--ai-text-success);
}
.dt-ai-panel__activity-step--running {
  color: var(--ai-accent);
}
.dt-ai-panel__activity-step--error,
.dt-ai-panel__activity-step--failed {
  color: var(--ai-text-error);
}
.dt-ai-panel__activity-step--pending {
  color: var(--ai-text-tertiary);
}
.dt-ai-panel__activity-step__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dt-ai-panel__activity-step--completed .dt-ai-panel__activity-step__indicator {
  background: var(--ai-text-success);
}
.dt-ai-panel__activity-step--running .dt-ai-panel__activity-step__indicator {
  background: var(--ai-accent);
  animation: dt-ai-pulse 1.5s ease-in-out infinite;
}
.dt-ai-panel__activity-step--error .dt-ai-panel__activity-step__indicator,
.dt-ai-panel__activity-step--failed .dt-ai-panel__activity-step__indicator {
  background: var(--ai-text-error);
}
.dt-ai-panel__activity-step--pending .dt-ai-panel__activity-step__indicator {
  background: var(--ai-text-tertiary);
}
.dt-ai-panel__activity-step__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-ai-panel__activity-elapsed {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  margin-left: auto;
  padding-left: var(--ai-sp-sm);
}

/* ==========================================================
   Section 21: Reasoning Shimmer Indicator
   ========================================================== */
@keyframes dt-reasoning-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes dt-reasoning-dot-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.35); }
}

.dt-reasoning-shimmer {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-7);
  border-radius: var(--dt-radius-sm);
  font-size: var(--ai-fs-sm);
  color: var(--ai-text-secondary);
  line-height: 1;
  margin: var(--space-2) 0;
}
.dt-reasoning-shimmer--active {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--ai-accent) 8%, transparent) 0%,
    color-mix(in srgb, var(--ai-accent) 18%, transparent) 40%,
    color-mix(in srgb, var(--ai-accent) 8%, transparent) 60%,
    color-mix(in srgb, var(--ai-accent) 3%, transparent) 100%
  );
  background-size: 200% 100%;
  animation: dt-reasoning-shimmer 2.4s ease-in-out infinite;
}
.dt-reasoning-shimmer__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ai-accent);
  flex-shrink: 0;
}
.dt-reasoning-shimmer--active .dt-reasoning-shimmer__dot {
  animation: dt-reasoning-dot-pulse 1.6s ease-in-out infinite;
}
.dt-reasoning-shimmer__label {
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.dt-reasoning-shimmer__bar {
  width: 40px;
  height: 3px;
  border-radius: var(--dt-radius-sm);
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ai-accent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: dt-reasoning-shimmer 1.6s ease-in-out infinite;
  opacity: 0.55;
}
.dt-ai-generation-timer {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ai-text-tertiary);
  margin-top: var(--space-3);
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* ==========================================================
   Section 22: LEGACY — Thinking (CopilotThinking, completed state)
   ========================================================== */
.dt-copilot-thinking {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) 0;
}
.dt-copilot-thinking__header {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-size: var(--ai-fs-sm);
  color: var(--ai-text-secondary);
  background: none;
  border: none;
  padding: 0;
}
.dt-copilot-thinking__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ai-text-tertiary);
}
.dt-copilot-thinking__toggle-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--ai-transition);
}
.dt-copilot-thinking__raw-toggle {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}
.dt-copilot-thinking__raw-toggle:hover {
  color: var(--ai-text-secondary);
}
.dt-copilot-thinking__raw-content {
  font-family: var(--ai-font-mono);
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
  background: var(--ai-bg-code);
  padding: var(--ai-sp-sm);
  border-radius: var(--ai-radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* ==========================================================
   Section 23: LEGACY — Artifact Window (CopilotArtifactWindow)
   ========================================================== */
.dt-ai-artifact-window {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-bg-elevated);
  overflow: hidden;
  margin: var(--ai-sp-sm) 0;
}
.dt-ai-artifact-window--collapsed .dt-ai-artifact-window__body {
  display: none;
}
.dt-ai-artifact-window__header {
  display: flex;
  align-items: center;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
  gap: var(--ai-sp-sm);
}
.dt-ai-artifact-window__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.dt-ai-artifact-window__type {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dt-ai-artifact-window__title {
  font-size: var(--ai-fs-sm);
  font-weight: 600;
  color: var(--ai-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-ai-artifact-window__controls {
  display: flex;
  gap: var(--space-1);
}
.dt-ai-artifact-window__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
}
.dt-ai-artifact-window__toggle:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-artifact-window__body {
  padding: var(--ai-sp-md);
  overflow: auto;
  max-height: 400px;
}
.dt-ai-artifact-window__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-elevated);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  transition: all var(--ai-transition);
}
.dt-ai-artifact-window__btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
  border-color: var(--ai-accent);
}

/* ==========================================================
   Section 24: LEGACY — Cards (Visualization, Table, Dashboard)
   ========================================================== */
.dt-copilot-card {
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-bg-card);
  overflow: hidden;
  margin: var(--ai-sp-sm) 0;
}
.dt-copilot-card--visualization {
  min-height: 200px;
}
.dt-copilot-card--table {
  overflow-x: auto;
}
.dt-copilot-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
  gap: var(--ai-sp-sm);
  font-size: var(--ai-fs-sm);
  font-weight: 600;
}
.dt-copilot-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
  flex-shrink: 0;
}
.dt-copilot-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 28px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: var(--space-2) var(--space-4);
  white-space: nowrap;
}
.dt-copilot-card__action:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-copilot-card__body {
  padding: var(--ai-sp-md);
}
.dt-copilot-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-top: 1px solid var(--ai-border-light);
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
}
.dt-copilot-viz-card {
  position: relative;
}
.dt-copilot-viz-card--expanded {
  position: fixed;
  inset: var(--space-13);
  z-index: 1100;
  margin: 0;
  max-height: none;
}

/* Table-specific */
.dt-copilot-table-filter {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  font-size: var(--ai-fs-xs);
}
.dt-copilot-table-row {
  display: flex;
  align-items: center;
  padding: var(--ai-sp-xs) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
  font-size: var(--ai-fs-xs);
}
.dt-copilot-table-row:hover {
  background: var(--ai-bg-hover);
}
.dt-copilot-table-showmore {
  display: flex;
  justify-content: center;
  padding: var(--ai-sp-sm);
  font-size: var(--ai-fs-xs);
  color: var(--ai-accent);
  cursor: pointer;
}
.dt-copilot-table-showmore:hover {
  color: var(--ai-accent-hover);
}

/* Dashboard card */
.dt-copilot-dashboard-card {
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-bg-card);
  overflow: hidden;
}

/* Candlestick panel */
.dt-copilot-candlestick-panel {
  width: 100%;
  min-height: 300px;
}

/* ==========================================================
   Section 25: LEGACY — Markdown (MarkdownText)
   ========================================================== */
.dt-ai-md {
  font-size: var(--ai-fs-base);
  line-height: 1.6;
  color: var(--ai-text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.dt-ai-md > :first-child { margin-top: 0; }
.dt-ai-md > :last-child { margin-bottom: 0; }
.dt-ai-md__h1 {
  font-size: var(--ai-fs-lg);
  font-weight: 700;
  margin: var(--ai-sp-lg) 0 var(--ai-sp-sm);
  color: var(--ai-text);
  border-bottom: 1px solid var(--ai-border-light);
  padding-bottom: var(--ai-sp-xs);
}
.dt-ai-md__h2 {
  font-size: var(--ai-fs-md);
  font-weight: 600;
  margin: var(--ai-sp-md) 0 var(--ai-sp-xs);
  color: var(--ai-text);
}
.dt-ai-md__h3 {
  font-size: var(--ai-fs-base);
  font-weight: 600;
  margin: var(--ai-sp-sm) 0 var(--ai-sp-xs);
  color: var(--ai-text);
}
.dt-ai-md__p {
  margin: var(--ai-sp-xs) 0 var(--ai-sp-sm);
  line-height: 1.6;
}
.dt-ai-md__ul,
.dt-ai-md__ol {
  margin: var(--ai-sp-xs) 0 var(--ai-sp-sm);
  padding-left: var(--ai-sp-lg);
}
.dt-ai-md__ul li,
.dt-ai-md__ol li {
  margin-bottom: var(--space-1);
  line-height: 1.6;
}
.dt-ai-md__hr {
  border: none;
  border-top: 1px solid var(--ai-border-light);
  margin: var(--ai-sp-lg) 0;
}
.dt-ai-md__link {
  color: var(--ai-text-link);
  text-decoration: none;
  transition: color var(--ai-transition);
}
.dt-ai-md__link:hover {
  color: var(--ai-accent-hover);
  text-decoration: underline;
}
.dt-ai-md__blockquote {
  border-left: 3px solid var(--ai-accent);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  margin: var(--ai-sp-sm) 0;
  color: var(--ai-text-secondary);
  background: var(--ai-bg-elevated);
  border-radius: 0 var(--ai-radius-sm) var(--ai-radius-sm) 0;
}
.dt-ai-md__code-inline {
  font-family: var(--ai-font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  background: var(--ai-bg-code);
  border-radius: var(--dt-radius-sm);
  color: var(--ai-accent);
}
.dt-ai-md__code-block {
  position: relative;
  margin: var(--ai-sp-sm) 0;
  border-radius: var(--ai-radius-sm);
  overflow: hidden;
  border: 1px solid var(--ai-border-light);
}
.dt-ai-md__code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ai-sp-xs) var(--ai-sp-md);
  background: var(--ai-bg-active);
  border-bottom: 1px solid var(--ai-border-light);
}
.dt-ai-md__code-lang {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dt-ai-md__code-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  transition: all var(--ai-transition);
}
.dt-ai-md__code-copy:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-md__code-copy--done {
  color: var(--ai-text-success);
}
.dt-ai-md__code-block pre {
  margin: 0;
  padding: var(--ai-sp-md);
  background: var(--ai-bg-code);
  overflow-x: auto;
  font-family: var(--ai-font-mono);
  font-size: var(--ai-fs-sm);
  line-height: 1.6;
}
.dt-ai-md__code-block code {
  font-family: var(--ai-font-mono);
  font-size: var(--ai-fs-sm);
}
.dt-ai-md__ticker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-3);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  font-weight: 600;
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
  cursor: pointer;
  text-decoration: none;
}
.dt-ai-md__ticker:hover {
  background: rgba(74,144,217,0.25);
}
.dt-ai-md__cite-ref {
  display: inline;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--ai-accent);
  cursor: default;
  vertical-align: super;
  line-height: 1;
  opacity: 0.85;
}
.dt-ai-md__cite-ref:hover {
  opacity: 1;
  text-decoration: underline;
}
.dt-ai-md__table-wrap {
  overflow-x: auto;
  margin: var(--ai-sp-sm) 0;
  border: 1px solid var(--ai-border-light);
  border-radius: var(--ai-radius-sm);
}
.dt-ai-md__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ai-fs-sm);
}
.dt-ai-md__th {
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
  background: var(--ai-bg-active);
  border-bottom: 1px solid var(--ai-border);
  white-space: nowrap;
}
.dt-ai-md__td {
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
  font-size: var(--ai-fs-sm);
}

/* ==========================================================
   Section 26: LEGACY — Generic Button / Input / Select classes
   ========================================================== */
.dt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ai-sp-xs);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-sm);
  font-family: var(--ai-font);
  cursor: pointer;
  transition: all var(--ai-transition);
  white-space: nowrap;
}
.dt-btn-primary {
  background: var(--ai-accent);
  color: var(--color-white);
  border-color: var(--ai-accent);
}
.dt-btn-primary:hover {
  background: var(--ai-accent-hover);
  border-color: var(--ai-accent-hover);
}
.dt-btn-secondary {
  background: var(--ai-bg-elevated);
  color: var(--ai-text);
  border-color: var(--ai-border);
}
.dt-btn-secondary:hover {
  background: var(--ai-bg-hover);
  border-color: var(--ai-text-secondary);
}
.dt-input {
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  font-family: var(--ai-font);
  outline: none;
  transition: border-color var(--ai-transition);
}
.dt-input:focus {
  border-color: var(--ai-border-focus);
}
.dt-select {
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  font-family: var(--ai-font);
  cursor: pointer;
  outline: none;
  transition: border-color var(--ai-transition);
}
.dt-select:focus {
  border-color: var(--ai-border-focus);
}

/* ==========================================================
   Section 27: LEGACY — Research Brief (CopilotResearchBrief)
   ========================================================== */
/* Uses .dt-ai-panel__chip, .dt-input, .dt-select, .dt-btn — already defined above */

/* ==========================================================
   Section 28: Responsive & Full-Screen Adjustments
   ========================================================== */
@media (max-width: 480px) {
  .dt-ai-empty__prompts {
    grid-template-columns: 1fr;
  }
  .dt-ai-msg-bubble-user {
    max-width: 95%;
  }
  .dt-ai-header {
    padding: 0 var(--ai-sp-sm);
  }
  .dt-ai-input {
    padding: var(--ai-sp-sm);
  }
}

/* Full-screen mode adjustments */
.dt-ai-panel--expanded .dt-ai-body {
  max-width: min(1040px, calc(100vw - 96px));
  margin: 0 auto;
  width: 100%;
}
.dt-ai-panel--expanded .dt-ai-footer {
  max-width: min(1040px, calc(100vw - 96px));
  margin: 0 auto;
  width: 100%;
}
.dt-ai-panel--expanded .dt-ai-msg-bubble-user {
  max-width: 70%;
}

/* ==========================================================
   Section 29: Sidebar / Panel Wrapper (for RightRail integration)
   ========================================================== */
.dt-ai-panel-wrapper {
  position: relative;
  height: 100%;
  display: flex;
}

/* ==========================================================
   Section 30: Print Styles
   ========================================================== */
@media print {
  .dt-ai-header,
  .dt-ai-footer,
  .dt-ai-msg-actions,
  .dt-ai-panel__resize-handle {
    display: none !important;
  }
  .dt-ai-panel {
    border: none;
    background: #fff;
    color: #000;
  }
  .dt-ai-msg-bubble-user {
    background: #ffffff;
    border-color: #3a4050;
  }
}


/* ==========================================================
   Section 31: Sidebar (CopilotSidebar)
   ========================================================== */
.dt-ai-sidebar {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.dt-ai-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
}
.dt-ai-sidebar__title {
  font-size: var(--ai-fs-sm);
  font-weight: 600;
  color: var(--ai-text);
}
.dt-ai-sidebar__new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
}
.dt-ai-sidebar__new-btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-sidebar__search {
  padding: var(--ai-sp-sm) var(--ai-sp-md);
}
.dt-ai-sidebar__search-input {
  width: 100%;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  outline: none;
  transition: border-color var(--ai-transition);
}
.dt-ai-sidebar__search-input:focus {
  border-color: var(--ai-border-focus);
}
.dt-ai-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--ai-sp-xs) var(--ai-sp-sm);
}
.dt-ai-sidebar__loading,
.dt-ai-sidebar__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ai-sp-xl);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-sm);
}
.dt-ai-sidebar__group {
  margin-bottom: var(--ai-sp-sm);
}
.dt-ai-sidebar__group-label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--ai-sp-xs) var(--ai-sp-sm);
  margin-bottom: var(--space-1);
}
.dt-ai-sidebar__item {
  display: flex;
  align-items: center;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-radius: var(--ai-radius-sm);
  cursor: pointer;
  transition: background var(--ai-transition);
  gap: var(--ai-sp-sm);
  min-height: 32px;
}
.dt-ai-sidebar__item:hover {
  background: var(--ai-bg-hover);
}
.dt-ai-sidebar__item--active {
  background: var(--ai-accent-subtle);
}
.dt-ai-sidebar__item-title {
  flex: 1;
  font-size: var(--ai-fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ai-text);
}
.dt-ai-sidebar__item-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--ai-transition);
  flex-shrink: 0;
}
.dt-ai-sidebar__item:hover .dt-ai-sidebar__item-actions {
  opacity: 1;
}
.dt-ai-sidebar__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: 0;
}
.dt-ai-sidebar__action-btn:hover {
  background: var(--ai-bg-active);
  color: var(--ai-text);
}
.dt-ai-sidebar__action-btn--delete:hover {
  color: var(--ai-text-error);
}
.dt-ai-sidebar__rename-input {
  flex: 1;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--ai-border-focus);
  border-radius: var(--ai-radius-xs);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  outline: none;
}

/* ==========================================================
   Section 32: LEGACY Old message row classes
   ========================================================== */
.dt-ai-msg-row {
  display: flex;
  gap: var(--ai-sp-md);
  padding: var(--ai-sp-sm) 0;
  position: relative;
}
.dt-ai-msg-row--user {
  justify-content: flex-end;
  padding: var(--ai-sp-xs) 0;
}
.dt-ai-msg-row--assistant {
  flex-direction: row;
  align-items: flex-start;
}

/* ── User bubble ── */
.dt-ai-msg-bubble-user {
  max-width: 85%;
  background: var(--dt-bg-tertiary);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-xs);
}
.dt-ai-msg-bubble-user__text {
  font-size: var(--ai-fs-base);
  line-height: var(--ai-lh);
  color: var(--ai-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.dt-ai-msg-bubble-user__footer {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--ai-transition);
}
.dt-ai-msg-bubble-user:hover .dt-ai-msg-bubble-user__footer {
  opacity: 1;
}

/* ── Avatar ── */
.dt-ai-msg-avatar {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--dt-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ai-fs-xs);
  font-weight: 600;
  margin-top: var(--space-1);
  border: 1px solid color-mix(in srgb, var(--ai-accent) 25%, transparent);
}
.dt-ai-msg-avatar--user {
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
}
.dt-ai-msg-avatar--assistant {
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
}
.dt-ai-msg-avatar__assistant-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Assistant body ── */
.dt-ai-msg-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dt-ai-msg-meta {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
}
.dt-ai-msg-role {
  font-weight: 600;
  color: var(--ai-text-secondary);
}
.dt-ai-msg-time {
  font-size: 10px;
  color: var(--ai-text-tertiary);
}
.dt-ai-msg-edited {
  font-size: 10px;
  color: var(--ai-text-tertiary);
  font-style: italic;
}
.dt-ai-msg-content {
  line-height: var(--ai-lh);
  font-size: var(--ai-fs-base);
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding-top: var(--ai-sp-xs);
}

/* ── Action bar ── */
.dt-ai-msg-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--ai-transition);
  margin-top: var(--ai-sp-xs);
  padding-top: var(--ai-sp-xs);
  border-top: 1px solid transparent;
}
.dt-ai-msg-actions__sep {
  flex: 1;
}
.dt-ai-msg-row:hover .dt-ai-msg-actions {
  opacity: 1;
  border-top-color: var(--ai-border-light);
}
.dt-ai-msg-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: 0;
}
.dt-ai-msg-action-btn:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-msg-action-btn--active { color: var(--ai-accent); }
.dt-ai-msg-action-btn--success { color: var(--ai-text-success); }
.dt-ai-msg-action-btn--active { color: var(--ai-accent); opacity: 1; }

/* ==========================================================
   Section 33: LEGACY Message edit mode
   ========================================================== */
.dt-copilot-msg-edit {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
}
.dt-copilot-msg-edit__textarea {
  width: 100%;
  min-height: 40px;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-border-focus);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-family: var(--ai-font);
  font-size: var(--ai-fs-base);
  line-height: var(--ai-lh);
  resize: none;
  outline: none;
}
.dt-copilot-msg-edit__actions {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
}
.dt-copilot-msg-edit__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--ai-border);
  transition: all var(--ai-transition);
}
.dt-copilot-msg-edit__btn--save {
  background: var(--ai-accent);
  color: var(--color-white);
  border-color: var(--ai-accent);
}
.dt-copilot-msg-edit__btn--save:hover { background: var(--ai-accent-hover); }
.dt-copilot-msg-edit__btn--cancel {
  background: transparent;
  color: var(--ai-text-secondary);
}
.dt-copilot-msg-edit__btn--cancel:hover { background: var(--ai-bg-hover); }

/* ==========================================================
   Section 34: LEGACY Follow-ups
   ========================================================== */
.dt-copilot-followups {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) 0;
}
.dt-copilot-followups--input {
  padding: var(--space-3) var(--space-5) var(--space-1);
  gap: var(--space-3);
  border-top: 1px solid var(--dt-border-primary);
}
.dt-copilot-followup-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ai-sp-xs);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  background: transparent;
  color: var(--dt-text-tertiary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  line-height: 1.4;
  font-family: var(--dt-font-sans);
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.dt-copilot-followup-chip:hover {
  background: var(--dt-bg-hover);
  border-color: var(--dt-border-primary);
  color: var(--dt-text-primary);
}
.dt-copilot-followup-chip:active {
  background: var(--dt-bg-active);
  border-color: var(--dt-border-secondary);
}

/* ==========================================================
   Section 35: LEGACY Empty State
   ========================================================== */
.dt-copilot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: var(--ai-sp-xl);
  text-align: center;
  gap: var(--ai-sp-md);
}
.dt-copilot-empty__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--dt-radius-sm);
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
  font-size: var(--ai-fs-sm);
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--ai-accent) 25%, transparent);
}
.dt-copilot-empty__eyebrow {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dt-copilot-empty__title {
  font-size: var(--ai-fs-lg);
  font-weight: 600;
  color: var(--ai-text);
  margin: 0;
}
.dt-copilot-empty__subtitle {
  font-size: var(--ai-fs-sm);
  color: var(--ai-text-secondary);
  max-width: 300px;
  line-height: var(--ai-lh);
  margin: 0;
}
.dt-copilot-empty__text {
  font-size: var(--ai-fs-sm);
  color: var(--ai-text-secondary);
  margin: 0;
}
.dt-copilot-empty__upgrade-btn {
  padding: var(--ai-sp-sm) var(--ai-sp-lg);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-accent);
  color: var(--color-white);
  font-size: var(--ai-fs-sm);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background var(--ai-transition);
}
.dt-copilot-empty__upgrade-btn:hover { background: var(--ai-accent-hover); }
.dt-copilot-empty__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ai-sp-sm);
  width: 100%;
  max-width: 360px;
  margin-top: var(--ai-sp-sm);
}
.dt-copilot-empty__card {
  display: flex;
  align-items: flex-start;
  gap: var(--dt-space-2);
  padding: var(--dt-space-2) var(--dt-space-3);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  background: var(--dt-bg-secondary);
  cursor: pointer;
  text-align: left;
  font-size: var(--dt-font-size-sm);
  font-weight: 600;
  color: var(--dt-text-secondary);
  line-height: 1.4;
  transition: all var(--dt-transition-fast);
  font-family: var(--dt-font-sans);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.dt-copilot-empty__card:hover {
  background: var(--dt-bg-hover);
  border-color: var(--dt-border-primary);
  color: var(--dt-text-primary);
}
.dt-copilot-empty__card:active {
  background: var(--dt-bg-active);
}
.dt-copilot-empty__card-icon {
  flex-shrink: 0;
  color: var(--ai-accent);
  margin-top: 1px;
}
.dt-copilot-empty__card-label {
  flex: 1;
}

/* ==========================================================
   Section 36: LEGACY Panel header and misc classes
   ========================================================== */
.dt-ai-panel--open:not(.dt-ai-panel--expanded) {
  display: flex;
  position: fixed;
  top: 0;
  right: var(--dt-right-rail-width, 56px);
  bottom: 0;
  z-index: 115;
  max-width: calc(100vw - var(--dt-right-rail-width, 56px));
  height: 100dvh;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
  border-left: 1px solid var(--dt-border-primary);
}
.dt-ai-panel__main {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.dt-ai-panel__header {
  display: flex;
  align-items: center;
  height: var(--ai-header-h);
  min-height: var(--ai-header-h);
  padding: 0 var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border);
  background: var(--ai-bg);
  gap: var(--ai-sp-sm);
  flex-shrink: 0;
}
.dt-ai-panel__title {
  flex: 1;
  min-width: 0;
}
.dt-ai-panel__title-copy {
  display: flex;
  align-items: center;
}
.dt-ai-panel__title-text {
  font-size: var(--ai-fs-md);
  font-weight: 600;
  color: var(--ai-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.dt-ai-panel__title-input {
  background: transparent;
  border: 1px solid var(--ai-border-focus);
  border-radius: var(--ai-radius-xs);
  color: var(--ai-text);
  font-size: var(--ai-fs-md);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  width: 100%;
  outline: none;
}
.dt-ai-panel__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}
.dt-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--ai-radius-sm);
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
  padding: 0;
}
.dt-btn-icon:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-ai-panel__messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--ai-sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-md);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.dt-ai-panel__messages::-webkit-scrollbar { width: 6px; }
.dt-ai-panel__messages::-webkit-scrollbar-track { background: transparent; }
.dt-ai-panel__messages::-webkit-scrollbar-thumb {
  background: var(--ai-border);
  border-radius: var(--dt-radius-sm);
}
.dt-ai-panel__error {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  background: rgba(199, 80, 80,0.1);
  border-bottom: 1px solid rgba(199, 80, 80,0.2);
  color: var(--ai-text-error);
  font-size: var(--ai-fs-sm);
}
.dt-ai-panel__error button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ai-text-error);
  cursor: pointer;
  padding: var(--space-1);
}
.dt-ai-panel__error-retry {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  border: 1px solid rgba(199, 80, 80,0.3);
  border-radius: var(--ai-radius-xs);
  color: var(--ai-text-error);
  font-size: var(--ai-fs-xs);
  padding: var(--space-1) var(--space-4);
  cursor: pointer;
  transition: all var(--ai-transition);
}
.dt-ai-panel__error-retry:hover {
  background: rgba(199, 80, 80,0.15);
}
.dt-ai-panel__cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ai-accent);
  animation: dt-ai-blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}
.dt-ai-panel__thinking {
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-sm);
  font-style: italic;
}

/* ==========================================================
   Section 37: LEGACY Research Brief Skeleton
   ========================================================== */
.dt-copilot-skeleton {
  padding: var(--ai-sp-md);
}


/* ==========================================================
   Section 38: CopilotInput — Input area, textarea, buttons
   ========================================================== */
.dt-ai-panel__input-area {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md) var(--ai-sp-md);
  border-top: 1px solid var(--dt-border-primary);
  background: var(--ai-bg);
  flex-shrink: 0;
}
.dt-ai-panel__input-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-bg-input);
  transition: border-color var(--ai-transition), background var(--ai-transition);
}
.dt-ai-panel__input-wrap:hover {
  border-color: var(--ai-text-tertiary);
}
.dt-ai-panel__input-wrap:focus-within {
  border-color: var(--ai-border-focus);
  background: color-mix(in srgb, var(--ai-bg-input) 88%, var(--ai-bg-elevated));
  box-shadow: var(--ai-focus-ring);
}
.dt-ai-panel__textarea {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 40px;
  max-height: 160px;
  border: none;
  border-radius: calc(var(--ai-radius) - 4px);
  background: transparent;
  color: var(--ai-text);
  font-family: var(--ai-font);
  font-size: var(--ai-fs-base);
  line-height: var(--ai-lh);
  resize: none;
  outline: none;
  padding: var(--space-4) var(--space-6);
  transition: background var(--ai-transition);
}
.dt-ai-panel__textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dt-ai-panel__textarea::-moz-placeholder {
  color: var(--ai-text-tertiary);
}
.dt-ai-panel__textarea::placeholder {
  color: var(--ai-text-tertiary);
}
.dt-ai-panel__send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ai-accent);
  border-radius: var(--dt-radius-sm);
  background: var(--ai-accent);
  color: var(--color-white);
  cursor: pointer;
  transition: all var(--ai-transition);
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.dt-ai-panel__send-btn:hover:not(:disabled) {
  background: var(--ai-accent-hover);
  border-color: var(--ai-accent-hover);
}
.dt-ai-panel__send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.dt-ai-panel__stop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ai-text-error);
  border-radius: var(--dt-radius-sm);
  background: var(--ai-text-error);
  color: var(--color-white);
  cursor: pointer;
  transition: all var(--ai-transition);
  flex-shrink: 0;
  padding: 0;
  margin: 0;
}
.dt-ai-panel__stop-btn:hover {
  opacity: 0.85;
}

/* ==========================================================
   Section 39: CopilotInput — Context chips
   ========================================================== */
.dt-copilot-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ai-sp-xs);
  padding: var(--ai-sp-sm) var(--ai-sp-md) 0;
}
.dt-copilot-context-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--dt-radius-sm);
  font-size: var(--ai-fs-xs);
  background: var(--dt-bg-tertiary);
  color: var(--ai-text-secondary);
  border: 1px solid var(--dt-border-primary);
  white-space: nowrap;
  max-width: 200px;
}
.dt-copilot-context-chip--button {
  cursor: pointer;
  font: inherit;
  transition: all var(--ai-transition);
}
.dt-copilot-context-chip--button:hover {
  background: var(--ai-bg-hover);
  border-color: var(--ai-accent);
}
.dt-copilot-context-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.dt-copilot-context-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-tertiary);
  transition: color var(--ai-transition);
  flex-shrink: 0;
}
.dt-copilot-context-chip--button:hover .dt-copilot-context-chip__remove {
  color: var(--ai-text-error);
}

/* ==========================================================
   Section 40: CopilotInput — Mention/Slash dropdowns
   ========================================================== */
.dt-copilot-mention-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: var(--space-2);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
}
.dt-copilot-mention-item {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: var(--ai-fs-sm);
  color: var(--ai-text);
  font-family: var(--ai-font);
  transition: background var(--ai-transition);
}
.dt-copilot-mention-item:hover,
.dt-copilot-mention-item--active {
  background: var(--ai-bg-hover);
}
.dt-copilot-mention-symbol {
  font-weight: 600;
  color: var(--ai-accent);
  font-size: var(--ai-fs-sm);
  white-space: nowrap;
}
.dt-copilot-mention-name {
  flex: 1;
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-copilot-mention-type {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
}

/* ==========================================================
   Section 41: CopilotInput — Footer, char count, hints
   ========================================================== */
.dt-copilot-input-footer {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
  min-width: 0;
  padding: 0;
}
.dt-copilot-input-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  row-gap: var(--space-3);
  flex-wrap: wrap;
  min-width: 0;
}
.dt-copilot-input-meta {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  flex-wrap: wrap;
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  line-height: 1.35;
}
.dt-copilot-input-status {
  color: var(--ai-text-tertiary);
  font-size: var(--ai-fs-xs);
}
.dt-copilot-input-status--error {
  color: var(--ai-text-error);
}
.dt-copilot-char-count {
  font-variant-numeric: tabular-nums;
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
}
.dt-copilot-char-count--warn {
  color: var(--ai-text-error);
  font-weight: 600;
}
.dt-copilot-newline-hint {
  opacity: 0.5;
  font-size: var(--ai-fs-xs);
}

/* ==========================================================
   Section 42: CopilotInput — Control selects
   ========================================================== */
.dt-copilot-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.dt-copilot-control__label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
}
.dt-copilot-control__select {
  font-size: var(--ai-fs-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--ai-radius-xs);
  border: 1px solid var(--ai-border);
  background: var(--ai-bg-elevated);
  color: var(--ai-text);
  cursor: pointer;
  outline: none;
}

/* ==========================================================
   Section 43: CopilotInput — Attachment picker
   ========================================================== */
.dt-copilot-attachment-picker {
  position: relative;
}
.dt-copilot-attachment-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 28px;
  padding: 3px var(--space-4);
  border-radius: var(--dt-radius-sm);
  border: 1px solid var(--dt-border-primary);
  background: transparent;
  color: var(--dt-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  font-family: var(--dt-font-sans);
  font-weight: 600;
}
.dt-copilot-attachment-picker__trigger:hover:not(:disabled) {
  background: var(--dt-bg-hover);
  border-color: var(--dt-border-secondary);
  color: var(--dt-text-primary);
}
.dt-copilot-attachment-picker__trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ==========================================================
   Section 44: CopilotInput — URL picker
   ========================================================== */
.dt-copilot-url-picker {
  position: relative;
}
.dt-copilot-url-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 28px;
  padding: 3px var(--space-4);
  border-radius: var(--dt-radius-sm);
  border: 1px solid var(--dt-border-primary);
  background: transparent;
  color: var(--dt-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  font-family: var(--dt-font-sans);
  font-weight: 600;
}
.dt-copilot-url-picker__trigger:hover:not(:disabled),
.dt-copilot-url-picker__trigger--active {
  background: var(--dt-bg-hover);
  border-color: var(--dt-border-secondary);
  color: var(--dt-text-primary);
}
.dt-copilot-url-picker__trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.dt-copilot-url-picker__menu {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: var(--space-3);
  width: min(320px, calc(100vw - var(--dt-right-rail-width, 56px) - 28px));
  max-width: calc(100vw - var(--dt-right-rail-width, 56px) - 28px);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-md);
  z-index: 30;
  padding: var(--ai-sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
}
.dt-copilot-url-picker__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ai-sp-sm);
}
.dt-copilot-url-picker__title {
  font-size: var(--ai-fs-sm);
  font-weight: 600;
  color: var(--ai-text);
}
.dt-copilot-url-picker__subtitle {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  line-height: var(--ai-lh);
  margin-top: var(--space-1);
}
.dt-copilot-url-picker__clear {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-error);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}
.dt-copilot-url-picker__controls {
  display: flex;
  gap: var(--ai-sp-sm);
}
.dt-copilot-url-picker__input {
  flex: 1;
  padding: var(--ai-sp-sm);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-input);
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  outline: none;
}
.dt-copilot-url-picker__input:focus {
  border-color: var(--ai-border-focus);
}
.dt-copilot-url-picker__add {
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: 1px solid var(--ai-accent);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-accent);
  color: var(--color-white);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ai-transition);
}
.dt-copilot-url-picker__add:hover {
  background: var(--ai-accent-hover);
}
.dt-copilot-url-picker__error {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-error);
}
.dt-copilot-url-picker__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 150px;
  overflow-y: auto;
}
.dt-copilot-url-picker__item {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm);
  border-radius: var(--ai-radius-sm);
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--ai-font);
  transition: background var(--ai-transition);
  width: 100%;
}
.dt-copilot-url-picker__item:hover {
  background: var(--ai-bg-hover);
}
.dt-copilot-url-picker__item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dt-copilot-url-picker__item-label {
  font-size: var(--ai-fs-sm);
  color: var(--ai-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-copilot-url-picker__item-url {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-copilot-url-picker__item-remove {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-error);
  white-space: nowrap;
  flex-shrink: 0;
}
.dt-copilot-url-picker__empty {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-align: center;
  padding: var(--ai-sp-sm);
}

/* ==========================================================
   Section 45: CopilotInput — Widget picker
   ========================================================== */
.dt-copilot-widget-picker {
  position: relative;
}
.dt-copilot-widget-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-4);
  border-radius: var(--ai-radius-sm);
  border: 1px solid var(--ai-border);
  background: var(--ai-bg-elevated);
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  transition: all var(--ai-transition);
  font-family: var(--ai-font);
}
.dt-copilot-widget-picker__trigger:hover:not(:disabled),
.dt-copilot-widget-picker__trigger--active {
  border-color: var(--ai-accent);
  color: var(--ai-text);
}
.dt-copilot-widget-picker__trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.dt-copilot-widget-picker__menu {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: var(--space-3);
  width: min(320px, calc(100vw - var(--dt-right-rail-width, 56px) - 28px));
  max-width: calc(100vw - var(--dt-right-rail-width, 56px) - 28px);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-md);
  z-index: 30;
  padding: var(--ai-sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
}
.dt-copilot-widget-picker__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ai-sp-sm);
}
.dt-copilot-widget-picker__title {
  font-size: var(--ai-fs-sm);
  font-weight: 600;
  color: var(--ai-text);
}
.dt-copilot-widget-picker__subtitle {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  line-height: var(--ai-lh);
  margin-top: var(--space-1);
}
.dt-copilot-widget-picker__clear {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-error);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}
.dt-copilot-widget-picker__list {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-xs);
  max-height: 200px;
  overflow-y: auto;
}
.dt-copilot-widget-picker__item {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--ai-font);
  transition: all var(--ai-transition);
  width: 100%;
}
.dt-copilot-widget-picker__item:hover {
  border-color: var(--ai-accent);
  background: var(--ai-bg-hover);
}
.dt-copilot-widget-picker__item--selected {
  border-color: var(--ai-accent);
  background: var(--ai-accent-subtle);
}
.dt-copilot-widget-picker__checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  flex-shrink: 0;
  color: transparent;
  transition: all var(--ai-transition);
}
.dt-copilot-widget-picker__item--selected .dt-copilot-widget-picker__checkbox {
  background: var(--ai-accent);
  border-color: var(--ai-accent);
  color: var(--color-white);
}
.dt-copilot-widget-picker__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dt-copilot-widget-picker__item-title {
  font-size: var(--ai-fs-sm);
  color: var(--ai-text);
  font-weight: 500;
}
.dt-copilot-widget-picker__item-description {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-secondary);
}
.dt-copilot-widget-picker__item-meta {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
}
.dt-copilot-widget-picker__badge {
  font-size: var(--ai-fs-xs);
  padding: 1px var(--space-3);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-bg-badge);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}
.dt-copilot-widget-picker__item--selected .dt-copilot-widget-picker__badge {
  background: var(--ai-accent-subtle);
  color: var(--ai-accent);
}


/* ==========================================================
   Section 46: CopilotPromptTemplates
   ========================================================== */
.dt-copilot-templates {
  position: relative;
}
.dt-copilot-templates__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 28px;
  padding: 3px var(--space-4);
  border-radius: var(--dt-radius-sm);
  border: 1px solid var(--dt-border-primary);
  background: transparent;
  color: var(--dt-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  font-family: var(--dt-font-sans);
  font-weight: 600;
}
.dt-copilot-templates__trigger:hover:not(:disabled),
.dt-copilot-templates__trigger--active {
  background: var(--dt-bg-hover);
  border-color: var(--dt-border-secondary);
  color: var(--dt-text-primary);
}
.dt-copilot-templates__panel {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: var(--space-3);
  width: min(320px, calc(100vw - var(--dt-right-rail-width, 56px) - 28px));
  max-height: 360px;
  max-width: calc(100vw - var(--dt-right-rail-width, 56px) - 28px);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-md);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 720px) {
  .dt-ai-panel--open:not(.dt-ai-panel--expanded) {
    right: 0;
    max-width: 100vw;
    width: 100vw !important;
  }

  .dt-ai-header {
    padding-left: var(--ai-sp-sm);
    padding-right: var(--ai-sp-sm);
  }

  .dt-ai-panel--expanded .dt-ai-body,
  .dt-ai-panel--expanded .dt-ai-footer {
    max-width: calc(100vw - 24px);
  }
}
.dt-copilot-templates__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border-bottom: 1px solid var(--ai-border-light);
}
.dt-copilot-templates__title {
  font-size: var(--ai-fs-sm);
  font-weight: 600;
  color: var(--ai-text);
}
.dt-copilot-templates__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  padding: 0;
}
.dt-copilot-templates__close:hover {
  background: var(--ai-bg-hover);
  color: var(--ai-text);
}
.dt-copilot-templates__search {
  width: 100%;
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  border: none;
  border-bottom: 1px solid var(--ai-border-light);
  background: transparent;
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  outline: none;
}
.dt-copilot-templates__search::-moz-placeholder {
  color: var(--ai-text-tertiary);
}
.dt-copilot-templates__search::placeholder {
  color: var(--ai-text-tertiary);
}
.dt-copilot-templates__categories {
  display: flex;
  gap: var(--ai-sp-xs);
  padding: var(--ai-sp-sm) var(--ai-sp-md);
  overflow-x: auto;
  flex-shrink: 0;
}
.dt-copilot-templates__category-pill {
  padding: var(--space-1) var(--space-5);
  border-radius: var(--ai-radius-sm);
  border: 1px solid var(--ai-border);
  background: transparent;
  color: var(--ai-text-secondary);
  font-size: var(--ai-fs-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--ai-transition);
  font-family: var(--ai-font);
}
.dt-copilot-templates__category-pill:hover {
  border-color: var(--ai-accent);
}
.dt-copilot-templates__category-pill--active {
  background: var(--ai-accent-subtle);
  border-color: var(--ai-accent);
  color: var(--ai-accent);
}
.dt-copilot-templates__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--ai-sp-sm);
}
.dt-copilot-templates__category {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--ai-sp-xs) var(--ai-sp-sm);
  margin-top: var(--ai-sp-sm);
}
.dt-copilot-templates__category:first-child {
  margin-top: 0;
}
.dt-copilot-templates__item {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-sm);
  border-radius: var(--ai-radius-sm);
  border: none;
  background: transparent;
  color: var(--ai-text);
  font-size: var(--ai-fs-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--ai-font);
  transition: background var(--ai-transition);
}
.dt-copilot-templates__item:hover {
  background: var(--ai-bg-hover);
}
.dt-copilot-templates__item-icon {
  color: var(--ai-accent);
  flex-shrink: 0;
}
.dt-copilot-templates__item-label {
  flex: 1;
}
.dt-copilot-templates__item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: var(--ai-radius-xs);
  background: transparent;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: all var(--ai-transition);
  flex-shrink: 0;
}
.dt-copilot-templates__item:hover .dt-copilot-templates__item-remove {
  opacity: 1;
}
.dt-copilot-templates__item-remove:hover {
  color: var(--ai-text-error);
}
.dt-copilot-templates__empty {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  text-align: center;
  padding: var(--ai-sp-lg);
}

/* ==========================================================
   Section 47: Research Brief Skeleton
   ========================================================== */
.dt-copilot-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-md);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  margin: var(--ai-sp-sm) 0;
}
.dt-copilot-skeleton__line {
  height: 12px;
  background: var(--ai-bg-active);
  border-radius: var(--ai-radius-xs);
  animation: dt-ai-pulse 1.5s ease-in-out infinite;
}
.dt-copilot-skeleton__line--short {
  width: 60%;
}
.dt-copilot-skeleton__line--medium {
  width: 80%;
}
.dt-copilot-skeleton-bar {
  background: var(--ai-bg-active);
  animation: dt-ai-pulse 1.5s ease-in-out infinite;
}

/* ==========================================================
   Section 48a: Inline Chart / Table wrappers
   ========================================================== */
.dt-copilot-inline-viz {
  margin: var(--ai-sp-sm) 0;
}
.dt-copilot-inline-viz--expanded {
  margin: var(--ai-sp-md) calc(-1 * var(--ai-sp-md));
}
.dt-copilot-inline-table {
  margin: var(--ai-sp-sm) 0;
}
.dt-copilot-inline-table--expanded {
  margin: var(--ai-sp-md) calc(-1 * var(--ai-sp-md));
}

/* ==========================================================
   Section 48: CopilotCitations (legacy class)
   ========================================================== */
.dt-copilot-citations {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ai-sp-xs);
  margin-top: var(--ai-sp-sm);
}
.dt-copilot-citation-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--ai-radius-sm);
  font-size: var(--ai-fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ai-transition);
  text-decoration: none;
  border: 1px solid var(--ai-border-light);
  background: var(--ai-bg-badge);
  color: var(--ai-text-secondary);
}
.dt-copilot-citation-chip:hover {
  border-color: var(--ai-accent);
  color: var(--ai-text);
}

/* ── Date separator ── */
.dt-ai-date-separator {
  display: flex;
  align-items: center;
  gap: var(--ai-sp-sm);
  padding: var(--ai-sp-xs) var(--ai-sp-lg);
  margin: var(--ai-sp-xs) 0;
}
.dt-ai-date-separator::before,
.dt-ai-date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ai-border-light);
}
.dt-ai-date-separator__label {
  font-size: var(--ai-fs-xs);
  color: var(--ai-text-tertiary);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ── Drag & drop overlay ── */
.dt-ai-panel__input-area--dragover {
  outline: 2px dashed var(--ai-accent);
  outline-offset: -2px;
  background: rgba(74,144,217,0.06);
  border-radius: var(--ai-radius);
}

/* ── Character counter danger state ── */
.dt-copilot-char-count--danger {
  color: var(--dt-negative) !important;
  font-weight: 600;
}

/* ── Touch/mobile: always show actions ── */
@media (hover: none), (pointer: coarse) {
  .dt-ai-msg-actions {
    opacity: 1 !important;
  }
  .dt-ai-msg-bubble-user__footer .dt-ai-msg-action-btn {
    opacity: 1 !important;
  }
}

/* ── Edit button always visible (subtle, stronger on hover) ── */
.dt-ai-msg-bubble-user__footer .dt-ai-msg-action-btn {
  opacity: 0.4;
  transition: opacity var(--ai-transition);
}
.dt-ai-msg-bubble-user:hover .dt-ai-msg-bubble-user__footer .dt-ai-msg-action-btn,
.dt-ai-msg-bubble-user__footer .dt-ai-msg-action-btn:focus-visible {
  opacity: 1;
}
/* ══════════════════════════════════════════════════════════════════════════════
   Design System for dibsTERMINAL — OpenBB-inspired dark theme
   Based on OpenBB Design System (OpenBB-finance/design-system)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Geist Sans — variable font from Vercel */
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── Color Palette — OpenBB Dark ── */
  /* Backgrounds — deep charcoal, not pure black */
  --dt-bg-primary: #131313;
  --dt-bg-secondary: #1F1E23;
  --dt-bg-tertiary: #24242A;
  --dt-bg-hover: rgba(255, 255, 255, 0.05);
  --dt-bg-active: rgba(255, 255, 255, 0.08);
  --dt-bg-input: #1A1A1F;

  /* Spec-named background aliases */
  --bg-base: var(--dt-bg-primary);
  --bg-surface: var(--dt-bg-secondary);
  --bg-elevated: var(--dt-bg-tertiary);
  --bg-hover: var(--dt-bg-hover);
  --bg-selected: var(--dt-bg-active);
  --bg-input: var(--dt-bg-input);

  /* Borders */
  --dt-border-primary: rgba(255,255,255,0.08);
  --dt-border-secondary: rgba(255,255,255,0.12);
  --dt-border-strong: rgba(255,255,255,0.20);
  --dt-border-focus: #00AAFF;

  /* Spec-named border aliases */
  --border-subtle: var(--dt-border-primary);
  --border-default: var(--dt-border-secondary);
  --border-strong: var(--dt-border-strong);
  --dt-border-subtle: var(--dt-border-primary);

  /* Text — bright off-white hierarchy */
  --dt-text-primary: #EAEAEA;
  --dt-text-secondary: #C8C8C8;
  --dt-text-tertiary: #5A5A5A;
  --dt-text-disabled: #474747;
  --dt-text-inverse: #131313;

  /* Spec-named text aliases */
  --text-primary: var(--dt-text-primary);
  --text-secondary: var(--dt-text-secondary);
  --text-muted: var(--dt-text-tertiary);
  --text-inverse: var(--dt-text-inverse);

  /* Accent — OpenBB blue */
  --dt-accent-blue: #00AAFF;
  --dt-accent-blue-hover: #0088CC;
  --dt-accent-muted: rgba(0, 170, 255, 0.1);
  --dt-accent-glow: rgba(0, 170, 255, 0.15);
  --dt-accent-green: #16A34A;
  --dt-accent-red: #DC2626;
  --dt-accent-yellow: #EA580C;
  --dt-accent-orange: #F97316;
  --dt-accent-purple: #6D38C4;
  --dt-accent-cyan: #33BBFF;

  /* Spec-named accent aliases */
  --accent: var(--dt-accent-blue);
  --accent-hover: var(--dt-accent-blue-hover);
  --accent-muted: var(--dt-accent-muted);
  --accent-glow: var(--dt-accent-glow);

  /* Financial colors — proper OpenBB green/red */
  --dt-positive: #16A34A;
  --dt-positive-dim: rgba(22, 163, 74, 0.08);
  --dt-negative: #DC2626;
  --dt-negative-dim: rgba(220, 38, 38, 0.08);
  --dt-neutral: #5A5A5A;
  --dt-unchanged: #474747;

  /* Spec-named financial aliases */
  --positive: var(--dt-positive);
  --positive-dim: var(--dt-positive-dim);
  --negative: var(--dt-negative);
  --negative-dim: var(--dt-negative-dim);
  --neutral: var(--dt-neutral);

  /* Color groups — OpenBB-inspired palette */
  --dt-group-1: #00AAFF;
  --dt-group-2: #16A34A;
  --dt-group-3: #F97316;
  --dt-group-4: #6D38C4;
  --dt-group-5: #33BBFF;
  --dt-group-6: #DC2626;

  /* Chart palette — vibrant OpenBB colors */
  --chart-1: #00AAFF;
  --chart-2: #16A34A;
  --chart-3: #F97316;
  --chart-4: #6D38C4;
  --chart-5: #33BBFF;
  --chart-6: #DC2626;
  --chart-7: #EA580C;
  --chart-8: #22C55E;

  /* Typography — clean system stack like OpenBB */
  --dt-font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  --dt-font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'PT Mono', 'Liberation Mono', Courier, monospace;
  --dt-font-size-xs: 12px;
  --dt-font-size-sm: 13px;
  --dt-font-size-base: 14px;
  --dt-font-size-md: 15px;
  --dt-font-size-lg: 16px;
  --dt-font-size-xl: 18px;
  --dt-font-size-2xl: 24px;
  --dt-font-size-3xl: 30px;
  --dt-font-size-4xl: 40px;

  /* Spacing — existing --dt-space-* kept for backward compat */
  --dt-space-0: 2px;
  --dt-space-half: 3px;
  --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;
  --dt-space-10: 40px;
  --dt-space-12: 48px;

  /* Spec spacing scale */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 12px;
  --space-6: 16px;
  --space-7: 20px;
  --space-8: 24px;
  --space-9: 32px;
  --space-10: 40px;

  /* Border radii — OpenBB-style: rounded but restrained */
  --dt-radius-sm: 4px;
  --dt-radius-md: 6px;
  --dt-radius-lg: 8px;
  --dt-radius-xl: 12px;

  /* Shadows — OpenBB dark */
  --dt-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.06);
  --dt-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.06);
  --dt-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.06);
  --dt-shadow-xl: 0 14px 44px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);
  --dt-shadow-glow-blue: 0 0 0 2px rgba(0, 170, 255, 0.4);

  /* Theme-aware utility vars */
  --dt-grid-line: rgba(255,255,255,0.05);
  --dt-nav-scrolled-bg: rgba(19, 19, 19, 0.95);
  --dt-feature-hover-bg: rgba(255, 255, 255, 0.04);
  --dt-overlay: rgba(0, 0, 0, 0.6);

  /* Layout — slightly more generous than before (OpenBB-like) */
  --dt-sidebar-width: 240px;
  --dt-sidebar-collapsed-width: 56px;
  --dt-right-rail-width: 56px;
  --dt-topbar-height: 45px;
  --dt-widget-header-height: 42px;
  --dt-statusbar-height: 24px;

  /* Row heights */
  --row-data: 34px;
  --row-compact: 28px;

  /* Transitions — smooth OpenBB-like feel */
  --dt-transition-fast: 140ms ease;
  --dt-transition-normal: 200ms ease-out;
  --dt-transition-slow: 320ms ease;

  /* Z-index stack */
  --z-base: 0;
  --z-widget: 10;
  --z-sticky: 20;
  --z-dropdown: 100;
  --z-modal: 200;
  --z-toast: 300;

  /* ── Extended palette — OpenBB tokens ── */
  /* Text variants */
  --dt-text-muted: #5A5A5A;
  --dt-text-dim: #474747;
  --dt-text-slate: #474747;
  --dt-text-bright: #F6F6F6;
  --dt-text-light: #808080;
  --dt-text-on-accent: #ffffff;

  /* Background variants */
  --dt-bg-deep: #070707;
  --dt-bg-alt: #070707;
  --dt-bg-panel-alt: #1F1E23;

  /* Border variant */
  --dt-border-muted: rgba(255,255,255,0.05);

  /* Accent variants — OpenBB */
  --dt-accent-blue-soft: rgba(0, 170, 255, 0.15);
  --dt-accent-blue-mid: #0088CC;
  --dt-accent-green-alt: #15803D;
  --dt-accent-green-dark: #166534;
  --dt-accent-amber: #EA580C;

  /* ── 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: #ffffff;
  --color-green: var(--dt-positive);
  --color-greenD: var(--dt-accent-green-dark);
  --color-greenBg: rgba(22, 163, 74, 0.08);
  --color-greenBgS: rgba(22, 163, 74, 0.15);
  --color-red: var(--dt-negative);
  --color-redBg: rgba(220, 38, 38, 0.08);
  --color-redBgS: rgba(220, 38, 38, 0.15);
  --color-yellow: var(--dt-accent-yellow);
  --color-yellowBg: rgba(234, 88, 12, 0.08);
  --color-yellowBgS: rgba(234, 88, 12, 0.15);
  --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: var(--dt-bg-secondary);
  --color-titleInactive: var(--dt-bg-secondary);
  --color-bevelLight: rgba(255, 255, 255, 0.04);
  --color-bevelDark: var(--dt-bg-primary);
  --color-statusBg: var(--dt-bg-secondary);

  /* Legacy sidebar/topbar vars */
  --dt-sidebar-bg: #1F1E23;
  --dt-sidebar-border: rgba(255,255,255,0.06);
  --dt-sidebar-text: var(--dt-text-secondary);
  --dt-sidebar-text-active: var(--dt-text-primary);
  --dt-sidebar-hover: rgba(255, 255, 255, 0.05);
  --dt-sidebar-active-bg: rgba(255, 255, 255, 0.05);
  --dt-sidebar-active-accent: var(--dt-accent-blue);
  --dt-sidebar-section-label: var(--dt-text-tertiary);
  --dt-topbar-bg: var(--dt-bg-primary);
  --dt-topbar-border: rgba(255,255,255,0.08);
  --dt-topbar-text: var(--dt-text-primary);
  --dt-content-bg: var(--dt-bg-primary);
}

::-moz-selection {
  background: rgba(0, 170, 255, 0.3);
  color: var(--dt-text-primary);
}

::selection {
  background: rgba(0, 170, 255, 0.3);
  color: var(--dt-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Global Reset — OpenBB
   ═══════════════════════════════════════════════════════════════════════════ */

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

.dt-route-viewport {
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Scrollbar Styling — OpenBB-style: thin, subtle
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
::-webkit-scrollbar-corner { background: transparent; }


/* ═══════════════════════════════════════════════════════════════════════════
   Data Table — OpenBB database-view style
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

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

.dt-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--dt-border-primary);
  white-space: nowrap;
  vertical-align: middle;
  color: var(--dt-text-primary);
}

.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 .right, .dt-table th.right { text-align: right; }

.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);
}

/* Dense table variant for data-heavy views */
.dt-table--dense th,
.dt-table--dense td {
  padding: var(--space-2) var(--space-4);
  font-size: var(--dt-font-size-xs);
}

/* Unified table enhancements */
.dt-table th:hover .filter-icon { opacity: 0.5 !important; }
.dt-table th:hover .resize-handle { background: var(--dt-border-secondary) !important; }
.dt-table .center-align { text-align: center; }

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.15; }
}

.unified-table-wrapper { min-width: 0; }
.unified-table-container::-webkit-scrollbar { width: 6px; height: 6px; }
.unified-table-container::-webkit-scrollbar-track { background: transparent; }
.unified-table-container::-webkit-scrollbar-thumb {
  background: var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Widget Container — OpenBB-style cards
   ═══════════════════════════════════════════════════════════════════════════ */

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

.dt-widget:focus-within {
  border-color: var(--dt-border-strong);
}

.dt-widget-header {
  height: var(--dt-widget-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--dt-space-4);
  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-3);
}

.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-4);
}

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


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

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

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

.dt-shell__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.dt-shell__right-dock {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  z-index: 0;
}

.dt-shell__right-dock--overlay {
  overflow: visible;
  z-index: 1300;
}

.dt-shell__right-dock--expanded {
  position: fixed;
  right: var(--dt-right-rail-width, 56px);
  top: 0;
  width: 65vw;
  height: 100vh;
  z-index: 100;
  overflow: visible;
  box-shadow: -1px 0 0 var(--dt-border-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Sidebar — OpenBB-style navigation
   ═══════════════════════════════════════════════════════════════════════════ */

.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;
  position: relative;
  z-index: 2;
}

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

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

.dt-sidebar__logo-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--dt-text-primary) !important;
  letter-spacing: -0.02em;
  line-height: 1;
}

.dt-sidebar__logo-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--dt-text-tertiary) !important;
  letter-spacing: -0.01em;
  line-height: 1;
}

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

.dt-sidebar__section { margin-bottom: var(--space-2); }

.dt-sidebar__section + .dt-sidebar__section {
  margin-top: var(--space-4);
  padding-top: var(--space-6);
  position: relative;
}

/* Visible section divider line */
.dt-sidebar__section + .dt-sidebar__section::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--dt-border-primary);
  margin: 0 var(--space-6) var(--space-6);
}

.dt-sidebar__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--dt-text-tertiary);
  opacity: 0.8;
  white-space: nowrap;
}

.dt-sidebar__section-header--mixed-case {
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--dt-text-secondary);
  opacity: 1;
}

.dt-sidebar__section-header button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: var(--dt-radius-sm);
  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);
}

/* ── Collapsible section animation ─────────────────────────────────── */
.dt-sidebar__collapsible {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 220ms ease-out, opacity 180ms ease-out;
  opacity: 1;
  overflow: hidden;
}
.dt-sidebar__collapsible--closed {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}
.dt-sidebar__collapsible-inner {
  overflow: hidden;
  min-height: 0;
}

/* Chevron rotation */
.dt-sidebar__chevron {
  transition: transform 220ms ease-out;
  flex-shrink: 0;
  color: var(--dt-text-secondary);
}
.dt-sidebar__chevron--collapsed {
  transform: rotate(-90deg);
}

.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);
  letter-spacing: 0.02em;
  color: var(--dt-text-tertiary);
  font-weight: 500;
  opacity: 0.8;
}

.dt-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--dt-space-3);
  padding: 6px var(--dt-space-4);
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  font-size: var(--dt-font-size-sm);
  font-weight: 400;
  border-radius: var(--dt-radius-sm);
  text-decoration: none;
  margin: 1px 8px;
}

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

.dt-sidebar-item.active {
  background: var(--dt-sidebar-active-bg);
  color: var(--dt-text-primary);
  font-weight: 500;
}

.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: var(--space-4);
  min-height: 30px;
  padding: 0 10px;
  margin: 1px 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--dt-sidebar-text);
  cursor: pointer;
  border-radius: var(--dt-radius-sm);
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  box-sizing: border-box;
  letter-spacing: -0.01em;
}

.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-text-primary);
  font-weight: 500;
}

.dt-sidebar__item--locked {
  color: var(--dt-text-secondary);
  opacity: 0.88;
}

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

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

.dt-sidebar__item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-weight: 400;
}

.dt-sidebar__item-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.dt-sidebar__item-subtitle {
  display: none;
}

.dt-sidebar__item-code {
  margin-left: auto;
  font-size: 10px;
  color: var(--dt-text-tertiary);
  font-family: var(--dt-font-mono);
  letter-spacing: 0.05em;
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-sm);
  padding: var(--space-1) var(--space-3);
  background: transparent;
  line-height: 1.3;
  flex-shrink: 0;
}

.dt-sidebar__item-lock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 9px;
  font-family: var(--dt-font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dt-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--dt-radius-sm);
  padding: 1px var(--space-3);
  line-height: 1.2;
}

.dt-sidebar__empty {
  padding: var(--space-3) var(--space-8) var(--space-5);
  font-size: 11px;
  color: var(--dt-text-tertiary);
}

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

.dt-sidebar__collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  border: none;
  border-radius: var(--dt-radius-sm);
  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 {
  width: var(--dt-sidebar-collapsed-width);
}

.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,
.dt-shell--collapsed .dt-sidebar__item-body {
  display: none !important;
}

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

.dt-shell--collapsed .dt-sidebar__logo-brand {
  font-size: 13px;
}

.dt-shell--collapsed .dt-sidebar__item {
  padding: 0;
  margin: 1px var(--space-2);
  width: calc(100% - 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: var(--dt-radius-sm);
}

.dt-shell--collapsed .dt-sidebar__section-header {
  display: none;
}

.dt-sidebar__section-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-3) 0 var(--space-1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   TopBar — OpenBB-style clean header
   ═══════════════════════════════════════════════════════════════════════════ */

.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 var(--space-5) 0 0;
  gap: var(--space-4);
  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: var(--dt-radius-sm);
  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: var(--space-2);
}
.dt-topbar__logo-k { color: var(--dt-text-primary); }

/* Search button — centered (see consolidated rule below) */
.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: var(--dt-radius-sm);
  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 { display: none; }

/* Help Center link */
.dt-topbar__help-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--dt-radius-sm);
  color: var(--dt-text-secondary);
  font-size: 13px;
  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: var(--dt-radius-sm);
  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-bg-tertiary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  padding: 0;
  overflow: hidden;
  line-height: 0;
  transition: opacity 0.12s, transform 0.12s;
}
.dt-topbar__avatar:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.dt-topbar__avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  -o-object-fit: cover;
     object-fit: cover;
}

/* 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: 50%;
  border: 1px solid var(--dt-border-secondary);
  color: var(--dt-text-secondary);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-family: var(--dt-font-mono);
  letter-spacing: 0.08em;
}
.dt-topbar__menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--dt-radius-sm);
  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: 560px;
}

.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: var(--dt-radius-sm);
  border: 1px solid var(--dt-border-secondary);
  color: var(--dt-text-secondary);
  background: rgba(255, 255, 255, 0.04);
  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: var(--space-4);
  padding: 6px var(--space-6);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dt-text-tertiary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
  width: 480px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

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

.dt-topbar__search-btn kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--dt-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  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: var(--dt-radius-sm);
  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: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--dt-radius-sm);
  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-bg-tertiary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  line-height: 0;
  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;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--space-4);
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}
.dt-content--no-pad {
  padding: 0;
  overflow: hidden;
}

.dt-content--no-pad > .dt-now-grid,
.dt-content--no-pad > :first-child {
  width: 100%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   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: 500;
  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 rgba(79, 138, 251, 0.5);
  outline-offset: 1px;
}

/* Universal focus-visible for all interactive elements */
button:focus-visible,
[role="button"]:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(79, 138, 251, 0.5);
  outline-offset: 1px;
}

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

.dt-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Primary Button — OpenBB blue */
.dt-btn-primary {
  background: #00AAFF;
  color: #ffffff;
  border-color: #00AAFF;
}

.dt-btn-primary:hover:not(:disabled) {
  background: #1B6EC2;
  border-color: #1B6EC2;
}

.dt-btn-primary:active:not(:disabled) {
  background: #1560A9;
  border-color: #1560A9;
  transform: scale(0.98);
}

/* 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(232,69,60,0.15);
  color: var(--dt-negative);
  border-color: rgba(232,69,60,0.4);
}

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

.dt-btn-danger:active:not(:disabled) {
  background: rgba(232,69,60,0.35);
  transform: scale(0.98);
}

.dt-btn-icon {
  padding: var(--dt-space-1);
  border-radius: var(--dt-radius-sm);
  background: transparent;
  color: var(--dt-text-secondary);
  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: var(--space-1) 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: #00AAFF;
  box-shadow: 0 0 0 2px rgba(79, 138, 251, 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: var(--space-1) 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: #00AAFF;
  box-shadow: 0 0 0 2px rgba(79, 138, 251, 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: var(--space-12);
  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: #00AAFF;
  box-shadow: 0 0 0 2px rgba(79, 138, 251, 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 {
  border-color: var(--dt-border-strong);
}

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

.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: var(--space-1) var(--space-3);
  border-radius: var(--dt-radius-sm);
  font-size: var(--dt-font-size-xs);
  font-weight: 500;
  line-height: 1.3;
}

.dt-badge-green  { background: rgba(38,166,91,0.15);  color: var(--dt-positive); }
.dt-badge-red    { background: rgba(232,69,60,0.15);  color: var(--dt-negative); }
.dt-badge-blue   { background: rgba(0, 170, 255, 0.12); color: #00AAFF; }
.dt-badge-yellow { background: rgba(245,166,35,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: var(--space-1) var(--space-4);
  border-radius: var(--dt-radius-sm);
  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(255, 255, 255, 0.10);
  color: var(--dt-text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}


/* ═══════════════════════════════════════════════════════════════════════════
   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;
  border-radius: var(--dt-radius-sm) var(--dt-radius-sm) 0 0;
  transition: all var(--dt-transition-fast);
  font-weight: 500;
  white-space: nowrap;
}

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

.dt-tab.active {
  color: var(--dt-text-primary);
  border-bottom-color: #00AAFF;
}

.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: #24242A;
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-md);
  box-shadow: var(--dt-shadow-lg);
  padding: 4px;
  min-width: 180px;
  z-index: 1000;
}

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

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

.dt-dropdown-item.active { color: var(--dt-text-primary); }

.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: #24242A;
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  padding: 4px 10px;
  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.5);
}

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

.dt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  font-size: var(--dt-font-size-lg);
  font-weight: 600;
  color: var(--dt-text-primary);
}

.dt-modal-body { padding: 12px 24px 20px; }

.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-lg);
  padding: var(--dt-space-4);
}

.dt-card-header {
  font-size: var(--dt-font-size-sm);
  font-weight: 600;
  color: var(--dt-text-tertiary);
  margin-bottom: var(--dt-space-3);
  letter-spacing: 0;
}

.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 var(--space-2);
  border-radius: var(--dt-radius-sm);
}

.dt-pct-change.up   { color: var(--dt-positive); background: rgba(38,166,91,0.1); }
.dt-pct-change.down { color: var(--dt-negative); background: rgba(232,69,60,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: var(--dt-radius-sm);
  padding: var(--space-1) var(--space-2);
}

.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-text-primary);
}

.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-border-strong); }

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


/* ═══════════════════════════════════════════════════════════════════════════
   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-text-primary); }

.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-text-primary);
  border-radius: 50%;
  animation: dt-spin 0.6s linear infinite;
}

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

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

@keyframes dt-loader-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes dt-loader-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

@keyframes dt-dot-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Symbol Link — Interactive ticker symbols
   ═══════════════════════════════════════════════════════════════════════════ */

.symbol-link {
  color: var(--dt-accent-blue);
  text-decoration: none;
  border-radius: var(--dt-radius-sm);
  padding: 0 var(--space-1);
  margin: 0 -var(--space-1);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  display: inline-block;
}
.symbol-link:hover {
  background: rgba(79, 138, 251, 0.08);
  color: #00AAFF;
}
.symbol-link:focus {
  outline: 1px solid var(--dt-accent-blue);
  outline-offset: 1px;
}

.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(255, 255, 255, 0.05);  border-left-color: var(--dt-accent-blue); color: var(--dt-text-primary); }
.dt-alert-success { background: rgba(38,166,91,0.08);   border-left-color: var(--dt-positive);    color: var(--dt-text-primary); }
.dt-alert-warning { background: rgba(245,166,35,0.08);   border-left-color: var(--dt-accent-yellow); color: var(--dt-text-primary); }
.dt-alert-error   { background: rgba(232,69,60,0.08);   border-left-color: var(--dt-negative);    color: var(--dt-text-primary); }


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

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

@keyframes dt-flash-green {
  0%   { color: var(--dt-positive); background: rgba(38,166,91,0.22); }
  40%  { color: var(--dt-positive); background: rgba(38,166,91,0.14); }
  100% { color: inherit; background: transparent; }
}

@keyframes dt-flash-red {
  0%   { color: var(--dt-negative); background: rgba(232,69,60,0.22); }
  40%  { color: var(--dt-negative); background: rgba(232,69,60,0.14); }
  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"]
   OpenBB Terminal warm light background
   ═══════════════════════════════════════════════════════════════════════════ */

[data-color-mode="light"] {
  /* Backgrounds — OpenBB warm light */
  --dt-bg-primary: #ffffff;
  --dt-bg-secondary: #f6f6f6;
  --dt-bg-tertiary: #eaeaea;
  --dt-bg-hover: rgba(0, 0, 0, 0.04);
  --dt-bg-active: rgba(0, 0, 0, 0.08);
  --dt-bg-input: #ffffff;

  /* Borders — OpenBB light */
  --dt-border-primary: rgba(255,255,255,0.1);
  --dt-border-secondary: rgba(255,255,255,0.06);
  --dt-border-focus: #0088cc;

  /* Text — OpenBB warm dark with purplish muted */
  --dt-text-primary: #131313;
  --dt-text-secondary: #5e5e64;
  --dt-text-tertiary: #8a869e;
  --dt-text-disabled: #b8b4c4;

  /* Accent — OpenBB light mode */
  --dt-accent-blue: #0088cc;
  --dt-accent-blue-hover: #006da6;
  --dt-accent-green: #0096d6;
  --dt-accent-red: #c80000;
  --dt-accent-yellow: #b8960a;
  --dt-accent-orange: #d46500;
  --dt-accent-purple: #6D38C4;
  --dt-accent-cyan: #0096d6;
  --dt-accent-blue-soft: rgba(0, 136, 204, 0.1);
  --dt-accent-blue-mid: #00AAFF;
  --dt-accent-green-alt: #0096d6;
  --dt-accent-green-dark: #006fa0;
  --dt-accent-amber: #b8960a;
  --dt-positive: #0096d6;
  --dt-positive-dim: rgba(0, 150, 214, 0.06);
  --dt-negative: #c80000;
  --dt-negative-dim: rgba(200, 0, 0, 0.06);

  /* Shadows — OpenBB light */
  --dt-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --dt-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.1);
  --dt-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.12);
  --dt-shadow-xl: 0 14px 44px rgba(0, 0, 0, 0.16);
  --dt-shadow-glow-blue: 0 0 0 2px rgba(0, 136, 204, 0.35);

  /* Theme-aware utility vars */
  --dt-grid-line: rgba(0, 0, 0, 0.06);
  --dt-nav-scrolled-bg: rgba(255, 255, 255, 0.95);
  --dt-feature-hover-bg: rgba(0, 0, 0, 0.04);
  --dt-overlay: rgba(0, 0, 0, 0.3);
  --dt-content-bg: var(--dt-bg-primary);

  /* Sidebar overrides — OpenBB light sidebar */
  --dt-sidebar-bg: #f6f6f6;
  --dt-sidebar-border: rgba(255,255,255,0.1);
  --dt-sidebar-hover: rgba(0, 0, 0, 0.04);
  --dt-sidebar-active-bg: rgba(0, 0, 0, 0.06);
  --dt-sidebar-active-accent: #0088cc;

  /* Backward compat --color-* overrides */
  --color-bg: #ffffff;
  --color-panel: #f6f6f6;
  --color-panelH: #eaeaea;
  --color-border: rgba(255,255,255,0.1);
  --color-borderA: rgba(255,255,255,0.06);
  --color-borderF: #0088cc;
  --color-text: #131313;
  --color-dim: #5e5e64;
  --color-muted: #8a869e;
  --color-green: #0096d6;
  --color-greenD: #006fa0;
  --color-greenBg: rgba(0, 150, 214, 0.06);
  --color-greenBgS: rgba(0, 150, 214, 0.12);
  --color-red: #c80000;
  --color-redBg: rgba(200, 0, 0, 0.06);
  --color-redBgS: rgba(200, 0, 0, 0.12);
  --color-yellow: #b8960a;
  --color-yellowBg: rgba(184, 150, 10, 0.06);
  --color-yellowBgS: rgba(184, 150, 10, 0.12);
  --color-accent: #0088cc;
  --color-titleActive: #eaeaea;
  --color-titleInactive: #f6f6f6;
  --color-bevelLight: rgba(0, 0, 0, 0.04);
  --color-bevelDark: #ebebed;
  --color-statusBg: #f6f6f6;
}

/* 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: var(--space-1);
  margin-top: var(--space-1);
}

/* Indented sub-item (for items under section headers) */
.dt-sidebar__item--indent {
  padding-left: var(--space-9) !important;
  padding-right: var(--space-5) !important;
  font-size: 12px !important;
  min-height: 28px !important;
  color: var(--dt-text-tertiary);
  letter-spacing: 0 !important;
}
.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: var(--space-2) var(--space-8) var(--space-2) 36px;
  font-size: 11px;
  font-family: var(--dt-font-sans);
  font-weight: 500;
  color: var(--dt-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  opacity: 0.7;
  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: var(--space-4);
  padding: var(--space-3) var(--space-8) var(--space-3);
  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: var(--dt-radius-sm);
  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;
  position: relative;
  width: var(--dt-right-rail-width, 56px);
  height: 100vh;
  background: var(--dt-bg-secondary);
  border-left: 1px solid var(--dt-border-primary);
  padding: var(--space-5) 0;
  gap: var(--space-2);
  overflow-x: hidden;
  overflow-y: auto;
}

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


.dt-right-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--dt-bg-secondary);
  border-left: 1px solid var(--dt-border-primary);
  display: flex;
  flex-direction: column;
  transform: translateX(16px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  overflow: hidden;
}

/* ── dibsTERMINAL Copilot panel (slide-out) ── */
/* ── Copilot panel keyframes ── */
@keyframes ai-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ai-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes ai-dot-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(255, 255, 255, 0.35); }
  60%  { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(255, 255, 255, 0);    }
}
@keyframes ai-sparkles-float {
  0%   { transform: translateY(0)    rotate(0deg);  }
  33%  { transform: translateY(-3px) rotate(3deg);  }
  66%  { transform: translateY(-1px) rotate(-2deg); }
  100% { transform: translateY(0)    rotate(0deg);  }
}
@keyframes ai-thinking-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}


.dt-right-panel--open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.dt-right-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-7);
  background: var(--dt-bg-primary);
  border-bottom: 1px solid var(--dt-border-primary);
  flex-shrink: 0;
}

.dt-right-panel__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dt-text-primary);
  letter-spacing: -0.01em;
}

.dt-right-panel__body {
  flex: 1;
  overflow-y: auto;
  background: var(--dt-bg-secondary);
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}

/* When notes panel is open, body should not scroll — let the editor fill space */
.dt-right-panel__body:has(.rr-notes) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 var(--space-7) var(--space-4);
}

.dt-right-panel-link {
  display: block;
  width: 100%;
  padding: var(--space-4) var(--space-8);
  text-align: left;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--dt-text-secondary);
  cursor: pointer;
}
.dt-right-panel-link:hover {
  background: var(--dt-bg-tertiary);
  color: var(--dt-text-primary);
}

/* ── Quick Notes (right rail panel) ──────────────────────────────────── */

.rr-notes {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
}

.rr-notes__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0 var(--space-3);
  min-height: 24px;
}

/* ── Quick Notes formatting toolbar ── */
.rr-notes__toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--dt-border-primary);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.rr-notes__toolbar-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--dt-text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Geist Mono', 'SF Mono', monospace;
  line-height: 1;
  padding: 0;
  transition: color 0.1s, background 0.1s;
}

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

.rr-notes__toolbar-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rr-notes__toolbar-sep {
  width: 1px;
  height: 16px;
  background: var(--dt-border-primary);
  margin: 0 3px;
}

/* ── Quick Notes WYSIWYG editor (contentEditable) ── */
.rr-notes__editor {
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  background: var(--dt-bg-input);
  color: var(--dt-text-primary);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-sm);
  padding: var(--space-5);
  font-size: 13px;
  line-height: 1.65;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.rr-notes__editor:empty::before {
  content: attr(data-placeholder);
  color: var(--dt-text-tertiary);
  font-style: italic;
  pointer-events: none;
}

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

.rr-notes__editor h1 {
  font-size: 20px;
  font-weight: 700;
  margin: var(--space-4) 0 var(--space-2);
  line-height: 1.3;
}

.rr-notes__editor h2 {
  font-size: 16px;
  font-weight: 700;
  margin: var(--space-3) 0 3px;
  line-height: 1.3;
}

.rr-notes__editor h3 {
  font-size: 14px;
  font-weight: 600;
  margin: var(--space-2) 0 var(--space-1);
  line-height: 1.3;
}

.rr-notes__editor blockquote {
  border-left: 3px solid var(--dt-accent-blue);
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-5);
  color: var(--dt-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.rr-notes__editor ul,
.rr-notes__editor ol {
  margin: var(--space-2) 0;
  padding-left: 22px;
}

.rr-notes__editor li {
  margin: var(--space-1) 0;
}

.rr-notes__editor hr {
  border: none;
  border-top: 1px solid var(--dt-border-primary);
  margin: var(--space-4) 0;
}

.rr-notes__hint {
  font-size: 10px;
  color: var(--dt-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rr-notes__saved {
  font-size: 10px;
  color: var(--dt-positive);
  font-weight: 600;
  animation: rr-fade-in 0.2s ease;
}

.rr-notes__textarea {
  flex: 1;
  width: 100%;
  min-height: 200px;
  background: var(--dt-bg-input);
  color: var(--dt-text-primary);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-sm);
  padding: var(--space-5);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rr-notes__textarea::-moz-placeholder {
  color: var(--dt-text-tertiary);
  font-style: italic;
  font-family: inherit;
}

.rr-notes__textarea::placeholder {
  color: var(--dt-text-tertiary);
  font-style: italic;
  font-family: inherit;
}

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

.rr-notes__footer {
  padding: var(--space-3) 0 0;
}

.rr-notes__footer-text {
  font-size: 9px;
  color: var(--dt-text-tertiary);
  opacity: 0.6;
}

@keyframes rr-fade-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Trending / Top Movers (right rail panel) ───────────────────────── */

.rr-trending {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rr-mover-section {
  padding: var(--space-2) 0;
}

.rr-mover-section + .rr-mover-section {
  border-top: 1px solid var(--dt-border-primary);
}

.rr-mover-section__title {
  padding: var(--space-4) 0 var(--space-2);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rr-mover-section__empty {
  padding: var(--space-6) 0;
  font-size: 11px;
  color: var(--dt-text-tertiary);
  text-align: center;
}

.rr-mover-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0;
  height: 32px;
  transition: background 0.1s;
}

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

.rr-mover-row__sym {
  font-size: 11px;
  font-weight: 600;
  color: var(--dt-text-primary);
  min-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-mover-row__price {
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  color: var(--dt-text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
}

.rr-mover-row__pct {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 54px;
  justify-content: flex-end;
}

.rr-mover-row__pct.up {
  color: var(--dt-positive);
}

.rr-mover-row__pct.down {
  color: var(--dt-negative);
}

.rr-trending__footer {
  border-top: 1px solid var(--dt-border-primary);
  margin-top: var(--space-2);
  padding: var(--space-2) 0;
}

.rr-trending__link {
  display: block;
  width: 100%;
  padding: var(--space-4) 0;
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--dt-accent-blue);
  cursor: pointer;
  text-align: center;
  transition: background 0.1s, color 0.1s;
}

.rr-trending__link:hover {
  background: var(--dt-accent-glow);
  color: var(--dt-accent-blue-hover);
}


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

.dt-now-dashboard-root {
  /* Achromatic panel palette — matches the global theme */
  --dt-bg-primary: #131313;
  --dt-bg-secondary: #1F1E23;
  --dt-bg-tertiary: #24242A;
  --dt-bg-hover: #24242A;
  --dt-bg-active: #242e40;
  --dt-bg-input: #182030;
  --dt-border-primary: #24242A;
  --dt-border-secondary: #24242A;
  --dt-border-strong: #1c1c1c;
  --dt-border-focus: #474747;
  --dt-text-primary: #EAEAEA;
  --dt-text-secondary: #5A5A5A;
  --dt-text-tertiary: #474747;
  --dt-text-disabled: #24242A;
  --dt-text-inverse: #131313;
  --dt-accent-blue: #EAEAEA;
  --dt-accent-blue-hover: #F6F6F6;
  --dt-accent-muted: #24242A;
  --dt-accent-glow: rgba(200, 210, 220, 0.06);
  --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-text: var(--dt-text-primary);
  --color-dim: var(--dt-text-secondary);
  --color-muted: var(--dt-text-tertiary);
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.dt-now-status-banner {
  flex: 0 0 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  max-width: 100%;
  padding: 5px var(--space-4);
  border-radius: var(--dt-radius-sm);
  border: 1px solid rgba(245, 166, 35, 0.22);
  background: rgba(245, 166, 35, 0.08);
  color: var(--dt-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.dt-now-status-banner__label {
  flex: 0 0 auto;
  color: var(--dt-text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.dt-now-status-banner__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.dt-now-shell {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* ── Fixed grid layout for Today's Markets ──────────────────────────── */
/*
  Layout (6 columns × 6 rows):
  ┌──────────┬──────────────────────┬──────────┐
  │  equity  │       news           │currencies│  row 1
  ├──────────┼──────────────────────┼──────────┤
  │          │                      │          │
  │ sectors  │       chart          │  global  │  row 2-4
  │          │                      │          │
  ├──────────┼───────────┬──────────┼──────────┤
  │    fi    │  factors  │  yields  │commodities│ row 5-6
  └──────────┴───────────┴──────────┴──────────┘
*/
.dt-now-fixed-grid {
  display: grid;
  grid-template-columns: 1fr 0.6fr 0.8fr 1fr;
  grid-template-rows: 1.8fr 1fr 1fr 1fr 1.05fr 1.05fr;
  grid-template-areas:
    "equity   news     news     currencies"
    "sectors  chart    chart    global"
    "sectors  chart    chart    global"
    "sectors  chart    chart    global"
    "fi       factors  yields   commodities"
    "fi       factors  yields   commodities";
  gap: var(--space-4);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: var(--space-4);
  background: var(--dt-bg-primary);
}

.dt-now-fixed-grid > div {
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  border: none;
}
.dt-now-fixed-grid > div:last-child { border: none; }

.dt-now-area-equity      { grid-area: equity; }
.dt-now-area-sectors     { grid-area: sectors; }
.dt-now-area-news        { grid-area: news; }
.dt-now-area-chart       { grid-area: chart; }
.dt-now-area-currencies  { grid-area: currencies; }
.dt-now-area-global      { grid-area: global; }
.dt-now-area-commodities { grid-area: commodities; }
.dt-now-area-fi          { grid-area: fi; }
.dt-now-area-factors     { grid-area: factors; }
.dt-now-area-yields      { grid-area: yields; }

/* All panels have uniform borders via gap + individual borders */

/* ── Responsive: stack on small screens ─────────────────────────────── */
@media (max-width: 900px) {
  .dt-now-fixed-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      "news"
      "equity"
      "sectors"
      "chart"
      "currencies"
      "global"
      "commodities"
      "fi"
      "factors"
      "yields";
    overflow-y: auto;
  }
  .dt-now-fixed-grid > div {
    min-height: 260px;
  }
}

/* Legacy: react-grid-layout container override (kept for custom dashboards) */
.dt-now-grid-layout {
  width: 100% !important;
}

/* Each grid cell must clip content so panels scroll internally */
.dt-now-grid-layout > .react-grid-item {
  overflow: hidden;
}

.dt-now-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--dt-border-primary);
  background:
    radial-gradient(circle at top right, rgba(250, 250, 250, 0.05), transparent 32%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.84));
}

.dt-now-overview-copy {
  min-width: 0;
}

.dt-now-overview-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dt-accent-blue);
  margin-bottom: var(--space-1);
}

.dt-now-overview-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.dt-now-overview-title {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--dt-text-primary);
}

.dt-now-overview-time {
  font-size: 11px;
  color: var(--dt-text-tertiary);
  font-family: var(--dt-font-mono);
}

.dt-now-overview-subtitle {
  margin: var(--space-2) 0 0;
  max-width: 720px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--dt-text-secondary);
}

.dt-now-overview-guide {
  display: flex;
  align-items: stretch;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dt-now-overview-guide-item {
  min-width: 100px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  background: var(--dt-bg-secondary);
}

.dt-now-overview-guide-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dt-text-primary);
  margin-bottom: var(--space-1);
}

.dt-now-overview-guide-detail {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--dt-text-tertiary);
}

.dt-now-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: clip;
  overflow-y: auto;
  border-right: 1px solid var(--dt-border-primary);
  gap: 0;
  padding: 0;
  background: var(--dt-bg-primary);
}
.dt-now-col:last-child { border-right: none; }

.dt-now-panel {
  border: none;
  border-radius: var(--dt-radius-sm);
  background: var(--dt-bg-secondary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.dt-now-panel:last-child { border-bottom: none; }

/* Panel body scrolls internally so panels don't need to grow */
.dt-now-panel > *:not(.dt-now-panel-header) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}

/* Tables need display:block wrapper behavior to enable overflow scroll */
.dt-now-panel > table.dt-now-table {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}
.dt-now-panel > table.dt-now-table > thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.dt-now-panel > table.dt-now-table > tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.dt-now-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  font-size: 12px;
  font-weight: 700;
  color: var(--dt-text-primary);
  border-bottom: 1px solid var(--dt-border-primary);
  background: var(--dt-bg-secondary);
  gap: var(--space-3);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  min-height: 24px;
}
.dt-now-panel-header-main {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
  flex-wrap: wrap;
}
.dt-now-panel-title {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.dt-now-panel-title-meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dt-accent-blue);
}
.dt-now-panel-header-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.dt-now-panel-header-legend-item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 1px var(--space-3);
  border-radius: var(--dt-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 24, 27, 0.78);
}
.dt-now-panel-header-legend-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dt-text-primary);
}
.dt-now-panel-header-legend-detail {
  font-size: 10px;
  color: var(--dt-text-tertiary);
}
.dt-now-panel-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.dt-now-panel-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 1px var(--space-3);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(24, 24, 27, 0.82);
  color: var(--dt-text-tertiary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dt-now-panel-status-chip--loading {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 64, 175, 0.16);
  color: var(--dt-accent-blue);
}
.dt-now-panel-status-chip--updating {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(146, 64, 14, 0.16);
  color: #9a9a7a;
}
.dt-now-panel-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: var(--dt-radius-sm);
  background: transparent;
  color: var(--dt-text-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.dt-now-panel-header-btn:hover { background: var(--dt-bg-hover); color: var(--dt-text-primary); }

/* Dense data table in NOW grid */
.dt-now-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}
.dt-now-table th {
  padding: var(--space-1) var(--space-3);
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--dt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--dt-border-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--dt-bg-secondary);
}
.dt-now-table th:not(:first-child) { text-align: right; }

/* Column width hints for dense data tables (checkbox, name, ticker, price, chg, %)
   NOTE: thead & tbody are separate display:table contexts, so widths must be set on BOTH th and td */
.dt-now-table th:nth-child(1),
.dt-now-table td:nth-child(1) { width: 28px; }
.dt-now-table th:nth-child(2),
.dt-now-table td:nth-child(2) { text-align: left; }
.dt-now-table th:nth-child(3),
.dt-now-table td:nth-child(3) { width: 56px; text-align: left; }
.dt-now-table th:nth-child(4),
.dt-now-table td:nth-child(4) { width: 72px; }
.dt-now-table th:nth-child(5),
.dt-now-table td:nth-child(5) { width: 62px; }
.dt-now-table th:nth-child(6),
.dt-now-table td:nth-child(6) { width: 56px; }

.dt-now-table--label-priority th:nth-child(4),
.dt-now-table--label-priority td:nth-child(4) { width: 72px; }
.dt-now-table--label-priority th:nth-child(5),
.dt-now-table--label-priority td:nth-child(5) { width: 62px; }
.dt-now-table--label-priority th:nth-child(6),
.dt-now-table--label-priority td:nth-child(6) { width: 56px; }
.dt-now-table td {
  padding: var(--space-1) var(--space-3);
  border-bottom: 1px solid var(--dt-border-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--dt-text-secondary);
}
.dt-now-table td:not(:first-child) { text-align: right; }
/* Name column always left-aligned (overrides the :not(:first-child) right-align) */
.dt-now-table td:nth-child(2) { text-align: left; }
.dt-now-table tr:hover td { background: var(--dt-bg-hover); }
.dt-now-table .symbol-cell { font-weight: 500; color: var(--dt-text-primary); }
/* Unified cell renderer color classes */
.dt-now-table .positive { color: var(--dt-positive); }
.dt-now-table .negative { color: var(--dt-negative); }
.dt-now-table .neutral  { color: var(--dt-text-tertiary); }

/* Name + Ticker inline layout */
.dt-now-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.dt-now-name-ticker {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.dt-now-table--label-priority .dt-now-name-cell {
  gap: 3px;
}
.dt-now-bullet {
  color: var(--dt-text-tertiary);
  font-size: 10px;
  flex-shrink: 0;
}
.dt-now-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.dt-now-ticker-col {
  font-family: var(--dt-font-mono);
  font-size: 10px;
  color: var(--dt-text-tertiary);
  text-align: left !important;
}
.dt-now-ticker-col a {
  color: inherit;
  text-decoration: none;
}
.dt-now-ticker-col a:hover {
  color: var(--dt-text-secondary);
}
.dt-now-color-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--dt-radius-sm);
  flex-shrink: 0;
}
.dt-now-color-dot-btn {
  width: 9px;
  height: 9px;
  border: none;
  border-radius: var(--dt-radius-sm);
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.dt-now-color-dot-btn:hover {
  opacity: 0.85;
}
.dt-now-color-dot-btn:focus-visible {
  outline: 1px solid var(--dt-accent-blue);
  outline-offset: 2px;
}

/* Colored checkbox swatch – replaces MUI Checkbox when a chart color is assigned */
.dt-now-color-swatch {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 3px;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.dt-now-color-swatch:hover {
  opacity: 1 !important;
}
.dt-now-color-swatch:focus-visible {
  outline: 1px solid var(--dt-accent-blue);
  outline-offset: 2px;
}

.dt-now-table .subheader td {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dt-text-tertiary);
  padding-top: var(--space-2);
  padding-bottom: var(--space-1);
  background: var(--dt-bg-tertiary);
}
.dt-now-table .subheader td:first-child {
  /* empty checkbox column in subheader */
}
.dt-now-table .subheader td:nth-child(2) {
  font-weight: 700;
  color: var(--dt-text-secondary);
}


@media (max-width: 1100px) {
  .dt-now-overview-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-now-overview-guide {
    justify-content: flex-start;
  }
}

/* Performance chart area */
.dt-now-chart-area {
  padding: 0;
  position: relative;
}
.dt-now-chart-tabs {
  display: flex;
  gap: 0;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--dt-border-primary);
}
.dt-now-chart-tab {
  padding: var(--space-1) var(--space-3);
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--dt-text-tertiary);
  cursor: pointer;
  border-radius: var(--dt-radius-sm);
  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-text-primary);
  background: rgba(250, 250, 250, 0.06);
}

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

/* News list items */
.dt-now-news-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}
.dt-now-news-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--dt-border-primary);
  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: var(--space-3);
  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 3px 3px var(--space-3);
  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);
  position: sticky;
  top: 0;
  background: var(--dt-bg-secondary);
}
.dt-now-yields-row {
  display: grid;
  grid-template-columns: 1fr repeat(4, 50px);
  padding: 3px 3px 3px var(--space-3);
  font-size: 11px;
  border-bottom: 1px solid var(--dt-border-primary);
  align-items: center;
  transition: background 0.1s;
}
.dt-now-yields-row:hover { background: var(--dt-bg-hover); }
.dt-now-yields-row--unavailable {
  background: transparent;
}
.dt-now-yields-row--reference {
  background: rgba(148, 163, 184, 0.06);
}
.dt-now-yields-flag {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--dt-text-secondary);
}
.dt-now-yields-status {
  font-size: 10px;
  color: var(--dt-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dt-now-yields-val {
  text-align: right;
  font-family: var(--dt-font-mono);
  font-size: 11px;
  color: var(--dt-text-secondary);
}
.dt-now-yields-row--unavailable .dt-now-yields-val,
.dt-now-yields-row--reference .dt-now-yields-val {
  color: var(--dt-text-tertiary);
}

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

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

/* Checkbox cell in table rows */
.dt-now-table td:first-child {
  width: 28px;
  padding-left: var(--space-3);
  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: var(--dt-radius-sm);
  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: var(--space-2);
  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: var(--space-1);
  top: var(--space-3);
  width: 8px;
  height: 2px;
  background: white;
}

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

.dt-now-table tr.selected:hover td {
  background: rgba(250, 250, 250, 0.1) !important;
}

/* Selected row in yields panel */
.dt-now-yields-row.selected {
  background: rgba(250, 250, 250, 0.06);
}

.dt-now-yields-row.selected:hover {
  background: rgba(250, 250, 250, 0.1);
}

/* Floating action bar for selected symbols */
.dt-now-selection-bar {
  position: fixed;
  bottom: var(--space-9);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dt-bg-secondary);
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  padding: var(--space-6) var(--space-9);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  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: var(--space-4);
}

.dt-now-selection-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--dt-border-secondary);
  border-radius: var(--dt-radius-sm);
  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-secondary);
}

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

/* Chart container */
.dt-now-chart-container {
  padding: var(--space-4);
  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: var(--space-8);
  padding: var(--space-2) var(--space-4) var(--space-4);
  font-size: 11px;
}

.dt-now-chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  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: var(--dt-radius-sm);
}

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

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

@media (max-width: 900px) {
  .dt-now-grid {
    grid-template-columns: 1fr;
  }
  
  .dt-now-col {
    border-right: none;
    border-bottom: 1px solid var(--dt-border-primary);
  }
  
  .dt-now-col:last-child {
    border-bottom: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-toast-container {
  position: fixed;
  bottom: var(--space-9);
  right: var(--space-9);
  z-index: 2600;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-4);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  pointer-events: none;
}

.dt-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-7);
  min-width: 280px;
  max-width: 400px;
  border-radius: var(--dt-radius-sm);
  border-left: 4px solid;
  background: var(--color-panel, #1F1E23);
  border-color: var(--dt-toast-border, #2a3040);
  box-shadow: var(--dt-shadow-lg);
  font-size: 0.75rem;
  line-height: 1.4;
  animation: dt-toast-enter 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.dt-toast--exiting {
  animation: dt-toast-exit 0.3s ease-in forwards;
}

.dt-toast__content {
  flex: 1;
  min-width: 0;
}

.dt-toast__title {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text, #EAEAEA);
  margin-bottom: var(--space-1);
}

.dt-toast__message {
  font-size: 0.6875rem;
  color: var(--color-dim, #5A5A5A);
  word-break: break-word;
}

.dt-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-muted, #6b7280);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  font-size: 14px;
  border-radius: var(--dt-radius-sm);
  transition: color 0.15s, background 0.15s;
}

.dt-toast__close:hover {
  color: var(--color-text, #EAEAEA);
  background: rgba(255, 255, 255, 0.06);
}

.dt-toast__action {
  margin-top: var(--space-3);
}

.dt-toast__action button {
  background: none;
  border: 1px solid var(--color-border, #2a2f3a);
  color: var(--color-accent, #ebebed);
  font-size: 0.6875rem;
  padding: 3px var(--space-5);
  border-radius: var(--dt-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.dt-toast__action button:hover {
  background: rgba(0, 170, 255, 0.08);
}

.dt-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--dt-toast-border, #2a3040);
  transition: width 0.1s linear;
  opacity: 0.6;
}

@keyframes dt-toast-enter {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes dt-toast-exit {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Form Patterns - Consistent error/success/hint styling
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-form-error {
  color: var(--color-red, #DC2626);
  font-size: 0.6875rem;
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  animation: fadeIn 0.2s ease;
}

.dt-form-error::before {
  content: '⚠';
  font-size: 10px;
}

.dt-form-success {
  color: var(--color-green, #16A34A);
  font-size: 0.6875rem;
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  animation: fadeIn 0.2s ease;
}

.dt-form-success::before {
  content: '✓';
  font-size: 10px;
}

.dt-form-hint {
  color: var(--color-muted, #6b7280);
  font-size: 0.6875rem;
  margin-top: var(--space-2);
  line-height: 1.4;
}

.dt-input--error,
.dt-select--error {
  border-color: var(--color-red, #DC2626) !important;
}

.dt-input--error:focus,
.dt-select--error:focus {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.dt-input--success,
.dt-select--success {
  border-color: var(--color-green, #16A34A) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Page Transitions
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-page-enter {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dt-border-secondary) transparent;
}
.dt-page-enter:has(.dt-fixed-view) {
  overflow: hidden;
}

.dt-page-enter > :first-child {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Error Banner
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-error-banner {
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
  padding: var(--dt-space-3) var(--dt-space-4);
  font-size: var(--dt-font-size-base);
  line-height: 1.5;
  border-radius: var(--dt-radius-sm);
}
.dt-error-banner--error   { color: var(--dt-accent-red);    background: var(--color-redBg);    border: 1px solid var(--dt-accent-red); }
.dt-error-banner--warning { color: var(--dt-accent-yellow); background: var(--color-yellowBg); border: 1px solid var(--dt-accent-yellow); }
.dt-error-banner--info    { color: var(--dt-accent-blue);   background: var(--color-blueBg, rgba(180,180,180,0.08)); border: 1px solid var(--dt-accent-blue); }
.dt-error-banner--success { color: var(--dt-accent-green);  background: var(--color-greenBg);  border: 1px solid var(--dt-accent-green); }

/* ═══════════════════════════════════════════════════════════════════════════
   Form Group
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-form-group { }
.dt-form-group label,
.dt-form-label {
  display: block;
  font-size: var(--dt-font-size-sm);
  font-weight: 500;
  color: var(--dt-text-secondary);
  margin-bottom: var(--dt-space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dt-form-hint {
  font-size: var(--dt-font-size-xs);
  color: var(--dt-text-tertiary);
  margin-top: var(--dt-space-1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section Header
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-section-header {
  font-size: var(--dt-font-size-md);
  font-weight: 600;
  color: var(--dt-text-primary);
  margin-top: var(--dt-space-6);
  margin-bottom: var(--dt-space-3);
  padding-bottom: var(--dt-space-2);
  border-bottom: 1px solid var(--dt-border-primary);
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
}
.dt-section-label {
  font-size: var(--dt-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dt-text-tertiary);
  margin-bottom: var(--dt-space-3);
  display: flex;
  align-items: center;
  gap: var(--dt-space-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-empty-state {
  animation: fadeInUp 0.4s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Recently Viewed - Sidebar section
   ═══════════════════════════════════════════════════════════════════════════ */

.dt-recent-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 42px;
  padding: 0 var(--space-6);
  font-size: 12px;
  color: var(--dt-text-secondary, var(--color-dim, #5A5A5A));
  cursor: pointer;
  border-radius: var(--dt-radius-sm);
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  box-sizing: border-box;
}

.dt-recent-item:hover {
  background: var(--dt-bg-hover, rgba(255, 255, 255, 0.04));
  color: var(--dt-text-primary, var(--color-text, #EAEAEA));
}

.dt-recent-item__symbol {
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--color-accent, #ebebed);
  min-width: 48px;
}

.dt-recent-item__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.dt-recent-item__time {
  font-size: 10px;
  color: var(--color-muted, #6b7280);
  flex-shrink: 0;
}
.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);
}/* tokens.css — Spec design tokens (OpenBB-inspired Dark) */

:root {
  /* Layout — wired to dibs theme tokens for consistency */
  --topbar-height: var(--dt-topbar-height);
  --sidebar-width: var(--dt-sidebar-width);
  --sidebar-collapsed-width: var(--dt-sidebar-collapsed-width);
  --right-sidebar-width: 230px;
  --panel-radius: var(--dt-radius-lg);
  --table-row-height: var(--row-data);
  --panel-padding: 16px;

  /* Canonical spec aliases wired to the dibs theme tokens */
  --color-bg-main: var(--dt-bg-primary);
  --color-bg-content: var(--dt-bg-secondary);
  --color-bg-sidebar-left: #1F1E23;
  --color-bg-sidebar-nav: #1F1E23;
  --color-bg-table-header: var(--dt-bg-primary);
  --color-accent: var(--dt-accent-blue);
  --color-accent-hover: var(--dt-accent-blue-hover);
  --color-positive: var(--dt-positive);
  --color-negative: var(--dt-negative);
  --color-text-primary: var(--dt-text-primary);
  --color-text-secondary: var(--dt-text-secondary);
  --color-border-spec: var(--dt-border-secondary);
  --color-upgrade-bg: rgba(0, 170, 255, 0.1);
  --color-upgrade-text: #00AAFF;
  --color-accent-spec: var(--color-accent);
  --color-text-primary-spec: var(--color-text-primary);
  --color-text-secondary-spec: var(--color-text-secondary);
  --color-positive-spec: var(--color-positive);
  --color-negative-spec: var(--color-negative);
}

html.dark {
  --color-bg-main: var(--dt-bg-primary);
  --color-bg-content: var(--dt-bg-secondary);
  --color-bg-sidebar-left: var(--dt-bg-secondary);
  --color-bg-sidebar-nav: var(--dt-bg-secondary);
  --color-bg-table-header: var(--dt-bg-tertiary);
  --color-text-primary: var(--dt-text-primary);
  --color-text-secondary: var(--dt-text-secondary);
  --color-border-spec: var(--dt-border-secondary);
}

/* ── Price animation keyframes ──────────────────────────────────────────── */

@keyframes priceBlink {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes priceFlashGreen {
  0% { background-color: rgba(22, 163, 74, 0.25); }
  100% { background-color: transparent; }
}

@keyframes priceFlashRed {
  0% { background-color: rgba(220, 38, 38, 0.25); }
  100% { background-color: transparent; }
}

/* ── Typography scale (from spec) ───────────────────────────────────────── */

.text-page-header { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.text-nav-item { font-size: 14px; font-weight: 500; }
.text-button-label { font-size: 13px; font-weight: 500; }
.text-table-cell { font-size: 13px; font-weight: 400; }
.text-column-header { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.text-small-label { font-size: 11px; font-weight: 400; }
.text-section-highlight { font-weight: 600; }

/* Layout metric enforcement */
.dt-shell {
  --dt-topbar-h: var(--topbar-height);
  --dt-sidebar-w: var(--sidebar-width);
  --dt-sidebar-collapsed-w: var(--sidebar-collapsed-width);
  --dt-right-sidebar-w: var(--right-sidebar-width);
}

/* ── Left Sidebar active state — Notion-style (no left border, background-only) ── */

.dt-sidebar__item--active {
  border-left: none !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.dt-sidebar__item-code {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.5;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* ── Phase 4: Topbar trial/plan banner ───────────────────────────────────── */

.dt-topbar__trial-banner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 3px var(--space-5);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-upgrade-text);
  background: var(--color-upgrade-bg);
  border-radius: var(--dt-radius-md);
  cursor: pointer;
  white-space: nowrap;
}

.dt-topbar__trial-banner:hover {
  opacity: 0.85;
}

/* ── Phase 5: Global Search Modal ────────────────────────────────────────── */

.dt-search-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.dt-search-modal {
  width: min(680px, 90vw);
  max-height: 70vh;
  background: var(--color-bg-main);
  border: 1px solid var(--color-border-spec);
  border-radius: var(--dt-radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dt-search-modal__input {
  width: 100%;
  padding: var(--space-8) var(--space-9);
  font-size: 16px;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-spec);
  outline: none;
}

.dt-search-modal__input::-moz-placeholder {
  color: var(--color-text-secondary);
}

.dt-search-modal__input::placeholder {
  color: var(--color-text-secondary);
}

.dt-search-modal__tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-8);
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border-spec);
  scrollbar-width: none;
}

.dt-search-modal__tabs::-webkit-scrollbar {
  display: none;
}

.dt-search-modal__tab {
  padding: var(--space-2) var(--space-5);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--dt-radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.dt-search-modal__tab:hover {
  background: var(--color-bg-content);
}

.dt-search-modal__tab--active {
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.dt-search-modal__results {
  overflow-y: auto;
  max-height: 50vh;
}

.dt-search-modal__result {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-9);
  cursor: pointer;
  transition: background 0.1s ease;
}

.dt-search-modal__result:hover,
.dt-search-modal__result--selected {
  background: var(--color-bg-content);
}

.dt-search-modal__result-ticker {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  min-width: 70px;
}

.dt-search-modal__result-name {
  font-size: 12px;
  color: var(--color-text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-search-modal__result-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-content);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--dt-radius-md);
  font-family: var(--font-mono);
}

.dt-search-modal__hint {
  padding: var(--space-4) var(--space-9);
  font-size: 11px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border-spec);
}

/* ── Phase 6: Right Sidebar Panel Overlay ────────────────────────────────── */

@keyframes panelSlideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.dt-right-panel-overlay {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  width: var(--right-sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--color-bg-main);
  border-left: 1px solid var(--color-border-spec);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  z-index: 40;
  display: flex;
  flex-direction: column;
  animation: panelSlideInRight 200ms ease-out;
}

.dt-right-panel-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--color-border-spec);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dt-right-panel-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.dt-right-rail__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--dt-radius-md);
  transition: all 0.12s ease;
}

.dt-right-rail__btn:hover {
  background: var(--color-bg-content);
  color: var(--color-text-primary);
}

.dt-right-rail__btn--active {
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

/* ── PanelCard ─────────────────────────────────────────────────────────── */
.dt-panel-card {
  background: var(--color-bg-content);
  border: 1px solid var(--color-border-spec);
  border-radius: var(--panel-radius);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.dt-panel-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dt-panel-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--panel-padding);
  border-bottom: 1px solid var(--color-border-spec);
}

.dt-panel-card__title-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
}

.dt-panel-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dt-panel-card__subtitle {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.dt-panel-card__header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.dt-panel-card__expand-icon {
  font-size: 12px;
  color: var(--color-text-secondary);
  transition: transform 0.2s ease;
  display: inline-flex;
}

.dt-panel-card__body {
  padding: var(--panel-padding);
}

/* ── TabStrip ──────────────────────────────────────────────────────────── */
.dt-tab-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--color-border-spec);
  padding: 0 var(--space-2);
}

.dt-tab-strip::-webkit-scrollbar {
  display: none;
}

.dt-tab-strip__tab {
  position: relative;
  padding: var(--space-5) var(--space-8);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s ease;
  flex-shrink: 0;
}

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

.dt-tab-strip__tab--active {
  color: var(--color-accent);
}

.dt-tab-strip__tab--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--dt-radius-md);
}

.dt-tab-strip__tab--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── UpgradeBanner ─────────────────────────────────────────────────────── */
.dt-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-8);
  background: var(--color-upgrade-bg);
  border-radius: var(--panel-radius);
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.dt-upgrade-banner:hover {
  opacity: 0.9;
}

.dt-upgrade-banner__message {
  font-size: 12px;
  color: var(--color-upgrade-text);
}

.dt-upgrade-banner__cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-upgrade-text);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* ── PriceCell ─────────────────────────────────────────────────────────── */
.dt-price-cell {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
  transition: background-color 0.3s ease;
  padding: 1px var(--space-2);
  border-radius: var(--dt-radius-md);
}

.dt-price-cell__value {
  font-weight: 600;
  color: var(--color-text-primary);
}

.dt-price-cell__change {
  font-weight: 500;
}

.dt-price-cell__pct {
  font-weight: 400;
  font-size: 0.9em;
}

.dt-price-flash-up {
  animation: priceFlashGreen 0.4s ease-out;
}

.dt-price-flash-down {
  animation: priceFlashRed 0.4s ease-out;
}

/* ── Toggle ────────────────────────────────────────────────────────────── */
.dt-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
}

.dt-toggle--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dt-toggle__track {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--color-border-spec);
  border: none;
  border-radius: var(--dt-radius-md);
  cursor: inherit;
  padding: 0;
  transition: background-color 0.2s ease;
}

.dt-toggle__track--on {
  background: var(--color-accent);
}

.dt-toggle__thumb {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.dt-toggle__track--on .dt-toggle__thumb {
  transform: translateX(16px);
}

.dt-toggle__label {
  font-size: 13px;
  color: var(--color-text-primary);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* ── Security Analysis sticky sub-nav ──────────────────────────────────── */
.dt-security-subnav {
  position: sticky;
  top: var(--topbar-height);
  z-index: 30;
  background: var(--color-bg-main);
  border-bottom: 1px solid var(--color-border-spec);
}

/* ── Phase 9-11: Security Analysis + Markets + Watchlists ────── */

/* Security sub-page layout */
.sec-page { padding: 0; display: flex; flex-direction: column; gap: var(--space-4); min-height: 0; }
.sec-page__header { display: flex; align-items: center; justify-content: space-between; }
.sec-page__title { font-size: 16px; font-weight: 600; color: var(--color-text-primary-spec); letter-spacing: -0.01em; }
/* Ensure all tables inside sec-page are scrollable */
.sec-page .table-scroll { overflow-x: auto; overflow-y: auto; max-height: 70vh; -webkit-overflow-scrolling: touch; }
.sec-page--fixed { height: 100%; min-height: 0; overflow: hidden; }
.sec-page--fixed > * { min-height: 0; flex-shrink: 0; }
.sec-page--fixed .sec-page__grid { min-height: 0; flex-shrink: 1 !important; overflow: hidden; }
.sec-page--fixed .sec-page__grid > * { min-height: 0; overflow: hidden; }
.sec-page--fixed .dt-panel-card { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.sec-page--fixed .dt-panel-card__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sec-page--fixed .table-scroll { flex: 1; min-height: 0; max-height: none; }
.dt-scroll-region {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sec-page__grid { display: grid; gap: var(--space-6); }
.sec-page__grid--2col { grid-template-columns: 1fr 1fr; }
.sec-page__grid--3col { grid-template-columns: 1fr 1fr 1fr; }
.sec-page__grid--4col { grid-template-columns: repeat(4, 1fr); }

/* KPI card */
.kpi-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-6) var(--space-8); }
.kpi-card__label { font-size: 11px; color: var(--color-text-secondary-spec); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-card__value { font-size: 20px; font-weight: 700; color: var(--color-text-primary-spec); margin-top: var(--space-2); }
.kpi-card__sub { font-size: 12px; color: var(--color-text-secondary-spec); margin-top: var(--space-1); }

/* Data table styles */
.spec-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.spec-table th { text-align: left; padding: 3px var(--space-4); font-weight: 500; color: var(--color-text-secondary-spec); border-bottom: 1px solid var(--color-border-spec); font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.spec-table td { padding: 3px var(--space-4); border-bottom: 1px solid var(--color-border-spec); color: var(--color-text-primary-spec); }
.spec-table tr:hover td { background: var(--color-bg-hover); }
.spec-table td.positive { color: var(--color-positive-spec); }
.spec-table td.negative { color: var(--color-negative-spec); }
.spec-table td.right, .spec-table th.right { text-align: right; }

/* ── Actuals & Consensus matrix table ── */
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: 'Inter', -apple-system, sans-serif; font-variant-numeric: tabular-nums; }
.ac-table th {
  text-align: right; padding: var(--space-3) var(--space-7); font-weight: 600; font-size: 12px;
  color: var(--color-text-secondary-spec); border-bottom: 2px solid var(--color-border-spec);
  letter-spacing: 0.02em; white-space: nowrap; vertical-align: bottom;
}
.ac-table th:first-child { text-align: left; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.ac-table th.ac-col { border-left: 1px solid var(--color-border-spec); }
.ac-table th.ac-col--est { color: var(--color-accent-spec); }
.ac-table td {
  padding: 5px var(--space-7); border-bottom: 1px solid color-mix(in srgb, var(--color-border-spec) 50%, transparent);
  color: var(--color-text-primary-spec); text-align: right; white-space: nowrap;
}
.ac-table td:first-child { text-align: left; }
.ac-table td.ac-col { border-left: 1px solid var(--color-border-spec); }
.ac-table td.ac-col--est { color: var(--color-accent-spec); }
.ac-table tr:hover td { background: var(--color-bg-hover); }
.ac-table .ac-meta-row td { font-size: 11px; color: var(--color-text-secondary-spec); padding: 3px var(--space-7); border-bottom: 1px solid color-mix(in srgb, var(--color-border-spec) 30%, transparent); }
.ac-table .ac-meta-row:hover td { background: transparent; }
.ac-section-row { cursor: pointer; -webkit-user-select: none; -moz-user-select: none; user-select: none; }
.ac-section-row td {
  padding: var(--space-5) var(--space-7); font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--color-border-spec);
  border-top: 1px solid var(--color-border-spec);
  background: color-mix(in srgb, var(--color-bg-table-header) 60%, transparent);
}
.ac-section-row:hover td { background: var(--color-bg-hover) !important; }
.ac-section-row .ac-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border: 1px solid var(--color-border-spec);
  font-size: 11px; line-height: 1; flex-shrink: 0; margin-right: var(--space-4);
  color: var(--color-text-secondary-spec); background: transparent;
}
.ac-table .ac-metric-label { padding-left: 38px; font-weight: 400; color: var(--color-text-secondary-spec); }
.ac-table .ac-metric-label--bold { font-weight: 600; color: var(--color-text-primary-spec); }
.ac-table .ac-spacer td { padding: 0; height: 4px; border: none; }
.ac-table .ac-spacer:hover td { background: transparent; }
.ac-header-info { display: flex; align-items: center; gap: var(--space-6); }
.ac-header-info__item { font-size: 12px; color: var(--color-text-secondary-spec); display: flex; align-items: center; gap: var(--space-2); }

/* Chart placeholder */
.chart-placeholder { background: var(--color-bg-content); border: 1px dashed var(--color-border-spec); border-radius: var(--dt-radius-md); display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary-spec); font-size: 13px; min-height: 200px; }

/* Periodicity selector */
.periodicity-bar { display: flex; gap: var(--space-2); align-items: center; }
.periodicity-btn { padding: var(--space-2) var(--space-5); font-size: 12px; font-weight: 500; border-radius: var(--dt-radius-md); border: 1px solid var(--color-border-spec); background: transparent; color: var(--color-text-secondary-spec); cursor: pointer; transition: all 0.15s; }
.periodicity-btn:hover { background: var(--color-bg-hover); }
.periodicity-btn--active { background: var(--color-accent-spec); color: #fff; border-color: var(--color-accent-spec); }

/* News article card */
.news-card { padding: var(--space-6) var(--space-8); border-bottom: 1px solid var(--color-border-spec); cursor: pointer; transition: background 0.15s; }
.news-card:hover { background: var(--color-bg-hover); }
.news-card__title { font-size: 14px; font-weight: 600; color: var(--color-text-primary-spec); margin-bottom: var(--space-2); }
.news-card__meta { font-size: 11px; color: var(--color-text-secondary-spec); display: flex; gap: var(--space-4); align-items: center; }
.news-card__preview { font-size: 13px; color: var(--color-text-secondary-spec); margin-top: var(--space-3); line-height: 1.4; }
.news-card__badge { display: inline-block; padding: var(--space-1) var(--space-3); border-radius: var(--dt-radius-md); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.news-card__badge--positive { background: rgba(38, 166, 91, 0.15); color: var(--color-positive-spec); }
.news-card__badge--negative { background: rgba(234, 57, 67, 0.15); color: var(--color-negative-spec); }
.news-card__badge--neutral { background: rgba(139, 148, 158, 0.15); color: var(--color-text-secondary-spec); }

/* Filter builder */
.filter-row { display: flex; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); }
.filter-row select, .filter-row input { padding: var(--space-3) var(--space-5); font-size: 13px; border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); background: var(--color-bg-content); color: var(--color-text-primary-spec); }
.filter-row select { min-width: 160px; }
.filter-row input { width: 120px; }
.filter-row__remove { background: none; border: none; color: var(--color-text-secondary-spec); cursor: pointer; font-size: 16px; padding: var(--space-2); }
.filter-row__remove:hover { color: var(--color-negative-spec); }

/* Watchlist layout */
.watchlist-layout { display: flex; height: 100%; }
.watchlist-layout__sidebar { width: 220px; border-right: 1px solid var(--color-border-spec); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.watchlist-layout__sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-6) var(--space-7) var(--space-5); border-bottom: 1px solid var(--color-border-spec); flex-shrink: 0; }
.watchlist-sidebar__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--color-text-secondary-spec); }
.watchlist-sidebar__btn-new { background: none; border: 1px solid var(--color-border-spec); color: var(--color-text-secondary-spec); font-size: 16px; line-height: 1; padding: 1px 7px var(--space-1); cursor: pointer; transition: all 0.15s; border-radius: var(--dt-radius-md); }
.watchlist-sidebar__btn-new:hover { border-color: var(--color-accent-spec); color: var(--color-accent-spec); }
.watchlist-layout__sidebar-list { flex: 1; overflow-y: auto; padding: var(--space-2) 0; }
.watchlist-layout__sidebar-create { padding: var(--space-5) var(--space-6); border-top: 1px solid var(--color-border-spec); flex-shrink: 0; }
.watchlist-layout__sidebar-create input { width: 100%; padding: var(--space-3) var(--space-4); font-size: 12px; box-sizing: border-box; border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); background: var(--color-bg-content); color: var(--color-text-primary-spec); outline: none; margin-bottom: var(--space-3); font-family: inherit; }
.watchlist-layout__sidebar-create input:focus { border-color: var(--color-accent-spec); }
.watchlist-layout__sidebar-create-actions { display: flex; gap: var(--space-2); }
.watchlist-layout__main { flex: 1; padding: var(--space-6) var(--space-8); overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.watchlist-item { position: relative; display: flex; align-items: center; padding: 7px var(--space-5) 7px var(--space-6); cursor: pointer; font-size: 13px; color: var(--color-text-primary-spec); transition: background 0.15s; border-left: 2px solid transparent; }
.watchlist-item:hover { background: var(--color-bg-hover); }
.watchlist-item--active { background: color-mix(in srgb, var(--color-accent-spec) 8%, transparent); color: var(--color-accent-spec); font-weight: 600; border-left-color: var(--color-accent-spec); }
.watchlist-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watchlist-item__badge { font-size: 10px; font-weight: 500; color: var(--color-text-secondary-spec); background: color-mix(in srgb, var(--color-border-spec) 60%, transparent); padding: 1px 5px; border-radius: 10px; margin-left: var(--space-3); flex-shrink: 0; }
.watchlist-item__delete { background: none; border: none; color: var(--color-text-secondary-spec); font-size: 13px; cursor: pointer; padding: var(--space-1) var(--space-2); margin-left: var(--space-2); opacity: 0; transition: opacity 0.15s, color 0.15s; flex-shrink: 0; line-height: 1; }
.watchlist-item:hover .watchlist-item__delete { opacity: 1; }
.watchlist-item__delete:hover { color: var(--color-negative-spec); }

/* Toolbar */
.spec-toolbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: nowrap; }
.spec-toolbar__btn { padding: var(--space-2) var(--space-5); font-size: 12px; font-weight: 500; border-radius: var(--dt-radius-md); border: 1px solid var(--color-border-spec); background: var(--color-bg-content); color: var(--color-text-primary-spec); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.spec-toolbar__btn:hover { background: var(--color-bg-hover); }
.spec-toolbar__btn--primary { background: var(--color-accent-spec); color: #fff; border-color: var(--color-accent-spec); }
.spec-toolbar__btn--primary:hover { opacity: 0.88; background: var(--color-accent-spec); }
.spec-toolbar__count { font-size: 11px; color: var(--color-text-secondary-spec); padding: 0 var(--space-2); white-space: nowrap; }
.spec-toolbar__dropdown { position: absolute; top: calc(100% + var(--space-2)); left: 0; z-index: 200; background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); min-width: 130px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.spec-toolbar__dropdown-item { padding: 7px var(--space-6); font-size: 12px; cursor: pointer; color: var(--color-text-primary-spec); transition: background 0.1s; }
.spec-toolbar__dropdown-item:hover { background: var(--color-bg-hover); }
.spec-toolbar__dropdown-item--active { color: var(--color-accent-spec); font-weight: 600; }

/* ── Phase 12-15: Portfolio + Dashboards + Analytics + Search ─── */

/* Portfolio layout */
.portfolio-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); margin-bottom: var(--space-8); }
.portfolio-summary__card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-8); }
.portfolio-summary__label { font-size: 11px; color: var(--color-text-secondary-spec); text-transform: uppercase; letter-spacing: 0.5px; }
.portfolio-summary__value { font-size: 24px; font-weight: 700; color: var(--color-text-primary-spec); margin-top: var(--space-2); }
.portfolio-summary__change { font-size: 13px; margin-top: var(--space-1); }

/* Dashboard index card */
.index-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-6) var(--space-8); display: flex; flex-direction: column; gap: var(--space-2); }
.index-card__name { font-size: 12px; font-weight: 600; color: var(--color-text-primary-spec); }
.index-card__value { font-size: 18px; font-weight: 700; color: var(--color-text-primary-spec); }
.index-card__change { font-size: 12px; font-weight: 500; }

/* Region group */
.region-group { margin-bottom: var(--space-9); }
.region-group__title { font-size: 13px; font-weight: 600; color: var(--color-text-secondary-spec); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border-spec); }
.region-group__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }

/* Calendar styles */
.calendar-event { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--color-border-spec); }
.calendar-event__date { font-size: 12px; font-weight: 600; color: var(--color-text-secondary-spec); min-width: 80px; }
.calendar-event__info { flex: 1; }
.calendar-event__title { font-size: 13px; font-weight: 500; color: var(--color-text-primary-spec); }
.calendar-event__detail { font-size: 11px; color: var(--color-text-secondary-spec); }
.impact-badge { display: inline-block; padding: var(--space-1) var(--space-3); border-radius: var(--dt-radius-md); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.impact-badge--high { background: rgba(234, 57, 67, 0.15); color: var(--color-negative-spec); }
.impact-badge--medium { background: rgba(234, 88, 12, 0.15); color: #EA580C; }
.impact-badge--low { background: rgba(139, 148, 158, 0.15); color: var(--color-text-secondary-spec); }

/* Heatmap placeholder */
.heatmap-placeholder { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); min-height: 300px; display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary-spec); font-size: 13px; }

/* Chip input */
.chip-input { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); background: var(--color-bg-content); align-items: center; }
.chip-input__chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-radius: var(--dt-radius-md); background: color-mix(in srgb, var(--color-accent-spec) 15%, transparent); color: var(--color-accent-spec); font-size: 12px; font-weight: 500; }
.chip-input__chip-remove { cursor: pointer; font-size: 14px; opacity: 0.7; }
.chip-input__chip-remove:hover { opacity: 1; }
.chip-input__field { border: none; background: none; outline: none; font-size: 13px; color: var(--color-text-primary-spec); flex: 1; min-width: 100px; }

/* Screener layout */
.screener-layout { display: flex; flex-direction: column; gap: var(--space-8); }
.screener-filters { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-8); }
.screener-filters__title { font-size: 13px; font-weight: 600; color: var(--color-text-primary-spec); margin-bottom: var(--space-6); }
.screener-results { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-8); }

/* ── Phase 16-18: Dashboards + Portfolios + Settings ──────────── */

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); }
.dashboard-card { background: var(--color-panel, var(--color-bg-content)); border: 1px solid var(--color-border, var(--color-border-spec)); border-radius: var(--dt-radius-md); overflow: hidden; cursor: pointer; transition: border-color 0.15s; position: relative; }
.dashboard-card:hover { border-color: var(--color-accent-spec); }
.dashboard-card__thumb { height: 90px; background: var(--color-bg, var(--color-bg-main)); display: flex; align-items: center; justify-content: center; color: var(--color-muted, var(--color-text-secondary-spec)); }
.dashboard-card__info { padding: var(--space-5) var(--space-7); }
.dashboard-card__title { font-size: 13px; font-weight: 600; color: var(--color-text, var(--color-text-primary-spec)); }
.dashboard-card__meta { font-size: 11px; color: var(--color-dim, var(--color-text-secondary-spec)); margin-top: 3px; }
.dashboard-card__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; gap: var(--space-3); opacity: 0; transition: opacity 0.15s; }
.dashboard-card:hover .dashboard-card__overlay { opacity: 1; }
.dashboard-card__action { padding: 5px var(--space-6); border-radius: var(--dt-radius-md); font-size: 11px; font-weight: 500; border: 1px solid rgba(255,255,255,0.25); color: #fff; background: rgba(255,255,255,0.08); cursor: pointer; transition: background 0.1s; }
.dashboard-card__action:hover { background: rgba(255,255,255,0.18); }
.dashboard-card--new { border-style: dashed; border-color: var(--color-border, var(--color-border-spec)); display: flex; align-items: center; justify-content: center; min-height: 140px; }
.dashboard-card--new:hover { border-color: var(--color-accent-spec); background: color-mix(in srgb, var(--color-accent-spec) 4%, transparent); }

/* Widget editor canvas */
.editor-canvas { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); min-height: 400px; }
.editor-widget { background: var(--color-panel, var(--color-bg-content)); border: 1px solid var(--color-border, var(--color-border-spec)); border-radius: var(--dt-radius-md); min-height: 220px; display: flex; flex-direction: column; overflow: hidden; }
.editor-widget__header { padding: var(--space-3) var(--space-6); border-bottom: 1px solid var(--color-border, var(--color-border-spec)); font-size: 12px; font-weight: 600; color: var(--color-dim, var(--color-text-secondary-spec)); display: flex; justify-content: space-between; align-items: center; background: var(--color-bg, var(--color-bg-main)); }
.editor-widget__body { flex: 1; min-height: 0; overflow: hidden; background: var(--color-panel, var(--color-bg-content)); }

/* Widget catalog */
.widget-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-6); }
.widget-catalog__item { background: var(--color-panel, var(--color-bg-content)); border: 1px solid var(--color-border, var(--color-border-spec)); border-radius: var(--dt-radius-md); padding: var(--space-8); text-align: center; cursor: pointer; transition: border-color 0.15s; }
.widget-catalog__item:hover { border-color: var(--color-accent-spec); background: color-mix(in srgb, var(--color-accent-spec) 6%, transparent); }
.widget-catalog__icon { font-size: 24px; margin-bottom: var(--space-4); color: var(--color-dim, var(--color-text-secondary-spec)); }
.widget-catalog__name { font-size: 13px; font-weight: 600; color: var(--color-text, var(--color-text-primary-spec)); }
.widget-catalog__desc { font-size: 11px; color: var(--color-dim, var(--color-text-secondary-spec)); margin-top: var(--space-2); }

/* Model portfolio cards */
.model-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-8); }
.model-card__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-6); }
.model-card__name { font-size: 16px; font-weight: 600; color: var(--color-text-primary-spec); }
.model-card__strategy { font-size: 11px; padding: var(--space-1) var(--space-4); border-radius: var(--dt-radius-md); background: color-mix(in srgb, var(--color-accent-spec) 10%, transparent); color: var(--color-accent-spec); font-weight: 500; }
.model-card__stats { display: flex; gap: var(--space-8); margin-bottom: var(--space-6); }
.model-card__stat { font-size: 12px; color: var(--color-text-secondary-spec); }
.model-card__stat-value { font-weight: 600; color: var(--color-text-primary-spec); }

/* Settings layout */
.settings-page { max-width: 720px; padding: var(--space-10); }
.settings-section { margin-bottom: var(--space-12); }
.settings-section__title { font-size: 16px; font-weight: 600; color: var(--color-text-primary-spec); margin-bottom: var(--space-2); }
.settings-section__desc { font-size: 13px; color: var(--color-text-secondary-spec); margin-bottom: var(--space-8); }
.settings-field { margin-bottom: var(--space-8); }
.settings-field__label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text-primary-spec); margin-bottom: var(--space-3); }
.settings-field__input { width: 100%; padding: var(--space-4) var(--space-6); font-size: 14px; border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); background: var(--color-bg-content); color: var(--color-text-primary-spec); }
.settings-field__input:focus { outline: none; border-color: var(--color-accent-spec); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent-spec) 20%, transparent); }
.settings-field__input--textarea { min-height: 80px; resize: vertical; }

/* Settings toggle row */
.settings-toggle { display: flex; align-items: center; justify-content: space-between; padding: var(--space-6) 0; border-bottom: 1px solid var(--color-border-spec); }
.settings-toggle__info { flex: 1; }
.settings-toggle__name { font-size: 14px; font-weight: 500; color: var(--color-text-primary-spec); }
.settings-toggle__desc { font-size: 12px; color: var(--color-text-secondary-spec); margin-top: var(--space-1); }

/* Theme selector cards */
.theme-cards { display: flex; gap: var(--space-6); }
.theme-card { flex: 1; padding: var(--space-8); border: 2px solid var(--color-border-spec); border-radius: var(--dt-radius-md); cursor: pointer; text-align: center; transition: all 0.15s; }
.theme-card:hover { border-color: var(--color-accent-spec); }
.theme-card--active { border-color: var(--color-accent-spec); background: color-mix(in srgb, var(--color-accent-spec) 6%, transparent); }
.theme-card__icon { font-size: 24px; margin-bottom: var(--space-4); }
.theme-card__label { font-size: 13px; font-weight: 600; color: var(--color-text-primary-spec); }

/* Plan comparison cards */
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.plan-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-10); text-align: center; }
.plan-card--featured { border-color: var(--color-accent-spec); box-shadow: 0 0 0 1px var(--color-accent-spec); }
.plan-card__name { font-size: 18px; font-weight: 700; color: var(--color-text-primary-spec); }
.plan-card__price { font-size: 32px; font-weight: 700; color: var(--color-text-primary-spec); margin: var(--space-6) 0; }
.plan-card__price span { font-size: 14px; font-weight: 400; color: var(--color-text-secondary-spec); }
.plan-card__features { list-style: none; padding: 0; margin: var(--space-8) 0; text-align: left; }
.plan-card__features li { padding: var(--space-3) 0; font-size: 13px; color: var(--color-text-primary-spec); border-bottom: 1px solid var(--color-border-spec); }
.plan-card__features li::before { content: '✓'; color: var(--color-positive-spec); margin-right: var(--space-4); font-weight: 600; }

/* Keyboard shortcut badge */
.kbd { display: inline-block; padding: var(--space-1) var(--space-3); font-size: 11px; font-family: 'JetBrains Mono', monospace; background: var(--color-bg-main); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); color: var(--color-text-primary-spec); box-shadow: 0 1px 0 var(--color-border-spec); }

/* Drag & drop upload zone */
.upload-zone { border: 2px dashed var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-12); text-align: center; cursor: pointer; transition: all 0.15s; }
.upload-zone:hover { border-color: var(--color-accent-spec); background: color-mix(in srgb, var(--color-accent-spec) 5%, transparent); }
.upload-zone__icon { font-size: 32px; margin-bottom: var(--space-4); }
.upload-zone__text { font-size: 14px; color: var(--color-text-primary-spec); }
.upload-zone__hint { font-size: 12px; color: var(--color-text-secondary-spec); margin-top: var(--space-2); }

/* Danger zone */
.danger-zone { margin-top: var(--space-13); padding: var(--space-8); border: 1px solid var(--color-negative-spec); border-radius: var(--dt-radius-md); background: rgba(234, 57, 67, 0.05); }
.danger-zone__title { font-size: 14px; font-weight: 600; color: var(--color-negative-spec); margin-bottom: var(--space-4); }
.danger-zone__desc { font-size: 13px; color: var(--color-text-secondary-spec); margin-bottom: var(--space-6); }
.danger-zone__btn { padding: var(--space-4) var(--space-8); font-size: 13px; font-weight: 500; border-radius: var(--dt-radius-md); border: 1px solid var(--color-negative-spec); background: transparent; color: var(--color-negative-spec); cursor: pointer; }
.danger-zone__btn:hover { background: var(--color-negative-spec); color: #fff; }

/* ── Phase 19-20: Live Price + Dark Mode + A11y ─────────────── */

/* Blink animation classes */
.blink-up { animation: blink-green 0.6s ease-out; }
.blink-down { animation: blink-red 0.6s ease-out; }

@keyframes blink-green { 0% { background: rgba(96,128,96,.25); } 100% { background: transparent; } }
@keyframes blink-red { 0% { background: rgba(144,96,96,.25); } 100% { background: transparent; } }

/* Live price table */
.live-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.live-table th { text-align: left; padding: var(--space-4) var(--space-6); font-weight: 600; color: var(--color-text-secondary); border-bottom: 2px solid var(--color-border-spec); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.live-table td { padding: var(--space-3) var(--space-6); border-bottom: 1px solid var(--color-border-spec); color: var(--color-text-primary); transition: background 0.3s; }
.live-table tr:hover td { background: var(--color-bg-content); }
.live-table th.right, .live-table td.right { text-align: right; }

/* Market summary strip */
.market-strip { display: flex; gap: var(--space-6); margin-bottom: var(--space-8); overflow-x: auto; padding-bottom: var(--space-2); }
.market-strip__item { flex-shrink: 0; background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: var(--dt-radius-md); padding: var(--space-5) var(--space-8); min-width: 180px; }
.market-strip__name { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; }
.market-strip__price { font-size: 18px; font-weight: 700; color: var(--color-text-primary); margin-top: var(--space-1); font-family: 'JetBrains Mono', monospace; }
.market-strip__change { font-size: 12px; font-weight: 500; margin-top: var(--space-1); font-family: 'JetBrains Mono', monospace; }

/* ── Dark mode overrides ─────────────────────────────────────── */
.dark .kpi-card { background: var(--color-bg-content); }
.dark .spec-table th { color: var(--color-text-secondary); }
.dark .spec-table tr:hover td { background: var(--color-bg-content); }
.dark .chart-placeholder { background: var(--color-bg-content); border-color: var(--color-border-spec); }
.dark .heatmap-placeholder { background: var(--color-bg-content); }
.dark .news-card:hover { background: var(--color-bg-content); }
.dark .filter-row select, .dark .filter-row input { background: var(--color-bg-content); color: var(--color-text-primary); border-color: var(--color-border-spec); }
.dark .settings-field__input { background: var(--color-bg-content); color: var(--color-text-primary); border-color: var(--color-border-spec); }
.dark .upload-zone { border-color: var(--color-border-spec); }
.dark .upload-zone:hover { border-color: var(--color-accent); }
.dark .dashboard-card { background: var(--color-panel, var(--color-bg-content)); }
.dark .dashboard-card:hover { box-shadow: none; }
.dark .editor-widget { background: var(--color-panel, var(--color-bg-content)); }
.dark .model-card { background: var(--color-bg-content); }
.dark .plan-card { background: var(--color-bg-content); }
.dark .theme-card--active { background: color-mix(in srgb, var(--color-accent-spec) 10%, transparent); }
.dark .index-card { background: var(--color-bg-content); }
.dark .watchlist-item:hover { background: var(--color-bg-content); }
.dark .watchlist-item__badge { background: color-mix(in srgb, var(--color-border-spec) 40%, transparent); }
.dark .spec-toolbar__dropdown { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.dark .widget-catalog__item:hover { background: color-mix(in srgb, var(--color-accent-spec) 8%, transparent); }
.dark .chip-input { background: var(--color-bg-content); border-color: var(--color-border-spec); }
.dark .chip-input__field { color: var(--color-text-primary); }
.dark .periodicity-btn { border-color: var(--color-border-spec); color: var(--color-text-secondary); }
.dark .spec-toolbar__btn { background: var(--color-bg-content); border-color: var(--color-border-spec); }

/* ── Accessibility ──────────────────────────────────────────── */

/* Focus visible outlines */
*:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .blink-up, .blink-down { animation: none; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  :root {
    --color-border-spec: #666;
    --color-text-secondary: #555;
  }
  html.dark {
    --color-border-spec: #656565;
    --color-text-secondary: #656565;
  }
  .spec-table th { border-bottom-width: 3px; }
  .kpi-card { border-width: 2px; }
}

/* Screen reader only utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Skip to main content link */
.skip-link { position: absolute; top: -100%; left: 50%; transform: translateX(-50%); padding: var(--space-4) var(--space-8); background: var(--color-accent); color: #fff; border-radius: var(--dt-radius-md); font-size: 13px; font-weight: 600; z-index: 10000; transition: top 0.2s; }
.skip-link:focus { top: 0; }

/* Minimum touch target size for mobile */
@media (pointer: coarse) {
  .periodicity-btn, .spec-toolbar__btn, .filter-row__remove, .dashboard-card__action { min-height: 44px; min-width: 44px; }
  .settings-toggle { padding: var(--space-8) 0; }
  .watchlist-item { padding: var(--space-6) var(--space-7); }
}

/* Scrollbar styling for dark mode */
.dark ::-webkit-scrollbar { width: 8px; height: 8px; }
.dark ::-webkit-scrollbar-track { background: var(--color-bg-main); }
.dark ::-webkit-scrollbar-thumb { background: var(--color-border-spec); border-radius: var(--dt-radius-md); }
.dark ::-webkit-scrollbar-thumb:hover { background: var(--color-text-secondary); }
*, ::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;
}
.invisible {
  visibility: hidden;
}
.collapse {
  visibility: collapse;
}
.static {
  position: static;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.sticky {
  position: sticky;
}
.inset-0 {
  inset: 0px;
}
.-left-12 {
  left: -3rem;
}
.bottom-0 {
  bottom: 0px;
}
.left-6 {
  left: 1.5rem;
}
.right-sidebar {
  right: var(--sidebar-width);
}
.top-0 {
  top: 0px;
}
.top-4 {
  top: 1rem;
}
.z-10 {
  z-index: 10;
}
.z-\[1000\] {
  z-index: 1000;
}
.col-span-2 {
  grid-column: span 2 / span 2;
}
.m-0 {
  margin: 0px;
}
.mx-0 {
  margin-left: 0px;
  margin-right: 0px;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.my-0 {
  margin-top: 0px;
  margin-bottom: 0px;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-1\.5 {
  margin-bottom: 0.375rem;
}
.mb-10 {
  margin-bottom: 2.5rem;
}
.mb-12 {
  margin-bottom: 3rem;
}
.mb-14 {
  margin-bottom: 3.5rem;
}
.mb-16 {
  margin-bottom: 4rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-5 {
  margin-bottom: 1.25rem;
}
.mb-6 {
  margin-bottom: 1.5rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.mb-\[10px\] {
  margin-bottom: 10px;
}
.mb-\[var\(--dt-space-4\)\] {
  margin-bottom: var(--dt-space-4);
}
.mb-\[var\(--dt-space-5\)\] {
  margin-bottom: var(--dt-space-5);
}
.ml-12 {
  margin-left: 3rem;
}
.ml-2 {
  margin-left: 0.5rem;
}
.ml-4 {
  margin-left: 1rem;
}
.mr-1 {
  margin-right: 0.25rem;
}
.mr-\[5px\] {
  margin-right: 5px;
}
.mt-0 {
  margin-top: 0px;
}
.mt-0\.5 {
  margin-top: 0.125rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-12 {
  margin-top: 3rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-8 {
  margin-top: 2rem;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.\!inline {
  display: inline !important;
}
.inline {
  display: inline;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.\!table {
  display: table !important;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.inline-grid {
  display: inline-grid;
}
.contents {
  display: contents;
}
.hidden {
  display: none;
}
.h-12 {
  height: 3rem;
}
.h-14 {
  height: 3.5rem;
}
.h-16 {
  height: 4rem;
}
.h-2 {
  height: 0.5rem;
}
.h-3 {
  height: 0.75rem;
}
.h-4 {
  height: 1rem;
}
.h-6 {
  height: 1.5rem;
}
.h-\[14px\] {
  height: 14px;
}
.h-\[2px\] {
  height: 2px;
}
.h-\[32px\] {
  height: 32px;
}
.h-full {
  height: 100%;
}
.min-h-0 {
  min-height: 0px;
}
.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-14 {
  width: 3.5rem;
}
.w-16 {
  width: 4rem;
}
.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-\[28px\] {
  width: 28px;
}
.w-\[2px\] {
  width: 2px;
}
.w-\[40px\] {
  width: 40px;
}
.w-\[72px\] {
  width: 72px;
}
.w-\[80px\] {
  width: 80px;
}
.w-full {
  width: 100%;
}
.min-w-0 {
  min-width: 0px;
}
.min-w-\[48px\] {
  min-width: 48px;
}
.max-w-6xl {
  max-width: 72rem;
}
.max-w-\[1100px\] {
  max-width: 1100px;
}
.max-w-\[1400px\] {
  max-width: 1400px;
}
.max-w-\[260px\] {
  max-width: 260px;
}
.max-w-\[460px\] {
  max-width: 460px;
}
.max-w-\[580px\] {
  max-width: 580px;
}
.max-w-\[600px\] {
  max-width: 600px;
}
.max-w-\[640px\] {
  max-width: 640px;
}
.max-w-\[860px\] {
  max-width: 860px;
}
.max-w-\[900px\] {
  max-width: 900px;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-shrink {
  flex-shrink: 1;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.shrink {
  flex-shrink: 1;
}
.shrink-0 {
  flex-shrink: 0;
}
.grow {
  flex-grow: 1;
}
.border-collapse {
  border-collapse: collapse;
}
.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-col-resize {
  cursor: col-resize;
}
.cursor-default {
  cursor: default;
}
.cursor-pointer {
  cursor: pointer;
}
.select-all {
  -webkit-user-select: all;
     -moz-user-select: all;
          user-select: all;
}
.resize {
  resize: both;
}
.list-none {
  list-style-type: none;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-cols-\[2fr_1fr_1fr_1fr_1fr\] {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-baseline {
  align-items: baseline;
}
.justify-end {
  justify-content: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-0 {
  gap: 0px;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-1\.5 {
  gap: 0.375rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-2\.5 {
  gap: 0.625rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-6 {
  gap: 1.5rem;
}
.gap-\[10px\] {
  gap: 10px;
}
.gap-\[18px\] {
  gap: 18px;
}
.gap-\[1px\] {
  gap: 1px;
}
.gap-\[5px\] {
  gap: 5px;
}
.gap-\[var\(--dt-space-2\)\] {
  gap: var(--dt-space-2);
}
.gap-\[var\(--dt-space-3\)\] {
  gap: var(--dt-space-3);
}
.gap-x-px {
  -moz-column-gap: 1px;
       column-gap: 1px;
}
.gap-y-px {
  row-gap: 1px;
}
.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));
}
.self-stretch {
  align-self: stretch;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-x-auto {
  overflow-x: auto;
}
.overflow-y-auto {
  overflow-y: auto;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-ellipsis {
  text-overflow: ellipsis;
}
.whitespace-nowrap {
  white-space: nowrap;
}
.break-all {
  word-break: break-all;
}
.rounded {
  border-radius: 0.25rem;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-md {
  border-radius: 8px;
}
.rounded-none {
  border-radius: 0px;
}
.rounded-sm {
  border-radius: 4px;
}
.border {
  border-width: 1px;
}
.border-2 {
  border-width: 2px;
}
.border-b {
  border-bottom-width: 1px;
}
.border-l-2 {
  border-left-width: 2px;
}
.border-t {
  border-top-width: 1px;
}
.border-none {
  border-style: none;
}
.border-\[color-mix\(in_srgb\2c var\(--dt-accent-blue\)_25\%\2c var\(--dt-border-primary\)\)\] {
  border-color: color-mix(in srgb,var(--dt-accent-blue) 25%,var(--dt-border-primary));
}
.border-\[var\(--dt-border-primary\)\] {
  border-color: var(--dt-border-primary);
}
.border-\[var\(--dt-border-secondary\)\] {
  border-color: var(--dt-border-secondary);
}
.border-accent {
  border-color: var(--accent);
}
.border-border {
  border-color: var(--color-border);
}
.border-borderA {
  border-color: var(--color-borderA);
}
.border-green {
  border-color: var(--color-green);
}
.border-orange {
  border-color: var(--color-orange);
}
.border-red {
  border-color: var(--color-red);
}
.border-yellow {
  border-color: var(--color-yellow);
}
.bg-\[color-mix\(in_srgb\2c var\(--dt-accent-blue\)_12\%\2c var\(--dt-bg-secondary\)\)\] {
  background-color: color-mix(in srgb,var(--dt-accent-blue) 12%,var(--dt-bg-secondary));
}
.bg-\[var\(--dt-bg-active\)\] {
  background-color: var(--dt-bg-active);
}
.bg-\[var\(--dt-bg-secondary\)\] {
  background-color: var(--dt-bg-secondary);
}
.bg-\[var\(--dt-bg-tertiary\)\] {
  background-color: var(--dt-bg-tertiary);
}
.bg-accent {
  background-color: var(--accent);
}
.bg-bg {
  background-color: var(--color-bg);
}
.bg-green {
  background-color: var(--color-green);
}
.bg-greenBgS {
  background-color: var(--color-greenBgS);
}
.bg-panel {
  background-color: var(--color-panel);
}
.bg-panelH {
  background-color: var(--color-panelH);
}
.bg-red {
  background-color: var(--color-red);
}
.bg-redBgS {
  background-color: var(--color-redBgS);
}
.bg-transparent {
  background-color: transparent;
}
.bg-yellowBgS {
  background-color: var(--color-yellowBgS);
}
.bg-none {
  background-image: none;
}
.p-0 {
  padding: 0px;
}
.p-2 {
  padding: 0.5rem;
}
.p-3 {
  padding: 0.75rem;
}
.p-3\.5 {
  padding: 0.875rem;
}
.p-4 {
  padding: 1rem;
}
.p-\[10px_14px\] {
  padding: 10px 14px;
}
.p-\[14px\] {
  padding: 14px;
}
.p-\[16px_14px\] {
  padding: 16px 14px;
}
.p-\[3px_4px\] {
  padding: 3px 4px;
}
.p-\[6px_4px\] {
  padding: 6px 4px;
}
.p-\[6px_8px\] {
  padding: 6px 8px;
}
.p-\[7px_14px\] {
  padding: 7px 14px;
}
.p-\[8px_14px\] {
  padding: 8px 14px;
}
.p-\[var\(--dt-space-3\)\] {
  padding: var(--dt-space-3);
}
.p-\[var\(--dt-space-4\)\] {
  padding: var(--dt-space-4);
}
.px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.px-1\.5 {
  padding-left: 0.375rem;
  padding-right: 0.375rem;
}
.px-10 {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}
.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;
}
.px-5 {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.px-7 {
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}
.px-\[10px\] {
  padding-left: 10px;
  padding-right: 10px;
}
.px-\[14px\] {
  padding-left: 14px;
  padding-right: 14px;
}
.px-\[3px\] {
  padding-left: 3px;
  padding-right: 3px;
}
.px-\[6px\] {
  padding-left: 6px;
  padding-right: 6px;
}
.px-\[7px\] {
  padding-left: 7px;
  padding-right: 7px;
}
.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-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.py-\[10px\] {
  padding-top: 10px;
  padding-bottom: 10px;
}
.py-\[14px\] {
  padding-top: 14px;
  padding-bottom: 14px;
}
.py-\[16px\] {
  padding-top: 16px;
  padding-bottom: 16px;
}
.py-\[1px\] {
  padding-top: 1px;
  padding-bottom: 1px;
}
.py-\[2px\] {
  padding-top: 2px;
  padding-bottom: 2px;
}
.py-\[3px\] {
  padding-top: 3px;
  padding-bottom: 3px;
}
.py-\[5px\] {
  padding-top: 5px;
  padding-bottom: 5px;
}
.py-\[6px\] {
  padding-top: 6px;
  padding-bottom: 6px;
}
.pb-0 {
  padding-bottom: 0px;
}
.pb-10 {
  padding-bottom: 2.5rem;
}
.pb-\[100px\] {
  padding-bottom: 100px;
}
.pb-\[2px\] {
  padding-bottom: 2px;
}
.pl-\[10px\] {
  padding-left: 10px;
}
.pt-16 {
  padding-top: 4rem;
}
.pt-2 {
  padding-top: 0.5rem;
}
.pt-4 {
  padding-top: 1rem;
}
.pt-7 {
  padding-top: 1.75rem;
}
.pt-\[3px\] {
  padding-top: 3px;
}
.pt-\[var\(--dt-space-3\)\] {
  padding-top: var(--dt-space-3);
}
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.align-middle {
  vertical-align: middle;
}
.font-\[inherit\] {
  font-family: inherit;
}
.font-mono {
  font-family: var(--font-mono);
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-\[10px\] {
  font-size: 10px;
}
.text-\[11px\] {
  font-size: 11px;
}
.text-\[12px\] {
  font-size: 12px;
}
.text-\[13px\] {
  font-size: 13px;
}
.text-\[14px\] {
  font-size: 14px;
}
.text-\[15px\] {
  font-size: 15px;
}
.text-\[16px\] {
  font-size: 16px;
}
.text-\[17px\] {
  font-size: 17px;
}
.text-\[18px\] {
  font-size: 18px;
}
.text-\[28px\] {
  font-size: 28px;
}
.text-\[40px\] {
  font-size: 40px;
}
.text-\[9px\] {
  font-size: 9px;
}
.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.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;
}
.italic {
  font-style: italic;
}
.ordinal {
  --tw-ordinal: ordinal;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.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);
}
.leading-\[1\.05\] {
  line-height: 1.05;
}
.leading-\[1\.15\] {
  line-height: 1.15;
}
.leading-\[1\.1\] {
  line-height: 1.1;
}
.leading-\[1\.2\] {
  line-height: 1.2;
}
.leading-\[1\.4\] {
  line-height: 1.4;
}
.leading-\[1\.55\] {
  line-height: 1.55;
}
.leading-\[1\.65\] {
  line-height: 1.65;
}
.leading-\[1\.6\] {
  line-height: 1.6;
}
.leading-\[1\.7\] {
  line-height: 1.7;
}
.tracking-\[-0\.025em\] {
  letter-spacing: -0.025em;
}
.tracking-\[-0\.02em\] {
  letter-spacing: -0.02em;
}
.tracking-\[-0\.03em\] {
  letter-spacing: -0.03em;
}
.tracking-\[0\.02em\] {
  letter-spacing: 0.02em;
}
.tracking-\[0\.04em\] {
  letter-spacing: 0.04em;
}
.tracking-\[0\.06em\] {
  letter-spacing: 0.06em;
}
.tracking-\[0\.08em\] {
  letter-spacing: 0.08em;
}
.text-\[var\(--dt-accent-blue\)\] {
  color: var(--dt-accent-blue);
}
.text-\[var\(--dt-text-primary\)\] {
  color: var(--dt-text-primary);
}
.text-\[var\(--dt-text-secondary\)\] {
  color: var(--dt-text-secondary);
}
.text-\[var\(--dt-text-tertiary\)\] {
  color: var(--dt-text-tertiary);
}
.text-accent {
  color: var(--accent);
}
.text-dim {
  color: var(--color-dim);
}
.text-green {
  color: var(--color-green);
}
.text-muted {
  color: var(--color-muted);
}
.text-orange {
  color: var(--color-orange);
}
.text-red {
  color: var(--color-red);
}
.text-text {
  color: var(--color-text);
}
.text-yellow {
  color: var(--color-yellow);
}
.underline {
  text-decoration-line: underline;
}
.overline {
  text-decoration-line: overline;
}
.line-through {
  text-decoration-line: line-through;
}
.no-underline {
  text-decoration-line: none;
}
.placeholder-muted::-moz-placeholder {
  color: var(--color-muted);
}
.placeholder-muted::placeholder {
  color: var(--color-muted);
}
.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);
}
.ring-accent {
  --tw-ring-color: var(--accent);
}
.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);
}
.grayscale {
  --tw-grayscale: grayscale(100%);
  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);
}
.invert {
  --tw-invert: invert(100%);
  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) !important;
}
.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;
}
.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.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);
}

/* ── Default theme: OpenBB-inspired Dark ──── */
:root {
  --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: #ffffff;
  --color-green: var(--dt-positive);
  --color-greenD: var(--dt-accent-green-dark);
  --color-greenBg: rgba(22, 163, 74, 0.08);
  --color-greenBgS: rgba(22, 163, 74, 0.15);
  --color-red: var(--dt-negative);
  --color-redBg: rgba(220, 38, 38, 0.08);
  --color-redBgS: rgba(220, 38, 38, 0.15);
  --color-yellow: var(--dt-accent-yellow);
  --color-yellowBg: rgba(234, 88, 12, 0.08);
  --color-yellowBgS: rgba(234, 88, 12, 0.15);
  --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: var(--dt-bg-secondary);
  --color-titleInactive: var(--dt-bg-secondary);
  --color-bevelLight: rgba(255, 255, 255, 0.04);
  --color-bevelDark: var(--dt-bg-primary);
  --color-statusBg: var(--dt-bg-secondary);

  --font-mono: var(--dt-font-mono);
  --font-sans: var(--dt-font-sans);

  --radius-sm: var(--dt-radius-sm);
  --radius-md: var(--dt-radius-md);
  --radius-lg: var(--dt-radius-lg);
  --radius-xl: var(--dt-radius-xl);

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

/* Theme transitions only on interactive elements */
button, a, input, select, textarea, [role="button"] {
  transition: var(--transition-theme);
}

/* ─── Focus-visible ring — Koyfin teal ─────────────────── */
:focus-visible {
  outline: 2px solid rgba(0, 170, 255, 0.5);
  outline-offset: 1px;
}

/* ─── Tabular numerals for all data values ───────────────────────────── */
.tabular-nums,
[data-numeric] {
  font-variant-numeric: tabular-nums;
}

html,
body,
#root {
  height: 100%;
}

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

body {
  margin: 0;
}

#root {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ─── 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 0 1px rgba(212, 212, 212, 0.10); }
  50% { box-shadow: 0 0 0 1px rgba(212, 212, 212, 0.18); }
}

@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(212, 212, 212, 0.12); }
  50% { border-color: rgba(212, 212, 212, 0.22); }
}

@keyframes bgPulse {
  0%, 100% { background-color: rgba(212, 212, 212, 0.03); }
  50% { background-color: rgba(212, 212, 212, 0.06); }
}

@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(255, 255, 255, 0.04) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.animate-gradient-text {
  background: linear-gradient(270deg, #EAEAEA, #5A5A5A, #5A5A5A, #EAEAEA);
  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: border-color 0.15s ease;
}
.hover-glow:hover {
  border-color: var(--dt-border-strong) !important;
}

.hover-lift {
  transition: transform 0.15s ease;
}
.hover-lift:hover {
  transform: translateY(-1px);
}

.btn-press {
  transition: transform 0.1s ease;
}
.btn-press:active {
  transform: scale(0.98);
}

.input-focus-glow:focus {
  border-color: var(--color-accent) !important;
  outline: none;
}

/* Accent border wrapper (simplified from gradient-border) */
.gradient-border {
  position: relative;
  overflow: hidden;
  border-radius: var(--dt-radius-md);
  border: 1px solid var(--dt-accent-blue);
}
.gradient-border::before {
  display: none;
}
.gradient-border > span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #131313;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--dt-border-strong, #2A2A31);
  border-radius: var(--dt-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dt-text-tertiary, #5A5A5A);
}

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

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

.animated-grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}
.animated-grid-bg::after {
  display: none;
}

.animated-divider {
  height: 1px;
  background: var(--dt-border-primary);
}

.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 {
  display: none;
}

.price-flash-up { animation: flashGreen 0.4s ease-out; }
.price-flash-down { animation: flashRed 0.4s ease-out; }
@keyframes flashGreen {
  0% { background-color: var(--dt-positive-dim, #1A3D2B); }
  100% { background-color: transparent; }
}
@keyframes flashRed {
  0% { background-color: var(--dt-negative-dim, #3D1A1A); }
  100% { background-color: transparent; }
}

::-moz-selection {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text);
}

::selection {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text);
}

/* ─── Panel slide-in animation ───────────────────────────────────────── */
.panel-slide-in-right {
  animation: panelSlideInRight 200ms ease-out;
}
.panel-slide-in-left {
  animation: panelSlideInLeft 200ms ease-out;
}
@keyframes panelSlideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes panelSlideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

.terminal-panel-focused {
  box-shadow: 0 0 0 1px rgba(212, 212, 212, 0.2);
}

@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.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 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: var(--color-panel) !important;
  border-color: var(--dt-border-secondary) !important;
}

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

.ask-header-link:hover {
  color: var(--dt-text-bright) !important;
  background: rgba(255,255,255,0.06) !important;
}

.ask-back-btn:hover {
  color: var(--dt-text-bright) !important;
  background: rgba(255,255,255,0.06) !important;
}

.ask-followup-btn:hover {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--dt-accent-muted) !important;
  color: var(--dt-text-bright) !important;
}

.ask-workspace-btn:hover {
  background: var(--dt-accent-muted) !important;
  border-color: var(--dt-border-secondary) !important;
}

.ask-submit-btn:hover:not(:disabled) {
  background: var(--dt-accent-green-alt) !important;
}

.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-border::after {
  content: var(--tw-content);
  border-color: var(--color-border);
}

.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-accent:hover {
  background-color: var(--accent);
}

.hover\:bg-panelH:hover {
  background-color: var(--color-panelH);
}

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

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

.hover\:opacity-80:hover {
  opacity: 0.8;
}

.hover\:opacity-90:hover {
  opacity: 0.9;
}

.focus\:border-accent:focus {
  border-color: var(--accent);
}

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

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

.peer:checked ~ .peer-checked\:bg-accent {
  background-color: var(--accent);
}

.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));
  }
}
