/* ════════════════════════════════════════════════════════════════
 * symbol_dashboard.css — Detail dashboard view styling
 * RTL-aware, dark theme matching main.css
 * ════════════════════════════════════════════════════════════════ */

.sd-root {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
}
.sd-root.open {
    pointer-events: auto;
    opacity: 1;
}

.sd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(6px);
}

.sd-panel {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 240ms ease;
    direction: rtl;
}
.sd-root.open .sd-panel {
    transform: translateY(0);
}

/* ─── Header ─── */
.sd-header {
    flex: 0 0 auto;
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.sd-header-left, .sd-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sd-close-btn, .sd-refresh-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #cbd5e1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
}
.sd-close-btn:hover, .sd-refresh-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}
.sd-refresh-btn .spin {
    display: inline-block;
    animation: sd-spin 1s linear infinite;
}
@keyframes sd-spin {
    to { transform: rotate(360deg); }
}
.sd-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    letter-spacing: 0.5px;
    direction: ltr;
}
.sd-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: #facc15;
    direction: ltr;
}
.sd-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 3px 8px;
    border-radius: 5px;
    direction: ltr;
}
.sd-change.up { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.sd-change.down { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.sd-header-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.sd-overall-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(71, 85, 105, 0.4);
}
.sd-overall-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}
.sd-overall-chip {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 5px;
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid transparent;
    direction: rtl;
}
.sd-overall-chip.sd-overall-bullish-strong {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}
.sd-overall-chip.sd-overall-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.35);
}
.sd-overall-chip.sd-overall-bearish-strong {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}
.sd-overall-chip.sd-overall-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}
.sd-overall-chip.sd-overall-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}
.sd-overall-detail {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #94a3b8;
}

