
.navi-preview-panel {
    flex: none;
    min-height: 0;
    padding: 8px 16px 12px;
    border-top: 2px solid #94a3b8;
    background: #f8fafc;
}

.navi-preview-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 7px;
}

.navi-preview-heading h2 {
    margin: 0;
    font-size: 17px;
}

.navi-preview-heading span {
    color: #64748b;
    font-size: 11px;
}

.navi-device {
    width: min(100%, 220px);
    margin: 0 auto;
    padding: 10px;
    border: 3px solid #475569;
    border-radius: 18px;
    background: #111827;
    box-shadow:
        inset 0 0 0 2px #0f172a,
        0 8px 24px rgba(15,23,42,.24);
}

.navi-screen {
    aspect-ratio: 480 / 800;
    display: grid;
    grid-template-rows:
        8% 10% minmax(0,1fr) 16% 7%;
    overflow: hidden;
    border: 2px solid #020617;
    border-radius: 8px;
    background: #f8f9f7;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
}

.navi-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 4%;
    border-bottom: 1px solid #cbd5e1;
    font-size: clamp(8px, 2.5vw, 14px);
    font-weight: 800;
}

.navi-topbar-time {
    justify-self: end;
}

.navi-battery {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.navi-battery-icon {
    position: relative;
    width: 25px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.navi-battery-icon::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    bottom: 2px;
    width: 70%;
    background: currentColor;
}

.navi-battery-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 2px;
    width: 3px;
    height: 5px;
    border-radius: 0 1px 1px 0;
    background: currentColor;
}

.navi-area {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 2% 5%;
    border-bottom: 1px solid #cbd5e1;
    text-align: center;
}

.navi-area-text {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    font-size: clamp(11px, 3vw, 18px);
    font-weight: 900;
    line-height: 1.08;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.navi-direction-destination {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navi-main {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 5%;
}

.navi-direction-view {
    width: 100%;
    display: grid;
    place-items: center;
    gap: 2%;
    text-align: center;
}

.navi-main-arrow {
    display: grid;
    place-items: center;
    width: min(54%, 150px);
    max-height: 62%;
    line-height: 0;
}

.navi-main-arrow svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 100%;
}

.navi-main-arrow path {
    fill: currentColor;
}

.navi-direction-label {
    font-size: clamp(9px, 2.6vw, 15px);
    font-weight: 700;
}

.navi-direction-destination {
    max-width: 95%;
    font-size: clamp(13px, 4vw, 23px);
    font-weight: 900;
}

.navi-route-overview {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 8%;
    text-align: center;
}

.navi-route-column {
    min-width: 0;
}

.navi-route-column .navi-small-arrow {
    font-size: clamp(46px, 12vw, 82px);
    font-weight: 900;
    line-height: 1;
}

.navi-route-column strong {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(9px, 2.8vw, 16px);
}

.navi-route-column small {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: #475569;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(7px, 2vw, 11px);
}

.navi-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #cbd5e1;
}

.navi-value {
    display: grid;
    place-items: center;
    align-content: center;
    min-width: 0;
    padding: 2px 5px;
    text-align: center;
}

.navi-value:nth-child(odd) {
    border-right: 1px solid #cbd5e1;
}

.navi-value:nth-child(-n+2) {
    border-bottom: 1px solid #cbd5e1;
}

.navi-value strong {
    font-size: clamp(10px, 3vw, 17px);
}

.navi-value span {
    color: #475569;
    font-size: clamp(7px, 1.9vw, 10px);
}

.navi-quality-good {
    color: #16a34a;
}

.navi-footer-note {
    display: grid;
    place-items: center;
    padding: 0 3%;
    border-top: 1px solid #cbd5e1;
    color: #334155;
    text-align: center;
    font-size: clamp(6px, 1.7vw, 9px);
}

.navi-preview-empty {
    padding: 14px;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
}

