html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    font-family: Arial, sans-serif;
}

[hidden] {
    display: none !important;
}

.web-auth-shell {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: #1e1e1e;
    color: white;
}

.web-auth-panel {
    width: min(360px, calc(100% - 32px));
    padding: 28px;
    box-sizing: border-box;
    border: 1px solid #555;
    border-radius: 6px;
    background: #252526;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.web-auth-panel h1 {
    margin: 0 0 22px;
}

.web-auth-panel form,
.web-auth-panel label {
    display: grid;
    gap: 8px;
}

.web-auth-panel input,
.web-auth-panel button {
    padding: 9px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #333;
    color: white;
}

.web-auth-panel button {
    margin-top: 12px;
    background: #3b78b8;
    border-color: #5c9cdd;
    cursor: pointer;
}

.web-auth-error {
    margin-bottom: 0;
    color: #ff8a80;
}

#app {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

#sidebar {
    width: 280px;

    background: #252526;
    color: white;

    border-right: 1px solid #111;

    display: flex;
    flex-direction: column;
    flex-shrink: 0;

    transition: width 0.2s ease;
}

#sidebar.collapsed {
    width: 48px;
}

.sidebar-header {

    padding: 16px;

    font-size: 22px;

    font-weight: bold;

    border-bottom: 1px solid #444;

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

}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.web-logout-button {
    padding: 5px 7px;
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
}

.sidebar-toggle {
    width: 26px;
    height: 26px;
    padding: 0;

    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;

    font-size: 22px;
    line-height: 20px;
    cursor: pointer;
}

#sidebar.collapsed .sidebar-header {
    padding: 16px 10px;
    justify-content: center;
}

#sidebar.collapsed .sidebar-header > span {
    display: none;
}

#sidebar.collapsed .web-logout-button {
    display: none;
}

#sidebar-content {

    padding: 16px;

    overflow-y: auto;

    flex: 1;

    transition: opacity 0.15s ease;

}

#sidebar.collapsed #sidebar-content {
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

#sidebar-content h2 {

    margin-top: 0;

    font-size: 16px;

    text-transform: uppercase;

    color: #bfbfbf;

}

.sidebar-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-toggle {
    background: transparent;
    color: #bfbfbf;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    line-height: 18px;
}

.sidebar-section-collapsed {
    display: none;
}

.incident-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 12px;
}

.incident-row:hover,
.incident-row.selected {
    background: #333;
}

.incident-row input {
    margin-top: 2px;
}

.sidebar-group-heading {
    margin-top: 10px;
    padding: 5px 0 3px;
    color: #e5e5e5;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.sidebar-subgroup-heading {
    padding: 4px 0 2px 8px;
    color: #999;
    font-size: 11px;
}

.future-item {
    color: #777;
}

.future-item .node-name {
    color: #777;
}

.future-item .node-indicator {
    opacity: 0.35;
}

.future-label {
    margin-left: auto;
    color: #777;
    font-size: 10px;
    white-space: nowrap;
}

.appearance-countdown {
    display: block;
    margin-top: 3px;
    color: #ff5c57;
    font-weight: bold;
}

#node-search {

    width: 100%;

    box-sizing: border-box;

    margin-bottom: 12px;

    padding: 8px;

    border: 1px solid #555;

    border-radius: 4px;

    background: #333;

    color: white;

}

#node-search::placeholder {

    color: #999;

}

#map {

    flex: 1;

}

.node-row {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 6px 0;

}

.node-indicator {

    width: 12px;

    height: 12px;

    border-radius: 50%;

    background: #3aa3ff;

    border: 2px solid black;

    flex-shrink: 0;

}

.node-name {

    color: white;

    font-size: 14px;

}
.callsign-label {

    background: rgba(0, 0, 0, 0.70);

    color: white;

    border: none;

    border-radius: 4px;

    box-shadow: none;

    padding: 2px 6px;

    font-size: 12px;

    font-weight: 600;

}

.callsign-label::before {

    display: none;

}
.node-row {

    cursor: pointer;

    border-radius: 4px;

}

.node-row:hover {

    background: #333;

}

.node-row.selected {

    background: #0a4b8c;

}

.trail-toggle {

    display: flex;

    align-items: center;

    gap: 6px;

    font-size: 12px;

    color: #bfbfbf;

    margin-bottom: 4px;

}

.node-summary {

    display: flex;

    align-items: center;

    gap: 10px;

}

.node-summary input {
    margin: 0;
    flex-shrink: 0;
}

.node-summary input:disabled {
    opacity: 0.35;
}

.trail-label {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: 6px;

    font-size: 12px;

}

.trail-select {

    width: 110px;

}

#node-inspector {

    font-size: 14px;

    line-height: 1.6;

}

.inspector-field {

    margin-bottom: 10px;

}

.inspector-label {

    font-size: 11px;

    font-weight: bold;

    color: #777;

    text-transform: uppercase;

}

.inspector-value {

    font-size: 14px;

}

hr {

    margin: 20px 0;

    border: none;

    border-top: 1px solid #444;

}

.playback-time {

    font-size: 13px;
    margin-bottom: 8px;

}

.playback-slider {

    width: 100%;
    margin: 0 0 10px;

}

.playback-bounds {

    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;

}

.playback-bounds label {

    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 6px;

    font-size: 12px;
    color: #bfbfbf;

}

