/**
 * Asset Detail Page - Mobile Optimization
 * Bloomberg-grade finance UX for mobile devices
 * 
 * CRITICAL: High specificity to override heatmap.css
 */

/* ============================================
   MOBILE BREAKPOINT (<768px)
   ============================================ */
@media (max-width: 767px) {
  
  /* --------------------------------------------
     MAIN CONTAINER - ZERO PADDING
     -------------------------------------------- */
  body main.container.asset-detail-main,
  body main.container,
  main.container {
    padding: 0 0 80px 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }
  
  /* Override Tailwind */
  .px-4, .md\:px-4, .container.px-4 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Section spacing */
  .space-y-6 > * + * {
    margin-top: 2px !important;
  }
  
  /* All table-containers */
  .table-container {
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    border-left: none !important;
    border-right: none !important;
  }
  
  /* --------------------------------------------
     HEADER SECTION
     -------------------------------------------- */
  .table-container.ring-tooltip-container,
  .ring-tooltip-container {
    padding: 12px 12px 0 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .asset-header-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .asset-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--border-secondary) !important;
  }
  
  /* Logo */
  .asset-logo-crypto-xl,
  .asset-header-left > div:first-child {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
  }
  
  .asset-header-title {
    font-size: 1.125rem !important;
    line-height: 1.3 !important;
  }
  
  .asset-header-info {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .asset-header-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 4px !important;
  }
  
  .signal-badge {
    font-size: 0.6875rem !important;
    padding: 3px 8px !important;
  }
  
  .status-badge.realtime {
    font-size: 0.5rem !important;
    padding: 2px 6px !important;
  }
  
  /* ============================================
     RING GAUGES - CRITICAL FIX
     Override heatmap.css grid + absolute positioning
     ============================================ */
  
  /* Grid container - override heatmap.css grid */
  body .bbg-gauges-grid,
  .ring-tooltip-container .bbg-gauges-grid,
  .table-container .bbg-gauges-grid,
  .bbg-gauges-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 1px !important;
    width: 100% !important;
    margin: 12px 0 0 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: var(--border-secondary) !important;
  }
  
  /* Each gauge - FIXED DIMENSIONS */
  body .bbg-gauge,
  .ring-tooltip-container .bbg-gauge,
  .table-container .bbg-gauge,
  .bbg-gauges-grid .bbg-gauge,
  .bbg-gauge {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 4px 6px 4px !important;
    background: var(--bg-primary) !important;
    position: relative !important;
    border: none !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important;
  }
  
  /* Active/highlight state - Same bg as other rings, no borders */
  body .bbg-gauge.bbg-gauge-highlight,
  body .bbg-gauge.bbg-current-growth,
  body .bbg-gauge.bbg-current-value,
  body .bbg-gauge.bbg-current-lack,
  .bbg-gauge.bbg-gauge-highlight,
  .bbg-gauge.bbg-current-growth,
  .bbg-gauge.bbg-current-value,
  .bbg-gauge.bbg-current-lack {
    background: var(--bg-secondary) !important;
    box-shadow: none !important;
  }
  
  /* Ring wrapper - relative for value positioning */
  body .bbg-gauge .bbg-ring-wrapper,
  .bbg-gauge .bbg-ring-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* SVG ring - LARGER SIZE for mobile */
  body .bbg-gauge svg,
  .bbg-gauges-grid .bbg-gauge svg,
  .bbg-gauge svg {
    width: 48px !important;
    height: 48px !important;
    flex-shrink: 0 !important;
    display: block !important;
  }
  
  /* Value INSIDE ring - FIXED position relative to ring */
  body .bbg-gauge .bbg-gauge-value,
  .bbg-gauges-grid .bbg-gauge .bbg-gauge-value,
  .bbg-gauge .bbg-gauge-value,
  .bbg-gauge-value {
    position: absolute !important;
    top: 29px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1 !important;
    color: var(--text-primary) !important;
    display: block !important;
    z-index: 1 !important;
    text-align: center !important;
  }
  
  /* Label under ring - positioned below SVG */
  body .bbg-gauge .bbg-gauge-label,
  .bbg-gauges-grid .bbg-gauge .bbg-gauge-label,
  .bbg-gauge .bbg-gauge-label,
  .bbg-gauge-label {
    position: static !important;
    transform: none !important;
    font-size: 0.5625rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    color: var(--text-tertiary) !important;
    margin-top: 6px !important;
    line-height: 1.2 !important;
    order: 2 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap !important;
  }
  
  /* ============================================
     DATE BADGES - FULL WIDTH 2 COLUMNS
     ============================================ */
  .asset-header-right {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  body .asset-date-badges,
  .ring-tooltip-container .asset-date-badges,
  .asset-date-badges {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1px !important;
    width: 100% !important;
    margin: 0 !important;
    background: var(--border-secondary) !important;
  }
  
  body .asset-date-box,
  .asset-date-badges .asset-date-box,
  .asset-date-box {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    background: var(--bg-primary) !important;
    border: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .asset-date-box .date-icon,
  .asset-date-box > svg,
  .asset-date-box > div:first-child {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    flex-shrink: 0 !important;
  }
  
  .asset-date-box .date-label {
    font-size: 0.5rem !important;
    text-transform: uppercase !important;
    color: var(--text-tertiary) !important;
    line-height: 1 !important;
  }
  
  .asset-date-box .date-value {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    line-height: 1.2 !important;
  }
  
  /* ============================================
     METRICS STRIP - HORIZONTAL SCROLL
     CRITICAL: Override heatmap.css grid layout
     ============================================ */
  body .metrics-strip,
  .ring-tooltip-container .metrics-strip,
  .table-container .metrics-strip,
  .asset-detail-main .metrics-strip,
  .metrics-strip {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    scroll-snap-type: x mandatory !important;
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-secondary) !important;
    border-bottom: 1px solid var(--border-secondary) !important;
    /* Override heatmap.css grid */
    grid-template-columns: none !important;
  }
  
  body .metrics-strip::-webkit-scrollbar,
  .metrics-strip::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
  }
  
  /* Each cell in metrics strip */
  body .metrics-strip .ms-cell,
  .metrics-strip .ms-cell,
  .ms-cell {
    flex: 0 0 auto !important;
    min-width: 70px !important;
    max-width: 90px !important;
    padding: 10px 12px !important;
    scroll-snap-align: start !important;
    border-right: 1px solid var(--border-secondary) !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    background: transparent !important;
  }
  
  .ms-cell:last-child {
    border-right: none !important;
    padding-right: 16px !important;
  }
  
  .ms-cell.ms-signal {
    min-width: 60px !important;
    background: rgba(59, 130, 246, 0.05) !important;
  }
  
  .ms-signal-badge {
    font-size: 0.625rem !important;
    padding: 4px 8px !important;
  }
  
  .ms-label {
    font-size: 0.5rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    color: var(--text-tertiary) !important;
    white-space: nowrap !important;
  }
  
  .ms-value {
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  
  .ms-max {
    font-size: 0.5625rem !important;
    opacity: 0.5 !important;
  }
  
  /* ============================================
     AI COMMENTARY
     ============================================ */
  .ai-commentary-section {
    padding: 12px !important;
    background: var(--bg-secondary) !important;
    border-left: 3px solid var(--accent-primary) !important;
  }
  
  /* ============================================
     CHARTS - TRUE FULL WIDTH
     ============================================ */
  .chart-hero-container,
  .table-container:has(canvas),
  .table-container:has(.chart),
  .table-container.p-5:has(#comparisonChart),
  .table-container.p-5:has(.cycle-hero) {
    width: 100% !important;
    margin: 2px 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    padding: 0 !important;
  }
  
  /* ============================================
     AI FORECAST CHART - Bloomberg-grade mobile
     Full-bleed, data-centric, zero chrome
     ============================================ */
  .chart-hero-container {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    position: relative !important;
    background: var(--bg-primary) !important;
    border: none !important;
    border-top: 1px solid var(--border-secondary) !important;
    border-bottom: 1px solid var(--border-secondary) !important;
    overflow: visible !important;
  }
  
  /* Header - title LEFT, legend RIGHT on same row */
  .chart-hero-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-secondary) !important;
    gap: 8px !important;
  }
  
  .chart-hero-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    width: auto !important;
    max-width: fit-content !important;
  }
  
  /* Legend on RIGHT side of header */
  .chart-hero-header .chart-legend-inline,
  .chart-hero-header .chart-hero-legend {
    flex-shrink: 1 !important;
    gap: 8px !important;
    justify-content: flex-end !important;
  }
  
  .chart-hero-header .legend-item {
    font-size: 0.5625rem !important;
    gap: 3px !important;
    white-space: nowrap !important;
  }
  
  /* Show only chart type badge */
  .chart-symbol,
  .chart-separator {
    display: none !important;
  }
  
  .chart-type-badge {
    font-size: 0.625rem !important;
    font-weight: 600 !important;
    padding: 3px 6px !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 4px !important;
    color: var(--accent-primary) !important;
    width: fit-content !important;
    max-width: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
  }
  
  .chart-type-badge .chart-info-icon {
    width: 12px !important;
    height: 12px !important;
  }
  
  .chart-type-badge .chart-info-icon svg {
    width: 12px !important;
    height: 12px !important;
  }
  
  .chart-info-icon {
    width: 14px !important;
    height: 14px !important;
  }
  
  .chart-info-icon svg {
    width: 12px !important;
    height: 12px !important;
  }
  
  /* Legend - inline in header row */
  .chart-hero-legend,
  .chart-legend {
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
  }
  
  .legend-item,
  .legend-item-compact {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.625rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    color: var(--text-secondary) !important;
  }
  
  .legend-color,
  .legend-item span:first-child {
    width: 12px !important;
    height: 3px !important;
    border-radius: 2px !important;
  }
  
  /* Chart legend inline - NO separate row */
  .chart-legend-inline {
    display: flex !important;
    gap: 10px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }
  
  .comparison-legend-compact {
    display: flex !important;
    gap: 12px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }
  
  /* Chart body - maximize data area */
  .chart-hero-body {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important; /* Allow STOP label to show */
    position: relative !important;
    width: 100% !important;
    background: var(--bg-primary) !important;
  }
  
  /* Canvas - width 100%, height auto (JS controls) */
  .chart-hero-body canvas,
  .price-forecast-canvas,
  #priceForecastMain,
  #priceForecastVolume {
    width: 100% !important;
    display: block !important;
    /* height is controlled by JS for correct aspect ratio */
  }
  
  /* Ensure chart container allows overflow for labels */
  .chart-hero-container {
    overflow: visible !important;
  }
  
  /* Timeframe tabs - compact */
  .chart-timeframe-tabs {
    display: flex !important;
    gap: 4px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    padding: 8px 12px !important;
    flex-wrap: nowrap !important;
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-secondary) !important;
    justify-content: center !important;
  }
  
  .chart-timeframe-tabs::-webkit-scrollbar {
    display: none !important;
  }
  
  .chart-timeframe-btn {
    padding: 6px 12px !important;
    font-size: 0.625rem !important;
    min-height: 32px !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
  }
  
  .chart-timeframe-btn.active {
    background: var(--accent-primary) !important;
    color: white !important;
  }
  
  /* ============================================
     AI vs BUY & HOLD - Title + Legend SAME ROW
     ============================================ */
  .table-container.p-5:has(#comparisonChart) {
    padding: 0 !important;
  }
  
  .table-container.p-5:has(#comparisonChart) > div:first-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-secondary) !important;
  }
  
  .table-container.p-5:has(#comparisonChart) h3 {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  
  /* Legend on RIGHT side - same row */
  .table-container.p-5:has(#comparisonChart) .comparison-legend-compact,
  .table-container.p-5:has(#comparisonChart) .chart-legend-inline {
    display: flex !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    gap: 12px !important;
    justify-content: flex-end !important;
  }
  
  .table-container.p-5:has(#comparisonChart) .legend-item {
    font-size: 0.5625rem !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }
  
  /* ============================================
     TOOLTIP INFO BUTTONS (i) - PERFECT CIRCLE
     ============================================ */
  body button.tooltip-trigger,
  body .tooltip-trigger,
  body h3 button,
  body h3 .tooltip-trigger,
  body .table-container h3 button,
  body .chart-hero-header button,
  body .chart-info-badge,
  body span.chart-info-badge,
  body [class*="chart-info"],
  body h3 span[data-tooltip-content],
  body span[data-tooltip-content],
  h3 .chart-info-badge,
  h3 span.chart-info-badge {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-secondary) !important;
    vertical-align: middle !important;
    margin: 0 !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
  }
  
  /* Title + info button alignment */
  body h3,
  body .table-container h3,
  h3 {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  
  body button.tooltip-trigger svg,
  body .tooltip-trigger svg,
  body h3 button svg,
  body .chart-info-badge svg,
  body span.chart-info-badge svg,
  .chart-info-badge svg,
  span.chart-info-badge svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
  }
  
  /* REMOVE background from INFO BUTTONS ONLY (not metrics) */
  body h3 .chart-info-badge,
  body h3 span.chart-info-badge,
  h3 .chart-info-badge,
  h3 span.chart-info-badge,
  .table-container > div:first-child .chart-info-badge,
  .chart-hero-header .chart-info-badge {
    background: transparent !important;
    border: none !important;
    min-width: 20px !important;
    max-width: 20px !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
  }
  
  /* ============================================
     MARKET CYCLE - Bloomberg Pro Mobile
     ULTRA-SPECIFIC SELECTORS
     ============================================ */
  
  /* Container */
  body .table-container.p-5:has(.cycle-hero),
  .table-container.p-5:has(.cycle-hero) {
    padding: 0 !important;
    background: var(--bg-primary) !important;
  }
  
  /* ========== 3 BADGES IN ONE ROW ========== */
  body .cycle-hero,
  .cycle-hero {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-secondary) !important;
  }
  
  body .cycle-hero > div,
  .cycle-hero > div,
  .cycle-hero > .cycle-position,
  .cycle-hero > .cycle-phase-badge,
  .cycle-hero > .cycle-forecast {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 6px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    border-right: 1px solid var(--border-primary) !important;
    min-height: 70px !important;
  }
  
  body .cycle-hero > div:last-child,
  .cycle-hero > div:last-child,
  .cycle-hero > .cycle-forecast {
    border-right: none !important;
  }
  
  /* Hour: "12" + "o'clock" */
  body .cycle-position,
  .cycle-position {
    gap: 2px !important;
  }
  
  body .cycle-hour,
  .cycle-hour {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    font-family: var(--font-mono) !important;
    color: var(--text-primary) !important;
  }
  
  body .cycle-label,
  .cycle-label {
    font-size: 0.5625rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--text-tertiary) !important;
  }
  
  /* Phase: clock icon + "PEAK ZONE" */
  body .cycle-phase-badge,
  .cycle-phase-badge {
    gap: 4px !important;
    flex-direction: column !important;
  }
  
  body .cycle-clock-icon,
  .cycle-clock-icon {
    width: 24px !important;
    height: 24px !important;
  }
  
  body .cycle-phase-badge > span,
  .cycle-phase-badge > span {
    font-size: 0.625rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
  }
  
  /* Forecast: "▲ +0.04%" + "HISTORICAL AVG" */
  body .cycle-forecast,
  .cycle-forecast {
    flex-direction: column !important;
    gap: 2px !important;
    align-items: center !important;
  }
  
  body .cycle-forecast > span:first-child,
  .cycle-forecast > span:first-child {
    font-size: 0.75rem !important;
    line-height: 1 !important;
  }
  
  body .cycle-forecast > span:nth-child(2),
  .cycle-forecast > span:nth-child(2) {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    font-family: var(--font-mono) !important;
    line-height: 1 !important;
  }
  
  body .cycle-forecast-label,
  .cycle-forecast-label {
    font-size: 0.5rem !important;
    color: var(--text-tertiary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    line-height: 1.2 !important;
  }
  
  /* ========== 12 CLOCKS - FORCE 12 COLUMNS ========== */
  body .cycle-timeline,
  .cycle-timeline,
  .table-container .cycle-timeline {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important; /* minmax(0,1fr) forces shrink */
    gap: 2px !important;
    padding: 6px 6px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: var(--bg-primary) !important;
    overflow: visible !important; /* Changed to visible to prevent clipping */
    box-sizing: border-box !important;
  }
  
  /* CRITICAL: Override .ms-cell styles for cycle blocks */
  body .cycle-hour-block,
  .cycle-hour-block,
  .cycle-timeline .cycle-hour-block,
  body .cycle-hour-block.ms-cell,
  .cycle-hour-block.ms-cell,
  .cycle-timeline .cycle-hour-block.ms-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 4px 0 10px 0 !important;
    min-width: 0 !important; /* CRITICAL: allows shrink below content */
    max-width: 100% !important;
    width: 100% !important;
    height: 36px !important;
    background: var(--bg-secondary) !important;
    border: none !important;
    border-radius: 3px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    /* Override ms-cell */
    flex: none !important;
    scroll-snap-align: unset !important;
    border-right: none !important;
    text-align: center !important;
    gap: 0 !important;
  }
  
  /* Hour number */
  body .cycle-hour-num,
  .cycle-hour-num {
    font-size: 0.5rem !important;
    font-weight: 600 !important;
    font-family: var(--font-mono) !important;
    color: var(--text-secondary) !important;
    line-height: 1 !important;
  }
  
  /* Color bar at bottom */
  body .cycle-hour-bar,
  .cycle-hour-bar {
    display: block !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-height: 3px !important;
    max-height: 16px !important;
    border-radius: 0 0 4px 4px !important;
    background: var(--text-quaternary) !important;
  }
  
  /* BULLISH = green */
  body .cycle-hour-bullish .cycle-hour-bar,
  .cycle-hour-bullish .cycle-hour-bar {
    background: var(--gain) !important;
  }
  
  /* BEARISH = red */
  body .cycle-hour-bearish .cycle-hour-bar,
  .cycle-hour-bearish .cycle-hour-bar {
    background: var(--loss) !important;
  }
  
  /* ACTIVE = blue bg - FULL BLUE BACKGROUND */
  body .cycle-hour-block.cycle-hour-active,
  .cycle-hour-block.cycle-hour-active,
  .cycle-timeline .cycle-hour-block.cycle-hour-active,
  body .cycle-hour-active.ms-cell,
  .cycle-hour-active.ms-cell {
    background: var(--accent-primary) !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35) !important;
  }
  
  body .cycle-hour-block.cycle-hour-active .cycle-hour-num,
  .cycle-hour-block.cycle-hour-active .cycle-hour-num,
  body .cycle-hour-active .cycle-hour-num,
  .cycle-hour-active .cycle-hour-num {
    color: white !important;
    font-weight: 700 !important;
  }
  
  /* Active bar - subtle white on blue */
  body .cycle-hour-block.cycle-hour-active .cycle-hour-bar,
  .cycle-hour-block.cycle-hour-active .cycle-hour-bar,
  .cycle-hour-active .cycle-hour-bar {
    background: rgba(255, 255, 255, 0.25) !important;
  }
  
  /* ========== ZONE LEGEND ========== */
  body .cycle-zones,
  .cycle-zones {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 10px !important;
    background: var(--bg-secondary) !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  
  body .cycle-zone,
  .cycle-zone {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-size: 0.5rem !important;
    color: var(--text-tertiary) !important;
    white-space: nowrap !important;
  }
  
  body .cycle-zone-active,
  .cycle-zone-active {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
  }
  
  body .cycle-zone-dot,
  .cycle-zone-dot {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }
  
  .cycle-hour-display {
    display: flex !important;
    align-items: baseline !important;
    gap: 4px !important;
  }
  
  .cycle-hour {
    font-size: 2rem !important;
    font-weight: 700 !important;
  }
  
  .cycle-label {
    font-size: 0.75rem !important;
  }
  
  .cycle-phase-badge {
    padding: 6px 12px !important;
    font-size: 0.6875rem !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  
  .cycle-clock-icon {
    width: 14px !important;
    height: 14px !important;
  }
  
  .cycle-forecast {
    font-size: 1rem !important;
    font-weight: 600 !important;
  }
  
  /* Removed duplicate cycle-timeline styles - see above */
  
  /* ============================================
     HEATMAP/MONTHLY RETURNS - Desktop-style tabs
     ============================================ */
  .heatmap-tabs,
  .monthly-tabs {
    display: flex !important;
    justify-content: center !important;
    gap: 0 !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 8px !important;
    padding: 3px !important;
    margin: 0 12px 12px 12px !important;
    overflow: hidden !important;
  }
  
  .heatmap-tab,
  .monthly-tab {
    flex: 1 !important;
    padding: 8px 6px !important;
    font-size: 0.625rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    text-align: center !important;
    transition: all 0.15s ease !important;
  }
  
  .heatmap-tab.active,
  .heatmap-tab[data-active="true"],
  .monthly-tab.active {
    background: var(--accent-primary) !important;
    color: white !important;
    font-weight: 600 !important;
  }
  
  /* Heatmap table container */
  .heatmap-container,
  .monthly-returns-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 !important;
    padding: 0 !important;
    scrollbar-width: none !important;
  }
  
  .heatmap-container::-webkit-scrollbar,
  .monthly-returns-wrapper::-webkit-scrollbar {
    display: none !important;
  }
  
  .heatmap-table {
    min-width: 600px !important;
    font-size: 0.625rem !important;
    border-collapse: collapse !important;
  }
  
  .heatmap-table th,
  .heatmap-table td {
    padding: 6px 4px !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
  
  /* Year column STICKY */
  .heatmap-table th:first-child,
  .heatmap-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background: var(--bg-primary) !important;
    font-weight: 600 !important;
    border-right: 1px solid var(--border-secondary) !important;
    min-width: 50px !important;
  }
  
  /* ============================================
     TRADE HISTORY
     ============================================ */
  .table-container:has(.trade-history-section),
  .trade-history-section {
    padding: 0 !important;
  }
  
  .trade-history-header {
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-secondary) !important;
  }
  
  .trade-history-header h3 {
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  
  /* Trade History info button - NO background */
  .trade-history-header h3 button,
  .trade-history-header h3 .tooltip-trigger,
  .trade-history-header h3 .chart-info-badge,
  .trade-history-header .chart-info-badge {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .trade-stats-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1px !important;
    background: var(--border-secondary) !important;
  }
  
  .trade-stat {
    padding: 10px 12px !important;
    background: var(--bg-primary) !important;
    text-align: center !important;
  }
  
  .trade-stat-label {
    font-size: 0.5rem !important;
    text-transform: uppercase !important;
    color: var(--text-tertiary) !important;
  }
  
  .trade-stat-value {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    margin-top: 2px !important;
  }
  
  /* Trade history table */
  .trade-history-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  
  .trade-history-table-wrapper::-webkit-scrollbar {
    display: none !important;
  }
  
  .trade-history-table {
    min-width: 400px !important;
    font-size: 0.6875rem !important;
  }
  
  .trade-history-table th,
  .trade-history-table td {
    padding: 10px 8px !important;
    white-space: nowrap !important;
  }
  
  .trade-signal-cell {
    min-width: 70px !important;
  }
  
  .trade-signal-badge {
    font-size: 0.5625rem !important;
    padding: 2px 6px !important;
  }
  
  /* ============================================
     MONTHLY RETURNS - Double sticky with comparison
     ============================================ */
  .monthly-returns-container,
  .heatmap-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    position: relative !important;
  }
  
  .monthly-returns-container::-webkit-scrollbar,
  .heatmap-container::-webkit-scrollbar {
    display: none !important;
  }
  
  .monthly-returns-table,
  .heatmap-table {
    min-width: 700px !important;
    font-size: 0.5625rem !important;
    border-collapse: collapse !important;
  }
  
  .monthly-returns-table th,
  .monthly-returns-table td,
  .heatmap-table th,
  .heatmap-table td {
    padding: 5px 3px !important;
    min-width: 28px !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  
  /* Year column STICKY (1st) */
  .monthly-returns-table th:first-child,
  .monthly-returns-table td:first-child,
  .heatmap-table th:first-child,
  .heatmap-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: var(--bg-secondary) !important;
    font-weight: 700 !important;
    min-width: 36px !important;
    font-family: var(--font-mono) !important;
  }
  
  /* Yearly/Total column STICKY (2nd) - with shadow separator */
  .monthly-returns-table th:nth-child(2),
  .monthly-returns-table td:nth-child(2),
  .heatmap-table th:nth-child(2),
  .heatmap-table td:nth-child(2) {
    position: sticky !important;
    left: 36px !important;
    z-index: 2 !important;
    background: var(--bg-secondary) !important;
    font-weight: 600 !important;
    min-width: 44px !important;
    box-shadow: 3px 0 6px rgba(0,0,0,0.15) !important;
  }
  
  /* Positive values - green with up arrow */
  .monthly-returns-table td.positive::before,
  .heatmap-table td.positive::before {
    content: '▲' !important;
    font-size: 0.4rem !important;
    margin-right: 1px !important;
    color: var(--gain) !important;
  }
  
  /* Negative values - red with down arrow */
  .monthly-returns-table td.negative::before,
  .heatmap-table td.negative::before {
    content: '▼' !important;
    font-size: 0.4rem !important;
    margin-right: 1px !important;
    color: var(--loss) !important;
  }
  
  /* ============================================
     GENERAL INFO
     ============================================ */
  .general-info-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1px !important;
    background: var(--border-secondary) !important;
  }
  
  .info-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background: var(--bg-primary) !important;
  }
  
  .info-label {
    font-size: 0.75rem !important;
    color: var(--text-tertiary) !important;
  }
  
  .info-value {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    text-align: right !important;
    max-width: 60% !important;
    word-break: break-word !important;
  }
  
}

