@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    background: #090d16;
    color: #e6edf3;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    max-width: 100%;
    overflow-x: hidden;
}

.page-wrapper {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Ambient Background Chart (Subtle background graph floating above dashboard) */
.chart-backdrop-section {
    width: 100%;
    position: relative;
    z-index: 15;
    margin-bottom: -16px;
    padding: 0 4px;
    background: radial-gradient(ellipse 95% 120% at 50% 35%, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.02) 65%, transparent 100%);
    border-radius: 16px 16px 0 0;
    user-select: none;
    touch-action: pan-y;
}
.chart-backdrop-section:has(.chart-settings-popover.open),
.chart-backdrop-section:has(.chart-tooltip.visible) {
    z-index: 35;
}

/* SVG Graph Stage */
.chart-stage {
    position: relative;
    width: 100%;
    height: 135px;
    min-height: 135px;
    cursor: grab;
    overflow: visible;
}
.chart-stage:not(.chart-ready)::before {
    content: "";
    position: absolute;
    inset: 12px 10px 8px 10px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.04) 25%, rgba(56, 189, 248, 0.1) 50%, rgba(56, 189, 248, 0.04) 75%);
    background-size: 200% 100%;
    animation: chartSkeletonShimmer 1.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes chartSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.chart-stage:active {
    cursor: grabbing;
}

.chart-svg {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}

.chart-grid-line {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-dasharray: 4, 6;
    stroke-width: 1;
}

