* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Landing background image is set in templates/index.html (webATC background.png). */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: block;
    color: #f5f7fa;
}

.container {
    width: 100%;
    max-width: none;
    padding: 2rem 2rem 2rem 2.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    box-sizing: border-box;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.button-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding-left: 0.5rem;
}

/* Landing: vertical nav stack on the left */
@media (min-width: 769px) {
    .container .button-row {
        align-items: flex-start;
        flex-wrap: nowrap;
    }
}

/* Landing page: glass nav buttons with SVG pictograms */
.container .button-row a.btn {
    text-decoration: none;
}

.container .button-row .btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, rgba(16, 24, 38, 0.82) 0%, rgba(8, 12, 22, 0.9) 100%);
    border: 1px solid rgba(148, 180, 220, 0.22);
    border-radius: 14px;
    padding: 0.55rem 1rem 0.55rem 0.6rem;
    color: rgba(245, 247, 250, 0.96);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    min-width: 0;
    width: 252px;
    max-width: 252px;
    min-height: 3.35rem;
    box-sizing: border-box;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex: 0 0 auto;
}

.container .button-row .btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.1) 0%, transparent 42%);
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
    z-index: 0;
}

.container .button-row .btn::before {
    display: none;
}

.container .button-row .btn:hover {
    transform: translateX(4px);
    border-color: rgba(190, 214, 255, 0.42);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.container .button-row .btn:hover::after {
    opacity: 1;
}

.container .button-row .btn:active {
    transform: translateX(2px) scale(0.99);
}

.container .button-row .btn .btn-icon {
    position: relative;
    z-index: 1;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    transition: transform 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.container .button-row .btn .btn-icon svg {
    width: 1.28rem;
    height: 1.28rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container .button-row .btn .btn-icon svg polygon,
.container .button-row .btn .btn-icon svg rect[rx] {
    fill: currentColor;
    fill-opacity: 0.18;
    stroke: currentColor;
}

.container .button-row .btn:hover .btn-icon {
    transform: scale(1.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 18px rgba(96, 165, 250, 0.22);
}

.container .button-row .btn .btn-label {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.12rem;
    min-width: 0;
}

.container .button-row .btn .btn-text {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.03em;
}

.container .button-row .btn .btn-subtext {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.78;
    color: rgba(191, 219, 254, 0.92);
}

.container .button-row .btn-landing-primary {
    border-color: rgba(52, 211, 153, 0.38);
    background: linear-gradient(135deg, rgba(14, 36, 32, 0.88) 0%, rgba(8, 16, 24, 0.92) 100%);
}

.container .button-row .btn-landing-primary .btn-icon {
    color: #6ee7b7;
    background: linear-gradient(145deg, rgba(52, 211, 153, 0.24) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-color: rgba(52, 211, 153, 0.35);
}

.container .button-row .btn-landing-primary:hover {
    border-color: rgba(110, 231, 183, 0.55);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.38),
        0 0 24px rgba(16, 185, 129, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.container .button-row .btn-landing-settings .btn-icon {
    color: #93c5fd;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.22) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-color: rgba(96, 165, 250, 0.32);
}

.container .button-row .btn-landing-playback .btn-icon {
    color: #c4b5fd;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.22) 0%, rgba(109, 40, 217, 0.08) 100%);
    border-color: rgba(167, 139, 250, 0.32);
}

.container .button-row .btn-landing-vccs .btn-icon {
    color: #fcd34d;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.08) 100%);
    border-color: rgba(251, 191, 36, 0.32);
}

.container .button-row .btn-landing-manual .btn-icon {
    color: #7dd3fc;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.22) 0%, rgba(2, 132, 199, 0.08) 100%);
    border-color: rgba(56, 189, 248, 0.32);
}

.container .button-row .btn-landing-airspace .btn-icon {
    color: #5eead4;
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.22) 0%, rgba(13, 148, 136, 0.08) 100%);
    border-color: rgba(45, 212, 191, 0.32);
}

.container .button-row .btn-landing-exercises .btn-icon {
    color: #fdba74;
    background: linear-gradient(145deg, rgba(251, 146, 60, 0.22) 0%, rgba(234, 88, 12, 0.08) 100%);
    border-color: rgba(251, 146, 60, 0.32);
}

.container .button-row .btn-landing-options .btn-icon {
    color: #93c5fd;
    background: linear-gradient(145deg, rgba(96, 165, 250, 0.22) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-color: rgba(96, 165, 250, 0.32);
}

.landing-player-rf-fieldset {
    border: 1px solid rgba(148, 180, 220, 0.18);
    border-radius: 10px;
    padding: 0.75rem 1rem 0.25rem;
    margin: 0.5rem 0 0;
}

.landing-player-rf-fieldset legend {
    padding: 0 0.35rem;
    margin-bottom: 0.25rem;
}

.landing-player-options-intro {
    margin-top: 0;
}

.landing-admin-only,
.landing-subscriber-only {
    display: none !important;
}

body.landing-role-admin .landing-menu-wrap.landing-admin-only,
body.landing-role-admin button.landing-admin-only.btn,
body.landing-role-admin a.landing-admin-only.btn {
    display: flex !important;
}

body.landing-role-subscriber button.landing-subscriber-only.btn {
    display: flex !important;
}

.subscriber-user-manual-body {
    padding-top: 0.5rem;
}

.subscriber-user-manual-figure {
    margin: 0;
    background: #fff;
    border: 1px solid rgba(148, 180, 220, 0.18);
    border-radius: 10px;
    padding: 0.75rem;
    overflow: auto;
}

.subscriber-user-manual-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

#subscriberUserManualModal .landing-player-options-actions .ai-pp-ptt-btn.btn {
    flex: 0 1 auto;
    min-width: 5.5rem;
    max-width: 8rem;
}

#landingPlayerOptionsModal .landing-player-voice-select {
    width: 100%;
    margin-bottom: 0.65rem;
}

#landingPlayerOptionsModal .landing-player-voice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

#landingPlayerOptionsModal .landing-player-options-footer {
    display: flex;
    justify-content: center;
    padding: 1rem 1.25rem 1.25rem;
}

#landingPlayerOptionsModal .landing-player-options-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

#landingPlayerOptionsModal .landing-player-options-actions .ai-pp-ptt-btn.btn {
    flex: 1 1 0;
    min-width: 5.5rem;
    max-width: 8rem;
    justify-content: center;
}

#landingPlayerOptionsModal .landing-player-voice-actions .ai-pp-ptt-btn.btn {
    flex: 0 1 auto;
    min-width: 5.5rem;
    max-width: none;
    justify-content: center;
}

.simulation-subscriber-options-wrap .edit-exercise-topbar-dropdown-trigger {
    min-width: 6.5rem;
}

/* Landing page expandable menus (Airspace, Exercises) */
.landing-menu-wrap {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 252px;
    max-width: 252px;
    flex: 0 0 auto;
    z-index: 5;
}

.landing-menu-wrap:hover,
.landing-menu-wrap:focus-within {
    z-index: 30;
}

.landing-menu-wrap .landing-menu-trigger {
    width: 100%;
    max-width: 100%;
}

.landing-menu-wrap::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 0;
    width: 0.65rem;
    height: 100%;
}

.landing-submenu {
    position: absolute;
    left: calc(100% + 0.65rem);
    top: 0;
    z-index: 35;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 220px;
    padding: 0;
}

.landing-menu-wrap:hover .landing-submenu,
.landing-menu-wrap:focus-within .landing-submenu {
    display: flex;
}

.landing-menu-wrap:hover .landing-menu-trigger,
.landing-menu-wrap:focus-within .landing-menu-trigger {
    transform: translateX(4px);
    border-color: rgba(190, 214, 255, 0.42);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.landing-menu-wrap:hover .landing-menu-trigger::after,
.landing-menu-wrap:focus-within .landing-menu-trigger::after {
    opacity: 1;
}

.landing-submenu-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    width: 220px;
    min-height: 2.75rem;
    padding: 0.45rem 0.85rem 0.45rem 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 180, 220, 0.22);
    background: linear-gradient(135deg, rgba(16, 24, 38, 0.92) 0%, rgba(8, 12, 22, 0.96) 100%);
    color: rgba(245, 247, 250, 0.96);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-align: left;
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.landing-submenu-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.1) 0%, transparent 42%);
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
    z-index: 0;
}

.landing-submenu-btn:hover {
    transform: translateX(4px);
    border-color: rgba(190, 214, 255, 0.42);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.landing-submenu-btn:hover::after {
    opacity: 1;
}

.landing-submenu-icon {
    position: relative;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.landing-submenu-icon svg {
    width: 1.05rem;
    height: 1.05rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.landing-submenu-text {
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.landing-submenu-create {
    border-color: rgba(52, 211, 153, 0.32);
}

.landing-submenu-create .landing-submenu-icon {
    color: #6ee7b7;
    background: linear-gradient(145deg, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-color: rgba(52, 211, 153, 0.28);
}

.landing-submenu-edit {
    border-color: rgba(148, 163, 184, 0.28);
}

.landing-submenu-edit .landing-submenu-icon {
    color: #cbd5e1;
    background: linear-gradient(145deg, rgba(148, 163, 184, 0.18) 0%, rgba(100, 116, 139, 0.08) 100%);
    border-color: rgba(148, 163, 184, 0.24);
}

.landing-submenu-delete {
    border-color: rgba(248, 113, 113, 0.32);
}

.landing-submenu-delete .landing-submenu-icon {
    color: #fca5a5;
    background: linear-gradient(145deg, rgba(248, 113, 113, 0.2) 0%, rgba(220, 38, 38, 0.08) 100%);
    border-color: rgba(248, 113, 113, 0.28);
}

.container .button-row .btn .btn-text-stack,
.container .button-row .btn .btn-text-line {
    position: relative;
    z-index: 1;
}

.landing-brand .reg-mark,
footer .reg-mark {
    font-size: 0.65em;
    vertical-align: super;
    margin-left: 0.05em;
}

.landing-brand {
    position: fixed;
    top: 1.35rem;
    left: 2.5rem;
    z-index: 15;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(245, 247, 250, 0.94);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    user-select: none;
}

.btn {
    background: rgba(44, 62, 80, 0.92);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    color: #f5f7fa;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-side {
    min-width: 200px;
    flex: 0 1 auto;
}

.btn-center {
    min-width: 220px;
    flex: 0 0 auto;
}

.btn-round {
    border-radius: 8px;
    min-width: 200px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn:active {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 3rem;
    display: block;
}

.btn-text {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: rgba(74, 144, 226, 0.5);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #2a5f94 100%);
    border-color: rgba(74, 144, 226, 0.8);
}

.btn-secondary {
    background: linear-gradient(135deg, #5ba3f5 0%, #4a90e2 100%);
    border-color: rgba(91, 163, 245, 0.5);
    color: #ffffff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: rgba(91, 163, 245, 0.8);
}

.btn-tertiary {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    border-color: rgba(0, 188, 212, 0.5);
    color: #ffffff;
}

.btn-tertiary:hover {
    background: linear-gradient(135deg, #0097a7 0%, #00838f 100%);
    border-color: rgba(0, 188, 212, 0.8);
}

.btn-success {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b1a 100%);
    border-color: rgba(255, 140, 66, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #ff6b1a 0%, #e55a0f 100%);
    border-color: rgba(255, 140, 66, 0.8);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: rgba(231, 76, 60, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: rgba(231, 76, 60, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-side {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.9) 0%, rgba(53, 122, 189, 0.9) 100%);
    border-color: rgba(74, 144, 226, 0.5);
    color: #ffffff;
}

.btn-side:hover {
    background: linear-gradient(135deg, rgba(53, 122, 189, 1) 0%, rgba(42, 95, 148, 1) 100%);
    border-color: rgba(74, 144, 226, 0.8);
}

footer {
    margin-top: 2rem;
    padding-left: 0.5rem;
    opacity: 0.85;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .landing-brand {
        top: 1rem;
        left: 1.25rem;
        font-size: 0.95rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.72);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Stacked modal: Create Sub-Flow over Flow details */
#createSubFlowModal.create-sub-flow-modal {
    z-index: 1100;
}

#deleteSubFlowConfirmModal.delete-sub-flow-confirm-modal {
    z-index: 1150;
}

/* Edit Airspace: map right-click menu + click-to-place waypoint hint */
.sector-map-context-menu {
    position: fixed;
    z-index: 1400;
    min-width: 10rem;
    padding: 0.35rem 0;
    background: rgba(26, 47, 74, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.sector-map-context-menu-item {
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    text-align: left;
    border: none;
    background: transparent;
    color: rgba(245, 247, 250, 0.95);
    font-size: 0.95rem;
    cursor: pointer;
}

.sector-map-context-menu-item:hover {
    background: rgba(74, 144, 226, 0.25);
}

.sector-map-delete-route-disambig {
    position: fixed;
    z-index: 1410;
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 12rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.5rem;
    background: rgba(26, 47, 74, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.sector-map-delete-route-disambig-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid rgba(74, 144, 226, 0.35);
    border-radius: 6px;
    background: rgba(10, 22, 40, 0.9);
    color: rgba(245, 247, 250, 0.95);
    font-size: 0.95rem;
    cursor: pointer;
}

.sector-map-delete-route-disambig-item:hover {
    background: rgba(74, 144, 226, 0.35);
}

.sector-map-context-submenu-wrap {
    position: relative;
}

.sector-map-context-submenu-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: default;
    user-select: none;
    margin: 0;
}

.sector-map-context-submenu-parent:hover,
.sector-map-context-submenu-wrap:hover > .sector-map-context-submenu-parent {
    background: rgba(74, 144, 226, 0.25);
}

.sector-map-context-submenu-arrow {
    opacity: 0.75;
    font-size: 1.1rem;
    line-height: 1;
}

.sector-map-context-submenu {
    display: none;
    position: absolute;
    left: calc(100% - 6px);
    top: 0;
    min-width: 11rem;
    padding: 0.35rem 0;
    background: rgba(26, 47, 74, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.sector-map-context-submenu-wrap:hover .sector-map-context-submenu {
    display: block;
}

.sector-map-context-submenu-flip .sector-map-context-submenu {
    left: auto;
    right: calc(100% - 6px);
}

.sector-map-context-placeholder-item {
    opacity: 0.55;
    cursor: not-allowed;
}

.sector-map-bg-calib-panel {
    margin-top: 1rem;
}

.sector-map-bg-calib-hint-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sector-map-bg-calib-hint {
    color: rgba(245, 247, 250, 0.92);
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.sector-map-bg-point-count-status {
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 140, 66, 0.95);
    white-space: nowrap;
    margin-bottom: 0.75rem;
}

.modal-bg-wizard.modal-content {
    width: min(96vw, 1180px);
    max-width: 1180px;
}

.sector-map-bg-calib-wrap {
    position: relative;
}

.sector-map-bg-img-host {
    position: relative;
    width: 100%;
    min-height: 320px;
    max-height: min(74vh, 760px);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(74, 144, 226, 0.35);
    overflow: hidden;
    margin-bottom: 1rem;
    touch-action: none;
}

.sector-map-bg-panzoom-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
    z-index: 0;
}

.sector-map-bg-calib-img {
    display: block;
    max-width: 100%;
    max-height: min(74vh, 760px);
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: crosshair;
    vertical-align: middle;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

.sector-map-bg-calib-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(230, 74, 25, 0.95);
    background: #ff8c42;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    z-index: 3;
}

.sector-map-bg-calib-marker-dragging {
    cursor: grabbing;
}

/* Floating coordinate/name card anchored next to its marker on the picture (sits over the
   img-host, in a sibling layer so it is never clipped by the host's overflow:hidden). */
.sector-map-bg-popup-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.sector-map-bg-coord-popup {
    position: absolute;
    width: 17.5rem;
    pointer-events: auto;
    padding: 0.65rem 0.75rem 0.75rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a2f4a 0%, #24405f 100%);
    border: 1px solid rgba(255, 140, 66, 0.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 6;
}

.sector-map-bg-coord-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sector-map-bg-coord-block-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.92);
    margin-right: auto;
}

.sector-map-bg-coord-popup-remove {
    background: none;
    border: 1px solid rgba(239, 83, 80, 0.55);
    color: rgba(255, 205, 200, 0.95);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    white-space: nowrap;
}

.sector-map-bg-coord-popup-remove:hover {
    background: rgba(239, 83, 80, 0.2);
    color: #fff;
}

.sector-map-bg-coord-popup-close {
    background: none;
    border: none;
    color: rgba(245, 247, 250, 0.7);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.sector-map-bg-coord-popup-close:hover {
    color: #fff;
}

.sector-map-bg-coord-popup-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sector-map-bg-coord-popup-latlon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sector-map-bg-coord-popup-hint {
    font-size: 0.72rem;
    margin: 0;
    line-height: 1.3;
}

.sector-map-bg-coord-field-waypoint .form-input {
    max-width: 100%;
}

.sector-map-bg-wp-get-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.45rem;
}

.sector-map-bg-wp-input {
    flex: 0 1 7.5rem;
    min-width: 4.5rem;
    max-width: 9rem;
}

.sector-map-bg-wp-get-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.45rem 0.55rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

@media (max-width: 720px) {
    .sector-map-bg-coord-popup {
        width: min(15.5rem, calc(100vw - 3rem));
    }
    .sector-map-bg-coord-popup-latlon {
        grid-template-columns: 1fr;
    }
}

.sector-map-bg-edit-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: min(50vh, 360px);
    overflow-y: auto;
}

.sector-map-bg-edit-pick-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(74, 144, 226, 0.35);
    background: rgba(26, 47, 74, 0.45);
    color: rgba(245, 247, 250, 0.95);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sector-map-bg-edit-pick-item:hover {
    background: rgba(74, 144, 226, 0.22);
    border-color: rgba(74, 144, 226, 0.55);
}

#sectorMapBackgroundModal .sector-map-bg-modal-footer,
#sectorMapBackgroundPickEditModal .sector-map-bg-pick-edit-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

#sectorMapBackgroundModal .sector-map-bg-modal-footer .btn,
#sectorMapBackgroundPickEditModal .sector-map-bg-pick-edit-footer .btn,
#sectorMapBackgroundPickDeleteModal .sector-map-bg-pick-delete-footer .btn,
#sectorMapBackgroundConfirmDeleteOneModal .sector-map-bg-confirm-delete-footer .btn,
#sectorMapBackgroundConfirmDeleteAllModal .sector-map-bg-confirm-delete-all-footer .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 0;
    min-width: 120px;
}

#sectorMapBackgroundPickDeleteModal .sector-map-bg-pick-delete-footer,
#sectorMapBackgroundConfirmDeleteOneModal .sector-map-bg-confirm-delete-footer,
#sectorMapBackgroundConfirmDeleteAllModal .sector-map-bg-confirm-delete-all-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.sector-map-bg-confirm-delete-msg {
    margin: 0 0 0.25rem 0;
    color: rgba(245, 247, 250, 0.92);
    font-size: 1rem;
    line-height: 1.45;
}

.sector-map-context-submenu-item {
    white-space: nowrap;
}

.sector-map-placement-hint {
    position: fixed;
    z-index: 1399;
    pointer-events: none;
    padding: 0.35rem 0.6rem;
    max-width: min(90vw, 22rem);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(74, 144, 226, 0.5);
    border-radius: 6px;
    color: rgba(245, 247, 250, 0.95);
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.35;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Overlays inside fullscreen sim (nested .modal siblings) must sit above radar/canvas */
#simulationModal > .modal.active {
    z-index: 1100;
}

/* Pop-ups over the sim: keep radar sharp; lighter dim than global .modal (0.7 → ~0.38) */
#simulationModal > .modal {
    background-color: rgba(0, 0, 0, 0.38);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#aiPpPttModal {
    z-index: 1300;
}

.modal.modal-discreet {
    background-color: transparent;
    backdrop-filter: none;
}

.modal.modal-discreet .modal-content {
    max-width: 340px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    border-color: rgba(74, 144, 226, 0.25);
}

.modal.modal-discreet .modal-header {
    padding: 0.9rem 1.1rem;
}

.modal.modal-discreet .modal-body {
    padding: 1rem 1.1rem;
}

.modal.modal-discreet .modal-header h2 {
    font-size: 1.05rem;
}

.simulation-debug-log-modal {
    /* Make the debug log window much wider for long lines */
    width: 95vw;
    max-width: 2700px !important;
}

.sim-debug-log-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.sim-debug-log-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre;
    resize: vertical;
}

.modal-content {
    background: linear-gradient(135deg, #1a2f4a 0%, #2c3e50 100%);
    margin: auto;
    padding: 0;
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

.playback-modal-content {
    width: min(96vw, 1200px);
    max-width: 1200px;
}

.playback-modal-body {
    min-height: 640px;
}

.playback-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 1rem;
    min-height: 600px;
}

.playback-recordings-panel,
.playback-viewer-panel {
    background: rgba(10, 18, 32, 0.45);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 12px;
    padding: 1rem;
}

.playback-panel-header,
.playback-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.playback-panel-header h3,
.playback-viewer-header h3 {
    margin: 0;
}

.playback-mini-btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
}

.playback-recordings-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 540px;
    overflow-y: auto;
}

.playback-recording-item {
    border: 1px solid rgba(245, 247, 250, 0.12);
    border-radius: 10px;
    padding: 0.75rem;
    background: rgba(44, 62, 80, 0.45);
}

.playback-recording-title {
    font-weight: 700;
    color: #f5f7fa;
    margin-bottom: 0.25rem;
}

.playback-recording-meta {
    color: rgba(245, 247, 250, 0.65);
    font-size: 0.8rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.playback-recording-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.playback-recording-actions .btn {
    flex: 1;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
}

.playback-canvas-wrap {
    position: relative;
    width: 100%;
}

.playback-canvas {
    width: 100%;
    height: 520px;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(74, 144, 226, 0.25);
    background: #07111f;
}

.playback-controls {
    display: grid;
    grid-template-columns: auto auto auto auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.playback-controls .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 30px;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.1;
    gap: 0.25rem;
}

.playback-subtitles-overlay {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
    z-index: 5;
    width: min(86%, 900px);
}

.playback-subtitle-item {
    max-width: 100%;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.playback-viewer-panel:fullscreen,
.playback-viewer-panel:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #07111f;
}

.playback-viewer-panel:fullscreen .playback-canvas-wrap,
.playback-viewer-panel:-webkit-full-screen .playback-canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
}

.playback-viewer-panel:fullscreen .playback-canvas,
.playback-viewer-panel:-webkit-full-screen .playback-canvas {
    height: 100%;
    min-height: 0;
}

.playback-viewer-panel:fullscreen .playback-controls,
.playback-viewer-panel:-webkit-full-screen .playback-controls {
    flex: 0 0 auto;
}

.playback-scrub-bar {
    width: 100%;
}

.playback-time-label {
    min-width: 110px;
    text-align: right;
    color: rgba(245, 247, 250, 0.8);
    font-variant-numeric: tabular-nums;
}

/* Label editor: 5-column grid needs more width than default .modal-large (900px) */
#simulationLabelEditorModal .modal-content.sim-label-editor-modal {
    width: min(96vw, 1220px);
    max-width: min(96vw, 1220px);
}

.modal-small {
    max-width: 500px;
}

.modal-medium {
    max-width: 640px;
}

.run-type-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.run-type-option-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    text-align: left;
    width: 100%;
}

.run-type-join-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    background: rgba(26, 47, 74, 0.2);
}

.run-type-join-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.run-type-join-item:last-child {
    border-bottom: none;
}

.run-type-join-item:hover {
    background: rgba(74, 144, 226, 0.15);
}

.run-type-join-item.selected {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

.start-session-lead {
    text-align: center;
    margin: 0 0 1.25rem 0;
}

.start-session-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.start-session-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    min-height: 11rem;
    padding: 1.5rem 1.25rem;
    background: rgba(44, 62, 80, 0.6);
    border: 2px solid rgba(74, 144, 226, 0.35);
    border-radius: 10px;
    color: #f5f7fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font: inherit;
}

.start-session-option-card:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.65);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.3);
}

