/* ==========================================================================
   Global Supply Chain Index — Global Supply Chain Health Index
   Master stylesheet. Dash auto-loads this from the assets/ directory.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4ea;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Dashboard Shell
   -------------------------------------------------------------------------- */

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2d3a;
}

.app-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #e1e4ea;
}

.app-subtitle {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: #8a8f9e;
    font-weight: 400;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.last-updated {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.70rem;
    color: #4b5563;
    letter-spacing: 0.05em;
}

.refresh-note {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.70rem;
    color: #4b5563;
    letter-spacing: 0.05em;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.live-dot {
    font-size: 0.8rem;
    color: #00d97e;
    font-weight: 600;
}

.live-dot.pulsing {
    animation: livePulse 2.5s infinite;
}

@keyframes livePulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.system-stats {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.70rem;
    color: #4b5563;
    letter-spacing: 0.05em;
    padding-right: 0px;
    margin-right: -4px;
}

/* --------------------------------------------------------------------------
   Hero Row (Gauge + 90-Day Trend)
   -------------------------------------------------------------------------- */

.hero-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: stretch;
}

/* --------------------------------------------------------------------------
   Chart Panels (shared card style for gauge, trend, map, health bars)
   -------------------------------------------------------------------------- */
/* Generic Panel Container */
.panel {
    background: #1a1d26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.chart-panel {
    background: #1a1d26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Thin, subtle border */
    border-radius: 6px;
    /* Slightly rounded */
    padding: 16px;
    overflow: hidden;
    position: relative;
    /* For corner ticks */
}

.chart-panel .js-plotly-plot,
.chart-panel .plotly,
.chart-panel .plot-container {
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   Category Cards Row
   -------------------------------------------------------------------------- */

.cards-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

/* --------------------------------------------------------------------------
   Sharp Financial Variant (Top Panels - Stock Market Look)
   -------------------------------------------------------------------------- */

.hero-row .chart-panel,
.charts-row .chart-panel {
    border-radius: 6px;
    /* Slightly rounded */
    position: relative;
    background: #1a1d26;
    box-shadow: none;
    /* Flat, clean look */
}

/* Middle Row Charts (Health, Map) */
.charts-row .chart-panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Thin, subtle border */
}

/* Top Row (Gauge & Trend): Frameless / "No Border" look per user request */
.hero-row .chart-panel {
    border: 1px solid transparent;
    /* Maintain layout spacing but hide line */
}

/* Corner Ticks (Standardized Viewfinder Style) */
/* Disabled for "Thin Rounded" look */
/*
.charts-row .chart-panel::after,
.panel::after,
.tech-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    border: 1px solid transparent;

    background:
        linear-gradient(to right, #71717a 1px, transparent 1px) 0 0,
        linear-gradient(to bottom, #71717a 1px, transparent 1px) 0 0,

        linear-gradient(to left, #71717a 1px, transparent 1px) 100% 0,
        linear-gradient(to bottom, #71717a 1px, transparent 1px) 100% 0,

        linear-gradient(to right, #71717a 1px, transparent 1px) 0 100%,
        linear-gradient(to top, #71717a 1px, transparent 1px) 0 100%,

        linear-gradient(to left, #71717a 1px, transparent 1px) 100% 100%,
        linear-gradient(to top, #71717a 1px, transparent 1px) 100% 100% !important;

    background-repeat: no-repeat;
    background-size: 6px 6px;
}
*/

/* --------------------------------------------------------------------------
   Individual Metric Card
   -------------------------------------------------------------------------- */

.metric-card {
    background: #1a1d26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Super thin */
    border-radius: 6px;
    /* Slightly rounded */
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
    /* For corner ticks */
    min-width: 0;
}

/* Corner Ticks handled by shared rule above */

.metric-card:hover {
    border-color: #3d4055;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Card header: label + weight badge */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a8f9e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
    min-width: 0;
}

.card-weight {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Score + delta row */
.card-score-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.card-score {
    font-family: "JetBrains Mono", monospace;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.card-delta {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Sparkline Graph (inside metric cards) — THIS IS THE KEY FIX
   --------------------------------------------------------------------------
   The dcc.Graph creates a Plotly container that can overflow its parent if
   unconstrained. We force it to respect the card boundaries.
   -------------------------------------------------------------------------- */

.card-sparkline {
    width: 100% !important;
    height: 48px !important;
    max-height: 48px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin-top: auto;
}

/* Plotly injects deeply nested containers; lock every single one. */
.card-sparkline .js-plotly-plot,
.card-sparkline .plotly,
.card-sparkline .plot-container,
.card-sparkline .plot-container.plotly,
.card-sparkline .svg-container,
.card-sparkline .main-svg,
.card-sparkline .draglayer {
    width: 100% !important;
    height: 48px !important;
    max-height: 48px !important;
}

/* Kill any Plotly-generated outlines, toolbars, or backgrounds that bleed */
.card-sparkline .modebar-container,
.card-sparkline .plotly .modebar-container {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Middle Row (Health Bars + World Map)
   -------------------------------------------------------------------------- */

.charts-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: stretch;
}

.chart-narrow {
    /* inherits from .chart-panel */
}

.chart-wide {
    /* inherits from .chart-panel */
}

/* --------------------------------------------------------------------------
   Bottom Row (Alerts + Disruptions)
   -------------------------------------------------------------------------- */

.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bottom-panel {
    min-width: 0;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Panel (shared wrapper used by alerts + disruptions)
   -------------------------------------------------------------------------- */

.panel {
    background: #1a1d26;
    border: 1px solid transparent;
    /* Maintain layout spacing but hide line */
    border-radius: 6px;
    /* Slightly rounded */
    padding: 20px;
    height: 100%;
    position: relative;
    /* For corner ticks */
}

/* Corner Ticks handled by shared rule above */

.panel-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #e1e4ea;
}

/* --------------------------------------------------------------------------
   Alerts Feed
   -------------------------------------------------------------------------- */

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
}

.alert-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: background 0.15s ease;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}

.severity-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.alert-time {
    font-size: 0.75rem;
    color: #8a8f9e;
}

.alert-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e1e4ea;
    margin-bottom: 4px;
    line-height: 1.3;
}

.alert-body {
    font-size: 0.8rem;
    color: #8a8f9e;
    line-height: 1.5;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Disruptions Table
   -------------------------------------------------------------------------- */

.disruptions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.disruptions-table thead {
    border-bottom: 2px solid #2a2d3a;
}

.disruptions-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #8a8f9e;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.disruptions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1e2130;
    color: #e1e4ea;
    vertical-align: top;
}

.disruptions-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.td-event {
    font-weight: 500;
    max-width: 200px;
}

.td-affected {
    font-size: 0.75rem;
    color: #8a8f9e;
    max-width: 160px;
}

.td-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Category Health Bars (inside chart panel)
   -------------------------------------------------------------------------- */

.health-bar-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.health-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* The Label sits on TOP of the bar */
.health-bar-label {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    width: 100%;

    font-family: "JetBrains Mono", monospace;
    /* Added font */
    font-size: 0.9rem;
    /* Matches Tech HUD */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    /* Zinc-400 (More Grey) */
    font-weight: 700;
    /* Matches Tech HUD */
}

.health-bar-label span:last-child {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    /* Score pops out */
}

.health-bar-track {
    width: 100%;
    height: 8px;
    /* Thicker */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    /* Sharper */
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 2px;
    /* Sharper */
    transition: width 0.6s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    /* Subtle inner glow */
    position: relative;
}

/* Add a "shine" effect to the bar */
.health-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.dash-footer {
    text-align: center;
    padding: 20px 0 0;
    border-top: 1px solid #2a2d3a;
}

.footer-text {
    font-size: 0.75rem;
    color: #8a8f9e;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Active Ingestion Feed (Startup Sequence Overlay)
   -------------------------------------------------------------------------- */

.ingestion-terminal {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 12px;
    z-index: 1040;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    pointer-events: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);

    /* Fade out the entire container at the very end */
    animation: terminalContainerHide 0.5s 6.0s forwards;
}

@keyframes terminalContainerHide {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.terminal-line {
    display: block;
    color: #8a8f9e;
    margin-bottom: 6px;
    opacity: 1;
}

.terminal-line.final {
    color: #00d97e;
    margin-bottom: 0;
}

/* Staggered disappearances */
.terminal-line:nth-child(1) {
    animation: seqOut 0.3s 4.0s forwards;
}

.terminal-line:nth-child(2) {
    animation: seqOut 0.3s 4.2s forwards;
}

.terminal-line:nth-child(3) {
    animation: seqOut 0.3s 4.4s forwards;
}

.terminal-line:nth-child(4) {
    animation: seqOut 0.3s 4.6s forwards;
}

.terminal-line:nth-child(5) {
    animation: seqOut 0.3s 4.8s forwards;
}

.terminal-line.final::after {
    content: '█';
    margin-left: 6px;
    animation: seqBlink 1s step-end infinite;
}

@keyframes seqOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes seqBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   Scrollbar (dark theme)
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a2d3a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d4055;
}

/* --------------------------------------------------------------------------
   Plotly global overrides (prevent toolbar bloat, enforce dark bg)
   -------------------------------------------------------------------------- */

.js-plotly-plot .plotly .modebar {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE — Mobile-first breakpoints
   ========================================================================== */

/* Tablets & small laptops (≤1024px) */
@media (max-width: 1024px) {
    .dashboard {
        padding: 16px 16px 32px;
        gap: 16px;
    }

    .hero-row {
        grid-template-columns: 1fr 1.5fr;
        gap: 16px;
    }

    .cards-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .charts-row {
        grid-template-columns: 1fr 1.5fr;
        gap: 16px;
    }

    .bottom-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* Phones — landscape & large phones (≤768px) */
@media (max-width: 768px) {
    .dashboard {
        padding: 12px 12px 24px;
        gap: 14px;
    }

    .dash-header {
        flex-direction: column;
        gap: 8px;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .header-meta {
        gap: 10px;
    }

    .hero-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cards-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .metric-card {
        padding: 12px;
    }

    .card-label {
        font-size: 0.7rem;
    }

    .card-score {
        font-size: 1.4rem;
    }

    .charts-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .bottom-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .chart-panel {
        padding: 12px;
    }

    .panel {
        padding: 14px;
    }

    .disruptions-table th,
    .disruptions-table td {
        padding: 6px 8px;
        font-size: 0.72rem;
    }

    .disruptions-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Phones — portrait (≤480px) */
@media (max-width: 480px) {
    .dashboard {
        padding: 8px 8px 20px;
        gap: 12px;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .app-subtitle {
        font-size: 0.8rem;
    }

    .cards-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .metric-card {
        padding: 10px;
        gap: 6px;
    }

    .card-label {
        font-size: 0.65rem;
    }

    .card-weight {
        font-size: 0.6rem;
        padding: 1px 6px;
    }

    .card-score {
        font-size: 1.2rem;
    }

    .card-delta {
        font-size: 0.7rem;
    }

    .card-sparkline {
        height: 40px !important;
        max-height: 40px !important;
    }

    .card-sparkline .js-plotly-plot,
    .card-sparkline .plotly,
    .card-sparkline .plot-container,
    .card-sparkline .plot-container.plotly,
    .card-sparkline .svg-container,
    .card-sparkline .main-svg {
        height: 40px !important;
        max-height: 40px !important;
    }

    .panel {
        padding: 12px;
    }

    .panel-title {
        font-size: 0.9rem;
    }

    .alert-item {
        padding: 10px 12px;
    }

    .alert-title {
        font-size: 0.82rem;
    }

    .alert-body {
        font-size: 0.75rem;
    }

    .alerts-list {
        max-height: 350px;
    }
}

/* ==========================================================================
   Dash debug toolbar — push below our content
   ========================================================================== */

._dash-debug-menu {
    z-index: 9999;
}

/* ==========================================================================
   Live Market Data Redesign (Scrolling Ticker)
   ========================================================================== */

.market-section-ticker {
    background: #0f1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Super thin */
    border-radius: 6px;
    /* Slightly rounded */
    padding: 12px 16px;
    margin-bottom: 24px;
    overflow: hidden;
    /* Hide the scrolling content */
    position: relative;
    white-space: nowrap;
}

/* Corner Ticks handled by shared rule above */

/* The Scrolling Track */
.market-ticker-track {
    display: flex;
    align-items: center;
    gap: 48px;
    /* Gap between items */
    width: max-content;
    /* Allow track to be as wide as needed */
    animation: ticker-scroll 60s linear infinite;
    /* Very slow rotation */
}

.market-ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* Move half the width (the duplicate set) */
}

/* Header Item (Inside ticker) */
.market-ticker-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 24px;
}

.ticker-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8a8f9e;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: "JetBrains Mono", monospace;
}

.ticker-live-dot {
    font-size: 0.7rem;
    color: #00d97e;
    font-weight: 700;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    letter-spacing: 0.05em;
}

/* Individual Ticker Items */
.market-ticker-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.market-symbol {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e1e4ea;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.market-value-price {
    font-family: "JetBrains Mono", monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.market-change-group {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.market-arrow {
    font-size: 0.7rem;
}

/* ==========================================================================
   Skeleton Loading Animation
   ========================================================================== */
.skeleton-pulse {
    background: #2a2d3a;
    position: relative;
    overflow: hidden;
}

.skeleton-pulse::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.05) 20%,
            rgba(255, 255, 255, 0.1) 60%,
            rgba(255, 255, 255, 0));
    animation: shimmer 2s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Category Card Redesign (Technical HUD)
   ========================================================================== */

.tech-card {
    background: #11131a;
    border: 1px solid #52525b;
    /* Sharp Financial Zinc */
    border-radius: 0;
    /* Sharp corners */
    padding: 12px;

    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
    min-height: 160px;
}

/* Corner Ticks for Tech Cards (Standardized) */
.tech-card::after {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    pointer-events: none;
    z-index: 10;
    background:
        linear-gradient(to right, #fff 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, #fff 2px, transparent 2px) 0 0,
        linear-gradient(to left, #fff 2px, transparent 2px) 100% 0,
        linear-gradient(to bottom, #fff 2px, transparent 2px) 100% 0,
        linear-gradient(to right, #fff 2px, transparent 2px) 0 100%,
        linear-gradient(to top, #fff 2px, transparent 2px) 0 100%,
        linear-gradient(to left, #fff 2px, transparent 2px) 100% 100%,
        linear-gradient(to top, #fff 2px, transparent 2px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 6px 6px;
}

.tech-card:hover {
    border-color: #e1e4ea;
    /* White hover instead of purple */
    box-shadow: none;
}

/* Bezel decoration at top */
.tech-card-bezel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2a2d3a 0%, #3d4055 50%, #2a2d3a 100%);
    opacity: 0.5;
}

/* Header */
.tech-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Align top so height difference grows down */
    margin-bottom: 12px;
    /* Increased spacing */
    min-height: 2.4em;
    /* Force height for 2 lines */
}

.tech-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #8a8f9e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    max-width: 75%;
    /* Ensure space for weight badge */
    line-height: 1.2;
}

.tech-weight {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    color: #4b5563;
    border: 1px solid #2a2d3a;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Main Score Row */
.tech-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.tech-score {
    font-family: "JetBrains Mono", monospace;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
}

/* Daily Delta Box */
.tech-delta-box {
    text-align: right;
}

.tech-meta-label {
    display: block;
    font-size: 0.55rem;
    color: #4b5563;
    text-transform: uppercase;
    margin-bottom: 1px;
    font-family: "JetBrains Mono", monospace;
}

.tech-delta-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Secondary Stats Grid (Min/Max) */
.tech-stats-grid {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: 2px;
    margin-top: 4px;
}

.tech-grid-sep {
    width: 1px;
    height: 12px;
    background: #2a2d3a;
}

.tech-meta-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Sparkline "Screen" */
.tech-sparkline-container {
    flex-grow: 1;
    border-top: 1px solid #2a2d3a;
    border-bottom: 1px solid #2a2d3a;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    margin-top: auto;
    overflow: hidden;
    /* Clip any potential fill bleed */
    /* Push to bottom */
}

/* Corner Decorations */
/* Corner Decorations (Legacy - Hidden in favor of standard ticks) */
.tech-corner-tr,
.tech-corner-bl {
    display: none !important;
}