.chart-area {
    fill: url(#areaGradient);
}

.chart-line {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point-ring {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 1.5;
    opacity: 0.75;
    transform-box: fill-box;
    transform-origin: center;
    animation: activePulse 2.4s ease-in-out 2;
}

@keyframes activePulse {
    0%, 100% { transform: scale(0.75); opacity: 0.85; }
    50% { transform: scale(1.5); opacity: 0.15; }
}

.chart-point-active {
    fill: #38bdf8;
    stroke: #090d16;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px #38bdf8);
}

.chart-cursor-line {
    stroke: rgba(56, 189, 248, 0.45);
    stroke-dasharray: 3, 3;
    stroke-width: 1.2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.chart-cursor-dot {
    fill: #ffffff;
    stroke: #38bdf8;
    stroke-width: 2.5;
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(0 0 8px #38bdf8);
    transition: opacity 0.12s ease;
}

/* Graph Header Bar & Controls (Outside the SVG Graph Stage) */
.chart-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 6px 10px;
    position: relative;
    z-index: 10;
}

.chart-title-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-title-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-ctrl-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.18s ease;
    user-select: none;
}

.chart-ctrl-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

.chart-ctrl-btn.active {
    background: rgba(56, 189, 248, 0.28);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.chart-reset-btn {
    display: none;
}

.chart-reset-btn.visible {
    display: inline-flex;
}

.chart-period-group {
    display: inline-flex;
    align-items: center;
    background: rgba(11, 18, 34, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
    backdrop-filter: blur(6px);
}

.chart-period-pill {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    border-radius: 16px;
    padding: 2px 8px;
    font-size: 9.5px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
    line-height: 1.25;
}

.chart-period-pill:hover {
    color: #e2e8f0;
    background: rgba(56, 189, 248, 0.1);
}

.chart-period-pill.active {
    background: rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.65);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

.chart-gear-btn {
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chart-export-group {
    display: inline-flex;
    align-items: center;
    background: rgba(11, 18, 34, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}
.chart-export-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    border-radius: 14px;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.25;
}
.chart-export-btn:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.2);
}

.chart-gear-btn.active {
    background: rgba(56, 189, 248, 0.35);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Redesigned Settings Popover */
.chart-settings-popover {
    position: absolute;
    top: 38px;
    right: 8px;
    width: 278px;
    max-width: calc(100vw - 24px);
    background: linear-gradient(165deg, rgba(15, 24, 46, 0.98) 0%, rgba(10, 16, 31, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.14);
    padding: 13px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    z-index: 200;
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.chart-settings-popover.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popover-title-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
}

.popover-title-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
}

.popover-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.popover-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 5px;
    transition: all 0.15s ease;
}

.popover-close:hover {
    color: #ffffff;
    background: rgba(244, 63, 94, 0.22);
    border-color: rgba(244, 63, 94, 0.45);
}

.popover-section {
    margin-bottom: 12px;
}

.popover-section:last-child {
    margin-bottom: 0;
}

.popover-label {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    font-weight: 700;
}

/* Interactive Asset Cards inside Settings */
.popover-asset-cards {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.popover-asset-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.popover-asset-card input[type="radio"] {
    display: none;
}

.popover-asset-card:hover {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(56, 189, 248, 0.28);
}

.popover-asset-card.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: inset 0 0 12px rgba(56, 189, 248, 0.08);
}

.asset-card-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.asset-card-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.asset-card-name {
    font-size: 11px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.2;
}

.popover-asset-card.active .asset-card-name {
    color: #ffffff;
}

.asset-card-sub {
    font-size: 8.5px;
    color: #64748b;
    line-height: 1.1;
}

.popover-badge {
    font-size: 8.5px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

/* Modern Cyber Toggle Switches */
.popover-toggles-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.popover-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    user-select: none;
    transition: all 0.14s ease;
}

.popover-switch-row:hover {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(56, 189, 248, 0.22);
}

.popover-switch-row.disabled-row {
    opacity: 0.42;
    pointer-events: none;
}

.switch-row-left {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.switch-row-title {
    font-size: 10.5px;
    font-weight: 600;
    color: #cbd5e1;
}

.popover-switch-row:hover .switch-row-title {
    color: #ffffff;
}

.switch-row-desc {
    font-size: 8.5px;
    color: #64748b;
}

.circ-line-preview {
    display: inline-block;
    width: 14px;
    height: 0;
    border-top: 2px dashed #34d399;
    filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.6));
}

.cyber-toggle-input {
    display: none;
}

.cyber-toggle-track {
    width: 30px;
    height: 16px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.32);
    position: relative;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.cyber-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-toggle-input:checked + .cyber-toggle-track {
    background: rgba(56, 189, 248, 0.24);
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.cyber-toggle-input:checked + .cyber-toggle-track .cyber-toggle-thumb {
    left: 16px;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
}

/* Event Overlay Styles */
.chart-event-group {
    pointer-events: auto;
}

.chart-event-band {
    fill-opacity: 0.07;
    pointer-events: none;
    transition: fill-opacity 0.2s ease;
}

.chart-event-group:hover .chart-event-band,
.chart-event-group.active-event .chart-event-band {
    fill-opacity: 0.16;
}

.chart-event-line {
    stroke-dasharray: 2, 3;
    stroke-width: 1.2;
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.chart-event-group:hover .chart-event-line,
.chart-event-group.active-event .chart-event-line {
    opacity: 0.95;
    stroke-width: 1.6;
}

.chart-event-bar {
    cursor: pointer;
    opacity: 0.78;
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.chart-event-bar:hover,
.chart-event-group.active-event .chart-event-bar {
    opacity: 1;
    filter: brightness(1.2) drop-shadow(0 0 4px currentColor) !important;
}

.chart-event-icon {
    pointer-events: none;
    opacity: 0.32;
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.chart-event-group:hover .chart-event-icon,
.chart-event-group.active-event .chart-event-icon {
    opacity: 0.85;
    filter: brightness(1.2) drop-shadow(0 0 6px currentColor) !important;
}

.chart-circ-line {
    fill: none;
    stroke: #34d399;
    stroke-width: 1.5;
    stroke-dasharray: 3.5, 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    opacity: 0.78;
    filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.35));
    transition: stroke 0.2s ease, opacity 0.2s ease;
}

/* Spike & Radical Event Vertical Bar Markers */
.chart-spike-marker {
    pointer-events: none;
}

.chart-spike-line {
    stroke-dasharray: 2, 3;
    stroke-width: 1.25;
    pointer-events: none;
    opacity: 0.65;
    transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.chart-spike-bar {
    pointer-events: none;
    stroke: currentColor;
    stroke-width: 0px;
    transition: stroke-width 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.chart-spike-dot {
    pointer-events: none;
    transition: stroke-width 0.15s ease, filter 0.15s ease;
}

/* Hover expansion: expand symmetrically via stroke-width and glow with ZERO coordinate jumping */
.chart-spike-marker.active-spike .chart-spike-bar {
    stroke-width: 1.5px;
    filter: brightness(1.35) drop-shadow(0 0 10px currentColor) !important;
}

.chart-spike-marker.active-spike .chart-spike-line {
    opacity: 0.98;
    stroke-width: 1.75;
}

.chart-spike-marker.active-spike .chart-spike-dot {
    stroke-width: 2.5px;
    filter: brightness(1.4) drop-shadow(0 0 8px currentColor) !important;
}

.chart-event-tag {
    cursor: pointer;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.chart-event-tag:hover {
    opacity: 1;
    filter: brightness(1.4) drop-shadow(0 0 6px currentColor);
}

.tooltip-event-badge {
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
    line-height: 1.35;
    max-width: 320px;
}

.tooltip-circ {
    font-size: 10px;
    color: #34d399;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tooltip-anomaly {
    margin-top: 5px;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 9.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: normal;
    max-width: 310px;
    line-height: 1.3;
}

/* Side-Docked Hover Readout Card (Never covers the graph stage) */
.chart-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 14px);
    min-width: 220px;
    max-width: 350px;
    width: max-content;
    box-sizing: border-box;
    pointer-events: none;
    visibility: hidden;
    background: linear-gradient(160deg, rgba(13, 21, 39, 0.97) 0%, rgba(9, 14, 26, 0.97) 100%);
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.14);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translate(-6px, -50%);
    transition: opacity 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.14s ease;
    z-index: 50;
    white-space: normal;
}

.chart-tooltip.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    cursor: pointer;
    transform: translate(0, -50%);
}

@media (max-width: 1220px) {
    .chart-tooltip {
        top: calc(100% + 10px);
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translate(-50%, -4px);
        width: calc(100% - 20px);
        max-width: 380px;
        pointer-events: none;
        visibility: hidden;
    }
    .chart-tooltip.visible {
        transform: translate(-50%, 0);
        pointer-events: auto;
        visibility: visible;
        cursor: pointer;
    }
}

.tooltip-time {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.tooltip-price {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.tooltip-diff {
    font-size: 10px;
    font-weight: 600;
}

.tooltip-hint {
    font-size: 9px;
    color: #38bdf8;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Dashboard Container */
.container {
    width: 100%;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 20;
}

.header {
    border-radius: 12px 12px 0 0;
    padding: 20px 24px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-title picture {
    display: contents;
}
.header-title img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #38bdf8;
}
.brand-text {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.25;
}
.sub-text {
    font-size: 11px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}
.badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.content {
    padding: 24px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: #131d35;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.stat-card-interactive {
    cursor: pointer;
    border-color: rgba(56, 189, 248, 0.25);
    background: linear-gradient(135deg, rgba(19, 29, 53, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.stat-card-interactive:hover, .stat-card-interactive:focus-visible {
    border-color: #38bdf8;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 28, 54, 0.95) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.18);
    transform: translateY(-2px);
    outline: none;
}
.stat-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: nowrap;
}
.stat-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-interactive-tag {
    font-size: 9.5px;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 9999px;
    padding: 2px 7px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}
.stat-card-interactive:hover .stat-interactive-tag,
.stat-interactive-tag:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
.stat-sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3fb950;
    box-shadow: 0 0 6px #3fb950;
    display: inline-block;
    flex-shrink: 0;
}
.stat-sync-dot.is-live {
    animation: livePulse 2.2s ease-in-out 2;
}
.stat-sync-dot.is-paused {
    opacity: 0.75;
}
.stat-sub-freshness {
    margin-top: 3px;
    font-size: 9.5px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}
.stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #ffffff;
}
.market-card {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.04) 0%, rgba(15, 23, 42, 0.35) 100%);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(56, 189, 248, 0.02);
}
.market-head {
    margin-bottom: 14px;
}
.market-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.market-title-text {
    font-size: 12px;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.market-pill-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 9999px;
    letter-spacing: 0.03em;
    font-family: 'JetBrains Mono', monospace;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    cursor: default;
}
.market-pill-badge.live {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
}
.market-pill-badge.live:hover {
    background: rgba(63, 185, 80, 0.22);
    border-color: #3fb950;
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.35);
}
.market-pill-badge.historical {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.market-pill-badge.historical:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
.market-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
    flex-shrink: 0;
}
.market-pill-badge.live .market-pill-dot {
    animation: livePulse 2.2s ease-in-out 2;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}
.market-pill-ago {
    color: #94a3b8;
    font-size: 9.5px;
    font-weight: 500;
}
.market-pill-reset {
    font-size: 9.5px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(56, 189, 248, 0.25);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 4px;
    padding: 1px 6px;
    text-decoration: none;
    margin-left: 2px;
    transition: all 0.15s ease;
}
.market-pill-reset:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* ── Market Snapshots Browser Modal ── */
.snap-modal-day-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    -webkit-overflow-scrolling: touch;
}
.snap-modal-day-pills::-webkit-scrollbar {
    height: 4px;
}
.snap-modal-day-pills::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 4px;
}
.snap-day-pill {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #94a3b8;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.snap-day-pill:hover {
    color: #ffffff;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}
.snap-day-pill.active {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.snap-day-pill-count {
    font-size: 9.5px;
    color: #64748b;
}
.snap-day-pill.active .snap-day-pill-count {
    color: #bae6fd;
}

.snap-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    max-height: 55vh;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.35) rgba(11, 19, 36, 0.6);
}
.snap-modal-grid::-webkit-scrollbar {
    width: 6px;
}
.snap-modal-grid::-webkit-scrollbar-track {
    background: rgba(11, 19, 36, 0.6);
    border-radius: 4px;
}
.snap-modal-grid::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 4px;
}
.snap-modal-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.6);
}

