html, body {
    height: 100%;
    margin: 0;
    font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0b1220;
    color: #e8ecf5;
}

.brand{
    font-family: 'Orbitron', sans-serif;
}

/* Top navigation bar */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    color: #0b1220;
    z-index: 2000;
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

#navbar .brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.nav-toggle {
    display: none;
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 20px;
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.12);
    color: #0b1220;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

#navbar .nav-items {
    display: flex;
    align-items: center;
    gap: 14px;
}
#navbar .nav-items .nav-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    flex-wrap: wrap;
}
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
#navbar .nav-items .nav-filters .search-wrapper { position: relative; }
#navbar .nav-items .nav-filters input[type="text"],
#navbar .nav-items .nav-filters select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #090c14;
    color: #ffffff;
    font-size: 13px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}
#navbar .nav-items .nav-filters input[type="text"]::placeholder,
#navbar .nav-items .nav-filters select::placeholder {
    color: rgba(255,255,255,0.7);
    opacity: 1;
}
#navbar .nav-items .nav-filters input[type="text"] { min-width: 180px; }
#navbar .nav-items .nav-filters .search-suggestions {
    position: absolute;
    top: 38px;
    left: 0;
    right: 0;
    background: #0b1220;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    z-index: 1200;
    display: none;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}
#navbar .nav-items .nav-filters .search-suggestions .item {
    padding: 10px 12px;
    cursor: pointer;
    color: #e8ecf5;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
#navbar .nav-items .nav-filters .search-suggestions .item:last-child {
    border-bottom: none;
}
#navbar .nav-items .nav-filters .search-suggestions .item:hover {
    background: rgba(255,255,255,0.08);
}
    #navbar .nav-items .nav-filters .checkbox-inline {
        display: flex;
        align-items: center;
        gap: 0;
        font-size: 14px;
        color: #444;
        white-space: nowrap;
    }
#navbar .nav-items .nav-filters input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #111;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}
#navbar .nav-items .nav-filters input[type="checkbox"]:checked {
    background: #111;
}
#navbar .nav-items .nav-filters input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}
#navbar .nav-items .nav-filters input[type="checkbox"].forced-off {
    background: #ddd;
    cursor: not-allowed;
}
#navbar .nav-items .nav-filters input[type="checkbox"].forced-off::after {
    content: '✕';
    color: #c00;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
#navbar .nav-items .nav-filters button,
#navbar .nav-items .nav-filters select#layerSelect {
    background: #111;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: inset 0 -2px 4px rgba(255,255,255,0.08);
    font-weight: 500;
}

#navbar .nav-items a {
    color: #0b1220;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

#navbar .nav-items a:hover {
    background: rgba(0,0,0,0.05);
}

.nav-premium {
    background: #111;
    color: #fff !important;
    border: none;
    padding: 8px 12px !important;
    border-radius: 8px;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.18);
}
.nav-premium:hover {
    background: #000 !important;
}

#navbar .nav-items .nav-filters select option {
    background: #ffffff;
    color: #0b1220;
    padding: 10px 12px;
}
@media (-webkit-min-device-pixel-ratio:0) {
    #navbar .nav-items .nav-filters select::-ms-expand {
        display: none;
    }
}


#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: inset 0 0 16px rgba(0,0,0,0.2);
}
.map-wrapper {
    position: absolute;
    top: 72px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}
.nav-gear {
    background: #111;
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.map-options {
    position: fixed;
    top: 72px;
    right: 20px;
    transform: translateY(-100%);
    opacity: 0;
    z-index: 1000;
    background: rgba(11, 18, 32, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    color: #e8ecf5;
    font-size: 12px;
    transition: all 0.2s ease;
    pointer-events: none;
}
.map-options i {
    margin-right: 5px;
    width: 14px;
    text-align: center;
    color: #e8ecf5;
}
.map-options.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.map-options label {
    display: block;
    margin-bottom: 4px;
    cursor: pointer;
}
.map-options input {
    margin-right: 6px;
}
/* Align map overlays with wrapper */
/* adjust coordinates overlay margin */
#coordinates {
    position: fixed;
    bottom: 20px;
    left: 24px;
    background: rgba(11, 18, 32, 0.8);
    padding: 6px 10px;
    border-radius: 6px;
    z-index: 1000;
    color: #c8d2e4;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
/* counts */
#fleetCounts {
    position: fixed;
    top: 80px !important;
    left: 20px;
    background: rgba(11, 18, 32, 0.85);
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 1000;
    color: #e8ecf5;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    min-width: 180px;
}
.loading-indicator {
    display: block;
    margin-top: 4px;
    color: #7ad8ff;
    font-size: 12px;
    min-height: 16px;
}
#loadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.loading-card {
    background: rgba(9, 14, 26, 0.92);
    padding: 18px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e8ecf5;
    text-align: left;
    min-width: 320px;
    max-width: 520px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #7ad8ff;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}
.loading-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.loading-title {
    font-weight: 800;
    font-size: 16px;
    color: #7ad8ff;
}
.loading-sub {
    color: #ffffff;
    font-size: 13px;
    margin-bottom: 10px;
}
.loading-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #ffffff;
    font-size: 13px;
}
.loading-bullets li {
    margin-bottom: 6px;
}
.loading-note {
    margin-top: 10px;
    font-size: 12px;
    color: #7ad8ff;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .loading-card {
        width: 90%;
        min-width: 0;
        max-width: 90%;
        padding: 16px;
    }
}