.navi-preview-length-warning {
    margin: 8px auto 0;
    max-width: 220px;
    color: #b45309;
    font-size: 12px;
    line-height: 1.35;
}

.navi-preview-length-warning[hidden] {
    display: none;
}


/* Segmentvorschau zeigt keine Abbiegeauswahl. Diese folgt erst mit VA-Markern. */
.navi-route-overview {
    display: none !important;
}

@media (max-height: 780px) {
    .navi-device {
        width: min(100%, 185px);
        padding: 7px;
    }

    .navi-preview-heading h2 {
        font-size: 15px;
    }

    .navi-preview-heading span {
        font-size: 10px;
    }
}


/* neu_2.67: Auswahloptik beim Ziehen ohne Leaflet-Icon neu aufzubauen */
.junction-marker-dragging .junction-marker {
    box-shadow:
        0 0 0 4px rgba(245,158,11,.45),
        0 4px 12px rgba(15,23,42,.28);
}


/* neu_2.96: einheitlicher Displayrahmen für Start, Strecke und VA */
.navi-screen.navi-screen-compact {
    grid-template-rows: 38px 42px minmax(0,1fr) 25px;
}

.navi-screen-compact .navi-topbar-compact {
    box-sizing: border-box;
    min-height: 0;
    height: 38px;
    padding: 3px 8px;
    overflow: hidden;
    border-bottom: 1px solid #cbd5e1;
}

.navi-screen-compact .navi-area {
    box-sizing: border-box;
    min-height: 0;
    height: 42px;
    padding: 3px 8px;
}

.navi-screen-compact .navi-main {
    min-height: 0;
    overflow: hidden;
}

.navi-screen-compact .navi-status-footer {
    box-sizing: border-box;
    min-height: 0;
    height: 25px;
    padding: 2px 9px;
    overflow: hidden;
}

.navi-screen-compact .navi-status-item {
    gap: 4px;
    font-size: 11px;
}

.navi-screen-compact .navi-status-item > img {
    width: 25px;
    height: 17px;
}

.navi-screen-compact .navi-signal {
    width: 24px;
    height: 17px;
    gap: 2px;
}

.navi-screen-compact .navi-signal i {
    width: 6px;
}

.navi-screen-compact .navi-signal i:nth-child(1) {
    height: 5px;
}

.navi-screen-compact .navi-signal i:nth-child(2) {
    height: 10px;
}

.navi-screen-compact .navi-signal i:nth-child(3) {
    height: 16px;
}

.navi-preview-empty-screen {
    width: calc(100% - 20px);
    box-sizing: border-box;
    margin: auto;
    background: rgba(255,255,255,.75);
}


/* neu_2.97: 5-Zoll-Display, 800 × 480 Pixel, Querformat */
.navi-device {
    width: min(100%, 360px);
    padding: 8px;
    border-radius: 15px;
}

.navi-screen,
.navi-screen.navi-screen-compact {
    aspect-ratio: 800 / 480;
    grid-template-rows: 34px 36px minmax(0,1fr) 24px;
}

.navi-screen-compact .navi-topbar-compact {
    height: 34px;
}

.navi-screen-compact .navi-area {
    height: 36px;
}

.navi-screen-compact .navi-main {
    padding: 8px 12px;
}

.navi-screen-compact .navi-status-footer {
    height: 24px;
}

.navi-direction-view {
    grid-template-columns: 120px minmax(0,1fr);
    grid-template-rows: auto auto;
    gap: 2px 16px;
    text-align: left;
}

.navi-main-arrow {
    grid-row: 1 / span 2;
    width: 84px;
    max-height: 130px;
}

.navi-direction-label,
.navi-direction-destination {
    justify-self: start;
    max-width: 100%;
}

.navi-direction-destination {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 24px;
    line-height: 1.08;
}

@media (max-height: 780px) {
    .navi-device {
        width: min(100%, 340px);
        padding: 7px;
    }
}
