/* ==========================================================================
   1. BASIS / CLASSIC DESIGN (Modern & Clean)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600&family=Oleo+Script:wght@400;700&display=swap');

:root {
    --blue: #4da6ff;
    --bg-dark: #080808;
    --card: #1e1e1e;
    --text: #e0e0e0;
    --warn: #ffcc00;
    --red: #ff4444;
    --green: #44ff44;
    --navlog-text: #e0e0e0;
    --navlog-heading: #4da6ff;
    --navlog-data: #ffcc00;
    --navlog-freq: #ffcc00;
    --navlog-border: #444;
    --plane-color: #E63946;
    --plane-size: 40px;
}

html {
    overflow-x: hidden;
    overflow-y: scroll; /* Zwingt den Scrollbalken zur Sichtbarkeit (Klassischer Fix) */
    scrollbar-gutter: stable; /* Moderner Fix für neue Browser */
    overscroll-behavior-x: none;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    margin: 0;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    background-repeat: no-repeat;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    position: relative;
    background-color: rgba(30, 30, 30, 0.90);
    padding: 30px 20px 20px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(77, 166, 255, 0.15);
    max-width: 480px;
    width: 100%;
    border: 1px solid #333;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    transition: all 0.3s;
    /* Zwingt den Flex-Container dazu, niemals durch Textinhalte in die Breite zu wachsen */
    min-width: 0;
}

body.fullscreen-active .container {
    backdrop-filter: none !important;
    transform: none !important;
}

h1 {
    font-size: 20px;
    text-align: center;
    color: var(--blue);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    border-bottom: 2px solid var(--blue);
    padding-bottom: 10px;
    transition: all 0.3s;
}

.help-icon {
    display: inline-block;
    font-size: 0.6em;
    vertical-align: top;
    margin-left: 8px;
    color: inherit;
    text-decoration: none;
    opacity: 0.9;
    border: 1px solid currentColor;
    border-radius: 50%;
    width: 1.2em;
    height: 1.2em;
    line-height: 1.2em;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.help-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

#searchIndicator {
    font-size: 12px;
    color: var(--green);
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
    min-height: 18px;
    line-height: 1.4;
    opacity: 1.0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

label {
    font-size: 11px;
    color: #d1d1d1;
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: bold;
    opacity: 1.0;
}

input,
select {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: white;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.preset-row {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
    margin-top: 5px;
}

.btn-preset {
    flex: 1;
    padding: 8px 4px;
    font-size: 11px;
    background: #333;
    color: var(--blue);
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.2s;
}

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

.slider-container {
    margin-bottom: 10px;
    background: #252525;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    transition: all 0.3s;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.slider-label {
    margin-bottom: 0;
    display: inline-block;
}

input[type=range] {
    width: 100%;
    appearance: none;
    height: 5px;
    background: #444;
    border-radius: 5px;
    margin: 12px 0;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
    border: 2px solid #2a2a2a;
}

.btn-main {
    width: 100%;
    padding: 16px;
    background-color: var(--blue);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
}

.btn-main:disabled {
    background-color: #333 !important;
    color: #888 !important;
    cursor: wait !important;
    border: 1px solid #555;
}

#map {
    height: 200px;
    width: 100%;
    border-radius: 12px;
    margin-top: 15px;
    border: 1px solid #444;
    display: none;
    background: #f4f4f4;
    transition: filter 0.3s;
}

.map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    filter: none !important;
}

.custom-pin {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    border: none !important;
}

.pin-hitbox {
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    cursor: pointer;
}

.pin-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    border-radius: 50%;
    border: 2px solid #222;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
    flex-shrink: 0;
}

.briefing {
    margin-top: 15px;
    padding: 15px;
    background-color: #252525;
    border-radius: 10px;
    border: 1px solid #444;
    display: none;
    transition: all 0.3s;
    overflow-x: hidden;
    word-wrap: break-word;
}

.aero-info-box {
    background: #1e252b;
    padding: 14px 12px;
    border-radius: 8px;
    border-left: 4px solid var(--warn);
    margin-bottom: 12px;
    transition: all 0.3s;
}

.box-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 15px;
}

.copy-box {
    cursor: pointer;
    transition: color 0.2s;
    display: inline-block;
    background: #333;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-size: 13px;
}

.copy-box:hover {
    color: var(--green);
    background: #444;
}

.copy-box::after {
    content: ' 📋';
    font-size: 11px;
    opacity: 0.5;
}

.route-label {
    font-size: 12px;
    color: #b0b0b0;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: bold;
}

.route-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    line-height: 1.4;
}

.rwy-info {
    font-size: 14px;
    color: #c0c0c0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #444;
}

.btn-log {
    background: var(--green);
    color: #000;
    grid-column: span 2;
    margin-top: 10px;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
    font-size: 14px;
}

.btn-log:hover {
    background: #33cc33;
}

.logbook {
    margin-top: 25px;
    border-top: 2px solid #333;
    padding-top: 15px;
    width: 100%;
    transition: all 0.3s;
}

.log-entry {
    background: #1a1a1a;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--blue);
    font-size: 12px;
}

.version-info {
    text-align: center;
    font-size: 11px;
    color: #777;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.screw {
    display: none;
}

/* ==========================================================================
   2. MECHANISCHER KIPPSCHALTER (TOGGLE)
   ========================================================================== */
.theme-switch-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px dashed #444;
}

.switch-label {
    font-size: 10px;
    font-weight: bold;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 26px;
    height: 40px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #111;
    border-radius: 4px;
    border: 2px solid #333;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.8);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 12px;
    left: 5px;
    bottom: 2px;
    background: linear-gradient(to right, #777, #fff, #777);
    border-radius: 3px;
    border-bottom: 2px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.8);
    transition: .3s;
}

input:checked+.slider:before {
    transform: translateY(-14px);
    border-bottom: none;
    border-top: 2px solid #333;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   3. 60er JAHRE ANALOG COCKPIT DESIGN
   ========================================================================== */
body.theme-retro {
    --piper-white: #f4f4f4;
    --piper-yellow: #f2c12e;
    --piper-red: #d93829;
    --piper-bg: #222428;
    --navlog-text: #111;
    --navlog-heading: #0b1f65;
    --navlog-data: #d93829;
    --navlog-freq: #0b1f65;
    --navlog-border: #888;
    font-family: 'Arial', sans-serif;
}

body.theme-retro .container {
    --p-bg: #6e737a;
    --p-bt: #9aa0a6;
    --p-bl: #8c9298;
    --p-bb: #2a2d30;
    --p-br: #2a2d30;
    background-color: var(--p-bg);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 15%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.25) 100%),
        repeating-linear-gradient(85deg, transparent, transparent 2px, rgba(255, 255, 255, 0.015) 2px, rgba(255, 255, 255, 0.015) 4px),
        repeating-linear-gradient(-85deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    padding: 45px 25px 25px 25px;
    border-radius: 24px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-top: 3px solid var(--p-bt);
    border-left: 3px solid var(--p-bl);
    border-bottom: 4px solid var(--p-bb);
    border-right: 4px solid var(--p-br);
    box-shadow: inset 0 4px 6px rgba(255, 255, 255, 0.2), inset 0 -6px 12px rgba(0, 0, 0, 0.3), 0 20px 50px rgba(0, 0, 0, 0.9);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

body.theme-retro .container.panel-med {
    --p-bg: #6e737a;
    --p-bt: #9aa0a6;
    --p-bl: #8c9298;
    --p-bb: #2a2d30;
    --p-br: #2a2d30;
}

body.theme-retro .container.panel-creme {
    --p-bg: #d1c1a1;
    --p-bt: #ebdcc0;
    --p-bl: #dbcbac;
    --p-bb: #7a6e54;
    --p-br: #7a6e54;
}

body.theme-retro .container.panel-light {
    --p-bg: #a1abb3;
    --p-bt: #cbd3d9;
    --p-bl: #b8c1c8;
    --p-bb: #555b61;
    --p-br: #555b61;
}

body.theme-retro .container.panel-dark {
    --p-bg: #3c4045;
    --p-bt: #5d636b;
    --p-bl: #4f545a;
    --p-bb: #111214;
    --p-br: #111214;
}

.glareshield {
    display: none;
}

body.theme-retro .glareshield {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background-color: #222;
    background-image: radial-gradient(circle at 50% -20%, #444 0%, transparent 70%), repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(0, 0, 0, 0.2) 2px, rgba(0, 0, 0, 0.2) 4px);
    border-radius: 20px 20px 0 0;
    border-bottom: 3px solid #0a0a0a;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.7), inset 0 2px 3px rgba(255, 255, 255, 0.1);
    z-index: 15;
}

body.theme-retro .screw {
    display: block;
    position: absolute;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #c4c4c4, #555);
    border-radius: 50%;
    box-shadow: inset 0 0 4px #000, 0 2px 4px rgba(0, 0, 0, 0.5), 0 -1px 1px rgba(255, 255, 255, 0.4);
}

body.theme-retro .screw::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 1px;
    width: 12px;
    height: 2px;
    background: #222;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.theme-retro .top-left {
    top: 38px;
    left: 16px;
    transform: rotate(45deg);
}

body.theme-retro .top-right {
    top: 38px;
    right: 16px;
    transform: rotate(15deg);
}

body.theme-retro .bottom-left {
    bottom: 16px;
    left: 16px;
    transform: rotate(-20deg);
}

body.theme-retro .bottom-right {
    bottom: 16px;
    right: 16px;
    transform: rotate(70deg);
}

body.theme-retro h1 {
    font-family: 'Oleo Script', cursive;
    font-size: 38px;
    color: #f4f4f4;
    text-shadow: -1px -1px 0 #aaa, 1px 1px 0 #555, 2px 2px 0 #444, 3px 3px 5px rgba(0, 0, 0, 0.8);
    font-weight: 400;
    letter-spacing: 1px;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 15px;
    margin-top: 25px;
    transform: rotate(-2deg);
}

body.theme-retro #searchIndicator {
    color: var(--piper-yellow);
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.9);
}