#weather-overlay {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11, 18, 32, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 1000;
    color: #c8d2e4;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Ship detail panel */
/* Shift ship detail inside map wrapper */
#shipDetailPanel {
    display:none;
    position: fixed;
    top: 80px;
    right: 20px;
    box-sizing: border-box;
    width: 380px;
    height: calc(95vh - 56px);
    background-color: #01040b;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overflow-x: visible;
    padding: 18px;
    border-radius: 16px !important;
    z-index: 1000;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    color: #e8ecf5;
}

#scheduleModal {
    display: none;
    position: fixed;
    top: 80px;
    left: 20px;
    box-sizing: border-box;
    width: 380px;
    height: calc(95vh - 56px);
    background-color: #01040b;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
    border-radius: 16px;
    z-index: 1100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: #e8ecf5;
}

#scheduleModal .schedule-close {
    position: absolute;
    top: 10px;
    right: 12px;
    cursor: pointer;
    font-size: 18px;
    color: #a9b5cc;
    background: none;
    border: none;
}

#scheduleModal .schedule-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

#scheduleModal .schedule-title {
    font-size: 18px;
    font-weight: 700;
    color: #7ad8ff;
}

#scheduleModal .schedule-subtitle {
    font-size: 12px;
    color: #8fa3c2;
}

#scheduleModal .schedule-window {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 10px;
}

#scheduleModal .schedule-table {
    display: grid;
    gap: 8px;
}

#scheduleModal .schedule-row {
    display: grid;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    font-size: 12px;
    color: #e8ecf5;
}

#scheduleModal .schedule-row.schedule-head {
    background: transparent;
    border: none;
    padding: 0 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8fa3c2;
}

#scheduleModal .schedule-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#scheduleModal .schedule-port {
    font-weight: 600;
    color: #ffffff;
}

#scheduleModal .schedule-locode {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

#scheduleModal .schedule-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 4px;
}

.last-known-pin .pin-dot {
    width: 10px;
    height: 10px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.last-known-pin .pin-label {
    margin-top: -2px;
    font-size: 11px;
    color: #fff;
    background: rgba(0,0,0,0.75);
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1.3;
    white-space: nowrap;
}

#shipDetailPanel .close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    cursor: pointer;
    font-size: 18px;
    color: #a9b5cc;
}
#shipDetailPanel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
#shipDetailPanel .panel-header h2 {
    margin-bottom: 4px;
    color: #ffffff;
}

#shipDetailPanel .sanction-badge {
    position: absolute;
    top: -12px;
    left: -24px;
    display: inline-block;
    background: #c62828;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 2;
}

#shipDetailPanel .pill {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
#shipDetailPanel .action-row {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 8px;
    margin-bottom: 10px;
    justify-content: flex-start;
}
#shipDetailPanel .copy-btn,
#shipDetailPanel .watch-btn,
#shipDetailPanel .alert-btn {
    font-size: 11px;
    padding: 4px 7px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.1);
    color: #e8ecf5;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}
#shipDetailPanel .watch-btn.active {
    background: #2bbf6a;
    color: #0b1220;
    border-color: #2bbf6a;
}
#shipDetailPanel .alert-btn.active {
    background: #7ad8ff;
    color: #0b1220;
    border-color: #7ad8ff;
}