/* ============================================
   LIGHT MODE
   ============================================ */
@media (max-width: 767px) {
  :root:not(.dark) .bbg-gauges-grid {
    background: rgba(0, 0, 0, 0.08) !important;
  }
  
  :root:not(.dark) .bbg-gauge {
    background: #ffffff !important;
  }
  
  :root:not(.dark) .bbg-gauge.bbg-gauge-highlight,
  :root:not(.dark) .bbg-gauge.bbg-current-growth,
  :root:not(.dark) .bbg-gauge.bbg-current-value,
  :root:not(.dark) .bbg-gauge.bbg-current-lack {
    background: #ffffff !important;
  }
  
  :root:not(.dark) .asset-date-badges {
    background: rgba(0, 0, 0, 0.08) !important;
  }
  
  :root:not(.dark) .asset-date-box {
    background: #ffffff !important;
  }
  
  :root:not(.dark) .metrics-strip {
    background: rgba(0, 0, 0, 0.02) !important;
  }
  
  :root:not(.dark) .ms-cell {
    border-right-color: rgba(0, 0, 0, 0.08) !important;
  }
  
  :root:not(.dark) .heatmap-table th:first-child,
  :root:not(.dark) .heatmap-table td:first-child {
    background: #ffffff !important;
  }
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */
@media (max-width: 767px) {
  .bbg-gauge:active,
  .ms-cell:active,
  .asset-date-box:active,
  .cycle-hour-block:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s ease !important;
  }
  
  .metrics-strip,
  .chart-legend-inline,
  .cycle-timeline,
  .trade-history-table-wrapper,
  .heatmap-container {
    scroll-behavior: smooth !important;
  }
  
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
  /* ============================================
     MOBILE TOOLTIP MODAL (Asset Detail Page)
     Same style as dashboard mobile tooltips
     NOTE: display is controlled by JS, NOT forced here
     ============================================ */
  .mobile-tooltip-modal.active,
  .mobile-tooltip-modal[style*="display: flex"],
  .mobile-tooltip-modal.show {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
  }

  .mobile-tooltip-modal-content {
    background: linear-gradient(135deg, 
      rgba(26, 31, 46, 0.98) 0%, 
      rgba(17, 23, 37, 0.95) 100%) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    max-width: 400px !important;
    width: 100% !important;
    position: relative !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(59, 130, 246, 0.1) !important;
  }

  .mobile-tooltip-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 8px !important;
    color: var(--text-secondary) !important;
    cursor: pointer !important;
  }

  .mobile-tooltip-close:active {
    background: rgba(59, 130, 246, 0.2) !important;
    transform: scale(0.95) !important;
  }

  .mobile-tooltip-icon {
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, 
      var(--accent-primary) 0%, 
      rgba(37, 99, 235, 0.9) 100%) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4) !important;
  }

  .mobile-tooltip-icon svg {
    width: 32px !important;
    height: 32px !important;
    color: white !important;
  }

  .mobile-tooltip-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    text-align: center !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
  }

  .mobile-tooltip-description {
    font-size: 0.9375rem !important;
    color: var(--text-secondary) !important;
    text-align: left !important;
    line-height: 1.6 !important;
    margin-bottom: 16px !important;
  }

  .mobile-tooltip-formula {
    font-family: var(--font-mono) !important;
    font-size: 0.8125rem !important;
    color: var(--accent-primary) !important;
    background: rgba(59, 130, 246, 0.08) !important;
    border-left: 3px solid var(--accent-primary) !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    margin-bottom: 12px !important;
  }

  .mobile-tooltip-btn {
    width: 100% !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, 
      var(--accent-primary) 0%, 
      rgba(37, 99, 235, 0.9) 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
  }

  .mobile-tooltip-btn:active {
    transform: scale(0.98) !important;
  }

  /* Light mode overrides */
  :root:not(.dark) .mobile-tooltip-modal {
    background: rgba(255, 255, 255, 0.85) !important;
  }

  :root:not(.dark) .mobile-tooltip-modal-content {
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.98) 0%, 
      rgba(249, 250, 251, 0.95) 100%) !important;
    border: 1px solid rgba(229, 231, 235, 0.8) !important;
  }
}

/* ============================================
   SAFE AREA
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 767px) {
    main.container {
      padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }
  }
}