.playback-bounds input {

    min-width: 0;
    box-sizing: border-box;
    padding: 6px;

    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;

}

.playback-actions {

    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;

}

.playback-button,
.playback-speed select {

    background: #3b78b8;
    color: white;
    border: 1px solid #5c9cdd;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;

}

.playback-button:disabled {

    opacity: 0.5;
    cursor: not-allowed;

}

.playback-speed {

    font-size: 12px;
    color: #bfbfbf;

}

.playback-scale {

    font-size: 12px;
    color: #bfbfbf;

}

.playback-speed select {

    margin-left: 4px;

}

.playback-scale select {

    margin-left: 4px;
    background: #3b78b8;
    color: white;
    border: 1px solid #5c9cdd;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;

}

.playback-scale option:disabled {

    color: #777;

}

.playback-help,
.playback-error {

    margin-top: 6px;
    font-size: 12px;
    color: #bfbfbf;

}

#playback-bar {
    position: absolute;
    z-index: 1000;
    left: 294px;
    right: 14px;
    bottom: 14px;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;

    padding: 10px;
    box-sizing: border-box;

    background: #252526;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);

    transition: left 0.2s ease;
}

#sidebar.collapsed ~ #playback-bar {
    left: 62px;
}

.playback-bar-status {
    grid-column: 1 / -1;
    color: #bfbfbf;
    font-size: 12px;
}

.playback-bar-button,
.playback-live-button,
.playback-move-button {
    background: #333;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 6px 9px;
    cursor: pointer;
}

.playback-bar-button {
    width: 38px;
    height: 34px;
    font-size: 16px;
}

.playback-live-button {
    height: 34px;
    padding-inline: 12px;
    background: #3b78b8;
    border-color: #5c9cdd;
}

.playback-bar-button:disabled,
.playback-live-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.playback-timeline-wrap {
    min-width: 0;
}

.playback-timeline-labels,
.playback-timeline-meta,
.playback-window-dates {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #bfbfbf;
    font-size: 11px;
}

.playback-timeline-labels {
    margin-bottom: 5px;
}

.playback-timeline-meta {
    margin-top: 5px;
}

.playback-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.playback-bottom-controls .playback-speed,
.playback-bottom-controls .playback-scale {
    white-space: nowrap;
}

.playback-window-dates {
    margin-top: 4px;
}

.playback-window-dates strong {
    color: white;
    font-weight: 600;
}

.playback-timeline {
    --range-start: 0%;
    --range-width: 100%;
    --playhead: 100%;
    --hover: 50%;

    position: relative;
    height: 30px;
    overflow: visible;

    border: 1px solid #777;
    background: repeating-linear-gradient(
        90deg,
        #484848 0,
        #484848 1px,
        #3d3d3d 1px,
        #3d3d3d 10%
    );
    cursor: pointer;
    touch-action: none;
}

.playback-unavailable,
.playback-loaded-range,
.playback-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
}

.playback-unavailable {
    background: repeating-linear-gradient(
        135deg,
        rgba(18, 18, 18, 0.72) 0,
        rgba(18, 18, 18, 0.72) 5px,
        rgba(42, 42, 42, 0.72) 5px,
        rgba(42, 42, 42, 0.72) 10px
    );
}

.playback-unavailable-before {
    left: 0;
    width: var(--range-start);
}

.playback-unavailable-after {
    left: calc(var(--range-start) + var(--range-width));
    right: 0;
}

.playback-loaded-range {
    left: var(--range-start);
    width: var(--range-width);
    top: 2px;
    bottom: 2px;
    box-sizing: border-box;
    border: 2px solid #5c9cdd;
    background: rgba(59, 120, 184, 0.38);
    pointer-events: none;
}

.playback-playhead {
    left: var(--playhead);
    width: 2px;
    background: #ff8a80;
    pointer-events: none;
}

.playback-playhead::before {
    content: "";
    position: absolute;
    top: 0;
    left: -4px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #ff8a80;
}

.playback-hover-time {
    position: absolute;
    z-index: 2;
    left: var(--hover);
    bottom: calc(100% + 7px);
    transform: translateX(-50%);

    padding: 4px 6px;
    border: 1px solid #777;
    border-radius: 3px;
    background: #252526;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);

    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
}

.playback-hover-time[hidden] {
    display: none;
}

.playback-move-button {
    padding: 3px 7px;
    font-size: 11px;
}

.playback-move-button[aria-pressed="true"] {
    background: #3b78b8;
    border-color: #5c9cdd;
}

.playback-move-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    #playback-bar {
        left: 290px;
        right: 8px;
        bottom: 8px;
        gap: 6px;
        padding: 7px;
    }

    #sidebar.collapsed ~ #playback-bar {
        left: 56px;
    }

    .playback-timeline-labels span:nth-child(2) {
        display: none;
    }

    .playback-window-dates {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .playback-timeline-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .playback-bottom-controls {
        justify-content: flex-start;
    }

    .playback-live-button {
        padding-inline: 8px;
    }
}

.playback-error {

    color: #ff8a80;

}

.settings-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #bfbfbf;
}

.settings-select {
    width: 100%;
    box-sizing: border-box;
    padding: 7px;

    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    margin-bottom: 12px;
}

.settings-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px;
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    margin-bottom: 12px;
}

.node-color-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-color-control input {
    width: 38px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.node-color-control button {
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
}