.start-session-option-card:focus {
    outline: none;
}

.start-session-option-card:focus-visible {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.65);
}

.start-session-option-icon {
    font-size: 2rem;
    line-height: 1;
}

.start-session-option-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f5f7fa;
}

.start-session-option-desc {
    font-size: 0.88rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.78);
    max-width: 16rem;
}

@media (max-width: 640px) {
    .start-session-options {
        grid-template-columns: 1fr;
    }
}

/* Join session: ATC sector + role picker */
.join-session-sector-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    padding: 0.5rem;
    background: rgba(26, 47, 74, 0.2);
}

.join-session-sector-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.join-session-sector-item:hover {
    background: rgba(74, 144, 226, 0.12);
}

.join-session-sector-item.selected {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.45);
}

.join-session-role-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.join-session-role-btn {
    min-width: 4.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(74, 144, 226, 0.45);
    background: rgba(44, 62, 80, 0.7);
    color: #f5f7fa;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.join-session-role-btn:hover:not(:disabled) {
    background: rgba(74, 144, 226, 0.35);
}

.join-session-role-btn.selected {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.7);
}

.join-session-role-btn.taken {
    background: #7f1d1d;
    border-color: #b91c1c;
    color: #fecaca;
    cursor: not-allowed;
    opacity: 0.95;
}

.join-session-role-btn:disabled {
    cursor: not-allowed;
}

.modal-fullscreen {
    max-width: 95vw;
    max-height: 95vh;
    width: 95vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

/* When simulation is in fullscreen, only the main radar panel fills the screen; nested dialogs keep .modal-small / default sizing */
#simulationModal:fullscreen > .modal-content.modal-fullscreen,
#simulationModal:-webkit-full-screen > .modal-content.modal-fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    background: rgba(26, 47, 74, 0.5);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: #f5f7fa;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 2px solid rgba(74, 144, 226, 0.3);
    background: rgba(26, 47, 74, 0.35);
}

/* ATC Sectors modal: orange sector names, row Edit/Delete same height as Clear form, centered Close */
#atcSectorsModal .atc-sectors-existing-list .boundary-item {
    color: #f5f7fa;
}

#atcSectorsModal .atc-sectors-existing-list .boundary-points {
    color: #ff8c42;
    font-weight: 600;
}

#atcSectorsModal .atc-sectors-existing-list .boundary-actions .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 0;
    min-width: 5.5rem;
}

#atcSectorsModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

#atcSectorsModal .modal-footer .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 0;
    min-width: 120px;
}

/* Airports modal: Add runway same height as top ADD; footer Close centered + compact */
#airportsModal .runways-header .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 0;
    min-width: 5.5rem;
}

#airportsModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

#airportsModal .modal-footer .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 0;
    min-width: 120px;
}

/* Add Runway / Add Approach (incl. Edit Approach): footer buttons side-by-side, compact */
#addRunwayModal .modal-footer,
#addApproachModal .modal-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

#addRunwayModal .modal-footer .btn,
#addApproachModal .modal-footer .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 0;
    min-width: 120px;
}

/* STCA Parameters modal: compact buttons (~1/3 default .btn height); Save + Close on one line */
#stcaParametersModal .stca-parameters-compact-btn.btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: calc(2.5rem / 3) calc(2rem / 3);
    font-size: 0.88rem;
    line-height: 1.2;
    min-height: 0;
}

#stcaParametersModal .modal-footer.stca-parameters-footer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    padding: 1rem 1.25rem;
}

#stcaParametersModal .stca-parameters-footer .stca-parameters-compact-btn {
    min-width: 5.5rem;
}

/* Realistic Frequency modal: reuse the same compact footer treatment as STCA Parameters */
#simulationRealisticFrequencyModal .stca-parameters-compact-btn.btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: calc(2.5rem / 3) calc(2rem / 3);
    font-size: 0.88rem;
    line-height: 1.2;
    min-height: 0;
}

#simulationRealisticFrequencyModal .modal-footer.stca-parameters-footer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    padding: 1rem 1.25rem;
}

#simulationRealisticFrequencyModal .stca-parameters-footer .stca-parameters-compact-btn {
    min-width: 5.5rem;
}

#simulationRealisticFrequencyModal .sim-radio-preview-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

/* Save all settings preset modal: same compact footer as STCA Parameters */
#saveSimSettingsPresetModal .save-sim-settings-preset-compact-btn.btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: calc(2.5rem / 3) calc(2rem / 3);
    font-size: 0.88rem;
    line-height: 1.2;
    min-height: 0;
}

#saveSimSettingsPresetModal .modal-footer.save-sim-settings-preset-footer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    padding: 1rem 1.25rem;
}

#saveSimSettingsPresetModal .save-sim-settings-preset-footer .save-sim-settings-preset-compact-btn {
    min-width: 5.5rem;
}

/* Edit Aircraft DB modal footer: compact, centered row */
#editAircraftDbModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: nowrap;
}

#editAircraftDbModal .modal-footer .btn {
    min-width: 0;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.05;
}

@media (max-width: 520px) {
    #editAircraftDbModal .modal-footer {
        flex-wrap: wrap; /* fall back gracefully on very small screens */
    }
}

#editAirlinesDbModal .modal-footer,
#airlinesDbResetConfirmModal .modal-footer,
#airlinesDbResetCautionModal .modal-footer,
#airlinesDbUnsavedConfirmModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: nowrap;
}

.airlines-db-footer-btn,
.airlines-db-confirm-footer .btn {
    min-width: 0;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.05;
}

@media (max-width: 520px) {
    #editAirlinesDbModal .modal-footer,
    #airlinesDbResetConfirmModal .modal-footer,
    #airlinesDbResetCautionModal .modal-footer,
    #airlinesDbUnsavedConfirmModal .modal-footer {
        flex-wrap: wrap;
    }
}

.airlines-db-search-wrap {
    margin-bottom: 0.75rem;
}

.airlines-db-search-field {
    position: relative;
}

.airlines-db-list-summary {
    margin: 0.5rem 0 0.65rem;
}

.airlines-db-table-wrap {
    max-height: min(52vh, 520px);
    overflow: auto;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 6px;
    background: rgba(15, 28, 45, 0.55);
}

.airlines-db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.airlines-db-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 0.55rem 0.85rem;
    background: rgba(26, 47, 74, 0.98);
    color: #c8d9ef;
    border-bottom: 1px solid rgba(74, 144, 226, 0.35);
    font-weight: 600;
}

.airlines-db-table tbody td {
    padding: 0.45rem 0.85rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.12);
    color: #f5f7fa;
    vertical-align: top;
}

.airlines-db-table tbody tr:hover {
    background: rgba(74, 144, 226, 0.12);
}

.airlines-db-table .airlines-db-code {
    width: 8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.04em;
    color: #9ec5ff;
}

.airlines-db-table .airlines-db-empty {
    text-align: center;
    color: #a8b8cc;
    font-style: italic;
}

.airlines-db-table tbody tr.airlines-db-row-modified {
    background: rgba(250, 204, 21, 0.18);
}

.airlines-db-table tbody tr.airlines-db-row-modified:hover {
    background: rgba(250, 204, 21, 0.26);
}

.airlines-db-table tbody tr.airlines-db-row-editing {
    background: rgba(74, 144, 226, 0.14);
}

.airlines-db-actions-col {
    width: 8.5rem;
    text-align: right;
}

.airlines-db-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.airlines-db-table tbody tr:hover .airlines-db-row-actions,
.airlines-db-table tbody tr.airlines-db-row-editing .airlines-db-row-actions {
    opacity: 1;
    pointer-events: auto;
}

.airlines-db-mini-btn {
    padding: 0.28rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.1;
    min-width: 0;
}

.airlines-db-row-input {
    width: 100%;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.88rem;
}

/* Stop / Restart Simulation confirm modal footer: small side-by-side buttons */
#stopSimulationConfirmModal .modal-footer,
#restartSimulationConfirmModal .modal-footer,
#simulationConnectedUsersModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: nowrap;
}

#stopSimulationConfirmModal .modal-footer .btn,
#restartSimulationConfirmModal .modal-footer .btn,
#simulationConnectedUsersModal .modal-footer .btn {
    min-width: 120px;
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
    border-radius: 6px;
    line-height: 1.05;
}

/* Simulation Settings modal footer: small side-by-side buttons */
/* SIM Settings: sub-panel triggers — height ≈ 1/3 of default .btn (padding scaled; text stays readable) */
#simulationSettingsModal .sim-settings-subpanel-btn.btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    /* Default .btn uses 2.5rem vertical padding — use one-third per side */
    padding: calc(2.5rem / 3) calc(2rem / 3);
    font-size: 0.88rem;
    line-height: 1.2;
    min-height: 0;
}

#simulationSettingsModal .modal-footer.sim-settings-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 1rem 1.25rem;
}

#simulationSettingsModal .sim-settings-footer-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Sim Settings footer: distinct from default .btn (compact outline / pill style) */
#simulationSettingsModal .sim-settings-footer-btn {
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.2;
    padding: 0.45rem 1.1rem;
    min-width: 9.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#simulationSettingsModal .sim-settings-footer-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(186, 230, 253, 0.45);
    color: #f8fafc;
}

#simulationSettingsModal .sim-settings-footer-btn:active {
    transform: translateY(1px);
}

#simulationSettingsModal .sim-settings-footer-btn-save {
    border-color: rgba(34, 197, 94, 0.55);
    background: linear-gradient(180deg, rgba(22, 101, 52, 0.55) 0%, rgba(15, 23, 42, 0.85) 100%);
    color: #ecfdf5;
}

#simulationSettingsModal .sim-settings-footer-btn-save:hover {
    border-color: rgba(74, 222, 128, 0.75);
    background: linear-gradient(180deg, rgba(22, 101, 52, 0.72) 0%, rgba(15, 23, 42, 0.9) 100%);
}

#simulationSettingsModal .sim-settings-footer-btn-outline {
    border-color: rgba(96, 165, 250, 0.38);
    background: rgba(30, 58, 95, 0.45);
    color: #dbeafe;
}

#simulationSettingsModal .sim-settings-footer-btn-outline:hover {
    border-color: rgba(147, 197, 253, 0.55);
    background: rgba(30, 58, 95, 0.72);
}

#simulationSettingsModal .sim-settings-footer-btn:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.75);
    outline-offset: 2px;
}

/* Label editor (modal) */
#simulationLabelEditorModal .sim-label-cell-free-text {
    display: none !important;
}

.sim-label-setup-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.6rem;
}

.sim-label-setup-row.has-inline-save {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.sim-label-setup-field {
    min-width: 0;
}

.sim-label-setup-actions-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sim-label-setup-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sim-label-setup-save-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sim-label-setup-save-spacer {
    visibility: hidden;
    margin-bottom: 0;
    line-height: 1.2;
    font-size: 0.875rem;
}

#simulationLabelEditorModal.admin-global-label-context .sim-label-editor-footer #saveLabelSetupBtn,
#simulationLabelEditorModal.admin-global-label-context .sim-label-editor-footer #deleteLabelSetupBtn {
    display: none;
}

#simulationLabelEditorModal.admin-global-label-context .sim-label-editor-footer {
    display: flex;
    justify-content: center;
}

#simulationLabelEditorModal.admin-global-label-context .admin-global-label-make-default-btn {
    display: inline-flex;
}

#simulationLabelEditorModal .admin-global-label-make-default-btn {
    display: none;
}

.admin-global-label-profile-row-select {
    display: grid;
    grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 1.6fr) auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
}

.admin-global-label-profile-row-select:first-child {
    grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 1.6fr);
}

.admin-global-label-profile-select {
    min-width: 0;
    width: 100%;
}

@media (max-width: 720px) {
    .admin-global-label-profile-row-select,
    .admin-global-label-profile-row-select:first-child {
        grid-template-columns: 1fr;
    }
}

#labelSetupSaveConfirmModal.active,
#labelSetupDeleteConfirmModal.active {
    z-index: 1230;
}

.label-setup-save-confirm-message {
    margin-bottom: 0;
}

.label-setup-save-confirm-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

#simulationLabelEditorModal .modal-footer.sim-label-editor-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
}

#simulationLabelEditorModal .sim-label-editor-footer .btn,
.sim-label-editor-action-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
    line-height: 1.05;
    min-width: 120px;
}

.sim-label-grid-wrap {
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

#simulationLabelEditorModal .sim-label-grid-wrap {
    overflow-x: visible;
}

@media (max-width: 900px) {
    #simulationLabelEditorModal .sim-label-grid-wrap {
        overflow-x: auto;
    }
}

.sim-label-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-width: 860px; /* ensure 5 columns are visible with scroll if needed */
}

.sim-label-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

@media (max-width: 560px) {
    .sim-label-setup-row,
    .sim-label-setup-row.has-inline-save {
        grid-template-columns: 1fr;
    }
    .sim-label-grid {
        grid-template-columns: repeat(5, minmax(140px, 1fr));
        min-width: 760px;
    }
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 140, 66, 0.2);
    color: #ff8c42;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.settings-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
    justify-items: stretch;
}

.settings-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.settings-menu-wrap {
    position: relative;
    width: 100%;
}

.settings-main-btn,
.settings-secondary-btn {
    width: 100%;
    min-width: 0;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
}

.settings-submenu {
    position: absolute;
    top: calc(100% - 0.2rem);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem;
    background: rgba(18, 32, 52, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.38);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.settings-menu-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.55rem;
}

.settings-menu-wrap:hover .settings-submenu,
.settings-menu-wrap:focus-within .settings-submenu {
    display: flex;
}

.settings-submenu-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    text-align: left;
}

.settings-submenu-btn .btn-text {
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.settings-submenu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
}

.settings-submenu-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.settings-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
}

.settings-btn-icon svg {
    width: 2.75rem;
    height: 2.75rem;
}

.settings-buttons-grid .btn {
    width: 100%;
    min-width: 0;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
}

.settings-buttons-grid .settings-main-btn .btn-text,
.settings-buttons-grid .settings-secondary-btn .btn-text {
    font-size: 1.15rem;
}

@media (max-width: 640px) {
    .settings-buttons-grid {
        grid-template-columns: 1fr;
    }
}

.settings-export-import-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(74, 144, 226, 0.22);
}

.settings-export-import-row .settings-half-btn {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
}

.settings-admin-row {
    margin-top: 0.75rem;
}

.settings-admin-row .settings-admin-btn {
    width: 100%;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
}

.exercise-categories-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exercise-categories-intro {
    margin: 0;
}

.exercise-categories-create-row {
    display: flex;
    align-items: flex-end;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.exercise-categories-create-field {
    flex: 1 1 240px;
    margin: 0;
}

.exercise-categories-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.3fr);
    gap: 1rem;
    align-items: start;
}

.exercise-categories-panel {
    background: rgba(8, 16, 28, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.24);
    border-radius: 10px;
    padding: 0.85rem;
    min-height: 320px;
}

.exercise-categories-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.exercise-categories-panel-header h3,
.exercise-categories-section h4 {
    margin: 0;
    font-size: 1rem;
}

.exercise-categories-delete-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

.exercise-categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 420px;
    overflow-y: auto;
}

.exercise-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(74, 144, 226, 0.22);
    background: rgba(18, 32, 52, 0.72);
    color: #f5f7fa;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.exercise-category-item:hover,
.exercise-category-item.is-selected {
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(30, 58, 95, 0.82);
}

.exercise-category-item-name {
    font-weight: 600;
}

.exercise-category-item-count {
    font-size: 0.82rem;
    opacity: 0.78;
    white-space: nowrap;
}

.exercise-categories-section + .exercise-categories-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(74, 144, 226, 0.18);
}

.exercise-categories-exercise-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 220px;
    overflow-y: auto;
}

.exercise-category-exercise-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(74, 144, 226, 0.16);
    background: rgba(12, 22, 36, 0.72);
}

.exercise-category-exercise-label {
    min-width: 0;
    font-size: 0.92rem;
}

.exercise-category-exercise-meta {
    display: block;
    font-size: 0.78rem;
    opacity: 0.75;
    margin-top: 0.15rem;
}

.exercise-category-exercise-row .btn {
    flex-shrink: 0;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

.subscriber-exercise-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding-bottom: 1.5rem;
}

.subscriber-exercise-card.is-start-ready {
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.18);
}

.subscriber-exercise-card:hover {
    border-color: rgba(96, 165, 250, 0.45);
}

.subscriber-exercise-start-rail {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.1rem;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
    pointer-events: none;
}

.subscriber-exercise-card.is-start-ready .subscriber-exercise-start-rail {
    transform: translateX(0);
    pointer-events: auto;
}

.subscriber-exercise-start-btn.btn {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0 0 8px 8px;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.exercise-categories-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.exercise-categories-footer .btn {
    min-width: 110px;
}

@media (max-width: 768px) {
    .exercise-categories-layout {
        grid-template-columns: 1fr;
    }
}

.admin-modal-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-modal-footer .btn {
    flex-direction: row;
    min-width: 110px;
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
}

.admin-error-text {
    color: #fca5a5;
    font-weight: 700;
    margin-top: 0.6rem;
}

.admin-message-text {
    font-weight: 700;
    margin-top: 0.6rem;
}

.admin-message-text.ok {
    color: #86efac;
}

.admin-message-text.error {
    color: #fca5a5;
}

.admin-ai-pilot-instructions-btn {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
}

.admin-ai-pilot-instructions-textarea {
    min-height: 24rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.45;
}

/* Admin + simulation label editor stacking (label editor moved to top-level DOM) */
#adminSettingsModal.active {
    z-index: 1100;
}

#adminAiPilotInstructionsModal.active {
    z-index: 1150;
}

#adminEmailSettingsModal.active {
    z-index: 1150;
}

#adminLoadSystemSettingModal.active {
    z-index: 1150;
}

#simulationLabelEditorModal.active {
    z-index: 1200;
}

#adminSingleUserLabelConfigModal.active,
#adminHostedSessionsLabelConfigModal.active {
    z-index: 1220;
}

