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

:root {
    --bg-main: #0b1a2e;
    --bg-panel: #f8fbff;
    --panel-border: #c6ddf3;
    --text-main: #102742;
    --text-muted: #526f8f;
    --accent: #0f79d0;
    --accent-soft: rgba(15, 121, 208, 0.14);
    --ok: #0c9a52;
    --warn: #b76e0a;
}

body {
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    background: radial-gradient(circle at 10% 10%, #21476f 0%, #0b1a2e 42%, #060f1f 100%);
    color: var(--text-main);
    overflow: hidden;
}

#appShell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    height: 100vh;
    width: 100vw;
}

#globePane {
    position: relative;
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
}

#globeViz {
    position: absolute;
    inset: 0;
}

#sidePanel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: linear-gradient(180deg, #fafdff 0%, #f2f7ff 100%);
    border-left: 1px solid rgba(15, 121, 208, 0.12);
    box-shadow: -12px 0 36px rgba(7, 25, 47, 0.24);
    min-height: 0;
    overflow: hidden;
}

.panelBlock {
    display: grid;
    gap: 8px;
}

.tableBlock {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#title {
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    font-size: 1rem;
}

#search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

#host {
    border: 1px solid rgba(15, 121, 208, 0.3);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 1rem;
    color: var(--text-main);
    background: #fff;
    outline: none;
}

#host:focus {
    border-color: rgba(15, 121, 208, 0.65);
    box-shadow: 0 0 0 3px rgba(15, 121, 208, 0.12);
}

#traceButton {
    border: 1px solid rgba(15, 121, 208, 0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, #44a7f4 0%, #0f79d0 100%);
    color: #fff;
    font-weight: 800;
    padding: 11px 14px;
    cursor: pointer;
}

.panelTitle {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #3a6d9f;
}

.exampleTargets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 9px;
    background: #fff;
}

.exampleChip {
    border: 1px solid rgba(15, 121, 208, 0.25);
    background: rgba(15, 121, 208, 0.08);
    color: #174b76;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.exampleChip:hover {
    background: rgba(15, 121, 208, 0.16);
}

.exampleHint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.iconSvg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ── Playback-Leiste ──────────────────────────────────────── */
#playbackControls {
    display: flex;
    gap: 6px;
}

#playbackControls button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(15, 121, 208, 0.28);
    border-radius: 9px;
    background: #fff;
    color: #19466f;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 4px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

#playbackControls button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#playbackControls button:not(:disabled):hover {
    background: rgba(15, 121, 208, 0.08);
    border-color: rgba(15, 121, 208, 0.48);
}

/* ── Einstellungs-Karte ───────────────────────────────────── */
.settingsCard {
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
}

/* ── Icon-Toolbar ─────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 3px;
}

.toolCol {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.toolLabel {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8aaabf;
    white-space: nowrap;
}

.toolGroup {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolSep {
    width: 1px;
    align-self: stretch;
    background: var(--panel-border);
    margin: 0 4px;
    flex-shrink: 0;
}

.toolBtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: #3a6d9f;
    padding: 0;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
    flex-shrink: 0;
}

.toolBtn input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toolBtn:hover {
    background: rgba(15, 121, 208, 0.1);
    border-color: rgba(15, 121, 208, 0.22);
}

.toolBtn:has(input:checked) {
    background: rgba(15, 121, 208, 0.14);
    border-color: rgba(15, 121, 208, 0.4);
    color: #0a5fa8;
}

/* ── Slider-Zeile ─────────────────────────────────────────── */
.slidersRow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 14px;
}

.rangeControl {
    display: grid;
    gap: 2px;
    color: #24486c;
}

.rangeControl span {
    font-size: 0.76rem;
    font-weight: 700;
    color: #3a6d9f;
}

.rangeControl input[type="range"] {
    width: 100%;
}

.rangeControl strong {
    font-size: 0.76rem;
    color: #123c66;
}

#traceSummary {
    display: grid;
    gap: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 11px;
    background: #fff;
}

.summaryRow {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    font-size: 0.94rem;
}

.summaryLabel {
    color: var(--text-muted);
    font-weight: 800;
}

.summaryValue {
    color: var(--text-main);
    overflow-wrap: anywhere;
}



#traceTableWrap {
    overflow: auto;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: #fff;
    min-height: 0;
    flex: 1;
    height: 100%;
}

#traceTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.98rem;
}

#traceTable thead th {
    position: sticky;
    top: 0;
    background: #e9f3ff;
    color: #2e4e71;
    text-align: left;
    padding: 11px 10px;
    font-weight: 800;
    border-bottom: 1px solid #cbe0f3;
}

#traceTable tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(84, 112, 143, 0.16);
    color: var(--text-main);
    vertical-align: middle;
}

#traceTable tbody td.cell-hop {
    width: 62px;
    font-weight: 800;
    color: #2d537a;
}

#traceTable tbody td.cell-location {
    font-weight: 700;
}

.cell-location-main {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
    color: #2d537a;
    flex: 1 1 auto;
    text-align: left;
}

.cell-location-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
}

.cell-location-flag {
    font-size: 0.98rem;
    line-height: 1;
    flex: 0 0 auto;
}

.cell-location-provider {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 800;
    color: #c13a3a;
    letter-spacing: 0.01em;
    text-align: right;
    white-space: nowrap;
}

.cell-location-ip {
    margin-top: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4c7aa6;
    letter-spacing: 0.01em;
    text-align: right;
}

#traceTable tbody tr {
    cursor: pointer;
    transition: background 0.14s ease;
}

#traceTable tbody tr:hover {
    background: rgba(15, 121, 208, 0.05);
}

#traceTable tbody tr.active {
    background: var(--accent-soft);
}

.status-ok { color: var(--ok); font-weight: 800; }
.status-timeout { color: var(--warn); font-weight: 800; }
.status-pending { color: var(--text-muted); font-weight: 700; }

#loadingOverlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    justify-items: center;
    background: linear-gradient(160deg, rgba(6, 15, 31, 0.74) 0%, rgba(11, 33, 58, 0.68) 100%);
    backdrop-filter: blur(2px);
    z-index: 12;
}

#loadingOverlay.hidden {
    display: none;
}

.loaderRing {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.24);
    border-top-color: #62bcff;
    animation: spin 0.9s linear infinite;
}

.loaderTitle {
    color: #fff;
    font-size: 1.12rem;
    font-weight: 800;
}

.loaderText {
    color: rgba(235, 245, 255, 0.95);
    font-size: 0.95rem;
}

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

@media (max-width: 1080px) {
    #appShell {
        grid-template-columns: 1fr;
        grid-template-rows: 56vh 44vh;
    }

    #sidePanel {
        border-left: none;
        border-top: 1px solid rgba(15, 121, 208, 0.12);
        box-shadow: 0 -8px 30px rgba(7, 25, 47, 0.24);
    }
}
