/* Planificador de vuelos — paleta de Aviación Simulada, modo claro y oscuro. */
.avpl, .avpl-prueba, .avpl-aviso { font-size: 15px; }
.avpl {
  --fondo: #F4F8FC; --panel: #FFFFFF; --texto: #16324F; --suave: #5A6F84; --borde: #DCE6EF; --campo: #FFFFFF; --campo-borde: #CFDDEA;
  --azul: #0875D1; --oro: #F2B53A; --resalte: #F0F6FB; --sombra: 0 14px 34px rgba(8, 26, 51, .1); --mapa: #0B2240;
  color: var(--texto);
}
.avpl[data-tema="oscuro"] {
  --fondo: #06142A; --panel: #0B2240; --texto: #E3EDF7; --suave: #9FB2C8; --borde: #1E3A5C; --campo: #081A33; --campo-borde: #2A4A70;
  --resalte: #0F2C50; --sombra: 0 14px 34px rgba(0, 0, 0, .4);
  background: var(--fondo); border-radius: 18px; padding: 12px;
}
.avpl-prueba { margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 12px; background: #FFF6E5; border: 1px solid #FFC98F; color: #5A3A00; font-size: 14px; }
.avpl-prueba strong:first-child { display: inline-block; margin-right: .5rem; padding: .15rem .5rem; border-radius: 6px; background: #F29A1F; color: #2A1700; font-size: 11.5px; letter-spacing: .06em; }
.avpl-beta { background: #EAF4FF; border-color: #A9D2F5; color: #0B3A63; }
.avpl-beta strong:first-child { background: #0875D1; color: #fff; }
.avpl-beta a { color: #0875D1; font-weight: 600; }
.avpl-aviso { padding: 1rem; border-radius: 12px; background: #F0F6FB; color: #16324F; }

/* Barra superior */
.avpl-barra { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.avpl-perfil { display: inline-flex; padding: 4px; border-radius: 12px; background: #081A33; }
.avpl-perfil button { min-height: 40px; padding: 0 1rem; border: 0; border-radius: 9px; background: transparent; color: #B9CDE2; font: 600 14px Inter, sans-serif; cursor: pointer; }
.avpl-perfil button[aria-checked="true"] { background: linear-gradient(180deg, #FFC659, #F29A1F); color: #2A1700; }
.avpl-acciones { display: flex; flex-wrap: wrap; gap: .4rem; }
.avpl-accion { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .85rem; border: 1px solid var(--borde); border-radius: 10px; background: var(--panel); color: var(--texto); font: 600 13.5px Inter, sans-serif; cursor: pointer; }
.avpl-accion small { font-weight: 500; color: var(--suave); font-size: 11px; }
.avpl-accion:disabled { opacity: .55; cursor: not-allowed; }
.avpl-accion:not(:disabled):hover { border-color: var(--azul); }
.avpl-real { margin-bottom: .75rem; padding: .7rem 1rem; border-radius: 12px; background: #FDECEC; border: 1px solid #F5B5B5; color: #7A1616; font-size: 14px; }

/* Distribución: panel | mapa | panel, y ruta debajo */
.avpl-zona { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 12px; height: min(76vh, 760px); min-height: 520px; }
.avpl-panel { min-width: 0; overflow: auto; background: var(--panel); border: 1px solid var(--borde); border-radius: 16px; box-shadow: var(--sombra); }
.avpl-panel details + details { border-top: 1px solid var(--borde); }
.avpl-panel summary { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; background: var(--panel); font: 800 1rem Barlow, Inter, sans-serif; cursor: pointer; list-style: none; }
.avpl-panel summary::-webkit-details-marker { display: none; }
.avpl-panel summary::after { content: "›"; margin-left: auto; transform: rotate(90deg); transition: transform .2s; color: var(--suave); font-size: 1.2rem; }
.avpl-panel details:not([open]) summary::after { transform: none; }
.avpl-panel summary small { font: 600 11px Inter, sans-serif; color: var(--suave); }
.avpl-panel__cuerpo { padding: 0 1rem 1rem; }
.avpl-panel--abajo { margin-top: 12px; overflow: visible; }

/* Campos */
.avpl-campo { position: relative; margin: 0 0 .8rem; border: 0; padding: 0; }
.avpl-campo label, .avpl-campo legend { display: block; margin-bottom: 4px; font: 600 12.5px Inter, sans-serif; color: var(--texto); }
.avpl-campo label small, .avpl-campo legend small { color: var(--suave); font-weight: 500; }
.avpl-campo input[type="text"], .avpl-campo select, .avpl-campo input[type="datetime-local"] { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--campo-borde); border-radius: 10px; background: var(--campo); color: var(--texto); font: 500 14.5px Inter, sans-serif; }
.avpl-campo input:disabled, .avpl-campo select:disabled { opacity: .6; }
.avpl-campo input:focus-visible, .avpl-campo select:focus-visible, .avpl button:focus-visible { outline: 2px solid #5CC8FF; outline-offset: 2px; }
.avpl-combo__caja { position: relative; }
.avpl-combo__caja input { padding-right: 36px !important; }
.avpl-combo__quitar { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--suave); font-size: 20px; cursor: pointer; }
.avpl-combo__lista { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% - 6px); max-height: 300px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra); }
.avpl-combo__lista li { padding: .5rem .6rem; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.avpl-combo__lista li small { display: block; color: var(--suave); font-size: 12px; }
.avpl-combo__lista li[aria-selected="true"], .avpl-combo__lista li:hover { background: var(--resalte); }
.avpl-combo__vacio { color: var(--suave); cursor: default !important; }
.avpl-combo__elegido { margin: 4px 0 0; font-size: 12.5px; color: var(--suave); }
.avpl-intercambiar { display: block; margin: -.4rem 0 .4rem auto; width: 34px; height: 30px; border: 1px solid var(--borde); border-radius: 8px; background: var(--panel); color: var(--texto); cursor: pointer; font-size: 16px; }
.avpl-reglas { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.avpl-reglas legend { width: 100%; }
.avpl-reglas label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font: 600 14px Inter, sans-serif; }

/* Mapa */
.avpl-mapa-caja { position: relative; min-width: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--borde); box-shadow: var(--sombra); }
.avpl-mapa { width: 100%; height: 100%; background: var(--mapa); }
.avpl[data-tema="oscuro"] .avpl-mapa .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) saturate(.6); }
.avpl-mapa .leaflet-tile-pane { filter: saturate(.75) brightness(.97); }
.avpl-mapa-estado { position: absolute; z-index: 440; left: 50%; top: 10px; transform: translateX(-50%); max-width: calc(100% - 120px); padding: .35rem .7rem; border-radius: 999px; background: rgba(8, 26, 51, .85); color: #DCE8F5; font-size: 12.5px; text-align: center; pointer-events: none; }
.avpl-mapa-estado:empty, .avpl-mapa-estado[hidden] { display: none; }
.avpl-etq { padding: 1px 6px; border: 0; border-radius: 6px; background: rgba(8, 26, 51, .9); color: #fff; font: 800 12px Barlow, Inter, sans-serif; box-shadow: none; }
.avpl-etq::before { display: none; }
.avpl-etq--origen { background: #0875D1; } .avpl-etq--destino { background: #F29A1F; color: #2A1700; }
.avpl-fondo { position: absolute; z-index: 450; left: 12px; bottom: 28px; width: min(320px, calc(100% - 24px)); box-sizing: border-box; padding: .85rem 1rem; border-radius: 14px; background: rgba(8, 26, 51, .94); color: #DCE8F5; font-size: 13.5px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.avpl-fondo[hidden] { display: none; }
.avpl-fondo p { margin: 0 0 .6rem; } .avpl-fondo strong { color: #fff; } .avpl-fondo small { display: block; margin-top: .5rem; color: #9FB2C8; }
.avpl-btn { min-height: 44px; width: 100%; padding: 0 1rem; border: 0; border-radius: 10px; background: linear-gradient(180deg, #FFC659, #F29A1F); color: #2A1700; font: 700 14.5px Inter, sans-serif; cursor: pointer; }
.avpl-enlace { padding: 0; border: 0; background: none; color: #9FD8FF; font: inherit; text-decoration: underline; cursor: pointer; }

/* Información, meteo y ruta */
.avpl-nota { margin: .4rem 0; font-size: 13.5px; color: var(--suave); line-height: 1.5; }
.avpl-error { color: #C62828; font-size: 13.5px; }
.avpl-info__cod { margin: 0; font: 800 1.35rem Barlow, Inter, sans-serif; color: var(--azul); }
.avpl[data-tema="oscuro"] .avpl-info__cod { color: #5CC8FF; }
.avpl-info__nombre { margin: .1rem 0 0; font-weight: 700; }
.avpl-dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: .6rem 0; font-size: 13.5px; }
.avpl-dl dt { color: var(--suave); } .avpl-dl dd { margin: 0; }
.avpl-tabla-caja { overflow-x: auto; }
.avpl-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: .4rem 0; }
.avpl-tabla th { text-align: left; padding: .4rem .5rem; background: var(--resalte); color: var(--suave); font-weight: 600; white-space: nowrap; }
.avpl-tabla td { padding: .45rem .5rem; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.avpl-tabla .avpl-alt td { color: var(--suave); }
.avpl-usar { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.avpl-usar button { min-height: 36px; padding: 0 .7rem; border: 1px solid var(--azul); border-radius: 9px; background: transparent; color: var(--azul); font: 600 13px Inter, sans-serif; cursor: pointer; }
.avpl[data-tema="oscuro"] .avpl-usar button { color: #5CC8FF; border-color: #5CC8FF; }
.avpl-usar button:hover { background: var(--resalte); }
.avpl-metar { margin-bottom: .7rem; }
.avpl-metar__cab { margin: 0 0 .25rem; font: 700 13px Inter, sans-serif; }
.avpl-metar__txt { margin: 0; padding: .55rem .65rem; border-radius: 10px; background: #081A33; color: #DCE8F5; font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.avpl-fuente { margin: .4rem 0 0; font-size: 11.5px; color: var(--suave); }
.avpl-cat { display: inline-block; padding: .05rem .4rem; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: #DCE6EF; color: #16324F; }
.avpl-cat--vfr { background: #D3F5E2; color: #0E6B3A; } .avpl-cat--mvfr { background: #DCEBFF; color: #0B4F9C; }
.avpl-cat--ifr { background: #FDE2E2; color: #9B1C1C; } .avpl-cat--lifr { background: #F3E3FF; color: #6B21A8; }
.avpl-fuentes { margin: .8rem 0 0; font-size: 12px; color: var(--suave); line-height: 1.5; }
.avpl-fuentes a { color: inherit; }

/* Fase 2: acciones, rendimiento, ruta y planes */
.avpl-accion--primaria { background: var(--azul); border-color: var(--azul); color: #fff; }
.avpl-accion--primaria:hover { background: #065BA3; }
.avpl-rend { margin: 0 0 .8rem; border: 1px solid var(--borde); border-radius: 12px; padding: .2rem .7rem .7rem; }
.avpl-rend summary { cursor: pointer; padding: .5rem 0; font: 700 13.5px Inter, sans-serif; }
.avpl-rend summary small { color: var(--suave); font-weight: 500; }
.avpl-rend__rejilla { display: grid; gap: .5rem; }
.avpl-num { display: grid; grid-template-columns: 1fr 112px; align-items: center; gap: .5rem; font-size: 12.5px; color: var(--texto); }
.avpl-num__caja { display: flex; align-items: center; gap: 4px; }
.avpl-num input { box-sizing: border-box; width: 72px; min-height: 36px; padding: 0 6px; border: 1px solid var(--campo-borde); border-radius: 8px; background: var(--campo); color: var(--texto); font: 600 13.5px Inter, sans-serif; text-align: right; }
.avpl-num small { color: var(--suave); font-size: 11px; }
.avpl-mini { margin-top: .6rem; min-height: 32px; padding: 0 .6rem; border: 1px solid var(--borde); border-radius: 8px; background: transparent; color: var(--texto); font: 600 12px Inter, sans-serif; cursor: pointer; }
.avpl-ruta-botones { display: flex; flex-wrap: wrap; gap: .4rem; }
.avpl-etiqueta { width: 100%; font: 600 12.5px Inter, sans-serif; }
.avpl-ruta-botones button { min-height: 38px; padding: 0 .7rem; border: 1px solid var(--azul); border-radius: 9px; background: transparent; color: var(--azul); font: 600 13px Inter, sans-serif; cursor: pointer; }
.avpl[data-tema="oscuro"] .avpl-ruta-botones button { color: #5CC8FF; border-color: #5CC8FF; }
.avpl-ruta-botones button[aria-pressed="true"] { background: var(--azul); color: #fff; }
.avpl-ruta-botones button:disabled { opacity: .6; cursor: wait; }
.avpl-mapa-caja.is-editando { box-shadow: 0 0 0 3px #F2B53A, var(--sombra); }
.avpl-mapa-caja.is-editando .avpl-mapa { cursor: crosshair; }
.avpl-pt { background: none; border: 0; }
.avpl-pt span { display: block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #F29A1F; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.avpl-pt--nav span { background: #7A5AF8; border-radius: 3px; transform: rotate(45deg); }
.avpl-pt--apt span { background: #0875D1; }
.avpl-pt b { position: absolute; left: 16px; top: -3px; padding: 1px 5px; border-radius: 5px; background: rgba(8, 26, 51, .85); color: #fff; font: 700 11px Barlow, Inter, sans-serif; white-space: nowrap; }
.avpl-pt.is-editable span { cursor: grab; box-shadow: 0 0 0 3px rgba(242, 181, 58, .5); }
.avpl-etq--perfil { background: #0B2240; color: #5CC8FF; }
.avpl-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin: .2rem 0 .8rem; }
.avpl-resumen > div { padding: .7rem .8rem; border-radius: 12px; background: var(--resalte); }
.avpl-resumen span { display: block; font-size: 12px; color: var(--suave); }
.avpl-resumen strong { display: block; font: 800 1.35rem Barlow, Inter, sans-serif; }
.avpl-resumen small { font-size: 12px; color: var(--suave); }
.avpl-sugerencia { display: inline-block; padding: 0 .35rem; border-radius: 5px; background: #FFF1D6; color: #7A4B00; }
.avpl-ok { color: #0E7A45; }
.avpl[data-tema="oscuro"] .avpl-ok { color: #6EE7A8; }
.avpl-aviso-ruta { margin: .3rem 0; padding: .5rem .7rem; border-radius: 10px; background: #FFF6E5; color: #6B4400; font-size: 13.5px; }
.avpl-tabla--ruta td small { display: block; color: var(--suave); font-size: 11.5px; white-space: normal; }
.avpl-acc { white-space: nowrap; }
.avpl-acc button { width: 28px; height: 28px; margin-left: 2px; border: 1px solid var(--borde); border-radius: 7px; background: var(--panel); color: var(--texto); cursor: pointer; }
.avpl-acc button:hover { border-color: var(--azul); }
.avpl-dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1rem; margin-top: .6rem; }
.avpl-dos h3 { margin: .4rem 0; font: 800 1rem Barlow, Inter, sans-serif; }
.avpl-guia ol, .avpl-guia ul { margin: .3rem 0 .6rem; padding-left: 1.2rem; line-height: 1.5; }
.avpl-guia li { margin: .25rem 0; }
.avpl-guia { margin-top: 1rem; }
.avpl-total td { font-weight: 800; border-top: 2px solid var(--texto); }
.avpl-planes { margin: 0; padding: 0; list-style: none; }
.avpl-planes li { padding: .55rem 0; border-bottom: 1px solid var(--borde); }
.avpl-planes li strong { display: block; font-size: 14px; }
.avpl-planes li small { display: block; color: var(--suave); font-size: 12px; }
.avpl-planes__acc { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; align-items: center; font-size: 12.5px; }
.avpl-planes__acc button { min-height: 30px; padding: 0 .55rem; border: 1px solid var(--borde); border-radius: 7px; background: var(--panel); color: var(--texto); font: 600 12px Inter, sans-serif; cursor: pointer; }
.avpl-planes__acc button[data-a="si"] { border-color: #C62828; color: #C62828; }
.avpl-ok-msg { margin: 0 0 .5rem; padding: .45rem .6rem; border-radius: 8px; background: #E3F7EC; color: #0E5A34; font-size: 13px; }

/* Fase 3: meteorología y alertas */
.avpl-ayuda { display: block; margin-top: 4px; color: var(--suave); font-size: 11.5px; }
.avpl-check { display: flex; align-items: center; gap: 8px; margin: -.3rem 0 .9rem; font: 600 13px Inter, sans-serif; }
.avpl-leyenda { max-width: 230px; padding: .45rem .65rem; border-radius: 10px; background: rgba(8, 26, 51, .9); color: #DCE8F5; font: 12px/1.4 Inter, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.avpl-leyenda summary { cursor: pointer; font-weight: 700; }
.avpl-leyenda p { margin: .45rem 0 .2rem; } .avpl-leyenda ul { margin: 0; padding: 0; list-style: none; }
.avpl-leyenda li { display: flex; align-items: center; gap: 6px; }
.avpl-leyenda i { width: 14px; height: 10px; border-radius: 2px; opacity: .85; } .avpl-leyenda i.avpl-redondo { width: 10px; border-radius: 50%; }
.avpl-vto { background: none; border: 0; text-align: center; pointer-events: none; }
.avpl-vto span { display: inline-block; color: #0B4F9C; font-size: 20px; line-height: 1; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.avpl[data-tema="oscuro"] .avpl-vto span { color: #9FE0FF; text-shadow: 0 0 3px #000; }
.avpl-vto b { display: block; margin-top: 1px; font: 700 10.5px Inter, sans-serif; color: #081A33; text-shadow: 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.avpl-contador { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #64748B; color: #fff; font: 800 12px Inter, sans-serif; }
.avpl-contador.is-media { background: #F29A1F; color: #2A1700; } .avpl-contador.is-alta { background: #E5484D; }
.avpl-sev { display: inline-block; padding: .1rem .45rem; border-radius: 6px; font: 700 11px Inter, sans-serif; letter-spacing: .03em; }
.avpl-sev--alta { background: #E5484D; color: #fff; } .avpl-sev--media { background: #F29A1F; color: #2A1700; } .avpl-sev--baja { background: #DCE6EF; color: #16324F; }
.avpl-alertas, .avpl-notas { margin: 0; padding: 0; list-style: none; }
.avpl-alerta { margin-bottom: .6rem; padding: .6rem .7rem; border-radius: 12px; border: 1px solid var(--borde); border-left: 4px solid #94A3B8; }
.avpl-alerta--alta { border-left-color: #E5484D; } .avpl-alerta--media { border-left-color: #F29A1F; }
.avpl-alerta__cab { margin: 0 0 .35rem; font: 700 13.5px/1.35 Inter, sans-serif; }
.avpl-dl--peq { grid-template-columns: auto 1fr; gap: .15rem .6rem; margin: 0 0 .4rem; font-size: 12.5px; }
.avpl-notas li { margin: .3rem 0; padding-left: .9rem; position: relative; font-size: 12.5px; color: var(--suave); }
.avpl-notas li::before { content: "·"; position: absolute; left: .2rem; font-weight: 800; }
.avpl-prev { margin: .35rem 0 0; font-size: 12.5px; line-height: 1.6; }
.avpl-prev .avpl-sev { margin: 0 .2rem .2rem 0; }
.avpl-nd { color: var(--suave); font-style: italic; }
.avpl-taf { margin: .35rem 0 0; font-size: 12.5px; } .avpl-taf summary { cursor: pointer; color: var(--suave); }
.avpl-pre { max-height: 160px; overflow: auto; white-space: pre-wrap; font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; background: #F0F6FB; padding: .4rem; border-radius: 6px; }
.avpl-foco { animation: avpl-foco 1s ease-in-out infinite; }
@keyframes avpl-foco { 50% { stroke-opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .avpl-foco { animation: none; } }

/* Fase 4: exportar e importar */
.avpl-intercambio { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem 1.5rem; margin: 0 0 .75rem; padding: 1rem 2.6rem 1rem 1rem; border: 1px solid var(--borde); border-radius: 16px; background: var(--panel); box-shadow: var(--sombra); }
.avpl-intercambio[hidden] { display: none; }
.avpl-intercambio[data-modo="exportar"] [data-avpl-pestana="importar"], .avpl-intercambio[data-modo="importar"] [data-avpl-pestana="exportar"] { opacity: .75; }
.avpl-intercambio h3 { margin: 0 0 .6rem; font: 800 1.05rem Barlow, Inter, sans-serif; }
.avpl-botones { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.avpl-botones button, .avpl-fila button { min-height: 44px; padding: .35rem .8rem; border: 1px solid var(--azul); border-radius: 10px; background: transparent; color: var(--azul); font: 700 13.5px Inter, sans-serif; text-align: left; cursor: pointer; }
.avpl[data-tema="oscuro"] .avpl-botones button, .avpl[data-tema="oscuro"] .avpl-fila button { color: #5CC8FF; border-color: #5CC8FF; }
.avpl-botones button small { display: block; font-weight: 500; font-size: 11.5px; color: var(--suave); }
.avpl-botones button:hover, .avpl-fila button:hover { background: var(--resalte); }
.avpl-botones .avpl-oro { background: linear-gradient(180deg, #FFC659, #F29A1F); border-color: #F29A1F; color: #2A1700 !important; }
.avpl-botones .avpl-oro small { color: #5A3A00; }
.avpl-archivo { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 2px dashed var(--campo-borde); border-radius: 10px; cursor: pointer; font: 600 13.5px Inter, sans-serif; }
.avpl-archivo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avpl-archivo:focus-within { outline: 2px solid #5CC8FF; outline-offset: 2px; }
.avpl-fila { display: flex; gap: .4rem; }
.avpl-fila input { flex: 1; }
.avpl-estado-imp { margin: .4rem 0 0; font-size: 13px; color: var(--texto); }
.avpl-cerrar { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--suave); font-size: 22px; cursor: pointer; }

/* Tablet y móvil: el mapa primero, paneles plegables debajo */
@media (max-width: 1100px) {
  .avpl-zona { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 60vh auto; height: auto; }
  .avpl-mapa-caja { grid-column: 1 / -1; grid-row: 1; min-height: 380px; }
  .avpl-panel--izq, .avpl-panel--der { grid-row: 2; max-height: none; overflow: visible; }
  .avpl-panel summary { position: static; }
}
@media (max-width: 700px) {
  .avpl-zona { grid-template-columns: 1fr; grid-template-rows: 56vh auto auto; }
  .avpl-panel--izq { grid-row: 2; } .avpl-panel--der { grid-row: 3; }
  .avpl-accion span, .avpl-accion small { display: none; }
  .avpl-accion.avpl-tema span { display: inline; }
  .avpl[data-tema="oscuro"] { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .avpl-panel summary::after { transition: none; } }
/* Pantallas táctiles: botones pequeños con zona de pulsación de al menos 40 px */
@media (pointer: coarse) {
  .avpl-combo__quitar, .avpl-intercambiar { min-width: 40px; min-height: 40px; }
  .avpl-check input, .avpl-reglas input { width: 20px; height: 20px; }
}

/* ---------- Carga, pesos y centrado ---------- */
.avpl-carga [data-avpl-carga-form] { display: grid; gap: .5rem; padding-top: .4rem; }
.avpl-carga .avpl-num select { grid-column: 1 / -1; width: 100%; min-height: 36px; padding: 0 6px; border: 1px solid var(--campo-borde); border-radius: 8px; background: var(--campo); color: var(--texto); font: 600 13px Inter, sans-serif; }
.avpl-carga__perfil { margin: 0; font-size: 13.5px; }
.avpl-fila--mini { align-items: center; flex-wrap: wrap; }
.avpl-fila--mini .avpl-mini { margin-top: 0; }
.avpl-dato { display: inline-block; padding: 0 .4rem; border-radius: 6px; font: 700 10.5px Inter, sans-serif; letter-spacing: .02em; vertical-align: 1px; }
.avpl-dato--documentado { background: #E3F5EC; color: #0B5D3B; }
.avpl-dato--aproximado { background: #FFF1D6; color: #7A4B00; }
.avpl-dato--usuario { background: #E6F1FB; color: #0C447C; }
.avpl-dato--nd { background: #EEF1F4; color: #4A5868; }
.avpl-carga__vista { border: 1px solid var(--borde); border-radius: 12px; padding: .6rem; background: var(--resalte); }
.avpl-avion { display: block; width: 100%; height: auto; max-height: 520px; }
.avpl-avion--lat { max-height: 160px; margin-top: .4rem; }
.avpl-avion__fus { fill: var(--panel); stroke: var(--suave); stroke-width: 1.5; }
.avpl-avion__ala { fill: var(--panel); stroke: var(--suave); stroke-width: 1.2; }
.avpl-avion__dep { fill: rgba(8, 117, 209, .08); stroke: #0875D1; stroke-width: 1; stroke-dasharray: 4 3; }
.avpl-avion__comb { fill: rgba(8, 117, 209, .45); }
.avpl-avion__suelo { stroke: var(--suave); stroke-width: 1; stroke-dasharray: 5 4; }
.avpl-avion__bod { fill: transparent; stroke: #BA7517; stroke-width: 1.2; }
.avpl-avion__bod.is-error { stroke: #E5484D; stroke-width: 2.5; }
.avpl-avion__bodc { fill: rgba(242, 154, 31, .55); }
.avpl-avion__cg { stroke: #E5484D; stroke-width: 2; }
.avpl-avion__txt { fill: var(--texto); font: 600 12px Inter, sans-serif; }
.avpl-asiento { fill: transparent; stroke: var(--suave); stroke-width: .6; cursor: pointer; }
.avpl-asiento.is-premium { stroke: #7F77DD; stroke-width: 1; }
.avpl-asiento.is-ocupado { fill: #1D9E75; stroke: #0F6E56; }
.avpl-asiento:hover { stroke: #0875D1; stroke-width: 1.5; }
.avpl-carga__leyenda { margin: .4rem 0 0; font-size: 12px; color: var(--suave); }
.avpl-carga__leyenda span { display: inline-block; width: 10px; height: 10px; margin: 0 .25rem 0 .6rem; border-radius: 2px; vertical-align: -1px; border: 1px solid var(--suave); }
.avpl-carga__leyenda span:first-child { margin-left: 0; }
.avpl-carga__leyenda .is-ocupado { background: #1D9E75; border-color: #0F6E56; }
.avpl-carga__leyenda .is-premium { border-color: #7F77DD; }
.avpl-carga__leyenda .is-comb { background: rgba(8, 117, 209, .45); border-color: #0875D1; }
.avpl-carga__leyenda .is-bod { background: rgba(242, 154, 31, .55); border-color: #BA7517; }
.avpl-pesos { display: grid; gap: .5rem; }
.avpl-peso { display: grid; gap: 2px; padding: .5rem .6rem; border: 1px solid var(--borde); border-radius: 10px; font-size: 12.5px; }
.avpl-peso strong { font: 800 1.05rem Barlow, Inter, sans-serif; }
.avpl-peso small { color: var(--suave); }
.avpl-peso__barra { display: block; height: 6px; border-radius: 4px; background: var(--borde); overflow: hidden; }
.avpl-peso__barra i { display: block; height: 100%; background: #1D9E75; }
.avpl-peso.is-error { border-color: #E5484D; background: rgba(229, 72, 77, .07); }
.avpl-peso.is-error .avpl-peso__barra i { background: #E5484D; }
.avpl-cg-nd { padding: .6rem .8rem; border: 1px dashed var(--suave); border-radius: 10px; font-size: 13px; }
.avpl-cg-nd p { margin: .2rem 0; }
.avpl-novalido { margin: 0 0 .6rem; padding: .6rem .8rem; border: 2px solid #E5484D; border-radius: 10px; background: rgba(229, 72, 77, .08); color: var(--texto); font-size: 13.5px; }
.avpl-novalido strong { color: #C62F34; margin-right: .4rem; }
.avpl-carga__err { margin: .6rem 0; padding-left: 1.2rem; color: #C62F34; font-size: 13px; }
.avpl-carga__datos { margin-top: .6rem; font-size: 13px; }
.avpl-carga__datos summary { cursor: pointer; font-weight: 700; }
.avpl-env { width: 100%; max-width: 380px; }
.avpl-env__pol { fill: rgba(29, 158, 117, .12); stroke: #1D9E75; stroke-width: 1.5; }
.avpl-env__rec { fill: none; stroke: #0875D1; stroke-width: 1.5; stroke-dasharray: 4 3; }
.avpl-env__pt { fill: #0875D1; }
.avpl-env__pt.is-error { fill: #E5484D; }
.avpl[data-tema="oscuro"] .avpl-dato--documentado { background: #0B3A27; color: #9FE1CB; }
.avpl[data-tema="oscuro"] .avpl-dato--aproximado { background: #4A3205; color: #FAC775; }
.avpl[data-tema="oscuro"] .avpl-dato--usuario { background: #0C2E52; color: #B5D4F4; }
.avpl[data-tema="oscuro"] .avpl-dato--nd { background: #1E3A5C; color: #C6D3E0; }
.avpl-juego { display: grid; gap: .3rem; margin: 0; padding: .5rem .6rem; border: 1px solid var(--borde); border-radius: 10px; font-size: 13px; }
.avpl-juego legend { padding: 0 .3rem; font-weight: 700; font-size: 12.5px; }
.avpl-juego label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.avpl-juego label.is-nd { color: var(--suave); cursor: not-allowed; }
.avpl-carga__fuentes { margin: 0; font-size: 12px; line-height: 1.45; }
.avpl-carga__fuentes a, .avpl-tabla--fuentes a, .avpl-carga__datos a { color: var(--azul); font-weight: 600; text-decoration: underline; }
.avpl[data-tema="oscuro"] .avpl-carga__fuentes a, .avpl[data-tema="oscuro"] .avpl-carga__datos a { color: #5CC8FF; }
.avpl-carga__datos h4 { margin: .8rem 0 .3rem; font: 800 .95rem Barlow, Inter, sans-serif; }

/* ---------- Dibujos de carga (v2): volumen, cabina ampliada e indicador ---------- */
.avpl { --av-fus1: #FFFFFF; --av-fus2: #EEF4FA; --av-fus3: #C9D8E8; --av-fus4: #93A9C2; --av-ala1: #F6F9FC; --av-ala2: #C3D3E4; --av-linea: #42607F; --av-suelo: #F7FAFD; }
.avpl[data-tema="oscuro"] { --av-fus1: #3B5878; --av-fus2: #2A4565; --av-fus3: #17304F; --av-fus4: #0B1F38; --av-ala1: #2E4B6B; --av-ala2: #142B47; --av-linea: #8FB3D6; --av-suelo: #102A48; }
.avpl-g-fus1 { stop-color: var(--av-fus1); } .avpl-g-fus2 { stop-color: var(--av-fus2); } .avpl-g-fus3 { stop-color: var(--av-fus3); } .avpl-g-fus4 { stop-color: var(--av-fus4); }
.avpl-g-ala1 { stop-color: var(--av-ala1); } .avpl-g-ala2 { stop-color: var(--av-ala2); }
.avpl-carga__vista { padding: .8rem; background: linear-gradient(180deg, var(--resalte), var(--panel)); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 10px 24px rgba(8, 26, 51, .08); }
.avpl-vistas { display: grid; gap: .8rem; }
.avpl-vista { margin: 0; padding: .5rem .6rem .6rem; border: 1px solid var(--borde); border-radius: 14px; background: var(--panel); box-shadow: 0 6px 16px rgba(8, 26, 51, .06); }
.avpl-vista figcaption { margin: 0 0 .3rem; font: 800 .82rem Barlow, Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); }
.avpl-avion { display: block; width: 100%; height: auto; }
.avpl-avion--gen { max-height: 460px; }
.avpl-avion--cab, .avpl-avion--lat { max-height: none; }
.avpl-av-fus { fill: url(#avplgFus); stroke: var(--av-linea); stroke-width: 1.4; }
.avpl-av-ala { fill: url(#avplgAla); stroke: var(--av-linea); stroke-width: 1.2; stroke-linejoin: round; }
.avpl-av-mot { fill: url(#avplgMot); stroke: var(--av-linea); stroke-width: 1; }
.avpl-av-cab { fill: #0B2240; opacity: .85; }
.avpl-av-vent { fill: #16324F; opacity: .55; }
.avpl[data-tema="oscuro"] .avpl-av-vent { fill: #9FD8FF; opacity: .5; }
.avpl-av-suelo { fill: var(--av-suelo); stroke: var(--borde); stroke-width: 1; }
.avpl-av-piso { stroke: var(--av-linea); stroke-width: 1; stroke-dasharray: 5 4; opacity: .6; }
.avpl-av-dep { fill: rgba(8, 117, 209, .1); stroke: #0875D1; stroke-width: 1.6; }
.avpl-av-dep.is-nd { fill: rgba(90, 111, 132, .08); stroke: var(--suave); stroke-dasharray: 5 4; }
.avpl-av-bod { fill: rgba(242, 154, 31, .08); stroke: #C87A10; stroke-width: 1.5; }
.avpl-av-bod.is-error { stroke: #E5484D; stroke-width: 3; fill: rgba(229, 72, 77, .12); }
.avpl-av-pt { fill: var(--panel); stroke: var(--av-linea); stroke-width: .5; }
.avpl-av-pt.is-ocupado { fill: #0875D1; stroke: #05539A; }
.avpl-av-pt.is-premium.is-ocupado { fill: #F2B53A; stroke: #B87A0A; }
.avpl-av-zona { fill: #0875D1; opacity: .25; }
.avpl-av-txt { fill: var(--texto); font: 700 13px Inter, sans-serif; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.avpl-av-txt.is-suave { fill: var(--suave); font-weight: 600; }
.avpl-av-fila { fill: var(--suave); font: 700 11px Inter, sans-serif; }
.avpl-asiento { cursor: pointer; outline: none; }
.avpl-asiento__base { fill: var(--panel); stroke: #8FA6BF; stroke-width: 1; transition: fill .15s; }
.avpl-asiento__resp { fill: #DCE6EF; stroke: #8FA6BF; stroke-width: 1; }
.avpl-asiento.is-premium .avpl-asiento__base, .avpl-asiento.is-premium .avpl-asiento__resp { stroke: #D49A1F; }
.avpl-asiento.is-ocupado .avpl-asiento__base { fill: #0875D1; stroke: #05539A; }
.avpl-asiento.is-ocupado .avpl-asiento__resp { fill: #05539A; stroke: #043F75; }
.avpl-asiento.is-premium.is-ocupado .avpl-asiento__base { fill: #F2B53A; stroke: #B87A0A; }
.avpl-asiento.is-premium.is-ocupado .avpl-asiento__resp { fill: #D49A1F; stroke: #9A6508; }
.avpl-asiento:hover .avpl-asiento__base { stroke: #F29A1F; stroke-width: 2; }
.avpl-asiento:focus-visible .avpl-asiento__base { stroke: #F29A1F; stroke-width: 2.5; }
.avpl[data-tema="oscuro"] .avpl-asiento__resp { fill: #24415F; }
.avpl-cc line { stroke: #E5484D; stroke-width: 2.2; stroke-dasharray: 6 3; }
.avpl-cc path { fill: #E5484D; stroke: #fff; stroke-width: 1.2; }
.avpl-cc text { fill: #C62F34; font: 800 12.5px Inter, sans-serif; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.avpl-cc.is-sin line { stroke: #E5484D; opacity: .4; }
.avpl-cc.is-sin path { fill: #F4A3A5; }
.avpl-cc-txt { margin: .7rem 0 .2rem; font-size: 13.5px; }
.avpl-cc-ico, .avpl-carga__leyenda .is-cc { display: inline-block; width: 10px; height: 10px; margin-right: .35rem; background: #E5484D; clip-path: polygon(0 0, 100% 0, 50% 100%); border: 0 !important; vertical-align: 0; }
.avpl-carga__leyenda .is-ocupado { background: #0875D1 !important; border-color: #05539A !important; }
.avpl-carga__leyenda .is-premium { background: #F2B53A !important; border-color: #B87A0A !important; }
.avpl-carga__leyenda .is-libre { background: var(--panel); border-color: #8FA6BF; }
.avpl-carga__leyenda .is-comb { background: linear-gradient(180deg, #7FD6FF, #0875D1) !important; border-color: #0875D1 !important; }
.avpl-carga__leyenda .is-bod { background: linear-gradient(180deg, #FFD27A, #E08A12) !important; border-color: #C87A10 !important; }
.avpl-avion--gen { max-height: 560px; }
.avpl-avion--gen .avpl-av-txt { font-size: 21px; stroke-width: 5px; }
.avpl-avion--gen .avpl-cc text { font-size: 20px; stroke-width: 5px; }
.avpl-avion--gen .avpl-cc line { stroke-width: 3.5; }
.avpl-avion--lat .avpl-av-txt { font-size: 14px; }

/* Tu simulador (integración con las fichas) */
.avpl-sim { display: inline-flex; align-items: center; gap: .4rem; font: 700 12.5px Inter, sans-serif; color: var(--suave); }
.avpl-sim select { min-height: 36px; padding: 0 8px; border: 1px solid var(--campo-borde); border-radius: 10px; background: var(--campo); color: var(--texto); font: 600 13.5px Inter, sans-serif; }
.avpl-sim-info { margin: 0 0 .7rem; padding: .7rem .9rem; border-radius: 12px; background: var(--resalte); border: 1px solid var(--borde); font-size: 13.5px; }
.avpl-sim-info p { margin: .2rem 0; }
.avpl-sim-info ul { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.avpl-sim-info a { color: var(--azul); font-weight: 600; }
.avpl-sim-info__t { font-weight: 800; }
.avpl-sim-info__lim { color: var(--suave); font-size: 12.5px; }
[data-avpl-exp].is-compat { border-color: #1D9E75 !important; box-shadow: 0 0 0 2px rgba(29, 158, 117, .25); }
[data-avpl-exp].is-compat::after { content: "Tu simulador"; display: block; margin-top: 2px; font: 800 10.5px Inter, sans-serif; letter-spacing: .04em; color: #0B5D3B; text-transform: uppercase; }
[data-avpl-exp].is-otro { opacity: .55; }
