* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: termina, sans-serif;
    color: #05070c;
}

#map {
    position: fixed;
    inset: 0;
    background: #05080e;
}

.topbar {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.leaflet-control-zoom {
    position: fixed;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.leaflet-control-home {
    width: 30px;
    height: 30px;
    border: 0;
    background: #fff;
    color: #05070c;
    font-size: 24px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
}

.brand,
.topbar-actions {
    pointer-events: auto;
}

.brand {
    padding: 12px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.brand-title {
    font-size: 18px;
    line-height: 1.15;
    font-weight: 700;
}

.brand-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: #68747e;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

.top-button,
.control-button,
.play-button,
.secondary-button {
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.96);
    color: #05070c;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    font: inherit;
}

.top-button {
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 600;
}

.top-button:hover,
.control-button:hover,
.play-button:hover,
.secondary-button:hover {
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
}

.panel {
    position: fixed;
    z-index: 1000;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.flight-panel {
    bottom: 128px;
    left: 16px;
    width: 255px;
    padding: 13px 15px;
}

.flight-progress {
    width: 100%;
    height: 3px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
}

.flight-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
}

.panel-kicker {
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #05070c;
}

.flight-title {
    font-size: 17px;
    font-weight: 700;
}

.flight-route {
    margin-top: 3px;
    font-size: 13px;
    font-weight: 600;
}

.flight-details {
    margin-top: 9px;
    color: #05070c;
    font-size: 12px;
    line-height: 1.55;
}

.secondary-button {
    margin-top: 11px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
}

.legend-panel {
    right: 16px;
    bottom: 128px;
    width: 185px;
    padding: 12px 14px;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    font-size: 12px;
}

.legend-dot,
.legend-airport {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.legend-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
}

.legend-dot.icelandair.active {
    background: #001a70;
}

.legend-dot.norlandair.active {
    background: #c00300;
}

.legend-dot:not(.active) {
    background: #d7dce2;
    color: transparent;
}

.legend-airport {
    background: #ea441e;
}

.controls {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}

.control-button {
    min-width: 46px;
    height: 34px;
    font-size: 11px;
    font-weight: 700;
}

.play-button {
    width: 42px;
    height: 42px;
    font-size: 16px;
    font-weight: 700;
}

.timeline-step {
    width: 42px;
    height: 42px;
    font-size: 20px;
    font-weight: 700;
}

.time-block {
    min-width: 0;
    flex: 1 1 auto;
    text-align: center;
}

.timeline-date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timeline-date {
    font-size: 14px;
    line-height: 1;
    font-weight: 400;
}

.timeline-time {
    font-family: anonymous-pro, monospace;
    font-size: 26px;
    line-height: 1;
    font-weight: 600;
}

.timeline-weekday {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
}

.day-arrow {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #05070c;
    font-size: 18px;
    line-height: 24px;
    cursor: pointer;
}

#time-slider {
    display: block;
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.speed-block {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 5px;
    font-size: 11px;
    font-weight: 700;
}

#speed {
    padding: 5px 7px;
    border: 1px solid #cbd2d8;
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.about-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 17, 23, 0.42);
}

.about-content {
    position: relative;
    width: min(540px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 25px 28px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.about-content h1 {
    margin: 0 0 13px;
    font-size: 25px;
}

.about-content p {
    margin: 0 0 13px;
    font-size: 13px;
    line-height: 1.6;
    color: #4f5b64;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 13px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #64707a;
}

.about-shortcuts {
    margin-top: 20px;
    border-top: 1px solid #e5e8ea;
}

.about-shortcuts div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e8ea;
    font-size: 12px;
}

.about-shortcuts span {
    color: #66727c;
}

.status {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2500;
    display: none;
    transform: translate(-50%, -50%);
    max-width: min(520px, calc(100vw - 40px));
    padding: 14px 18px;
    border-radius: 9px;
    background: rgba(20, 28, 35, 0.92);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.22);
}

@media (max-width: 700px) {
    .topbar {
        top: 8px;
        left: 8px;
        right: 8px;
    }

    .brand-title {
        font-size: 15px;
    }

    .flight-panel {
        left: 16px;
        bottom: 128px;
        width: 230px;
    }

    .legend-panel {
        display: none;
    }

    .controls {
        left: 8px;
        right: 8px;
        bottom: 8px;
        gap: 5px;
        padding: 7px;
    }

    .control-button {
        min-width: 39px;
    }

    .speed-block span {
        display: none;
    }
}
