

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: Arial, Helvetica, sans-serif;
            background: #f1f5f9;
            color: #0f172a;
            min-height: 100vh;
        }

        .app {
            width: 100%;
            max-width: 520px;
            margin: 0 auto;
            min-height: 100vh;
            background: #ffffff;
        }

        /* =====================================================
           HEADER
        ===================================================== */

        .header {
            background: linear-gradient(
                135deg,
                #075985,
                #0284c7
            );

            color: #ffffff;
            padding: 25px 20px 30px;

            border-radius: 0 0 28px 28px;
        }

        .header-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .logo {
            width: 48px;
            height: 48px;
            background: rgba(255,255,255,.15);
            border-radius: 14px;

            display: flex;
            align-items: center;
            justify-content: center;

            font-size: 27px;
        }

        .header-title {
            flex: 1;
        }

        .header-title h1 {
            font-size: 20px;
            font-weight: 700;
        }

        .header-title p {
            font-size: 13px;
            margin-top: 4px;
            opacity: .85;
        }

        .connection {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #22c55e;
            box-shadow: 0 0 0 4px rgba(34,197,94,.2);
        }

        .connection.offline {
            background: #ef4444;
            box-shadow: 0 0 0 4px rgba(239,68,68,.2);
        }

        /* =====================================================
           CONTENIDO
        ===================================================== */

        .content {
            padding: 20px;
        }

        .status-card {
            margin-top: -5px;
            background: #ffffff;
            border-radius: 22px;

            padding: 25px 20px;

            box-shadow:
                0 10px 30px rgba(15,23,42,.10);

            text-align: center;
        }

        .status-label {
            font-size: 13px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 700;
        }

        .water-level {
            margin-top: 12px;

            font-size: 58px;
            font-weight: 800;

            color: #0284c7;

            line-height: 1;
        }

        .water-level span {
            font-size: 26px;
            margin-left: 3px;
        }

        .status {
            display: inline-flex;
            align-items: center;
            gap: 8px;

            margin-top: 18px;

            padding: 10px 18px;

            border-radius: 999px;

            font-size: 14px;
            font-weight: 700;
        }

        .status.normal {
            background: #dcfce7;
            color: #166534;
        }

        .status.alerta {
            background: #fee2e2;
            color: #991b1b;

            animation: pulse 1.5s infinite;
        }

        .status-icon {
            font-size: 18px;
        }

        @keyframes pulse {

            0% {
                box-shadow: 0 0 0 0 rgba(239,68,68,.4);
            }

            70% {
                box-shadow: 0 0 0 12px rgba(239,68,68,0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(239,68,68,0);
            }

        }

        /* =====================================================
           BARRA DE NIVEL
        ===================================================== */

        .level-container {
            margin-top: 25px;
            text-align: left;
        }

        .level-header {
            display: flex;
            justify-content: space-between;

            font-size: 12px;
            color: #64748b;

            margin-bottom: 8px;
        }

        .level-bar {
            height: 12px;
            width: 100%;

            background: #e2e8f0;

            border-radius: 999px;

            overflow: hidden;
        }

        .level-progress {
            height: 100%;
            width: 0%;

            background: #0284c7;

            border-radius: inherit;

            transition: width .5s ease;
        }

        .level-progress.alerta {
            background: #ef4444;
        }

        /* =====================================================
           INFORMACIÓN
        ===================================================== */

        .info-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;

            gap: 12px;

            margin-top: 18px;
        }

        .info-card {
            background: #f8fafc;

            border: 1px solid #e2e8f0;

            border-radius: 16px;

            padding: 15px;
        }

        .info-card .label {
            font-size: 11px;
            color: #64748b;

            text-transform: uppercase;

            letter-spacing: .5px;
        }

        .info-card .value {
            margin-top: 6px;

            font-size: 15px;

            font-weight: 700;

            color: #0f172a;

            word-break: break-word;
        }

        /* =====================================================
           ACTUALIZACIÓN
        ===================================================== */

        .update {
            margin-top: 20px;

            text-align: center;

            font-size: 12px;

            color: #94a3b8;
        }

        .refresh {
            margin-top: 15px;

            width: 100%;

            border: none;

            background: #075985;

            color: #ffffff;

            padding: 13px;

            border-radius: 13px;

            font-size: 14px;

            font-weight: 700;

            cursor: pointer;
        }

        .refresh:active {
            transform: scale(.98);
        }

        /* =====================================================
           MENSAJE DE ERROR
        ===================================================== */

        .error {
            display: none;

            margin-top: 15px;

            padding: 13px;

            border-radius: 12px;

            background: #fee2e2;

            color: #991b1b;

            font-size: 13px;

            text-align: center;
        }

        /* =====================================================
           FOOTER
        ===================================================== */

        .footer {
            text-align: center;

            padding: 25px 20px;

            color: #94a3b8;

            font-size: 11px;
        }

    