
/* ============================================
   ROUTE IMPACT — COMPLETE DARK DASHBOARD STYLE
   ============================================ */

:root {
    --bg: #0d0c0a;
    --panel: #29261c;
    --panel-inner: #353020;
    --border: #746b51;
    --text: #f5f1e7;
    --muted: #c4b394;
    --accent: #dfc58a;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 Arial, Helvetica, sans-serif;
}

a {
    color: #e8cf97;
}

.site-header {
    border-bottom: 1px solid #4e4938;
    padding: 17px 24px;
}

.header-inner {
    max-width: 1540px;
    margin: auto;
}

.site-header h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: .13em;
}

.site-header h1 span {
    color: #e3c179;
}

.site-header p {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--muted);
}

.dashboard {
    max-width: 1540px;
    margin: 0 auto;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(285px, .83fr) minmax(0, 1.7fr);
    grid-template-areas:
        "traffic map"
        "chart map"
        "explorer prices";
    grid-template-rows: auto auto auto;
    gap: 12px;
    align-items: start;
}

.dashboard > * {
    min-width: 0;
}

.panel {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
}

.panel h2 {
    font-size: 17px;
    margin: 0 0 5px;
    font-weight: 700;
}

.panel h3 {
    margin: 0 0 6px;
    font-size: 14px;
}

.panel h4 {
    margin: 13px 0 4px;
    font-size: 12px;
    color: #ead6a9;
}

.panel p {
    margin: 0 0 13px;
    color: var(--muted);
}

label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 700;
    margin: 0 0 7px;
    color: #eed6a2;
}

select {
    width: 100%;
    padding: 11px 12px;
    background: #201f1b;
    border: 1px solid #807454;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

select:focus-visible, a:focus-visible {
    outline: 2px solid #ffdf8e;
    outline-offset: 3px;
}

.status {
    font-size: 12px;
}

/* SHIPPING TRAFFIC DATA */

.portwatch-panel {
    grid-area: traffic;
}

.traffic-controls {
    margin: 14px 0 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel-inner);
}

.traffic-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.traffic-stats > div {
    min-height: 76px;
    border: 1px solid #6b634d;
    border-radius: 6px;
    padding: 12px;
    background: #332e22;
    overflow-wrap: anywhere;
}

.traffic-stats span {
    color: #d4c29c;
    display: block;
    font-size: 10px;
    margin-bottom: 8px;
}

.traffic-stats strong {
    display: block;
    font-size: 17px;
    color: #fff;
    font-weight: 700;
}

.panel p.data-source {
    font-size: 10px;
    margin: 12px 0 0;
}

/* HISTORICAL VESSEL GRAPH */

.traffic-chart-panel {
    grid-area: chart;
    background: #242e34;
    border-color: #485862;
}

.traffic-chart-panel h2,
.traffic-chart-panel p {
    color: #fff;
}

.traffic-chart-container {
    width: 100%;
    height: 260px;
    min-height: 260px;
    position: relative;
    padding: 8px 0;
}

.traffic-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* GLOBAL SHIPPING MAP */

.map-panel {
    grid-area: map;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1 1 auto;
    width: 100%;
    height: 620px;
    min-height: 620px;
    border: 1px solid #746b51;
    border-radius: 5px;
    background: #bed9df;
    z-index: 1;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    border: 1px solid #665e47;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid #151515;
    border-radius: 100%;
    margin-right: 6px;
    vertical-align: -1px;
    background: #e2ce8d;
}

.legend-dot.selected {
    background: #d4634b;
}

.chokepoint-label {
    background: rgba(255,255,255,.92);
    color: #1d1c19;
    border: 1px solid #7b765e;
    font-weight: 600;
    font-size: 11px;
    padding: 3px 7px;
    box-shadow: none;
}

.chokepoint-label:before {
    display: none;
}

.map-panel .map-status {
    color: #f4b39f;
}

/* COMMODITY EXPLORER */

.market-explorer {
    grid-area: explorer;
}

.market-explorer select {
    margin: 0 0 15px;
}

.market-route-context {
    background: #332f22;
    border-left: 3px solid #cfa971;
    border-radius: 4px;
    padding: 16px;
}

.market-route-context p {
    font-size: 12px;
    line-height: 1.65;
    margin-bottom: 9px;
    color: #f0e7d2;
}