body.theme-retro h3.theme-title-text {
    color: var(--piper-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.9);
}

body.theme-retro label {
    background: #111;
    color: #ddd;
    border: 1px solid #000;
    padding: 3px 6px;
    border-radius: 2px;
    margin-bottom: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    letter-spacing: 1.5px;
    display: inline-block;
    font-family: monospace;
    font-size: 11px;
}

body.theme-retro input,
body.theme-retro select {
    background-color: #f0eada;
    border: 1px solid #c2bba8;
    border-right: none;
    color: #111;
    text-shadow: none;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 14px;
    border-radius: 2px 0 0 2px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='40' viewBox='0 0 15 40'%3E%3Cpath fill='%23f0eada' d='M0 0h15L12 4l3 5-4 3 4 6-3 4 3 7-4 5 3 6H0z'/%3E%3Cpath fill='none' stroke='%23c2bba8' stroke-width='1.5' stroke-linecap='round' d='M15 0L12 4l3 5-4 3 4 6-3 4 3 7-4 5 3 6' opacity='0.7'/%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-position: right top;
    background-size: auto 100%;
}

body.theme-retro #startLoc {
    transform: rotate(-1.5deg);
    border-left: 6px solid #d93829;
}

body.theme-retro #destLoc {
    transform: rotate(1deg);
    border-left: 6px solid #d93829;
}

body.theme-retro #targetType {
    transform: rotate(-0.5deg);
    border-left: 6px solid #4da6ff;
}

body.theme-retro #distRange {
    transform: rotate(1.5deg);
    border-left: 6px solid #4da6ff;
}

body.theme-retro #regionFilter {
    transform: rotate(-1deg);
    border-left: 6px solid #f2c12e;
}

body.theme-retro #dirPref {
    transform: rotate(0.5deg);
    border-left: 6px solid #f2c12e;
}

body.theme-retro #maxSeats {
    transform: rotate(-1.5deg);
    border-left: 6px solid #f2c12e;
}

