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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.gs-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 3px;
  font-family: var(--dt-font-sans);
  font-size: 10px;
  color: var(--dt-text-secondary, #94a3b8);
  background: var(--dt-bg-tertiary, #1a1f2e);
  border: 1px solid var(--dt-border-primary, #1e2536);
  border-radius: 3px;
  line-height: 1.3;
}

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

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

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

.gs-back-btn:hover {
  background: var(--dt-bg-hover, #1e2536);
  color: var(--dt-text-primary, #e2e8f0);
  border-color: var(--dt-border-active, #3b82f6);
}

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

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

/* ── Function code badge ── */
.gs-fn-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 2px 8px;
  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: 8px 20px 6px;
  background: var(--dt-bg-secondary, #111113);
  border-bottom: 1px solid var(--dt-border-primary, #27272a);
  flex-shrink: 0;
}

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

.ih-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.ih-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ih-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dt-text-primary, #fafafa);
  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 6px;
  border-radius: 3px;
  background: rgba(76, 124, 243, 0.10);
  color: var(--dt-accent-blue, #4C7CF3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.ih-row-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ih-price-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

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

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

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

.ih-change {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dt-text-tertiary, #71717a);
}
.ih-change--up { color: var(--dt-positive, #22c55e); }
.ih-change--down { color: var(--dt-negative, #ef4444); }

/* Separator between info blocks */
.ih-sep {
  width: 1px;
  height: 28px;
  background: var(--dt-border-primary, #27272a);
  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, #fafafa);
  white-space: nowrap;
}

.ih-info-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--dt-text-tertiary, #71717a);
  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, #fafafa);
  font-variant-numeric: tabular-nums;
}

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

.ih-stat-value--up { color: var(--dt-positive, #22c55e); }
.ih-stat-value--down { color: var(--dt-negative, #ef4444); }

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

.ih-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.ih-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--dt-bg-tertiary, #1e1e22);
  border: 1px solid var(--dt-border-primary, #27272a);
  border-radius: 4px;
  color: var(--dt-text-secondary, #a1a1aa);
  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, #fafafa);
}
/* ── Right Sidebar — 240px slide-over panel ──────────────────────────── */

.rs-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: var(--dt-right-rail-width, 56px);
  z-index: 918;
  background: rgba(0, 0, 0, 0.24);
}

.rs-panel {
  position: fixed;
  top: 0;
  right: var(--dt-right-rail-width, 56px);
  bottom: 0;
  width: 280px;
  z-index: 920;
  background: var(--dt-bg-secondary, #111113);
  border-left: 1px solid var(--dt-border-primary, #27272a);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  overflow: hidden;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  will-change: transform;
}

.rs-panel--open {
  transform: translateX(0);
  pointer-events: auto;
}

/* ── Header & Tabs ──────────────────────────────────────────────────── */

.rs-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--dt-border-primary, #27272a);
  flex-shrink: 0;
}

.rs-tabs {
  display: flex;
  flex: 1;
  gap: 0;
}

.rs-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dt-text-tertiary, #71717a);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.rs-tab:hover {
  color: var(--dt-text-secondary, #a1a1aa);
}

.rs-tab--active {
  color: var(--dt-text-primary, #fafafa);
  border-bottom-color: var(--dt-accent-blue, #4C7CF3);
}

.rs-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: none;
  border: none;
  color: var(--dt-text-tertiary, #71717a);
  cursor: pointer;
  flex-shrink: 0;
}

.rs-close:hover {
  background: var(--dt-bg-hover, rgba(255,255,255,0.06));
  color: var(--dt-text-primary, #fafafa);
}

/* ── Tab Content ────────────────────────────────────────────────────── */

.rs-tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.rs-empty {
  padding: 16px 12px;
  font-size: 11px;
  color: var(--dt-text-tertiary, #71717a);
  text-align: center;
}

/* ── Watchlist Select ───────────────────────────────────────────────── */

.rs-watchlist-select {
  padding: 8px 8px 4px;
}

.rs-watchlist-select select {
  width: 100%;
  background: var(--dt-bg-input, #1a1a1e);
  color: var(--dt-text-primary, #fafafa);
  border: 1px solid var(--dt-border-primary, #27272a);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.rs-watchlist-select select:focus {
  border-color: var(--dt-accent-blue, #4C7CF3);
}

/* ── Ticker Row (32px compact) ──────────────────────────────────────── */

.rs-ticker-list {
  padding: 4px 0;
}

.rs-ticker-row {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: none;
  border: none;
  color: var(--dt-text-primary, #fafafa);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.1s;
  gap: 6px;
}

.rs-ticker-row:hover {
  background: var(--dt-bg-hover, rgba(255,255,255,0.06));
}

.rs-ticker-row__symbol {
  font-size: 11px;
  font-weight: 600;
  min-width: 60px;
  text-align: left;
  color: var(--dt-text-primary, #fafafa);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.rs-ticker-row__change {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 54px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}

/* ── Movers Section ─────────────────────────────────────────────────── */

.rs-movers-section {
  padding: 4px 0;
}

.rs-movers-section + .rs-movers-section {
  border-top: 1px solid var(--dt-border-primary, #27272a);
}

.rs-movers-title {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dt-text-tertiary, #71717a);
}

/* ── News Item ──────────────────────────────────────────────────────── */

.rs-news-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--dt-border-primary, #1e1e22);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}

.rs-news-item:hover {
  background: var(--dt-bg-hover, rgba(255,255,255,0.06));
}

.rs-news-item__headline {
  font-size: 11px;
  font-weight: 500;
  color: var(--dt-text-primary, #fafafa);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rs-news-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--dt-text-tertiary, #71717a);
}

.rs-news-item__source {
  font-weight: 600;
  color: var(--dt-text-secondary, #a1a1aa);
}

.rs-news-item__time {
  color: var(--dt-text-tertiary, #71717a);
}
/* ══════════════════════════════════════════════════════════════════════════════
   Design System for dibsTERMINAL
   Dense, data-rich financial analytics dashboard aesthetic
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Color Palette ── */
  /* Backgrounds — Koyfin-style deep navy hierarchy (darkest → lightest) */
  --dt-bg-primary: #0D0F17;
  --dt-bg-secondary: #131722;
  --dt-bg-tertiary: #1A1D2E;
  --dt-bg-hover: #21253A;
  --dt-bg-active: #252B45;
  --dt-bg-input: #181C2A;

  /* 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: #1F2335;
  --dt-border-secondary: #2A2E45;
  --dt-border-strong: #3A3F5C;
  --dt-border-focus: #4C7CF3;

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

  /* Text */
  --dt-text-primary: #E4E6F0;
  --dt-text-secondary: #8B8FA8;
  --dt-text-tertiary: #555978;
  --dt-text-disabled: #3D4162;
  --dt-text-inverse: #0D0F17;

  /* 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 colors — blue primary */
  --dt-accent-blue: #4C7CF3;
  --dt-accent-blue-hover: #6290F5;
  --dt-accent-muted: #1E2D5A;
  --dt-accent-glow: rgba(76, 124, 243, 0.15);
  --dt-accent-green: #26A65B;
  --dt-accent-red: #E8453C;
  --dt-accent-yellow: #F5A623;
  --dt-accent-orange: #F97316;
  --dt-accent-purple: #A855F7;
  --dt-accent-cyan: #06B6D4;

  /* 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 */
  --dt-positive: #26A65B;
  --dt-positive-dim: #1A3D2B;
  --dt-negative: #E8453C;
  --dt-negative-dim: #3D1A1A;
  --dt-neutral: #8B8FA8;
  --dt-unchanged: #555978;

  /* 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 (for widget linking) — matches chart palette */
  --dt-group-1: #4C7CF3;
  --dt-group-2: #26A65B;
  --dt-group-3: #F97316;
  --dt-group-4: #A855F7;
  --dt-group-5: #06B6D4;
  --dt-group-6: #EC4899;

  /* Chart palette (ordered) */
  --chart-1: #4C7CF3;
  --chart-2: #26A65B;
  --chart-3: #E8453C;
  --chart-4: #F5A623;
  --chart-5: #A855F7;
  --chart-6: #06B6D4;
  --chart-7: #F97316;
  --chart-8: #EC4899;

  /* Typography */
  --dt-font-sans: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
  --dt-font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  --dt-font-size-xs: 10px;
  --dt-font-size-sm: 11px;
  --dt-font-size-base: 12px;
  --dt-font-size-md: 13px;
  --dt-font-size-lg: 14px;
  --dt-font-size-xl: 16px;
  --dt-font-size-2xl: 20px;

  /* 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;

  /* 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 */
  --dt-radius-sm: 4px;
  --dt-radius-md: 6px;
  --dt-radius-lg: 8px;
  --dt-radius-xl: 12px;

  /* Shadows */
  --dt-shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --dt-shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --dt-shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
  --dt-shadow-xl: 0 8px 32px rgba(0,0,0,0.4);
  --dt-shadow-glow-blue: 0 0 0 2px var(--dt-accent-glow);

  /* Theme-aware utility vars */
  --dt-grid-line: rgba(31,35,53,0.6);
  --dt-nav-scrolled-bg: rgba(13,15,23,0.95);
  --dt-feature-hover-bg: #1A1D2E;
  --dt-overlay: rgba(0,0,0,0.6);

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

  /* Row heights */
  --row-data: 32px;
  --row-compact: 26px;

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

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

  /* ── 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: #1E8C4E;
  --color-greenBg: rgba(38,166,91,0.10);
  --color-greenBgS: rgba(38,166,91,0.18);
  --color-red: var(--dt-negative);
  --color-redBg: rgba(232,69,60,0.10);
  --color-redBgS: rgba(232,69,60,0.18);
  --color-yellow: var(--dt-accent-yellow);
  --color-yellowBg: rgba(245,166,35,0.10);
  --color-yellowBgS: rgba(245,166,35,0.18);
  --color-cyan: var(--dt-accent-cyan);
  --color-blue: var(--dt-accent-blue);
  --color-purple: var(--dt-accent-purple);
  --color-orange: var(--dt-accent-orange);
  --color-accent: var(--dt-accent-blue);
  --color-titleActive: #131722;
  --color-titleInactive: var(--dt-bg-secondary);
  --color-bevelLight: rgba(255,255,255,0.04);
  --color-bevelDark: #0A0C14;
  --color-statusBg: var(--dt-bg-secondary);

  /* Legacy sidebar/topbar vars → new design tokens */
  --dt-sidebar-bg: var(--dt-bg-primary);
  --dt-sidebar-border: var(--dt-border-primary);
  --dt-sidebar-text: var(--dt-text-secondary);
  --dt-sidebar-text-active: var(--dt-text-primary);
  --dt-sidebar-hover: var(--dt-bg-hover);
  --dt-sidebar-active-bg: rgba(76,124,243,0.12);
  --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: var(--dt-border-primary);
  --dt-topbar-text: var(--dt-text-primary);
  --dt-content-bg: var(--dt-bg-secondary);
}


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

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

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

::-moz-selection {
  background: rgba(76,124,243,0.25);
  color: var(--dt-text-primary);
}

::selection {
  background: rgba(76,124,243,0.25);
  color: var(--dt-text-primary);
}

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

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


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

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

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

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

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

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

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

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

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

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

/* Dense table variant for data-heavy views */
.dt-table--dense th,
.dt-table--dense td {
  padding: 2px 6px;
  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: 3px;
}


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

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

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

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

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

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

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

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

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

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


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

.dt-shell {
  display: grid;
  grid-template-columns: var(--dt-sidebar-width) 1fr;
  height: 100vh;
  /* Extra 8px gap so content never touches the fixed right rail */
  padding-right: calc(var(--dt-right-rail-width, 56px) + 8px);
  background: var(--dt-content-bg);
  transition: grid-template-columns 0.2s ease;
  /* overflow: hidden clips fixed-position children (RightSidebar) */
  overflow: visible;
}

.dt-shell--collapsed {
  grid-template-columns: var(--dt-sidebar-collapsed-width) 1fr;
}

.dt-shell__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  /* overflow: hidden clips fixed-position children (RightSidebar) */
  overflow: visible;
}


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

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

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

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

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

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

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

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

.dt-sidebar__section + .dt-sidebar__section {
  margin-top: 4px;
  padding-top: 8px;
  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 12px 8px;
}

.dt-sidebar__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dt-text-secondary);
  white-space: nowrap;
}

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

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

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

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

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

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

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

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

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

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

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

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

.dt-sidebar__item--active {
  background: transparent;
  color: var(--dt-sidebar-active-accent);
  position: relative;
}
.dt-sidebar__item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--dt-sidebar-active-accent);
  border-radius: 0 2px 2px 0;
}

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

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

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

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

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

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

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

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

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

/* Collapsed sidebar overrides */
.dt-shell--collapsed .dt-sidebar {
  width: 44px;
}

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

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

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

.dt-shell--collapsed .dt-sidebar__item {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
}

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


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

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

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

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

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

/* Flexible spacer */
.dt-topbar__spacer { display: none; }

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

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

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

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

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

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

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

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

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

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

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

.dt-topbar__spacer { flex: 1; }

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

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

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

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

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

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

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

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

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


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

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

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

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


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

.dt-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px;
  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: 600;
  cursor: pointer;
  transition: all var(--dt-transition-fast);
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
  font-family: var(--dt-font-sans);
  text-decoration: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

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

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

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

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

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

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

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

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

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

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

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

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

/* Danger Button */
.dt-btn-danger {
  background: rgba(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);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.dt-btn-icon {
  padding: var(--dt-space-1);
  border-radius: var(--dt-radius-sm);
  background: transparent;
  color: var(--dt-text-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: 2px var(--dt-space-2); font-size: var(--dt-font-size-xs); }
.dt-btn-lg { padding: var(--dt-space-2) var(--dt-space-5); font-size: var(--dt-font-size-md); }


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

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

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

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

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

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

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

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

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

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

.dt-select {
  background: var(--dt-bg-input);
  border: 1px solid var(--dt-border-primary);
  border-radius: var(--dt-radius-md);
  padding: var(--dt-space-2) var(--dt-space-3);
  padding-right: 32px;
  color: var(--dt-text-primary);
  font-size: var(--dt-font-size-sm);
  font-family: var(--dt-font-sans);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all var(--dt-transition-fast);
}

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

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

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

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

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

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

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

.dt-toggle input:focus + .dt-toggle-track {
  box-shadow: 0 0 0 3px rgba(38,166,91,0.2);
}

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

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

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


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

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

.dt-badge-green  { background: rgba(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(76,124,243,0.15); color: var(--dt-accent-blue); }
.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: 2px 8px;
  border-radius: 9999px;
  font-size: var(--dt-font-size-xs);
  font-weight: 500;
  background: var(--dt-bg-tertiary);
  color: var(--dt-text-secondary);
  border: 1px solid var(--dt-border-primary);
}

.dt-chip.active {
  background: rgba(76,124,243,0.15);
  color: var(--dt-accent-blue);
  border-color: rgba(76,124,243,0.3);
}


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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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


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

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


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

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

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

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

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

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


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

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

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

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

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


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

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

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

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

.dt-pct-change.up   { color: var(--dt-positive); background: rgba(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: 2px;
  padding: 2px 4px;
}

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

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

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


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

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

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

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

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

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

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


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

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

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


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

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

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

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

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

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

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

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

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


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

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

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

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

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

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


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

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

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

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

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

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


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

.symbol-link {
  color: var(--dt-accent-blue);
  text-decoration: none;
  border-radius: 3px;
  padding: 0 2px;
  margin: 0 -2px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  display: inline-block;
}
.symbol-link:hover {
  background: rgba(76, 124, 243, 0.12);
  color: #7DA4F7;
}
.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(76,124,243,0.08);  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"]
   Clean white background, slate text, same blue accent
   ═══════════════════════════════════════════════════════════════════════════ */

[data-color-mode="light"] {
  /* Backgrounds — clean white with warm grays */
  --dt-bg-primary: #ffffff;
  --dt-bg-secondary: #f8f9fb;
  --dt-bg-tertiary: #eef0f4;
  --dt-bg-hover: #eef0f4;
  --dt-bg-active: #e2e5ea;
  --dt-bg-input: #ffffff;

  /* Borders */
  --dt-border-primary: #e2e5ea;
  --dt-border-secondary: #cdd1d8;
  --dt-border-focus: #2098b5;

  /* Text */
  --dt-text-primary: #191e25;
  --dt-text-secondary: #5e6470;
  --dt-text-tertiary: #8b919d;
  --dt-text-disabled: #b5b9c2;

  /* Accent — teal, slightly deeper for contrast on white */
  --dt-accent-blue: #2098b5;
  --dt-accent-blue-hover: #1a7f99;

  /* Shadows — subtle in light mode */
  --dt-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --dt-shadow-md: 0 4px 8px rgba(0,0,0,0.07);
  --dt-shadow-lg: 0 10px 20px rgba(0,0,0,0.08);
  --dt-shadow-xl: 0 20px 30px rgba(0,0,0,0.10);
  --dt-shadow-glow-blue: 0 0 20px rgba(32,152,181,0.10);

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

  /* Sidebar overrides */
  --dt-sidebar-active-bg: rgba(32,152,181,0.10);
  --dt-sidebar-active-accent: #2098b5;

  /* Backward compat --color-* overrides */
  --color-bg: #ffffff;
  --color-panel: #f8f9fb;
  --color-panelH: #eef0f4;
  --color-border: #e2e5ea;
  --color-borderA: #cdd1d8;
  --color-borderF: #2098b5;
  --color-text: #191e25;
  --color-dim: #5e6470;
  --color-muted: #8b919d;
  --color-green: #16a34a;
  --color-greenD: #15803d;
  --color-greenBg: rgba(22,163,74,0.08);
  --color-greenBgS: rgba(22,163,74,0.15);
  --color-red: #dc2626;
  --color-redBg: rgba(220,38,38,0.08);
  --color-redBgS: rgba(220,38,38,0.15);
  --color-yellow: #ca8a04;
  --color-yellowBg: rgba(202,138,4,0.08);
  --color-yellowBgS: rgba(202,138,4,0.15);
  --color-accent: #2098b5;
  --color-titleActive: #eef0f4;
  --color-titleInactive: #f8f9fb;
  --color-bevelLight: rgba(0,0,0,0.03);
  --color-bevelDark: #e2e5ea;
  --color-statusBg: #f8f9fb;
}

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


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

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

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

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

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


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

.dt-right-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--dt-right-rail-width, 56px);
  background: var(--dt-bg-secondary);
  border-left: 1px solid var(--dt-border-primary);
  padding: 10px 0;
  gap: 4px;
  z-index: 930;
  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: 6px;
  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(76, 124, 243, 0.15);
  color: var(--dt-accent-blue);
}


/* ── Right Panel (slide-out) ── */
.dt-right-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 900;
}

.dt-right-panel {
  position: fixed;
  top: 0;
  right: var(--dt-right-rail-width, 56px);
  bottom: 0;
  width: 340px;
  background: var(--dt-bg-secondary);
  border-left: 1px solid var(--dt-border-primary);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + var(--dt-right-rail-width, 56px)));
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* ── dibsAI Panel (slide-out) ── */
.dt-ai-panel-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-bevelDark);
  z-index: 950;
}

.dt-ai-panel {
  position: fixed;
  top: 0;
  right: var(--dt-right-rail-width, 56px);
  bottom: 0;
  width: 380px;
  background: var(--dt-bg-secondary);
  border-left: 1px solid var(--dt-border-primary);
  z-index: 951;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + var(--dt-right-rail-width, 56px)));
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.dt-ai-panel--open {
  transform: translateX(0);
  pointer-events: auto;
}

.dt-right-panel--open {
  transform: translateX(0);
  pointer-events: auto;
}

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

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

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

.dt-right-panel-link {
  display: block;
  width: 100%;
  padding: 8px 16px;
  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;
  height: 100%;
  padding: 0;
}

.rr-notes__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 6px;
  min-height: 24px;
}

.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: 4px;
  padding: 10px;
  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: 6px 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: 4px 0;
}

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

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

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

.rr-mover-row {
  display: flex;
  align-items: center;
  gap: 6px;
  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: 4px;
  padding: 4px 0;
}

.rr-trending__link {
  display: block;
  width: 100%;
  padding: 8px 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-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;
}

/* react-grid-layout container override */
.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: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--dt-border-primary);
  background:
    radial-gradient(circle at top right, rgba(76, 124, 243, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.72));
}

.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: 6px;
}

.dt-now-overview-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.dt-now-overview-title {
  margin: 0;
  font-size: 22px;
  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: 8px 0 0;
  max-width: 720px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dt-text-secondary);
}

.dt-now-overview-guide {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dt-now-overview-guide-item {
  min-width: 112px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.48);
}

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

.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: 12px;
  padding: 12px 8px;
  background: var(--dt-bg-primary);
}
.dt-now-col:last-child { border-right: none; }

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

/* 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: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--dt-text-secondary);
  border-bottom: 1px solid var(--dt-border-primary);
  gap: 6px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.dt-now-panel-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
/* Drag handle icon — only the icon triggers drag */
.dt-now-panel-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 4px;
  color: var(--dt-text-tertiary);
  cursor: grab;
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
  touch-action: none;
}
.dt-now-panel-drag-handle:hover {
  background: var(--dt-bg-hover);
  color: var(--dt-text-secondary);
  opacity: 1;
}
.dt-now-panel-drag-handle:active {
  cursor: grabbing;
}
.dt-now-panel-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  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: 6px;
  flex-wrap: wrap;
}
.dt-now-panel-header-legend-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.42);
}
.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: 4px;
}
.dt-now-panel-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--dt-text-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: 3px 3px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  color: var(--dt-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--dt-border-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: sticky;
  top: 0;
  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, %) */
.dt-now-table th:nth-child(1) { width: 32px; }
.dt-now-table th:nth-child(2) { text-align: left; }
.dt-now-table th:nth-child(3) { width: 70px; }
.dt-now-table th:nth-child(4) { width: 56px; }
.dt-now-table th:nth-child(5) { width: 42px; }
.dt-now-table td {
  padding: 3px 3px;
  border-bottom: 1px solid rgba(30,37,54,0.5);
  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-ticker {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.dt-now-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.dt-now-ticker {
  font-family: var(--dt-font-mono);
  font-weight: 600;
  color: var(--dt-text-tertiary);
  font-size: 10px;
  flex-shrink: 0;
}
.dt-now-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dt-now-color-dot-btn {
  width: 9px;
  height: 9px;
  border: none;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
}
.dt-now-color-dot-btn:hover {
  filter: brightness(1.08);
}
.dt-now-color-dot-btn:focus-visible {
  outline: 1px solid var(--dt-accent-blue);
  outline-offset: 2px;
}
.dt-now-table .subheader td {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--dt-text-tertiary);
  padding-top: 6px;
  background: var(--dt-bg-tertiary);
}

@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: 4px 8px;
  border-bottom: 1px solid var(--dt-border-primary);
}
.dt-now-chart-tab {
  padding: 2px 6px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--dt-text-tertiary);
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}
.dt-now-chart-tab:hover { color: var(--dt-text-secondary); }
.dt-now-chart-tab--active {
  color: var(--dt-accent-blue);
  background: rgba(76,124,243,0.1);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

.dt-now-table tr.selected:hover td {
  background: rgba(76, 124, 243, 0.25) !important;
}

/* Selected row in yields panel */
.dt-now-yields-row.selected {
  background: rgba(76, 124, 243, 0.15);
}

.dt-now-yields-row.selected:hover {
  background: rgba(76, 124, 243, 0.25);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Responsive adjustments */
@media (max-width: 1200px) {
  .dt-now-grid {
    grid-template-columns: 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: 20px;
  right: 20px;
  z-index: 2600;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  pointer-events: none;
}

.dt-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  min-width: 280px;
  max-width: 400px;
  border-radius: 6px;
  border-left: 4px solid;
  background: var(--color-panel, #1a1e27);
  border-color: var(--dt-toast-border, #333);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  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, #e8eaed);
  margin-bottom: 2px;
}

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

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

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

.dt-toast__action {
  margin-top: 6px;
}

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

.dt-toast__action button:hover {
  background: rgba(49, 183, 216, 0.08);
}

.dt-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--dt-toast-border, #333);
  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, #ef4444);
  font-size: 0.6875rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: fadeIn 0.2s ease;
}

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

.dt-form-success {
  color: var(--color-green, #22c55e);
  font-size: 0.6875rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  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: 4px;
  line-height: 1.4;
}

.dt-input--error,
.dt-select--error {
  border-color: var(--color-red, #ef4444) !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, #22c55e) !important;
}

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

.dt-page-enter {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  animation: dt-page-fade-in 0.2s ease-out;
}

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

@keyframes dt-page-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

.dt-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--dt-text-secondary, var(--color-dim, #9ba1ad));
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.dt-recent-item__symbol {
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--color-accent, #31b7d8);
  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 (Koyfin-inspired) */

:root {
  /* Layout */
  --topbar-height: 50px;
  --sidebar-width: 190px;
  --sidebar-collapsed-width: 48px;
  --right-sidebar-width: 230px;
  --panel-radius: 6px;
  --table-row-height: 36px;
  --panel-padding: 14px;

  /* Light mode defaults (overridden by .dark) */
  --color-bg-main: #FFFFFF;
  --color-bg-content: #F7F7F9;
  --color-bg-sidebar-left: #F5F5F5;
  --color-bg-sidebar-nav: #1E2227;
  --color-bg-table-header: #F8F9FA;
  --color-accent: #1E6FE8;
  --color-accent-hover: #1E5AD6;
  --color-positive: #22C55E;
  --color-negative: #EF4444;
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #6B7280;
  --color-border-spec: #E5E7EB;
  --color-upgrade-bg: #EFF6FF;
  --color-upgrade-text: #1E6FE8;
}

html.dark {
  --color-bg-main: #0F1117;
  --color-bg-content: #161B22;
  --color-bg-sidebar-left: #0D1117;
  --color-bg-sidebar-nav: #0D1117;
  --color-bg-table-header: #1C2128;
  --color-text-primary: #E6EDF3;
  --color-text-secondary: #8B949E;
  --color-border-spec: #30363D;
}

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

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

@keyframes priceFlashGreen {
  0% { background-color: rgba(34, 197, 94, 0.3); }
  100% { background-color: transparent; }
}

@keyframes priceFlashRed {
  0% { background-color: rgba(239, 68, 68, 0.3); }
  100% { background-color: transparent; }
}

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

.text-page-header { font-size: 22px; font-weight: 700; }
.text-nav-item { font-size: 14px; font-weight: 500; }
.text-button-label { font-size: 14px; font-weight: 500; }
.text-table-cell { font-size: 12px; font-weight: 400; }
.text-column-header { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.text-small-label { font-size: 10px; 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);
}

/* ── Phase 3: Left Sidebar active state & shortcode refinements ──────────── */

.dt-sidebar__item--active {
  border-left: 3px solid var(--color-accent, #1E6FE8) !important;
  background: color-mix(in srgb, var(--color-accent, #1E6FE8) 8%, transparent) !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: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-upgrade-text);
  background: var(--color-upgrade-bg);
  border-radius: 4px;
  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: 12px;
  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: 16px 20px;
  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: 2px;
  padding: 8px 16px;
  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: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: 4px;
  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: 12px;
  padding: 10px 20px;
  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: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.dt-search-modal__hint {
  padding: 8px 20px;
  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: 12px 14px;
  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: 8px 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: 6px;
  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-main);
  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: 10px var(--panel-padding);
  border-bottom: 1px solid var(--color-border-spec);
}

.dt-panel-card__title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.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: 8px;
}

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

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

.dt-tab-strip__tab {
  position: relative;
  padding: 10px 16px;
  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: 2px 2px 0 0;
}

.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: 12px;
  padding: 10px 16px;
  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: 4px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.3s ease;
  padding: 1px 4px;
  border-radius: 3px;
}

.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: 8px;
  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: 10px;
  cursor: inherit;
  padding: 0;
  transition: background-color 0.2s ease;
}

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

.dt-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  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: 8px; 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; }
.sec-page--fixed .sec-page__grid { min-height: 0; }
.sec-page--fixed .sec-page__grid > * { min-height: 0; }
.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; }
.sec-page__grid { display: grid; gap: 12px; }
.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: 6px; padding: 12px 16px; }
.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: 4px; }
.kpi-card__sub { font-size: 12px; color: var(--color-text-secondary-spec); margin-top: 2px; }

/* Data table styles */
.spec-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.spec-table th { text-align: left; padding: 3px 8px; 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 8px; 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; }

/* Chart placeholder */
.chart-placeholder { background: var(--color-bg-content); border: 1px dashed var(--color-border-spec); border-radius: 6px; 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: 4px; align-items: center; }
.periodicity-btn { padding: 4px 10px; font-size: 12px; font-weight: 500; border-radius: 4px; 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: 12px 16px; 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: 4px; }
.news-card__meta { font-size: 11px; color: var(--color-text-secondary-spec); display: flex; gap: 8px; align-items: center; }
.news-card__preview { font-size: 13px; color: var(--color-text-secondary-spec); margin-top: 6px; line-height: 1.4; }
.news-card__badge { display: inline-block; padding: 2px 6px; border-radius: 3px; 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(140, 152, 164, 0.15); color: var(--color-text-secondary-spec); }

/* Filter builder */
.filter-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter-row select, .filter-row input { padding: 6px 10px; font-size: 13px; border: 1px solid var(--color-border-spec); border-radius: 4px; 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: 4px; }
.filter-row__remove:hover { color: var(--color-negative-spec); }

/* Watchlist layout */
.watchlist-layout { display: flex; height: 100%; }
.watchlist-layout__sidebar { width: 250px; border-right: 1px solid var(--color-border-spec); padding: 12px; flex-shrink: 0; }
.watchlist-layout__main { flex: 1; padding: 12px 16px; overflow: auto; }
.watchlist-item { padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--color-text-primary-spec); transition: background 0.15s; }
.watchlist-item:hover { background: var(--color-bg-hover); }
.watchlist-item--active { background: rgba(56, 132, 244, 0.1); color: var(--color-accent-spec); font-weight: 600; }

/* Toolbar */
.spec-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--color-border-spec); margin-bottom: 12px; }
.spec-toolbar__btn { padding: 6px 12px; font-size: 12px; font-weight: 500; border-radius: 4px; border: 1px solid var(--color-border-spec); background: var(--color-bg-content); color: var(--color-text-primary-spec); cursor: pointer; transition: all 0.15s; }
.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); }

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

/* Portfolio layout */
.portfolio-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.portfolio-summary__card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; padding: 16px; }
.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: 4px; }
.portfolio-summary__change { font-size: 13px; margin-top: 2px; }

/* Dashboard index card */
.index-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.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: 20px; }
.region-group__title { font-size: 13px; font-weight: 600; color: var(--color-text-secondary-spec); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--color-border-spec); }
.region-group__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* Calendar styles */
.calendar-event { display: flex; align-items: center; gap: 12px; padding: 8px 12px; 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: 2px 6px; border-radius: 3px; 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(245, 166, 35, 0.15); color: #f5a623; }
.impact-badge--low { background: rgba(140, 152, 164, 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: 6px; 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: 6px; padding: 8px; border: 1px solid var(--color-border-spec); border-radius: 6px; background: var(--color-bg-content); align-items: center; }
.chip-input__chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 4px; background: rgba(56, 132, 244, 0.15); 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: 16px; }
.screener-filters { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; padding: 16px; }
.screener-filters__title { font-size: 13px; font-weight: 600; color: var(--color-text-primary-spec); margin-bottom: 12px; }
.screener-results { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; padding: 16px; }

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

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.dashboard-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.2s; position: relative; }
.dashboard-card:hover { border-color: var(--color-accent-spec); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.dashboard-card__thumb { height: 140px; background: var(--color-bg-main); display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary-spec); }
.dashboard-card__info { padding: 12px 16px; }
.dashboard-card__title { font-size: 14px; font-weight: 600; color: var(--color-text-primary-spec); }
.dashboard-card__meta { font-size: 11px; color: var(--color-text-secondary-spec); margin-top: 4px; }
.dashboard-card__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity 0.2s; }
.dashboard-card:hover .dashboard-card__overlay { opacity: 1; }
.dashboard-card__action { padding: 6px 14px; border-radius: 4px; font-size: 12px; font-weight: 500; border: 1px solid rgba(255,255,255,0.3); color: #fff; background: rgba(255,255,255,0.1); cursor: pointer; }
.dashboard-card__action:hover { background: rgba(255,255,255,0.2); }
.dashboard-card--new { border-style: dashed; display: flex; align-items: center; justify-content: center; min-height: 200px; }
.dashboard-card--new:hover { background: rgba(56, 132, 244, 0.05); }

/* Widget editor canvas */
.editor-canvas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; min-height: 400px; }
.editor-widget { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; min-height: 180px; display: flex; flex-direction: column; }
.editor-widget__header { padding: 8px 12px; border-bottom: 1px solid var(--color-border-spec); font-size: 12px; font-weight: 600; color: var(--color-text-secondary-spec); display: flex; justify-content: space-between; align-items: center; }
.editor-widget__body { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary-spec); font-size: 13px; }