#simulationLabelAuthModal.active {
    z-index: 1250;
}

.admin-global-label-profiles {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(74, 144, 226, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-global-label-profile-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.admin-global-label-profile-label {
    color: rgba(245, 247, 250, 0.88);
    font-size: 0.92rem;
}

.admin-global-label-profile-name {
    color: rgba(245, 247, 250, 0.72);
    font-style: italic;
    font-size: 0.92rem;
}

.admin-global-label-profile-edit-btn {
    margin-left: auto;
}

.admin-global-label-compact-btn {
    min-width: 4.5rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

#adminSingleUserLabelConfigModal .admin-single-user-label-intro,
#adminHostedSessionsLabelConfigModal .admin-single-user-label-intro {
    margin-top: 0;
    margin-bottom: 1rem;
}

.admin-single-user-profile-setup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.85rem;
}

.admin-single-user-profile-field {
    min-width: 0;
}

.admin-single-user-profile-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#adminSingleUserLabelConfigModal .admin-single-user-label-footer,
#adminHostedSessionsLabelConfigModal .admin-single-user-label-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.admin-fst-label-config-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-fst-label-config-header-row,
.admin-fst-label-config-row {
    display: grid;
    grid-template-columns: minmax(11rem, 1.25fr) minmax(9rem, 1fr) minmax(9rem, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.admin-fst-label-config-header-row {
    margin-bottom: 0.15rem;
}

.admin-fst-label-config-col-header {
    color: rgba(245, 247, 250, 0.82);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}

.admin-fst-label-config-header-spacer {
    visibility: hidden;
}

.admin-fst-label-config-label {
    color: rgba(245, 247, 250, 0.92);
    font-size: 0.92rem;
}

.admin-fst-label-config-select {
    width: 100%;
}

.admin-hosted-sessions-role-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.admin-hosted-sessions-role-btn {
    min-width: 3.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.72;
    border: 1px solid rgba(245, 247, 250, 0.22);
    background: rgba(44, 62, 80, 0.55);
    color: rgba(245, 247, 250, 0.88);
}

.admin-hosted-sessions-role-btn:hover {
    opacity: 0.92;
}

.admin-hosted-sessions-role-btn.active {
    opacity: 1;
    background: #4a90e2;
    border-color: #6ba8ea;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.35), 0 0 10px rgba(74, 144, 226, 0.35);
}

@media (max-width: 720px) {
    .admin-fst-label-config-header-row,
    .admin-fst-label-config-row {
        grid-template-columns: 1fr;
    }

    .admin-fst-label-config-header-row {
        display: none;
    }

    .admin-single-user-profile-setup-row {
        grid-template-columns: 1fr;
    }
}

.import-data-file-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.import-data-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.import-data-file-label {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.import-data-empty-hint {
    margin-bottom: 0;
}

.import-data-options-panel {
    margin-top: 0.75rem;
}

.import-data-name-mode-fieldset {
    border: 1px solid rgba(74, 144, 226, 0.28);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin: 0 0 1rem 0;
}

.import-data-name-mode-fieldset legend {
    padding: 0 0.35rem;
}

.import-data-radio-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0;
    cursor: pointer;
    color: rgba(245, 247, 250, 0.95);
}

.import-data-radio-label input {
    flex-shrink: 0;
}

.import-data-columns {
    margin-top: 0.25rem;
}

.import-data-scroll .import-data-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.import-data-row .import-data-row-main {
    flex: 1;
    min-width: 120px;
}

.import-data-name-field {
    flex: 1;
    min-width: 140px;
    max-width: 260px;
    margin: 0 !important;
    display: none;
}

#importDataModal.import-data-modal--custom-names .import-data-name-field {
    display: block;
}

.import-data-foot-hint {
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Export data modal */
.export-data-intro {
    margin-bottom: 1rem;
}

.export-data-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .export-data-columns {
        grid-template-columns: 1fr;
    }
}

.export-data-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.export-data-column-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f5f7fa;
}

.export-data-column-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.export-data-mini-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.export-data-scroll {
    max-height: min(360px, 45vh);
    overflow-y: auto;
    border: 1px solid rgba(74, 144, 226, 0.28);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: rgba(12, 22, 38, 0.35);
}

.export-data-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    color: rgba(245, 247, 250, 0.95);
}

.export-data-row:hover {
    background: rgba(74, 144, 226, 0.12);
}

.export-data-row input[type='checkbox'] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.export-data-row .export-data-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.export-data-row .export-data-row-title {
    font-weight: 500;
    word-break: break-word;
}

.export-data-row .export-data-row-sub {
    font-size: 0.82rem;
    opacity: 0.85;
}

.export-data-row .export-data-id {
    font-size: 0.72rem;
    opacity: 0.65;
    word-break: break-all;
    margin-top: 0.15rem;
}

.export-data-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Edit Exercise */
.edit-exercise-topbar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 0.65rem 1rem 0.75rem;
    background: rgba(26, 47, 74, 0.72);
    border-bottom: 2px solid rgba(74, 144, 226, 0.25);
}

.edit-exercise-topbar-selects {
    flex: 0 1 26rem;
    min-width: 0;
    max-width: 26rem;
}

.edit-exercise-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.edit-exercise-topbar-dropdown {
    position: relative;
    flex: 0 0 auto;
}

/* Invisible bridge so pointer can reach the menu without closing hover */
.edit-exercise-topbar-dropdown:hover::before,
.edit-exercise-topbar-dropdown:focus-within::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 1px);
    height: 0.65rem;
    z-index: 119;
}

.edit-exercise-topbar-dropdown-trigger {
    min-height: 2.35rem;
    min-width: 5.5rem;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 121;
}

/* Keep trigger seated while menu is open — avoids gap from translateY(-5px) lift */
.edit-exercise-topbar-dropdown:hover .edit-exercise-topbar-dropdown-trigger,
.edit-exercise-topbar-dropdown:focus-within .edit-exercise-topbar-dropdown-trigger {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.edit-exercise-topbar-dropdown:hover .edit-exercise-topbar-dropdown-trigger:active,
.edit-exercise-topbar-dropdown:focus-within .edit-exercise-topbar-dropdown-trigger:active {
    transform: none;
}

.edit-exercise-topbar-action-btn {
    min-height: 2.35rem;
    min-width: 8.25rem;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    line-height: 1.1;
    white-space: nowrap;
}

.edit-exercise-topbar-action-btn .exercise-flights-count {
    display: inline;
    white-space: nowrap;
}

.edit-exercise-topbar-dropdown-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    position: absolute;
    top: calc(100% + 0.15rem);
    left: 0;
    min-width: 100%;
    width: max-content;
    padding: 0.45rem;
    background: rgba(26, 47, 74, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    z-index: 120;
}

.edit-exercise-topbar-dropdown-item.btn:hover {
    transform: none;
}

.edit-exercise-topbar-dropdown:hover .edit-exercise-topbar-dropdown-menu,
.edit-exercise-topbar-dropdown:focus-within .edit-exercise-topbar-dropdown-menu {
    display: flex;
}

.edit-exercise-topbar-dropdown:has(.edit-exercise-topbar-dropdown-trigger:disabled) .edit-exercise-topbar-dropdown-menu {
    display: none !important;
}

.edit-exercise-topbar-dropdown-item.btn {
    width: 100%;
    min-width: 10.5rem;
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.exercise-flights-popup-modal-content {
    max-height: 85vh;
}

.exercise-flights-popup-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.exercise-flights-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.exercise-flights-popup-container {
    max-height: 62vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.edit-exercise-topbar .exercise-label {
    margin: 0 0 0.35rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(245, 247, 250, 0.82);
}

.edit-exercise-topbar .form-select {
    min-height: 2.35rem;
}

.edit-exercise-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

.exercise-sidebar {
    flex: 0 0 33.333333%;
    width: 33.333333%;
    max-width: 33.333333%;
    min-width: 0;
    background: rgba(26, 47, 74, 0.55);
    border-right: 2px solid rgba(74, 144, 226, 0.25);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.exercise-sidebar--traffic-hidden {
    display: none;
}

.exercise-sidebar-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    min-width: 0;
}

.exercise-sidebar-preview-sticky {
    flex: 0 0 auto;
    flex-shrink: 0;
    z-index: 2;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.exercise-sidebar-preview-section {
    margin: 0;
}

.exercise-sidebar-preview-section .exercise-preview-time-block {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.exercise-sidebar-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 0.75rem;
}

.exercise-create-flows-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.exercise-create-flows-title {
    margin: 0;
    font-size: 1.05rem;
    color: #f5f7fa;
    font-weight: 600;
}

.exercise-create-flows-close {
    position: static;
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.15rem 0.45rem;
}

.exercise-flows-subheader {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #f5f7fa;
    font-weight: 600;
}

.exercise-flows-list-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.exercise-flows-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exercise-flow-list-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: rgba(44, 62, 80, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    color: #f5f7fa;
    font-size: 0.9rem;
}

.exercise-flow-list-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.exercise-flow-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.exercise-flow-list-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.add-flow-details-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.add-flow-reposition-wrap {
    margin-bottom: 0;
}

.flow-details-read-dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
}

.flow-details-read-dl dt {
    margin: 0;
    color: rgba(245, 247, 250, 0.65);
    font-weight: 600;
}

.flow-details-read-dl dd {
    margin: 0;
    color: #f5f7fa;
}

.flow-details-read-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flow-details-read-swatch {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    vertical-align: middle;
}

.delete-flow-confirm-message {
    margin: 0 0 1rem 0;
    color: #f5f7fa;
    font-size: 0.95rem;
}

.delete-flow-confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.flow-details-subflow-toolbar {
    margin-bottom: 0.75rem;
}

.flow-details-subflows-heading {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #f5f7fa;
    font-weight: 600;
}

.flow-details-subflows-list {
    margin-bottom: 1.25rem;
    max-height: 12rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.flow-subflow-list-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    background: rgba(44, 62, 80, 0.45);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 6px;
    font-size: 0.88rem;
    color: #f5f7fa;
}

.flow-subflow-list-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.flow-subflow-list-item-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-subflow-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.flow-subflow-list-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.flow-details-read-dl--main {
    margin-top: 0.5rem;
}

.form-textarea {
    min-height: 3rem;
    resize: vertical;
    font-family: inherit;
}

#createSubFlowModal .form-input.form-input--invalid,
#createSubFlowModal .form-textarea.form-input--invalid {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.35);
}

.exercise-flow-color-dot {
    flex-shrink: 0;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.exercise-flow-list-name {
    min-width: 0;
}

.exercise-add-flow-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exercise-add-flow-btn {
    width: 100%;
    padding: 0.28rem 0.75rem;
    min-height: 0;
    line-height: 1.2;
    font-size: 0.85rem;
}

.exercise-add-flow-btn.add-flow-pick-active {
    background: #c62828;
    border-color: #b71c1c;
    color: #fff;
}

.exercise-add-flow-btn.add-flow-pick-active:hover {
    background: #b71c1c;
}

.exercise-add-flow-hint {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.85);
}

.exercise-save-flows-btn {
    width: 100%;
}

.exercise-preview-time-block {
    width: 100%;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.exercise-preview-time-label {
    display: block;
    margin: 0 0 0.4rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.88);
}

.exercise-preview-time-slider {
    display: block;
    width: 100%;
    height: 1.35rem;
    margin: 0;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.exercise-preview-time-slider:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.exercise-preview-time-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(44, 62, 80, 0.9);
    border: 1px solid rgba(74, 144, 226, 0.35);
}

.exercise-preview-time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    background: #4a90e2;
    border: 2px solid rgba(245, 247, 250, 0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.exercise-preview-time-slider:disabled::-webkit-slider-thumb {
    background: rgba(74, 144, 226, 0.45);
}

.exercise-preview-time-slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(44, 62, 80, 0.9);
    border: 1px solid rgba(74, 144, 226, 0.35);
}

.exercise-preview-time-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4a90e2;
    border: 2px solid rgba(245, 247, 250, 0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.exercise-preview-clock-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.45rem;
    width: 100%;
}

.exercise-preview-time-clock {
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: #f5f7fa;
}

.exercise-flights-list-textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 12rem;
}

.exercise-flights-list-text-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-input-color {
    height: 2.25rem;
    padding: 0.15rem 0.25rem;
    cursor: pointer;
}

.exercise-sidebar-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #f5f7fa;
    font-weight: 600;
}

.exercise-select-row {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: flex-start;
    min-width: 0;
}

.exercise-select-field {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.exercise-label {
    display: block;
    margin: 0.5rem 0 0.25rem 0;
    font-size: 0.85rem;
    color: rgba(245, 247, 250, 0.85);
}

.exercise-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exercise-sidebar-actions .btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
}

.exercise-sidebar-actions-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: stretch;
    min-width: 0;
}

.exercise-sidebar-actions-row--compact .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.2;
    box-sizing: border-box;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;
    text-align: center;
}

.exercise-sidebar-actions-grid {
    display: grid;
    grid-template-columns: 1fr minmax(6.25rem, 28%);
    grid-template-rows: auto auto;
    gap: 0.5rem;
    align-items: stretch;
}

.exercise-sidebar-actions-grid > .exercise-sidebar-actions-row:first-of-type {
    grid-column: 1;
    grid-row: 1;
}

.exercise-sidebar-actions-grid > .exercise-sidebar-actions-row:nth-of-type(2) {
    grid-column: 1;
    grid-row: 2;
}

.exercise-save-exercise-wrap {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.exercise-save-exercise-wrap .exercise-save-exercise-btn {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.exercise-sector-load-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.exercise-sector-load-section--active {
    flex: 1 1 auto;
    min-height: 8rem;
}

.exercise-sector-load-btn,
.exercise-view-options-btn,
.exercise-ai-pilot-btn {
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
}

.edit-exercise-topbar .exercise-sector-load-btn,
.edit-exercise-topbar .exercise-view-options-btn,
.edit-exercise-topbar .exercise-ai-pilot-btn {
    width: auto;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
}

.exercise-sector-load-btn[aria-pressed="true"],
.exercise-view-options-btn[aria-pressed="true"],
.exercise-ai-pilot-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    border-color: rgba(248, 113, 113, 0.85);
    color: #ffffff;
}

.exercise-ai-pilot-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.exercise-ai-pilot-section--active {
    flex: 0 0 auto;
    min-height: 0;
}

.exercise-ai-pilot-panel {
    flex: 0 0 auto;
    min-height: 0;
    max-height: min(72vh, 640px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
    background: rgba(15, 28, 45, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    color: #f5f7fa;
}

.exercise-ai-pilot-panel[hidden] {
    display: none !important;
}

.exercise-ai-pilot-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f5f7fa;
}

.exercise-ai-pilot-hint {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.exercise-ai-pilot-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.95);
}

.exercise-ai-pilot-context {
    flex: 0 0 auto;
    min-height: 10rem;
    width: 100%;
    resize: vertical;
    font-size: 0.88rem;
    line-height: 1.4;
}

.exercise-ai-pilot-saved-hint {
    min-height: 1.1rem;
    margin: 0;
}

.exercise-ai-pilot-save-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.exercise-ai-pilot-save-btn {
    flex-shrink: 0;
    min-width: 8.25rem;
}

.exercise-scripts-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 0.35rem;
}

.exercise-scripts-section[hidden] {
    display: none !important;
}

.exercise-scripts-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
    background: rgba(15, 28, 45, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    color: #f5f7fa;
    min-height: 8rem;
}

.exercise-scripts-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.exercise-scripts-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f5f7fa;
    flex: 1 1 auto;
    min-width: 0;
}

.exercise-scripts-delete-all-btn {
    flex-shrink: 0;
}

.exercise-scripts-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.exercise-scripts-generate-init-calls-btn:disabled,
.exercise-scripts-delete-all-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.exercise-scripts-body {
    flex: 1 1 auto;
    min-height: 6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.exercise-scripts-empty {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.75);
}

.exercise-script-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.4rem 0.55rem;
    background: rgba(44, 62, 80, 0.45);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.35;
    color: #f5f7fa;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.exercise-script-list-item:hover {
    border-color: rgba(74, 144, 226, 0.45);
    background: rgba(74, 144, 226, 0.1);
}

.exercise-script-list-item.selected {
    border-color: rgba(74, 144, 226, 0.55);
    background: rgba(74, 144, 226, 0.14);
}

.exercise-ai-pilot-script-lbl-tin-wrap {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(234, 179, 8, 0.45);
    background: rgba(234, 179, 8, 0.08);
}

.exercise-ai-pilot-script-lbl-tin-command {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.exercise-script-list-item-initial-call .exercise-script-list-label {
    color: #c2410c;
}

.exercise-script-list-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exercise-script-list-actions {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.2rem;
}

.exercise-script-list-item.selected .exercise-script-list-actions {
    display: flex;
}

.exercise-script-list-actions .btn {
    min-width: 0;
    min-height: 1.65rem;
    padding: 0.15rem 0.35rem;
    line-height: 1;
}

.exercise-script-list-actions .btn-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.exercise-scripts-delete-all-confirm-actions {
    justify-content: center;
    flex-wrap: wrap;
}

.exercise-ai-pilot-script-modal-body .form-group {
    margin-bottom: 0.85rem;
}

.exercise-ai-pilot-script-field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.95);
}

.exercise-ai-pilot-script-readonly {
    padding: 0.45rem 0.6rem;
    background: rgba(44, 62, 80, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 6px;
    font-size: 0.9rem;
    color: #f5f7fa;
    font-variant-numeric: tabular-nums;
}

.exercise-ai-pilot-script-textarea {
    width: 100%;
    min-height: 4.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.exercise-ai-pilot-script-checkbox {
    margin-top: 0.45rem;
    font-size: 0.88rem;
}

.exercise-ai-pilot-script-command-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.exercise-ai-pilot-script-command-header .exercise-ai-pilot-script-field-label {
    margin-bottom: 0;
    flex: 1 1 auto;
}

.exercise-ai-pilot-script-transform-btn {
    flex-shrink: 0;
}

.exercise-ai-pilot-script-transformed-wrap {
    margin-top: 0.15rem;
}

.exercise-ai-pilot-script-transformed-output {
    background: rgba(44, 62, 80, 0.45);
    color: #f5f7fa;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

.exercise-ai-pilot-script-command-assessment {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.85);
}

.exercise-ai-pilot-script-command-assessment.is-valid {
    color: #4ade80;
}

.exercise-ai-pilot-script-command-assessment.is-invalid {
    color: #f87171;
}

.exercise-ai-pilot-script-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.exercise-sector-load-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.exercise-sector-load-panel[hidden] {
    display: none !important;
}

.exercise-sector-load-chart-wrap {
    flex: 1 1 auto;
    min-height: 11rem;
    background: rgba(15, 28, 45, 0.65);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    padding: 0.35rem;
    overflow: hidden;
}

.exercise-sector-load-canvas {
    display: block;
    width: 100%;
    height: 220px;
}

.exercise-sector-load-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    font-size: 0.72rem;
    color: rgba(245, 247, 250, 0.92);
    line-height: 1.25;
}

.exercise-sector-load-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
}

.exercise-sector-load-legend-swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.exercise-sector-load-legend-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exercise-view-options-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.exercise-view-options-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(15, 28, 45, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    color: #f5f7fa;
}

.exercise-view-options-panel[hidden] {
    display: none !important;
}

.exercise-view-options-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f5f7fa;
}

.exercise-view-option {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.exercise-view-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.exercise-view-option-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.92);
}

.exercise-view-option-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    min-width: 2rem;
    text-align: right;
}

.exercise-view-option-slider {
    width: 100%;
}

.exercise-view-option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.92);
    cursor: pointer;
    user-select: none;
}

.exercise-view-option-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: #4a90e2;
}

.exercise-flights-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.exercise-flights-section:not(.exercise-flights-section--collapsed) {
    flex: 1;
}

.exercise-flights-section--collapsed {
    flex: 0 0 auto;
}

.exercise-flights-section-header-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    margin: 0 0 0.5rem 0;
}

.exercise-flights-section--collapsed .exercise-flights-section-header-row {
    margin-bottom: 0;
}

.exercise-flights-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0.3rem 0.35rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    color: #f5f7fa;
    font-weight: 600;
    text-align: left;
}

.exercise-flights-section-toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.exercise-flights-section-toggle:focus {
    outline: none;
}

.exercise-flights-section-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.65);
}

.exercise-flights-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    min-width: 0;
}

.exercise-flights-header-actions .exercise-flights-header-btn.btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    min-height: 0;
    box-shadow: none;
    transform: none;
    white-space: nowrap;
}

.exercise-flights-header-actions .exercise-flights-header-btn.btn:hover:not(:disabled) {
    transform: none;
}

.exercise-flights-header-actions .exercise-flights-header-btn.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.exercise-flights-section-chevron {
    display: inline-block;
    flex-shrink: 0;
    font-size: 0.6rem;
    line-height: 1;
    opacity: 0.9;
    transition: transform 0.15s ease;
}

