#vigfoot-map {
    width: 100%;
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    position: relative;
    background: var(--bg-elevated);
    overflow: hidden;
}

/* Editor Control Bar: 지도 하단 분리 배치 */
#floating-editor-ui {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: rgba(10, 10, 15, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-radius: 0 0 6px 6px;
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}

#floating-editor-ui > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#floating-editor-ui button {
    padding: 5px 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    font-family: var(--font-mono);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#floating-editor-ui button:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
}

#btn-mode-view {
    background: rgba(56, 189, 248, 0.18) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

#btn-save-polygon {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #10b981 !important;
    border-color: #10b981 !important;
    padding: 5px 14px !important;
}

#testZone-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 10px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

#telemetry-info {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 10px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-height: 60px;
    color: var(--text-main);
    line-height: 1.5;
}

/* Override .alert-danger to animate border-color and prevent opacity overrides */
.alert-danger {
    animation: alert-blink-custom 0.8s infinite !important;
}

@keyframes alert-blink-custom {
    0% {
        background-color: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
        border-color: rgba(239, 68, 68, 0.4);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.4);
        color: #fff;
        border-color: #ef4444;
    }
    100% {
        background-color: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
        border-color: rgba(239, 68, 68, 0.4);
    }
}

/* Map Danger blinking border */
.map-danger-active {
    opacity: 1 !important;
    animation: map-danger-blink 0.8s infinite !important;
}

@keyframes map-danger-blink {
    0% {
        border-color: rgba(239, 68, 68, 0.4);
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
    }
    50% {
        border-color: #ef4444;
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
    }
    100% {
        border-color: rgba(239, 68, 68, 0.4);
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
    }
}

/* --- Mobile Layout optimizations (max-width: 768px) --- */
@media (max-width: 768px) {
    #map-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    #vigfoot-map {
        order: 1 !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    #vessel-stowage-hud {
        position: absolute !important;
        transform: scale(0.68) !important;
        transform-origin: bottom right !important;
        bottom: 6px !important;
        right: 6px !important;
        width: 140px !important;
        order: unset !important;
    }

    /* Autopilot & Telemetry Collapse Content stacking */
    #local-content .collapse-content {
        flex-direction: column !important;
    }

    #autopilot-panel {
        border-right: none !important;
        border-bottom: 1px dashed var(--border) !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    #telemetry-panel {
        flex-direction: column !important;
        width: 100% !important;
    }

    #telemetry-panel > div:first-child {
        border-right: none !important;
        border-bottom: 1px dashed var(--border) !important;
        width: 100% !important;
    }

    #telemetry-panel > div:last-child {
        height: 120px !important;
        width: 100% !important;
    }
}

/* ============================================================
   TOAST NOTIFICATION SYSTEM
   ============================================================ */

#vigfoot-toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.vigfoot-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 260px;
    max-width: 360px;
    padding: 11px 14px;
    background: rgba(10, 12, 16, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-main);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    pointer-events: auto;
    animation: toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vigfoot-toast.toast-out {
    animation: toast-out 0.22s ease-in forwards;
}

.vigfoot-toast-icon {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

.vigfoot-toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vigfoot-toast-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.6;
}

.vigfoot-toast-msg {
    font-size: 11px;
    color: var(--text-main);
    word-break: break-word;
}

/* Type variants — left border accent */
.vigfoot-toast.toast-success {
    border-left: 3px solid #10b981;
}
.vigfoot-toast.toast-success .vigfoot-toast-label { color: #10b981; opacity: 1; }

.vigfoot-toast.toast-warning {
    border-left: 3px solid #f59e0b;
}
.vigfoot-toast.toast-warning .vigfoot-toast-label { color: #f59e0b; opacity: 1; }

.vigfoot-toast.toast-danger {
    border-left: 3px solid #ef4444;
}
.vigfoot-toast.toast-danger .vigfoot-toast-label { color: #ef4444; opacity: 1; }

.vigfoot-toast.toast-info {
    border-left: 3px solid var(--accent);
}
.vigfoot-toast.toast-info .vigfoot-toast-label { color: var(--accent); opacity: 1; }

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 120px;
        margin-bottom: 0;
    }
    to {
        opacity: 0;
        transform: translateX(24px);
        max-height: 0;
        margin-bottom: -8px;
        padding-top: 0;
        padding-bottom: 0;
    }
}

@media (max-width: 768px) {
    #vigfoot-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    .vigfoot-toast {
        min-width: 0;
        max-width: 100%;
    }
}

/* API Log Entry Highlight in Terminal Bar */
.log-entry-api {
    background: rgba(34, 211, 238, 0.06) !important;
    border-left: 2px solid #22d3ee !important;
    padding-left: 6px !important;
}

 / *   P r i s m J S   E d i t o r   S t y l i n g   * / 
 . e d i t o r - c o n t a i n e r   { 
         p o s i t i o n :   r e l a t i v e ; 
         w i d t h :   1 0 0 % ; 
         h e i g h t :   1 0 0 % ; 
 } 
 # j a v a - e d i t o r ,   # h i g h l i g h t i n g   { 
         m a r g i n :   0   ! i m p o r t a n t ; 
         p a d d i n g :   1 0 p x   ! i m p o r t a n t ; 
         b o r d e r :   0   ! i m p o r t a n t ; 
         w i d t h :   1 0 0 % ; 
         h e i g h t :   1 0 0 % ; 
         f o n t - f a m i l y :   v a r ( - - f o n t - m o n o )   ! i m p o r t a n t ; 
         f o n t - s i z e :   1 3 p x   ! i m p o r t a n t ; 
         l i n e - h e i g h t :   1 . 5   ! i m p o r t a n t ; 
         p o s i t i o n :   a b s o l u t e ; 
         t o p :   0 ; 
         l e f t :   0 ; 
         w h i t e - s p a c e :   p r e   ! i m p o r t a n t ; 
         o v e r f l o w - w r a p :   n o r m a l ; 
         o v e r f l o w :   a u t o ; 
         b o x - s i z i n g :   b o r d e r - b o x ; 
         t a b - s i z e :   4 ; 
 } 
 # j a v a - e d i t o r   { 
         c o l o r :   t r a n s p a r e n t   ! i m p o r t a n t ;   / *   T e x t   i s   i n v i s i b l e   * / 
         b a c k g r o u n d :   t r a n s p a r e n t   ! i m p o r t a n t ; 
         c a r e t - c o l o r :   w h i t e ;   / *   C u r s o r   i s   v i s i b l e   * / 
         z - i n d e x :   1 ;   / *   A b o v e   c o d e   * / 
         r e s i z e :   n o n e ; 
         o u t l i n e :   n o n e ; 
 } 
 # h i g h l i g h t i n g   { 
         z - i n d e x :   0 ;   / *   B e l o w   t e x t a r e a   * / 
         p o i n t e r - e v e n t s :   n o n e ;   / *   I g n o r e   m o u s e   e v e n t s   * / 
 } 
 # h i g h l i g h t i n g - c o n t e n t   { 
         f o n t - f a m i l y :   v a r ( - - f o n t - m o n o )   ! i m p o r t a n t ; 
         f o n t - s i z e :   1 3 p x   ! i m p o r t a n t ; 
         l i n e - h e i g h t :   1 . 5   ! i m p o r t a n t ; 
 } 
  
 