body.theme-retro input:focus,
body.theme-retro select:focus {
    outline: none;
    transform: scale(1.02) rotate(0deg) !important;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

body.theme-retro .btn-preset {
    background: linear-gradient(to bottom, #d4d4d4, #888);
    color: #111;
    border: 2px solid #222;
    border-bottom: 4px solid #111;
    border-right: 3px solid #111;
    font-family: 'Arial', sans-serif;
    font-weight: 900;
    border-radius: 4px;
}

body.theme-retro .btn-preset:active {
    transform: translate(2px, 2px);
    border-bottom: 2px solid #111;
    border-right: 1px solid #111;
}

body.theme-retro .slider-container {
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 15px;
}

body.theme-retro input[type=range] {
    height: 8px;
    background: #111;
    border: 2px inset #444;
    border-radius: 10px;
    transform: none;
    box-shadow: none;
}

body.theme-retro input[type=range]::-webkit-slider-thumb {
    height: 24px;
    width: 12px;
    border-radius: 2px;
    background: linear-gradient(to right, #ccc, #fff, #ccc);
    border: 1px solid #000;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.8);
}

body.theme-retro .btn-main {
    background: linear-gradient(to bottom, #d93829, #8a1a12);
    color: #fff;
    border: 2px solid #222;
    border-bottom: 4px solid #111;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    font-family: 'Oleo Script', cursive;
    text-shadow: 1px 1px 2px #000;
    letter-spacing: 1px;
}
body.theme-retro .btn-main:hover {
    background: linear-gradient(to bottom, #ff4d3d, #a62017);
}
body.theme-retro .btn-main:active, body.theme-retro .btn-main.active {
    background: linear-gradient(to bottom, #b82c1f, #6e150f);
    transform: translateY(2px);
    border-bottom: 2px solid #111;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

body.theme-retro #map {
    border: 4px solid #e0d8c8;
    border-radius: 4px;
    background: #e0d8c8;
    filter: sepia(0.2) brightness(1.05) contrast(0.95);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

body.theme-retro .briefing {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 5px;
}

body.theme-retro .flightplan-container {
    position: relative;
    z-index: 1;
}

body.theme-retro .flightplan-container::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    background-color: #e4e4e4;
    background-image: linear-gradient(transparent 15%, #2a2d34 16%, transparent 18%), linear-gradient(transparent 42%, #2a2d34 44%, #2a2d34 46%, transparent 48%), linear-gradient(transparent 78%, #2a2d34 79%, transparent 81%);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    z-index: 0;
}

body.theme-retro .aero-info-box {
    background: #2b2d31;
    border-radius: 12px;
    border: 4px solid #5a5f6a;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

body.theme-retro .aero-info-box::before,
body.theme-retro .aero-info-box::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #777;
    border-radius: 50%;
    box-shadow: inset 0 0 2px #000;
}

body.theme-retro .aero-info-box::before {
    top: 5px;
    left: 5px;
}

body.theme-retro .aero-info-box::after {
    bottom: 5px;
    right: 5px;
}

body.theme-retro .route-data {
    color: var(--piper-white);
    text-shadow: none;
    font-size: 18px;
}

body.theme-retro .copy-box {
    background: #222;
    border: 2px inset #444;
    color: #fff;
}

body.theme-retro .copy-box:hover {
    color: var(--piper-yellow);
}

body.theme-retro .btn-log {
    background: linear-gradient(to bottom, #f2c12e, #a88212);
    color: #111;
    border: 2px solid #222;
    border-bottom: 4px solid #111;
    border-right: 3px solid #111;
    font-family: 'Arial', sans-serif;
    font-weight: 900;
}

body.theme-retro .btn-log:active {
    transform: translate(2px, 2px);
    border-bottom: 2px solid #111;
    border-right: 2px solid #111;
}

body.theme-retro .theme-switch-wrapper {
    border-top: 2px dashed #444;
}

body.theme-retro .logbook {
    border-top: 3px solid #444;
}

body.theme-retro .log-entry {
    background: #1a1c1e;
    border-left: 4px solid var(--piper-yellow);
    border-radius: 2px;
    font-family: 'Courier New', monospace;
}

/* ==========================================================================
   4. MECHANISCHE TROMMELZÄHLWERKE
   ========================================================================== */
.drum-readout-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.theme-retro .drum-window {
    display: inline-flex;
    gap: 1px;
    background-color: #111;
    border-radius: 3px;
    height: 22px;
    overflow: hidden;
    position: relative;
    padding: 0 2px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

body.theme-retro .drum-strip {
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform;
    background-color: transparent;
}

body.theme-retro .drum-digit {
    height: 22px;
    line-height: 22px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 17px;
    color: var(--piper-white);
    text-align: center;
    width: 12px;
    background-color: transparent;
}

body.theme-retro .highlight .drum-digit,
body.theme-retro .theme-green-text .drum-digit {
    color: var(--piper-yellow);
}

/* ==========================================================================
   5. ACTION BAR & ANALOGES S-METER
   ========================================================================== */
.action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

.action-bar .btn-main {
    flex-grow: 1;
    margin-top: 0 !important;
}

.analog-meter {
    display: none;
    width: 65px;
    height: 45px;
    background: #111;
    border: 1px solid #444;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.meter-face {
    position: absolute;
    inset: 4px;
    border-top: 2px dashed #555;
    border-radius: 50% 50% 0 0;
}

.meter-needle {
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 2px;
    height: 40px;
    background: var(--blue);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-45deg);
    transition: transform 0.1s;
}

.meter-led {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #222;
}

.meter-led.led-green {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.meter-led.led-blue {
    background: #4da6ff;
    box-shadow: 0 0 6px #4da6ff;
}

.meter-led.led-red {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}

.meter-label {
    display: none;
}

/* Dual-Color LED für Gemini 3.0 Flash */
.meter-led.led-flash3 {
    background: linear-gradient(135deg, #4da6ff 50%, var(--green) 50%);
    box-shadow: -2px 0 6px #4da6ff, 2px 0 6px var(--green);
}

body.theme-retro .meter-led.led-flash3 {
    background: linear-gradient(135deg, #2b8cff 50%, #00ff41 50%);
    box-shadow: -3px 0 8px #2b8cff, 3px 0 8px #00ff41, inset 0 1px 2px #fff;
    border-color: #fff;
}

body.theme-retro .analog-meter {
    display: block;
    width: 75px;
    height: 50px;
    background: #1e1f22;
    border: 3px solid #4a4e59;
    border-radius: 6px;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.9), 0 4px 6px rgba(0, 0, 0, 0.5);
}

body.theme-retro .meter-face {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 3px;
    background-color: #f0eada;
    border-radius: 2px 2px 0 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: none;
}

body.theme-retro .meter-scale {
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 90%;
    border-radius: 50% 50% 0 0;
    border-top: 2px solid #555;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
}

body.theme-retro .meter-needle {
    background: #d93829;
    height: 38px;
    bottom: 2px;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: transform 0.12s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 2;
}

body.theme-retro .analog-meter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 6px;
    background: #222;
    border-radius: 50% 50% 0 0;
    border: 1px solid #000;
    z-index: 3;
}

body.theme-retro .meter-led {
    width: 6px;
    height: 6px;
    top: 6px;
    right: 8px;
    background: #002200;
    border: 1px solid #000;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
    z-index: 3;
}

body.theme-retro .meter-led.led-green {
    background: #00ff41;
    box-shadow: 0 0 6px #00ff41, inset 0 1px 2px #fff;
    border-color: #fff;
}

body.theme-retro .meter-led.led-blue {
    background: #2b8cff;
    box-shadow: 0 0 8px #2b8cff, inset 0 1px 2px #fff;
    border-color: #fff;
}

body.theme-retro .meter-led.led-red {
    background: #d93829;
    box-shadow: 0 0 8px #d93829, inset 0 1px 2px #fff;
    border-color: #fff;
}

body.theme-retro .meter-label {
    display: block;
    position: absolute;
    bottom: 2px;
    left: 4px;
    font-size: 8px;
    font-weight: bold;
    color: #888;
    font-family: Arial, sans-serif;
}

body.theme-retro .slider-label {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--piper-white);
    font-size: 13px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   6. DER NOTIZZETTEL-STAPEL (Interaktive Blätter)
   ========================================================================== */
#mTitle {
    margin-top: 20px;
    font-size: 19px;
    color: var(--blue);
}

.story {
    font-style: italic;
    color: #bbb;
    font-size: 16px;
    line-height: 1.6;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
}

.wiki-title {
    display: none;
}

.wiki-info-note {
    font-size: 14px;
    color: #ccc;
    font-style: italic;
    line-height: 1.5;
}

.notes-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    max-width: 100%;
    box-sizing: border-box;
}

.paperclip,
.page-number {
    display: none;
}

.mission-note-page {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
}

body.theme-retro .notes-stack {
    display: grid;
    grid-template-areas: "stack";
    position: relative;
    margin-bottom: 25px;
    cursor: pointer;
    min-width: 250px;
    min-height: 400px;
    /* Explizite Mindestgröße für bessere Klick-Erkennung */
    user-select: none;
    -webkit-user-select: none;
    /* Verhindert Text-Selektion statt Blättern */
}

body.theme-retro .paperclip {
    display: block;
    position: absolute;
    top: -18px;
    left: 20px;
    width: 25px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 60'%3E%3Cpath d='M10 40 V12 a4 4 0 0 1 8 0 v32 a6 6 0 0 1-12 0 V10 a8 8 0 0 1 16 0 v32' fill='none' stroke='%23889' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    z-index: 10;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    transform: rotate(-15deg);
}

body.theme-retro .mission-note-page {
    grid-area: stack;
    background-color: #fdf5e6;
    background-image: repeating-linear-gradient(transparent, transparent 23px, #a6bccc 24px);
    background-size: 100% 24px;
    background-position: 0 4px;
    padding: 15px 15px 15px 25px;
    border-radius: 2px 6px 4px 2px;
    border: 1px solid #d3cbb8;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

body.theme-retro .mission-note-page::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    width: 1px;
    background-color: rgba(220, 50, 50, 0.4);
}

body.theme-retro .front-note {
    z-index: 2;
    transform: rotate(-1.5deg);
    box-shadow: 3px 5px 12px rgba(0, 0, 0, 0.6);
    opacity: 1;
}

body.theme-retro .back-note {
    z-index: 1;
    transform: rotate(2deg) translate(8px, 6px);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.5);
    filter: brightness(0.85);
}

body.theme-retro .third-note {
    z-index: 0;
    transform: rotate(-3deg) translate(14px, 12px);
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);
    filter: brightness(0.7);
}

body.theme-retro .fourth-note {
    z-index: -1;
    transform: rotate(1deg) translate(2px, 18px);
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
    filter: brightness(0.6);
}

body.theme-retro .fifth-note {
    z-index: -2;
    transform: rotate(-2deg) translate(-4px, 24px);
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
    filter: brightness(0.5);
}

body.theme-retro .page-number {
    display: block;
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: #0b1f65;
    opacity: 0.6;
}

body.theme-retro #mTitle,
body.theme-retro .wiki-title {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: 28px;
    color: #0b1f65;
    text-shadow: none;
    margin-bottom: 8px;
    margin-top: 25px;
    transform: rotate(-1deg);
    line-height: 1.2;
}

body.theme-retro #mStory,
body.theme-retro .wiki-info-note {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    color: #222;
    line-height: 24px;
    border: none;
    padding-bottom: 0;
    margin-bottom: 0;
    text-shadow: none;
    letter-spacing: -0.5px;
    font-style: normal;
}

.briefing-photo-attachment {
    position: relative;
    width: 130px;
    background: #f0eada;
    padding: 6px 6px 22px 6px;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4);
    transform: rotate(3deg);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    float: right;
    margin-left: 15px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    z-index: 5;
}

.briefing-photo-attachment:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 4px 8px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.photo-pin {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #d93829;
    border-radius: 50%;
    z-index: 2;
    box-shadow: inset -1px -2px 4px rgba(0, 0, 0, 0.5), 1px 2px 2px rgba(0, 0, 0, 0.4);
}

.photo-caption {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: #111;
    text-align: center;
    position: absolute;
    bottom: 2px;
    width: 100%;
    left: 0;
}

.photo-img {
    width: 100%;
    height: 115px;
    background-image: url('map.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid #ddd;
    filter: sepia(0.4) contrast(1.1);
    z-index: 1;
}

.photo-img .leaflet-container {
    background: transparent;
}

/* ==========================================================================
   7. PAYLOAD & FRACHT
   ========================================================================== */
.note-manifest {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #444;
    font-size: 14px;
    color: #eee;
}

.note-manifest strong {
    color: #b0b0b0;
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.note-manifest span {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

body.theme-retro .note-manifest {
    display: block;
    margin-top: 24px;
    padding-top: 0;
    border-top: none;
}

body.theme-retro .note-manifest div {
    line-height: 24px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    color: #222;
}

body.theme-retro .note-manifest strong {
    display: inline;
    font-size: 14px;
    color: #d93829;
    margin-right: 5px;
    text-transform: uppercase;
}

body.theme-retro .note-manifest span {
    font-size: 14px;
    font-weight: bold;
    color: #222;
}

/* ==========================================================================
   8. PANEL SCHALTER (METAR & AIP)
   ========================================================================== */
.switch-row {
    display: flex;
    gap: 15px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #444;
}

.retro-switch-container {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #333;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.retro-switch-container:hover {
    background: #555;
}

.retro-switch {
    display: none;
}

.retro-switch-label {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

body.theme-retro .switch-row {
    border-top: 1px solid #4a4e59;
}

body.theme-retro .retro-switch-container {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

body.theme-retro .retro-switch-container:hover {
    background: transparent;
}

body.theme-retro .retro-switch {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #d93829, #8a1a12);
    border: 2px solid #111;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
}

body.theme-retro .retro-switch-label {
    background: #e4e4e4;
    color: #111;
    font-family: 'Arial', sans-serif;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 2px;
    border: 1px solid #888;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
}

body.theme-retro .retro-switch-container:active .retro-switch {
    transform: translateY(3px);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   9. KI DISPATCHER SETTINGS
   ========================================================================== */
.api-settings {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #444;
}

.api-settings label {
    color: var(--blue);
}

body.theme-retro .api-settings label {
    color: var(--piper-yellow);
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.9);
}

body.theme-retro .api-settings input {
    background-image: none;
    border-radius: 4px;
    border-right: 1px solid #c2bba8;
    padding-right: 12px;
    font-family: monospace;
}

.api-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
    line-height: 1.4;
}

.api-hint a {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px dotted var(--blue);
    transition: color 0.2s;
}

.api-hint a:hover {
    color: var(--green);
    border-bottom-color: var(--green);
}

body.theme-retro .api-hint {
    font-family: 'Courier New', Courier, monospace;
    color: #e4dec8;
    font-weight: bold;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.9);
}

body.theme-retro .api-hint a {
    color: var(--piper-yellow);
    border-bottom: 1px solid var(--piper-yellow);
}

body.theme-retro .api-hint a:hover {
    color: var(--piper-white);
    border-bottom-color: var(--piper-white);
}

/* --- API FUEL METER --- */
.api-fuel-meter {
    display: block;
    width: 60px;
    height: 40px;
    margin-top: -5px;
}

.api-fuel-meter .api-scale {
    border-left: 2px solid var(--red) !important;
    border-top: 2px solid var(--warn) !important;
    border-right: 2px solid var(--green) !important;
}

body.theme-retro .api-fuel-meter {
    width: 75px;
    height: 45px;
}

body.theme-retro .api-fuel-meter .api-scale {
    border-left: 3px solid #d93829 !important;
    border-top: 3px solid #f2c12e !important;
    border-right: 3px solid #00ff41 !important;
}

/* ==========================================================================
   10. HANGAR PINNWAND (MAINTENANCE BOARD) & CONTAINER SKALIERUNG
   ========================================================================== */
.pinboard-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    flex-direction: column;
}

.pinboard-overlay.active {
    display: flex;
}

.pinboard-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
}

.pb-btn {
    background: #444;
    color: #fff;
    border: 1px solid #222;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-family: monospace;
}

.pb-btn.add {
    background: var(--green);
    color: #000;
    font-weight: bold;
}

.pinboard-scroll-area {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* NEU: Das Brett als Container definieren, damit sich Post-Its daran anpassen */
.pinboard-content {
    width: 900px;
    height: 600px;
    background-image: url('board.jpg') !important;
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    container-type: inline-size;
}

/* NEU: Post-Its nutzen ab sofort cqw (Container Query Width) statt fester Pixel */
.post-it {
    position: absolute;
    width: 15.5cqw !important;
    height: 15.5cqw !important;
    padding: 2.2cqw 1.1cqw 1.1cqw 1.1cqw !important;
    /* Top-Padding erhöht, damit der Text unter den Buttons beginnt */
    font-size: 1.4cqw !important;
    background: #fdfd86;
    box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.4);
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: #111;
    cursor: grab;
    user-select: none;
    line-height: 1.2;
    overflow: visible !important;
}

.post-it:active {
    cursor: grabbing;
    box-shadow: 4px 5px 8px rgba(0, 0, 0, 0.5);
}

/* Icons und Buttons sitzen jetzt sauber INNEN in den Ecken */
.post-it-del {
    position: absolute;
    top: 0.4cqw !important;
    right: 0.4cqw !important;
    background: #d93829;
    color: white;
    width: 1.6cqw !important;
    height: 1.6cqw !important;
    border-radius: 50%;
    text-align: center;
    line-height: 1.6cqw !important;
    font-size: 0.9cqw !important;
    cursor: pointer;
    font-family: sans-serif;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
    z-index: 10;
}

.post-it-edit {
    position: absolute;
    top: 0.4cqw !important;
    left: 0.4cqw !important;
    background: #4da6ff;
    color: white;
    width: 1.6cqw !important;
    height: 1.6cqw !important;
    border-radius: 50%;
    text-align: center;
    line-height: 1.6cqw !important;
    font-size: 0.9cqw !important;
    cursor: pointer;
    font-family: sans-serif;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
    z-index: 10;
}

.post-it-edit:hover,
.post-it-del:hover {
    transform: scale(1.1);
}

.post-it-pin {
    position: absolute;
    top: 0.5cqw !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 1cqw !important;
    height: 1cqw !important;
    border-radius: 50%;
    background: #444;
    box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* --- FLIGHT POST-ITS (GESPEICHERTE FLÜGE) --- */
.briefing-save-pin {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.5));
}

.briefing-export-pin {
    position: absolute;
    top: 12px;
    right: 42px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.5));
}

.briefing-pdf-pin {
    position: absolute;
    top: 12px;
    right: 72px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.5));
}

.briefing-save-pin:hover,
.briefing-export-pin:hover,
.briefing-pdf-pin:hover {
    transform: scale(1.2) rotate(10deg);
}

.post-it.flight-card {
    background: #e6f7ff;
    border: 1px solid #b3e0ff;
    width: 20cqw !important;
    height: auto !important;
    min-height: 12cqw !important;
}

.flight-load-btn {
    background: var(--blue);
    color: #fff;
    border: 1px solid #222;
    padding: 0.5cqw !important;
    width: 100%;
    margin-top: 0.8cqw !important;
    cursor: pointer;
    font-weight: bold;
    border-radius: 3px;
    font-size: 1cqw !important;
    font-family: sans-serif;
    transition: background 0.2s;
}

.flight-load-btn:hover {
    background: #3388dd;
}

/* ==========================================================================
   11. KARTENTISCH (MAP TABLE)
   ========================================================================== */
.maptable-content {
    width: 1000px;
    height: 600px;
    background-image: url('map.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

#mapArea {
    flex: 1;
    display: flex;
    width: 100%;
    min-height: 0;
}

#map {
    width: 100%;
    height: 100%;
    display: block;
    filter: sepia(0.35) contrast(0.95);
}

/* Map Profile Strip */
.map-profile-strip {
    width: 100%;
    height: 25%;
    min-height: 80px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.map-profile-controls {
    display: flex;
    align-items: center;
    padding: 3px 10px;
    background: #111;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    gap: 2px;
}

.map-profile-controls input[type=range] {
    height: 4px;
    margin: 0;
    padding: 0;
}

.map-profile-controls input[type=range]::-webkit-slider-thumb {
    height: 14px;
    width: 14px;
}

.vp-zoom-btn {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vp-zoom-btn:hover {
    background: #555;
}

.vp-zoom-btn:active {
    background: #222;
}

.vp-ctrl-btn {
    background: #333; color: #fff; border: 1px solid #555; width: 22px; height: 22px;
    font-size: 14px; font-weight: bold; cursor: pointer; border-radius: 3px;
    line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    user-select: none; flex-shrink: 0;
}
.vp-ctrl-btn:active { background: #111; }
.vp-ctrl-val {
    color: #4da6ff; font-family: monospace; font-size: 14px; font-weight: bold;
    cursor: pointer; padding: 0 4px; min-width: 3ch; text-align: center;
    user-select: none; transition: color 0.1s;
}
.vp-ctrl-val:active { color: #fff; }
.vp-ctrl-input {
    background: rgba(0, 0, 0, 0.3); color: #fff; font-family: monospace; font-size: 12px;
    border: 1px solid #444; width: 58px; text-align: center; margin: 0 2px;
    -moz-appearance: textfield; padding: 4px 2px; border-radius: 3px; box-sizing: border-box;
}
.vp-ctrl-input:focus { border: 1px solid #4da6ff; outline: none; background: #111; color: #fff; }
.vp-ctrl-input::-webkit-outer-spin-button, .vp-ctrl-input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
.vp-ctrl-label {
    color: #fff; font-size: 11px; font-family: monospace; min-width: 32px; text-align: center;
    cursor: pointer; user-select: none;
}
.vp-toggle-cloud {
    background: transparent; border: none; font-size: 16px; cursor: pointer;
    filter: grayscale(100%); opacity: 0.4; transition: 0.2s; margin-left: 4px; flex-shrink: 0;
}
.vp-toggle-cloud.active { filter: none; opacity: 1; text-shadow: 0 0 5px rgba(255,255,255,0.5); }

.map-profile-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.map-profile-scroll::-webkit-scrollbar {
    height: 6px;
}

.map-profile-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.map-profile-scroll::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.map-profile-scroll canvas {
    display: block;
    height: 100%;
}

/* Resize Handle */
.profile-resize-handle {
    width: 100%;
    height: 22px;
    background: #222;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
    transition: background 0.15s;
    touch-action: none;
}

.profile-resize-handle::before {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: #555;
    box-shadow: 0 5px 0 #555, 0 10px 0 #555;
    border-radius: 1px;
}

.profile-resize-handle:hover {
    background: #333;
}

.profile-resize-handle:hover::before {
    background: #aaa;
    box-shadow: 0 5px 0 #aaa, 0 10px 0 #aaa;
}

.profile-resize-handle:active {
    background: #444;
}

.profile-resize-handle:active::before {
    background: #fff;
    box-shadow: 0 5px 0 #fff, 0 10px 0 #fff;
}

@media (max-width: 768px) {
    .profile-resize-handle {
        height: 30px;
    }

    /* Profil-Strip: etwas weiter oben (iPhone-Ecken schneiden sonst Start/Landezone ab)
       + padding-bottom für Safari-Adressleiste und Home-Indicator */
    .map-profile-strip {
        padding-bottom: env(safe-area-inset-bottom, 8px);
        margin-bottom: 0;
    }

    /* Fullscreen: dynamische Viewport-Höhe für Safari (Adressleiste beeinflusst vh nicht) */
    body.map-is-fullscreen #mapTableOverlay {
        height: 100vh !important;
        /* Fallback */
        height: 100dvh !important;
        /* Überschreibt in Browsern mit dvh-Support (Safari 16+) */
    }
}

/* Position Slider Bar */
.map-profile-pos-bar {
    height: 20px;
    background: #111;
    padding: 2px 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #222;
}

.map-profile-pos-bar input[type=range] {
    height: 3px;
    margin: 0;
    padding: 0;
    background: #333;
    border: none;
}

.map-profile-pos-bar input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #ff00ff;
    background: transparent;
    cursor: pointer;
}

/* Flush map edges with profile - ONLY in fullscreen */
body.map-is-fullscreen #mapArea {
    padding: 0 !important;
}

body.map-is-fullscreen #mapArea #map {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    height: 100% !important;
    filter: none !important;
}

body.map-is-fullscreen .container {
    display: none !important;
}

body.map-is-fullscreen {
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.map-is-fullscreen #mapTableOverlay {
    background: #111 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-left: env(safe-area-inset-left, 0px) !important;
    padding-right: env(safe-area-inset-right, 0px) !important;
    box-sizing: border-box !important;
}

body.map-is-fullscreen .pinboard-header {
    position: relative !important;
    height: auto !important;
    z-index: 100000;
    box-sizing: border-box;
    background: rgba(26, 26, 26, 0.95);
    flex-wrap: wrap;
    gap: 8px;
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
}

body.map-is-fullscreen .maptable-content {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-size: cover !important;
    padding: 0 !important;
}

body.map-is-fullscreen .pinboard-scroll-area {
    position: relative !important;
    top: 0 !important;
    flex: 1 !important;
    display: block;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

body.map-is-fullscreen #map {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0 !important;
    filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

body.map-is-fullscreen .map-profile-strip {
    min-height: 100px;
    height: 25%;
    max-height: 75%;
}

/* ==========================================================================
   12. DIE SCHUBLADEN-ANIMATION (PC LAYOUT DYNAMISCH - SCROLLBAR FIX)
   ========================================================================== */
.container {
    position: relative;
    z-index: 10;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-x: hidden;
}

@media (min-width: 1250px) {

    /* Container für die Overlays auf der rechten / linken Seite */
    #pinboardOverlay,
    #mapTableOverlay {
        display: flex !important;
        flex-direction: column;
        visibility: hidden;
        background: transparent;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 1;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        overflow: hidden !important;
        /* Verhindert das Auftauchen von Scrollbalken! */
        transition: opacity 0.4s, visibility 0.4s;
        transform: none !important;
    }

    #pinboardOverlay {
        left: 520px !important;
        right: 20px !important;
    }

    #mapTableOverlay {
        left: 20px !important;
        right: 520px !important;
    }

    /* Das Hauptpanel schiebt sich zur Seite */
    body.pinboard-open .container {
        transform: translateX(calc(-50vw + 260px));
    }

    body.maptable-open .container {
        transform: translateX(calc(50vw - 260px));
    }

    #pinboardOverlay.active,
    #mapTableOverlay.active {
        visibility: visible;
        opacity: 1;
        pointer-events: all;
    }

    /* Der innere Bereich unter dem Header bekommt den gesamten Restplatz */
    .pinboard-scroll-area {
        flex: 1 !important;
        overflow: hidden !important;
        /* Blockiert Scrollbalken im Inneren endgültig */
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    /* Die Bretter: 16:10 Format stur halten, passen sich perfekt ein */
    .maptable-content,
    .pinboard-content {
        transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        aspect-ratio: 16 / 10 !important;
        width: 100% !important;
        max-width: calc((100vh - 120px) * 1.6) !important;
        /* Koppelung an die Höhe, verhindert Abschneiden */
        height: auto !important;
        margin: auto !important;
        background-size: cover !important;
        background-position: center !important;
        transform: scale(0.8);
        padding: 5% 6% 6% 6%;
        box-sizing: border-box;
    }

    #pinboardOverlay.active .pinboard-content,
    #mapTableOverlay.active .maptable-content {
        transform: scale(1);
    }
}

