:root{
  --ink:#0b1220; --line:#e6e6e6; --muted:#6b7280;
  --phase-ground:#9ca3af; --phase-enroute:#2563eb; --phase-arrival:#f59e0b; --phase-done:#16a34a; --phase-unknown:#94a3b8;
  --sum-minh:48px; --sum-vpad:8px; --sum-hpad:16px; --fs-call:18px; --fs-route:14px; --gap:10px;
  --rail-h:6px; --plane-size:20px; --plane-dy:0px; --plane-color:#0b2545; --po-sec-title:20px;
}

.mvd-po{ max-width:900px; margin:0 auto; font-family:'Overpass',sans-serif; color:var(--ink); }
.mvd-po .mvd-po-accordion{ display:flex; flex-direction:column; gap:14px; }
.mvd-po details{ border:1px solid var(--line); border-radius:10px; background:#fff; overflow:hidden; transition:box-shadow .2s ease; }
.mvd-po details[open]{ box-shadow:0 2px 18px rgba(0,0,0,.06); }
.mvd-po summary{ cursor:pointer; list-style:none; display:flex; align-items:center; gap:var(--gap); padding:var(--sum-vpad) var(--sum-hpad); min-height:var(--sum-minh); user-select:none; }
.mvd-po summary::-webkit-details-marker{ display:none; }
.mvd-po .po-callsign{ font-size:var(--fs-call); font-weight:700; line-height:1; letter-spacing:.2px; white-space:nowrap; }
.mvd-po .po-route{ display:flex; align-items:center; gap:8px; font-size:var(--fs-route); color:var(--muted); white-space:nowrap; }
.mvd-po .po-route i{ font-size:calc(var(--fs-route) - 1px); opacity:.85; }
.mvd-po .po-code{ font-weight:700; letter-spacing:.2px; }
.mvd-po .po-body{ padding:12px var(--sum-hpad) 16px; }
.mvd-po .po-grid{ display:grid; grid-template-columns:150px 1fr; gap:8px 14px; font-size:15px; }
.mvd-po .po-airline-logo{ width:200px; height:50px; object-fit:contain; object-position:center; display:block; background:transparent; content-visibility:auto; }
.mvd-po .po-summary-logo{ height:var(--sum-logo-h,20px); width:auto; object-fit:contain; display:block; }
.mvd-po .po-state-line{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.mvd-po .po-phase-badge{ display:inline-flex; align-items:center; justify-content:center; padding:2px 10px; border-radius:999px; font-weight:700; font-size:12px; letter-spacing:.2px; color:#fff; background:var(--phase-unknown); min-width:110px; text-align:center; }
.mvd-po .po-flagwrap{ display:inline-flex; align-items:center; gap:6px; }
.mvd-po .po-flag{ height:14px; width:auto; display:inline-block; border-radius:2px; box-shadow:0 0 0 1px rgba(0,0,0,.08); }
.mvd-po .po-cmd-link, .mvd-po .po-cmd-link:hover, .mvd-po .po-cmd-link:active, .mvd-po .po-cmd-link:focus, .mvd-po .po-cmd-link:visited{ color:#0066cc; text-decoration:none !important; border-bottom:0 !important; box-shadow:none !important; }
.mvd-po .po-cmd-link:focus, .mvd-po .po-cmd-link:focus-visible{ outline:none !important; }

.mvd-po .po-summary-logo,
.mvd-po .po-sum-operator{
  opacity:1;
  transform:scale(1);
  transition:opacity .30s ease, transform .30s ease;
  will-change:opacity, transform;
}
.mvd-po .po-summary-logo.is-hidden,
.mvd-po .po-sum-operator.is-hidden{
  opacity:0;
  transform:scale(.96);
}
.mvd-po .po-body{
  overflow:hidden;
  max-height:0;
  opacity:0;
  transform:translateY(-4px);
  transition:max-height .30s ease, opacity .30s ease, transform .30s ease, padding-top .30s ease, padding-bottom .30s ease;
  will-change:max-height, opacity, transform;
}
.mvd-po details.po-open .po-body{
  opacity:1;
  transform:translateY(0);
}
.mvd-po .po-prog-wrap{ display:flex; flex-direction:column; gap:6px; }
.mvd-po .po-progress{ position:relative; width:100%; height:var(--rail-h); background:#eceff3; border-radius:999px; overflow:visible; }
.mvd-po .po-progress-fill{ position:absolute; left:0; top:0; height:100%; width:0%; background:var(--phase-unknown); border-radius:999px; transition:width .25s ease, background-color .2s ease; }
.mvd-po .po-plane{ position:absolute; width:var(--plane-size); height:var(--plane-size); left:var(--plane-x,2.5%); top:calc(50% + var(--plane-dy)); transform:translate(-50%, -50%); transform-origin:center center; z-index:2; pointer-events:none; display:block; background-color:var(--plane-color); -webkit-mask-repeat:no-repeat; -webkit-mask-position:center; -webkit-mask-size:contain; mask-repeat:no-repeat; mask-position:center; mask-size:contain; filter:drop-shadow(0 1px 0 rgba(0,0,0,.05)); }
.mvd-po .po-prog-text{ font-size:13px; color:#555; }
.mvd-po.phase-final .po-progress-fill, .mvd-po .phase-final .po-progress-fill{ animation:poPulse 1.8s ease-in-out infinite; }
@keyframes poPulse{ 0%,100%{ filter:brightness(1); } 50%{ filter:brightness(1.15); } }
.mvd-po .po-grid > :nth-child(1), .mvd-po .po-grid > :nth-child(2){ display:flex; align-items:center; min-height:50px; }

@media (max-width:640px){
  :root{ --sum-minh:44px; --fs-call:16px; --fs-route:13px; --po-sec-title:16px; }
  .mvd-po .po-airline-logo{ width:150px; height:38px; }
  .mvd-po .po-grid{ grid-template-columns:120px 1fr; font-size:14px; }
}
@media (max-width:420px){
  :root{ --sum-minh:42px; --fs-call:15px; --fs-route:12.5px; --po-sec-title:15px; }
  .mvd-po .po-airline-logo{ width:130px; height:32px; }
  .mvd-po .po-grid{ grid-template-columns:105px 1fr; font-size:13px; }
}

.mvd-po .mvd-po-sec-card{
  border:1px solid var(--line,#e6e6e6);
  border-radius:12px;
  padding:10px 12px;
  background:
    radial-gradient(900px 160px at 0% 0%, rgba(43,88,125,0.06), transparent 60%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow:0 2px 12px rgba(0,0,0,.05);
}
.mvd-po .mvd-po-sec-title{
  display:flex; align-items:center; gap:10px;
  margin:4px 2px 10px; font-weight:800; letter-spacing:.2px;
  color:#0f172a; font-size:var(--po-sec-title,18px);
}
.mvd-po .mvd-po-sec-title .count{
  margin-left:auto; color:var(--muted,#6b7280);
  font-weight:600; font-size:12px; display:inline-flex; align-items:center; gap:6px;
}
.mvd-po .mvd-po-sec-list{ display:flex; flex-direction:column; gap:10px; }
.mvd-po .mvd-po-sec-empty{ color:var(--muted,#6b7280); font-size:14px; padding:8px 2px; }

.mvd-po .po-remarks-box{
  line-height:1.45;
  max-height:calc(1.45em * 3);
  overflow:auto;
  padding-right:6px;
  scrollbar-width:thin;
  scrollbar-color:rgba(0,0,0,.28) transparent;
}
.mvd-po .po-remarks-box::-webkit-scrollbar{ width:6px; height:6px; }
.mvd-po .po-remarks-box::-webkit-scrollbar-track{ background:transparent; }
.mvd-po .po-remarks-box::-webkit-scrollbar-thumb{ background-color:rgba(0,0,0,.28); border-radius:999px; }
.mvd-po .po-remarks-box:hover::-webkit-scrollbar-thumb{ background-color:rgba(0,0,0,.38); }

.mvd-po .po-operator-cell{ display:flex; justify-content:flex-start; align-items:center; }
.mvd-po .po-operator-flag{
  height: var(--flag-h, 56px);
  width: calc(var(--flag-h, 56px) * 2);
  aspect-ratio:2/1; display:block; overflow:hidden; border-radius:8px;
  background:#fff; border:1px solid #e5e7eb; image-rendering:auto;
}
.mvd-po .po-operator-flag.contain{ object-fit:contain; object-position:center; }
.mvd-po .po-operator-flag.cover{ object-fit:cover; }
.mvd-po .flag-focus-center{ object-position:center center; }
.mvd-po .flag-focus-left-top{ object-position:left top; }
.mvd-po .flag-focus-left-center{ object-position:left center; }
.mvd-po .flag-focus-right-center{ object-position:right center; }
.mvd-po .po-sum-operator{
  height: var(--sum-pill-h, 18px);
  width: calc(var(--sum-pill-h, 18px) * 2);
  aspect-ratio:2/1; display:block; overflow:hidden; border-radius:6px;
  background:#fff; border:1px solid #e5e7eb;
}
.mvd-po .po-sum-operator.contain{ object-fit:contain; object-position:center; }
.mvd-po .po-sum-operator.cover{ object-fit:cover; }
.mvd-po .po-offline{ opacity:.7; filter:grayscale(.35); }
.mvd-po .mvd-po-empty{ font-family:'Overpass',sans-serif; text-align:center; margin-top:20px; font-size:18px; color:#666; }
.mvd-po .mvd-po-error{ margin-top:10px; color:#b00020; font-size:14px; text-align:center; font-family:'Overpass',sans-serif; }

.mvd-po[data-booted="0"] .mvd-po-sec-card[data-optional="1"]{ display:none !important; }


.mvd-po[data-booted="0"] .mvd-po-sec-card[data-section="transit"],
.mvd-po[data-booted="0"] .mvd-po-sec-card[data-section="transito"],
.mvd-po[data-booted="0"] .mvd-po-sec-card[data-section="en_transito"]{ display:none !important; }

.mvd-po[data-loading="1"] .mvd-po-sec-card[data-section="transit"],
.mvd-po[data-loading="1"] .mvd-po-sec-card[data-section="local"],
.mvd-po[data-loading="1"] .mvd-po-sec-card[data-section="done"]{ display:none !important; }

/* Limpieza dura de markup legacy de tránsito */
#po-accordion-transit, #po-transit-panel, #po-transit-list{display:none !important;}




/* Suavizado de bloques principales */
.mvd-po .mvd-po-sec-card{
  opacity:1;
  transform:translateY(0);
  transition:opacity .30s ease, transform .30s ease, box-shadow .30s ease;
  will-change:opacity, transform;
}
.mvd-po .mvd-po-sec-card.po-sec-enter{
  opacity:0;
  transform:translateY(8px);
}
.mvd-po .mvd-po-sec-card.po-sec-leave{
  opacity:0;
  transform:translateY(-6px);
  pointer-events:none;
}

/* Suavizado de aparición/desaparición de tarjetas */
.mvd-po details{
  opacity:1;
  transform:translateY(0);
  transition:opacity .30s ease, transform .30s ease, box-shadow .30s ease;
  will-change:opacity, transform;
}
.mvd-po details.po-enter{
  opacity:0;
  transform:translateY(8px);
}
.mvd-po details.po-leave{
  opacity:0;
  transform:translateY(-6px);
  pointer-events:none;
}
