/* Shared card skin: Show, planning and TV. Load chrome stays outside this boundary. */
:is(.drozap-private-ui, .manifest-display) .mc-group {
    --mc-person-size: 1rem; --mc-tint: #fff; --mc-accent: #64748b; --mc-border: #d8dee8;
    display: flex !important; flex-direction: column !important; gap: 0 !important;
    padding: 0 !important; margin: 0 !important; min-width: 0; width: 100%;
    background: #fff !important; border: 1px solid #d8dee8 !important; border-radius: 10px !important;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px !important;
    container-type: inline-size;
}
.mc-group[data-mc-kind="tandem"] { --mc-tint: #dce9f4; --mc-header: linear-gradient(115deg, #c6dced 0%, #dce9f4 55%, #edf3f8 100%); --mc-accent: #365e7e; --mc-border: #b4cadd; }
.mc-group[data-mc-kind="aff"] { --mc-tint: #deecdf; --mc-header: linear-gradient(115deg, #cce1cf 0%, #deecdf 55%, #eef4ef 100%); --mc-accent: #42664d; --mc-border: #b8cfbd; }
.mc-group[data-mc-kind="coach"] { --mc-tint: #eee1d1; --mc-header: linear-gradient(115deg, #dfc8ac 0%, #eee1d1 55%, #f6f0e8 100%); --mc-accent: #795737; --mc-border: #d4bfa7; }
:is(.drozap-private-ui, .manifest-display) .mc-group > .mc-row {
    position: relative; display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "name actions" "equipment lower" "extra extra" !important;
    align-items: center !important; gap: 2px 6px !important; min-width: 0; min-height: 0 !important;
    width: 100% !important; padding: 4px 6px !important; margin: 0 !important;
    background: #fff !important; border: 0 !important; border-radius: 0 !important;
    color: #1a2035; font-size: .82rem; line-height: 1.2;
}
:is(.drozap-private-ui, .manifest-display) .mc-group > .mc-primary { background: var(--mc-header, var(--mc-tint)) !important; border-color: var(--mc-border) !important; }
:is(.drozap-private-ui, .manifest-display) .mc-group > .mc-has-avatar { grid-template-columns: 42px minmax(0,1fr) auto !important; grid-template-areas: "avatar name actions" "avatar equipment lower" "extra extra extra" !important; }
.mc-avatar { grid-area: avatar; align-self: start; width: 42px; height: 42px; }
.mc-face { position: relative; display: block; width: 42px; height: 42px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-avatar :is(img,.manifest-person-avatar,.mc-initials) {
    position: absolute; inset: 0; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; margin: 0;
}
.mc-initials { display: flex; align-items: center; justify-content: center; background: #e8edf5; color: #334155; font-size: 14px; font-weight: 600; }
.mc-avatar [hidden] { display: none !important; }
.mc-name { grid-area: name; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-name :is(.manifest-card-title,.manifest-crew-name,.manifest-tandem-title-stack,.manifest-tandem-title-top,.manifest-person) {
    display: inline-flex; align-items: center; gap: 5px; width: auto; min-height: 0; margin: 0; padding: 0; flex-direction: row; font-size: inherit;
}
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-name :is(a,.manifest-person-name,.manifest-tandem-passenger-name,.manifest-tandem-passenger-title) { color: #1a2035 !important; font-size: inherit; line-height: 1.2; letter-spacing: normal; }
.mc-name strong { font-weight: 700; }
.mc-name .mc-icon, .mc-name .manifest-discipline-icon { color: var(--mc-accent); flex: 0 0 28px; width: 28px; height: 28px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions { grid-area: actions; display: flex; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions :is(.manifest-card-actions,.manifest-crew-actions,.manifest-aff-header-actions,.compact-actions) { position: static; display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; width: auto; min-width: 0; max-width: 100%; margin: 0; padding: 0; }
.mc-equipment { grid-area: equipment; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.mc-equipment:last-child { grid-column-end: -1; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(.manifest-crew-rig-inline,.manifest-aff-equipment-row) { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; width: 100%; margin: 0; padding: 0; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(.manifest-rig-badge,.mc-rig) { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #d6deed; border-radius: 999px; padding: 2px 6px; background: #fff; color: #1a2035; font-size: .68rem; line-height: 1.15; width: auto; max-width: 100%; white-space: normal; text-align: left; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(.manifest-rig-badge,.mc-rig) img { width: 14px; height: 14px; flex: 0 0 14px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(.manifest-rig-badge--pending,.mc-rig-pending) { color: #9f2430; border-color: #f0c9cd; background: #fff7f8; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(.manifest-rig-badge--pending,.mc-rig-pending) img { filter: invert(24%) sepia(77%) saturate(2187%) hue-rotate(331deg) brightness(87%) contrast(94%); }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(button.manifest-crew-rig.is-pending,.manifest-rig-pick) { width: auto; height: auto; min-width: 0 !important; min-height: 0 !important; padding: 0; border: 0; background: transparent; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment .manifest-crew-rig::after { display: none; }
.mc-equipment b { font-weight: 700; }
.mc-lower-actions { grid-area: lower; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.mc-extra { grid-area: extra; font-size: .72rem; }
.mc-row > :is(.mc-actions,.mc-equipment,.mc-lower-actions,.mc-extra):empty { display: none !important; }
.mc-row:not(:has(> .mc-lower-actions > *)) > .mc-equipment { grid-column-end: -1; }
.mc-group .mc-icon { width: 20px; height: 20px; fill: currentColor; }
.mc-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 6px; background: #fff; color: var(--mc-accent); font-size: .68rem; font-weight: 700; }
.mc-license { background: #fa5364; color: #fff; margin-left: auto; white-space: nowrap; }
:is(.drozap-private-ui, .manifest-display) .mc-group :is(.manifest-license-inline,.manifest-aff-header-status) { margin-left: auto; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions :is(.app-action-btn--icon,.mq-act) { height: 30px; width: 30px; min-height: 30px !important; min-width: 30px !important; padding: 0; }
:is(.drozap-private-ui, .manifest-display) .mc-group .manifest-discipline-toggle { height: 30px; min-height: 30px !important; padding: 0 7px; }
@container (max-width: 360px) {
    :is(.drozap-private-ui, .manifest-display) .mc-group > .mc-row { grid-template-areas: "name name" "equipment equipment" "actions lower" "extra extra" !important; }
    :is(.drozap-private-ui, .manifest-display) .mc-group > .mc-has-avatar { grid-template-areas: "avatar name name" "avatar equipment equipment" "actions actions lower" "extra extra extra" !important; }
}

/* The adapters retain legacy hook classes, but they never set staff-card geometry. */
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-name { font-size: var(--mc-person-size); letter-spacing: normal; font-weight: 400; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment .mc-rig { display: inline-block; font-size: .68rem; letter-spacing: normal; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment .mc-rig img { vertical-align: middle; margin-right: 4px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions .app-action-btn.app-action-btn--icon { width: 30px !important; height: 30px !important; min-width: 30px !important; min-height: 30px !important; border-radius: 8px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions .app-action-btn.app-action-btn--icon i { font-size: 13px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions .manifest-aff-phase-placement { position: static; margin: 0; }

:is(.drozap-private-ui, .manifest-display) .mc-group .mc-actions :is(.manifest-tandem-service-badge,.manifest-course-phase-badge,.mc-badge:not(.mc-discipline)) { font-size: .68rem; line-height: 1.2; padding: 3px 6px; border: 0; border-radius: 999px; background: #fff; color: var(--mc-accent); box-shadow: none; font-weight: 700; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-discipline { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 7px; border: 1px solid #d6deed; border-radius: 8px; background: #edf2f7; color: #334155; font-size: .75rem; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment .manifest-rig-badge { display: inline-block; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment .manifest-rig-badge img { vertical-align: middle; margin-right: 4px; }
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-equipment :is(.badge-danger,.mc-license) { font-size: .68rem; line-height: 1.2; padding: 3px 6px; border-radius: 999px; background: #fa5364; color: #fff; letter-spacing: normal; }

/* Every person's name uses the same scale, independent of legacy header/crew rules. */
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-name :is(.mc-person, .manifest-person-name, .manifest-crew-name, .manifest-tandem-passenger-title > span) {
    font-size: var(--mc-person-size) !important;
    line-height: 1.2;
    letter-spacing: normal;
}
:is(.drozap-private-ui, .manifest-display) .mc-group .mc-name :is(.mc-person, .manifest-person-name) strong { font-size: inherit; }

/* The flatter AFF/coaching silhouettes need more area to match the tandem icon visually. */
:is(.drozap-private-ui, .manifest-display) .mc-group:is([data-mc-kind="aff"], [data-mc-kind="coach"]) > .mc-primary .mc-name :is(.mc-icon, .manifest-discipline-icon) {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}

/* Boarding sidebar uses the same identity and primary row as pending planning cards. */
#embarkableSideCard :is([data-tab-pane="reservas"], [data-tab-pane="alumnos"]) .embarkable-list { display: flex; flex-direction: column; gap: 8px; }
:is(.drozap-private-ui, .manifest-display) #embarkableSideCard .mc-group > .manifest-pending-row {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "name" "actions" "extra" !important;
    padding: 6px !important;
}
:is(.drozap-private-ui, .manifest-display) #embarkableSideCard .mc-group > .manifest-pending-row.mc-has-avatar {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    grid-template-areas: "avatar name" "avatar actions" "extra extra" !important;
}
#embarkableSideCard .manifest-pending-row :is(.mc-avatar, .mc-face, .mc-avatar img, .mc-initials) { width: 36px; height: 36px; }
#embarkableSideCard .manifest-pending-row .mc-actions { justify-content: flex-start; min-width: 0; }
.manifest-pending-actions, .manifest-pending-services, .manifest-pending-finance { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.manifest-pending-actions { width: 100%; }
.manifest-pending-finance { margin-left: auto; }
#embarkableSideCard .manifest-pending-service { white-space: normal; overflow-wrap: anywhere; }
.manifest-pending-paid { font-size: .72rem; color: #42664d; font-weight: 700; }
.manifest-pending-reference { font-size: .65rem; color: #64748b; }

/* Puesto del salto superpuesto al avatar; sin columna extra. */
.mc-avatar { position: relative; }
:is(.mc-staff-role,.mc-fun-role) { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: #ffe28a; color: #795000; font-size: 12px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.mc-avatar > :is(.mc-staff-role,.mc-fun-role) { position: absolute; left: -3px; bottom: -3px; z-index: 2; }

/* Un contorno por grupo; separadores rectos entre alumno y puestos. */
:is(.drozap-private-ui, .manifest-display) .mc-group > .mc-row + .mc-row { border-top: 1px solid #e2e8f0 !important; }
:is(.drozap-private-ui, .manifest-display) .mc-group > .mc-row:first-child { border-top-left-radius: 9px !important; border-top-right-radius: 9px !important; }
:is(.drozap-private-ui, .manifest-display) .mc-group > .mc-row:last-child { border-bottom-left-radius: 9px !important; border-bottom-right-radius: 9px !important; }
:is(.drozap-private-ui, .manifest-display) .manifest-list-column,
:is(.drozap-private-ui, .manifest-display) .manifest-jumpers:has(> .mc-group) { row-gap: 14px !important; }

/* Último embarque: solo luz en el contorno, sin transformar ni desplazar la tarjeta. */
:is(.drozap-private-ui, .manifest-display) .mc-group.mc-just-boarded { position: relative; }
.mc-group.mc-just-boarded::after { content: ""; position: absolute; inset: 0; z-index: 3; border: 2px solid #2684ff; border-radius: inherit; pointer-events: none; box-shadow: 0 0 5px #2684ff, 0 0 12px rgba(38,132,255,.5), inset 0 0 5px rgba(38,132,255,.3); animation: mc-boarding-glow 1.4s ease-in-out infinite alternate; }
@keyframes mc-boarding-glow { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mc-group.mc-just-boarded::after { animation: none; } }

/* Mismo hueco de inserción que Plan del día; el grupo siempre viaja entero. */
.manifest-order-slot { flex: none; box-sizing: border-box; width: 100%; border: 2px dashed #2f6fd6; border-radius: 7px; background: rgba(47,111,214,.08); transition: height .1s; display: flex; align-items: center; justify-content: center; padding: 8px; color: #365e7e; font-size: .85rem; pointer-events: none; }
.manifest-list-column > .mc-group[draggable="true"] { cursor: grab; }
.manifest-list-column > .mc-group.is-dragging { opacity: .35; }
.manifest-order-slot.is-saving { border-style: solid; }
@media (prefers-reduced-motion: reduce) { .manifest-order-slot { transition: none; } }

/* FUN shares the avatar overlay position with instructor/camera roles. */
.mc-fun-role { width: auto; min-width: 29px; height: 19px; padding: 0 4px; border-radius: 6px; background: #155acb; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .2px; }
.manifest-discipline-toggle .manifest-discipline-icon:has(use[href$="#jump-fun"]),
.mc-discipline .mc-icon:has(use[href$="#jump-fun"]) { display: none; }

/* Coverage/document action: icon only, with an accessible label. */
:is(.drozap-private-ui, .manifest-display) .manifest-license-alert {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 16px; width: 16px; height: 16px; min-width: 16px; padding: 0 !important;
    margin-left: auto; border: 1px solid #f6a6ae; border-radius: 50% !important;
    background: #fff0f2 !important; color: #bf263c !important; font-size: 9px !important;
    cursor: pointer; vertical-align: middle;
}
.manifest-license-alert .mc-license-cross { position:absolute; font-size:4px; color:#fff; top:5px; left:6px; }
.manifest-license-alert:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
@media (pointer:coarse) { .drozap-private-ui .manifest-license-alert::after { content: ''; position: absolute; inset: -14px; } }
.drozap-private-ui .mc-group[data-mc-kind="fun"] .mc-equipment { grid-column-end: -1 !important; width: 100%; }
.drozap-private-ui .mc-group[data-mc-kind="fun"] .mc-equipment :is(.manifest-license-inline, .manifest-license-alert) { margin-inline-start: auto !important; }
.drozap-private-ui .mc-group[data-mc-kind="fun"] .mc-equipment .manifest-crew-rig-inline { width: 100% !important; }
.mq-license-form { display:grid; gap:10px; }
.mq-license-form label { display:block; margin:0; font-size:.85rem; font-weight:600; }
.mq-license-form .form-control { margin-top:4px; }
.mq-license-dates { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.mq-license-form input[type=file] { width:100%; margin-top:5px; }

/* Primary identities keep the available width; service sits below the passenger. */
.drozap-private-ui .mc-group > .mc-primary .mc-name :is(.mc-icon, .manifest-discipline-icon) { display: none !important; }
.drozap-private-ui .mc-group > .mc-primary .mc-name-with-service { flex-direction: column; align-items: flex-start; gap: 3px; }
.drozap-private-ui .mc-service-subtitle { display: flex; min-width: 0; max-width: 100%; }
.drozap-private-ui .mc-service-subtitle :is(.mc-badge, .manifest-tandem-service-badge) { font-size: .68rem; line-height: 1.2; padding: 3px 6px; border: 0; border-radius: 999px; background: #fff; color: var(--mc-accent); box-shadow: none; font-weight: 700; white-space: normal; }