.track-clear-btn {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 1200;
    display: none;
}
.track-clear-btn .btn {
    margin-top: 0;
    padding: 10px 16px;
}
.schedule-close-btn {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 1200;
    display: none;
}
.schedule-close-btn .btn {
    margin-top: 0;
    padding: 10px 16px;
}
#shipDetailPanel .copy-btn:hover,
#shipDetailPanel .watch-btn:hover,
#shipDetailPanel .alert-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
#shipDetailPanel .copy-btn.copied {
    background: #2bbf6a;
    color: #0b1220;
    border-color: #2bbf6a;
}
#shipDetailPanel .watch-btn.disabled,
#shipDetailPanel .alert-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#shipDetailPanel .alert-btn.disabled {
    pointer-events: none;
}
#shipDetailPanel .alert-btn {
    background: rgba(255, 255, 255, 0.08);
}
.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(12, 18, 30, 0.95);
    color: #e8ecf5;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5000;
    pointer-events: none;
    font-size: 13px;
}
.toast.show {
    opacity: 1;
}

.track-progress {
    position: fixed;
    left: 50%;
    bottom: 54px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    z-index: 1001;
    color: #e8ecf5;
    font-size: 12px;
    backdrop-filter: blur(6px);
}
.track-progress .controls {
    display: flex;
    gap: 6px;
}
.track-progress .controls button {
    background: rgba(255,255,255,0.12);
    color: #e8ecf5;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}
.track-progress .controls button:hover {
    background: rgba(255,255,255,0.2);
}
.track-progress input[type="range"] {
    width: 240px;
    accent-color: #ff6b6b;
}
.track-progress span {
    min-width: 170px;
    text-align: left;
}

.highlight-beacon {
    position: relative;
    pointer-events: none;
}
.highlight-beacon .beacon-wave {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.92);
    border: 2px solid rgba(255, 209, 102, 0.95);
    box-shadow: 0 0 30px rgba(255, 209, 102, 0.7);
    animation: beaconPulse 1.8s ease-out infinite;
    transform-origin: center;
}
.highlight-beacon .beacon-wave::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid rgba(255, 209, 102, 0.4);
    animation: beaconWave 2.4s linear infinite;
}
.highlight-beacon .beacon-wave::before {
    content: '';
    position: absolute;
    top: -14px;
    left: -14px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 209, 102, 0.25);
    animation: beaconWave 3s linear infinite;
}

@keyframes beaconPulse {
    0% { transform: scale(0.5); opacity: 0.8; }
    60% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1.1); opacity: 0.2; }
}

@keyframes beaconWave {
    0% { transform: scale(0.3); opacity: 0.6; }
    80% { transform: scale(1.5); opacity: 0; }
    100% { opacity: 0; }
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6000;
}
.modal-card {
    background: #0f1728;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    width: 340px;
    color: #e8ecf5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-header .title {
    font-weight: 800;
}
.modal-header .close {
    background: none;
    border: none;
    color: #e8ecf5;
    font-size: 16px;
    cursor: pointer;
}
.modal-body {
    padding: 12px 14px;
}
.modal-body .field {
    margin-bottom: 10px;
}
.modal-body label {
    display:block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #c8d2e4;
}
.modal-body input,
.modal-body select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #e8ecf5;
}
.modal-body .hint {
    font-size: 12px;
    color: #9fb0c9;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.modal-actions .primary {
    background: #2b7cff;
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.modal-actions .ghost {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #e8ecf5;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.confirm-overlay {
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.6);
    display:flex; align-items:center; justify-content:center;
    z-index: 6100;
}
.confirm-card {
    background:#0f1728;
    border:1px solid rgba(255,255,255,0.1);
    border-radius:10px;
    padding:16px;
    color:#e8ecf5;
    width:320px;
    box-shadow:0 10px 30px rgba(0,0,0,0.35);
}
.confirm-actions {
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:12px;
}
.confirm-actions button {
    padding:8px 12px;
    border:none;
    border-radius:6px;
    cursor:pointer;
}
.confirm-actions .primary { background:#2b7cff; color:#fff; }
.confirm-actions .ghost { background:rgba(255,255,255,0.08); color:#e8ecf5; }

/* Mobile tweaks */
@media (max-width: 768px) {
    .map-options {
        top: 132px;
    }
    #navbar .nav-items .nav-filters .checkbox-inline {
        display: block;
        font-size: 14px;
    }
    #navbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
        position: fixed;
    }
    .nav-toggle { display: block; }
    .nav-toggle {
        right: 14px;
        top: 5px;
        padding: 5px 8px;
        font-size: 16px;
    }
    #navbar .nav-items {
        width: 100%;
        display: none;
    }
    #navbar.open .nav-items {
        display: block;
        padding-top: 4px;
    }
    #navbar .nav-filters {
        flex-wrap: wrap;
        gap: 6px;
    }
    .filter-row {
        width: 100%;
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }
    .bottom-row {
        flex-wrap: nowrap;
    }
    .filter-row input,
    .filter-row select,
    .filter-row .checkbox-inline {
        flex: 1;
        min-width: 0;
    }
    .filter-row button {
        flex: 0 0 auto;
        width: auto;
    }
    .checkbox-inline {
        gap: 0;
        font-size: 10px;
    }
    #map {
        top: 64px;
        transition: filter 0.2s ease;
    }
    .map-wrapper {
        top: 4px;
    }
    #shipDetailPanel {
        left: 20px;
        right: 20px;
        top: 72px;
        width: calc(100% - 40px);
        padding: 14px 12px;
        border-radius: 16px;
        height: calc(100vh - 96px);
        bottom: 0;
        box-shadow: 0 0 35px rgba(0,0,0,0.35);
        overflow-y: auto;
        overflow-x: visible;
    }
    .id-row span {
        min-width: 100%;
    }
    #shipDetailPanel h2 {
        font-size: 18px;
    }
    .panel-section {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    .panel-section .section-title {
        font-size: 11px;
        margin-bottom: 4px;
    }
    .panel-section .kv {
        font-size: 11px;
        grid-template-columns: 1fr 1fr;
        gap: 3px;
    }
    body.panel-open #fleetCounts,
    body.panel-open #coordinates,
    body.panel-open .leaflet-control-container {
        display: none !important;
    }
body.panel-open #map {
        pointer-events: none;
        filter: blur(1px);
    }
}