@media (max-width: 1249px) {

    body.maptable-open,
    body.pinboard-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    .pinboard-overlay {
        background: #080808 !important;
    }

       #mapTableOverlay {
        touch-action: none;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;           /* Fallback für sehr alte Browser */
        height: 100dvh !important;          /* FIX: Dynamische Höhe für iOS Safari */
        overscroll-behavior: none;
    }


    #mapTableOverlay .pinboard-scroll-area {
        overflow: hidden !important;
        touch-action: none;
        overscroll-behavior: none;
    }

    .maptable-content {
        touch-action: none;
        overflow: hidden !important;
    }
}

body.map-is-fullscreen .pb-btn.close {
    display: none !important;
}

/* ==========================================================================
   13. NAV-LOG (WEGPUNKTE)
   ========================================================================== */
.waypoint-list {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #ddd;
}

.wp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wp-row:last-child {
    border-bottom: none;
}

.wp-name {
    font-weight: bold;
    flex-grow: 1;
    padding-right: 15px;
    line-height: 1.3;
}

.wp-data {
    color: var(--green);
    font-weight: bold;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.interactive-route {
    cursor: pointer;
}

/* Airspace List Rows (NavLog) */
.as-row {
    border-radius: 3px;
}

.as-row:hover {
    background: rgba(0, 0, 0, 0.06);
}

.as-row.as-active {
    background: rgba(0, 0, 0, 0.12) !important;
    box-shadow: inset 3px 0 0 #d93829;
}

body.theme-retro .waypoint-list {
    color: #f4f4f4;
    border-top: 1px dashed #777;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 15px;
}

body.theme-retro .wp-data {
    color: var(--piper-yellow);
}

/* ==========================================================================
   14. NOT-AUS (RESET BUTTON)
   ========================================================================== */
.emergency-reset {
    position: relative;
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: repeating-linear-gradient(45deg, var(--warn), var(--warn) 6px, #111 6px, #111 12px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    border: 2px solid #222;
    transition: transform 0.2s;
    margin: 0 5px;
}

.emergency-reset:hover {
    transform: scale(1.05);
}

.emergency-reset-inner {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #ff4444, #aa0000);
    border-radius: 50%;
    border: 1px solid #111;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 3px 5px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    transition: transform 0.1s;
}

.emergency-reset:active .emergency-reset-inner {
    transform: scale(0.9);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   15. MOBILE OPTIMIERUNG (SMARTPHONES & TABLETS)
   ========================================================================== */

/* ── iPhone (≤767px): Karte Vollbild, Pinnwand horizontal panbar ── */
@media (max-width: 767px) {
    #mapTableOverlay .pinboard-scroll-area {
        padding: 0 !important;
    }

    .maptable-content {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        background-size: cover !important;
        background-position: center !important;
        padding: 20px;
        box-sizing: border-box;
    }


    /* Im echten Vollbild-Modus (⛶) wieder den kompletten Screen ausfüllen */
    body.map-is-fullscreen #map {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Pinnwand: nur horizontal panbar, kein Pinch-Zoom */
    #pinboardOverlay {
        touch-action: pan-x;
    }

    #pinboardOverlay .pinboard-scroll-area {
        display: block !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 !important;
        height: calc(100vh - 70px) !important;
    }

    .pinboard-content {
        height: 100% !important;
        width: auto !important;
        aspect-ratio: 16 / 10 !important;
        background-size: cover !important;
        background-position: center !important;
        margin: 0 !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
    }

    body.theme-retro .container {
        padding: 30px 15px 20px 15px !important;
    }

    /* Briefing: etwas breiter auf iPhone durch weniger Padding */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.theme-retro .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .briefing-photo-attachment {
        width: 100px !important;
    }

    /* Route-Map-Polaroid: gleiche Dimensionen wie PC (130px × 115px), überschreibt den 100px-Override */
    .briefing-photo-attachment:has(#miniMap) {
        width: 130px !important;
    }

    body.theme-retro .notes-stack {
        min-width: 0;
    }
}

