* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── Light theme (default) ─── */
:root,
[data-theme="light"] {
    --bg-page: #f3f5f8;
    --bg-panel: #ffffff;
    --bg-subtle: #f8fafc;
    --border-color: #d9e1ea;
    --border-strong: #c3cfdd;
    --text-primary: #1f2a37;
    --text-secondary: #5b6777;
    --text-muted: #7b8796;
    --brand: #2d5d88;
    --brand-soft: #dbe8f3;
    --cpu-color: #2d5d88;
    --memory-color: #2f6f56;
    --disk-color: #8c6a2f;
    --network-color: #5d6370;
    --success-color: #2f6f56;
    --warning-color: #8c6a2f;
    --danger-color: #8b3a3a;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
    --iface-up-bg: #e8f5ef;
    --iface-up-text: #1d5c3a;
    --iface-down-bg: #fde8e8;
    --iface-down-text: #7a2020;
    --alert-warn-bg: #fffbeb;
    --alert-warn-border: #d97706;
    --alert-warn-text: #78350f;
    --alert-crit-bg: #fff1f1;
    --alert-crit-border: #dc2626;
    --alert-crit-text: #7f1d1d;
    --scope-host-bg: #dbeafe;
    --scope-host-text: #1e3a5f;
    --scope-container-bg: #ede9fe;
    --scope-container-text: #4c1d95;
    --msb-used: #2d5d88;
    --msb-cached: #6ba4d4;
    --msb-free: #d1e5f5;
}

/* ─── Dark theme ─── */
[data-theme="dark"] {
    --bg-page: #0f1117;
    --bg-panel: #1a1f2e;
    --bg-subtle: #222736;
    --border-color: #2e3650;
    --border-strong: #3e4a66;
    --text-primary: #e8edf5;
    --text-secondary: #9aa5b8;
    --text-muted: #6b7a94;
    --brand: #5b9ad5;
    --brand-soft: #1e3352;
    --cpu-color: #5b9ad5;
    --memory-color: #4aad7a;
    --disk-color: #c49a45;
    --network-color: #8899af;
    --success-color: #4aad7a;
    --warning-color: #c49a45;
    --danger-color: #d45f5f;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    --iface-up-bg: #0d2b1e;
    --iface-up-text: #6fdba8;
    --iface-down-bg: #2b0d0d;
    --iface-down-text: #e07878;
    --alert-warn-bg: #1f1800;
    --alert-warn-border: #c49a45;
    --alert-warn-text: #f5d78a;
    --alert-crit-bg: #200808;
    --alert-crit-border: #d45f5f;
    --alert-crit-text: #f5a0a0;
    --scope-host-bg: #112040;
    --scope-host-text: #7ec3f5;
    --scope-container-bg: #1a0f35;
    --scope-container-text: #c4b0f5;
    --msb-used: #5b9ad5;
    --msb-cached: #2c5480;
    --msb-free: #1c2e42;
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px;
    transition: background 0.25s, color 0.25s;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
}

/* ─── Header ─── */
header {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 28px;
    margin-bottom: 14px;
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

header h1 {
    font-size: 1.4rem;
    line-height: 1.3;
    color: var(--text-primary);
    font-weight: 700;
}

header .subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.theme-toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.header-info {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.header-info span {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.81rem;
    font-weight: 600;
    padding: 5px 11px;
}

.scope-badge {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scope-badge.scope-host {
    background: var(--scope-host-bg) !important;
    color: var(--scope-host-text) !important;
    border-color: transparent !important;
}

.scope-badge.scope-container {
    background: var(--scope-container-bg) !important;
    color: var(--scope-container-text) !important;
    border-color: transparent !important;
}

.refresh-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px;
    border-radius: 50% !important;
    background: var(--success-color) !important;
    border-color: transparent !important;
    padding: 0 !important;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.75); }
}

/* ─── Alert Strip ─── */
.alert-strip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 600;
    border-left: 4px solid;
}

.alert-item.warn {
    background: var(--alert-warn-bg);
    border-color: var(--alert-warn-border);
    color: var(--alert-warn-text);
}

.alert-item.crit {
    background: var(--alert-crit-bg);
    border-color: var(--alert-crit-border);
    color: var(--alert-crit-text);
}

.alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ─── Dashboard layout ─── */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── Overview Cards ─── */
.cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 16px 14px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.card-value {
    margin-top: 8px;
    font-size: 2.1rem;
    line-height: 1;
    font-weight: 700;
    color: var(--text-primary);
}

.card-unit {
    margin-top: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-sub {
    margin-top: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.circular-progress {
    width: 92px;
    height: 92px;
    margin-top: 10px;
}

.progress-background {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 6;
}

.progress-fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: butt;
    transform-origin: 49px 49px;
    transform: rotate(-90deg);
    transition: stroke-dashoffset 0.3s ease;
}

.cpu-card     .progress-fill { stroke: var(--cpu-color); }
.memory-card  .progress-fill { stroke: var(--memory-color); }
.disk-card    .progress-fill { stroke: var(--disk-color); }
.network-card .progress-fill { stroke: var(--network-color); }
.network-card .card-value    { color: var(--network-color); }

/* ─── Charts ─── */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 12px;
}

.chart-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.chart-container h2 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 700;
}

.chart-container canvas {
    max-height: 260px;
}

/* ─── Detail Section ─── */
.details-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.detail-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

.detail-card h3 {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border-color);
}

.detail-link {
    margin-top: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--brand);
    font-size: 0.81rem;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.detail-link:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}

/* ─── Info Grid ─── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.info-grid-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.info-item {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-subtle);
}

.info-item .label {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}

.info-item .value {
    font-size: 0.91rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

/* ─── Load Average ─── */
.load-avg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.load-avg-row .label {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
}

.load-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 9px;
}

.load-badge.load-high   { color: var(--warning-color); border-color: var(--warning-color); }
.load-badge.load-crit   { color: var(--danger-color);  border-color: var(--danger-color); }

/* ─── Per-Core CPU Bars ─── */
.per-core-section {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
}

.core-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.core-bar-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.core-bar-track {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.core-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--cpu-color);
    transition: width 0.3s ease;
}

/* ─── Memory Stacked Bar ─── */
.memory-stacked-bar-wrap {
    margin-top: 12px;
}

.memory-stacked-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--msb-free);
    display: flex;
}

.msb-used {
    height: 100%;
    background: var(--msb-used);
    transition: width 0.3s ease;
}

.msb-cached {
    height: 100%;
    background: var(--msb-cached);
    transition: width 0.3s ease;
}

.msb-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.msb-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 3px;
}

.msb-dot-used   { background: var(--msb-used); }
.msb-dot-cached { background: var(--msb-cached); }
.msb-dot-free   { background: var(--border-strong); }

/* ─── Network Interfaces ─── */
.net-iface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.net-iface-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-subtle);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.net-iface-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.net-iface-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

.net-iface-status {
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.net-iface-status.up {
    background: var(--iface-up-bg);
    color: var(--iface-up-text);
}

.net-iface-status.down {
    background: var(--iface-down-bg);
    color: var(--iface-down-text);
}

.net-iface-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ─── Disk ─── */
.disk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.disk-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-subtle);
    padding: 12px;
}

.disk-item-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    align-items: center;
    gap: 14px;
}

.disk-item-main {
    min-width: 0;
}

.disk-item .disk-path {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-all;
}

.disk-item .progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0 9px;
}

.disk-item .progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.disk-item .disk-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.disk-ring-wrap {
    display: flex;
    justify-content: center;
}