#shipDetailPanel .panel-section,
#shipDetailPanel .panel-section .kv,
#shipDetailPanel .panel-section .kv span,
#shipDetailPanel .panel-section .kv strong {
    color: #ffffff;
}
#shipDetailPanel .panel-section .kv:first-child {
    margin-top: -8px;
}

#shipDetailPanel h2 {
    margin-top: 0;
    color: #7ad8ff;
}
.flag-placeholder {
    color: #8fa3c2;
    font-size: 12px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}
.id-photo-row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.panel-heading-text {
    flex: 1;
    min-width: 0;
}
.id-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #ffffff;
    justify-content: flex-start;
    text-align: left;
    padding-top: 20px;
    flex: 1;
}
.id-row span {
    text-align: left;
}
.vessel-photo {
    width: 140px;
    height: 110px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    color: #e8ecf5;
    font-size: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    align-self: flex-start;
    position: relative;
}
.vessel-photo a {
    color: #e8ecf5;
    text-decoration: underline;
    font-weight: 600;
}
.photo-placeholder {
    opacity: 0.8;
}
.photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.panel-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.panel-section .section-title {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 12px;
    font-weight: 700;
    color: #e8ecf5;
    margin-bottom: 6px;
    text-align: center;
}
.panel-section .kv {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 4px;
    font-size: 12px;
    color: #cfd7e6;
    padding: 2px 0;
}
.panel-section .kv span {
    color: #8fa3c2;
    text-align: left;
    word-break: break-word;
}
.panel-section .kv strong {
    color: #e8ecf5;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}
.sanctions-title {
    color: #ff6b6b;
    font-weight: 700;
}

#route_btn {
    background-color: #7ad8ff;
    color: #0b1220;
    border: none;
    padding: 8px 14px;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.15s ease;
    display: block;
    margin: 12px auto 0;
}

#route_btn:hover {
    background-color: #5fc9f5;
    transform: translateY(-1px);
}

#route_btn:active {
    background-color: #4eb6df;
    transform: translateY(0);
}

/* Leaflet popups and markers */
.leaflet-popup-content {
    font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1b2333;
    font-size: 14px;
}
.leaflet-popup-content b {
    color: #0b1220;
}
.leaflet-container .leaflet-popup-tip {
    background: #fff;
}
.leaflet-bottom.leaflet-left {
    left: 10px;
    bottom: 50px; /* reduced spacing from coords */
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex-direction: row; /* explicit ordering: zoom then scale */
}
.leaflet-left .leaflet-control-scale,
.leaflet-left .leaflet-control-zoom {
    margin-bottom: 0;
}