/* ── iPad (768px–1249px): Bild passt ans Display – kein Scroll, kein Pinch-Zoom ── */
@media (min-width: 768px) and (max-width: 1249px) {

    /* Kein Browser-Scroll und kein Pinch-Zoom auf den Overlays */
    #mapTableOverlay,
    #pinboardOverlay {
        touch-action: pan-x pan-y;
    }

    /* Karte: Vollbild, Hintergrundbild gestreckt auf das Div */
    #mapTableOverlay .pinboard-scroll-area {
        padding: 0 !important;
    }

    .maptable-content {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        background-size: cover !important;
        background-position: center !important;
        padding: 40px;
        box-sizing: border-box;
    }

    /* Pinnwand: zentriert, passt sich komplett ans Display an – nichts abgeschnitten */
    #pinboardOverlay .pinboard-scroll-area {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
        padding: 0 !important;
        height: calc(100vh - 70px) !important;
    }

    .pinboard-content {
        /* Nimmt die kleinste passende Dimension: entweder volle Breite
           oder so breit, dass die Höhe ins Display passt – nie abgeschnitten */
        width: min(100vw, calc((100vh - 70px) * 16 / 10)) !important;
        height: auto !important;
        aspect-ratio: 16 / 10 !important;
        background-size: cover !important;
        background-position: center !important;
        margin: 0 !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================================
   16. RADIO STACK DESIGN (NavCom Style) & THEME LOGIK
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

#navcomInputs {
    display: none;
}

body.theme-navcom #navcomInputs {
    display: flex;
}

body.theme-navcom #classicInputs {
    display: none;
}

body.theme-navcom {
    --piper-white: #f4f4f4;
    --piper-yellow: #33ff33;
    --piper-red: #ff4444;
    --navlog-text: #111;
    --navlog-heading: #0b1f65;
    --navlog-data: #d93829;
    --navlog-freq: #0b1f65;
    --navlog-border: #888;
    font-family: 'Arial', sans-serif;
}

body.theme-navcom .container {
    --p-bg: #3c4045;
    --p-bt: #5d636b;
    --p-bl: #4f545a;
    --p-bb: #111214;
    --p-br: #111214;
    background-color: var(--p-bg);
    padding: 45px 25px 25px 25px;
    border-radius: 24px;
    border-top: 3px solid var(--p-bt);
    border-left: 3px solid var(--p-bl);
    border-bottom: 4px solid var(--p-bb);
    border-right: 4px solid var(--p-br);
    box-shadow: inset 0 4px 6px rgba(255, 255, 255, 0.2), inset 0 -6px 12px rgba(0, 0, 0, 0.3), 0 20px 50px rgba(0, 0, 0, 0.9);
}

body.theme-navcom h1 {
    margin-top: 32px;
    /* Abstand zu den Schrauben vergrößert */
    color: #33ff33;
    text-shadow: 0 0 6px rgba(51, 255, 51, 0.8), 0 0 18px rgba(51, 255, 51, 0.3);
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    letter-spacing: 5px;
    text-transform: uppercase;
    border: 2px solid #2a2a2a;
    border-top: 2px solid #444;
    border-radius: 4px;
    background: #0a0a0a;
    padding: 7px 16px;
    margin-bottom: 8px;
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9), 0 3px 6px rgba(0, 0, 0, 0.7), 0 0 1px rgba(51, 255, 51, 0.2);
    transform: none;
}

body.theme-navcom #searchIndicator {
    color: #aaa;
    font-family: monospace;
}
body.theme-navcom .help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1; /* Ignoriert störende Font-Baselines */
    vertical-align: middle;
    margin-top: -3px; /* Optische Korrektur zur H1-Höhe */
    border-width: 2px; /* Etwas dickerer Rahmen, passend zum NavCom-Look */
}

body.theme-navcom .theme-switch-wrapper {
    border-top: 2px solid #555;
}

/* NavCom: Oberes Audio-Panel flacher – Marker bleiben vertikal */
body.theme-navcom .audio-panel {
    padding: 5px 10px !important;
}

body.theme-navcom .audio-panel-inner {
    gap: 10px;
    align-items: center;
}

body.theme-navcom .audio-panel .marker-lights {
    flex-direction: column;
    gap: 3px;
    padding: 3px 4px;
}

body.theme-navcom .audio-panel .marker-light {
    width: 18px;
    height: 14px;
    font-size: 7px;
    border-radius: 2px;
}

body.theme-navcom .audio-panel .audio-btn {
    height: 26px;
    font-size: 10px;
    padding: 2px 2px;
}

body.theme-navcom .audio-panel .audio-btn-grid {
    gap: 4px;
}

/* ============================================================
   NavCom: Radio Stack – Authentisches Bendix/King Design
   ============================================================ */

/* Outer Rack – dunkles Aluminium-Gehäuse */
body.theme-navcom .radio-stack {
    gap: 2px;
    background: #080808;
    padding: 6px;
    border-radius: 6px;
    border: 5px solid #1e1e1e;
    border-top: 5px solid #333;
    border-bottom: 6px solid #0a0a0a;
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.97),
        inset 0 2px 0 rgba(255, 255, 255, 0.06),
        inset 0 0 10px rgba(0, 0, 0, 0.95);
}

/* Einzelne Paneele – KX 165 Frontplatten-Optik */
body.theme-navcom .radio-module {
    background: linear-gradient(to bottom, #161616 0%, #101010 100%);
    border: 1px solid #777;
    border-top: 2px solid #bbb;
    border-bottom: 3px solid #1a1a1a;
    border-right: 1px solid #666;
    border-radius: 2px;
    padding: 6px 10px 8px 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.6),
        0 2px 5px rgba(0, 0, 0, 0.8);
    overflow: visible;
}