.exercise-flights-section--collapsed .exercise-flights-section-chevron {
    transform: rotate(-90deg);
}

.exercise-flights-count {
    font-weight: 500;
    opacity: 0.88;
}

.exercise-flights-section-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.exercise-flights-section--collapsed .exercise-flights-section-body {
    display: none;
}

.exercise-flights-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.25rem;
}

.exercise-flight-item {
    background: rgba(44, 62, 80, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
}

.exercise-flight-item:hover {
    border-color: rgba(74, 144, 226, 0.5);
    background: rgba(74, 144, 226, 0.12);
}

.exercise-flight-line {
    color: #f5f7fa;
    font-size: 0.9rem;
    line-height: 1.35;
    word-break: break-word;
}

.exercise-flight-actions {
    display: none;
    margin-top: 0.6rem;
    gap: 0.5rem;
}

.exercise-flight-item.selected .exercise-flight-actions {
    display: flex;
}

.exercise-flight-actions .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.exercise-map {
    flex: 1 1 0;
    min-width: 0;
    background: #ffffff;
}

@media (max-width: 900px) {
    .edit-exercise-topbar-selects {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-exercise-container {
        flex-direction: column;
    }
    .exercise-sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }
    .exercise-map {
        flex: 1 1 0;
        width: 100%;
        max-width: 100%;
        min-height: 0;
    }
}

.exercise-editor-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

.exercise-script-marker-tooltip {
    position: absolute;
    z-index: 12;
    max-width: min(280px, 90vw);
    padding: 0.45rem 0.6rem;
    background: rgba(15, 28, 45, 0.96);
    border: 1px solid rgba(74, 144, 226, 0.55);
    border-radius: 6px;
    color: #f5f7fa;
    font-size: 0.8rem;
    line-height: 1.35;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    white-space: pre-wrap;
    word-break: break-word;
}

.exercise-script-marker-tooltip[hidden] {
    display: none !important;
}

#exerciseEditorCanvasElement {
    width: 100%;
    height: 100%;
    display: block;
    cursor: default;
    user-select: none;
}

.add-flight-route-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.add-flight-route-label-row label {
    margin-bottom: 0;
}

.add-flight-pick-route-btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.8rem !important;
    min-height: 0 !important;
    flex-shrink: 0;
}

.add-flight-route-pick-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: 12px;
    z-index: 12000;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: min(960px, calc(100vw - 24px));
    padding: 0.6rem 1rem;
    background: rgba(26, 47, 74, 0.95);
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.add-flight-route-pick-banner-text {
    font-size: 0.85rem;
    color: #f5f7fa;
    line-height: 1.35;
}

.add-flight-route-pick-context-menu {
    position: fixed;
    z-index: 12001;
    min-width: 180px;
    padding: 0.35rem;
    background: rgba(26, 47, 74, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.5);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    flex-direction: column;
    gap: 0.25rem;
}

.add-flight-route-pick-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    color: #f5f7fa;
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 6px;
    cursor: pointer;
}

.add-flight-route-pick-menu-item:hover {
    background: rgba(74, 144, 226, 0.35);
}

#exerciseEditorRouteDisambigPanel {
    z-index: 12002;
}

.hint-text {
    color: rgba(245, 247, 250, 0.7);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: block;
}

.sim-presets-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    max-height: 280px;
    overflow-y: auto;
}

.sim-presets-list li {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
}

.sim-presets-list li:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sim-presets-list li.sim-preset-row {
    cursor: default;
}

.sim-preset-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}

.sim-preset-row .sim-preset-name {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.sim-preset-delete-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    min-height: 0 !important;
    border-radius: 6px;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

.sim-preset-delete-btn.btn:hover {
    transform: none;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: end;
}

#addFlightModal .add-flight-compact-row label {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

#addFlightModal .add-flight-compact-row .form-input {
    padding: 0.45rem 0.5rem;
    font-size: 0.88rem;
}

#addFlightModal .add-flight-compact-block .hint-text {
    margin-top: 0.35rem;
}

.exercise-autocomplete-group {
    position: relative;
}

/* Selection Step Styles */
.selection-step {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #f5f7fa;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-back {
    background: rgba(44, 62, 80, 0.8);
    border: 2px solid rgba(74, 144, 226, 0.4);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #f5f7fa;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: rgba(74, 144, 226, 0.3);
    border-color: rgba(74, 144, 226, 0.6);
    transform: translateX(-3px);
    color: #4a90e2;
}

.step-header .step-title {
    flex: 1;
    margin: 0;
    text-align: left;
}

/* Sector Selection Grid */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sector-card {
    background: rgba(44, 62, 80, 0.85);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.sector-card:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.3);
}

.sector-card.selected {
    border-color: #ff8c42;
    background: rgba(255, 140, 66, 0.15);
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3);
}

.sector-card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f5f7fa;
    margin-bottom: 0.5rem;
}

.sector-card-description {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Exercises List Styles */
.exercises-list {
    max-height: min(56vh, 520px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.exercises-list > .exercise-card,
.exercises-list > .subscriber-exercise-card {
    flex: 0 0 auto;
    flex-shrink: 0;
}

#categoryExerciseSelectionStep {
    min-height: 0;
}

#categoryExerciseSelectionStep .step-header {
    flex: 0 0 auto;
}

#categoryExercisesList {
    flex: 1 1 auto;
    min-height: 0;
}

#selectExerciseModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 820px);
    overflow: hidden;
}

#selectExerciseModal .modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#selectExerciseModal .selection-step {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.exercises-list::-webkit-scrollbar {
    width: 8px;
}

.exercises-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.exercises-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.exercises-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.exercise-card {
    background: rgba(44, 62, 80, 0.85);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.exercise-card:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.6);
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.3);
}

.exercise-card.selected {
    border-color: #ff8c42;
    background: rgba(255, 140, 66, 0.15);
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3);
}

.exercise-card-action {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(74, 144, 226, 0.3);
    display: flex;
    justify-content: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-run-simulation {
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
}

.exercise-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f5f7fa;
    flex: 1;
}

.exercise-card-date {
    font-size: 0.85rem;
    opacity: 0.7;
    white-space: nowrap;
    margin-left: 1rem;
}

.exercise-card-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.exercise-detail-item {
    display: flex;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.exercise-detail-label {
    font-weight: 600;
    min-width: 120px;
    opacity: 0.9;
}

.exercise-detail-value {
    flex: 1;
    opacity: 0.8;
    line-height: 1.5;
}


.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    opacity: 0.7;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.2rem;
    line-height: 1.6;
}

.create-exercise-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.create-exercise-container .btn {
    min-width: 200px;
    padding: 1.5rem 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    color: #f5f7fa;
}

.form-group label.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: #4a90e2;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(26, 47, 74, 0.6);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    color: #f5f7fa;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* Ensure dropdown option text is readable (native option list is typically white) */
select option,
select optgroup {
    color: #000000;
    background: #ffffff;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(245, 247, 250, 0.5);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.15);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.aircraft-db-textarea {
    min-height: 320px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    line-height: 1.35;
    white-space: pre;
}

.aircraft-db-editor {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 10px;
    background: rgba(26, 47, 74, 0.35);
    border: 1px solid rgba(74, 144, 226, 0.25);
}

.aircraft-db-editor-header {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.aircraft-db-editor-select {
    min-width: 240px;
    flex: 1;
}

.aircraft-db-editor-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.aircraft-db-editor-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.aircraft-db-editor-actions .btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.05;
}

.aircraft-db-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .aircraft-db-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .aircraft-db-fields-grid {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.form-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Delete Exercises Styles */
.delete-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.delete-exercises-list::-webkit-scrollbar {
    width: 8px;
}

.delete-exercises-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.delete-exercises-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.delete-exercise-item {
    background: rgba(44, 62, 80, 0.6);
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.delete-exercise-item:hover {
    border-color: rgba(231, 76, 60, 0.6);
    background: rgba(231, 76, 60, 0.1);
}

.delete-exercise-info {
    flex: 1;
}

.delete-exercise-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f5f7fa;
    margin-bottom: 0.5rem;
}

.delete-exercise-details {
    font-size: 0.9rem;
    color: rgba(245, 247, 250, 0.7);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.delete-exercise-sector {
    color: #4a90e2;
}

.delete-exercise-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 2px solid rgba(231, 76, 60, 0.5);
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.delete-exercise-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: rgba(231, 76, 60, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Edit Airspace: airspace selector (⅓ width) + Save / Duplicate / Print on one row */
.edit-sector-toolbar-leading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    flex: 1 1 100%;
    box-sizing: border-box;
}

.edit-sector-select-wrap {
    flex: 0 0 calc(100% / 3);
    width: calc(100% / 3);
    max-width: calc(100% / 3);
    min-width: 0;
    box-sizing: border-box;
}

.edit-sector-select-wrap .form-select {
    width: 100%;
    min-width: 0;
}

.edit-sector-leader-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.btn.edit-sector-btn-duplicate {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    border-color: rgba(13, 71, 161, 0.55);
    color: #ffffff;
}

.btn.edit-sector-btn-duplicate:hover {
    background: linear-gradient(135deg, #283593 0%, #1565c0 100%);
    border-color: rgba(21, 101, 192, 0.75);
    color: #ffffff;
}

.edit-sector-inport-file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.edit-sector-inport-compact-btn.btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    line-height: 1.15;
    min-width: 0;
    min-height: 0;
    width: auto;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.edit-sector-inport-file-name {
    color: rgba(245, 247, 250, 0.88);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.edit-sector-inport-status {
    min-height: 1.2rem;
    margin-bottom: 0.75rem;
}

.edit-sector-inport-status.error {
    color: #ef4444;
}

.edit-sector-inport-status.ok {
    color: #22c55e;
}

.edit-sector-inport-column-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    max-height: 9rem;
    overflow: auto;
    margin: 0 0 0.75rem 0;
    padding: 0.65rem;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    background: rgba(15, 28, 45, 0.35);
}

.edit-sector-inport-column-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 22rem;
    color: rgba(245, 247, 250, 0.92);
    font-size: 0.82rem;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.edit-sector-inport-column-option input {
    flex-shrink: 0;
    accent-color: #4a90e2;
}

.edit-sector-inport-column-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-sector-inport-preview-wrap {
    max-width: 100%;
    max-height: 58vh;
    overflow-x: scroll;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
    border: 1px solid rgba(74, 144, 226, 0.35);
    border-radius: 8px;
    background: rgba(15, 28, 45, 0.42);
}

.edit-sector-inport-preview-wrap::-webkit-scrollbar {
    height: 14px;
    width: 14px;
}

.edit-sector-inport-preview-wrap::-webkit-scrollbar-track {
    background: rgba(15, 28, 45, 0.95);
    border-radius: 999px;
}

.edit-sector-inport-preview-wrap::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.9);
    border: 3px solid rgba(15, 28, 45, 0.95);
    border-radius: 999px;
}

.edit-sector-inport-preview-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 1);
}

#editSectorInportModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.edit-sector-inport-load-flow-select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 8px;
    background: rgba(15, 28, 45, 0.82);
    color: #f5f7fa;
    font-size: 0.95rem;
}

.edit-sector-inport-load-flow-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.edit-sector-inport-preview-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    color: #f5f7fa;
    font-size: 0.85rem;
}

.edit-sector-inport-preview-table th,
.edit-sector-inport-preview-table td {
    border: 1px solid rgba(74, 144, 226, 0.25);
    padding: 0.45rem 0.65rem;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    width: max-content;
    max-width: none;
}

.edit-sector-inport-preview-table th {
    background: rgba(74, 144, 226, 0.22);
    font-weight: 700;
}

.edit-sector-inport-format-builder {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.edit-sector-inport-builder-title,
.edit-sector-inport-output-title {
    color: #f5f7fa;
    font-size: 0.95rem;
    font-weight: 700;
}

.edit-sector-inport-field-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    background: rgba(15, 28, 45, 0.28);
}

.edit-sector-inport-field-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(74, 144, 226, 0.55);
    background: rgba(74, 144, 226, 0.22);
    color: #f5f7fa;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-sector-inport-field-btn:hover {
    background: rgba(74, 144, 226, 0.38);
    border-color: rgba(96, 165, 250, 0.9);
}

.edit-sector-inport-function-buttons {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.edit-sector-inport-function-btn {
    padding: 0.28rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.75);
    background: rgba(245, 158, 11, 0.2);
    color: #fef3c7;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.edit-sector-inport-function-btn:hover,
.edit-sector-inport-function-btn.active {
    background: rgba(245, 158, 11, 0.38);
    border-color: rgba(251, 191, 36, 1);
}

.edit-sector-inport-flow-btn {
    border-color: rgba(74, 144, 226, 0.7);
    background: rgba(74, 144, 226, 0.18);
    color: #dbeafe;
}

.edit-sector-inport-flow-btn:hover {
    background: rgba(74, 144, 226, 0.34);
    border-color: rgba(96, 165, 250, 0.95);
}

.edit-sector-inport-function-hint {
    color: rgba(245, 247, 250, 0.75);
    font-size: 0.78rem;
}

.edit-sector-inport-end-countif-btn {
    align-self: flex-start;
    padding: 0.28rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.75);
    background: rgba(34, 197, 94, 0.2);
    color: #dcfce7;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.edit-sector-inport-end-countif-btn:hover {
    background: rgba(34, 197, 94, 0.36);
    border-color: rgba(74, 222, 128, 1);
}

.edit-sector-inport-format-strip {
    min-height: 2.75rem;
    max-height: 8rem;
    overflow: auto;
    padding: 0.55rem;
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.edit-sector-inport-format-strip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.55);
}

.edit-sector-inport-token {
    display: inline-flex;
    align-items: center;
    max-width: 18rem;
    margin: 0 0.1rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(37, 99, 235, 0.45);
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 700;
    vertical-align: baseline;
    cursor: pointer;
    white-space: nowrap;
}

.edit-sector-inport-token:hover {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.6);
    color: #991b1b;
}

.edit-sector-inport-round-token {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.55);
    color: #065f46;
}

.edit-sector-inport-countif-token {
    display: inline-block;
    min-width: 12rem;
    max-width: 100%;
    margin: 0 0.1rem;
    padding: 0.12rem 0.45rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.6);
    border: 1px solid rgba(245, 158, 11, 0.6);
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 700;
    vertical-align: baseline;
    cursor: text;
    white-space: normal;
}

.edit-sector-inport-countif-token:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.edit-sector-inport-countif-token:not(.has-args)::after {
    content: attr(data-placeholder);
    color: rgba(146, 64, 14, 0.55);
    font-weight: 600;
    pointer-events: none;
}

.edit-sector-inport-countif-token.invalid {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.75);
    color: #991b1b;
}

.edit-sector-inport-countif-token.ended {
    border-style: solid;
    cursor: pointer;
    user-select: none;
}

.edit-sector-inport-countif-token.ended:hover {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.6);
    color: #991b1b;
}

.edit-sector-inport-countif-prefix {
    margin-right: 0.25rem;
    user-select: none;
}

.edit-sector-inport-builder-hint {
    margin: 0;
}

.edit-sector-inport-output-preview {
    min-height: 4rem;
    max-height: 14rem;
    overflow: auto;
    margin: 0;
    padding: 0.65rem;
    border: 1px solid rgba(74, 144, 226, 0.35);
    border-radius: 8px;
    background: rgba(15, 28, 45, 0.72);
    color: #f5f7fa;
    font-size: 0.85rem;
    line-height: 1.45;
    white-space: pre;
}

/* Edit Airspace Styles */
.edit-sector-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.control-strip {
    background: rgba(26, 47, 74, 0.9);
    border-top: 2px solid rgba(74, 144, 226, 0.3);
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    padding: 0.25rem 2rem;
    flex-shrink: 0;
}

.top-strip {
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    flex-shrink: 0;
}

.bottom-strip {
    border-top: 2px solid rgba(74, 144, 226, 0.3);
    flex: 0 0 auto;
    overflow-y: auto;
    flex-shrink: 0;
    max-height: none;
}

.strip-content {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.bottom-strip .strip-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
}

.strip-content .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
}

.strip-content .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 4px;
    height: auto;
}

/* Edit Airspace toolbar: Waypoints / Routes hover dropdowns */
.edit-sector-hover-split {
    position: relative;
    display: inline-flex;
    align-self: center;
    vertical-align: middle;
}

.edit-sector-hover-split .edit-sector-split-trigger {
    margin: 0;
    white-space: nowrap;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.edit-sector-split-caret {
    flex-shrink: 0;
    line-height: 1;
    font-size: 0.85em;
    opacity: 0.85;
}

.edit-sector-split-menu {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% - 2px);
    z-index: 200;
    padding-top: 4px;
    min-width: 100%;
}

.edit-sector-split-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    min-width: max(100%, 220px);
    background: rgba(18, 32, 52, 0.98);
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.edit-sector-hover-split:hover .edit-sector-split-menu,
.edit-sector-hover-split:focus-within .edit-sector-split-menu {
    display: block;
}

.edit-sector-split-menu-inner .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.sector-map-bg-opacity-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(26, 47, 74, 0.45);
    border: 1px solid rgba(74, 144, 226, 0.35);
}

.sector-map-bg-opacity-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.88);
    white-space: nowrap;
}

.sector-map-bg-opacity-slider {
    width: 100px;
    max-width: 22vw;
    accent-color: #4a90e2;
    cursor: pointer;
}

.sector-map-bg-opacity-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.75);
    min-width: 2.5rem;
    text-align: right;
}

.strip-content h3 {
    font-size: 0.7rem;
    margin: 0.25rem 0;
    margin: 0;
    color: #4a90e2;
    min-width: 100px;
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-zoom {
    background: rgba(44, 62, 80, 0.8);
    border: 2px solid rgba(74, 144, 226, 0.4);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: #f5f7fa;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-zoom:hover {
    background: rgba(74, 144, 226, 0.3);
    border-color: rgba(74, 144, 226, 0.6);
    transform: scale(1.1);
}

.btn-zoom.sector-map-options-btn {
    min-width: 48px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.btn-zoom.sector-map-render-view-btn {
    min-width: 92px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.btn-zoom.sector-map-render-view-btn.active {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.85);
    color: #ffffff;
}

.sector-map-options-body {
    display: grid;
    gap: 0.75rem;
}

.sector-map-option-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(245, 247, 250, 0.95);
    font-size: 0.95rem;
}

.sector-map-option-check input {
    accent-color: #4a90e2;
}

.sector-map-option-slider {
    display: grid;
    gap: 0.35rem;
    padding-top: 0.15rem;
}

.sector-map-option-slider label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(245, 247, 250, 0.9);
    font-size: 0.9rem;
}

.sector-map-option-slider input {
    width: 100%;
}

.sector-map-options-footer {
    display: flex;
    justify-content: center;
}

#visualizationCanvas {
    cursor: grab;
    user-select: none;
}

#visualizationCanvas:active {
    cursor: grabbing;
}

.visualization-canvas {
    height: 60vh;
    flex-shrink: 0;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    border: 1px solid #cccccc;
}

/* Simulation Styles */
.simulation-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.simulation-control-strip {
    background: rgba(26, 47, 74, 0.9);
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    padding: 0.45rem 1rem;
    flex-shrink: 0;
}

.simulation-strip-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    justify-content: space-between;
}

.simulation-strip-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
    flex: 0 1 auto;
}

.simulation-strip-content h2 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f5f7fa;
    line-height: 1.35;
    min-width: 0;
    flex-shrink: 0;
    max-width: min(42rem, 100%);
    word-break: break-word;
}

.simulation-clock {
    justify-self: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f5f7fa;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.simulation-clock.sim-clock-flash-red {
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.65);
    background: rgba(255, 59, 48, 0.10);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}

.sim-host-atc-scope {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: rgba(245, 247, 250, 0.88);
    white-space: nowrap;
    max-width: 15rem;
}

.sim-host-atc-scope-select {
    max-width: 12rem;
    min-width: 0;
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    border: 1px solid rgba(74, 144, 226, 0.35);
    background: rgba(14, 24, 38, 0.95);
    color: #f5f7fa;
}

.sim-host-atc-scope-select:disabled {
    opacity: 0.92;
    cursor: not-allowed;
}

.sim-host-atc-scope-select.is-locked {
    border-color: rgba(74, 144, 226, 0.55);
}

.run-type-single-atc-sector-select {
    max-width: 100%;
}

.simulation-clock-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem 0.65rem;
    min-width: 0;
    flex: 0 1 auto;
}

.sim-fullscreen-btn {
    min-width: auto;
    height: 32px;
    padding: 0 0.55rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.sim-tts-toggle {
    min-width: 4.5rem;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: 6px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 800;
    line-height: 1;
}

.sim-tts-title {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    font-weight: 900;
}

.sim-tts-value {
    font-size: 0.85rem;
    font-weight: 900;
}

.sim-tts-toggle.sim-tts-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sim-tts-toggle.sim-tts-on {
    background: rgba(34, 197, 94, 0.22) !important;
    border-color: rgba(34, 197, 94, 0.65) !important;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16) inset;
}