.leaflet-control-zoom {
    display: inline-flex;
    flex-direction: row;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    order: 1;
    z-index: 1000;
}
.leaflet-control-zoom a {
    border-radius: 4px;
    margin-right: 6px;
    background: rgba(11, 18, 32, 0.9);
    color: #e8ecf5;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.leaflet-control-zoom a:last-child { margin-right: 0; }
.leaflet-control-scale {
    text-align: left;
    background: rgba(11, 18, 32, 0.85);
    color: #e8ecf5;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 0;
    min-width: 88px;
    flex-shrink: 0;
    order: 2;
}
.leaflet-control-attribution {
    display: none !important; /* hide OpenStreetMap text per request */
}
.leaflet-control-scale-line {
    border: none !important;
}
.leaflet-left .leaflet-control {
    margin-left: 0 !important;
}
.leaflet-touch .leaflet-bar a {
    line-height: normal !important;
}

.ship-icon {
    background: transparent;
    border: none;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ship-arrow {
    display: inline-block;
    width: 18px;
    height: 34px;
    background: var(--ship-color, #7ad8ff);
    /* AISC-style: sharp bow, flat stern */
    clip-path: polygon(50% 0%, 86% 22%, 86% 70%, 86% 100%, 14% 100%, 14% 70%, 14% 22%);
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 0 0 2px 2px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    transform: rotate(var(--heading, 0deg));
    transform-origin: 50% 60%;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.35));
}
.ship-hull {
    display: inline-block;
    background: var(--ship-color, #7ad8ff);
    /* AISC-style hull: pointed bow, flat stern */
    clip-path: polygon(50% 0%, 84% 18%, 84% 78%, 84% 100%, 16% 100%, 16% 78%, 16% 18%);
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transform: rotate(var(--heading, 0deg));
    transform-origin: 50% 55%;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.35));
}
.ship-label {
    display: inline-block;
    padding: 2px 4px;
    background: rgba(11, 18, 32, 0.8);
    color: #e8ecf5;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
}
.ship-icon .locked { color: #a9b5cc; }
.ship-icon.type-cargo { --ship-color: #234f8a; }         /* navy */
.ship-icon.type-tanker { --ship-color: #000; }        /* black */
.ship-icon.type-passenger { --ship-color: #1f5d1f; }     /* dark green */
.ship-icon.type-fishing { --ship-color: #d4a300; }       /* gold */
.ship-icon.type-tug { --ship-color: #1a9f9f; }           /* teal */
.ship-icon.type-other { --ship-color: #6e5ca6; }         /* muted purple */
.ship-icon.type-ncg { --ship-color: #ff4bd8; }           /* bright magenta */
.ship-icon.type-unknown { --ship-color: #8892a0; }       /* gray */
.ship-icon.status-underway { --ship-color: #234f8a; }    /* navy */
.ship-icon.status-anchor { --ship-color: #d33c3c; }      /* softer red */
.ship-icon.status-moored { --ship-color: #1f5d1f; }      /* dark green */
.ship-icon.status-fishing { --ship-color: #c75b00; }     /* dark orange */
.ship-icon.fallback .ship-label {
    font-size: 10px;
    padding: 1px 3px;
}
.ship-icon.fallback .ship-arrow {
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.25);
}
.ship-icon.nolabel .ship-label {
    display: none;
}
.ship-dot {
    width: 8px;
    height: 8px;
    background: var(--ship-color);
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.3);
    display: inline-block;
}
.ship-icon.sanctioned .ship-arrow {
    background: #d33c3c;
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 6px rgba(211, 60, 60, 0.6);
    position: relative;
}
.ship-icon.sanctioned .ship-arrow::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(211, 60, 60, 0.4);
    animation: pulse 1.6s ease-out infinite;
}
.ship-icon.sanctioned .ship-hull {
    background: #d33c3c;
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 6px rgba(211, 60, 60, 0.6);
    position: relative;
}
.ship-icon.sanctioned .ship-hull::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(211, 60, 60, 0.4);
    animation: pulse 1.6s ease-out infinite;
}
.ship-icon.forced-sanction .ship-arrow {
    background: #d33c3c !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 0 10px rgba(211, 60, 60, 0.8);
    position: relative;
}
.ship-icon.forced-sanction .ship-hull {
    background: #d33c3c !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 0 10px rgba(211, 60, 60, 0.8);
    position: relative;
}
.ship-icon.forced-sanction .ship-hull::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid rgba(211, 60, 60, 0.45);
    animation: pulse 1.2s ease-out infinite;
}
.ship-icon.forced-sanction .ship-arrow::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid rgba(211, 60, 60, 0.45);
    animation: pulse 1.2s ease-out infinite;
}
.port-icon {
    color: #1b4bff;
    font-size: 14px;
    text-shadow: 0 0 4px rgba(0,0,0,0.5);
}
@keyframes pulse {
    0% { transform: scale(0.7); opacity: 0.8; }
    60% { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Leaflet controls */
.leaflet-control-attribution {
    pointer-events: none;
}
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
    background: rgba(0, 102, 204, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.marker-cluster div {
    background: rgba(0, 102, 204, 0.6);
    color: #fff;
}