/* Clickable Choice Cards */
.snap-choice-card {
    background: rgba(19, 29, 53, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    min-height: 60px;
    box-sizing: border-box;
}
.snap-choice-card:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.25);
}
.snap-choice-card.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.85) 0%, rgba(3, 105, 161, 0.95) 100%);
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}
.snap-choice-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
}
.snap-choice-time {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
}
.snap-choice-date {
    font-size: 9.5px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}
.snap-choice-card.active .snap-choice-date {
    color: #e0f2fe;
}
.snap-choice-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-size: 10px;
}
.snap-choice-ago {
    color: #64748b;
}
.snap-choice-card:hover .snap-choice-ago {
    color: #93c5fd;
}
.snap-choice-card.active .snap-choice-ago {
    color: #bae6fd;
}
.snap-choice-act {
    color: #38bdf8;
    font-weight: 700;
    font-size: 10.5px;
}
.snap-choice-card.active .snap-choice-act {
    color: #ffffff;
}

.snap-modal-live-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(63, 185, 80, 0.14);
    border: 1px solid rgba(63, 185, 80, 0.35);
    color: #3fb950;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.snap-modal-live-link:hover, .snap-modal-live-link.active {
    background: rgba(63, 185, 80, 0.28);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.35);
}
.snap-modal-live-btn {
    font-size: 10.5px;
    font-weight: 700;
    color: #3fb950;
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.35);
    border-radius: 12px;
    padding: 3px 9px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.snap-modal-live-btn:hover {
    background: rgba(63, 185, 80, 0.3);
    color: #ffffff;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.market-stat-col {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(13, 21, 39, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    position: relative;
}
.market-stat-col:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}
.market-stat-interactive {
    cursor: pointer;
    user-select: none;
}
.market-stat-interactive:hover,
.market-stat-interactive:focus-visible {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(18, 29, 56, 0.7);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 10px rgba(56, 189, 248, 0.15);
    outline: none;
    z-index: 500;
}
.market-stat-interactive.is-locked {
    border-color: #38bdf8;
    background: rgba(18, 30, 60, 0.95);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
    z-index: 500;
}
.m-item-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.m-item-pin-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    color: #475569;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    padding: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.market-stat-interactive:hover .m-item-pin-hint {
    color: #94a3b8;
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
}
.market-stat-interactive.is-locked .m-item-pin-hint {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}
.m-item-val-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    margin-top: 2px;
}
.m-trend-tag {
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.01em;
}
.m-trend-tag.pos {
    color: #4ade80;
}
.m-trend-tag.neg {
    color: #f87171;
}

