* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #000;
    color: #fff;
    font-family: 'Inconsolata', sans-serif;
    font-size: 13px;
}

a {
    color: #66a0ff;
    text-decoration: none;
}

a:hover,
a:focus {
    color: #FB8B1E;
}

.explore-shell {
    padding: 16px;
}

.explore-header,
.explore-filters,
.metric-card,
.panel,
.entity-card {
    background: #0a0a0a;
    box-shadow: 0 2.8px 7px 0 rgba(0, 72, 255, .8), 0 1px 2px 0 rgba(0, 72, 255, .2);
}

.explore-header {
    padding: 16px;
    margin-bottom: 14px;
}

.explore-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.explore-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.page-asset-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    object-fit: contain;
    padding: 6px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
}

.explore-header h1 {
    margin: 0 0 6px;
    color: #FB8B1E;
    font-size: 28px;
    letter-spacing: 0;
}

.explore-subtitle {
    color: #888;
    font-size: 12px;
}

.lens-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lens-nav a {
    border: 1px solid #3131e0;
    color: #ccc;
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.lens-nav a.active {
    border-color: #FB8B1E;
    color: #fff;
    background: rgba(251, 139, 30, .16);
}

.explore-filters {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    margin-bottom: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 132px;
}

.control-group label {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
}

.control-group input,
.control-group select,
.control-group button,
.filter-actions button {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #3131e0;
    border-radius: 4px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12px;
}

.control-group input:focus,
.control-group select:focus,
.control-group button:focus,
.filter-actions button:focus {
    outline: none;
    border-color: #0048ff;
}

.filter-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-actions button.primary {
    border: none;
    background: linear-gradient(135deg, #3131e0 0%, #0048ff 100%);
    cursor: pointer;
}

.quick-date {
    cursor: pointer;
}

.quick-date:hover {
    background: #FB8B1E;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 14px;
    min-height: 86px;
}

.metric-label {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-value {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.metric-value.compact {
    font-size: 17px;
}

.positive {
    color: #4CAF50;
}

.negative {
    color: #f44336;
}

.workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .75fr);
    gap: 16px;
    align-items: start;
}

.panel {
    padding: 14px;
    min-width: 0;
}

.panel + .panel {
    margin-top: 16px;
}

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

.panel-title {
    color: #FB8B1E;
    font-size: 15px;
    font-weight: 700;
}

.panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.panel-actions input {
    min-width: 180px;
}

.focus-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.focus-stat {
    min-width: 0;
    padding: 12px;
    border: 1px solid #202020;
    border-radius: 4px;
    background: #070707;
}

.focus-analytics {
    padding-top: 12px;
    border-top: 1px solid #222;
}

.focus-analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.chart-toggle {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chart-toggle button {
    color: #ccc;
    background: #111;
    border: 1px solid #3131e0;
    border-radius: 4px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.chart-toggle button.active {
    color: #fff;
    border-color: #FB8B1E;
    background: rgba(251, 139, 30, .16);
}

.rolling-chart-box {
    height: 220px;
    min-height: 200px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #222;
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.data-table th {
    color: #FB8B1E;
    font-size: 10px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    background: #0a0a0a;
    z-index: 1;
    cursor: pointer;
}

.data-table tr:hover td {
    background: #111;
}

.data-table .wide {
    white-space: normal;
    min-width: 180px;
}

.entity-card {
    display: block;
    color: inherit;
    padding: 14px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.entity-card.current {
    border-color: #FB8B1E;
}

.entity-card + .entity-card {
    margin-top: 10px;
}

.entity-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.entity-title {
    color: #FB8B1E;
    font-size: 17px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.entity-subtitle {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}

.badge {
    color: #111;
    background: #4CAF50;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    white-space: nowrap;
}

.badge.real,
.badge.warn {
    color: #fff;
    background: #f44336;
}

.mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.mini-pill {
    display: inline-flex;
    gap: 5px;
    color: #ccc;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 11px;
}

.chart-box {
    height: 300px;
    min-height: 260px;
}

.empty-state {
    color: #aaa;
    padding: 26px;
    text-align: center;
    background: #0a0a0a;
    box-shadow: 0 2.8px 7px 0 rgba(0, 72, 255, .8), 0 1px 2px 0 rgba(0, 72, 255, .2);
}

.link-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.link-button {
    color: #fff;
    border: 1px solid #3131e0;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1200px) {
    .workbench-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .explore-shell {
        padding: 8px;
    }

    .explore-title-row {
        gap: 12px;
    }

    .explore-heading {
        width: 100%;
    }

    .page-asset-icon {
        width: 44px;
        height: 44px;
    }

    .explore-header h1 {
        font-size: 22px;
    }

    .lens-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
    }

    .lens-nav a {
        padding: 8px 6px;
        text-align: center;
    }

    .explore-filters {
        position: static;
        align-items: stretch;
        gap: 8px;
    }

    .control-group,
    .panel-actions input {
        width: 100%;
        min-width: 0;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions button {
        flex: 1 1 calc(50% - 3px);
        min-height: 38px;
    }

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

    .metric-card,
    .panel,
    .entity-card {
        padding: 10px;
    }

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

    .focus-stat {
        padding: 10px;
    }

    .focus-analytics-header {
        align-items: stretch;
        flex-direction: column;
    }

    .chart-toggle {
        width: 100%;
    }

    .chart-toggle button {
        flex: 1 1 calc(50% - 3px);
        min-height: 36px;
    }

    .metric-value {
        font-size: 18px;
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .metric-value.compact {
        font-size: 15px;
    }

    .workbench-grid {
        gap: 10px;
    }

    .panel-header,
    .entity-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-actions {
        width: 100%;
    }

    .panel-actions .link-button,
    .panel-actions input {
        width: 100%;
    }

    .chart-box {
        height: 240px;
        min-height: 220px;
    }

    .rolling-chart-box {
        height: 220px;
    }

    .table-wrap {
        overflow-x: visible;
    }

    .data-table {
        border-collapse: separate;
        border-spacing: 0 8px;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
    }

    .data-table tr {
        border: 1px solid #242424;
        border-radius: 4px;
        background: #0c0c0c;
        padding: 6px 8px;
    }

    .data-table tr:hover td {
        background: transparent;
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(92px, .44fr) minmax(0, 1fr);
        gap: 8px;
        border-bottom: 0;
        padding: 6px 0;
        font-size: 11px;
        white-space: normal;
        align-items: start;
    }

    .data-table td::before {
        content: attr(data-label);
        color: #888;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .data-table .wide {
        min-width: 0;
    }

    .mini-list {
        gap: 5px;
    }
}

@media (max-width: 420px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .focus-stat-grid {
        grid-template-columns: 1fr;
    }

    .lens-nav {
        grid-template-columns: 1fr;
    }
}
