        /* Carta Náutica - Adaptada para layout con sidebar */

        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            font-weight: bold;
            color: #003366;
            z-index: 10000;
        }

        #container {
            position: fixed;
            top: 0;
            left: 80px;
            right: 0;
            bottom: 0;
            width: calc(100vw - 80px);
            height: 100vh;
            background: #ddd;
        }

        /* Reglas estilo carta náutica profesional */
        .ruler {
            position: absolute;
            background: #fefefe;
            z-index: 1000;
        }

        #left-ruler {
            left: 0;
            top: 25px;
            bottom: 25px;
            width: 25px;
            border-right: 1px solid #000;
            border-top: 1px solid #000;
            border-bottom: 1px solid #000;
        }

        #right-ruler {
            right: 0;
            top: 25px;
            bottom: 25px;
            width: 25px;
            border-left: 1px solid #000;
            border-top: 1px solid #000;
            border-bottom: 1px solid #000;
        }

        #top-ruler {
            top: 0;
            left: 25px;
            right: 25px;
            height: 25px;
            border-bottom: 1px solid #000;
            border-left: 1px solid #000;
            border-right: 1px solid #000;
        }

        #bottom-ruler {
            bottom: 0;
            left: 25px;
            right: 25px;
            height: 25px;
            border-top: 1px solid #000;
            border-left: 1px solid #000;
            border-right: 1px solid #000;
        }

        /* Mapa */
        #map {
            position: absolute;
            top: 25px;
            left: 25px;
            right: 25px;
            bottom: 25px;
            z-index: 1;
            border: 1px solid #000;
        }

        /* Canvas de las reglas */
        .ruler-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        /* Esquinas */
        .corner-box {
            position: absolute;
            width: 25px;
            height: 25px;
            background: #fefefe;
            border: 1px solid #000;
            z-index: 1002;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 8px;
            font-weight: bold;
            color: #000;
        }

        #corner-tl { top: 0; left: 0; }
        #corner-tr { top: 0; right: 0; }
        #corner-bl { bottom: 0; left: 0; }
        #corner-br { bottom: 0; right: 0; }

        /* Cuadrícula */
        #grid-overlay {
            position: absolute;
            top: 25px;
            left: 25px;
            right: 25px;
            bottom: 25px;
            pointer-events: none;
            z-index: 500;
        }

        /* Líneas del cursor */
        #cursor-lines {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            z-index: 501;
        }

        .cursor-line-h {
            position: absolute;
            left: 0;
            right: 0;
            height: 1px;
            background: rgba(255, 0, 0, 0.4);
            display: none;
        }

        .cursor-line-v {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 1px;
            background: rgba(255, 0, 0, 0.4);
            display: none;
        }

        /* Coordenadas del cursor */
        #cursor-coords {
            position: absolute;
            background: rgba(255, 255, 255, 0.95);
            color: #c00;
            padding: 3px 6px;
            border-radius: 2px;
            font-size: 10px;
            font-weight: bold;
            pointer-events: none;
            z-index: 1002;
            display: none;
            border: 1px solid #c00;
            white-space: nowrap;
        }

        /* Display de coordenadas - OCULTO */
        #coordinates-display {
            display: none;
            position: absolute;
            top: 35px;
            left: 35px;
            background: rgba(255, 255, 255, 0.95);
            color: #000;
            padding: 6px 10px;
            border-radius: 2px;
            z-index: 1001;
            font-size: 11px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
            border: 1px solid #666;
        }

        #coordinates-display .coord-line {
            margin: 2px 0;
            display: flex;
            justify-content: space-between;
            gap: 10px;
        }

        #coordinates-display .label {
            font-weight: bold;
            color: #c00;
        }

        /* Controles */
        .zoom-controls {
            position: absolute;
            top: 35px;
            right: 35px;
            z-index: 1001;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .zoom-btn {
            width: 25px;
            height: 25px;
            background: rgba(255, 255, 255, 0.95);
            color: #000;
            border: 1px solid #666;
            border-radius: 2px;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .zoom-btn:hover {
            background: #333;
            color: white;
        }

        .layer-toggle {
            position: absolute;
            bottom: 35px;
            right: 35px;
            z-index: 1001;
            background: rgba(255, 255, 255, 0.95);
            padding: 6px 8px;
            border-radius: 2px;
            border: 1px solid #666;
        }

        .layer-toggle label {
            color: #000;
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            font-size: 11px;
        }

        #map-info {
            position: absolute;
            bottom: 35px;
            left: 35px;
            background: rgba(255, 255, 255, 0.95);
            color: #000;
            padding: 5px 8px;
            border-radius: 2px;
            z-index: 1001;
            font-size: 10px;
            border: 1px solid #666;
        }

        #loading {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #333;
            font-size: 18px;
            z-index: 9999;
        }

        /* Herramienta de Regla Náutica */
        #ruler-tool {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 400px;
            height: 50px;
            background: linear-gradient(to bottom, 
                rgba(255, 255, 200, 0.9) 0%, 
                rgba(255, 255, 200, 0.9) 10px,
                rgba(240, 240, 180, 0.8) 10px,
                rgba(240, 240, 180, 0.8) 100%);
            border: 2px solid #8B4513;
            border-radius: 3px;
            transform-origin: center center;
            transform: translate(-50%, -50%);
            z-index: 600;
            display: none;
            cursor: move;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        }

        #ruler-tool.active {
            display: block;
        }

        #ruler-tool.drawing {
            cursor: crosshair;
        }

        #ruler-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 80px;
            height: 30px;
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid #000;
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: bold;
            color: #c00;
            z-index: 1;
            pointer-events: none;
        }

        .ruler-edge {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 10px;
            cursor: crosshair;
            z-index: 2;
        }

        .ruler-marks {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 10px;
            overflow: hidden;
            pointer-events: none;
        }

        .ruler-mark {
            position: absolute;
            top: 0;
            width: 1px;
            background: #000;
            pointer-events: none;
        }

        .ruler-mark.major {
            height: 10px;
            width: 2px;
            background: #000;
        }

        .ruler-mark.minor {
            height: 5px;
            background: #666;
        }

        .ruler-mark-text {
            position: absolute;
            top: 12px;
            font-size: 8px;
            color: #000;
            transform: translateX(-50%);
            pointer-events: none;
        }

        .ruler-controls {
            position: absolute;
            top: 100px;
            left: 35px;
            background: rgba(255, 255, 255, 0.95);
            width: 280px;
            padding: 0;
            border-radius: 3px;
            border: 1px solid #666;
            z-index: 1001;
            cursor: default;
            user-select: none;
        }

        .ruler-controls-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4px 7px;
            background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
            color: white;
            cursor: move;
            border-radius: 2px 2px 0 0;
        }

        .ruler-controls-header span {
            font-size: 10px;
            font-weight: bold;
        }

        .ruler-controls-toggle {
            background: none;
            border: none;
            color: white;
            font-family: "Segoe UI", Arial, sans-serif;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            padding: 0 3px;
            line-height: 1;
        }

        .ruler-controls-toggle:hover {
            color: #ffd700;
        }

        .ruler-controls-body {
            padding: 6px;
            max-height: none;
            overflow-y: visible;
            transition: padding 0.3s ease;
        }

        .ruler-controls.collapsed .ruler-controls-body {
            max-height: 0;
            padding: 0 6px;
            overflow: hidden;
        }

        .ruler-controls h4 {
            margin: 6px 0 2px 0;
            font-size: 9px;
            line-height: 1.1;
            color: #333;
        }

        .ruler-btn {
            min-width: 0;
            width: 100%;
            height: 23px;
            background: #fff;
            border: 1px solid #666;
            border-radius: 2px;
            cursor: pointer;
            font-family: "Segoe UI", Arial, sans-serif;
            font-size: 10px;
            font-weight: 700;
            line-height: 1;
            padding: 0 3px;
            transition: all 0.2s;
        }

        .ruler-btn:hover {
            background: #333;
            color: white;
        }

        .ruler-btn.active {
            background: #c00;
            color: white;
        }

        .ruler-buttons {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1px;
        }

        .ruler-btn-wide {
            grid-column: 1 / -1;
        }

        .ruler-instructions {
            font-size: 8px;
            color: #666;
            margin-top: 4px;
            line-height: 1.2;
        }

        /* Búsqueda de puntos */
        .search-container {
            display: flex;
            gap: 3px;
            margin-bottom: 6px;
        }

        .search-input {
            flex: 1;
            min-width: 0;
            padding: 4px 6px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 10px;
        }

        .search-btn {
            min-width: 28px;
            padding: 4px 6px;
            background: #0066cc;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-family: "Segoe UI", Arial, sans-serif;
            font-size: 12px;
            font-weight: 700;
            line-height: 1;
        }

        .search-btn:hover {
            background: #0052a3;
        }

        /* Modal de resultados de búsqueda */
        .search-results-modal {
            display: none;
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 400px;
            max-height: 500px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            z-index: 2000;
            overflow: hidden;
        }

        .search-results-modal.active {
            display: block;
        }

        .search-modal-header {
            background: #0066cc;
            color: white;
            padding: 12px 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: move;
            user-select: none;
        }

        .search-modal-close {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .search-modal-close:hover {
            background: rgba(255,255,255,0.2);
            border-radius: 4px;
        }

        .search-results-content {
            max-height: 450px;
            overflow-y: auto;
            padding: 10px;
        }

        .search-result-item {
            padding: 10px;
            margin-bottom: 8px;
            background: #f5f5f5;
            border-radius: 5px;
            cursor: pointer;
            border-left: 4px solid #0066cc;
            transition: all 0.2s;
        }

        .search-result-item:hover {
            background: #e8f4ff;
            transform: translateX(5px);
        }

        .search-result-name {
            font-weight: bold;
            color: #000;
            font-size: 13px;
        }

        .search-result-type {
            color: #666;
            font-size: 11px;
            margin-top: 4px;
        }

        .search-result-coords {
            color: #888;
            font-size: 10px;
            font-family: monospace;
            margin-top: 2px;
        }

        .search-result-desc {
            color: #555;
            font-size: 10px;
            margin-top: 4px;
            font-style: italic;
        }

        /* Líneas dibujadas */
        .drawn-line {
            position: absolute;
            background: #c00;
            height: 2px;
            transform-origin: 0 0;
            z-index: 650;
            pointer-events: auto;
            cursor: pointer;
        }

        .drawn-line.selected {
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.8);
        }

        .protractor-line.selected {
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.8);
        }

        .tangent-line.selected {
            box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.8);
        }

        .line-label {
            position: absolute;
            top: -15px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.9);
            padding: 2px 4px;
            border-radius: 2px;
            font-size: 9px;
            font-weight: bold;
            color: #000;
            border: 1px solid #c00;
            white-space: nowrap;
            pointer-events: none;
        }

        .line-delete {
            position: absolute;
            width: 15px;
            height: 15px;
            background: #c00;
            color: white;
            border: 1px solid #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 10px;
            font-weight: bold;
            line-height: 1;
            pointer-events: auto;
            transform: translateY(-50%);
        }

        .line-delete:hover {
            background: #f00;
            transform: translateY(-50%) scale(1.2);
        }

        /* Marca central de la línea */
        .line-center {
            position: absolute;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #ffd800;
            border: 2px solid #c00;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            cursor: pointer;
            pointer-events: auto;
            box-shadow: 0 0 3px rgba(0,0,0,0.4);
        }

        /* Etiquetas de extremos de línea - siempre horizontales */
        .line-endpoint-label {
            position: absolute;
            top: -18px;
            background: rgba(0, 80, 160, 0.9);
            padding: 2px 5px;
            border-radius: 3px;
            font-size: 8px;
            color: #fff;
            white-space: nowrap;
            pointer-events: none;
            border: 1px solid #004080;
        }

        .line-start-label {
            left: 0;
        }

        .line-end-label {
            left: 100%;
        }

        /* Lápiz (barra perpendicular con cono amarillo) */
        .pencil {
            position: absolute;
            width: 10px;
            /* CORRECCIÓN: Altura total (cuerpo + punta) */
            height: 48px;
            background: #444;
            border-radius: 5px;
            border: 1px solid #111;
            box-shadow: 0 0 3px rgba(0,0,0,0.6);
            /* El origen de la transformación es la punta final */
            transform-origin: 50% 100%;
            z-index: 660;
            pointer-events: none;
        }

        .pencil::after {
            content: '';
            position: absolute;
            /* CORRECCIÓN: La punta se posiciona al final del contenedor */
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 7px solid transparent;
            border-right: 7px solid transparent;
            border-top: 8px solid #ffd800;
            filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
        }

        /* Transportador Náutico */
        #protractor-tool {
            position: absolute;
            width: 300px;
            height: 300px;
            background: rgba(200, 200, 200, 0.5);
            border: 3px solid rgba(100, 100, 100, 0.8);
            border-radius: 8px;
            z-index: 700;
            display: none;
            cursor: move;
            box-shadow: 0 4px 15px rgba(0,0,0,0.4);
            transform-origin: center center;
            /* Centrar el div en las coordenadas left/top */
            margin-left: -150px;
            margin-top: -150px;
        }

        #protractor-tool.active {
            display: block;
        }

        .protractor-center-marker {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 8px;
            height: 8px;
            background: #000;
            border-radius: 50%;
            border: 2px solid #fff;
            z-index: 5;
            pointer-events: none;
        }

        .protractor-cardinal {
            position: absolute;
            font-size: 18px;
            font-weight: bold;
            color: #000;
            text-shadow: 0 0 3px rgba(255,255,255,0.8);
            pointer-events: none;
            z-index: 4;
        }

        .protractor-cardinal.north { top: 5px; left: 50%; transform: translateX(-50%); }
        .protractor-cardinal.south { bottom: 5px; left: 50%; transform: translateX(-50%); }
        .protractor-cardinal.east { right: 5px; top: 50%; transform: translateY(-50%); }
        .protractor-cardinal.west { left: 5px; top: 50%; transform: translateY(-50%); }

        .protractor-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 2;
        }

        .protractor-draw-button {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 35px;
            height: 35px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #0066cc;
            border-radius: 50%;
            color: #0066cc;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            z-index: 6;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }

        .protractor-draw-button:hover {
            background: #0066cc;
            color: white;
            transform: scale(1.1);
        }

        .protractor-draw-button.active {
            background: #0066cc;
            color: white;
            box-shadow: 0 0 15px #0066cc;
            animation: pulse 1.5s ease-in-out infinite;
        }

        .protractor-angle-button {
            position: absolute;
            bottom: 10px;
            right: 10px;
            width: 35px;
            height: 35px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #ff9900;
            border-radius: 50%;
            color: #cc6600;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            z-index: 6;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }

        .protractor-angle-button:hover,
        .protractor-angle-button.active {
            background: #ff9900;
            color: white;
            box-shadow: 0 0 12px rgba(255,153,0,0.6);
            transform: scale(1.05);
        }

        .protractor-position-button {
            position: absolute;
            bottom: 10px;
            left: 10px;
            width: 35px;
            height: 35px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #0066cc;
            border-radius: 50%;
            color: #0066cc;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            z-index: 6;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }

        .protractor-position-button:hover,
        .protractor-position-button.active {
            background: #0066cc;
            color: white;
            box-shadow: 0 0 12px rgba(0,102,204,0.6);
            transform: scale(1.05);
        }

        /* Mensaje flotante centrado arriba */
        .action-message {
            position: fixed;
            top: 15px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 51, 102, 0.9);
            color: white;
            padding: 10px 18px;
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            z-index: 5000;
            font-weight: bold;
            font-size: 13px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .action-message.show {
            opacity: 1;
        }

        /* Modal de ángulo */
        .angle-modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 6000;
        }

        .angle-modal-content {
            background: white;
            border-radius: 8px;
            width: 450px;
            max-width: 95vw;
            box-shadow: 0 6px 20px rgba(0,0,0,0.4);
            overflow: hidden;
            border: 2px solid #003366;
        }

        .angle-modal-header {
            background: #003366;
            color: white;
            padding: 10px 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: bold;
        }

        .angle-modal-close {
            background: none;
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
        }

        .angle-modal-body {
            padding: 12px 14px;
            display: grid;
            gap: 8px;
        }

        .angle-input-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }

        .angle-input-row label {
            flex: 1;
            font-size: 13px;
            color: #003366;
        }

        .angle-input-row input {
            flex: 1;
            padding: 6px 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 13px;
        }

        .angle-modal-footer {
            padding: 12px 14px;
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            background: #f5f5f5;
        }

        .angle-btn {
            padding: 8px 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            background: white;
            cursor: pointer;
            font-weight: bold;
            color: #003366;
        }

        .angle-btn.primary {
            background: #0066cc;
            border-color: #0066cc;
            color: white;
        }

        /* Overlay de ayuda */
        .help-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 6000;
        }

        .help-content {
            width: 80%;
            max-width: 900px;
            max-height: 80vh;
            background: white;
            border-radius: 10px;
            border: 3px solid #003366;
            box-shadow: 0 8px 30px rgba(0,0,0,0.4);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .help-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #003366;
            color: white;
        }

        .help-header h2 {
            margin: 0;
            font-size: 18px;
        }

        .help-close {
            background: none;
            border: none;
            color: white;
            font-size: 22px;
            cursor: pointer;
        }

        .help-body {
            padding: 16px;
            overflow-y: auto;
            display: grid;
            gap: 16px;
        }

        .help-body p {
            margin: 0 0 8px 0;
            color: #333;
        }

        .help-tool {
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 12px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        }

        .help-tool-title {
            font-weight: bold;
            color: #003366;
            margin-bottom: 8px;
        }

        .help-tool-body {
            display: grid;
            grid-template-columns: 160px 1fr;
            gap: 12px;
            align-items: center;
        }

        .help-tool-body img {
            width: 100%;
            max-width: 160px;
            border-radius: 6px;
            border: 1px solid #ccc;
        }

        .help-tool-text {
            font-size: 13px;
            color: #333;
            line-height: 1.4;
        }

        /* Botón flotante de ayuda en la carta */
        .help-toggle-btn {
            position: absolute;
            bottom: 80px;
            right: 20px;
            background: #28a745;
            color: white;
            border: none;
            padding: 12px 16px;
            border-radius: 6px;
            font-weight: bold;
            font-size: 13px;
            cursor: pointer;
            box-shadow: 0 3px 10px rgba(0,0,0,0.3);
            z-index: 1200;
            transition: all 0.2s;
        }

        .help-toggle-btn:hover {
            background: #218838;
            transform: scale(1.03);
        }

        @media (max-width: 700px) {
            .help-tool-body {
                grid-template-columns: 1fr;
            }
        }

        .protractor-hide-button {
            position: absolute;
            top: 10px;
            left: 10px;
            width: 30px;
            height: 30px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #666;
            border-radius: 50%;
            color: #666;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            z-index: 6;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }

        .protractor-hide-button:hover {
            background: #f00;
            color: white;
            border-color: #f00;
            transform: scale(1.1);
        }

        .ruler-hide-button {
            position: absolute;
            top: 50%;
            right: 5px;
            transform: translateY(-50%);
            width: 20px;
            height: 20px;
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid #666;
            border-radius: 50%;
            color: #666;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
            z-index: 3;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }

        .ruler-hide-button:hover {
            background: #f00;
            color: white;
            border-color: #f00;
            transform: translateY(-50%) scale(1.2);
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .protractor-line {
            position: absolute;
            background: transparent;
            height: 1px;
            transform-origin: 0 0;
            z-index: 680;
            pointer-events: none;
            border-top: 1px dashed #0066cc;
        }

        .protractor-line-label {
            position: absolute;
            top: -20px;
            left: 50%;
            background: rgba(255, 255, 255, 0.95);
            padding: 3px 6px;
            border-radius: 3px;
            font-size: 9px;
            font-weight: bold;
            color: #000;
            border: 1px solid #0066cc;
            white-space: nowrap;
            pointer-events: none;
            display: none;
            transform-origin: center;
        }

        .protractor-line-delete {
            position: absolute;
            width: 16px;
            height: 16px;
            background: #0066cc;
            color: white;
            border: 2px solid #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 11px;
            font-weight: bold;
            pointer-events: auto;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .protractor-line-delete:hover {
            background: #f00;
            transform: scale(1.2);
        }

        .protractor-line-center {
            position: absolute;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #ffd800;
            border: 2px solid #0066cc;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            cursor: pointer;
            pointer-events: auto;
            box-shadow: 0 0 4px rgba(0,0,0,0.4);
        }

        .protractor-line-center:hover {
            transform: translate(-50%, -50%) scale(1.2);
        }

        /* Marcas de Posición */
        .position-marker {
            position: absolute;
            transform: translate(-50%, -50%);
            z-index: 690;
            cursor: pointer;
            pointer-events: auto;
        }

        .position-marker-outer {
            width: 20px;
            height: 20px;
            background: rgba(0, 51, 102, 0.7);
            border: 2px solid rgba(0, 51, 102, 1);
            border-radius: 50%;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .position-marker-inner {
            width: 10px;
            height: 10px;
            background: rgba(102, 178, 255, 0.9);
            border: 1px solid rgba(0, 102, 204, 1);
            border-radius: 50%;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .position-marker:hover .position-marker-outer {
            transform: translate(-50%, -50%) scale(1.2);
        }

        .position-marker-info {
            position: absolute;
            top: 25px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 6px 10px;
            border-radius: 4px;
            border: 2px solid rgba(0, 51, 102, 1);
            font-size: 10px;
            white-space: nowrap;
            display: none;
            z-index: 691;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }

        .position-marker-info.active {
            display: block;
        }

        .position-marker-info div {
            margin: 2px 0;
            color: #000;
        }

        .position-marker-info .label {
            font-weight: bold;
            color: #003366;
        }

        /* Rosa de los Vientos (Compass Rose) */
        #compass-rose {
            position: absolute;
            top: 25px;
            left: 50%;
            width: 120px;
            height: 120px;
            transform: translateX(-50%);
            z-index: 500;
            pointer-events: none;
        }

        #compass-rose svg {
            width: 100%;
            height: 100%;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
        }

        /* Ventana Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
        }

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

        .modal-content {
            background: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            max-width: 400px;
            width: 90%;
        }

        .modal-header {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            color: #003366;
            border-bottom: 2px solid #003366;
            padding-bottom: 10px;
        }

        .modal-body {
            margin-bottom: 15px;
        }

        .modal-field {
            margin-bottom: 12px;
        }

        .modal-field label {
            display: block;
            font-weight: bold;
            margin-bottom: 5px;
            color: #333;
            font-size: 12px;
        }

        .modal-field input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 14px;
            box-sizing: border-box;
        }

        .modal-field input:focus {
            outline: none;
            border-color: #0066cc;
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .modal-btn {
            padding: 8px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            transition: all 0.2s;
        }

        .modal-btn-primary {
            background: #0066cc;
            color: white;
        }

        .modal-btn-primary:hover {
            background: #0052a3;
        }

        .modal-btn-secondary {
            background: #ccc;
            color: #333;
        }

        .modal-btn-secondary:hover {
            background: #999;
        }

        .modal-btn-small {
            padding: 4px 8px;
            font-size: 11px;
            background: #0066cc;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            margin-left: 8px;
            font-weight: bold;
        }

        .modal-btn-small:hover {
            background: #0052a3;
        }

        .modal-field select {
            flex: 1;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 13px;
        }

        /* Ventana de Gestión de Rutas */
        #routes-panel {
            position: absolute;
            top: 120px;
            left: 50%;
            transform: translate(-50%, 0);
            width: 450px;
            max-height: 600px;
            background: white;
            border: 3px solid #003366;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 2001;
            display: none;
        }

        #routes-panel.active {
            display: block;
        }

        #routes-panel.collapsed {
            max-height: none;
        }

        #routes-panel.collapsed .routes-body {
            display: none;
        }

        .routes-header {
            background: #003366;
            color: white;
            padding: 12px 15px;
            font-weight: bold;
            font-size: 16px;
            border-radius: 5px 5px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: move;
            user-select: none;
        }

        .routes-header button {
            background: none;
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-left: 6px;
        }

        .routes-header button:hover {
            background: rgba(255,255,255,0.2);
            border-radius: 3px;
        }

        .routes-collapse {
            border: 1px solid rgba(255,255,255,0.4);
            border-radius: 4px;
            font-size: 18px;
        }

        .routes-body {
            padding: 15px;
            max-height: 450px;
            overflow-y: auto;
        }

        .route-item {
            background: #f5f5f5;
            border: 2px solid #ccc;
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .route-item:hover {
            background: #e8f4ff;
            border-color: #0066cc;
        }

        .route-info {
            flex: 1;
        }

        .route-name {
            font-weight: bold;
            color: #003366;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .route-details {
            font-size: 11px;
            color: #666;
        }

        .route-actions {
            display: flex;
            gap: 6px;
        }

        .route-btn {
            padding: 6px 10px;
            font-size: 11px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: transparent;
        }

        .route-btn-show {
            background: #0066cc;
            color: white;
        }

        .route-btn-show:hover {
            background: #0052a3;
        }

        .route-btn-delete {
            background: #cc0000;
            color: white;
        }

        .route-btn-delete:hover {
            background: #a00000;
        }

        .route-btn-play {
            background: #00aa00;
            color: white;
        }

        .route-btn-play:hover {
            background: #008800;
        }

        .route-btn-stop {
            background: #ff6600;
            color: white;
        }

        .route-btn img {
            width: 22px;
            height: 22px;
            display: block;
            pointer-events: none;
        }

        .route-btn-stop:hover {
            background: #cc5200;
        }

        .routes-empty {
            text-align: center;
            color: #999;
            padding: 40px 20px;
            font-style: italic;
        }

        /* Botón para abrir panel de rutas */
        .routes-toggle-btn {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: #003366;
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 6px;
            font-weight: bold;
            font-size: 13px;
            cursor: pointer;
            box-shadow: 0 3px 10px rgba(0,0,0,0.3);
            z-index: 1001;
            transition: all 0.2s;
        }

        .routes-toggle-btn:hover {
            background: #0066cc;
            transform: scale(1.05);
        }

        /* Reloj de Simulación */
        #simulation-clock {
            position: absolute;
            top: 25px;
            right: 170px;
            background: rgba(255, 255, 255, 0.95);
            padding: 8px 12px;
            border-radius: 6px;
            border: 2px solid #003366;
            font-size: 13px;
            font-weight: bold;
            color: #003366;
            z-index: 500;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            display: none;
        }

        #simulation-clock.active {
            display: block;
        }

        .clock-time {
            font-size: 16px;
            color: #0066cc;
            margin-bottom: 4px;
        }

        .clock-controls {
            display: flex;
            gap: 6px;
            align-items: center;
            margin-top: 6px;
        }

        .clock-controls label {
            font-size: 10px;
            color: #666;
        }

        .clock-controls select {
            padding: 3px 6px;
            font-size: 11px;
            border: 1px solid #ccc;
            border-radius: 3px;
        }

        /* ============================================
           COMPÁS NÁUTICO - Herramienta de medición
           ============================================ */

        #compass-tool {
            position: absolute;
            width: 400px;
            height: 400px;
            z-index: 750;
            display: none;
            pointer-events: none;
        }

        #compass-tool.active {
            display: block;
        }

        #compass-tool.arc-preview {
            opacity: 0.9;
        }

        /* Contenedor del compás */
        .compass-container {
            position: relative;
            width: 100%;
            height: 100%;
            pointer-events: auto;
        }

        /* Pivote central del compás - punto de arrastre */
        .compass-pivot {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 20px;
            height: 20px;
            background: radial-gradient(circle at 30% 30%, #d0d0d0, #606060);
            border-radius: 50%;
            border: 2px solid #404040;
            box-shadow:
                0 2px 4px rgba(0,0,0,0.5),
                inset 0 -2px 4px rgba(0,0,0,0.3),
                inset 0 2px 4px rgba(255,255,255,0.4);
            z-index: 10;
            cursor: move;
            pointer-events: auto;
        }

        /* Tornillo central */
        .compass-pivot::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 8px;
            height: 8px;
            background: radial-gradient(circle at 40% 40%, #999, #333);
            border-radius: 50%;
            border: 1px solid #222;
        }

        /* Ranura del tornillo */
        .compass-pivot::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 5px;
            height: 1px;
            background: #222;
        }

        /* Brazo del compás - más largo y delgado */
        .compass-arm {
            position: absolute;
            top: 50%;
            left: 50%;
            transform-origin: 0 50%;
            width: 180px;
            height: 8px;
            background: linear-gradient(180deg,
                #e0e0e0 0%,
                #a8a8a8 25%,
                #d0d0d0 50%,
                #909090 75%,
                #c0c0c0 100%);
            border: 1px solid #505050;
            border-radius: 3px;
            box-shadow:
                0 2px 4px rgba(0,0,0,0.35),
                inset 0 1px 2px rgba(255,255,255,0.5);
            z-index: 5;
        }

        /* Punta metálica muy fina del brazo */
        .compass-tip {
            position: absolute;
            right: -25px;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border-left: 28px solid #404040;
            border-top: 3px solid transparent;
            border-bottom: 3px solid transparent;
            filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
        }

        /* Anillo decorativo dorado cerca del pivote */
        .compass-arm::before {
            content: '';
            position: absolute;
            left: 5px;
            top: -2px;
            bottom: -2px;
            width: 10px;
            background: linear-gradient(180deg, #c8a000, #ffd700, #c8a000);
            border: 1px solid #a08000;
            border-radius: 2px;
        }

        /* Segundo anillo cerca de la punta */
        .compass-arm::after {
            content: '';
            position: absolute;
            right: 10px;
            top: -1px;
            bottom: -1px;
            width: 8px;
            background: linear-gradient(180deg, #c8a000, #ffd700, #c8a000);
            border: 1px solid #a08000;
            border-radius: 1px;
        }

        /* Indicador de apertura/distancia - en el centro superior */
        .compass-display {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 51, 102, 0.9);
            color: white;
            padding: 4px 12px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: bold;
            white-space: nowrap;
            font-family: 'Courier New', monospace;
            pointer-events: none;
        }

        /* Botón en la punta del brazo izquierdo - Cerrar */
        .compass-btn-close {
            position: absolute;
            right: -50px;
            top: 50%;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: linear-gradient(180deg, #ff6666, #cc0000);
            border: 2px solid #990000;
            color: white;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.4);
            z-index: 15;
            pointer-events: auto;
        }

        /* Botón de medir - flotante sobre el pivote */
        .compass-btn-measure {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, 30px);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(180deg, #66cc66, #228822);
            border: 3px solid #006600;
            color: white;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 8px rgba(0,0,0,0.5);
            z-index: 15;
            pointer-events: auto;
        }

        .compass-btn-measure:hover {
            background: linear-gradient(180deg, #88ee88, #44aa44);
            transform: translate(-50%, 30px) scale(1.1);
        }

        /* Ocultar estilos antiguos */
        .compass-btn-close {
            display: none;
        }

        /* Animación de medición */
        #compass-tool.measuring {
            transition: left 0.8s ease-in-out, top 0.8s ease-in-out, transform 0.8s ease-in-out;
        }

        /* Resultado de medición */
        .compass-result {
            position: absolute;
            top: 50%;
            left: 180px;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #003366;
            border-radius: 8px;
            padding: 12px 18px;
            font-size: 16px;
            font-weight: bold;
            color: #003366;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 800;
            display: none;
            text-align: center;
        }

        .compass-result.active {
            display: block;
        }

        .compass-result-value {
            font-size: 24px;
            color: #0066cc;
            font-family: 'Courier New', monospace;
        }

        .compass-result-label {
            font-size: 11px;
            color: #666;
            margin-top: 4px;
        }

        .compass-result.active {
            display: block;
        }

        .compass-result-value {
            font-size: 20px;
            color: #cc0000;
            margin-bottom: 4px;
        }

        .compass-result-label {
            font-size: 11px;
            color: #666;
        }

        /* Marcadores de puntos del compás */
        .compass-point-marker {
            position: absolute;
            width: 24px;
            height: 24px;
            background: #cc0000;
            color: white;
            border: 2px solid white;
            border-radius: 50%;
            font-size: 12px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            transform: translate(-50%, -50%);
            z-index: 800;
            box-shadow: 0 2px 6px rgba(0,0,0,0.4);
            pointer-events: none;
        }

        /* Línea de distancia del compás */
        .compass-distance-line {
            background: #0066cc !important;
            height: 3px !important;
        }

        .compass-distance-line .line-label {
            background: rgba(0, 102, 204, 0.95);
            color: white;
            border-color: #004488;
        }

        /* ===== ARCOS NÁUTICOS ===== */
        .nautical-arc {
            position: absolute;
            pointer-events: none;
        }

        .nautical-arc svg {
            position: absolute;
            pointer-events: none;
        }

        .nautical-arc circle {
            fill: none;
            stroke: #0066cc;
            stroke-width: 2;
            stroke-dasharray: 5, 5;
            opacity: 0.8;
            pointer-events: none;
        }

        .nautical-arc-center {
            position: absolute;
            width: 8px;
            height: 8px;
            background: #0066cc;
            border: 2px solid white;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 4px rgba(0,0,0,0.3);
        }

        .nautical-arc-label {
            position: absolute;
            background: rgba(0, 102, 204, 0.95);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
            white-space: nowrap;
            transform: translate(-50%, -50%);
            pointer-events: none;
            border: 1px solid #004488;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .nautical-arc-delete {
            position: absolute;
            width: 20px;
            height: 20px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #cc0000;
            border-radius: 50%;
            color: #cc0000;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transform: translate(-50%, -50%);
            transition: all 0.2s;
            pointer-events: auto;
        }

        .nautical-arc-delete:hover {
            background: #cc0000;
            color: white;
            transform: translate(-50%, -50%) scale(1.2);
        }

        /* ===== LÍNEAS TANGENTES ===== */
        .tangent-line {
            position: absolute;
            height: 1px;
            background: #0066cc;
            transform-origin: 0 0;
            pointer-events: all;
        }

        .tangent-line-delete {
            position: absolute;
            width: 18px;
            height: 18px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #cc0000;
            border-radius: 50%;
            color: #cc0000;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transform: translateY(-50%);
            transition: all 0.2s;
            pointer-events: auto;
        }

        .tangent-line-delete:hover {
            background: #cc0000;
            color: white;
            transform: translateY(-50%) scale(1.2);
        }

        .tangent-line-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 3px 8px;
            border-radius: 3px;
            font-size: 11px;
            font-weight: bold;
            color: #003366;
            white-space: nowrap;
            margin-top: 8px;
            border: 1px solid #0066cc;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            pointer-events: none;
        }

        .tangent-line-center {
            position: absolute;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #ffd800;
            border: 2px solid #0066cc;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            cursor: pointer;
            pointer-events: auto;
            box-shadow: 0 0 4px rgba(0,0,0,0.4);
        }

        .tangent-line-center:hover {
            transform: translate(-50%, -50%) scale(1.2);
        }

        /* Control de entrada de coordenadas */
        #coord-input-control {
            position: absolute;
            bottom: 80px;
            right: 30px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid #003366;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            z-index: 950;
            min-width: 320px;
            font-family: Arial, sans-serif;
        }

        .coord-input-header {
            background: linear-gradient(135deg, #003366, #005599);
            color: white;
            padding: 10px 15px;
            border-radius: 6px 6px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: bold;
            font-size: 14px;
        }

        .coord-input-toggle {
            background: none;
            border: none;
            color: white;
            font-size: 20px;
            font-weight: bold;
            cursor: pointer;
            padding: 0;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 3px;
            transition: background 0.2s;
        }

        .coord-input-toggle:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .coord-input-body {
            padding: 15px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .coord-input-body.collapsed {
            display: none;
        }

        .coord-input-section {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .coord-input-section label {
            font-size: 12px;
            font-weight: bold;
            color: #003366;
        }

        .coord-input-row {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .coord-input-row input[type="number"] {
            width: 60px;
            padding: 6px;
            border: 1px solid #003366;
            border-radius: 4px;
            font-size: 13px;
            text-align: center;
        }

        .coord-input-row input[type="number"]:focus {
            outline: none;
            border-color: #0066cc;
            box-shadow: 0 0 4px rgba(0, 102, 204, 0.3);
        }

        .coord-input-row span {
            font-size: 13px;
            color: #003366;
            font-weight: bold;
        }

        .coord-input-row select {
            padding: 6px;
            border: 1px solid #003366;
            border-radius: 4px;
            font-size: 13px;
            font-weight: bold;
            background: white;
            cursor: pointer;
        }

        .coord-input-btn {
            background: linear-gradient(135deg, #006600, #00aa00);
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 5px;
            font-weight: bold;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .coord-input-btn:hover {
            background: linear-gradient(135deg, #008800, #00cc00);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        }

        .coord-input-btn:active {
            transform: translateY(0);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        /* Estilos adicionales para el reloj de simulación con datos */
        .clock-data {
            display: flex;
            gap: 15px;
            padding: 8px 15px;
            background: rgba(0, 51, 102, 0.05);
            border-radius: 4px;
            margin: 8px 0;
        }

        .clock-data-item {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .clock-data-item label {
            font-size: 10px;
            color: #666;
            font-weight: bold;
        }

        .clock-data-item span {
            font-size: 14px;
            color: #003366;
            font-weight: bold;
        }

        /* Herramientas Meteorológicas */

        /* Indicador de Viento */
        .wind-indicator {
            position: absolute;
            width: 80px;
            height: 80px;
            cursor: pointer;
            z-index: 687;
        }

        .wind-arrow {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 4px;
            height: 50px;
            background: linear-gradient(to bottom, #0066cc 0%, #003d7a 100%);
            transform-origin: bottom center;
            transform: translate(-50%, -100%);
            border-radius: 2px;
        }

        .wind-arrow::before {
            content: '';
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 15px solid #0066cc;
        }

        .wind-arrow::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 10px;
            height: 10px;
            background: #003d7a;
            border-radius: 50%;
            border: 2px solid white;
        }

        .wind-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 16px;
            height: 16px;
            background: white;
            border: 3px solid #0066cc;
            border-radius: 50%;
            z-index: 2;
            cursor: pointer;
            pointer-events: auto;
        }

        .wind-center:hover {
            background: #e6f2ff;
            transform: translate(-50%, -50%) scale(1.2);
        }

        .wind-label {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: bold;
            color: #003366;
            white-space: nowrap;
            margin-top: 5px;
            border: 1px solid #0066cc;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            transition: opacity 0.3s, visibility 0.3s;
        }

        .wind-label.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .wind-speed {
            font-size: 12px;
            color: #0066cc;
        }

        .wind-delete {
            position: absolute;
            top: -8px;
            right: -8px;
            width: 20px;
            height: 20px;
            background: #cc0000;
            color: white;
            border: 2px solid white;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
            z-index: 3;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .wind-indicator:hover .wind-delete {
            display: flex;
        }

        .wind-rotate-handle {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 24px;
            height: 24px;
            background: rgba(0, 102, 204, 0.8);
            border: 2px solid white;
            border-radius: 50%;
            cursor: grab;
            display: none;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 10px;
            font-weight: bold;
            z-index: 3;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .wind-rotate-handle:active {
            cursor: grabbing;
        }

        .wind-indicator:hover .wind-rotate-handle {
            display: flex;
        }

        /* Indicador de Corriente */
        .current-indicator {
            position: absolute;
            width: 100px;
            height: 60px;
            cursor: pointer;
            z-index: 688;
        }

        .current-arrow-container {
            pointer-events: none;
        }

        .current-arrow {
            position: absolute;
            top: 50%;
            left: 10px;
            right: 10px;
            height: 6px;
            background: linear-gradient(to right, rgba(0, 153, 153, 0.7) 0%, #009999 100%);
            transform: translateY(-50%);
            border-radius: 3px;
        }

        .current-arrow::before {
            content: '';
            position: absolute;
            right: -12px;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border-left: 16px solid #009999;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
        }

        .current-arrow::after {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 12px;
            height: 12px;
            background: #006666;
            border-radius: 50%;
            border: 2px solid white;
            cursor: pointer;
            pointer-events: auto;
        }

        .current-arrow::after:hover {
            background: #009999;
            transform: translateY(-50%) scale(1.3);
        }

        .current-waves {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            opacity: 0.5;
        }

        .current-wave {
            position: absolute;
            top: 50%;
            height: 2px;
            background: #00cccc;
            transform: translateY(-50%);
            border-radius: 1px;
        }

        .current-wave:nth-child(1) {
            left: 20%;
            width: 15%;
            animation: wave 2s ease-in-out infinite;
        }

        .current-wave:nth-child(2) {
            left: 40%;
            width: 12%;
            animation: wave 2s ease-in-out infinite 0.3s;
        }

        .current-wave:nth-child(3) {
            left: 60%;
            width: 10%;
            animation: wave 2s ease-in-out infinite 0.6s;
        }

        @keyframes wave {
            0%, 100% {
                transform: translateY(-50%) scaleX(1);
                opacity: 0.5;
            }
            50% {
                transform: translateY(-50%) scaleX(1.2);
                opacity: 0.8;
            }
        }

        .current-label {
            position: absolute;
            top: 100%;
            left: 50%;
            background: rgba(255, 255, 255, 0.95);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: bold;
            color: #006666;
            white-space: nowrap;
            margin-top: 5px;
            border: 1px solid #009999;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            transition: opacity 0.3s, visibility 0.3s;
        }

        .current-label.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .current-speed {
            font-size: 12px;
            color: #009999;
        }

        .current-time {
            font-size: 10px;
            color: #666;
            font-style: italic;
        }

        .current-delete {
            position: absolute;
            top: -8px;
            right: -8px;
            width: 20px;
            height: 20px;
            background: #cc0000;
            color: white;
            border: 2px solid white;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
            z-index: 3;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .current-indicator:hover .current-delete {
            display: flex;
        }

        .current-rotate-handle {
            position: absolute;
            top: 50%;
            right: -12px;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            background: rgba(0, 153, 153, 0.8);
            border: 2px solid white;
            border-radius: 50%;
            cursor: grab;
            display: none;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 10px;
            font-weight: bold;
            z-index: 3;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .current-rotate-handle:active {
            cursor: grabbing;
        }

        .current-indicator:hover .current-rotate-handle {
            display: flex;
        }