.sim-ai-pp-toggle {
    min-width: 5.5rem;
}

.simulation-speed-status {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(245, 247, 250, 0.85);
    white-space: nowrap;
    opacity: 0.95;
}

.simulation-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
    align-content: center;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
}

.sim-controls-main {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.sim-playback-cluster {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.simulation-controls .btn {
    padding: 0 0.65rem;
    min-height: 32px;
    height: 32px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Top strip: glass buttons — transparent + white outline; hover = filled (previous solid style), no outline */
.simulation-control-strip .btn.btn-secondary {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.92) !important;
    box-shadow: none !important;
}

.simulation-control-strip .btn.btn-secondary:hover {
    background: linear-gradient(135deg, #5ba3f5 0%, #4a90e2 100%) !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none;
}

.simulation-control-strip .sim-tts-toggle.sim-tts-on {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.92) !important;
    box-shadow: none !important;
}

.simulation-control-strip .sim-tts-toggle.sim-tts-on:hover {
    background: rgba(34, 197, 94, 0.22) !important;
    border: none !important;
    border-color: rgba(34, 197, 94, 0.65) !important;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16) inset !important;
}

.ai-pp-ptt-select-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.ai-pp-ptt-btn.btn {
    flex-direction: row;
    min-width: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

.ai-pp-selected-key {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(74, 144, 226, 0.35);
    border-radius: 8px;
    background: rgba(15, 28, 45, 0.58);
    color: #f5f7fa;
    font-weight: 700;
    text-align: center;
}

.ai-pp-ptt-hint {
    min-height: 1.2rem;
    margin-top: 0.6rem;
}

#aiPpPttModal .ai-pp-ptt-modal-footer {
    display: flex;
    justify-content: center;
    padding: 1rem 1.25rem 1.25rem;
}

#aiPpPttModal .ai-pp-ptt-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

#aiPpPttModal .ai-pp-ptt-actions-row .ai-pp-ptt-btn.btn {
    flex: 1 1 0;
    min-width: 5.5rem;
    max-width: 8rem;
    justify-content: center;
}

.sim-ai-pp-vccs {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 7;
    min-width: 160px;
    max-width: 22rem;
    padding: 0.55rem;
    border: 1px solid rgba(147, 197, 253, 0.42);
    border-radius: 10px;
    background: rgba(8, 16, 28, 0.34);
    color: rgba(245, 247, 250, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(4px);
    user-select: none;
}

.sim-ai-pp-vccs-title {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 0;
}

.sim-ai-pp-vccs-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 0.4rem;
    min-height: 1.35rem;
}

.sim-ai-pp-vccs-details-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid rgba(245, 247, 250, 0.42);
    border-radius: 4px;
    background: transparent;
    color: rgba(245, 247, 250, 0.78);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.sim-ai-pp-vccs-details-toggle:hover {
    border-color: rgba(147, 197, 253, 0.75);
    color: rgba(245, 247, 250, 0.96);
    background: transparent;
}

.sim-ai-pp-vccs-details-toggle:focus {
    outline: none;
    border-color: rgba(147, 197, 253, 0.85);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.18);
}

.sim-ai-pp-vccs-details[hidden] {
    display: none !important;
}

.sim-ai-pp-vccs-details .sim-ai-pp-reply:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.sim-ai-pp-vccs-row {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
}

.sim-ai-pp-vccs-box {
    min-width: 42px;
    padding: 0.25rem 0.35rem;
    border: 1px solid rgba(245, 247, 250, 0.38);
    border-radius: 6px;
    background: rgba(245, 247, 250, 0.06);
    color: rgba(245, 247, 250, 0.7);
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.sim-ai-pp-vccs-box.active {
    background: rgba(34, 197, 94, 0.42);
    border-color: rgba(74, 222, 128, 0.95);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
}

.sim-ai-pp-vccs-box.blocked {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(248, 113, 113, 0.92);
    color: #fecaca;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.38);
}

.sim-ai-pp-status {
    max-width: 15rem;
    margin-top: 0.4rem;
    color: rgba(245, 247, 250, 0.72);
    font-size: 0.68rem;
    line-height: 1.25;
    text-align: center;
}

.sim-ai-pp-reply {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(245, 247, 250, 0.12);
}

.sim-ai-pp-reply-label {
    color: rgba(147, 197, 253, 0.95);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sim-ai-pp-reply-text {
    margin-top: 0.15rem;
    color: rgba(245, 247, 250, 0.88);
    font-size: 0.68rem;
    line-height: 1.25;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    cursor: text;
}

.sim-ai-pp-raw-text {
    display: block;
    width: 100%;
    min-height: 3.5rem;
    max-height: 8rem;
    margin-top: 0.15rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid rgba(147, 197, 253, 0.28);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: rgba(245, 247, 250, 0.92);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.62rem;
    line-height: 1.35;
    resize: vertical;
    user-select: text;
    cursor: text;
}

.sim-ai-pp-raw-text:focus {
    outline: none;
    border-color: rgba(147, 197, 253, 0.55);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.simulation-control-strip .simulation-controls .sim-tri-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    filter: none;
}

.simulation-control-strip .simulation-controls .sim-tri-btn:hover {
    background: linear-gradient(135deg, #5ba3f5 0%, #4a90e2 100%) !important;
    box-shadow: none !important;
    filter: none;
    border: none !important;
}

/* RR / FF: triangular buttons (left / right), text kept inside */
.simulation-controls .sim-tri-btn {
    width: 52px;
    min-width: 52px;
    height: 32px;
    padding: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.03em;
    font-size: 0.68rem;
    line-height: 1;
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.simulation-controls .sim-tri-btn.sim-tri-rr {
    -webkit-clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
    clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
    padding-left: 0.2rem;
}

.simulation-controls .sim-tri-btn.sim-tri-ff {
    -webkit-clip-path: polygon(100% 50%, 0% 0%, 0% 100%);
    clip-path: polygon(100% 50%, 0% 0%, 0% 100%);
    padding-right: 0.2rem;
}

.simulation-controls .sim-tri-btn:hover {
    filter: brightness(1.08);
}

.sim-spv-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0.15rem;
}

.sim-mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sim-mode-option {
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    background: rgba(26, 47, 74, 0.25);
    cursor: pointer;
}

.sim-mode-option:hover {
    border-color: rgba(74, 144, 226, 0.55);
}

.sim-mode-option.active {
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15) inset;
}

.sim-mode-option-disabled {
    cursor: not-allowed;
    border-color: rgba(220, 38, 38, 0.45);
    background: rgba(80, 20, 20, 0.35);
    opacity: 0.92;
    pointer-events: none;
}

.sim-mode-option-disabled .sim-mode-option-title {
    color: rgba(248, 113, 113, 0.95);
}

.sim-mode-option-disabled .sim-mode-option-desc {
    color: rgba(248, 180, 180, 0.65);
}

.sim-mode-option-demo-tag {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: rgba(252, 165, 165, 0.98);
    white-space: nowrap;
}

.sim-mode-option-title {
    font-weight: 900;
    color: rgba(245, 247, 250, 0.95);
    margin-bottom: 0.35rem;
}

.sim-mode-option-desc {
    font-size: 0.88rem;
    color: rgba(245, 247, 250, 0.78);
    line-height: 1.3;
}

.sim-alv-picker {
    position: absolute;
    z-index: 50;
    min-width: 78px;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    background: rgba(14, 24, 38, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    user-select: none;
}

#simulationAvlbFlPicker.sim-holding-avlb-fl-picker-top {
    position: fixed;
    z-index: 1350;
    pointer-events: auto;
}

#simulationAlvPicker.sim-holding-alv-picker-top {
    position: fixed;
    z-index: 1350;
    pointer-events: auto;
}

/* Floating Advanced Label (in-sim only; not a browser popup) */
.sim-advanced-label {
    position: fixed;
    z-index: 1200;
    min-width: 280px;
    max-width: min(96vw, 560px);
    border: 1px solid rgba(74, 144, 226, 0.55);
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    pointer-events: auto;
    user-select: none;
}

.sim-advanced-label-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.35);
    background: transparent;
    cursor: grab;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    color: rgba(245, 247, 250, 0.95);
}

.sim-advanced-label-header:active {
    cursor: grabbing;
}

.sim-advanced-label-title {
    flex: 0 0 auto;
}

.sim-advanced-label-flight {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    color: rgba(147, 197, 253, 0.95);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 12rem;
}

.sim-advanced-label-body {
    padding: 10px 10px 12px;
    background: transparent;
    min-height: 2.5rem;
    width: 100%;
    box-sizing: border-box;
}

.sim-advanced-label-columns {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.sim-advanced-label-left {
    flex: 0 1 auto;
    min-width: 0;
}

.sim-advanced-label-right {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.88);
}

.sim-adv-grid {
    border-collapse: collapse;
    font-size: 0.72rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: rgba(245, 247, 250, 0.92);
}

.sim-adv-grid td {
    border: 1px solid rgba(74, 144, 226, 0.28);
    padding: 3px 5px;
    min-width: 2.6rem;
    max-width: 7rem;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sim-adv-grid td.sim-adv-cell-empty {
    min-height: 1.1rem;
}

.sim-adv-route-block {
    margin-bottom: 10px;
    width: 100%;
}

.sim-adv-route-label {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(147, 197, 253, 0.95);
    margin-bottom: 4px;
}

/* Full width of right column (same as OLDI grid); wrap between waypoints only — names stay intact */
.sim-adv-route-tokens {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0;
    row-gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.sim-adv-route-tokens .sim-adv-route-wp {
    white-space: nowrap;
    flex: 0 0 auto;
}

.sim-adv-route-tokens .sim-adv-route-sep {
    flex: 0 0 auto;
    white-space: pre;
    user-select: none;
}

.sim-adv-oldi-block {
    margin-bottom: 10px;
    width: 100%;
}

.sim-adv-oldi-title {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(147, 197, 253, 0.95);
    margin-bottom: 4px;
}

.sim-adv-oldi-cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
    text-align: center;
}

.sim-adv-oldi-cols .sim-adv-h {
    font-size: 0.65rem;
    color: rgba(245, 247, 250, 0.65);
    line-height: 1.2;
}

.sim-adv-oldi-cols .sim-adv-v {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    margin-top: 2px;
    min-height: 1.1em;
}

.sim-adv-sector-block {
    width: 100%;
}

.sim-adv-sector-block .sim-adv-sector-title {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(147, 197, 253, 0.95);
    margin-bottom: 4px;
}

.sim-adv-sector-body {
    color: rgba(245, 247, 250, 0.72);
    font-size: 0.76rem;
}

.sim-advanced-label-placeholder {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(245, 247, 250, 0.65);
}

/* DL: aircraft in holding (auto popup for EXE/PLN, PP, host, solo) */
.sim-holding-list-panel {
    min-width: 420px;
    max-width: min(96vw, 620px);
}

.sim-holding-list-header {
    cursor: grab;
}

.sim-holding-list-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.sim-holding-list-detached-host {
    pointer-events: none;
}

.sim-holding-list-detached-panel {
    pointer-events: auto;
}

/* EN-MGMT floating panel (entry management) */
.sim-en-mgmt-panel {
    width: max-content;
    min-width: 420px;
    max-width: min(96vw, 960px);
}

.sim-en-mgmt-panel .sim-en-mgmt-body {
    min-height: 88px;
    overflow-x: auto;
}

/* Detached per-route windows: header = route name, sized to fit the list (no scrolling). */
.sim-en-mgmt-detached-route-panel {
    width: max-content;
    min-width: 0;
    max-width: 96vw;
}

.sim-en-mgmt-detached-route-panel .sim-en-mgmt-body {
    min-height: 0;
    max-height: none;
    overflow: visible;
}

.sim-en-mgmt-categories {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sim-en-mgmt-category + .sim-en-mgmt-category {
    margin-top: 0.35rem;
}

.sim-en-mgmt-category-header {
    border-bottom: 1px solid rgba(74, 144, 226, 0.35);
    padding: 8px 10px 4px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(245, 247, 250, 0.95);
    text-align: left;
}

.sim-en-mgmt-category-content {
    min-height: 0.35rem;
}

.sim-en-mgmt-category-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.74rem;
}

.sim-en-mgmt-category-table th {
    padding: 0;
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(245, 247, 250, 0.75);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    white-space: nowrap;
}

.sim-en-mgmt-sortable-th {
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.sim-en-mgmt-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 4px 10px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    letter-spacing: inherit;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    gap: 0;
}

.sim-en-mgmt-sort-label {
    flex: 0 1 auto;
    text-align: center;
}

.sim-en-mgmt-sort-btn:hover {
    color: rgba(245, 247, 250, 0.95);
}

.sim-en-mgmt-sort-btn:focus-visible {
    outline: 2px solid rgba(74, 144, 226, 0.55);
    outline-offset: 1px;
}

.sim-en-mgmt-sort-indicator {
    flex: 0 0 auto;
    width: 0.65rem;
    margin-left: 0.38rem;
    font-size: 0.62rem;
    line-height: 1;
    text-align: center;
    color: rgba(125, 211, 252, 0.95);
    pointer-events: none;
}

.sim-en-mgmt-sortable-th:not(.is-sort-asc):not(.is-sort-desc) .sim-en-mgmt-sort-indicator {
    display: none;
}

.sim-en-mgmt-sortable-th.is-sort-asc .sim-en-mgmt-sort-label,
.sim-en-mgmt-sortable-th.is-sort-desc .sim-en-mgmt-sort-label {
    color: rgba(245, 247, 250, 0.96);
}

.sim-en-mgmt-category-table td {
    padding: 4px 10px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-en-mgmt-category-table td.sim-en-mgmt-category-rmk {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
}

.sim-en-mgmt-category-table td.sim-en-mgmt-category-avlb-lvls {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
}

.sim-en-mgmt-avlb-lvl-chip.sim-en-mgmt-avlb-lvl-blocked {
    color: #f87171;
    font-weight: 700;
}

.sim-en-mgmt-calc-th,
.sim-en-mgmt-category-table td.sim-en-mgmt-category-calc {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.sim-en-mgmt-calc-btn {
    border: 1px solid rgba(14, 116, 144, 0.45);
    background: rgba(14, 116, 144, 0.14);
    color: rgba(245, 247, 250, 0.92);
    border-radius: 5px;
    padding: 0.18rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.sim-en-mgmt-calc-btn:hover {
    background: rgba(14, 116, 144, 0.28);
}

.sim-en-mgmt-rule-debug-panel {
    width: max-content;
    min-width: 420px;
    max-width: min(96vw, 720px);
    max-height: min(88vh, 720px);
}

.sim-en-mgmt-rule-debug-panel .sim-en-mgmt-rule-debug-body {
    max-height: calc(min(88vh, 720px) - 44px);
    overflow: auto;
    padding: 8px 10px 12px;
}

.sim-en-mgmt-rule-debug-close-btn {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
}

.sim-en-mgmt-rule-debug-meta {
    font-size: 0.74rem;
    line-height: 1.45;
    color: rgba(245, 247, 250, 0.88);
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.25);
}

.sim-en-mgmt-rule-debug-note,
.sim-en-mgmt-rule-debug-empty {
    font-size: 0.74rem;
    color: rgba(245, 247, 250, 0.7);
    margin: 0.35rem 0;
}

.sim-en-mgmt-rule-debug-level {
    margin-top: 0.65rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(74, 144, 226, 0.18);
}

.sim-en-mgmt-rule-debug-level-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.25rem;
}

.sim-en-mgmt-rule-debug-level-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: rgba(245, 247, 250, 0.95);
}

.sim-en-mgmt-rule-debug-level-outcome {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.sim-en-mgmt-rule-debug-level-outcome.is-maintained {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

.sim-en-mgmt-rule-debug-level-outcome.is-blocked {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.sim-en-mgmt-rule-debug-level-outcome.is-neutral {
    color: rgba(245, 247, 250, 0.65);
    background: rgba(148, 163, 184, 0.12);
}

.sim-en-mgmt-rule-debug-level-detail {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    color: rgba(245, 247, 250, 0.72);
}

.sim-en-mgmt-rule-debug-pair {
    margin: 0.45rem 0 0.55rem;
    padding: 0.4rem 0.45rem;
    border: 1px solid rgba(74, 144, 226, 0.16);
    border-radius: 6px;
    background: rgba(8, 18, 32, 0.35);
}

.sim-en-mgmt-rule-debug-pair-head {
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
    color: rgba(245, 247, 250, 0.9);
}

.sim-en-mgmt-rule-debug-rule {
    margin-top: 0.35rem;
}

.sim-en-mgmt-rule-debug-rule-head {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

.sim-en-mgmt-rule-debug-rule-text {
    margin: 0 0 0.25rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.68rem;
    line-height: 1.35;
    white-space: pre-wrap;
    color: rgba(245, 247, 250, 0.82);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sim-en-mgmt-rule-debug-trace {
    margin-top: 0.2rem;
}

.sim-en-mgmt-rule-debug-trace-step {
    font-size: 0.68rem;
    line-height: 1.35;
    padding: 0.12rem 0;
    color: rgba(245, 247, 250, 0.82);
}

.sim-en-mgmt-rule-debug-trace-step.is-pass {
    color: #86efac;
}

.sim-en-mgmt-rule-debug-trace-step.is-fail {
    color: #fca5a5;
}

.sim-en-mgmt-rule-debug-trace-detail {
    font-size: 0.66rem;
    color: rgba(245, 247, 250, 0.62);
    padding-left: 0.35rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sim-en-mgmt-rule-debug-pair-head .is-pass,
.sim-en-mgmt-rule-debug-rule-head .is-pass {
    color: #86efac;
    font-weight: 700;
}

.sim-en-mgmt-rule-debug-pair-head .is-fail,
.sim-en-mgmt-rule-debug-rule-head .is-fail {
    color: #f87171;
    font-weight: 700;
}

.sim-en-mgmt-category-table td.sim-en-mgmt-category-mach {
    font-variant-numeric: tabular-nums;
}

.sim-en-mgmt-category-table tbody tr.sim-en-mgmt-row-selected td {
    background: rgba(74, 144, 226, 0.22);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.42);
}

.sim-en-mgmt-category-table tbody tr.sim-en-mgmt-row-xfl-unavailable td {
    background: rgba(154, 52, 18, 0.52);
}

.sim-en-mgmt-category-table tbody tr.sim-en-mgmt-row-xfl-unavailable.sim-en-mgmt-row-selected td {
    background: rgba(154, 52, 18, 0.62);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.42);
}

.sim-en-mgmt-category-table tbody tr.sim-en-mgmt-row-xfl-unavailable.sim-en-mgmt-row-xfl-hold-active td {
    box-shadow: inset 0 0 0 2px rgba(248, 113, 113, 0.9);
}

.sim-en-mgmt-category-xfl.sim-en-mgmt-xfl-unavailable {
    color: #ef4444;
    font-weight: 700;
    animation: sim-en-mgmt-xfl-unavailable-flash 0.85s ease-in-out infinite;
}

@keyframes sim-en-mgmt-xfl-unavailable-flash {
    0%, 100% {
        color: #ef4444;
        opacity: 1;
    }
    50% {
        color: #fecaca;
        opacity: 0.45;
    }
}

.sim-en-mgmt-category-empty {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: rgba(245, 247, 250, 0.65);
}

.sim-en-mgmt-panel.sim-en-mgmt-opaque {
    background: rgba(14, 24, 38, 0.95);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.sim-en-mgmt-panel.sim-en-mgmt-opaque .sim-advanced-label-header,
.sim-en-mgmt-panel.sim-en-mgmt-opaque .sim-holding-list-body {
    background: rgba(14, 24, 38, 0.95);
}

/* EN-MGMT Routes dialog: same style as Simulation Settings, 2× modal-small width (500px → 1000px).
   Nested in #simulationModal; must beat #simulationModal > .modal.active (1100) and EN-MGMT panel (1200). */
#simulationModal > #simulationEnMgmtRoutesModal.active {
    z-index: 1300;
}

#simulationModal > #simulationEnMgmtMergeRoutesModal.active {
    z-index: 1310;
}

#simulationModal > #simulationEnMgmtAddRouteModal.active {
    z-index: 1310;
}

#simulationModal > #simulationEnMgmtIdentifierModal.active {
    z-index: 1320;
}

#simulationModal > #simulationEnMgmtRulesModal.active {
    z-index: 1320;
}

#simulationModal > #simulationEnMgmtLevelsModal.active {
    z-index: 1330;
}

#simulationModal > #simulationEnMgmtSaveRoutesModal.active {
    z-index: 1340;
}

#simulationModal > #simulationEnMgmtSaveRoutesOverwriteModal.active {
    z-index: 1350;
}

#simulationModal > #simulationEnMgmtLoadRoutesModal.active {
    z-index: 1340;
}

#simulationModal > #simulationEnMgmtDeleteRoutesModal.active {
    z-index: 1310;
}

#simulationModal > #simulationEnMgmtDeleteRouteConfirmModal.active {
    z-index: 1360;
}