/* ── Interactive Extended Set Tooltip Popover ── */
.set-breakdown-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-width: min(340px, 94vw);
    background-color: #0b1326 !important;
    background: #0b1326 !important;
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.98), 0 0 25px rgba(56, 189, 248, 0.25);
    padding: 10px 12px;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
    pointer-events: none;
    cursor: default;
    box-sizing: border-box;
    backdrop-filter: none !important;
}
.market-stat-interactive:hover .set-breakdown-popover,
.market-stat-interactive.is-locked .set-breakdown-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.set-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.set-popover-sub {
    font-size: 9.5px;
    color: #64748b;
    line-height: 1.3;
    margin-bottom: 6px;
}
.set-popover-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
}
.set-popover-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.set-popover-title {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}
.set-popover-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.set-popover-pin-badge {
    font-size: 9px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1px 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.market-stat-interactive.is-locked .set-popover-pin-badge {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
}
.set-popover-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0 3px;
    border-radius: 3px;
    transition: all 0.14s ease;
}
.set-popover-close:hover {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.18);
}
.set-popover-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 7px;
}
.set-pop-sum-label {
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
}
.set-pop-sum-val {
    color: #ffffff;
    font-weight: 700;
}
.set-pop-sum-trend {
    font-weight: 700;
}
.set-pop-sum-trend.pos {
    color: #4ade80;
}
.set-pop-sum-trend.neg {
    color: #f87171;
}
.set-popover-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 2px;
}
.set-popover-list::-webkit-scrollbar {
    width: 4px;
}
.set-popover-list::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 4px;
}
.set-popover-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    padding: 3.5px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.55);
    transition: background 0.12s ease;
}
.set-popover-row:hover {
    background: rgba(56, 189, 248, 0.12);
}
.set-row-name {
    color: #cbd5e1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.set-row-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.set-row-price {
    color: #ffffff;
    font-weight: 600;
}
.set-row-trend {
    font-weight: 700;
    min-width: 42px;
    text-align: right;
    font-size: 10px;
}
.set-row-trend.pos {
    color: #4ade80;
}
.set-row-trend.neg {
    color: #f87171;
}