/* Widget catalog */
.widget-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.widget-catalog__item { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; padding: 16px; text-align: center; cursor: pointer; transition: all 0.15s; }
.widget-catalog__item:hover { border-color: var(--color-accent-spec); background: rgba(56, 132, 244, 0.05); }
.widget-catalog__icon { font-size: 24px; margin-bottom: 8px; }
.widget-catalog__name { font-size: 13px; font-weight: 600; color: var(--color-text-primary-spec); }
.widget-catalog__desc { font-size: 11px; color: var(--color-text-secondary-spec); margin-top: 4px; }

/* Model portfolio cards */
.model-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 8px; padding: 16px; }
.model-card__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.model-card__name { font-size: 16px; font-weight: 600; color: var(--color-text-primary-spec); }
.model-card__strategy { font-size: 11px; padding: 2px 8px; border-radius: 3px; background: rgba(56, 132, 244, 0.1); color: var(--color-accent-spec); font-weight: 500; }
.model-card__stats { display: flex; gap: 16px; margin-bottom: 12px; }
.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: 24px; }
.settings-section { margin-bottom: 32px; }
.settings-section__title { font-size: 16px; font-weight: 600; color: var(--color-text-primary-spec); margin-bottom: 4px; }
.settings-section__desc { font-size: 13px; color: var(--color-text-secondary-spec); margin-bottom: 16px; }
.settings-field { margin-bottom: 16px; }
.settings-field__label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text-primary-spec); margin-bottom: 6px; }
.settings-field__input { width: 100%; padding: 8px 12px; font-size: 14px; border: 1px solid var(--color-border-spec); border-radius: 6px; 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 rgba(56, 132, 244, 0.2); }
.settings-field__input--textarea { min-height: 80px; resize: vertical; }