#simulationModal > #simulationEnMgmtLoadRoutesDeleteConfirmModal.active {
    z-index: 1370;
}

.sim-en-mgmt-levels-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sim-en-mgmt-levels-strip {
    width: 100%;
    box-sizing: border-box;
}

.sim-en-mgmt-identifier-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sim-en-mgmt-identifier-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(245, 247, 250, 0.82);
}

.sim-en-mgmt-identifier-rows {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.sim-en-mgmt-identifier-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 1rem;
    align-items: start;
}

.sim-en-mgmt-identifier-priority-cell {
    position: relative;
    align-self: center;
    flex: 0 0 auto;
}

.sim-en-mgmt-identifier-priority-btn {
    min-width: 2.85rem;
    height: 32px;
    padding: 0 0.45rem;
    border-radius: 6px;
    border: 1px solid rgba(74, 144, 226, 0.55);
    background: rgba(74, 144, 226, 0.2);
    color: rgba(245, 247, 250, 0.96);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.sim-en-mgmt-identifier-priority-btn:hover {
    background: rgba(74, 144, 226, 0.34);
    border-color: rgba(74, 144, 226, 0.85);
}

.sim-en-mgmt-identifier-priority-picker {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 10;
    min-width: 4.5rem;
    padding: 0.25rem;
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 6px;
    background: rgba(12, 20, 36, 0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sim-en-mgmt-identifier-priority-option {
    padding: 0.3rem 0.5rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(245, 247, 250, 0.92);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.sim-en-mgmt-identifier-priority-option:hover {
    background: rgba(74, 144, 226, 0.28);
}

.sim-en-mgmt-identifier-priority-option.is-current {
    background: rgba(74, 144, 226, 0.22);
    color: rgba(245, 247, 250, 0.98);
}

.sim-en-mgmt-identifier-ident-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.sim-en-mgmt-identifier-row > .sim-en-mgmt-identifier-field:last-child {
    align-self: center;
}

.sim-en-mgmt-identifier-row-delete {
    align-self: center;
    flex: 0 0 auto;
    padding: 0 0.55rem;
    min-height: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(231, 76, 60, 0.5);
    background: rgba(231, 76, 60, 0.22);
    color: rgba(255, 220, 215, 0.96);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.sim-en-mgmt-identifier-row-delete:hover {
    background: rgba(231, 76, 60, 0.38);
    border-color: rgba(231, 76, 60, 0.85);
}

.sim-en-mgmt-identifier-row-delete[hidden] {
    display: none !important;
}

.sim-en-mgmt-rules-row-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-self: center;
}

.sim-en-mgmt-rules-row-duplicate {
    flex: 0 0 auto;
    padding: 0 0.55rem;
    min-height: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(20, 160, 160, 0.5);
    background: rgba(20, 160, 160, 0.2);
    color: rgba(220, 250, 250, 0.96);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sim-en-mgmt-rules-row-duplicate:hover {
    background: rgba(20, 160, 160, 0.36);
    border-color: rgba(20, 160, 160, 0.85);
}

.sim-en-mgmt-identifier-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.sim-en-mgmt-identifier-label {
    flex: 0 0 4.25rem;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.92);
    text-align: right;
    line-height: 1;
}

.sim-en-mgmt-identifier-strip {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0.45rem;
    border: 1px solid rgba(74, 144, 226, 0.45);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 0.9rem;
    line-height: 32px;
    white-space: nowrap;
}

.sim-en-mgmt-identifier-strip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.55);
}

.sim-en-mgmt-identifier-strip.sim-en-mgmt-identifier-strip-invalid {
    border-color: rgba(231, 76, 60, 0.75);
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.35);
}

.sim-en-mgmt-identifier-strip.sim-en-mgmt-identifier-strip-invalid:focus {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.45);
}

.sim-en-mgmt-id-bubble {
    display: inline-flex;
    align-items: center;
    max-width: 12rem;
    margin: 0 0.1rem;
    padding: 0 0.45rem;
    height: 22px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(37, 99, 235, 0.45);
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 700;
    vertical-align: middle;
    cursor: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-en-mgmt-id-bubble:hover {
    background: rgba(37, 99, 235, 0.24);
    border-color: rgba(37, 99, 235, 0.65);
}

.sim-en-mgmt-id-bubble-editing {
    outline: 2px solid rgba(37, 99, 235, 0.55);
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
}

.sim-en-mgmt-id-bubble-operator {
    background: rgba(14, 116, 144, 0.16);
    border-color: rgba(14, 116, 144, 0.45);
    color: #0e4f5f;
}

.sim-en-mgmt-id-bubble-list {
    max-width: none;
}

.sim-en-mgmt-id-bubble-list-prefix {
    user-select: none;
}

.sim-en-mgmt-id-bubble-list-body {
    display: inline;
    outline: none;
    min-width: 0.35rem;
}

.sim-en-mgmt-id-bubble-list-body.sim-en-mgmt-id-bubble-list-body-empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.78rem;
}

.sim-en-mgmt-identifier-op-toolbar {
    display: none;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-left: calc(4.25rem + 0.55rem);
}

.sim-en-mgmt-identifier-op-toolbar.is-active {
    display: flex;
}

.sim-en-mgmt-identifier-op-btn {
    padding: 0 0.55rem;
    min-height: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(74, 144, 226, 0.45);
    background: rgba(74, 144, 226, 0.16);
    color: rgba(245, 247, 250, 0.94);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}

.sim-en-mgmt-identifier-op-btn:hover {
    background: rgba(74, 144, 226, 0.32);
    border-color: rgba(74, 144, 226, 0.75);
}

.sim-en-mgmt-identifier-remarks-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    min-height: 32px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 32px;
    box-sizing: border-box;
}

.sim-en-mgmt-identifier-add-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0.15rem;
}

.sim-en-mgmt-identifier-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(74, 144, 226, 0.55);
    background: rgba(74, 144, 226, 0.22);
    color: rgba(245, 247, 250, 0.96);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.sim-en-mgmt-identifier-add-btn:hover {
    background: rgba(74, 144, 226, 0.38);
    border-color: rgba(74, 144, 226, 0.85);
}

.sim-en-mgmt-rules-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sim-en-mgmt-rules-rows {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sim-en-mgmt-rules-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
}

.sim-en-mgmt-rules-rule-stack {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.sim-en-mgmt-rules-field {
    width: 100%;
}

.sim-en-mgmt-rules-strip {
    height: calc(1.35em * 5 + 0.7rem);
    min-height: calc(1.35em * 5 + 0.7rem);
    max-height: calc(1.35em * 20 + 0.7rem);
    line-height: 1.35;
    padding: 0.35rem 0.45rem;
    white-space: normal;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.sim-en-mgmt-rules-line-indent {
    display: inline;
    white-space: pre;
    user-select: none;
    pointer-events: none;
}

.sim-en-mgmt-rules-fn-toolbar {
    display: none;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-left: calc(4.25rem + 0.55rem);
}

.sim-en-mgmt-rules-fn-toolbar.is-active {
    display: flex;
}

.sim-en-mgmt-rules-fn-btn {
    border: 1px solid rgba(14, 116, 144, 0.45);
    background: rgba(14, 116, 144, 0.12);
    color: rgba(245, 247, 250, 0.92);
    border-radius: 6px;
    padding: 0.28rem 0.55rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
}

.sim-en-mgmt-rules-fn-btn:hover {
    background: rgba(14, 116, 144, 0.24);
    border-color: rgba(14, 116, 144, 0.65);
}

.sim-en-mgmt-rules-fn-btn[data-rule-function="|"] {
    min-width: 1.5rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    font-size: 0.85rem;
}

.sim-en-mgmt-id-bubble-abs-delimiter {
    font-weight: 800;
    letter-spacing: 0;
}

.sim-en-mgmt-rules-fn-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.sim-en-mgmt-id-bubble-function {
    background: rgba(109, 40, 217, 0.14);
    border-color: rgba(109, 40, 217, 0.45);
    color: #4c1d95;
}

.sim-en-mgmt-id-bubble-aircraft-composite {
    max-width: none;
    gap: 0.15rem;
    padding: 0 0.4rem 0 0.45rem;
    white-space: nowrap;
    overflow: visible;
    cursor: default;
}

.sim-en-mgmt-id-bubble-aircraft-label {
    user-select: none;
}

.sim-en-mgmt-id-bubble-aircraft-body {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}

.sim-en-mgmt-id-bubble-aircraft-paren {
    color: inherit;
    font-weight: 700;
    user-select: none;
}

.sim-en-mgmt-id-bubble-aircraft-nested {
    margin: 0;
    height: 18px;
    padding: 0 0.35rem;
    font-size: 0.74rem;
    cursor: default;
}

.modal-en-mgmt-routes {
    width: min(96vw, 1000px);
    max-width: min(96vw, 1000px);
}

.sim-en-mgmt-routes-body {
    min-height: 280px;
}

.sim-en-mgmt-routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sim-en-mgmt-route-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(74, 144, 226, 0.28);
    border-radius: 6px;
    background: rgba(10, 18, 32, 0.35);
    overflow: hidden;
}

.sim-en-mgmt-route-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.5rem;
}

.sim-en-mgmt-route-row-main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
}

.sim-en-mgmt-route-expand-btn {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(74, 144, 226, 0.55);
    background: rgba(74, 144, 226, 0.18);
    color: rgba(245, 247, 250, 0.96);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.sim-en-mgmt-route-expand-btn:hover {
    background: rgba(74, 144, 226, 0.34);
    border-color: rgba(74, 144, 226, 0.85);
}

.sim-en-mgmt-route-details {
    border-top: 1px solid rgba(74, 144, 226, 0.22);
    padding: 0.55rem 0.65rem 0.65rem calc(0.65rem + 22px + 0.45rem);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sim-en-mgmt-route-details[hidden] {
    display: none !important;
}

.sim-en-mgmt-route-detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sim-en-mgmt-route-detail-header {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 247, 250, 0.88);
}

.sim-en-mgmt-route-detail-content {
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(245, 247, 250, 0.82);
}

.sim-en-mgmt-route-empty {
    color: rgba(245, 247, 250, 0.55);
    font-style: italic;
}

.sim-en-mgmt-route-identifier-pair {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.25rem 0;
}

.sim-en-mgmt-route-identifier-pair + .sim-en-mgmt-route-identifier-pair {
    border-top: 1px solid rgba(74, 144, 226, 0.16);
    margin-top: 0.15rem;
    padding-top: 0.4rem;
}

.sim-en-mgmt-route-identifier-pair-line {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}

.sim-en-mgmt-route-detail-sub-label {
    flex: 0 0 auto;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.72);
}

.sim-en-mgmt-route-detail-sub-value {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-word;
}

.sim-en-mgmt-route-detail-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.sim-en-mgmt-route-name {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sim-en-mgmt-route-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.sim-en-mgmt-merge-routes-body {
    min-height: 0;
}

.sim-en-mgmt-merge-routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: min(60vh, 420px);
    overflow-y: auto;
}

.sim-en-mgmt-merge-routes-section-label {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 247, 250, 0.58);
}

.sim-en-mgmt-merge-routes-section-label:not(:first-child) {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(74, 144, 226, 0.22);
}

.sim-en-mgmt-merge-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(74, 144, 226, 0.28);
    border-radius: 6px;
    background: rgba(10, 18, 32, 0.35);
}

.sim-en-mgmt-merge-group-members {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
}

.sim-en-mgmt-merge-group-name {
    flex: 0 1 auto;
    max-width: 45%;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.92);
    text-align: right;
    line-height: 1.35;
    word-break: break-word;
}

.sim-en-mgmt-merge-routes-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sim-en-mgmt-merge-routes-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.92);
    user-select: none;
}

.sim-en-mgmt-merge-routes-item input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.sim-en-mgmt-merge-routes-empty {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(245, 247, 250, 0.65);
}

.sim-en-mgmt-save-routes-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sim-en-mgmt-save-routes-section-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 247, 250, 0.58);
}

.sim-en-mgmt-save-routes-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: min(40vh, 240px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sim-en-mgmt-save-routes-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.92);
    user-select: none;
}

.sim-en-mgmt-save-routes-file-item-name {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
    cursor: pointer;
}

.sim-en-mgmt-save-routes-file-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sim-en-mgmt-save-routes-file-item.is-selected {
    background: rgba(74, 144, 226, 0.22);
    border-color: rgba(74, 144, 226, 0.55);
}

.sim-en-mgmt-save-routes-empty {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(245, 247, 250, 0.65);
}

.sim-en-mgmt-save-routes-name-group {
    margin-bottom: 0;
}

.sim-en-mgmt-delete-routes-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sim-en-mgmt-delete-routes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: min(50vh, 360px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sim-en-mgmt-delete-routes-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(74, 144, 226, 0.28);
    border-radius: 6px;
    background: rgba(10, 18, 32, 0.35);
}

.sim-en-mgmt-delete-routes-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.92);
    line-height: 1.35;
    word-break: break-word;
}

.sim-en-mgmt-delete-routes-empty {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(245, 247, 250, 0.65);
}

#simulationEnMgmtIdentifierModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtRulesModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtLevelsModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtSaveRoutesModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtSaveRoutesOverwriteModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtLoadRoutesModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtLoadRoutesDeleteConfirmModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtDeleteRoutesModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtDeleteRouteConfirmModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtMergeRoutesModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtRoutesModal .sim-en-mgmt-routes-footer,
#simulationEnMgmtAddRouteModal .sim-en-mgmt-routes-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 1.25rem;
    flex-wrap: nowrap;
}

.sim-en-mgmt-routes-action-btn.btn,
#simulationEnMgmtIdentifierModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtRulesModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtLevelsModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtSaveRoutesModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtSaveRoutesOverwriteModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtLoadRoutesModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtLoadRoutesDeleteConfirmModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtDeleteRoutesModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtDeleteRouteConfirmModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtMergeRoutesModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtRoutesModal .sim-en-mgmt-routes-footer .btn,
#simulationEnMgmtAddRouteModal .sim-en-mgmt-routes-footer .btn {
    padding: 0 0.65rem;
    min-height: 32px;
    height: 32px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.sim-en-mgmt-routes-btn {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2px 10px;
    min-height: 0;
    line-height: 1.35;
    white-space: nowrap;
}

.sim-en-mgmt-sector-select {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 2px 24px 2px 8px;
    min-height: 0;
    line-height: 1.35;
    max-width: 9.5rem;
    border-radius: 4px;
    border: 1px solid rgba(245, 247, 250, 0.28);
    background: transparent;
    color: rgba(245, 247, 250, 0.92);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(245, 247, 250, 0.75) 50%), linear-gradient(135deg, rgba(245, 247, 250, 0.75) 50%, transparent 50%);
    background-position: calc(100% - 12px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.sim-en-mgmt-sector-select:focus {
    outline: 2px solid rgba(74, 144, 226, 0.55);
    outline-offset: 1px;
}

.sim-en-mgmt-sector-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sim-en-mgmt-panel.sim-en-mgmt-opaque .sim-en-mgmt-sector-select {
    background-color: rgba(15, 23, 42, 0.35);
}

.sim-en-mgmt-ext-plus-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.sim-en-mgmt-ext-plus-label {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(245, 247, 250, 0.88);
    white-space: nowrap;
}

.sim-en-mgmt-ext-plus-select {
    max-width: 5.5rem;
}

.sim-en-mgmt-category-table td.sim-en-mgmt-category-ext {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 3.25rem;
}

.sim-holding-list-avlb-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    cursor: pointer;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(245, 247, 250, 0.92);
    user-select: none;
}

.sim-holding-list-avlb-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sim-holding-list-avlb-box {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(147, 197, 253, 0.85);
    border-radius: 2px;
    background: transparent;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.sim-holding-list-avlb-toggle input:checked + .sim-holding-list-avlb-box {
    background: rgba(34, 197, 94, 0.85);
    box-shadow: inset 0 0 0 1px rgba(14, 24, 38, 0.35);
}

.sim-holding-list-avlb-label {
    white-space: nowrap;
}

.sim-holding-list-table td.sim-holding-list-fl {
    text-align: center;
    font-weight: 900;
    white-space: nowrap;
    vertical-align: middle;
}

.sim-holding-list-avlb-stack-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.35rem;
    padding: 2px 0;
    line-height: 1.25;
}

td.sim-holding-list-cs .sim-holding-list-avlb-stack-item {
    justify-content: flex-start;
}

.sim-holding-list-avlb-stack-item + .sim-holding-list-avlb-stack-item {
    border-top: 1px solid rgba(74, 144, 226, 0.22);
}

.sim-holding-list-avlb-stack-item.sim-holding-list-row-warn {
    color: #ca8a04 !important;
    background: rgba(202, 138, 4, 0.14);
}

.sim-holding-list-avlb-stack-item.sim-holding-list-row-over {
    color: #f87171 !important;
    background: rgba(220, 38, 38, 0.14);
}

.sim-holding-list-row-avlb-free td {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.08);
}

.sim-holding-list-row-avlb-occupied td {
    color: rgba(248, 113, 113, 0.95) !important;
    background: rgba(220, 38, 38, 0.1);
}

.sim-holding-list-row-avlb-conflict td,
.sim-holding-list-row-avlb-conflict .sim-holding-list-avlb-stack-item {
    color: rgba(245, 247, 250, 0.55) !important;
    background: rgba(220, 38, 38, 0.06) !important;
}

.sim-holding-list-row-avlb-conflict.sim-holding-list-row-avlb-conflict-flash-on td,
.sim-holding-list-row-avlb-conflict.sim-holding-list-row-avlb-conflict-flash-on .sim-holding-list-avlb-stack-item {
    color: #f87171 !important;
    background: rgba(220, 38, 38, 0.38) !important;
}

.sim-holding-list-body {
    padding: 8px 10px 10px;
    background: transparent;
    max-height: min(42vh, 340px);
    overflow-y: auto;
}

.sim-holding-list-table {
    width: 100%;
    border-collapse: collapse;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.72rem;
    color: rgba(245, 247, 250, 0.92);
}

.sim-holding-list-table th {
    padding: 2px 6px 4px;
    text-align: left;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(147, 197, 253, 0.95);
    border-bottom: 1px solid rgba(74, 144, 226, 0.35);
}

.sim-holding-list-table td {
    border: 1px solid rgba(74, 144, 226, 0.28);
    padding: 4px 6px;
    vertical-align: middle;
}

.sim-holding-list-table td.sim-holding-list-cs {
    font-weight: 800;
    white-space: nowrap;
}

.sim-holding-list-cs-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.sim-holding-list-xh-btn {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 4px;
    min-width: 1.65rem;
    height: 1.25rem;
    border: 1px solid rgba(248, 113, 113, 0.65);
    border-radius: 4px;
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
}

.sim-holding-list-xh-btn:hover {
    background: rgba(220, 38, 38, 0.28);
    border-color: rgba(248, 113, 113, 0.9);
}

.sim-holding-list-stack-cs {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sim-holding-exit-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: transparent;
    pointer-events: none;
    align-items: center;
    justify-content: center;
}

.sim-holding-exit-confirm-overlay.active {
    display: flex;
}

.sim-holding-exit-confirm-panel {
    pointer-events: auto;
    min-width: 260px;
    max-width: min(96vw, 360px);
}

.sim-holding-exit-confirm-header {
    cursor: default;
}

.sim-holding-exit-confirm-body {
    padding: 10px 12px 12px;
    background: transparent;
}

.sim-holding-exit-confirm-message {
    margin: 0 0 0.85rem;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.88);
}

.sim-holding-exit-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.sim-holding-exit-confirm-actions .btn {
    padding: 0.38rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.38;
    min-height: auto;
    border-radius: 6px;
}

.sim-holding-merge-panel {
    pointer-events: auto;
    min-width: 260px;
    max-width: min(96vw, 400px);
}

.sim-holding-merge-body {
    padding: 10px 12px 12px;
    background: transparent;
}

.sim-holding-merge-hint {
    margin: 0 0 0.65rem;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.75rem;
    line-height: 1.35;
    color: rgba(245, 247, 250, 0.72);
}

.sim-holding-merge-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: min(50vh, 280px);
    overflow-y: auto;
    margin-bottom: 0.85rem;
}

.sim-holding-merge-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.92);
    user-select: none;
}

.sim-holding-merge-item input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.sim-holding-merge-empty {
    margin: 0 0 0.85rem;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.82rem;
    color: rgba(245, 247, 250, 0.65);
}

.sim-holding-list-detached-panel .sim-advanced-label-title[data-holding-title] {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
}

.sim-holding-list-table th.sim-holding-list-col-num,
.sim-holding-list-table td.sim-holding-list-mc,
.sim-holding-list-table td.sim-holding-list-alv,
.sim-holding-list-table td.sim-holding-list-entry,
.sim-holding-list-table td.sim-holding-list-tih,
.sim-holding-list-table td.sim-holding-list-mtih {
    text-align: center;
    white-space: nowrap;
}

