* { margin: 0; padding: 0; box-sizing: border-box; }
[x-cloak] { display: none !important; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
#map { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; }

/* Top bar */
.top-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 8px 10px; }
.top-row1 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.brand { color: white; font-weight: bold; font-size: 1em; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.top-controls { display: flex; align-items: center; gap: 6px; }
.lang-switch { display: flex; background: rgba(0,51,102,0.92); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.lang-btn { border: none; background: transparent; color: rgba(255,255,255,0.6); padding: 5px 9px; font-size: 0.72em; cursor: pointer; font-weight: 600; }
.lang-btn.active { background: white; color: #003366; }
.gps-btn { display: flex; align-items: center; gap: 5px; background: rgba(0,51,102,0.92); border: none; color: white; padding: 6px 12px; border-radius: 20px; font-size: 0.8em; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.25); white-space: nowrap; }
.top-row2 { display: flex; gap: 8px; }
.tab {
    flex: 1; min-height: 46px; border: none; border-radius: 12px;
    background: rgba(0,51,102,0.92); color: white; font-size: 0.95em; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.tab.active { background: #003366; box-shadow: 0 2px 12px rgba(0,0,0,0.4); }

/* Panels */
.panel {
    position: fixed; top: 108px; left: 10px; right: 10px; z-index: 999;
    background: white; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    max-height: 70vh; overflow-y: auto; padding: 16px;
}
.panel-title { font-weight: bold; color: #003366; margin-bottom: 10px; }
.panel-close { position: absolute; top: 10px; right: 12px; background: none; border: none; font-size: 1.3em; cursor: pointer; color: #888; }

/* Search input + clear button */
.search-wrap { position: relative; }
.search-input { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 10px; font-size: 0.95em; margin-bottom: 12px; outline: none; }
.search-input:focus { border-color: #003366; }
.search-clear {
    position: absolute; top: 9px; right: 10px; width: 24px; height: 24px;
    border: none; background: #eee; color: #666; border-radius: 50%;
    font-size: 0.75em; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.search-clear:active { background: #ddd; }

.result-card { border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.result-card:active { background: #f5f8fc; }
.result-name { font-weight: bold; color: #003366; font-size: 0.95em; }
.result-meta { font-size: 0.75em; color: #888; margin-top: 2px; }
.result-badge { font-size: 0.7em; padding: 2px 8px; border-radius: 10px; color: white; }
.b-active { background: #00aa55; } .b-stale { background: #999; }
.berth-row { display: flex; justify-content: space-between; align-items: center; }

/* Status bar */
#status-bar { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,30,0.75); color: white; padding: 4px 14px; border-radius: 20px; font-size: 0.75em; z-index: 500; }
.live { color: #00ff88; }

/* Animations */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(33,150,243,0.6); } 100% { box-shadow: 0 0 0 12px rgba(33,150,243,0); } }
@keyframes vesselPulse { 0% { transform: scale(1); } 50% { transform: scale(1.5); } 100% { transform: scale(1); } }
.vessel-pulse { animation: vesselPulse 1.2s ease-in-out infinite; transform-origin: center; }
@keyframes berthPulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } 100% { transform: scale(1); opacity: 1; } }
.berth-pulse { animation: berthPulse 1.3s ease-in-out infinite; transform-origin: center bottom; }

/* Popup */
.leaflet-popup-content { font-family: -apple-system, sans-serif; font-size: 13px; line-height: 1.5; min-width: 220px; }
.popup-name { font-weight: bold; font-size: 1.1em; color: #003366; }
.popup-eta { background: #f0f7ff; border-radius: 6px; padding: 6px 10px; margin-top: 6px; }
.popup-eta-val { font-size: 1.3em; font-weight: bold; color: #003366; }