/* Settings toggle row */
.settings-toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 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: 2px; }

/* Theme selector cards */
.theme-cards { display: flex; gap: 12px; }
.theme-card { flex: 1; padding: 16px; border: 2px solid var(--color-border-spec); border-radius: 8px; 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: rgba(56, 132, 244, 0.05); }
.theme-card__icon { font-size: 24px; margin-bottom: 8px; }
.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: 16px; }
.plan-card { background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 8px; padding: 24px; 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: 12px 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: 16px 0; text-align: left; }
.plan-card__features li { padding: 6px 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: 8px; font-weight: 600; }

/* Keyboard shortcut badge */
.kbd { display: inline-block; padding: 2px 6px; font-size: 11px; font-family: 'JetBrains Mono', monospace; background: var(--color-bg-main); border: 1px solid var(--color-border-spec); border-radius: 4px; 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: 8px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.15s; }
.upload-zone:hover { border-color: var(--color-accent-spec); background: rgba(56, 132, 244, 0.05); }
.upload-zone__icon { font-size: 32px; margin-bottom: 8px; }
.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: 4px; }

/* Danger zone */
.danger-zone { margin-top: 40px; padding: 16px; border: 1px solid var(--color-negative-spec); border-radius: 8px; background: rgba(234, 57, 67, 0.05); }
.danger-zone__title { font-size: 14px; font-weight: 600; color: var(--color-negative-spec); margin-bottom: 8px; }
.danger-zone__desc { font-size: 13px; color: var(--color-text-secondary-spec); margin-bottom: 12px; }
.danger-zone__btn { padding: 8px 16px; font-size: 13px; font-weight: 500; border-radius: 4px; 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(38,166,91,.25); } 100% { background: transparent; } }
@keyframes blink-red { 0% { background: rgba(234,57,67,.25); } 100% { background: transparent; } }