.disk-ring {
    --disk-usage: 0%;
    --disk-ring-color: var(--disk-color);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: conic-gradient(
        var(--disk-ring-color) 0 var(--disk-usage),
        var(--border-color) var(--disk-usage) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.disk-ring-inner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
}

.disk-ring-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.disk-ring-label {
    margin-top: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ─── Modal ─── */
.process-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

.process-table thead {
    background: var(--bg-subtle);
}

.process-table th,
.process-table td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.process-table th {
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.73rem;
}

.process-table td {
    color: var(--text-secondary);
    font-weight: 600;
    word-break: break-word;
}

.process-table tbody tr:hover {
    background: var(--bg-subtle);
}

.process-table tbody tr.process-loading-row:hover {
    background: transparent;
}

.process-loading-cell {
    text-align: center !important;
    color: var(--text-secondary);
}

.process-loading-cell span {
    vertical-align: middle;
}

.table-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    border-top-color: var(--brand);
    display: inline-block;
    margin-right: 8px;
    animation: table-spinner-rotate 0.8s linear infinite;
}

@keyframes table-spinner-rotate {
    to { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.modal-dialog {
    position: relative;
    width: min(980px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    overflow: hidden;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.modal-body {
    padding: 13px 16px 16px;
    max-height: calc(100vh - 130px);
    overflow: auto;
}

.modal-body .process-table {
    margin-top: 0;
}

body.modal-open {
    overflow: hidden;
}

/* ─── Responsive ─── */
@media (max-width: 960px) {
    body { padding: 12px; }

    .charts-section,
    .details-section { grid-template-columns: 1fr; }

    .cards-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .modal-dialog { width: calc(100% - 16px); }
}

@media (max-width: 640px) {
    .cards-section { grid-template-columns: 1fr; }

    header { padding: 14px; }

    header h1 { font-size: 1.15rem; }

    .card { min-height: 180px; }

    .disk-grid { grid-template-columns: 1fr; }

    .disk-item-layout { grid-template-columns: 1fr; }

    .info-grid-two-column { grid-template-columns: 1fr; }

    .per-core-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Host Filesystem Explorer ─── */
.explorer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.explorer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.explorer-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s;
}

.explorer-overlay.is-open .explorer-modal {
    transform: none;
}

.explorer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.explorer-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}

.explorer-breadcrumb .crumb {
    color: var(--brand);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
}

.explorer-breadcrumb .crumb:hover { background: var(--brand-soft); }
.explorer-breadcrumb .crumb-sep { color: var(--text-muted); user-select: none; }
.explorer-breadcrumb .crumb-cur { color: var(--text-primary); font-weight: 600; white-space: nowrap; }

.explorer-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.explorer-btn {
    padding: 5px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.explorer-btn:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.explorer-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.explorer-close:hover { background: var(--danger-color); color: white; border-color: var(--danger-color); }

.explorer-path-bar {
    padding: 8px 18px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    font-family: "SF Mono", "Consolas", "Fira Code", monospace;
    font-size: 0.83rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorer-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

.explorer-loading {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.explorer-loading::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

.explorer-error {
    padding: 24px 18px;
    color: var(--danger-color);
    font-size: 0.9rem;
    background: var(--bg-subtle);
    margin: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--danger-color);
}

.explorer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.explorer-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-subtle);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.explorer-table thead th:hover { color: var(--brand); }

.explorer-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s;
}

.explorer-table tbody tr:hover { background: var(--bg-subtle); }

.explorer-table td {
    padding: 9px 14px;
    vertical-align: middle;
    white-space: nowrap;
}

.explorer-table .td-icon { width: 28px; color: var(--text-muted); font-size: 1rem; }
.explorer-table .td-name { max-width: 500px; overflow: hidden; text-overflow: ellipsis; }
.explorer-table .td-size { text-align: right; width: 110px; color: var(--text-secondary); font-family: "SF Mono", "Consolas", monospace; font-size: 0.82rem; }
.explorer-table .td-bar  { width: 140px; }
.explorer-table .td-type { width: 70px; color: var(--text-muted); font-size: 0.8rem; }

.explorer-table .name-link {
    color: var(--brand);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.explorer-table .name-link:hover { text-decoration: underline; }
.explorer-table .name-plain { color: var(--text-primary); }
.explorer-table .name-link-sym { color: var(--text-muted); font-style: italic; }

.explorer-table .err-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75rem;
    color: var(--danger-color);
}

.exp-bar-wrap {
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}

.exp-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.explorer-summary {
    padding: 10px 18px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 18px;
    flex-shrink: 0;
    background: var(--bg-subtle);
    border-radius: 0 0 12px 12px;
}

/* Button spinner animation */
.explorer-btn.spinning {
    opacity: 0.65;
    pointer-events: none;
}

.explorer-btn.spinning::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: exp-spinner 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes exp-spinner {
    to { transform: rotate(360deg); }
}

.explorer-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 40px;
    color: var(--text-muted);
    text-align: center;
}

.explorer-welcome-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.explorer-welcome-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.explorer-welcome-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
    line-height: 1.4;
}

.explorer-welcome-hint strong {
    color: var(--brand);
    font-weight: 600;
}