.sim-holding-list-subhead td {
    border: none;
    border-bottom: 1px solid rgba(74, 144, 226, 0.35);
    background: transparent;
    padding: 8px 10px 4px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(245, 247, 250, 0.95);
    text-align: left;
}

.sim-holding-list-row-warn td {
    color: #ca8a04 !important;
    background: rgba(202, 138, 4, 0.14);
}

.sim-holding-list-row-over td {
    color: #f87171 !important;
    background: rgba(220, 38, 38, 0.14);
}

.sim-holding-list-mtih-display {
    display: inline-block;
    min-width: 1.5rem;
    min-height: 1em;
    cursor: text;
}

.sim-holding-list-mtih-input {
    width: 3rem;
    margin: 0;
    padding: 0 2px;
    border: 1px solid rgba(147, 197, 253, 0.65);
    border-radius: 4px;
    background: rgba(14, 24, 38, 0.55);
    color: rgba(245, 247, 250, 0.95);
    font: inherit;
    font-weight: 800;
    text-align: center;
}

.sim-holding-list-alv-btn {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-weight: 800;
    color: rgba(147, 197, 253, 0.98);
    cursor: pointer;
}

.sim-holding-list-alv-btn:hover {
    text-decoration: underline;
}

.sim-alv-picker-header {
    padding: 8px 8px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.22);
    font-weight: 900;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    color: rgba(245, 247, 250, 0.92);
    text-align: center;
}

.sim-alv-picker-list {
    max-height: calc(7 * 26px);
    overflow-y: auto;
    padding: 6px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 800;
}

.sim-alv-item {
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(245, 247, 250, 0.9);
    cursor: pointer;
}

.sim-alv-item:hover {
    background: rgba(74, 144, 226, 0.18);
}

.sim-alv-item.current {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.sim-dct-picker {
    min-width: 150px;
    max-width: 240px;
}

.sim-dct-picker .sim-alv-picker-list {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-weight: 800;
}

.sim-dct-picker .sim-alv-item {
    justify-content: flex-start;
    padding: 0 10px;
    white-space: nowrap;
}

.sim-dct-wp-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 26px;
    border-radius: 8px;
    color: rgba(245, 247, 250, 0.9);
    overflow: hidden;
}

.sim-dct-wp-row.current {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.sim-dct-wp-row:hover {
    background: rgba(74, 144, 226, 0.14);
}

.sim-hold-arm-spacer {
    width: 22px;
    flex: 0 0 22px;
}

.sim-hold-arm-btn {
    flex: 0 0 24px;
    width: 24px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    font-size: 0.78rem;
    color: rgba(245, 247, 250, 0.55);
    background: transparent;
    align-self: center;
}

.sim-hold-arm-btn:hover,
.sim-hold-arm-btn.sim-hold-arm-btn-active {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.15);
}

.sim-dct-wp-name-btn {
    flex: 1 1 auto;
    margin: 0;
    padding: 0 6px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

.sim-dct-wp-name-btn:hover {
    text-decoration: underline;
}

.sim-dct-picker .sim-alv-subitem {
    justify-content: flex-start;
    padding: 0 10px 0 22px;
    height: 22px;
    font-weight: 700;
    color: rgba(245, 247, 250, 0.78);
    cursor: default;
}

.sim-flight-status-popup {
    min-width: 168px;
    max-width: min(96vw, 280px);
    /* font-size set in JS from simulation label size (simulationMap.labelSize) */
    font-size: 14px;
}

.sim-flight-status-popup .sim-alv-picker-header {
    font-size: 1em;
}

.sim-flight-status-popup .sim-alv-picker-list {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    max-height: none;
    font-size: 1em;
}

.sim-flight-status-popup .sim-alv-item {
    justify-content: flex-start;
    padding: 0 12px;
    white-space: nowrap;
    height: auto;
    min-height: calc(1.35 * 1em);
    font-size: 1em;
}

.sim-dct-picker .sim-alv-subitem:hover {
    background: transparent;
}

.turn-radius-editor {
    margin: 0.85rem 0 0.9rem;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(74, 144, 226, 0.25);
    background: rgba(26, 47, 74, 0.18);
}

.turn-radius-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.turn-radius-editor-title {
    font-weight: 900;
    color: rgba(245, 247, 250, 0.92);
    letter-spacing: 0.02em;
}

.turn-radius-editor-actions {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.turn-radius-editor-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr 0.8fr 0.8fr;
    gap: 0.6rem 0.75rem;
    align-items: center;
}

.turn-radius-row-label {
    font-weight: 800;
    color: rgba(245, 247, 250, 0.88);
    font-size: 0.92rem;
}

.turn-radius-col-header {
    font-weight: 900;
    color: rgba(245, 247, 250, 0.75);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.turn-radius-row-input {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.turn-radius-row-input input[type="number"] {
    width: 100%;
    max-width: 110px;
}

.turn-radius-unit {
    font-weight: 800;
    color: rgba(245, 247, 250, 0.7);
    font-size: 0.85rem;
    white-space: nowrap;
}

.airports-add-form {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(74, 144, 226, 0.25);
    background: rgba(26, 47, 74, 0.18);
    margin-bottom: 0.85rem;
}

.airports-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.airport-item {
    border: 1px solid rgba(74, 144, 226, 0.22);
    border-radius: 12px;
    background: rgba(14, 24, 38, 0.35);
    overflow: hidden;
}

.airport-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
    user-select: none;
}

.airport-item-title {
    font-weight: 900;
    color: rgba(245, 247, 250, 0.92);
}

.airport-item-subtitle {
    font-weight: 800;
    color: rgba(245, 247, 250, 0.7);
    font-size: 0.9rem;
}

.airport-item-body {
    padding: 0.75rem 0.8rem 0.85rem;
    border-top: 1px solid rgba(74, 144, 226, 0.18);
    display: none;
}

.airport-item.expanded .airport-item-body {
    display: block;
}

.airport-fields-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1.6fr;
    gap: 0.65rem 0.85rem;
    align-items: end;
    margin-bottom: 0.75rem;
}

.runways-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0.4rem 0 0.5rem;
}

.runways-title {
    font-weight: 900;
    color: rgba(245, 247, 250, 0.86);
}

.runway-item {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.18);
}

.runway-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr 0.8fr 1.2fr;
    gap: 0.5rem 0.65rem;
    align-items: end;
}

.runway-ends-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.85rem;
}

.approaches-header {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.approaches-title {
    font-weight: 800;
    color: rgba(245, 247, 250, 0.85);
    font-size: 0.9rem;
}

.approaches-list {
    margin-top: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.approach-item {
    border: 1px solid rgba(74, 144, 226, 0.18);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    background: rgba(14, 24, 38, 0.22);
}

.approach-name {
    font-weight: 900;
    color: rgba(245, 247, 250, 0.9);
    margin-bottom: 0.2rem;
}

.approach-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.approach-meta {
    font-size: 0.78rem;
    color: rgba(245, 247, 250, 0.72);
    margin-top: -0.05rem;
}

.approach-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
}

/* Compact buttons for inline approach actions */
.approach-actions .btn,
.approaches-header .btn {
    min-width: 0;
    padding: 0.38rem 0.6rem;
    font-size: 0.82rem;
    border-radius: 6px;
    line-height: 1.05;
    flex-direction: row;
    gap: 0.35rem;
}

.approach-seq {
    color: rgba(245, 247, 250, 0.72);
    font-size: 0.85rem;
    line-height: 1.2;
    word-break: break-word;
}

.sim-probing-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.sim-probing-colors {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.sim-probing-color {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(245, 247, 250, 0.85);
    white-space: nowrap;
}

.sim-probing-color input[type="color"] {
    width: 34px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    background: transparent;
}

.sim-selected-aircraft-thickness input[type="range"] {
    min-width: 120px;
    max-width: 200px;
    vertical-align: middle;
}

/* Flight Status (FST) colors modal */
.sim-fst-colors-list {
    margin-top: 0.5rem;
}

.sim-fst-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
}

.sim-fst-color-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sim-fst-color-label {
    font-size: 0.9rem;
    color: rgba(245, 247, 250, 0.92);
    flex: 1 1 160px;
}

.sim-fst-color-pickers {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#flightStatusColorsModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
}

#flightStatusColorsModal .modal-footer .btn {
    min-width: 120px;
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
    border-radius: 6px;
    line-height: 1.05;
}

#adminLoadSystemSettingModal .modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#adminLoadSystemSettingModal .modal-footer .btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
    border-radius: 6px;
    line-height: 1.05;
}

.simulation-controls .sim-spv-step {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.simulation-controls .sim-spv-toggle {
    min-width: 3.25rem;
    height: 32px;
    padding: 0 0.4rem;
    border-radius: 6px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-weight: 800;
    line-height: 1;
}

.sim-spv-title {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.sim-spv-value {
    font-size: 0.85rem;
}

.simulation-paused-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.65);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.45);
    pointer-events: none;
    user-select: none;
    z-index: 5;
}

/* Host connected users modal */
.sim-connected-users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: min(60vh, 480px);
    overflow-y: auto;
    margin-top: 0.5rem;
}

.sim-connected-users-sector {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.65rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
}

.sim-connected-users-sector-name {
    margin: 0 0 0.45rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f5f7fa;
}

.sim-connected-users-row {
    font-size: 0.85rem;
    color: #e5e7eb;
    margin: 0.2rem 0;
    word-break: break-all;
}

.sim-connected-users-role {
    display: inline-block;
    min-width: 3.5rem;
    font-weight: 600;
    color: #93c5fd;
}

.sim-connected-users-empty {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

.sim-connected-users-multi {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fbbf24;
}

.sim-connected-users-status {
    margin: 0;
}

/* Simulation Colors Modal */
.sim-colors-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sim-colors-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #f5f7fa;
    font-weight: 600;
}

.sim-color-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.sim-color-row label {
    color: rgba(245, 247, 250, 0.9);
    font-size: 0.9rem;
}

.sim-color-row input[type="color"] {
    width: 48px;
    height: 32px;
    border: 1px solid rgba(74, 144, 226, 0.35);
    background: transparent;
    border-radius: 6px;
    padding: 0;
}

.sim-color-row input[type="range"] {
    width: 100%;
}

.sim-slider-value {
    color: rgba(245, 247, 250, 0.85);
    font-size: 0.85rem;
    min-width: 48px;
    text-align: right;
}

.sim-toggle-row {
    grid-template-columns: 120px auto;
}

.sim-route-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.sim-route-select-row > .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
    line-height: 1.1;
    min-width: 11.5rem;
    box-sizing: border-box;
}

.sim-route-selected {
    color: rgba(245, 247, 250, 0.8);
    font-size: 0.85rem;
    text-align: right;
    flex: 1;
}

.sim-runway-ext-cl-row {
    margin-top: 0.35rem;
}

.sim-runway-ext-cl-row > .btn {
    width: 100%;
    min-width: 0;
}

.sim-runway-ext-cl-hint {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.sim-runway-ext-cl-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sim-runway-ext-cl-grid .form-group {
    margin-bottom: 0;
}

.sim-runway-ext-cl-grid .sim-color-row {
    margin: 0.25rem 0;
}

.sim-routes-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(44, 62, 80, 0.55);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
}

.sim-routes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(245, 247, 250, 0.9);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.sim-routes-panel-actions {
    display: flex;
    gap: 0.5rem;
}

.sim-routes-panel-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    line-height: 1.1;
    min-width: 3.25rem;
    box-sizing: border-box;
}

.sim-routes-checkbox-list {
    max-height: 240px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 0.25rem;
}

.sim-route-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(245, 247, 250, 0.9);
    font-size: 0.9rem;
    user-select: none;
}

.sim-route-checkbox input[type="checkbox"] {
    transform: translateY(1px);
}

.simulation-canvas {
    flex: 1;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    min-height: 0;
    border: 1px solid #cccccc;
}

#simulationCanvasElement {
    display: block;
    cursor: default;
    user-select: none;
    margin: 0 auto;
}

.simulation-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
}

#sectorCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waypoints-list,
.navaids-list,
.routes-list,
.boundaries-list,
.areas-list,
.holdings-list {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.waypoints-list h3,
.navaids-list h3,
.routes-list h3,
.boundaries-list h3,
.areas-list h3,
.holdings-list h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #f5f7fa;
    font-weight: 600;
}

#waypointsContainer,
#navaidsContainer,
#routesContainer,
#boundariesContainer,
#areasContainer,
#holdingsContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

.waypoint-search,
.route-search,
.boundary-search {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(26, 47, 74, 0.6);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 4px;
    color: #f5f7fa;
    font-size: 0.85rem;
}

.waypoint-search:focus,
.route-search:focus,
.boundary-search:focus {
    outline: none;
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.15);
}

.waypoint-search::placeholder,
.route-search::placeholder,
.boundary-search::placeholder {
    color: rgba(245, 247, 250, 0.5);
}

.waypoint-input-group {
    position: relative;
    margin-bottom: 0.75rem;
}

.route-waypoint-input {
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26, 47, 74, 0.95);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
}

.autocomplete-suggestion {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: #f5f7fa;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.1);
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background: rgba(74, 144, 226, 0.3);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.scroll-to-section {
    background: rgba(26, 47, 74, 0.9);
    border-top: 2px solid rgba(74, 144, 226, 0.3);
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    padding: 1rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.scroll-to-section span {
    color: #4a90e2;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
}

.scroll-to-section:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.6);
}

.scroll-to-section:active {
    background: rgba(74, 144, 226, 0.3);
}

.waypoint-item,
.navaid-item,
.route-item,
.boundary-item {
    background: rgba(44, 62, 80, 0.6);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.waypoint-actions,
.navaid-actions,
.route-actions,
.boundary-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-waypoint-btn,
.edit-navaid-btn,
.edit-route-btn,
.edit-boundary-btn,
.edit-map-area-btn,
.edit-holding-btn {
    background: rgba(74, 144, 226, 0.3);
    border: 1px solid rgba(74, 144, 226, 0.5);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: #4a90e2;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-waypoint-btn:hover,
.edit-navaid-btn:hover,
.edit-route-btn:hover,
.edit-boundary-btn:hover,
.edit-map-area-btn:hover,
.edit-holding-btn:hover {
    background: rgba(74, 144, 226, 0.5);
    border-color: rgba(74, 144, 226, 0.8);
}

.waypoint-item {
    color: #f5f7fa;
}

.navaid-item {
    color: #fef3c7;
}

.route-item {
    color: #00bcd4;
}

.boundary-item {
    color: #0000ff;
}

.waypoint-info,
.navaid-info,
.route-info,
.boundary-info {
    flex: 1;
}

.waypoint-name,
.navaid-name,
.route-name {
    font-weight: 600;
    margin-right: 0.5rem;
}

.waypoint-coords {
    font-size: 0.8rem;
    opacity: 0.7;
}

.navaid-type,
.navaid-coords {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-left: 0.35rem;
}

.route-waypoints {
    font-size: 0.8rem;
    opacity: 0.8;
}

.delete-waypoint-btn,
.delete-navaid-btn,
.delete-route-btn,
.delete-boundary-btn {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: #e74c3c;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-waypoint-btn:hover,
.delete-navaid-btn:hover,
.delete-route-btn:hover,
.delete-boundary-btn:hover {
    background: rgba(231, 76, 60, 0.5);
    border-color: rgba(231, 76, 60, 0.8);
}

.error-message {
    color: #ff8c42;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: block;
}


/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .button-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding-left: 0.5rem;
    }

    .container .button-row {
        align-items: flex-start;
    }

    .container .button-row .btn {
        width: min(252px, calc(100vw - 3rem));
        max-width: min(252px, calc(100vw - 3rem));
    }

    .landing-menu-wrap {
        width: min(252px, calc(100vw - 3rem));
        max-width: min(252px, calc(100vw - 3rem));
    }

    .landing-menu-wrap::after {
        left: 0;
        top: 100%;
        width: 100%;
        height: 0.5rem;
    }

    .landing-submenu {
        left: 0;
        top: calc(100% + 0.5rem);
        min-width: 0;
        width: 100%;
    }

    .landing-submenu-btn {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .sectors-grid {
        grid-template-columns: 1fr;
    }

    .exercises-list {
        max-height: min(50vh, 420px);
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .step-header .step-title {
        text-align: left;
        width: 100%;
    }

    .exercise-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .exercise-card-date {
        margin-left: 0;
    }
}

/* --- Print Maps (Edit Airspace): near full-screen modal, options / preview each 50% width --- */
#printMapsModal .modal-content.print-maps-modal-content {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 16px);
    min-height: min(92vh, calc(100vh - 24px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#printMapsModal .modal-content.print-maps-modal-content .modal-header {
    flex-shrink: 0;
}

#printMapsModal .modal-content.print-maps-modal-content .print-maps-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 1.25rem 1.5rem;
}

.print-maps-modal-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
    min-height: 0;
    flex: 1 1 auto;
}

.print-maps-options-col {
    flex: 1 1 50%;
    min-width: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.print-maps-preview-col {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 0.5rem;
}

/* Allow fixed-position floating text panel to extend without clipping */
#printMapsModal.active {
    overflow: visible;
}

#printMapsModal > .print-maps-annot-floating-panel.print-maps-annot-floating-panel--shape,
#printMapsModal > .print-maps-annot-floating-panel.print-maps-annot-floating-panel--line,
#printMapsModal > .print-maps-annot-floating-panel.print-maps-annot-floating-panel--rect {
    width: 12rem;
}

#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-sample-select {
    font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.72rem;
    letter-spacing: 0;
}

.print-maps-annot-overlay-layer .print-maps-annot-line-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-sizing: border-box;
}

.print-maps-annot-overlay-layer .print-maps-annot-line-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 3px solid #1565c0;
    box-sizing: border-box;
    cursor: grab;
    pointer-events: auto;
    z-index: 5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.print-maps-annot-overlay-layer .print-maps-annot-line-handle:active {
    cursor: grabbing;
}

.print-maps-annot-overlay-layer .print-maps-annot-rect-corner-nw,
.print-maps-annot-overlay-layer .print-maps-annot-rect-corner-ne,
.print-maps-annot-overlay-layer .print-maps-annot-rect-corner-se,
.print-maps-annot-overlay-layer .print-maps-annot-rect-corner-sw {
    cursor: nwse-resize;
}

.print-maps-annot-overlay-layer .print-maps-annot-rect-corner-ne,
.print-maps-annot-overlay-layer .print-maps-annot-rect-corner-sw {
    cursor: nesw-resize;
}

#printMapsModal > .print-maps-annot-floating-panel {
    position: fixed;
    z-index: 10050;
    width: 9.5rem;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-radius: 8px;
    background: rgba(18, 22, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    overflow: hidden;
}

.print-maps-annot-floating-panel-header {
    flex-shrink: 0;
    padding: 0.38rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(245, 247, 250, 0.95);
    background: rgba(21, 101, 192, 0.55);
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.print-maps-annot-floating-panel-header:active {
    cursor: grabbing;
}

.print-maps-annot-floating-panel-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.45rem;
}

.print-maps-annot-floating-panel-label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(245, 247, 250, 0.82);
}

#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-overlay-select,
#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-overlay-num {
    min-width: 0;
    width: 100%;
}

.print-maps-annot-rotation-row .print-maps-annot-rotation-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}

#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-rot-step-btn {
    flex: 0 0 auto;
    min-width: 1.75rem;
    padding: 0.25rem 0.35rem;
    font-weight: 700;
    line-height: 1;
}

#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-rotation-input {
    flex: 1 1 auto;
    min-width: 0;
}

#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-overlay-color {
    width: 100%;
    height: 2rem;
    padding: 2px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    box-sizing: border-box;
}

.print-maps-preview-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#printMapsPreviewCanvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

#printMapsPreviewCanvas.print-maps-preview-panning {
    cursor: grabbing;
}

.print-maps-section {
    margin-bottom: 1.25rem;
}

.print-maps-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f5f7fa;
    margin: 0 0 0.65rem 0;
}

.print-maps-page-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.6rem;
    margin-bottom: 0.65rem;
}

.print-maps-page-lock-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.print-maps-lock-view-hint {
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
    margin: 0;
    max-width: 100%;
    color: rgba(245, 247, 250, 0.78);
}

.print-maps-orientation-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.15rem;
}

.print-maps-orientation-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: rgba(245, 247, 250, 0.92);
}

.print-maps-orientation-row .print-maps-orientation-select.form-select {
    min-width: 11rem;
    max-width: 100%;
}

.print-maps-columns-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.print-maps-columns-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: rgba(245, 247, 250, 0.92);
}

.print-maps-columns-row .print-maps-columns-select.form-select {
    min-width: 11rem;
    max-width: 100%;
}

.print-maps-columns-hint {
    margin: 0.35rem 0 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    max-width: 100%;
}

#printMapsModal .print-maps-lock-view-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 0;
    width: auto;
}

.print-maps-preview-wrap canvas#printMapsPreviewCanvas.print-maps-preview-view-locked {
    cursor: default !important;
}

.print-maps-page-label {
    font-weight: 600;
    color: rgba(245, 247, 250, 0.9);
}