.sd-bias-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sd-bias-chip {
    font-size: 0.78rem;
    padding: 4px 9px;
    border-radius: 5px;
    background: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
    border: 1px solid transparent;
    font-weight: 600;
    direction: ltr;
}
.sd-bias-chip.sd-bias-bullish { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-color: rgba(34,197,94,0.3); }
.sd-bias-chip.sd-bias-bearish { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239,68,68,0.3); }
.sd-bias-chip.sd-bias-neutral { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

.sd-killzone-chip {
    font-size: 0.78rem;
    padding: 4px 9px;
    border-radius: 5px;
    background: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
    font-weight: 600;
}
.sd-killzone-chip.on {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

/* ─── Chart section (50% chart / 50% info sidebar) ─── */
.sd-chart-section {
    flex: 0 0 auto;
    height: 44vh;
    min-height: 320px;
    padding: 12px 16px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    position: relative;
}
.sd-chart-side {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.sd-chart-info-panel {
    flex: 1 1 50%;
    min-width: 0;
    overflow-y: auto;
    padding: 4px;
}
.sd-chart-info-panel::-webkit-scrollbar { width: 6px; }
.sd-chart-info-panel::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}
.sd-info-loading {
    color: #64748b;
    text-align: center;
    padding: 20px;
}
.sd-info-empty {
    color: #64748b;
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}
.sd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr;
    gap: 6px;
}
.sd-info-card {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.35);
    border-radius: 7px;
    transition: border-color 150ms ease, background 150ms ease;
}
.sd-info-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
}
/* clickable cards — route to their source panel */
.sd-info-card.sd-info-clickable { cursor: pointer; }
.sd-info-card.sd-info-clickable:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.1);
}
.sd-info-go {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    opacity: 0.35;
    transition: opacity 150ms ease, transform 150ms ease, color 150ms ease;
}
.sd-info-card.sd-info-clickable:hover .sd-info-go {
    opacity: 1;
    color: #818cf8;
    transform: translateX(-3px);
}
.sd-info-card.info-res { border-right: 3px solid #ef4444; }
.sd-info-card.info-sup { border-right: 3px solid #22c55e; }
.sd-info-card.info-bos { border-right: 3px solid #6366f1; }
.sd-info-card.info-fvg { border-right: 3px solid #a855f7; }
.sd-info-card.info-liq { border-right: 3px solid #f97316; }
.sd-info-card.info-ob  { border-right: 3px solid #fbbf24; }
.sd-info-card.info-pat { border-right: 3px solid #06b6d4; }
.sd-info-card.info-vwap-up { border-right: 3px solid #10b981; }
.sd-info-card.info-vwap-down { border-right: 3px solid #ef4444; }
.sd-info-card.info-delta-up { border-right: 3px solid #22c55e; }
.sd-info-card.info-delta-down { border-right: 3px solid #ef4444; }
.sd-info-card.info-delta-flat { border-right: 3px solid #64748b; }
.sd-info-card.info-divg-up { border-right: 3px solid #22c55e; }
.sd-info-card.info-divg-down { border-right: 3px solid #ef4444; }
.sd-info-card.info-divg-flat { border-right: 3px solid #64748b; }
.sd-info-card.info-dim { opacity: 0.55; }
.sd-info-icon {
    font-size: 1.1rem;
    text-align: center;
    width: 32px;
    line-height: 1;
}
.sd-info-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sd-info-label {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.sd-info-main {
    font-size: 0.82rem;
    color: #e2e8f0;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-info-sub {
    font-size: 0.7rem;
    color: #cbd5e1;
    font-family: 'JetBrains Mono', monospace;
    direction: ltr;
    text-align: right;
}
.sd-info-dim {
    color: #64748b;
    font-style: italic;
    font-weight: 400;
}

/* On narrower screens, give the chart more room and shrink the info panel */
@media (max-width: 1400px) {
    .sd-chart-side       { flex: 1 1 60%; }
    .sd-chart-info-panel { flex: 1 1 40%; }
}
/* Below this, the 2-column info grid would crowd — drop back to 1 column */
@media (max-width: 1200px) {
    .sd-info-grid { grid-template-columns: 1fr; }
}

/* Candle close timer above chart */
.sd-candle-timer {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 5px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 7px;
    font-size: 0.82rem;
    color: #cbd5e1;
}
.sd-ct-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: sd-pulse-glow 1.5s ease-in-out infinite;
}
.sd-ct-pulse.warning { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.6); }
.sd-ct-pulse.urgent {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    animation: sd-pulse-glow 0.6s ease-in-out infinite;
}
@keyframes sd-pulse-glow {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.sd-ct-tf {
    font-weight: 700;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
}
.sd-ct-time {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #e2e8f0;
    direction: ltr;
}
.sd-ct-time.warning { color: #fbbf24; }
.sd-ct-time.urgent { color: #ef4444; }
.sd-ct-meta {
    font-size: 0.72rem;
    color: #94a3b8;
}
.sd-chart-wrap {
    flex: 1 1 auto;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(71, 85, 105, 0.4);
}
.sd-chart-section { position: relative; }
.sd-chart-expand-btn {
    position: absolute;
    top: 18px;
    left: 22px;
    z-index: 5;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.45);
    color: #c7d2fe;
    width: 32px; height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
}
.sd-chart-expand-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
    transform: scale(1.05);
}
.sd-chart-expand-wrap {
    flex: 1 1 auto;
    width: 100%;
    border-radius: 8px;
    background: #0f172a;
    border: 1px solid rgba(71, 85, 105, 0.4);
    transition: opacity 150ms ease;
}
.sd-expand-body:has(.sd-chart-expand-wrap) {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}
.sd-expand-card:has(.sd-chart-expand-wrap) {
    max-width: none;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}
.sd-expand-overlay:has(.sd-chart-expand-wrap) {
    padding: 0;
}

/* ─── Drawing toolbar (inside expanded chart) ──────────────────── */
.sd-draw-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid rgba(71, 85, 105, 0.35);
    flex-wrap: wrap;
}
.sd-draw-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: #e2e8f0;
    width: 34px;
    height: 30px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.sd-draw-btn:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.55);
}
.sd-draw-btn.active {
    background: rgba(99, 102, 241, 0.42);
    border-color: rgba(99, 102, 241, 0.95);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.55) inset;
}
.sd-draw-btn:active { transform: scale(0.94); }
.sd-draw-action { color: #cbd5e1; }
.sd-draw-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.7);
    color: #fecaca;
}
.sd-draw-sep {
    width: 1px;
    height: 22px;
    background: rgba(71, 85, 105, 0.5);
    margin: 0 6px;
}
/* Indicator toggle buttons (Fractals, …) — amber accent when active */
.sd-draw-ind.active {
    background: rgba(245, 158, 11, 0.32);
    border-color: rgba(245, 158, 11, 0.9);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5) inset;
}
.sd-draw-status {
    margin-inline-start: auto;
    color: #94a3b8;
    font-size: 12px;
    direction: rtl;
}
.sd-draw-status.active { color: #a5b4fc; }
/* Crosshair cursor over the chart while a drawing tool is active */
.sd-chart-expand-wrap.sd-drawing-mode { cursor: crosshair; }

/* TF selector row + candle timer inside expanded chart */
.sd-expand-tf-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.sd-tf-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.sd-tf-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(71, 85, 105, 0.35);
    color: #94a3b8;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    transition: all 130ms ease;
    min-width: 42px;
}
.sd-tf-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #cbd5e1;
    border-color: rgba(99, 102, 241, 0.4);
}
.sd-tf-btn.active {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(99, 102, 241, 0.7);
    color: #fff;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.3);
}
.sd-expand-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 6px;
    font-size: 0.82rem;
    color: #cbd5e1;
}
.sd-chart-legend {
    flex: 0 0 auto;
    display: flex;
    gap: 12px;
    font-size: 0.72rem;
    color: #64748b;
    padding: 0 6px;
}
.sd-chart-legend span {
    direction: ltr;
}

/* ─── panel grid (5 panels: signals/candles/liquidity/pd/sessbreaks) ─── */
.sd-panels-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 12px 16px;
    overflow: hidden;
}
@media (max-width: 1500px) {
    .sd-panels-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ─── Deep-dive bottom dock (tabs centered) ─── */
.sd-deep-dock {
    flex: 0 0 auto;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    padding: 8px 16px;
    display: flex;
    justify-content: center;
}
.sd-deep-tabs {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.sd-deep-tab {
    flex: 0 0 auto;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #cbd5e1;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 150ms ease;
    white-space: nowrap;
    font-family: inherit;
}
.sd-deep-tab:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    transform: translateY(-1px);
}
.sd-deep-tab.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.7);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* ─── Deep-tab modal overlay (smaller than dashboard) ─── */
.sd-deeptab-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(6px);
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    animation: sd-fade-in 180ms ease;
}
.sd-deeptab-overlay.show {
    display: flex;
}
.sd-deeptab-card {
    width: 92%;
    max-width: 1300px;
    height: 88%;
    max-height: calc(100vh - 60px);
    background: linear-gradient(180deg, #0b1220 0%, #111c33 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    animation: sd-pop-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sd-deeptab-head {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sd-deeptab-tabs-row {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: auto;
}
.sd-deeptab-mtab {
    flex: 0 0 auto;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 150ms ease;
    white-space: nowrap;
    font-family: inherit;
}
.sd-deeptab-mtab:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #cbd5e1;
}
.sd-deeptab-mtab.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.7);
    color: #fff;
}
.sd-deeptab-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 22px;
    font-size: 0.92rem;
}
.sd-deeptab-body::-webkit-scrollbar { width: 8px; }
.sd-deeptab-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}
.sd-panel-card {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 10px;
    overflow: hidden;
}
.sd-panel-head {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.7);
    color: #e2e8f0;
    font-size: 0.92rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(71, 85, 105, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
    user-select: none;
}
.sd-panel-head:hover {
    background: rgba(99, 102, 241, 0.18);
    border-bottom-color: rgba(99, 102, 241, 0.5);
}
.sd-panel-head:hover .sd-expand-hint {
    color: #c7d2fe;
    transform: scale(1.15);
}
.sd-expand-hint {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #64748b;
    transition: color 150ms ease, transform 150ms ease;
    margin-inline-start: 4px;
}
.sd-panel-title {
    flex: 0 1 auto;
    white-space: nowrap;
}
.sd-panel-summary {
    flex: 0 0 auto;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    white-space: nowrap;
    border: 1px solid transparent;
}
.sd-panel-summary.sd-summary-bullish {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.35);
}
.sd-panel-summary.sd-summary-bullish-strong {
    background: rgba(34, 197, 94, 0.28);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.25);
}
.sd-panel-summary.sd-summary-bearish {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}
.sd-panel-summary.sd-summary-bearish-strong {
    background: rgba(239, 68, 68, 0.28);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}
