﻿/* KseAlert live heatmap (from app) */
}
.lhm-container,
.lhm-container * {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue",
                 Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.lhm-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    color: #1a1a1a;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
/* ---- Tabs (Stock Heatmap | Sector Overview) ---- */
.lhm-tabs {
    display: flex;
    gap: 3px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 3px;
    margin-bottom: 10px;
    box-shadow: none;
}
.lhm-tab,
.lhm-tab:hover,
.lhm-tab:focus,
.lhm-tab:visited {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: #475569 !important;
    font-weight: 800;
    font-size: 12px;
    line-height: 1.15;
    padding: 11px 8px;
    border-radius: 7px;
    cursor: pointer;
    letter-spacing: 0;
    text-transform: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: none;
    text-shadow: none;
    min-height: 38px;
    white-space: nowrap;
}
.lhm-tab:active { transform: scale(0.98); }
.lhm-tab.lhm-tab-active,
.lhm-tab.lhm-tab-active:hover,
.lhm-tab.lhm-tab-active:focus,
.lhm-tab.lhm-tab-active:visited,
.lhm-tab.lhm-tab-active:active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 1px 6px rgba(37, 99, 235, 0.34) !important;
}

.lhm-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.lhm-filter-wrap {
    flex: 1;
    min-width: 0;
}
.lhm-filter-select {
    display: block;
    width: 100%;
    max-width: 180px;
    height: 34px;
    padding: 0 28px 0 12px;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none;
    -webkit-box-shadow: none;
    outline: none;
}
/* jQM wraps selects in .ui-select on inner pages â€” keep native dropdown */
.lhm-container div.ui-select {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    float: none !important;
    position: static !important;
}
.lhm-container div.ui-select > .ui-btn,
.lhm-container div.ui-select > span.ui-btn {
    display: none !important;
}
.lhm-container div.ui-select > select.lhm-filter-select {
    position: static !important;
    clip: auto !important;
    width: 100% !important;
    max-width: 180px !important;
    height: 34px !important;
    opacity: 1 !important;
    margin: 0 !important;
}
/* Dedicated heatmap page: flat outer shell (home uses dashboard-section card) */
.lhm-container[data-context="page"] {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}
.lhm-container[data-context="page"] .lhm-filter-select,
.lhm-container[data-context="page"] div.ui-select > select.lhm-filter-select {
    max-width: 200px;
}
.lhm-filter-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.lhm-refresh {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.lhm-refresh:active { background: #2563eb; color: #fff; }

/* Zoom controls (âˆ’ level +) */
.lhm-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 3px;
    height: 38px;
    box-sizing: border-box;
    touch-action: manipulation;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.lhm-zoom-btn {
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    color: #475569;
    text-decoration: none !important;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.lhm-zoom-btn:active:not(.lhm-disabled) { background: #2563eb; color: #fff; }
.lhm-zoom-btn.lhm-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.lhm-zoom-level {
    min-width: 52px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum";
    font-feature-settings: "tnum";
    line-height: 32px;
    touch-action: manipulation;
}
.lhm-zoom-level:active { color: #1e40af; }

/* Drill-down breadcrumb (visible when a sector is focused) */
.lhm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 12px;
    color: #1e3a5f;
    flex-wrap: wrap;
}
.lhm-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #2563eb;
    color: #ffffff !important;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 11px;
    line-height: 1;
    flex: 0 0 auto;
}
.lhm-back:active { background: #1d4ed8; transform: scale(0.97); }
.lhm-back-arrow {
    font-size: 16px;
    line-height: 1;
    margin-top: -2px;
}
.lhm-focus-name {
    font-weight: 700;
    color: #1e293b;
    text-transform: none;
    letter-spacing: -0.005em;
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lhm-focus-meta {
    flex: 0 0 auto;
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
    letter-spacing: 0;
}
.lhm-focus-meta.lhm-focus-up   { color: #16a34a; }
.lhm-focus-meta.lhm-focus-down { color: #dc2626; }
.lhm-container
{
    text-shadow:0 0 0 !important;
}
.lhm-canvas {
    position: relative;
    width: 100%;
    height: 620px; /* JS overrides exact pixel value per context/zoom */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0; /* prevents 4px gap before absolutely-positioned children */
    touch-action: pan-y;
    -ms-touch-action: pan-y;
    overscroll-behavior: contain;
}
.lhm-tile {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.35);
    transition: filter 0.12s;
    padding: 2px 3px;
    line-height: 1.1;
}

/* Sector grouping: outer rect wrapper + header band */
.lhm-sector-group {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    pointer-events: none; /* tile clicks pass through; label re-enables its own */
    z-index: 2;
}
.lhm-sector-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.005em;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    cursor: pointer;
    transition: background 0.12s, transform 0.12s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    z-index: 3;
}
/* Stacked: name row + change row (large / medium sectors) */
.lhm-sector-label-stacked {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: stretch;
    gap: 2px;
    padding: 4px 8px 3px;
    line-height: 1.15;
}
.lhm-sector-label-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 2px 6px;
    line-height: 1.1;
}
.lhm-sector-label:active { transform: scale(0.98); filter: brightness(0.96); }
.lhm-sector-name {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    color: #111827;
    text-shadow: none;
    font-weight: 700;
}
.lhm-sector-label-stacked .lhm-sector-name {
    white-space: nowrap;
    display: block;
    width: 100%;
    max-height: 100%;
}
.lhm-sector-label-stacked.lhm-sector-label-tall .lhm-sector-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    line-height: 1.12;
}
.lhm-sector-label-compact .lhm-sector-name {
    flex: 1 1 auto;
    white-space: nowrap;
    display: block;
}
.lhm-sector-pch {
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    -moz-font-feature-settings: "tnum", "ss01", "cv11";
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
    letter-spacing: 0;
}
.lhm-sector-label-stacked .lhm-sector-pch {
    justify-self: end;
    align-self: end;
    padding: 0;
    margin: 0;
}
.lhm-sector-label-compact .lhm-sector-pch {
    align-self: center;
}
.lhm-sector-label.lhm-sector-up   .lhm-sector-pch { color: #16a34a; }
.lhm-sector-label.lhm-sector-down .lhm-sector-pch { color: #dc2626; }
.lhm-tile:active { filter: brightness(1.15); }
.lhm-tile-sym {
    font-weight: 700;
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
}
.lhm-tile-pch {
    margin-top: 2px;
    font-weight: 600;
    opacity: 0.96;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    -moz-font-feature-settings: "tnum", "ss01", "cv11";
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
}
.lhm-empty {
    height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 13px;
    font-style: italic;
    background: #f8fafc;
}

.lhm-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 10px;
    color: #64748b;
    flex-wrap: wrap;
}
.lhm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.lhm-leg-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #475569;
}
.lhm-leg-sw {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.lhm-updated {
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
    letter-spacing: 0;
}

/* ---- Sector Overview (table view) ---- */
.lhm-pane-overview { color: #1a1a1a; }
.lhm-ov-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.lhm-ov-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
}
.lhm-ov-chips::-webkit-scrollbar { display: none; }
.lhm-ov-chip {
    flex: 0 0 auto;
    padding: 5px 11px;
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.005em;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
}
.lhm-ov-chip:active { transform: scale(0.96); }
.lhm-ov-chip.lhm-ov-chip-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}
.lhm-ov-viewall-wrap {
    text-align: center;
    padding: 16px 12px;
}
.lhm-ov-viewall {
    color: #007bff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    display: inline-block;
    border-radius: 6px;
    background: #f0f7ff;
    transition: all 0.2s;
    white-space: nowrap;
}
.lhm-ov-refresh { /* re-uses .lhm-refresh styling */ }

.lhm-ov-table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}
.lhm-ov-list {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.lhm-ov-head, .lhm-ov-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) minmax(0, 0.8fr) 72px;
    align-items: stretch;
    border-bottom: 1px solid #e9ecef;
}
.lhm-ov-head {
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
}
.lhm-ov-head > div { padding: 10px 10px; }
.lhm-ov-h-mcap, .lhm-ov-h-vol, .lhm-ov-h-pch { text-align: right; }
.lhm-ov-h-unit {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    margin-top: 1px;
    letter-spacing: 0;
}
.lhm-ov-row {
    cursor: pointer;
    transition: background 0.12s;
    min-height: 44px;
    background: #ffffff;
}
.lhm-ov-row:last-child { border-bottom: none; }
.lhm-ov-row:active { background: #f0f7ff; }
.lhm-ov-name {
    padding: 6px 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}
.lhm-ov-name-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1e293b;
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.3;
    letter-spacing: -0.005em;
    text-transform: none;
}
.lhm-ov-name-sub {
    color: #64748b;
    font-size: 10.5px;
    font-weight: 500;
    margin-top: 3px;
    line-height: 1;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum";
    font-feature-settings: "tnum";
}
.lhm-ov-mcap-cell,
.lhm-ov-vol-cell {
    min-height: 44px;
    padding: 6px 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #f8fafc;
}
.lhm-ov-vol-cell {
    border-left: 1px solid #eef2f6;
}
.lhm-ov-mcap {
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
    text-shadow: none;
    line-height: 1.1;
    letter-spacing: -0.005em;
    text-align: right;
}
.lhm-ov-vol {
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
    text-shadow: none;
    line-height: 1.1;
    letter-spacing: 0;
    text-align: right;
    white-space: nowrap;
}
.lhm-ov-pch {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum", "ss01", "cv11";
    font-feature-settings: "tnum", "ss01", "cv11";
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
    border-left: 1px solid #e2e8f0;
    letter-spacing: -0.005em;
}