.print-maps-page-readout {
    font-variant-numeric: tabular-nums;
    color: #f5f7fa;
}

/* Print Maps — preview row uses compact buttons; export modal uses full-size actions */
/* Print Maps — export PDF modal */
#printMapsPdfExportModal.print-maps-pdf-export-modal .modal-footer.print-maps-pdf-export-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 0.5rem;
}

#printMapsPdfExportModal.print-maps-pdf-export-modal .modal-footer.print-maps-pdf-export-footer .btn {
    padding: 0.5rem 1.35rem;
    font-size: 0.9375rem;
    font-weight: 600;
    min-width: 9.5rem;
}

#printMapsModal .print-maps-page-row .btn.print-maps-page-btn,
#printMapsModal .print-maps-page-row .btn.print-maps-export-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 0.25rem;
    min-width: 0;
    width: auto;
    border-radius: 6px;
    border-width: 1px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#printMapsModal .print-maps-page-row .btn.print-maps-page-btn:hover,
#printMapsModal .print-maps-page-row .btn.print-maps-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.print-maps-page-btn[disabled],
.print-maps-page-btn.print-maps-btn-disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

#printMapsModal .btn.print-maps-select-area-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 0.35rem;
    min-width: 0;
    width: auto;
    max-width: none;
    align-self: flex-start;
    border-radius: 6px;
    border-width: 1px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.35rem;
}

#printMapsModal .btn.print-maps-select-area-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.print-maps-area-summary {
    margin: 0 0 0.75rem 0 !important;
}

.print-maps-details {
    margin-top: 0.65rem;
    border: 1px solid rgba(74, 144, 226, 0.35);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    background: rgba(26, 47, 74, 0.35);
}

.print-maps-details-summary {
    cursor: pointer;
    font-weight: 600;
    color: #dce8f7;
    padding: 0.25rem 0;
    user-select: none;
}

.print-maps-exclusion-choice-modal {
    z-index: 1200;
}

.print-maps-close-confirm-modal {
    z-index: 1350;
}

.print-maps-move-reset-confirm-modal {
    z-index: 1350;
}

.print-maps-confirm-actions-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
    align-items: center;
}

#printMapsCloseConfirmModal.print-maps-close-confirm-modal .print-maps-confirm-actions-compact .btn.print-maps-confirm-yes-btn,
#printMapsCloseConfirmModal.print-maps-close-confirm-modal .print-maps-confirm-actions-compact .btn.print-maps-confirm-no-btn,
#printMapsMoveResetConfirmModal.print-maps-move-reset-confirm-modal .print-maps-confirm-actions-compact .btn.print-maps-confirm-yes-btn,
#printMapsMoveResetConfirmModal.print-maps-move-reset-confirm-modal .print-maps-confirm-actions-compact .btn.print-maps-confirm-no-btn {
    padding: 0.38rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.38;
    min-height: auto;
    border-radius: 6px;
    flex-direction: row;
}

.print-maps-exclusions-hint {
    margin-bottom: 0.5rem;
}

.print-maps-exclusions-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.print-maps-exclusions-activate-btn {
    margin-bottom: 0;
}

/* Compact activate / reset (global .btn is oversized in this modal) */
#printMapsModal .btn.print-maps-exclusions-activate-btn,
#printMapsModal .btn.print-maps-exclusions-show-btn,
#printMapsModal .btn.print-maps-move-activate-btn,
#printMapsModal .btn.print-maps-move-reset-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    gap: 0.25rem;
    min-width: 0;
    width: auto;
    border-radius: 6px;
    border-width: 1px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#printMapsModal .btn.print-maps-exclusions-activate-btn:hover,
#printMapsModal .btn.print-maps-exclusions-show-btn:hover,
#printMapsModal .btn.print-maps-move-activate-btn:hover,
#printMapsModal .btn.print-maps-move-reset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.print-maps-exclusions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 10rem;
    overflow-y: auto;
}

.print-maps-exclusion-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(245, 247, 250, 0.92);
}

.print-maps-exclusion-item-label {
    flex: 1;
    min-width: 0;
}

.print-maps-exclusion-remove-btn {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
}

.print-maps-exclusion-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.print-maps-wp-coords-format-actions .btn[disabled],
.print-maps-wp-coords-format-actions .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Print Maps — custom waypoint appendix format builder (stacked above coord-format modal) */
.print-maps-wp-custom-builder-modal {
    z-index: 1210;
}

.print-maps-wp-custom-submodal {
    z-index: 1240;
}

.print-maps-wp-custom-hint {
    margin-bottom: 0.75rem;
}

.print-maps-wp-custom-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

#printMapsModal .btn.print-maps-wp-custom-tok-btn {
    flex-direction: row;
    padding: 0.32rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    width: auto;
}

.print-maps-wp-custom-seq-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.print-maps-wp-custom-sequence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.6rem;
    padding: 0.45rem;
    margin-bottom: 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(74, 144, 226, 0.35);
    background: rgba(26, 47, 74, 0.35);
}

.print-maps-wp-custom-seq-chip {
    flex-shrink: 0;
    padding: 0.28rem 0.5rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(74, 144, 226, 0.55);
    background: rgba(44, 62, 80, 0.85);
    color: rgba(245, 247, 250, 0.95);
    cursor: pointer;
    max-width: 100%;
}

.print-maps-wp-custom-seq-chip:hover {
    border-color: rgba(74, 144, 226, 0.95);
    background: rgba(52, 73, 94, 0.95);
}

.print-maps-wp-custom-preview {
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(230, 237, 246, 0.95);
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: rgba(15, 27, 46, 0.65);
    border: 1px solid rgba(74, 144, 226, 0.22);
    word-break: break-word;
}

.print-maps-wp-custom-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.print-maps-wp-custom-chip-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.print-maps-wp-custom-delete-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.print-maps-wp-custom-enter-text-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.print-maps-exclusions-empty {
    padding: 0.25rem 0;
}

.print-maps-moves-list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    max-height: 10rem;
    overflow-y: auto;
}

.print-maps-move-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(245, 247, 250, 0.92);
}

.print-maps-move-item-label {
    flex: 1;
    min-width: 0;
}

.print-maps-move-item-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

#printMapsModal .btn.print-maps-move-hide-line-btn,
#printMapsModal .btn.print-maps-move-remove-btn {
    padding: 0.22rem 0.48rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 6px;
}

.print-maps-moves-empty {
    padding: 0.25rem 0;
}

.print-maps-move-hint {
    margin-bottom: 0.5rem;
}

.print-maps-move-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.print-maps-move-activate-btn {
    margin-bottom: 0;
}

.print-maps-move-reset-btn {
    margin-bottom: 0;
}

#printMapsPreviewCanvas.print-maps-preview-move-mode:not(.print-maps-preview-move-dragging) {
    cursor: grab;
}

#printMapsPreviewCanvas.print-maps-preview-move-dragging {
    cursor: grabbing;
}

#printMapsPreviewCanvas.print-maps-preview-annot-mode:not(.print-maps-preview-annot-dragging) {
    cursor: crosshair;
}

#printMapsPreviewCanvas.print-maps-preview-annot-dragging {
    cursor: crosshair;
}

.print-maps-annot-hint {
    margin-bottom: 0.45rem;
}

.print-maps-annot-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

#printMapsModal .btn.print-maps-annot-tool-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 0;
    width: auto;
    border-radius: 6px;
}

#printMapsModal .btn.print-maps-annot-tool-btn.print-maps-annot-tool-active {
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.65);
}

.print-maps-annot-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.print-maps-annot-overlay-select,
.print-maps-annot-overlay-num {
    padding: 0.28rem 0.38rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.98);
    color: #1a1d24;
    font-size: 0.78rem;
    min-width: 7rem;
}

.print-maps-annot-overlay-num {
    width: 4rem;
    min-width: 4rem;
}

#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-overlay-done-btn,
#printMapsModal > .print-maps-annot-floating-panel .print-maps-annot-overlay-cancel-btn {
    padding: 0.32rem 0.62rem;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 6px;
    width: 100%;
    justify-content: center;
}

.print-maps-annot-overlay-kit {
    position: absolute;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    box-sizing: border-box;
}

.print-maps-annot-overlay-frame {
    position: relative;
    pointer-events: auto;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 2px dashed #1565c0;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.print-maps-annot-overlay-move-grip {
    flex-shrink: 0;
    height: 22px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(21, 101, 192, 0.98);
    background: rgba(255, 255, 255, 0.88);
    cursor: move;
    user-select: none;
    border: 2px solid #1565c0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    box-sizing: border-box;
}

.print-maps-annot-overlay-kit .print-maps-annot-overlay-frame {
    border-radius: 0 0 6px 6px;
}

.print-maps-annot-overlay-textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    flex: 1 1 auto;
    min-height: 24px;
    resize: none;
    margin: 0;
    padding: 6px;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: #0d47a1;
    line-height: 1.25;
}

.print-maps-annot-overlay-textarea::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

.print-maps-annot-overlay-shape-slot {
    flex: 1 1 auto;
    min-height: 24px;
    width: 100%;
    pointer-events: none;
}

.print-maps-annot-overlay-handles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.print-maps-annot-overlay-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    margin: -5px;
    background: #fff;
    border: 2px solid #1565c0;
    box-sizing: border-box;
    pointer-events: auto;
    border-radius: 2px;
    z-index: 3;
}

.print-maps-annot-overlay-handle-nw {
    top: 0;
    left: 0;
    cursor: nwse-resize;
}
.print-maps-annot-overlay-handle-n {
    top: 0;
    left: 50%;
    cursor: ns-resize;
}
.print-maps-annot-overlay-handle-ne {
    top: 0;
    right: 0;
    cursor: nesw-resize;
}
.print-maps-annot-overlay-handle-e {
    top: 50%;
    right: 0;
    cursor: ew-resize;
}
.print-maps-annot-overlay-handle-se {
    bottom: 0;
    right: 0;
    cursor: nwse-resize;
}
.print-maps-annot-overlay-handle-s {
    bottom: 0;
    left: 50%;
    cursor: ns-resize;
}
.print-maps-annot-overlay-handle-sw {
    bottom: 0;
    left: 0;
    cursor: nesw-resize;
}
.print-maps-annot-overlay-handle-w {
    top: 50%;
    left: 0;
    cursor: ew-resize;
}

.print-maps-annot-overlay-handle-n,
.print-maps-annot-overlay-handle-s {
    transform: translateX(-50%);
}
.print-maps-annot-overlay-handle-e,
.print-maps-annot-overlay-handle-w {
    transform: translateY(-50%);
}

.print-maps-check-grid {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    max-height: 10rem;
    overflow-y: auto;
}

.print-maps-annot-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    color: rgba(245, 247, 250, 0.92);
}

.print-maps-annot-item-label {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.print-maps-annot-item-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

#printMapsModal .btn.print-maps-annot-edit-btn,
#printMapsModal .btn.print-maps-annot-remove-btn {
    padding: 0.22rem 0.48rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 6px;
}

.print-maps-annot-empty {
    padding: 0.25rem 0;
}

.print-maps-check-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.5rem;
    padding-bottom: 0.35rem;
}

.print-maps-check {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: rgba(245, 247, 250, 0.92);
    font-size: 0.92rem;
    cursor: pointer;
}

.print-maps-check input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.print-maps-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.5rem;
    padding-bottom: 0.35rem;
}

.print-maps-slider-row {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 38%) 2rem;
    align-items: center;
    gap: 0.5rem;
    color: rgba(245, 247, 250, 0.88);
    font-size: 0.88rem;
}

.print-maps-slider-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #b8d4f5;
}

.sector-map-print-area-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    pointer-events: none;
    cursor: crosshair;
    box-sizing: border-box;
}

.sector-map-print-area-overlay.sector-map-print-area-overlay-active {
    display: block;
    pointer-events: auto;
}

.sector-map-print-area-overlay .sector-map-print-area-rect {
    position: absolute;
    border: 2px dashed #1565c0;
    background: rgba(21, 101, 192, 0.12);
    box-sizing: border-box;
    pointer-events: none;
}

.sector-map-satbg-area-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    pointer-events: none;
    cursor: crosshair;
    box-sizing: border-box;
}

.sector-map-satbg-area-overlay.sector-map-satbg-area-overlay-active {
    display: block;
    pointer-events: auto;
}

.sector-map-satbg-area-overlay .sector-map-satbg-area-rect {
    position: absolute;
    border: 2px dashed #2e7d32;
    background: rgba(46, 125, 50, 0.14);
    box-sizing: border-box;
    pointer-events: none;
}

.sector-map-bg-live-calib-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: min(92vw, 52rem);
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 152, 0, 0.6);
    border-radius: 8px;
    color: rgba(245, 247, 250, 0.95);
    font-size: 0.82rem;
    line-height: 1.3;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.sector-map-bg-live-calib-hint {
    flex: 1 1 auto;
    min-width: 12rem;
}

.sector-map-bg-live-calib-count {
    flex: 0 0 auto;
    white-space: nowrap;
    color: #ffb74d;
    font-weight: 600;
}

.sector-map-bg-live-calib-finish-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .sector-map-bg-live-calib-bar {
        flex-wrap: wrap;
        max-width: 96vw;
    }
}

@media (max-width: 900px) {
    #printMapsModal .modal-content.print-maps-modal-content {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        min-height: unset;
        max-height: calc(100vh - 12px);
    }

    .print-maps-modal-body {
        flex-direction: column;
        min-height: 0;
    }

    .print-maps-preview-col {
        flex: 1 1 auto;
        max-height: 50vh;
        overflow: auto;
    }

    .print-maps-slider-row {
        grid-template-columns: 1fr;
    }

    .print-maps-slider-val {
        text-align: left;
    }
}

/* --- User auth (login / subscribe / admin users) --- */
body.auth-page {
    align-items: flex-start;
    padding: 2rem 1rem 3rem;
    background-color: #0a1929;
    background-image: url('../images/webATC background.png');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.auth-shell {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.auth-card {
    background: rgba(12, 22, 36, 0.92);
    border: 1px solid rgba(120, 140, 170, 0.35);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.auth-brand h1 {
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

.auth-tagline {
    opacity: 0.85;
    margin-bottom: 1.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(245, 247, 250, 0.75);
    border: 1px solid rgba(120, 140, 170, 0.25);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.auth-tab.active,
.auth-tab:hover {
    color: #fff;
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(37, 99, 235, 0.18);
}

.auth-form .form-group {
    text-align: left;
}

.auth-submit {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-footnote {
    margin-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.75;
    line-height: 1.45;
}

.auth-banner,
.auth-message {
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
    text-align: left;
}

.auth-banner-info,
.auth-message-info {
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.35);
}

.auth-banner-warn,
.auth-message-error {
    background: rgba(185, 28, 28, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.auth-message-success {
    background: rgba(22, 101, 52, 0.22);
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.auth-verify-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(4, 10, 20, 0.72);
    backdrop-filter: blur(4px);
}

.auth-verify-card {
    width: min(100%, 460px);
    background: rgba(18, 28, 42, 0.96);
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.auth-verify-card h2 {
    margin: 0 0 0.75rem;
    color: #f5f7fa;
}

.auth-verify-timer {
    margin: 0 0 1rem;
    font-weight: 600;
    color: #93c5fd;
}

.auth-verify-code-input {
    letter-spacing: 0.35em;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-verify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.auth-verify-actions .btn {
    flex: 1 1 180px;
}

.auth-verify-footnote {
    margin-top: 1rem;
    margin-bottom: 0;
}

.auth-legal-acceptance {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
}

.auth-legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.45;
    font-size: 0.92rem;
}

.auth-legal-checkbox input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.auth-legal-link {
    background: none;
    border: none;
    padding: 0;
    color: #8ec5ff;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.auth-legal-link:hover {
    color: #b8dcff;
}

.legal-shell {
    max-width: 760px;
}

.legal-card {
    max-height: none;
}

.legal-document-body {
    max-height: none;
    overflow: visible;
}

.legal-section + .legal-section {
    margin-top: 1.25rem;
}

.legal-section h2,
.legal-section h3 {
    font-size: 1rem;
    margin: 0 0 0.55rem;
}

.legal-section p {
    margin: 0 0 0.65rem;
    line-height: 1.55;
    opacity: 0.92;
}

.legal-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.legal-modal-card {
    width: min(720px, 100%);
    max-height: min(88vh, 900px);
    display: flex;
    flex-direction: column;
}

.legal-modal-body {
    overflow: auto;
    max-height: min(58vh, 620px);
    padding-right: 0.35rem;
    margin: 0.75rem 0 1rem;
}

.admin-users-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding-bottom: 2rem;
}

.admin-users-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-users-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-users-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-users-toolbar .form-input {
    width: auto;
    min-width: 180px;
}

.admin-users-table-wrap {
    overflow-x: auto;
    min-height: 28rem;
    background: rgba(12, 22, 36, 0.92);
    border: 1px solid rgba(120, 140, 170, 0.35);
    border-radius: 12px;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.admin-users-table th,
.admin-users-table td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid rgba(120, 140, 170, 0.18);
    text-align: left;
    vertical-align: top;
}

.admin-users-table th {
    font-weight: 600;
    opacity: 0.9;
}

.admin-users-table td {
    overflow: visible;
}

.admin-users-actions-cell {
    width: 1%;
    white-space: nowrap;
}

.admin-user-actions-menu {
    position: relative;
    display: inline-block;
}

.admin-user-actions-trigger {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    min-width: 5.5rem;
}

.admin-user-actions-dropdown {
    display: none;
    position: fixed;
    min-width: 12.5rem;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(120, 140, 170, 0.35);
    background: rgba(12, 22, 36, 0.98);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    z-index: 1200;
}

.admin-user-actions-menu.is-open .admin-user-actions-dropdown {
    display: block;
}

.admin-user-action-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.65rem;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.admin-user-action-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

.admin-user-action-item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-user-action-primary {
    color: #86efac;
}

.admin-user-action-danger {
    color: #fca5a5;
}

.admin-user-actions-divider {
    height: 1px;
    margin: 0.35rem 0.2rem;
    background: rgba(120, 140, 170, 0.25);
}

.admin-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-user-actions .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
}

.admin-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    background: rgba(234, 179, 8, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.35);
}

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    text-transform: capitalize;
}

.status-pending { background: rgba(234, 179, 8, 0.18); }
.status-approved { background: rgba(34, 197, 94, 0.18); }
.status-rejected { background: rgba(239, 68, 68, 0.18); }
.status-disabled { background: rgba(148, 163, 184, 0.18); }

.user-session-bar {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    z-index: 20;
}

.user-session-bar .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

.user-session-email {
    font-size: 0.82rem;
    opacity: 0.85;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-access-banner {
    max-width: 720px;
    margin: 0 0 1.25rem 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.45;
    background: rgba(234, 179, 8, 0.16);
    border: 1px solid rgba(250, 204, 21, 0.35);
    color: #fde68a;
}

.container .button-row .btn.platform-locked,
.container .button-row a.btn.platform-locked {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
    transform: none;
}

.platform-access-link {
    color: #fde68a;
    font-weight: 600;
    margin-left: 0.35rem;
}

.subscribe-shell {
    max-width: 520px;
}

.subscribe-shell-wide {
    max-width: 820px;
}

.subscribe-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: stretch;
}

.subscribe-plans-grid .subscribe-plan-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.subscribe-plan-btn {
    margin-top: auto;
    width: 100%;
}

.subscribe-plan-box {
    text-align: left;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    border: 1px solid rgba(120, 140, 170, 0.25);
    background: rgba(255, 255, 255, 0.03);
}

.subscribe-plan-box h2 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.subscribe-plan-detail {
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.subscribe-plan-features {
    margin-left: 1.1rem;
    line-height: 1.55;
    opacity: 0.9;
}

.subscribe-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.subscribe-actions-primary {
    margin-bottom: 1rem;
}

.subscribe-actions .btn,
.subscribe-actions a.btn {
    width: 100%;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.promo-code-box {
    margin-top: 1rem;
}

.promo-code-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: stretch;
}

.promo-code-input {
    flex: 1 1 180px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
}

.promo-code-row .btn {
    flex: 0 0 auto;
}

.admin-promotions-create {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 12px;
    background: rgba(12, 22, 36, 0.55);
}

.admin-promotions-create h2 {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
}

.admin-promotions-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem 1rem;
    align-items: end;
}

.admin-promotions-generate-cell {
    display: flex;
    align-items: flex-end;
}

.promo-code-chip {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: rgba(30, 58, 95, 0.85);
    letter-spacing: 0.14em;
    font-weight: 700;
}

.admin-promotions-storage-hint {
    margin-top: 0.35rem;
}

.admin-promotions-storage-warn {
    color: #fca5a5;
}

.admin-promotions-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 11rem;
}

.admin-promo-action-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

.promo-status-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.promo-status-active {
    background: rgba(22, 101, 52, 0.25);
    color: #86efac;
}

.promo-status-stopped {
    background: rgba(127, 29, 29, 0.28);
    color: #fca5a5;
}
