:root {
    --bg: #0b0f14;
    --panel: rgba(255, 255, 255, 0.06);
    --stroke: rgba(255, 255, 255, 0.12);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --blue: #60a5fa;
    --green: #22c55e;
    --gold: #f59e0b;
    --link: rgba(255, 255, 255, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(1200px 800px at 20% -10%,
            rgba(96, 165, 250, 0.12),
            transparent 60%),
        radial-gradient(1200px 800px at 90% 10%,
            rgba(34, 197, 94, 0.1),
            transparent 55%),
        radial-gradient(900px 700px at 50% 120%,
            rgba(234, 179, 8, 0.08),
            transparent 60%),
        var(--bg);
    color: var(--text);
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
}

body {
    padding: 16px;
}

.page {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.leftHead {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.homeBtn,
.statsBtn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.06);
    color: #2dff00;
    text-decoration: none;
}

h1 {
    margin: 0;
    font-size: 24px;
}

.sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    max-width: 900px;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.controlCard {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.18);
    color: var(--muted);
    font-size: 12px;
    min-width: 170px;

}

.controlCard select {
    flex: 1 1 auto;

    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--stroke);

    background: rgba(0, 0, 0, 0.6);
    color: var(--text);

    font-size: 14px;
    outline: none;

    /* removes default white styling on some browsers */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.controlCard select:hover,
.controlCard select:focus {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.75);
}

.controlCard input[type="range"] {
    width: 140px;
}

.controlCard .val {
    min-width: 34px;
    font-size: 14px;
    text-align: right;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.heroStats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.card,
.vizWrap,
.tablePanel,
.emptyState {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.03));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.card {
    padding: 10px 12px;
}

.label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 700;
}

.vizWrap {
    padding: 12px;
}

#viz {
    width: 100%;
    height: 760px;
    position: relative;
}

#viz svg {
    display: block;
    width: 100%;
    height: 100%;
}

.tablePanel {
    margin-top: 12px;
    overflow: hidden;
}

.panelHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 8px;
}

.panelTitle {
    margin: 0;
    font-size: 16px;
}

.panelSub {
    color: var(--muted);
    font-size: 12px;
}

.tableWrap {
    overflow: auto;
    padding: 0 16px 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.typePill {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.06);
    text-transform: capitalize;
}

.sideLabel {
    font-size: 14px;
    font-weight: 700;
    fill: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nodeLabel {
    fill: hsl(0, 0%, 87%);
    font-size: 13px;
    font-weight: 600;
}

.nodeSub {
    font-size: 13px;
    fill: rgba(255, 255, 255, 0.78);
    font-weight: 200;
}

.tooltip {
    position: fixed;
    pointer-events: none;
    display: none;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 10px 12px;
    max-width: 340px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    z-index: 100;
}

.tooltip b {
    display: block;
    font-size: 13px;
}

.tooltip .meta,
.tooltip .desc {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.emptyState {
    padding: 28px 22px;
    color: var(--muted);
    font-size: 14px;
}

.tuneLink {
    color: #93c5fd;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
}

.tuneLink:hover {
    color: var(--gold);
}

@media (max-width: 1100px) {
    .heroStats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #viz {
        height: 900px;
    }
}

@media (max-width: 720px) {
    body {
        padding: 8px;
    }

    .header {
        margin-bottom: 8px;
    }

    h1 {
        font-size: 18px;
    }

    .sub {
        font-size: 12px;
    }

    .heroStats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .card {
        padding: 10px 12px;
    }

    .value {
        font-size: 16px;
    }

    .controls {
        width: 100%;
    }

    .controlCard {
        width: 100%;
        justify-content: space-between;
    }

    .controlCard input[type="range"] {
        width: 120px;
        flex: 1 1 auto;
    }

    #viz {
        height: 920px;
    }
}

.recordingCellTop {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sessionIconLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
}

.sessionIconLink:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
}

.sessionIconLink img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.trackOverviewLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.trackOverviewDot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.5),
        0 0 6px rgba(245, 158, 11, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trackOverviewLink:hover .trackOverviewDot {
    transform: scale(1.2);
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.7),
        0 0 10px rgba(245, 158, 11, 0.9);
}

.trackTuneLink {
    color: #93c5fd;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    min-width: 0;
}

.trackTuneLink:hover {
    color: var(--text);
    text-decoration: underline;
}

.tuneLinkEllipsis {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 24px;
}

.tuneLinkEllipsisLeft {
    text-align: left;
}

.tuneLinkEllipsisRight {
    text-align: right;
}