/* ── Direct Trade & TornW3B Pricelist Card ── */
.market-trade-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.market-trade-sub {
    font-size: 9.5px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}
.market-trade-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.market-trade-link {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    transition: all 0.15s ease;
}
.market-trade-link:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.45);
    color: #ffffff;
}
.market-trade-link.primary {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}
.market-trade-link.primary:hover {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}
.m-item-title {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}
.market-stat-col:hover .m-item-title {
    color: #cbd5e1;
}
.m-item-val {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

/* ── System Telemetry & Automation Card (Clean, compact inline specs) ── */
.system-specs-card {
    background: linear-gradient(135deg, rgba(17, 27, 49, 0.7) 0%, rgba(11, 19, 36, 0.85) 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
    margin-bottom: 6px;
    backdrop-filter: blur(8px);
}
.specs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.specs-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.specs-status-badge {
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 12px;
    padding: 2px 8px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.specs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.specs-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s ease;
    cursor: default;
}
.specs-col:hover {
    background: rgba(56, 189, 248, 0.06);
}
.specs-key {
    font-size: 9.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.specs-val {
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 600;
    white-space: nowrap;
}
.specs-endpoint-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(8, 13, 26, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 6px;
    padding: 6px 10px;
}
.specs-endpoint-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
}
.specs-endpoint-code {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.specs-copy-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #ffffff;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.specs-copy-btn:hover {
    background: #0284c7;
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.telemetry-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3fb950;
    box-shadow: 0 0 8px #3fb950;
    display: inline-block;
    animation: pulse-glow 2s ease-in-out 2;
}
.telemetry-pulse-dot.is-static {
    animation: none;
    opacity: 0.75;
}
@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* ── Universal Cyber Custom Tooltip ── */
.val-global-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 99999999;
    background: rgba(10, 16, 32, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 5px;
    padding: 5px 9px;
    color: #f8fafc;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 12px rgba(56, 189, 248, 0.25);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.1s ease, transform 0.1s ease;
    max-width: 290px;
    white-space: normal;
    word-break: break-word;
}
.val-global-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

/* ── High-Tech Cyber Modals ── */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 9, 18, 0.82);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
}
.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-window {
    background: #0d1527;
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 25px rgba(56, 189, 248, 0.16);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'JetBrains Mono', monospace;
    box-sizing: border-box;
    content-visibility: auto;
}
.modal-backdrop.open .modal-window {
    transform: scale(1) translateY(0);
}
.modal-header {
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.modal-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.modal-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.modal-badge {
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.modal-close-btn:hover {
    color: #ffffff;
    background: rgba(244, 63, 94, 0.2);
}
.modal-body {
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.35) rgba(11, 19, 36, 0.6);
}
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(11, 19, 36, 0.6);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.6);
}

