    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { background: #0d1117; color: #e6edf3; font-family: 'Inter', system-ui, sans-serif; min-height: 100vh; overflow-x: hidden; }
    /* Números tabulares para precios y datos numéricos */
    .price, #price-badge, .info-table td, .info-pre, .signal-detail,
    #history-table td, .conf-label { font-variant-numeric: tabular-nums; }

    header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 24px; border-bottom: 1px solid #21262d;
    }
    header h1 { font-size: 1.05rem; font-weight: 600; color: #f0883e; }
    #price-badge { font-size: 1.4rem; font-weight: 700; color: #3fb950; }
    #last-update { font-size: 0.75rem; color: #8b949e; }

    .btn {
      background: #21262d; border: 1px solid #30363d; color: #e6edf3;
      padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.8rem;
    }
    .btn:hover { background: #30363d; }

    main {
      display: flex; flex-direction: column;
      gap: 14px; padding: 14px 24px;
      max-width: 100vw; overflow-x: hidden;
    }
    #top-row { display: flex; gap: 14px; align-items: start; }

    #sidebar {
      width: 272px; min-width: 272px;
      display: flex; flex-direction: column; gap: 9px;
      transition: all .25s ease;
      overflow: hidden;
    }
    #sidebar.hidden { width: 0; min-width: 0; opacity: 0; pointer-events: none; }

    #sidebar-toggle {
      position: fixed; right: 0; top: 50%;
      transform: translateY(-50%);
      background: #21262d; border: 1px solid #30363d;
      border-right: none; border-radius: 6px 0 0 6px;
      color: #8b949e; cursor: pointer; padding: 10px 6px;
      font-size: 0.8rem; z-index: 50; writing-mode: vertical-rl;
      transition: all .2s;
    }
    #sidebar-toggle:hover { background: #30363d; color: #e6edf3; }
    #sidebar-toggle.open { color: #f0883e; border-color: #f0883e44; }

    #charts-col { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }

    .chart-card { background: #161b22; border: 1px solid #21262d; border-radius: 8px; overflow: hidden; position: relative; }

    .resize-handle {
      height: 14px; cursor: ns-resize;
      background: transparent;
      border-top: 2px solid #21262d;
      transition: border-color .15s;
      display: flex; align-items: center; justify-content: center;
    }
    .resize-handle::after {
      content: ''; display: block;
      width: 32px; height: 2px;
      background: #30363d; border-radius: 2px;
      transition: background .15s;
    }
    .resize-handle:hover { border-color: #58a6ff44; }
    .resize-handle:hover::after { background: #58a6ff; }
    .resize-handle.dragging { border-color: #58a6ff88; }
    .resize-handle.dragging::after { background: #58a6ff; }
    .chart-card h2 {
      padding: 9px 14px; font-size: 0.78rem; color: #8b949e;
      border-bottom: 1px solid #21262d; letter-spacing: .03em;
      display: flex; align-items: center; justify-content: space-between;
    }
    .chart-card h2 span { flex: 1; }
    .chart-wrap { width: 100%; }

    /* ---- Responsive ---- */
    @media (max-width: 768px) {
      header { display: none !important; }
      #sidebar-toggle { display: none !important; }
      .legend { display: none !important; }
      .chart-card h2 { display: none !important; }
      .iv-bar { display: flex !important; }
      #draw-toolbar {
        display: none;
        position: fixed !important; top: 0; left: 0; right: 0;
        z-index: 320; background: #161b22ee;
        backdrop-filter: blur(6px);
        border-bottom: 1px solid #30363d;
        flex-wrap: wrap; gap: 6px; padding: 10px 14px;
      }
      #card-rsi, #card-macd, #card-stoch { display: none !important; }
      #history-section { display: none !important; }
      main { padding: 4px 6px 70px; gap: 6px; }

      /* Info y Umbrales como panel full en móvil */
      #info-overlay,
      #cfg-overlay {
        align-items: flex-start !important;
        top: 0 !important; left: 0 !important; right: 0 !important;
        bottom: 58px !important;
      }
      #info-panel,
      #cfg-panel {
        width: 100% !important; max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        padding: 16px 14px 16px !important;
        overflow-y: auto;
      }

      /* Barra de tabs inferior */
      #mobile-tabbar {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 350;
        background: #161b22; border-top: 1px solid #30363d;
        height: 58px; align-items: center; justify-content: space-around;
      }
      .m-tab {
        display: flex; flex-direction: column; align-items: center;
        gap: 3px; background: none; border: none; color: #8b949e;
        cursor: pointer; font-size: 0.6rem; padding: 6px 10px;
        transition: color .15s; flex: 1;
      }
      .m-tab:hover, .m-tab.active { color: #f0883e; }
      .m-tab svg { width: 20px; height: 20px; }

      /* Panel flotante de indicadores */
      #mobile-ind-panel {
        display: none; position: fixed; bottom: 58px; left: 0; right: 0;
        z-index: 340; background: #161b22; border-top: 1px solid #30363d;
        padding: 12px 14px; flex-wrap: wrap; gap: 6px;
      }
      #mobile-ind-panel.open { display: flex !important; }
      #top-row { flex-direction: column; }
      #sidebar {
        position: fixed !important; inset: 0 !important;
        width: 100% !important; min-width: 100% !important;
        z-index: 300; overflow-y: auto;
        background: #0d1117ee;
        backdrop-filter: blur(4px);
        padding: 16px 14px 80px;
        opacity: 1 !important; pointer-events: all !important;
        transition: opacity .2s ease !important;
      }
      #sidebar.hidden { display: none !important; }
      #sidebar-toggle {
        position: fixed; bottom: 16px; right: 16px;
        top: auto; transform: none; writing-mode: horizontal-tb;
        border: 1px solid #30363d; border-radius: 24px;
        padding: 8px 18px; font-size: 0.85rem;
        z-index: 400; box-shadow: 0 4px 16px #00000088;
      }
      .legend { gap: 8px; padding: 5px 10px; font-size: 0.65rem; }
      .toggle-btn { padding: 2px 7px; font-size: 0.65rem; }
      #history-section { padding: 10px; }
      #history-table { font-size: 0.72rem; }
      #history-table td, #history-table th { padding: 5px 6px; }
    }

    /* ---- Intervalo ---- */
    .iv-bar { display: flex; gap: 4px; padding: 5px 14px; border-bottom: 1px solid #21262d; background: #0d1117; }
    .iv-btn {
      background: #21262d; border: 1px solid #30363d; color: #8b949e;
      padding: 2px 10px; border-radius: 4px; cursor: pointer;
      font-size: 0.72rem; font-weight: 700; letter-spacing: .04em;
      transition: all .15s;
    }
    .iv-btn:hover  { background: #30363d; color: #e6edf3; }
    .iv-btn.active { background: #0d2818; border-color: #3fb950; color: #3fb950; }

    /* ---- Drawing toolbar ---- */
    #draw-toolbar {
      display: none; align-items: center; gap: 6px;
      padding: 6px 14px; border-bottom: 1px solid #21262d;
      background: #0d1117; flex-wrap: wrap;
    }
    #draw-toolbar.open { display: flex; }
    .draw-btn {
      background: #21262d; border: 1px solid #30363d; color: #8b949e;
      padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 0.75rem;
      transition: all .15s; display: inline-flex; align-items: center; justify-content: center;
    }
    .draw-btn:hover { background: #30363d; color: #e6edf3; }
    .draw-btn.active { background: #1a3a20; border-color: #3fb950; color: #3fb950; }
    .draw-btn.del-mode { background: #3a1a1a; border-color: #da3633; color: #da3633; }
    #draw-color { width: 28px; height: 28px; padding: 2px; border: 1px solid #30363d; border-radius: 6px; background: #21262d; cursor: pointer; }
    .draw-sep { width: 1px; height: 20px; background: #30363d; margin: 0 2px; }
    #db-save-exit { background: #1a3a20; border-color: #3fb950; color: #3fb950; }
    #db-save-exit:hover { background: #238636; color: #fff; }
    /* Botón flotante ✓ visible sobre el gráfico mientras hay un modo de dibujo activo */
    #draw-done {
      display: none; position: absolute; bottom: 14px; right: 14px; z-index: 25;
      align-items: center; gap: 4px; padding: 8px 16px; border: 0; border-radius: 20px;
      background: #238636; color: #fff; font-weight: 600; font-size: 0.85rem; font-family: inherit; cursor: pointer;
      box-shadow: 0 2px 10px rgba(0,0,0,.5);
    }
    #draw-done:hover { background: #2ea043; }

    /* Maximize */
    .max-btn {
      background: none; border: none; cursor: pointer; color: #484f58;
      font-size: 0.85rem; padding: 0 4px; line-height: 1;
      transition: color .15s;
    }
    .max-btn:hover { color: #e6edf3; }

    .toggle-btn {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 3px 9px; border-radius: 20px; border: 1px solid #30363d;
      background: #21262d; color: #8b949e; font-size: 0.7rem;
      cursor: pointer; transition: all .15s; user-select: none;
    }
    .toggle-btn.active { background: #0d1117; border-color: currentColor; }
    .toggle-btn.active.vol   { color: #3fb950; }
    .toggle-btn.active.bb    { color: #58a6ff; }
    .toggle-btn.active.ema   { color: #f0883e; }
    .toggle-btn.active.rsi   { color: #f0883e; }
    .toggle-btn.active.macd  { color: #58a6ff; }
    .toggle-btn.active.stoch { color: #3fb950; }

    .ema-extra-row {
      display: flex; align-items: center; gap: 8px; padding: 5px 0;
    }
    .ema-extra-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3fb950; cursor: pointer; }
    .ema-extra-row label { font-size: 0.75rem; color: #8b949e; width: 40px; }
    .ema-extra-row input[type="number"] {
      width: 0; flex: 1; background: #0d1117; border: 1px solid #30363d; color: #e6edf3;
      border-radius: 6px; padding: 6px 8px; font-size: 0.8rem;
    }
    .ema-extra-row input[type="color"] {
      width: 26px; height: 26px; padding: 0; border: 1px solid #30363d; border-radius: 6px;
      background: none; cursor: pointer;
    }

    .chart-card.maximized {
      position: fixed; inset: 0; z-index: 200;
      border-radius: 0; display: flex; flex-direction: column;
    }
    .chart-card.maximized .chart-wrap { flex: 1; }
    .chart-card.maximized .legend { padding: 4px 14px; }

    #signals-panel { display: flex; flex-direction: column; gap: 9px; }

    #fng-card {
      background: #161b22; border: 1px solid #21262d; border-radius: 8px;
      padding: 14px;
    }
    .fng-dot {
      width: 10px; height: 10px; border-radius: 50%; cursor: default;
    }
    @media (min-width: 769px) {
      #mobile-tabbar { display: none; }
      #mobile-ind-panel { display: none; }
    }

    .signal-card {
      background: #161b22; border: 1px solid #21262d; border-radius: 8px;
      padding: 12px 14px; display: flex; align-items: center; gap: 12px;
    }
    .signal-card.green { border-left: 3px solid #3fb950; }
    .signal-card.red   { border-left: 3px solid #da3633; }
    .signal-card.gray  { border-left: 3px solid #484f58; }
    .signal-dot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; }
    .green .signal-dot { background: #3fb950; box-shadow: 0 0 7px #3fb95088; }
    .red   .signal-dot { background: #da3633; box-shadow: 0 0 7px #da363388; }
    .gray  .signal-dot { background: #484f58; }
    .signal-info { flex: 1; min-width: 0; }
    .signal-name { font-size: 0.83rem; font-weight: 600; }
    .signal-detail { font-size: 0.71rem; color: #8b949e; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .signal-label { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; flex-shrink: 0; }
    .green .signal-label { background: #1a3a2088; color: #3fb950; }
    .red   .signal-label { background: #3a1a1a88; color: #da3633; }
    .gray  .signal-label { background: #21262d; color: #8b949e; }

    /* ---- Confluencia ---- */
    #confluence-card {
      background: #161b22; border: 1px solid #21262d; border-radius: 8px; padding: 14px;
    }
    #confluence-card h3 { font-size: 0.78rem; color: #8b949e; margin-bottom: 10px; }
    .conf-row { display: flex; gap: 10px; margin-bottom: 10px; }
    .conf-side { flex: 1; }
    .conf-label { font-size: 0.7rem; color: #8b949e; margin-bottom: 5px; display: flex; justify-content: space-between; }
    .conf-bar-bg { background: #21262d; border-radius: 4px; height: 10px; overflow: hidden; }
    .conf-bar { height: 10px; border-radius: 4px; transition: width .4s; }
    .conf-bar.bull { background: linear-gradient(90deg, #1a7f37, #3fb950); }
    .conf-bar.bear { background: linear-gradient(90deg, #da3633, #ff6b6b); }
    .conf-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
    .conf-tag { font-size: 0.65rem; padding: 2px 6px; border-radius: 10px; }
    .conf-tag.bull { background: #1a3a2088; color: #3fb950; }
    .conf-tag.bear { background: #3a1a1a88; color: #f0883e; }
    .signal-pts { flex-shrink: 0; font-weight: 700; margin-right: 6px; }
    .conf-alert {
      font-size: 0.75rem; font-weight: 700; text-align: center; padding: 5px 8px;
      border-radius: 6px; margin-top: 8px;
    }
    .conf-alert.bull { background: #1a3a20; color: #3fb950; }
    .conf-alert.bear { background: #3a1a1a; color: #f0883e; }
    .conf-alert.none { background: #21262d; color: #8b949e; }

    #history-section {
      grid-column: 1 / -1; background: #161b22; border: 1px solid #21262d;
      border-radius: 8px; padding: 14px 16px;
    }
    #history-section h2 { font-size: 0.82rem; color: #8b949e; margin-bottom: 10px; }
    #history-table { width: 100%; border-collapse: collapse; font-size: 0.79rem; }
    #history-table th { text-align: left; color: #8b949e; padding: 5px 10px; border-bottom: 1px solid #21262d; font-weight: 500; }
    #history-table td { padding: 7px 10px; border-bottom: 1px solid #21262d15; color: #c9d1d9; }
    #history-table tr:last-child td { border-bottom: none; }
    .badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.69rem; font-weight: 600; background: #1a3a20; color: #3fb950; }

    .legend { display: flex; gap: 14px; padding: 6px 14px 0; font-size: 0.7rem; color: #8b949e; flex-wrap: wrap; }
    .legend span { display: flex; align-items: center; gap: 4px; }
    .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

    /* ---- Config panel ---- */
    #cfg-overlay {
      display: none; position: fixed; inset: 0; background: #0008; z-index: 100;
      align-items: center; justify-content: center;
    }
    #cfg-overlay.open { display: flex; }
    #cfg-panel {
      background: #161b22; border: 1px solid #30363d; border-radius: 10px;
      padding: 24px; width: 480px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
    }
    #cfg-panel h3 { font-size: 0.95rem; margin-bottom: 18px; color: #e6edf3; }
    .cfg-section { margin-bottom: 18px; }
    .cfg-section h4 { font-size: 0.75rem; color: #8b949e; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; border-bottom: 1px solid #21262d; padding-bottom: 5px; }
    .cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .cfg-field { display: flex; flex-direction: column; gap: 4px; }
    .cfg-field label { font-size: 0.72rem; color: #8b949e; }
    .cfg-field input {
      background: #0d1117; border: 1px solid #30363d; color: #e6edf3;
      padding: 6px 10px; border-radius: 6px; font-size: 0.82rem; width: 100%;
    }
    .cfg-field input:focus { outline: none; border-color: #58a6ff; }
    .cfg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
    #cfg-save { background: #1a7f37; border: none; }
    #cfg-save:hover { background: #238636; }
    /* ---- Info modal ---- */
    #info-overlay {
      display: none; position: fixed; inset: 0; z-index: 500;
      background: #00000088; backdrop-filter: blur(3px);
      align-items: center; justify-content: center;
    }
    #info-overlay.open { display: flex; }
    #info-panel {
      background: #161b22; border: 1px solid #30363d; border-radius: 12px;
      width: min(680px, 96vw); max-height: 85vh; overflow-y: auto;
      padding: 28px 28px 24px;
    }
    #info-panel h3 { font-size: 1rem; color: #e6edf3; margin: 0; }
    .info-section { margin-bottom: 28px; }
    .info-section h4 {
      font-size: 0.78rem; color: #58a6ff; text-transform: uppercase;
      letter-spacing: .07em; margin-bottom: 12px;
      border-bottom: 1px solid #21262d; padding-bottom: 6px;
    }
    .info-section p { font-size: 0.83rem; color: #8b949e; line-height: 1.65; margin-bottom: 10px; }
    .info-section code {
      background: #0d1117; border: 1px solid #30363d; border-radius: 4px;
      padding: 2px 6px; font-size: 0.78rem; color: #f0883e; font-family: monospace;
    }
    .info-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.78rem; }
    .info-table th { color: #58a6ff; text-align: left; padding: 5px 10px; border-bottom: 1px solid #21262d; }
    .info-table td { color: #8b949e; padding: 5px 10px; border-bottom: 1px solid #21262d11; }
    .info-table tr:last-child td { border-bottom: none; }
    .info-pre {
      background: #0d1117; border: 1px solid #21262d; border-radius: 6px;
      padding: 10px 14px; font-family: monospace; font-size: 0.75rem;
      color: #3fb950; line-height: 1.7; margin: 10px 0; white-space: pre-wrap;
    }