/* Live price table */
.live-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.live-table th { text-align: left; padding: 8px 12px; 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: 6px 12px; 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: 12px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }
.market-strip__item { flex-shrink: 0; background: var(--color-bg-content); border: 1px solid var(--color-border-spec); border-radius: 6px; padding: 10px 16px; 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: 2px; font-family: 'JetBrains Mono', monospace; }
.market-strip__change { font-size: 12px; font-weight: 500; margin-top: 2px; 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-bg-content); }
.dark .dashboard-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.dark .editor-widget { background: 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: rgba(56, 132, 244, 0.1); }
.dark .index-card { background: var(--color-bg-content); }
.dark .watchlist-item:hover { background: var(--color-bg-content); }
.dark .widget-catalog__item:hover { background: rgba(56, 132, 244, 0.08); }
.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: #888;
    --color-text-secondary: #aaa;
  }
  .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: 8px 16px; background: var(--color-accent); color: #fff; border-radius: 0 0 6px 6px; 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: 16px 0; }
  .watchlist-item { padding: 12px 16px; }
}

/* 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: 4px; }
.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;
}
.-left-12 {
  left: -3rem;
}
.bottom-0 {
  bottom: 0px;
}
.left-6 {
  left: 1.5rem;
}
.top-0 {
  top: 0px;
}
.top-4 {
  top: 1rem;
}
.z-10 {
  z-index: 10;
}
.col-span-2 {
  grid-column: span 2 / span 2;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.ml-12 {
  margin-left: 3rem;
}
.ml-2 {
  margin-left: 0.5rem;
}
.ml-4 {
  margin-left: 1rem;
}
.mr-1 {
  margin-right: 0.25rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.inline {
  display: inline;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.inline-grid {
  display: inline-grid;
}
.contents {
  display: contents;
}
.hidden {
  display: none;
}
.h-1 {
  height: 0.25rem;
}
.h-12 {
  height: 3rem;
}
.h-2 {
  height: 0.5rem;
}
.h-3 {
  height: 0.75rem;
}
.h-4 {
  height: 1rem;
}
.h-6 {
  height: 1.5rem;
}
.min-h-24 {
  min-height: 6rem;
}
.min-h-screen {
  min-height: 100vh;
}
.w-0\.5 {
  width: 0.125rem;
}
.w-11 {
  width: 2.75rem;
}
.w-12 {
  width: 3rem;
}
.w-2 {
  width: 0.5rem;
}
.w-3 {
  width: 0.75rem;
}
.w-4 {
  width: 1rem;
}
.w-40 {
  width: 10rem;
}
.w-6 {
  width: 1.5rem;
}
.w-64 {
  width: 16rem;
}
.w-full {
  width: 100%;
}
.min-w-0 {
  min-width: 0px;
}
.max-w-6xl {
  max-width: 72rem;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-shrink {
  flex-shrink: 1;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.shrink {
  flex-shrink: 1;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.cursor-pointer {
  cursor: pointer;
}
.resize {
  resize: both;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-6 {
  gap: 1.5rem;
}
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-x-3 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.75rem * var(--tw-space-x-reverse));
  margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}
.overflow-x-auto {
  overflow-x: auto;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.break-all {
  word-break: break-all;
}
.rounded {
  border-radius: 0.25rem;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-md {
  border-radius: 0.375rem;
}
.border {
  border-width: 1px;
}
.border-2 {
  border-width: 2px;
}
.border-t {
  border-top-width: 1px;
}
.border-gray-600 {
  --tw-border-opacity: 1;
  border-color: rgb(75 85 99 / var(--tw-border-opacity, 1));
}
.border-gray-700 {
  --tw-border-opacity: 1;
  border-color: rgb(55 65 81 / var(--tw-border-opacity, 1));
}
.bg-gray-600 {
  --tw-bg-opacity: 1;
  background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));
}
.bg-gray-700 {
  --tw-bg-opacity: 1;
  background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
}
.bg-gray-800 {
  --tw-bg-opacity: 1;
  background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
}
.bg-gray-800\/50 {
  background-color: rgb(31 41 55 / 0.5);
}
.bg-gray-900 {
  --tw-bg-opacity: 1;
  background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));
}
.p-2 {
  padding: 0.5rem;
}
.p-4 {
  padding: 1rem;
}
.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}
.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}
.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}
.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.pt-4 {
  padding-top: 1rem;
}
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.font-mono {
  font-family: var(--font-mono);
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.uppercase {
  text-transform: uppercase;
}
.lowercase {
  text-transform: lowercase;
}
.capitalize {
  text-transform: capitalize;
}
.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);
}
.text-gray-300 {
  --tw-text-opacity: 1;
  color: rgb(209 213 219 / var(--tw-text-opacity, 1));
}
.text-gray-400 {
  --tw-text-opacity: 1;
  color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}
.text-gray-500 {
  --tw-text-opacity: 1;
  color: rgb(107 114 128 / var(--tw-text-opacity, 1));
}
.text-white {
  color: var(--color-white);
}
.underline {
  text-decoration-line: underline;
}
.overline {
  text-decoration-line: overline;
}
.line-through {
  text-decoration-line: line-through;
}
.placeholder-gray-500::-moz-placeholder {
  --tw-placeholder-opacity: 1;
  color: rgb(107 114 128 / var(--tw-placeholder-opacity, 1));
}
.placeholder-gray-500::placeholder {
  --tw-placeholder-opacity: 1;
  color: rgb(107 114 128 / var(--tw-placeholder-opacity, 1));
}
.outline {
  outline-style: solid;
}
.ring-1 {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.blur {
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.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);
}
.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: dibs Dark (blue accent, deep navy background) ─────────── */
:root {
  --color-bg: #0D0F17;
  --color-panel: #131722;
  --color-panelH: #1A1D2E;
  --color-border: #1F2335;
  --color-borderA: #2A2E45;
  --color-borderF: #4C7CF3;
  --color-text: #E4E6F0;
  --color-dim: #8B8FA8;
  --color-muted: #555978;
  --color-white: #ffffff;
  --color-green: #26A65B;
  --color-greenD: #1E8C4E;
  --color-greenBg: rgba(38, 166, 91, 0.10);
  --color-greenBgS: rgba(38, 166, 91, 0.18);
  --color-red: #E8453C;
  --color-redBg: rgba(232, 69, 60, 0.10);
  --color-redBgS: rgba(232, 69, 60, 0.18);
  --color-yellow: #F5A623;
  --color-yellowBg: rgba(245, 166, 35, 0.10);
  --color-yellowBgS: rgba(245, 166, 35, 0.18);
  --color-cyan: #06B6D4;
  --color-blue: #4C7CF3;
  --color-purple: #A855F7;
  --color-orange: #F97316;
  --color-accent: #4C7CF3;
  --color-titleActive: #131722;
  --color-titleInactive: #0D0F17;
  --color-bevelLight: rgba(255, 255, 255, 0.04);
  --color-bevelDark: #0A0C14;
  --color-statusBg: #131722;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  --font-sans: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;

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

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

/* ── dibs Dark (Green) — win2019 overrides ────────────────────────────────── */
:root.win2019 {
  --color-border: rgba(255, 255, 255, 0.08);
  --color-borderA: rgba(255, 255, 255, 0.12);
  --color-borderF: #4C7CF3;
  --color-text: #E4E6F0;
  --color-dim: #8B8FA8;
  --color-muted: #555978;
  --color-white: #fafafa;
  --color-green: #4C7CF3;
  --color-greenD: #059669;
  --color-greenBg: rgba(76, 124, 243, 0.10);
  --color-greenBgS: rgba(76, 124, 243, 0.18);
  --color-accent: #4C7CF3;
  --color-bevelLight: rgba(255, 255, 255, 0.06);
}

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

/* ─── Focus-visible ring for all interactive elements ────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent, #4C7CF3);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--dt-accent-glow, rgba(76, 124, 243, 0.15));
}

/* ─── 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 20px rgba(76, 124, 243, 0.25); }
  50% { box-shadow: 0 0 40px rgba(76, 124, 243, 0.45), 0 0 80px rgba(76, 124, 243, 0.15); }
}

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

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

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

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

@keyframes borderGlow {
  0%, 100% { border-color: rgba(76, 124, 243, 0.35); }
  50% { border-color: rgba(76, 124, 243, 0.65); }
}

@keyframes bgPulse {
  0%, 100% { background-color: rgba(76, 124, 243, 0.08); }
  50% { background-color: rgba(76, 124, 243, 0.18); }
}

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

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

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

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

.animate-gradient-text {
  background: linear-gradient(270deg, #4C7CF3, #6290F5, #8BABF8, #4C7CF3);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease-in-out infinite;
}

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

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

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

.hover-glow {
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 60px rgba(76, 124, 243, 0.20), 0 0 120px rgba(76, 124, 243, 0.08);
  border-color: rgba(76, 124, 243, 0.3) !important;
  transform: translateY(-2px);
}

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

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

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

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--dt-border-strong, #3A3F5C);
  border-radius: 3px;
}

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

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

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

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

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

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

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

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

.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: var(--color-greenBgS);
  color: var(--color-text);
}

::selection {
  background: var(--color-greenBgS);
  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(76,124,243,0.4);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@media (min-width: 768px) {

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

@media (min-width: 1024px) {

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