html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #1f1f1f;
    font-family: 'Segoe UI', sans-serif;
}

#lt-header {
    height: 60px;
    width: 100%;
    background: #1f1f1f;
    border-bottom: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    padding: 0 20px;
    color: #fff;
}

.header-left {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.header-home-link {
    display: inline-block;
    line-height: 0;
}

.header-home-link:hover {
    opacity: 0.85;
}

.header-logo {
    height: 45px;
    width: auto;
    display: block;
}

.header-center {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-actions {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.header-btn {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.header-btn:hover {
    background: #444;
}

#lt-app {
    display: flex;
    width: 100%;
    height: calc(100vh - 60px);
    box-sizing: border-box;
}

.side-panel {
    width: 300px;
    background: #1f1f1f;
    color: #fff;
    border-color: #333;
    border-style: solid;
    border-width: 0;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

#left-panel {
    border-right-width: 2px;
}

#left-panel[hidden] {
    display: none !important;
}

#left-panel-declared-row[hidden] {
    display: none !important;
}

#right-panel {
    border-left-width: 2px;
}

.briefing-utc-clock {
    margin: 0 0 18px;
    padding: 0 0 16px;
    text-align: center;
    border-bottom: 1px solid #3a3a3a;
}

.briefing-utc-clock-caption {
    margin: 0 0 8px;
    color: #bfbfbf;
    font-size: 13px;
    letter-spacing: 0.04em;
}

.briefing-utc-clock-time {
    margin: 0;
    color: #ffffff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.panel-title {
    margin: 0 0 12px;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #bfbfbf;
}

.panel-subtitle {
    margin: 20px 0 10px;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #bfbfbf;
}

.panel-hint {
    margin: 0 0 8px;
    font-size: 14px;
    color: #fff;
}

.panel-callsign {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
}

.pilot-stats {
    margin: 16px 0 0;
    padding: 0;
}

.pilot-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 10px;
    font-size: 14px;
}

.pilot-stat-row dt {
    margin: 0;
    color: #bfbfbf;
    font-weight: 400;
}

.pilot-stat-row dd {
    margin: 0;
    color: #fff;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.pilot-stat-row dd.pilot-stat-out-of-band {
    color: #e53935;
}

.pilot-stat-row dd.pilot-stat-in-band {
    color: #4caf50;
}

.form-section {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #bfbfbf;
}

.form-select {
    width: 100%;
    padding: 10px;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.route-picker-trigger {
    width: 100%;
    min-height: 46px;
    padding: 11px 36px 11px 12px;
    background: #2a2a2a;
    color: #f2f2f2;
    border: 1px solid #555;
    border-radius: 6px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 15px;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.route-picker-trigger:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.route-picker-trigger:not(:disabled):hover {
    border-color: #777;
    background: #303030;
}

.route-picker-trigger.is-open:not(:disabled) {
    border-color: #9ec5ff;
}

.route-picker-trigger::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bfbfbf;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}

.route-picker-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.route-picker-trigger:disabled::after {
    opacity: 0.45;
}

.route-picker-trigger .route-picker-name,
.route-picker-trigger .discipline-badge,
.route-picker-trigger .live-badge {
    pointer-events: none;
}

.route-picker-name {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-picker-list {
    margin-top: 6px;
    background: #252525;
    border: 1px solid #555;
    border-radius: 6px;
    overflow: hidden;
}

.route-picker-option {
    width: 100%;
    padding: 11px 12px;
    background: transparent;
    color: #f2f2f2;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 15px;
    text-align: left;
    font-family: inherit;
}

.route-picker-option:hover {
    background: #333;
}

.discipline-badge {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.discipline-basic-200 {
    background: #1f4d2b;
    color: #bff0cc;
}

.discipline-basic-3d {
    background: #163b73;
    color: #c8ddff;
}

.discipline-precision-cup {
    background: #7a6618;
    color: #fff8dc;
}

.discipline-precision-pro {
    background: #6b1f1f;
    color: #ffd0d0;
}

#map-column {
    flex: 1;
    background: #ddd;
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

#map .leaflet-container {
    width: 100%;
    height: 100%;
    background: #ddd;
}

.ranking-wrap {
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ranking-table th,
.ranking-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.ranking-table th {
    background: #2a2a2a;
    color: #bfbfbf;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.ranking-table tbody tr:hover {
    background: #2a2a2a;
}

#flying-now tbody tr[data-flight-id] {
    cursor: pointer;
}

.ranking-table tbody tr.is-selected {
    background: #333;
}

.empty-cell {
    color: #888;
    text-align: center;
    font-style: italic;
}

.current-score {
    margin-top: 16px;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.current-score-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #bfbfbf;
}

.current-score-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.panel-hint-muted {
    color: #9ec5ff;
    font-size: 13px;
}

.live-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 4px;
    background: #1e3a28;
    border: 1px solid #2f6b45;
    color: #bff0cc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.route-picker-option .route-picker-name,
.route-picker-trigger .route-picker-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aircraft-marker-wrap {
    background: transparent;
    border: none;
}

.aircraft-marker-svg {
    transform-origin: 50% 50%;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.65));
}

.aircraft-marker-svg.is-selected {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

.aircraft-marker-svg svg {
    display: block;
}

.aircraft-label {
    background: rgba(26, 45, 74, 0.92);
    color: #9ec5ff;
    border: 1px solid #3d5a8a;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.flight-trail-line {
    stroke: #4a8fd4;
}

.leaflet-tooltip.route-point-label {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    padding: 0;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff;
}

.leaflet-tooltip.route-point-label::before {
    display: none;
}

@media (max-width: 900px) {
    #lt-app {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        max-height: 35vh;
        border-width: 0;
        border-top-width: 2px;
    }

    #left-panel {
        border-right-width: 0;
        order: 3;
    }

    #map-column {
        min-height: 45vh;
        order: 1;
    }

    #right-panel {
        order: 2;
        border-left-width: 0;
    }

    .header-actions {
        position: static;
        transform: none;
        margin-left: auto;
    }

    #lt-header {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding-top: 10px;
        padding-bottom: 10px;
        gap: 8px;
    }

    .header-left {
        position: static;
        transform: none;
    }

    .header-center {
        width: 100%;
        text-align: center;
        order: 3;
    }
}