.market-explorer .small-note {
    margin: 13px 0 0;
    font-size: 11px;
    line-height: 1.6;
}

/* REAL COMMODITY PRICE CHART */

.market-prices {
    grid-area: prices;
}

.market-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.market-heading .market-subtitle {
    font-size: 18px;
    color: #fff;
    font-weight: 700;
    margin: 10px 0 2px;
}

.market-heading .market-units {
    font-size: 11px;
    margin: 0;
}

.market-badge {
    background: #343e33;
    color: #c7dec8;
    border: 1px solid #6c8b6f;
    padding: 4px 9px;
    border-radius: 40px;
    white-space: nowrap;
    font-size: 10px;
}

.market-chart-widget {
    height: 475px;
    width: 100%;
    background: #222b32;
    border: 1px solid #515951;
    border-radius: 6px;
    overflow: hidden;
}

.market-chart-widget .tradingview-widget-container {
    height: 100%;
    width: 100%;
}

.market-chart-widget .tradingview-widget-container__widget {
    height: 100%;
    width: 100%;
}

.market-prices #market-status {
    margin: 12px 0 6px;
    font-size: 11px;
}

.market-prices .market-explanation {
    margin: 0 0 12px;
    font-size: 12px;
    color: #f4e9d1;
}

.market-footnote {
    border-top: 1px solid #615a45;
    padding-top: 12px;
    font-size: 11px;
    line-height: 1.7;
    color: #cabc9d;
}

.market-footnote a {
    display: inline-block;
    margin-left: 5px;
}

/* RESPONSIVE DESIGN */

@media (max-width: 1100px) {
    .dashboard {
        grid-template-columns: minmax(260px, .95fr) minmax(0, 1.35fr);
    }

    #map {
        height: 550px;
        min-height: 550px;
    }
}

@media (max-width: 780px) {
    .dashboard {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "traffic"
            "chart"
            "map"
            "explorer"
            "prices";
        padding: 12px;
    }

    .map-panel {
        align-self: start;
    }

    #map {
        flex: none;
        height: 420px;
        min-height: 420px;
    }

    .market-chart-widget {
        height: 420px;
    }

    .panel {
        padding: 14px;
    }
}

@media (max-width: 430px) {
    .traffic-stats strong {
        font-size: 15px;
    }

    #map {
        height: 340px;
        min-height: 340px;
    }

    .market-chart-widget {
        height: 355px;
    }
}

/* LIVE SHIPPING ACTIVITY CONTROL */

.live-vessel-count {
    min-width: 170px;
    padding: 13px 16px;
    background: #29261c;
    color: #fff;
    border: 1px solid #746b51;
    border-radius: 6px;
    box-shadow: 0 2px 9px rgba(0,0,0,.28);
    font: 12px/1.45 Arial, sans-serif;
}

.live-vessel-count span {
    display: block;
    font-size: 10px;
    letter-spacing: .1em;
    color: #c9bc9e;
}

.live-vessel-count strong {
    display: block;
    margin: 5px 0 2px;
    font-size: 28px;
}

.live-vessel-count b {
    display: block;
    font-size: 12px;
}

.live-vessel-count small {
    display: block;
    margin-top: 7px;
    color: #c9bc9e;
    font-size: 10px;
}

/* ==========================================
   ROUTE IMPACT
   EMBEDDED COMMODITY PRICE CHART
   ========================================== */

.market-chart-widget {
    display: block;

    width: 100%;
    height: 540px;
    min-height: 540px;

    background: #222B32;

    border: 1px solid #515951;
    border-radius: 8px;

    overflow: hidden;
    position: relative;
}

.market-chart-widget .tradingview-widget-container {
    display: block;

    width: 100%;
    height: 100%;
}

.market-chart-widget
.tradingview-widget-container__widget {
    width: 100%;
    height: calc(100% - 26px);
}

.tradingview-widget-copyright {
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #222B32;
    font-size: 11px;
}

.tradingview-widget-copyright a {
    color: #C6D0D5;
    text-decoration: none;
}

.tradingview-widget-copyright a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

@media (max-width: 780px) {
    .market-chart-widget {
        height: 420px;
        min-height: 420px;
    }
}