/* ── Schrauben entfernen ── */
body.theme-navcom .radio-module::before,
body.theme-navcom .radio-module::after,
body.theme-navcom .radio-module-right-screws::before,
body.theme-navcom .radio-module-right-screws::after {
    display: none;
}

body.theme-navcom .radio-module-right-screws {
    display: none;
}

/* ── Half-Module: CSS-Grid – KX 165 Layout ──
   Zeile 1: Display (volle Breite, weißer Rahmen)
   Zeile 2: Transfer-Button (kleiner weißer Taster)
   Zeile 3: Modul-Label links (weißer Rahmen) + Drehknopf rechts */
body.theme-navcom .half-module {
    display: grid;
    grid-template-areas:
        "disp disp"
        "swap swap"
        "lbl  knob";
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 3px 0;
    padding: 5px 10px 6px 10px;
    overflow: visible;
}

/* Display: volle Breite, weißer Rahmen wie im Original */
body.theme-navcom .half-module .radio-display-container {
    grid-area: disp;
    width: 100%;
    border: 2px solid #ccc;
    border-radius: 3px;
    padding: 4px 8px;
    background: #050505;
    box-shadow:
        inset 0 0 14px rgba(0, 0, 0, 0.97),
        inset 0 2px 8px rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
}

/* Inneres Display-Layout: Beschreibung links, Wert rechts */
body.theme-navcom .radio-disp-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 6px;
    width: 100%;
}

body.theme-navcom .radio-disp-inner .lcd-label {
    margin-bottom: 0;
    text-align: left;
    font-family: 'Share Tech Mono', monospace;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ff4400;
    text-shadow: 0 0 5px rgba(255, 55, 0, 0.8), 0 0 12px rgba(255, 30, 0, 0.3);
    opacity: 1;
}

body.theme-navcom .radio-disp-inner .lcd-input {
    width: 100% !important;
    min-width: 0;
    text-align: right;
    text-align-last: right;
    font-weight: bold;
}

/* Transfer-Button (↔) – weißer Taster unterhalb des Displays */
.radio-transfer-btn {
    display: none;
}