/* ── Enhanced Items Catalog Styling ── */
.catalog-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    background: rgba(11, 19, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}
.catalog-stat-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}
.catalog-stat-label {
    font-size: 9.5px;
    color: #64748b;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.catalog-stat-value {
    font-size: 12px;
    color: #f1f5f9;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.catalog-controls-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
    max-width: 100%;
    box-sizing: border-box;
}
.catalog-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}
.catalog-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}
.catalog-search-input {
    width: 100%;
    background: #111b33;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    padding: 8px 34px 8px 30px;
    color: #ffffff;
    font-size: 11.5px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.catalog-search-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.catalog-search-kbd {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #64748b;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 4px;
    padding: 1px 5px;
    pointer-events: none;
}
.catalog-search-input:focus ~ .catalog-search-kbd,
.catalog-search-clear.visible ~ .catalog-search-kbd {
    display: none;
}
.catalog-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    display: none;
}
.catalog-search-clear.visible {
    display: block;
}
.catalog-search-clear:hover {
    color: #f43f5e;
}
.catalog-sort-select {
    background: #111b33;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    padding: 7px 8px;
    color: #cbd5e1;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    cursor: pointer;
}
.catalog-sort-select:focus {
    border-color: #38bdf8;
}
.catalog-export-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.32);
    color: #38bdf8;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 10.5px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.catalog-export-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
}

.items-cat-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 2px 0 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}
.items-cat-pill.watchlist-pill {
    border-color: rgba(251, 191, 36, 0.35);
    color: #fcd34d;
}
.items-cat-pill.watchlist-pill.active {
    background: rgba(251, 191, 36, 0.2);
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}
.watchlist-alerts-bar {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 7px 10px;
    margin-bottom: 10px;
    font-size: 10.5px;
    color: #a7f3d0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.item-pin-btn {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #64748b;
    border-radius: 4px;
    padding: 2px 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 600;
    transition: all 0.14s ease;
}
.item-pin-btn:hover,
.item-pin-btn.pinned {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.12);
}
.item-wl-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}
.item-wl-badge.triggered {
    border-color: rgba(52, 211, 153, 0.55);
    color: #34d399;
    background: rgba(16, 185, 129, 0.16);
}
.item-watchlist-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(11, 19, 36, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 12px;
}
.item-wl-pin-btn.pinned {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.14);
}
.item-wl-alert-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.item-wl-lbl {
    font-size: 10px;
    color: #94a3b8;
}
.item-wl-select,
.item-wl-input {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 4px;
    color: #f8fafc;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 7px;
    outline: none;
}
.item-wl-input {
    width: 105px;
}
.item-wl-select:focus,
.item-wl-input:focus {
    border-color: #38bdf8;
}
.items-cat-pills::-webkit-scrollbar {
    height: 4px;
}
.items-cat-pills::-webkit-scrollbar-track {
    background: transparent;
}
.items-cat-pills::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.25);
    border-radius: 4px;
}
.items-cat-pills::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}
.items-cat-pill {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #94a3b8;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.items-cat-pill:hover {
    color: #ffffff;
    border-color: #38bdf8;
}
.items-cat-pill.active {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}
.items-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}
.item-catalog-card {
    background: rgba(14, 22, 41, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.16s ease;
    position: relative;
}
.item-catalog-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(19, 31, 58, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(56, 189, 248, 0.12);
}
.item-card-media {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: rgba(8, 13, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}
.item-card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.item-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.item-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.item-card-id {
    font-size: 9.5px;
    color: #64748b;
    font-weight: 600;
}
.item-card-type {
    font-size: 9px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.item-card-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    margin-top: 1px;
}
.item-card-price {
    color: #34d399;
    font-weight: 700;
}
.item-card-circ {
    color: #94a3b8;
    font-size: 10px;
}
.item-card-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}
.item-act-btn {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #94a3b8;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 9.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.14s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.item-act-btn:hover {
    color: #ffffff;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
}
.item-act-btn.item-detail-btn {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.1);
}
.item-act-btn.item-detail-btn:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
}