.sd-panel-summary.sd-summary-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}
.sd-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 0.85rem;
}
.sd-panel-body::-webkit-scrollbar { width: 6px; }
.sd-panel-body::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.4); border-radius: 3px; }

.sd-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin: 10px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed rgba(71, 85, 105, 0.3);
}
.sd-section-label:first-child { margin-top: 0; }

.sd-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 4px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.15);
}
.sd-row-label {
    font-weight: 600;
    color: #cbd5e1;
    font-size: 0.82rem;
}
.sd-row-mid {
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    direction: ltr;
    text-align: start;
}
.sd-row-mid strong { color: #f1f5f9; }

.sd-pill {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    white-space: nowrap;
    direction: ltr;
}
.sd-pill-bullish, .sd-pill-buy { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.sd-pill-bearish, .sd-pill-sell { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.sd-pill-overbought { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.sd-pill-oversold { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.sd-pill-rising, .sd-pill-strong { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.sd-pill-falling, .sd-pill-weak { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Divergence rows */
.sd-divg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    margin: 3px 0;
    border-radius: 6px;
    font-size: 0.78rem;
    background: rgba(30, 41, 59, 0.4);
    border-right: 3px solid rgba(148, 163, 184, 0.3);
}
.sd-divg-row.buy { border-right-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.sd-divg-row.sell { border-right-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.sd-divg-type {
    font-weight: 700;
    font-size: 0.72rem;
    color: #e2e8f0;
    direction: ltr;
}
.sd-divg-desc {
    flex: 1;
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Pattern rows */
.sd-pat-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 5px 8px;
    margin: 3px 0;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.4);
    border-right: 3px solid rgba(148, 163, 184, 0.3);
}
.sd-pat-row.buy { border-right-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.sd-pat-row.sell { border-right-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.sd-pat-tf {
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-weight: 700;
    direction: ltr;
}
.sd-pat-desc { font-size: 0.78rem; color: #e2e8f0; }
.sd-pat-conf {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}
.sd-pat-conf-high { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.sd-pat-conf-med { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.sd-pat-conf-low { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

/* Structure rows */
.sd-struct-row {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    gap: 8px;
    align-items: center;
    padding: 5px 8px;
    margin: 3px 0;
    border-radius: 6px;
    font-size: 0.78rem;
}
.sd-struct-row.buy { background: rgba(34, 197, 94, 0.08); color: #4ade80; }
.sd-struct-row.sell { background: rgba(239, 68, 68, 0.08); color: #f87171; }
.sd-struct-arrow { font-size: 0.9rem; font-weight: 700; }
.sd-struct-type {
    font-weight: 700;
    direction: ltr;
}
.sd-struct-dir { color: #94a3b8; font-size: 0.75rem; }
.sd-struct-price {
    font-family: 'JetBrains Mono', monospace;
    color: #cbd5e1;
    text-align: start;
    direction: ltr;
}

/* Levels / Liquidity rows with proximity highlight */
.sd-lvl-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    margin: 3px 0;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.4);
    font-size: 0.82rem;
    transition: background 150ms ease;
}
.sd-lvl-row:hover { background: rgba(30, 41, 59, 0.7); }
.sd-lvl-row.prox-hot {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}
.sd-lvl-row.prox-warm {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.sd-lvl-row.prox-note {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
}
.sd-lvl-row.prox-far {
    opacity: 0.7;
}

.sd-lvl-icon { font-size: 0.95rem; }
.sd-lvl-label {
    font-weight: 700;
    color: #cbd5e1;
    font-size: 0.78rem;
    direction: ltr;
}
.sd-lvl-price {
    font-family: 'JetBrains Mono', monospace;
    color: #f1f5f9;
    text-align: start;
    direction: ltr;
    font-size: 0.85rem;
}
.sd-lvl-dist {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    direction: ltr;
}
.sd-lvl-row.prox-hot .sd-lvl-dist { color: #fca5a5; }
.sd-lvl-row.prox-warm .sd-lvl-dist { color: #fcd34d; }

.sd-pool-row { grid-template-columns: auto auto 1fr auto; }
.sd-pool-type {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    direction: ltr;
}
.sd-pool-type.bsl { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.sd-pool-type.ssl { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.sd-pool-stars {
    font-size: 0.7rem;
    color: #fbbf24;
}

.sd-zone-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px 8px;
}
.sd-zone-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-weight: 600;
    direction: ltr;
}

/* ─── Loading / Empty / Error ─── */
.sd-loading {
    padding: 24px;
    text-align: center;
    color: #64748b;
}
.sd-loading .spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: sd-spin 0.8s linear infinite;
    margin-bottom: 8px;
}
.sd-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.82rem;
    font-style: italic;
}
.sd-error {
    padding: 16px;
    text-align: center;
    color: #f87171;
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 6px;
}

/* ─── Expanded panel overlay (panel "fullscreen") ─── */
.sd-expand-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: sd-fade-in 180ms ease;
}
.sd-expand-overlay.show {
    display: flex;
}
@keyframes sd-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sd-expand-card {
    width: 100%;
    max-width: 1100px;
    max-height: calc(100vh - 60px);
    background: linear-gradient(180deg, #0b1220 0%, #111c33 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    animation: sd-pop-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes sd-pop-in {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.sd-expand-head {
    flex: 0 0 auto;
    padding: 14px 18px;
    background: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sd-expand-title {
    flex: 1 1 auto;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
}
.sd-expand-head .sd-panel-summary {
    flex: 0 0 auto;
    font-size: 0.78rem;
    padding: 4px 11px;
}
.sd-expand-close {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
}
.sd-expand-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.sd-expand-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 22px;
    font-size: 0.92rem;
}
.sd-expand-body::-webkit-scrollbar { width: 8px; }
.sd-expand-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}
/* Larger rows when expanded */
.sd-expand-body .sd-row,
.sd-expand-body .sd-lvl-row,
.sd-expand-body .sd-divg-row,
.sd-expand-body .sd-pat-row,
.sd-expand-body .sd-struct-row {
    padding: 8px 10px;
    font-size: 0.9rem;
}
.sd-expand-body .sd-section-label {
    font-size: 0.78rem;
    margin: 14px 0 8px;
}

/* ─── Session Breaks Panel ─── */
.sd-sess-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    transition: border-color 150ms ease;
}
.sd-sess-card.sd-sess-break-up {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(15, 23, 42, 0.55));
    border-left: 3px solid #10b981;
}
.sd-sess-card.sd-sess-break-down {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(15, 23, 42, 0.55));
    border-left: 3px solid #ef4444;
}
.sd-sess-card.sd-sess-inside {
    border-left: 3px solid rgba(148, 163, 184, 0.4);
}
.sd-sess-card.sd-sess-pending {
    opacity: 0.55;
    border-style: dashed;
}
.sd-sess-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.sd-sess-icon { font-size: 1.1rem; }
.sd-sess-name {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 0.9rem;
}
.sd-sess-status {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}
.sd-sess-status.sd-sess-active {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
}
.sd-sess-status.sd-sess-closed {
    background: rgba(71, 85, 105, 0.25);
    color: #94a3b8;
}
.sd-sess-status.sd-sess-stale {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}
.sd-sess-status.sd-sess-pending-tag {
    background: rgba(71, 85, 105, 0.2);
    color: #94a3b8;
}
.sd-sess-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    direction: ltr;
    white-space: nowrap;
}
.sd-sess-timer.pending {
    background: rgba(71, 85, 105, 0.2);
    color: #94a3b8;
    border-color: rgba(71, 85, 105, 0.4);
}
.sd-sess-timer.warning {
    background: rgba(251, 191, 36, 0.18);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.4);
}
.sd-sess-timer.urgent {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.45);
    animation: sd-pulse-glow 0.8s ease-in-out infinite;
}
.sd-sess-timer.ended {
    background: rgba(71, 85, 105, 0.15);
    color: #64748b;
    border-color: rgba(71, 85, 105, 0.3);
}
.sd-sess-state {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 8px;
    margin: 4px 0 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.6);
}
.sd-sess-state.break-up {
    background: rgba(16, 185, 129, 0.12);
    color: #86efac;
}
.sd-sess-state.break-down {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}
.sd-sess-state.inside { color: #cbd5e1; }
.sd-sess-state-label { font-weight: 700; }
.sd-sess-state-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}
.sd-sess-state-meta {
    color: rgba(203, 213, 225, 0.7);
    font-size: 0.72rem;
}
.sd-sess-levels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    font-size: 0.76rem;
}
.sd-sess-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 6px;
    background: rgba(30, 41, 59, 0.55);
    border-radius: 5px;
}
.sd-sess-level-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sd-sess-level-val {
    font-family: 'JetBrains Mono', monospace;
    color: #e2e8f0;
    font-weight: 700;
    margin-top: 2px;
}
.sd-sess-signal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin-bottom: 5px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.5);
    font-size: 0.78rem;
}
.sd-sess-signal-icon { font-size: 0.95rem; }
.sd-sess-signal-text { flex: 1 1 auto; color: #e2e8f0; }
.sd-sess-signal-bullish-strong {
    background: rgba(16, 185, 129, 0.15);
    border-right: 3px solid #10b981;
}
.sd-sess-signal-bearish-strong {
    background: rgba(239, 68, 68, 0.15);
    border-right: 3px solid #ef4444;
}
.sd-sess-signal-bullish { border-right: 3px solid rgba(16, 185, 129, 0.5); }
.sd-sess-signal-bearish { border-right: 3px solid rgba(239, 68, 68, 0.5); }
.sd-sess-signal-neutral { border-right: 3px solid rgba(148, 163, 184, 0.4); }

/* ═══ 💎 Premium/Discount + Delta tab (2026-05-22) ═══ */
.pd-tab {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px;
}
.pd-bias {
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    border: 1px solid var(--border, #2a2a3a);
}
.pd-bias-label { font-size: 1.15rem; font-weight: 800; }
.pd-bias-reason { font-size: 0.82rem; color: var(--text-muted, #94a3b8); margin-top: 4px; }
.pd-bias-long    { background: rgba(16,163,74,0.12);   border-color: rgba(16,163,74,0.5); }
.pd-bias-long .pd-bias-label    { color: #22c55e; }
.pd-bias-short   { background: rgba(220,38,38,0.12);   border-color: rgba(220,38,38,0.5); }
.pd-bias-short .pd-bias-label   { color: #ef4444; }
.pd-bias-neutral { background: rgba(100,116,139,0.12); border-color: rgba(100,116,139,0.45); }
.pd-bias-neutral .pd-bias-label { color: #cbd5e1; }

.pd-ote {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
}
.pd-ote-buy  { background: rgba(16,163,74,0.14);  color: #22c55e; border: 1px solid rgba(16,163,74,0.5); }
.pd-ote-sell { background: rgba(220,38,38,0.14);  color: #ef4444; border: 1px solid rgba(220,38,38,0.5); }
.pd-ote-none { background: rgba(100,116,139,0.1); color: var(--text-muted,#94a3b8); border: 1px dashed rgba(100,116,139,0.4); }

.pd-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 720px) {
    .pd-cards { grid-template-columns: 1fr; }
}
.pd-card {
    background: rgba(15,23,42,0.55);
    border: 1px solid var(--border, #2a2a3a);
    border-radius: 10px;
    padding: 12px 14px;
}
.pd-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.pd-card-title { font-weight: 700; font-size: 0.9rem; }
.pd-zone-chip {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}
.pd-zone-prem { background: rgba(220,38,38,0.18);  color: #ef4444; }
.pd-zone-disc { background: rgba(16,163,74,0.18);  color: #22c55e; }
.pd-zone-eq   { background: rgba(100,116,139,0.2); color: #cbd5e1; }

.pd-scale-caps {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
    margin: 8px 0 4px;
    direction: ltr;
}
.pd-track {
    position: relative;
    height: 14px;
    border-radius: 7px;
    direction: ltr;
}
.pd-marker {
    position: absolute;
    top: -3px;
    width: 3px;
    height: 20px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
    transform: translateX(-50%);
}
.pd-meta {
    font-size: 0.76rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 5px;
}
.pd-meta strong { color: var(--text-primary, #e2e8f0); }

.pd-fib {
    background: rgba(15,23,42,0.55);
    border: 1px solid var(--border, #2a2a3a);
    border-radius: 10px;
    padding: 10px 14px;
}
.pd-fib-title { font-weight: 700; font-size: 0.84rem; margin-bottom: 4px; }
.pd-fib-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(71,85,105,0.2);
}
.pd-fib-row:last-child { border-bottom: none; }
.pd-fib-val { font-family: 'JetBrains Mono', monospace; }
.pd-fib-prem { color: #ef4444; }
.pd-fib-disc { color: #22c55e; }
.pd-fib-eq   { color: var(--text-muted, #94a3b8); }

.pd-note {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    background: rgba(100,116,139,0.08);
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.5;
}

/* compact variant — used inside the dashboard panel (not the expand overlay) */
.pd-tab-compact { gap: 10px; }
.pd-tab-compact .pd-cards { grid-template-columns: 1fr; gap: 8px; }
.pd-tab-compact .pd-bias { padding: 8px 10px; }
.pd-tab-compact .pd-bias-label { font-size: 0.95rem; }
.pd-tab-compact .pd-bias-reason { font-size: 0.74rem; }
.pd-tab-compact .pd-card { padding: 9px 10px; }
.pd-tab-compact .pd-ote { font-size: 0.78rem; padding: 7px 10px; }

/* ─── Mobile fallback (hide dashboard, modal will be used) ─── */
@media (max-width: 1023px) {
    .sd-root { display: none; }
}