body.theme-navcom .half-module .radio-transfer-btn {
    grid-area: swap;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    background: linear-gradient(to bottom, #e8e8e8 0%, #c0c0c0 100%);
    color: #111;
    border: 1px solid #888;
    border-top: 1px solid #f4f4f4;
    border-bottom: 2px solid #555;
    border-radius: 2px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: -1px;
    height: 18px;
    width: 44px;
    padding: 0;
    cursor: pointer;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: 0.08s;
    user-select: none;
}

body.theme-navcom .half-module .radio-transfer-btn:active {
    border-top: 1px solid #777;
    border-bottom: 1px solid #ccc;
    box-shadow: inset 1px 2px 3px rgba(0, 0, 0, 0.4);
    transform: translateY(1px);
}

/* Label: aus absoluter Position befreit → statisch im Grid, weißer Rahmen */
body.theme-navcom .half-module .radio-label {
    grid-area: lbl;
    position: static;
    border: 2px solid #ccc;
    border-radius: 2px;
    background: #0f0f0f;
    color: #bbb;
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 600;
    padding: 4px 8px;
    white-space: nowrap;
    align-self: center;
    top: auto;
    left: auto;
}

/* Knopf: rechts, leicht über den Label-Rahmen (sitzt auf dem Rahmen) */
body.theme-navcom .half-module .radio-knob {
    grid-area: knob;
    margin: 0 0 0 -5px;
    align-self: center;
    position: relative;
    z-index: 2;
}

/* Label für full-width Module (XPDR etc.) – bleibt absolut positioniert, weiß */
body.theme-navcom .radio-label {
    background: #0f0f0f;
    color: #aaa;
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 600;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    top: -7px;
    padding: 0 6px;
}

/* Display allgemein (full-width Module: XPDR, etc.) – weiß gerahmt */
body.theme-navcom .radio-display-container {
    background: #050505;
    border: 2px solid #ccc;
    border-radius: 3px;
    padding: 5px 8px;
    box-shadow:
        inset 0 0 14px rgba(0, 0, 0, 0.97),
        inset 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* Rote LED-Anzeige – Bendix/King Stil */
body.theme-navcom .lcd-input {
    color: #ff4400 !important;
    text-shadow: 0 0 5px rgba(255, 55, 0, 0.8), 0 0 12px rgba(255, 30, 0, 0.3) !important;
    font-size: 20px;
    letter-spacing: 1px;
    background: transparent !important;
}

body.theme-navcom .lcd-input:focus {
    background: rgba(255, 60, 0, 0.06) !important;
}

body.theme-navcom .lcd-input option {
    background: #050505;
    color: #ff4400;
}

/* LCD-Beschriftungen – USE / STBY Stil */
body.theme-navcom .lcd-label {
    color: #aaa;
    font-size: 9px;
    letter-spacing: 2px;
    opacity: 1;
    text-shadow: none;
}

/* Drehknöpfe – groß, mit weißem Ring (KX 165 Stil) */
body.theme-navcom .radio-knob {
    width: 38px;
    height: 38px;
    border: 3px solid #d8d8d8;
    background: #181818;
    box-shadow:
        3px 5px 10px rgba(0, 0, 0, 0.85),
        1px 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.12),
        inset 0 -2px 5px rgba(0, 0, 0, 0.8);
    margin-left: 0;
}

body.theme-navcom .radio-knob::before {
    background: repeating-conic-gradient(#3a3a3a 0% 4%, #111 4% 8%);
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
}

body.theme-navcom .radio-knob::after {
    width: 16px;
    height: 16px;
    border: 2px solid #d0d0d0;
    background: #111;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

/* Audio-Buttons – mehr 3D wie KMA 26 Taster */
body.theme-navcom .audio-btn {
    background: linear-gradient(to bottom, #383838 0%, #242424 100%);
    border: 1px solid #555;
    border-top: 2px solid #666;
    border-bottom: 3px solid #111;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #ddd;
}

body.theme-navcom .audio-btn:active {
    border-top: 1px solid #333;
    border-bottom: 1px solid #444;
    box-shadow: inset 1px 2px 4px rgba(0, 0, 0, 0.9);
}

/* ============================================================
   KLN 90B GPS Module – Green Phosphor LCD
   ============================================================ */
.kln90b-module {
    display: none;
}

body.theme-navcom .kln90b-module {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 10px 8px 10px;
}

body.theme-navcom .kln90b-module .radio-label {
    background: #0f0f0f;
    color: #aaa;
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 600;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    top: -7px;
    padding: 0 6px;
}

/* Outer body wrapper */
.kln90b-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Display – grünes Phosphor LCD, Split links|rechts */
.kln90b-display {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    grid-template-rows: 1fr auto;
    background: #020a02;
    border: 2px solid #ccc;
    border-radius: 3px;
    height: 120px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #33ff33;
    text-shadow: 0 0 4px rgba(51, 255, 51, 0.6);
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.95),
        inset 0 2px 8px rgba(0, 0, 0, 0.9);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Scanline-Overlay */
.kln90b-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.15) 2px,
            rgba(0, 0, 0, 0.15) 4px);
    pointer-events: none;
    z-index: 2;
}

.kln90b-left,
.kln90b-right {
    padding: 5px 6px 3px 6px;
    overflow: hidden;
    line-height: 1.45;
    min-height: 0;
    word-break: break-word;
    /* Graceful bottom fade statt hartem Abschnitt */
    -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}

.kln90b-left {
    grid-column: 1;
    grid-row: 1;
}

.kln90b-right {
    grid-column: 3;
    grid-row: 1;
}

.kln90b-divider {
    grid-column: 2;
    grid-row: 1;
    background: #33ff33;
    opacity: 0.35;
    width: 1px;
}

.kln90b-statusbar {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    padding: 2px 7px;
    font-size: 9px;
    color: #33ff33;
    opacity: 0.7;
    border-top: 1px solid rgba(51, 255, 51, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.kln90b-line {
    margin: 0;
}

.kln90b-line.highlight {
    color: #66ff66;
    text-shadow: 0 0 8px rgba(51, 255, 51, 0.9);
}

.kln90b-line.dim {
    opacity: 0.5;
}

/* Mode Buttons Reihe – volle Breite */
.kln90b-buttons {
    display: flex;
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
}

/* Encoder-Reihe: links (zurück) und rechts (vor) unterhalb der Buttons */
.kln90b-encoder-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-top: 2px;
}

/* Encoder (Drehgeber) */
.kln90b-encoder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #181818;
    border: 3px solid #d8d8d8;
    box-shadow:
        3px 5px 10px rgba(0, 0, 0, 0.85),
        1px 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.12),
        inset 0 -2px 5px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.kln90b-enc-inner {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: repeating-conic-gradient(#3a3a3a 0% 4%, #111 4% 8%);
}

.kln90b-encoder::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #d0d0d0;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.2);
    z-index: 1;
}

/* Mode Buttons – weiß, klein, kein LED */
.kln90b-btn {
    background: linear-gradient(to bottom, #e8e8e8 0%, #c0c0c0 100%);
    border: 1px solid #888;
    border-top: 1px solid #f4f4f4;
    border-bottom: 2px solid #555;
    border-radius: 2px;
    color: #222;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    font-weight: bold;
    padding: 4px 0;
    cursor: pointer;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    user-select: none;
    transition: 0.08s;
    flex: 1;
    text-align: center;
}

.kln90b-btn:active {
    border-top: 1px solid #777;
    border-bottom: 1px solid #ccc;
    box-shadow: inset 1px 2px 3px rgba(0, 0, 0, 0.4);
    transform: translateY(1px);
}

.kln90b-btn.active {
    background: linear-gradient(to bottom, #c8c8c8 0%, #a8a8a8 100%);
    color: #000;
    border-bottom: 2px solid rgba(51, 255, 51, 0.7);
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.3), 0 0 4px rgba(51, 255, 51, 0.3);
}

/* Radio Stack Modul Styling */
.radio-stack {
    flex-direction: column;
    gap: 4px;
    background: #111;
    padding: 10px;
    border-radius: 8px;
    border: 4px solid #2a2a2a;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), inset 0 0 10px rgba(0, 0, 0, 0.8);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.radio-row {
    display: flex;
    gap: 6px;
    width: 100%;
}

.radio-module {
    background: #1a1a1a;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 10px 12px 8px 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.5);
}

.half-module {
    flex: 1;
    padding: 8px 10px 6px 10px;
    min-width: 0;
}

.radio-module::before,
.radio-module::after,
.radio-module-right-screws::before,
.radio-module-right-screws::after {
    content: '⊕';
    position: absolute;
    color: #666;
    font-size: 11px;
}

.radio-module::before {
    top: 4px;
    left: 4px;
}

.radio-module::after {
    bottom: 4px;
    left: 4px;
}

.radio-module-right-screws::before {
    top: 4px;
    right: 4px;
}

.radio-module-right-screws::after {
    bottom: 4px;
    right: 4px;
}

.radio-label {
    position: absolute;
    top: -8px;
    left: 20px;
    background: #1a1a1a;
    color: #ccc;
    font-size: 10px;
    font-weight: bold;
    padding: 0 8px;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    letter-spacing: 1px;
    white-space: nowrap;
}

.radio-display-container {
    background: #051405;
    border: 3px inset #333;
    border-radius: 4px;
    padding: 6px;
    display: flex;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9);
    flex: 1;
}

.lcd-input {
    background: transparent !important;
    border: none !important;
    color: #33ff33 !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 22px;
    text-align: center;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.6) !important;
    text-transform: uppercase;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.lcd-input:focus {
    outline: none;
    background: rgba(51, 255, 51, 0.1) !important;
}

.lcd-input option {
    background: #051405;
    color: #33ff33;
    font-family: 'Share Tech Mono', monospace;
}

.lcd-label {
    display: block;
    color: #33ff33;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 2px;
    letter-spacing: 1px;
}

/* Bendix/King Style Encoder (Weiße Ringe & geriffeltes Inneres) */
.radio-knob {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #e0e0e0;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
    flex-shrink: 0;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-sizing: border-box;
    transform-origin: center;
}

.radio-knob:active {
    transform: scale(0.95);
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.radio-knob::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    background: repeating-conic-gradient(#333 0% 5%, #111 5% 10%);
}

.radio-knob::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #e0e0e0;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* --- Audio / Marker Panel (KMA Style) --- */
.audio-panel-inner {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.marker-lights {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px;
    background: #0a0a0a;
    border-radius: 4px;
    border: 1px inset #333;
}

.marker-light {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    font-weight: bold;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.3;
    transition: all 0.2s;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.8);
}

/* Farben der Marker Beacons */
.mk-outer {
    background: #4da6ff;
}

/* O - Blue */
.mk-middle {
    background: #f2c12e;
}

/* M - Amber */
.mk-inner {
    background: #fdfdfd;
}

/* I - White */

/* Aktiver / Blinkender Zustand */
.marker-light.on {
    opacity: 1;
    box-shadow: 0 0 10px currentColor, inset 0 0 5px #fff;
    color: #fff;
    text-shadow: 0 0 2px #000;
}

.marker-light.blinking {
    animation: markerBlink 0.3s infinite alternate;
}

@keyframes markerBlink {
    from {
        opacity: 0.2;
    }

    to {
        opacity: 1;
        box-shadow: 0 0 10px currentColor;
        color: #fff;
    }
}

/* Audio Taster */
.audio-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    flex-grow: 1;
}

.audio-btn {
    background: #2a2a2a;
    border: 2px solid #111;
    border-bottom-color: #444;
    border-right-color: #444;
    border-radius: 3px;
    color: #ccc;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    padding: 4px 2px;
    text-align: center;
    cursor: pointer;
    position: relative;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    user-select: none;
}

.audio-btn:active {
    transform: translateY(1px);
    border-bottom-color: #111;
    border-right-color: #111;
    border-top-color: #444;
    border-left-color: #444;
    box-shadow: inset 1px 2px 3px rgba(0, 0, 0, 0.8);
}

.audio-led {
    width: 12px;
    height: 4px;
    background: #111;
    border-radius: 1px;
    margin-top: 4px;
    border: 1px solid #000;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Aktiver Taster (LED an) */
.audio-btn.active .audio-led {
    background: #33ff33;
    box-shadow: 0 0 8px #33ff33, inset 0 1px 2px #fff;
    border-color: #fff;
}

.audio-btn.active {
    color: #fff;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Airspace Pulse Highlight Animation */
@keyframes airspace-pulse {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.55;
    }
}

@keyframes airspace-stroke-pulse {

    0%,
    100% {
        stroke-opacity: 0.5;
        stroke-width: 2;
    }

    50% {
        stroke-opacity: 1;
        stroke-width: 4;
    }
}

.airspace-highlight-pulse path {
    animation: airspace-pulse 1.5s ease-in-out infinite, airspace-stroke-pulse 1.5s ease-in-out infinite;
}

/* CMD Action Bar (NavCom DISPATCH/CLEAR) */
.navcom-action-bar {
    padding: 10px 12px;
    justify-content: center;
}

.navcom-action-btns {
    display: flex;
    gap: 8px;
    width: 100%;
}

.navcom-exec-btn {
    flex: 1;
    height: 42px;
    font-size: 13px;
    color: #ff4444 !important;
    border-color: #444;
}

.navcom-exec-btn .audio-led {
    background: #111;
}

.navcom-exec-btn.active .audio-led {
    background: #ff4444;
    box-shadow: 0 0 8px #ff4444, inset 0 1px 2px #fff;
    border-color: #fff;
}

.navcom-clear-btn {
    flex: 0 0 auto;
    width: 70px;
    height: 42px;
    font-size: 13px;
    color: #f2c12e !important;
    border-color: #444;
}

.navcom-clear-btn .audio-led {
    background: #111;
}

.audio-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Drag Knobs Cursor */
.drag-knob {
    cursor: ns-resize;
}

/* Zeigt Pfeile nach oben/unten an */

/* KLN Loading-Animation: drei Punkte blinken nacheinander */
@keyframes kln-dot {

    0%,
    60%,
    100% {
        opacity: 0.15;
    }

    30% {
        opacity: 1;
    }
}

.kln-loading-dots span {
    display: inline-block;
    animation: kln-dot 1.2s infinite;
    font-size: 14px;
    letter-spacing: 2px;
}

.kln-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.kln-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}


/* KLN 90B: mehr Höhe auf schmalen Mobilgeräten (iPhone Portrait) */
@media (max-width: 480px) {
    .kln90b-display {
        height: 145px;
    }

    /* Fade-Out etwas weicher, da mehr Platz vorhanden */
    .kln90b-left,
    .kln90b-right {
        -webkit-mask-image: linear-gradient(to bottom, black 82%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 82%, transparent 100%);
    }

    /* XPDR / Aircraft module: kompakter auf iPhone */
    .radio-module {
        padding: 6px 4px 4px 4px !important;
    }

    .radio-module>.radio-display-container {
        flex-wrap: wrap !important;
        gap: 2px !important;
        padding: 2px 4px !important;
    }

    .radio-module .lcd-input {
        font-size: 18px !important;
    }

    .radio-knob.drag-knob {
        width: 28px !important;
        height: 28px !important;
        margin-left: 4px !important;
    }

    .radio-knob {
        width: 30px !important;
        height: 30px !important;
        margin-left: 4px !important;
    }

    .lcd-label {
        font-size: 9px !important;
    }

    /* NavCom: Labels genauso groß wie Werte */
    body.theme-navcom .radio-disp-inner .lcd-label {
        font-size: 18px !important;
    }

    /* NavCom: Knöpfe auf iPhone wie KLN-Encoder (volle Größe + Styling) */
    body.theme-navcom .radio-knob {
        width: 40px !important;
        height: 40px !important;
        border: 3px solid #d8d8d8 !important;
        box-shadow:
            3px 5px 10px rgba(0, 0, 0, 0.85),
            1px 1px 0 rgba(255, 255, 255, 0.15),
            inset 0 2px 5px rgba(255, 255, 255, 0.12),
            inset 0 -2px 5px rgba(0, 0, 0, 0.8) !important;
        margin-left: 0 !important;
    }

    body.theme-navcom .radio-knob::after {
        width: 18px !important;
        height: 18px !important;
    }

    /* NavCom: PAX auf iPhone ausblenden */
    body.theme-navcom .xpdr-pax {
        display: none !important;
    }

    .radio-module>.radio-display-container {
        border-width: 1px !important;
    }

    .radio-stack {
        padding: 6px !important;
        border-width: 2px !important;
    }

    .radio-row {
        gap: 2px !important;
    }

    .half-module {
        padding: 5px 6px 4px 6px !important;
    }
}

/* Sanfte Animation für das Polaroid */
.briefing-photo-attachment {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s !important;
    cursor: zoom-in;
}

/* Der herangeholte / vergrößerte Zustand – transform wird per JS berechnet und als Inline-Style gesetzt */
.briefing-photo-attachment.photo-zoomed {
    z-index: 100 !important;
    box-shadow: 5px 20px 50px rgba(0, 0, 0, 0.8) !important;
    cursor: zoom-out !important;
}

/* Transition während des Zoom-Setup unterdrücken (verhindert unerwünschte Zwischen-Animation) */
.briefing-photo-attachment.wiki-zoom-setup {
    transition: none !important;
}

/* ==========================================================================
   17. DISCORD LINK
   ========================================================================== */
.discord-link {
    display: inline-block;
    margin-top: 6px;
    color: #5865F2;
    /* Discord Blurple */
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: color 0.2s, transform 0.2s;
}

.discord-link:hover {
    color: #7983f5;
    transform: scale(1.05);
}

/* Analog Cockpit Theme */
body.theme-retro .discord-link {
    color: #777;
    font-family: 'Courier New', Courier, monospace;
}

body.theme-retro .discord-link:hover {
    color: var(--piper-white);
}

/* NavCom Theme */
body.theme-navcom .discord-link {
    color: #555;
    font-family: 'Share Tech Mono', monospace;
}

body.theme-navcom .discord-link:hover {
    color: #33ff33;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.6);
}

/* ==========================================================================
   18a. EXTRA-SCHMALE GERÄTE (≤393px: iPhone SE, iPhone 14 mini etc.)
   ========================================================================== */
@media (max-width: 393px) {

    /* --- Briefing: bis an die Container-Kante (Classic/Modern Theme) --- */
    .briefing {
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* --- Zettelstapel: bis an die Container-Kante (Retro + NavCom) --- */
    body.theme-retro .notes-stack {
        margin-left: -14px;
        margin-right: -14px;
    }

    /* --- NavCom: Kleinere Encoder (28px, wie die frühere Variante) --- */
    body.theme-navcom .radio-knob {
        width: 28px !important;
        height: 28px !important;
        border: 2px solid #d8d8d8 !important;
        box-shadow:
            2px 3px 6px rgba(0, 0, 0, 0.85),
            inset 0 1px 3px rgba(255, 255, 255, 0.12),
            inset 0 -1px 3px rgba(0, 0, 0, 0.8) !important;
        margin-left: 2px !important;
    }

    body.theme-navcom .radio-knob::before {
        top: 2px !important;
        left: 2px !important;
        right: 2px !important;
        bottom: 2px !important;
    }

    body.theme-navcom .radio-knob::after {
        width: 12px !important;
        height: 12px !important;
    }

    /* --- XPDR: Kein Zeilenumbruch --- */
    .radio-module>.radio-display-container {
        flex-wrap: nowrap !important;
    }

    /* --- Schrift skalieren für mehr Platz --- */
    .radio-module .lcd-input {
        font-size: 16px !important;
    }

    body.theme-navcom .radio-disp-inner .lcd-label {
        font-size: 14px !important;
    }
}

/* ==========================================================================
   18. OVERRIDES FÜR MOBILE (Muss ganz unten stehen!)
   ========================================================================== */
/* (mobile .photo-zoomed transform wird per JS gesetzt – kein CSS-Override nötig) */

/* FIX: Interaktive Elemente auf Hintergrund-Seiten deaktivieren, damit Klicks zuverlässig zum Blättern führen */
body.theme-retro .mission-note-page:not(.front-note) .briefing-photo-attachment,
body.theme-retro .mission-note-page:not(.front-note) a,
body.theme-retro .mission-note-page:not(.front-note) button,
body.theme-retro .mission-note-page:not(.front-note) .retro-switch-container {
    pointer-events: none;
}

/* ==========================================================================
   19. CREW BOARD / MULTIPLAYER
   ========================================================================== */
.pb-tabs {
    display: inline-flex;
    background: #111;
    border-radius: 4px;
    border: 1px solid #333;
    overflow: hidden;
}
.pb-tab {
    background: transparent;
    color: #888;
    border: none;
    padding: 6px 15px;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
}
.pb-tab:hover { background: #222; color: #ccc; }
.pb-tab.active { background: #4da6ff; color: #000; }
body.theme-retro .pb-tab.active { background: var(--piper-yellow); color: #111; }
body.theme-navcom .pb-tab.active { background: #33ff33; color: #000; box-shadow: inset 0 0 5px rgba(0,0,0,0.5); }
.pin-modal-overlay {
    position: fixed; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.85);
    z-index: 100000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.pin-modal-box {
    background: #1e1e1e;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 25px;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
}
.post-it-new-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 10px;
    transform: rotate(-10deg);
    box-shadow: 1px 2px 4px rgba(0,0,0,0.5);
    z-index: 100 !important;
    font-family: sans-serif;
    pointer-events: none;
}
.post-it.roster-card {
    background: #e6e6e6;
    border: 2px solid #ccc;
    cursor: default;
}
.roster-list {
    font-size: 1.1cqw;
    margin-top: 1cqw;
    line-height: 1.4;
    color: #333;
    font-weight: normal;
    text-align: left;
}
.roster-item {
    display: flex; justify-content: space-between;
    border-bottom: 1px dashed #ccc; padding-bottom: 2px; margin-bottom: 2px;
}
.roster-status {
    font-size: 0.9cqw;
    color: #888;
}

/* ==========================================================================
   20. HARDWARE ACCELERATION FIX (JITTER PREVENTION)
   ========================================================================== */
body.theme-navcom .radio-stack,
body.theme-navcom .radio-module,
.marker-light {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
.marker-light.blinking {
    will-change: opacity, box-shadow;
}

/* ==========================================================================
   21. NAVCOM SYNC LED FEEDBACK
   ========================================================================== */
@keyframes led-blink-fast {
    0%, 100% { background: #ffcc00; box-shadow: 0 0 8px #ffcc00; border-color: #fff; }
    50% { background: #111; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1); border-color: #000; }
}
.audio-btn.led-syncing .audio-led {
    animation: led-blink-fast 0.3s infinite;
}
.audio-btn.led-success .audio-led {
    background: #33ff33 !important;
    box-shadow: 0 0 8px #33ff33, inset 0 1px 2px #fff !important;
    border-color: #fff !important;
}
.audio-btn.led-error .audio-led {
    background: #ff4444 !important;
    box-shadow: 0 0 8px #ff4444, inset 0 1px 2px #fff !important;
    border-color: #fff !important;
}

/* ==========================================================================
   22. MENU BUTTONS (KARTENTISCH & PINNWAND)
   ========================================================================== */
.btn-menu {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    background: #444; /* Standard Modern */
    color: #fff;
    border: 2px solid #222;
    border-bottom: 4px solid #111;
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s, border-width 0.1s, background 0.1s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border-radius: 8px; /* Leicht abgerundet */
    position: relative; /* Wichtig, damit das Badge nicht wegfliegt */
}
.btn-menu:hover { background: #555; }
.btn-menu:active {
    background: #222;
    transform: translateY(2px);
    border-bottom: 2px solid #111;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
/* RETRO THEME (Zwingt die Buttons in den Retro-Look) */
body.theme-retro .btn-menu {
    background: linear-gradient(to bottom, #d93829, #8a1a12);
    color: #fff;
    border: 2px solid #222;
    border-bottom: 4px solid #111;
    font-family: 'Oleo Script', cursive;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    letter-spacing: 1px;
}
body.theme-retro .btn-menu:hover {
    background: linear-gradient(to bottom, #ff4d3d, #a62017);
}
body.theme-retro .btn-menu:active {
    background: linear-gradient(to bottom, #b82c1f, #6e150f);
    transform: translateY(2px);
    border-bottom: 2px solid #111;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
/* NAVCOM THEME (Überschreibt Retro-Rot mit NavCom-Grau!) */
body.theme-navcom .btn-menu {
    background: #2a2a2a;
    color: #ccc;
    border: 2px solid #111;
    border-bottom: 3px solid #444;
    font-family: 'Share Tech Mono', monospace;
    border-radius: 0;
    text-shadow: none;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: normal;
}
body.theme-navcom .btn-menu:hover {
    background: #383838;
}
body.theme-navcom .btn-menu:active {
    background: #111;
    transform: translateY(1px);
    border-bottom: 2px solid #111;
    box-shadow: inset 1px 2px 3px rgba(0, 0, 0, 0.8);
}
/* --- RUNDE NOTIFICATION BADGES --- */
#mainPinboardBadge {
    position: absolute;
    background: #ff4444;
    color: #fff;
    font-size: 11px;
    font-family: sans-serif;
    font-weight: bold;
    transform: translateY(-2px);
    margin-left: 6px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    box-sizing: border-box;
    display: none;
}
#groupBadge {
    display: inline-block;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-family: sans-serif;
    font-weight: bold;
    transform: translateY(-1px);
    margin-left: 4px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    box-sizing: border-box;
    display: none;
}

/* ==========================================================================
   4. MAP OVERLAYS (Auto-Follow & Telemetry)
   ========================================================================== */
.map-overlay-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--blue);
    color: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.map-overlay-btn:active {
    transform: scale(0.9);
}
.telemetry-box {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10001;
    background: rgba(15,15,15,0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1.5px solid #444;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    pointer-events: none;
    min-width: 100px;
}
.tele-val {
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 0.5px;
}
.tele-unit {
    font-size: 10px;
    color: #888;
    margin-left: 4px;
    text-transform: uppercase;
}

/* ==========================================================================
   ELEVATION / TPA TOOLTIP
   ========================================================================== */
.leaflet-tooltip.elev-tooltip {
    background: rgba(10, 10, 10, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.45;
    padding: 4px 8px;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}
.leaflet-tooltip.elev-tooltip::before {
    display: none;
}

/* ==========================================================================
   DIRECT TO MODE
   ========================================================================== */
#freeflightBtn.active {
    background: #00e5ff !important;
    color: #000 !important;
    font-weight: bold;
}
.ff-context-popup .leaflet-popup-content-wrapper {
    background: rgba(10, 10, 10, 0.92);
    border: 2px solid #00e5ff;
    border-radius: 6px;
    color: #fff;
}
.ff-context-popup .leaflet-popup-tip {
    border-top-color: rgba(10, 10, 10, 0.92);
}
.ff-context-popup .leaflet-popup-close-button {
    color: #aaa;
}
.ff-toast {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 229, 255, 0.9);
    color: #000;
    font-family: monospace;
    font-weight: bold;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    animation: ffToastFade 3s ease-out forwards;
}
@keyframes ffToastFade {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}