/* ── Item Detail Intelligence Modal ── */
.item-detail-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    background: rgba(11, 19, 36, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.item-detail-media {
    width: 64px;
    height: 64px;
    min-width: 64px;
    background: rgba(8, 13, 26, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.item-detail-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.item-detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.item-detail-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.item-detail-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-detail-id {
    font-size: 11px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
}
.item-detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.item-stat-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.item-stat-lbl {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.item-stat-val {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
}
.item-stat-val.val-price {
    color: #34d399;
}
.item-chart-section {
    background: rgba(11, 19, 36, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.item-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.item-chart-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.item-chart-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.item-chart-period-tabs {
    display: flex;
    gap: 4px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2px;
    border-radius: 6px;
}
.item-period-tab {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.item-period-tab:hover {
    color: #ffffff;
}
.item-period-tab.active {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}
.item-chart-wrap {
    position: relative;
    width: 100%;
    height: 160px;
    background: rgba(8, 13, 26, 0.6);
    border-radius: 6px;
    overflow: hidden;
    user-select: none;
}
.item-chart-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 11px;
    background: rgba(8, 13, 26, 0.85);
    z-index: 5;
}
.item-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.item-chart-area {
    fill: url(#itemAreaGradient);
}
.item-chart-line {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.item-chart-circ-line {
    fill: none;
    stroke: #34d399;
    stroke-width: 1.5;
    stroke-dasharray: 4, 3;
    opacity: 0.8;
}
.item-cursor-line {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-dasharray: 2, 2;
    stroke-width: 1;
}
.item-cursor-dot {
    fill: #ffffff;
    stroke: #38bdf8;
    stroke-width: 2;
}
.item-chart-tooltip {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 5px;
    padding: 6px 9px;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.item-chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    font-size: 10px;
    color: #64748b;
}
.item-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-swatch {
    width: 10px;
    height: 3px;
    border-radius: 2px;
}
.item-detail-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.item-act-btn-lg {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.item-act-btn-lg:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

.footer {
    background: #090d16;
    border-top: 1px solid #1e293b;
    padding: 12px 24px;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}
.footer-author-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.footer-tip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.08);
    color: #fb7185;
    cursor: pointer;
    transition: all 0.16s ease;
}
.footer-tip-btn:hover {
    background: rgba(244, 63, 94, 0.22);
    border-color: #f43f5e;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
    transform: translateY(-1px);
}
.tip-modal-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tip-modal-desc {
    font-size: 12px;
    line-height: 1.55;
    color: #cbd5e1;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.tip-modal-desc strong {
    color: #ffffff;
}
.tip-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tip-primary-btn {
    background: rgba(244, 63, 94, 0.16);
    border-color: rgba(244, 63, 94, 0.45);
    color: #fda4af;
}
.tip-primary-btn:hover {
    background: rgba(244, 63, 94, 0.32);
    border-color: #f43f5e;
    color: #ffffff;
}

footer {
    text-align: center;
    padding: 16px 0;
    margin-top: 20px;
    font-size: 11px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    border-top: 1px solid #1e293b;
    width: 100%;
}
@media (max-width: 600px) {
    body {
        padding: 14px 8px;
    }
    .page-wrapper {
        overflow-x: hidden;
    }
    .header {
        padding: 14px 14px;
    }
    .content {
        padding: 14px 10px;
    }
    .chart-header-bar {
        padding: 8px 6px 6px 6px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .chart-settings-popover {
        top: 100%;
        right: 4px;
        width: min(290px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
    }
    .chart-title-tag {
        font-size: 10px;
    }
    .chart-controls {
        gap: 4px;
    }
    .chart-period-pill {
        padding: 2px 6px;
        font-size: 9px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 10px 12px;
    }
    .market-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .market-stat-col {
        padding: 6px 8px;
        min-width: 0;
    }
    .m-item-val {
        font-size: 14px;
    }
    .specs-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }
    .specs-col {
        padding: 3px 4px;
        min-width: 0;
    }
    .specs-key {
        font-size: 8.5px;
    }
    .specs-val {
        font-size: 10px;
    }
    .specs-endpoint-row {
        padding: 5px 8px;
    }
    .specs-endpoint-code {
        font-size: 10px;
        min-width: 0;
    }

    /* Refined Mobile Modal Sizing (Zero Horizontal Scroll / Leak-Proof) */
    .modal-backdrop {
        padding: 6px;
        overflow-x: hidden;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .modal-window {
        width: 100%;
        max-width: 100%;
        max-height: 82vh;
        border-radius: 10px;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .modal-header {
        padding: 10px 10px;
        gap: 6px;
    }
    .modal-title {
        font-size: 11px;
    }
    .modal-badge {
        font-size: 8.5px;
        padding: 1px 5px;
    }
    .modal-body {
        padding: 8px 8px;
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    .catalog-summary-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 6px 6px;
        gap: 4px;
        margin-bottom: 8px;
    }
    .catalog-stat-box {
        min-width: 0;
    }
    .catalog-stat-label {
        font-size: 7.5px;
    }
    .catalog-stat-value {
        font-size: 10px;
    }
    .catalog-controls-row {
        gap: 6px;
        margin-bottom: 8px;
    }
    .catalog-search-input {
        padding: 6px 22px 6px 8px;
        font-size: 10.5px;
    }
    .catalog-sort-select {
        padding: 6px 4px;
        font-size: 9.5px;
    }
    .snap-modal-live-link {
        padding: 5px 8px;
        font-size: 9.5px;
    }
    .snap-modal-day-pills,
    .items-cat-pills {
        gap: 4px;
        padding-bottom: 5px;
        margin-bottom: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .snap-day-pill,
    .items-cat-pill {
        padding: 3px 7px;
        font-size: 9.5px;
    }
    .snap-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        max-height: 48vh;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(56, 189, 248, 0.35) rgba(11, 19, 36, 0.6);
    }
    .snap-choice-card {
        padding: 6px 7px;
        min-height: 46px;
        gap: 3px;
        min-width: 0;
        box-sizing: border-box;
    }
    .snap-choice-time {
        font-size: 11px;
    }
    .snap-choice-date {
        font-size: 8px;
    }
    .snap-choice-ago {
        font-size: 8px;
    }
    .snap-choice-act {
        font-size: 8.5px;
    }
    .items-catalog-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    .item-catalog-card {
        padding: 6px 8px;
        gap: 8px;
        min-width: 0;
        box-sizing: border-box;
    }
    .item-card-media {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
    .item-card-name {
        font-size: 11px;
    }
    .item-card-stats {
        font-size: 9.5px;
        gap: 6px;
    }
    .chart-controls {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .footer {
        padding: 12px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .catalog-controls-row {
        flex-wrap: wrap;
    }
    .catalog-search-wrapper {
        flex: 1 1 100%;
    }
    .catalog-search-input {
        padding: 6px 24px 6px 28px;
    }
    .catalog-search-kbd {
        display: none !important;
    }
    .catalog-sort-select {
        flex: 1;
    }
    .set-breakdown-popover {
        position: fixed;
        left: 50% !important;
        right: auto !important;
        bottom: 14px;
        width: calc(100vw - 20px);
        max-width: 360px;
        transform: translate(-50%, 10px) scale(0.98);
        z-index: 900;
    }
    .market-stat-interactive:hover .set-breakdown-popover,
    .market-stat-interactive.is-locked .set-breakdown-popover {
        transform: translate(-50%, 0) scale(1);
    }
    .set-row-name {
        position: sticky;
        left: 0;
        background: #0b1326;
        padding-right: 6px;
    }
    .item-detail-hero {
        gap: 10px;
        padding: 10px 12px;
    }
    .item-detail-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .item-watchlist-panel {
        padding: 8px 10px;
    }
    .item-detail-footer-actions {
        flex-wrap: wrap;
    }
}
