/* ==========================================================================
   PLUSA · PLUSA INSTALADA (Pirámide CSS: va encima de web.css y solo la carga el lanzador)
   0. Pantalla de app · 1. Una pantalla cada vez · 2. Franja negra · 3. Primera vez · 4. Fichas a todo color
   5. «Añadir apps» y filas · 6. El panel del «+» · 7. «Más» · 8. Barra oscura
   ========================================================================== */

/* 0. Plusa instalada (/nire-aplikazioak): franja negra de Plusa arriba y el papel del portal debajo. La primera vez,
   arranque en dos pasos; «Tus apps» en fichas a todo color (como las redes de Bide+) o en lista, con «Editar»;
   «Más» en filas planas; el «+» abre tus atajos en un panel. Barra oscura abajo (columna en escritorio), como el portal */
.app-shell {
    background-color: var(--color-paper);
    color: var(--color-text);
}

.app-shell .lang-offer { bottom: calc(84px + env(safe-area-inset-bottom)); }

.launcher {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

/* 1. La pantalla la decide app-launcher.js; si no llega, a los 1,5 s se leen todas seguidas */
.launcher[data-pending] {
    opacity: 0;
    animation: launcher-reveal 0s linear 1.5s forwards;
}

@keyframes launcher-reveal {
    to { opacity: 1; }
}

.launcher [hidden] { display: none; }

/* Al entrar desde el arranque, la pantalla aparece con un deslizamiento corto */
.launcher.is-entering .launcher-screen:not([hidden]) { animation: launcher-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes launcher-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* Los títulos reciben el foco al cambiar de pantalla (lo anuncia el lector) sin ser controles */
.launcher h2:focus { outline: none; }

.launcher-wrap {
    width: 100%;
    max-width: 592px;
    margin: 0 auto;
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
}

.launcher-body { padding-top: 24px; }

/* 2. La franja negra: la marca con solo las piezas de tus apps encendidas, o el título de la pantalla */
.launcher-band {
    padding: max(24px, env(safe-area-inset-top)) 0 24px;
    background-color: var(--color-ink);
    color: var(--color-white);
}

.launcher-title { font-size: var(--text-figure); }

.launcher-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.launcher-brand p {
    font-size: var(--text-sm);
    color: var(--color-text-on-dark-muted);
}

.launcher-brand .launcher-title { margin-top: 18px; }

[data-launcher-mark] .plusa-piece { transition: fill 0.3s ease; }
[data-launcher-mark] .plusa-piece.is-off { fill: var(--color-piece-off); }

.launcher-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.launcher-subtitle {
    font-size: var(--text-xl);
    letter-spacing: var(--tracking-heading);
}

.launcher-lead,
.launcher-note {
    margin-bottom: 20px;
    font-size: var(--text-md);
    line-height: var(--leading-body);
    color: var(--color-text-muted);
}

.launcher-head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Fichas o lista: dos botones de icono en una caja de esquinas suaves, el activo en un cuadradito relleno (como Bide+) */
.launcher-views {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--color-line);
    border-radius: calc(var(--radius-lg) + 4px);
    background-color: var(--color-white);
}

.launcher-views button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tap-min);
    height: calc(var(--tap-min) - 4px);
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background-color: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.launcher-views svg { width: 20px; height: 20px; }

.launcher-views button[aria-pressed="true"] {
    background-color: var(--color-ink);
    color: var(--color-white);
}

/* «Editar», que pasa a «Listo» mientras se edita */
.launcher-pill {
    min-height: var(--tap-min);
    padding: 0 18px;
    border: 1px solid var(--color-text-muted);
    border-radius: var(--radius-round);
    background-color: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
}

.launcher-pill[aria-pressed="true"] {
    border-color: var(--color-ink);
    background-color: var(--color-ink);
    color: var(--color-white);
}

/* Botones de pie de pantalla: el principal en tinta y el secundario como texto */
.launcher-primary {
    min-height: var(--control-height);
    padding: 0 28px;
    border: 0;
    border-radius: var(--radius-round);
    background-color: var(--color-ink);
    color: var(--color-white);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.launcher-primary:disabled {
    background-color: var(--color-line);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.launcher-secondary {
    min-height: var(--tap-min);
    padding: 0 20px;
    border: 0;
    background-color: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

/* 3. La primera vez: iconos grandes para elegir apps y fichas de atajos que se rellenan del color de cada atajo */
.launcher-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.launcher-dots > span[aria-hidden] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-piece-off);
}

.launcher-dots > span.is-on { background-color: var(--color-white); }

.launcher-pick {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.launcher-pick > li { flex: 0 0 33.333%; min-width: 0; }

.launcher-pick-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: var(--tap-min);
    padding: 10px 4px;
    border: 0;
    border-radius: var(--radius-lg);
    background-color: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.launcher-pick-icon {
    position: relative;
    display: flex;
    border-radius: 22.6%;
    transition: box-shadow 0.15s ease;
}

.launcher-pick-icon.is-soon > svg { opacity: 0.6; }

.launcher-pick-app[aria-pressed="true"] .launcher-pick-icon { box-shadow: 0 0 0 3px var(--color-paper), 0 0 0 5px var(--color-ink); }

.launcher-pick-name {
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: var(--leading-ui);
}

.launcher-check {
    position: absolute;
    top: -8px;
    right: -8px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--color-ink);
    color: var(--color-white);
    box-shadow: 0 0 0 2px var(--color-paper);
}

.launcher-check svg { width: 14px; height: 14px; }
.launcher-pick-app[aria-pressed="true"] .launcher-check { display: flex; }

.launcher-group + .launcher-group { margin-top: 24px; }

.launcher-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: 0;
}

.launcher-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Atajos del arranque: fichas cuadradas, tres por fila (cinco en escritorio), icono arriba y nombre debajo; sin color
   hasta que se eligen */
.launcher-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.launcher-picks > li { display: flex; flex: 0 0 calc((100% - 16px) / 3); min-width: 0; }

.launcher-pickcut {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    aspect-ratio: 1;
    padding: 10px 6px;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background-color: var(--color-white);
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: var(--leading-ui);
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.launcher-pickcut:active { transform: scale(0.97); }

.launcher-pickcut[aria-pressed="true"] {
    border-color: var(--accent, var(--color-ink));
    background-color: var(--accent, var(--color-ink));
    color: var(--color-white);
}

.launcher-pickcut[aria-pressed="true"].launcher-tone--light { color: var(--color-ink); }

/* Su icono tal cual, con las esquinas de las fichas de Bide+ */
.launcher-pickcut-icon { display: flex; flex-shrink: 0; }
.launcher-pickcut-icon img,
.launcher-pickcut-icon svg { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }

/* Dos líneas como mucho */
.launcher-pickcut-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow-wrap: anywhere;
}

/* La ✓ de la esquina: un círculo del color del texto con la marca del color del atajo */
.launcher-pickcut-check {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: currentColor;
}

.launcher-pickcut-check svg { width: 12px; height: 12px; color: var(--accent, var(--color-ink)); }
.launcher-pickcut[aria-pressed="true"] .launcher-pickcut-check { display: flex; }

/* «Ver los N restantes» / «Ver menos» */
.launcher-more {
    min-height: var(--tap-min);
    margin-top: 4px;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

@media (min-width: 720px) {
    .launcher-picks > li { flex-basis: calc((100% - 32px) / 5); }
}

.launcher-chips--stack { flex-direction: column; }

.launcher-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 2px solid var(--accent, var(--color-ink));
    border-radius: var(--radius-round);
    background-color: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.launcher-chip.is-filled {
    background-color: var(--accent, var(--color-ink));
    color: var(--color-white);
}

.launcher-chip.is-filled.launcher-tone--light { color: var(--color-ink); }

/* El icono del atajo (su red, su función) tal cual sobre el color, sin placa, con las esquinas de las fichas de Bide+
   (16 px en 56) */
.launcher-chip-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    object-fit: cover;
}

/* «Empezar» / «Siguiente» siempre a mano, abajo: barra pegajosa en el flujo (al final del todo queda debajo de la
   última fila, que nunca tapa) con fondo de papel y un filo */
.launcher-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right)));
    margin-left: calc(-1 * max(16px, env(safe-area-inset-left)));
    padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-top: 1px solid var(--color-line);
    background-color: var(--color-paper);
}

/* En el paso 1 la lista es corta y la barra queda debajo, sin filo */
[data-welcome-step="1"]:not([hidden]) ~ .launcher-actions { border-top-color: transparent; }

.launcher-actions .launcher-primary { width: 100%; max-width: 360px; }

.launcher[data-screen="inicio"] { padding-bottom: 0; }
.launcher[data-screen="inicio"] .launcher-tabs { display: none; }

/* 4. Fichas a todo color: nombre grande, su frase y el símbolo de la app de marca de agua */
.launcher-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.launcher-tiles > li {
    position: relative;
    display: flex;
    flex: 0 0 calc((100% - 12px) / 2);
    min-width: 0;
}

.launcher-tile {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    min-height: 168px;
    padding: 16px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 24px;
    background-color: var(--accent, var(--color-ink));
    color: var(--color-white);
    transition: transform 0.12s ease;
}

.launcher-tile:active { transform: scale(0.98); }
.launcher-tone--light { color: var(--color-ink); }

.launcher-tile-icon { display: flex; }

/* Marca de agua: solo el símbolo, algo más claro que el fondo (más oscuro en las fichas claras) y recortado por el borde */
.launcher-tile-mark {
    position: absolute;
    right: -52px;
    bottom: -58px;
    z-index: -1;
    display: flex;
    color: var(--color-white);
    opacity: 0.16;
    pointer-events: none;
}

.launcher-tone--light .launcher-tile-mark { color: var(--color-ink); opacity: 0.14; }

.launcher-tile-go {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

.launcher-tile-soon {
    position: absolute;
    top: 18px;
    right: 16px;
    font-size: var(--text-xs);
    font-weight: 700;
}

/* Las de próximamente, atenuadas */
.launcher-tile.is-soon .launcher-tile-icon { opacity: 0.6; }
.launcher-tile.is-soon .launcher-tile-text { opacity: 0.8; }
.launcher-tile.is-soon .launcher-tile-mark { opacity: 0.1; }

.launcher-tile-text strong {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: var(--leading-heading);
    letter-spacing: var(--tracking-heading);
}

.launcher-tile-text > span {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    font-size: var(--text-sm);
    line-height: var(--leading-ui);
    opacity: 0.9;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Botones de editar (fichas de apps y de atajos): ✕ para quitar y flechas para ordenar */
.launcher-remove,
.launcher-moves button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tap-min);
    height: var(--tap-min);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: var(--color-badge-on-color-bg);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-lg);
    font-weight: 800;
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.launcher-remove svg,
.launcher-moves svg { width: 20px; height: 20px; }

.launcher-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.launcher-moves {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.launcher-moves button:disabled { cursor: default; opacity: 0.35; }

/* «Instalar» de cada app en marcha: en la lista, al editar y al añadir */
.launcher-install-app {
    flex-shrink: 0;
    min-height: var(--tap-min);
    padding: 0 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-round);
    background-color: var(--color-white);
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
}

.launcher-tiles:not(.is-editing) .launcher-remove,
.launcher-tiles:not(.is-editing) .launcher-moves,
.launcher-tiles:not(.is-editing):not(.is-list) .launcher-install-app,
.launcher-tiles.is-editing .launcher-tile-go,
.launcher-tiles.is-editing .launcher-tile-soon,
.launcher-tiles.is-editing .launcher-tile-text > span { display: none; }

.launcher-tiles.is-editing .launcher-tile { padding-bottom: 68px; }

/* En fichas, al editar, «Instalar» ocupa el sitio del icono (arriba a la izquierda) */
.launcher-tiles.is-editing:not(.is-list) .launcher-tile-icon { visibility: hidden; }

.launcher-tiles.is-editing:not(.is-list) .launcher-install-app {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 2;
    border: 0;
    background-color: var(--color-badge-on-color-bg);
    color: var(--color-ink);
}

/* En lista: filas planas con icono, nombre, una línea y ↗; el color, solo en el icono */
.launcher-tiles.is-list {
    gap: 0;
    border-top: 1px solid var(--color-line);
}

.launcher-tiles.is-list > li {
    flex-basis: 100%;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--color-line);
}

.launcher-tiles.is-list .launcher-tile {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 0;
    overflow: visible;
    border-radius: 0;
    background-color: transparent;
    color: var(--color-text);
}

.launcher-tiles.is-list .launcher-tile-mark { display: none; }

.launcher-tiles.is-list .launcher-tile-text {
    flex: 1 1 auto;
    order: 1;
    min-width: 0;
}

.launcher-tiles.is-list .launcher-tile-text strong {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: 0;
}

.launcher-tiles.is-list .launcher-tile-text > span {
    display: block;
    overflow: hidden;
    color: var(--color-text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.launcher-tiles.is-list .launcher-tile-go,
.launcher-tiles.is-list .launcher-tile-soon {
    position: static;
    flex-shrink: 0;
    order: 2;
    color: var(--color-text-muted);
}

.launcher-tiles.is-list .launcher-remove,
.launcher-tiles.is-list .launcher-moves { position: static; }
.launcher-tiles.is-list.is-editing .launcher-tile { padding-bottom: 12px; }

/* 5. «Añadir apps» (dentro de «Editar») y las filas planas sobre el papel, separadas por una línea fina */
.launcher-adding { margin-top: 32px; }

.launcher-adding h3 {
    margin-bottom: 12px;
    font-size: var(--text-xl);
}

.launcher-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.launcher-search svg {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    pointer-events: none;
}

/* Con id: el estilo de los campos de base.css va con varios :not() y pesa más que una clase */
#launcher-search {
    width: 100%;
    min-height: var(--control-height);
    padding: 0 16px 0 46px;
    border-radius: 16px;
}

#launcher-search::placeholder { color: var(--color-text-muted); }

.launcher-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-line);
}

.launcher-list + .launcher-list { margin-top: 32px; }

.launcher-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--color-line);
}

.launcher-row-open {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 60px;
    padding: 10px 0;
    border: 0;
    background-color: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

[data-row] .launcher-row-open { min-height: 72px; }

.launcher-row-icon { display: flex; flex-shrink: 0; }
.launcher-row-glyph { display: flex; flex-shrink: 0; }
.launcher-row-glyph svg { width: 24px; height: 24px; }
.launcher-row-icon.is-soon { opacity: 0.55; }

.launcher-row-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.launcher-row-text strong {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    font-size: var(--text-md);
    font-weight: 700;
}

.launcher-row-text > span {
    font-size: var(--text-sm);
    line-height: var(--leading-ui);
    color: var(--color-text-muted);
}

/* Una sola línea de descripción por app */
[data-row] .launcher-row-text > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* «Pronto», texto apagado junto al nombre */
.launcher-soon {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
}

.launcher-row-end {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-left: auto;
    color: var(--color-text-muted);
}

/* «Añadir» con contorno; «Añadida ✓» rellena de tinta */
.launcher-add {
    flex-shrink: 0;
    min-height: var(--tap-min);
    padding: 0 14px 0 10px;
    border: 1px solid var(--color-text-muted);
    border-radius: var(--radius-round);
    background-color: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
}

.launcher-add:hover { border-color: var(--color-ink); }

.launcher-add[aria-pressed="true"] {
    border-color: var(--color-ink);
    background-color: var(--color-ink);
    color: var(--color-white);
}

.launcher-add-off,
.launcher-add-on {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.launcher-add svg { width: 16px; height: 16px; }
.launcher-add[aria-pressed="true"] .launcher-add-off,
.launcher-add[aria-pressed="false"] .launcher-add-on { display: none; }

.launcher-none:not(:empty) {
    margin-top: 16px;
    font-size: var(--text-sm);
    text-align: center;
    color: var(--color-text-muted);
}

/* «¿Echas algo en falta? Escríbeme»: texto apagado y el enlace subrayado */
.launcher-missing {
    margin-top: 32px;
    font-size: var(--text-sm);
    line-height: var(--leading-body);
    color: var(--color-text-muted);
}

.launcher-missing a {
    font-weight: 700;
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 6. El «+»: tus atajos en el panel del «+» de la web (.suite-panel), con los colores de panel de tokens.css.
   Sube pegado a la barra, de borde a borde y redondeado solo arriba, hasta el 85 % de alto con su propio scroll; la
   barra queda encima (el «+» abierto gira a ✕ y lo cierra) */
.launcher-panel .suite-sheet {
    top: auto;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0;
    display: flex;
    flex-direction: column;
    width: auto;
    max-height: calc(85vh - 64px);
    max-height: calc(85dvh - 64px - env(safe-area-inset-bottom));
    padding: 0;
    overflow: hidden;
    border: 0;
    border-top: 1px solid var(--color-panel-line);
    border-radius: 22px 22px 0 0;
    background-color: var(--color-panel-bg);
    color: var(--color-panel-fg);
    box-shadow: none;
    transform: translateY(24px);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.launcher-panel.is-open .suite-sheet { transform: none; }
.launcher-panel .suite-sheet.is-dragging { transition: none; }
.launcher-panel-sheet:focus { outline: none; }

/* Cabecera: asa para deslizar hacia abajo, título, «Editar» y ✕ */
.launcher-panel-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 8px 12px 20px;
    border-bottom: 1px solid var(--color-panel-line);
    touch-action: none;
    cursor: grab;
}

.launcher-panel-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background-color: var(--color-panel-muted);
    opacity: 0.5;
}

.launcher-panel-head h2 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--text-xl);
    color: inherit;
}

.launcher-panel .launcher-pill {
    border-color: var(--color-panel-muted);
    color: var(--color-panel-fg);
}

.launcher-panel .launcher-pill[aria-pressed="true"] {
    border-color: var(--color-panel-fg);
    background-color: var(--color-panel-fg);
    color: var(--color-panel-bg);
}

.launcher-panel .launcher-sheet-close { color: inherit; }

.launcher-panel-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
    padding: 16px 16px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

[data-shortcut-groups] {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* «Destacados» y la cabecera de cada app (su icono y su nombre) */
.launcher-panel-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0;
    color: var(--color-panel-muted);
}

.launcher-panel-label svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.launcher-panel-hint {
    font-size: var(--text-sm);
    line-height: var(--leading-body);
    color: var(--color-panel-muted);
}

/* En fichas (cuadrados): a todo color, dos por fila; las de cada app, algo más bajas que las destacadas */
.launcher-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.launcher-shortcuts > li {
    position: relative;
    display: flex;
    flex: 0 0 calc((100% - 10px) / 2);
    min-width: 0;
}

.launcher-shortcuts > li.is-new,
.launcher-minis > li.is-new { animation: launcher-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes launcher-pop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: none; }
}

.launcher-shortcut {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    min-height: 108px;
    padding: 14px;
    border-radius: 18px;
    background-color: var(--accent, var(--color-ink));
    color: var(--color-white);
}

.launcher-shortcut.launcher-tone--light { color: var(--color-ink); }
.launcher-shortcut-icon { display: flex; }

/* El icono del atajo tal cual sobre su color, sin placa, con las esquinas de las fichas de Bide+ (16 px en 56) */
.launcher-shortcut-icon img,
.launcher-mini-icon img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    object-fit: cover;
}

.launcher-shortcut-go {
    position: absolute;
    top: 12px;
    right: 14px;
    font-weight: 800;
    opacity: 0.85;
}

.launcher-shortcut-name {
    display: -webkit-box;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 800;
    line-height: var(--leading-heading);
    letter-spacing: var(--tracking-heading);
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.launcher-shortcuts--small .launcher-shortcut {
    min-height: 84px;
    padding: 12px;
}

.launcher-shortcuts--small .launcher-shortcut-name { font-size: var(--text-md); }

/* En lista (y siempre al editar): filas con el icono sobre su color, el nombre y su línea */
.launcher-minis {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.launcher-minis > li {
    position: relative;
    display: flex;
    flex: 0 0 100%;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.launcher-mini {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 52px;
    padding: 6px 4px;
    border-radius: 12px;
    color: var(--color-panel-fg);
}

.launcher-mini:hover { background-color: var(--color-panel-raised); }

.launcher-mini-icon {
    display: flex;
    flex-shrink: 0;
    border-radius: 9px;
    background-color: var(--accent, var(--color-panel-raised));
}

.launcher-mini-icon svg { width: 32px; height: 32px; }

/* Un pictograma en SVG (Gasolinera+) llega a sangre: aire alrededor, como en las fichas; los PNG de icono traen el suyo */
.launcher-mini-icon img[src$=".svg"] { padding: 5px; }

.launcher-mini-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: var(--leading-ui);
}

.launcher-mini-text strong {
    font-size: var(--text-md);
    overflow-wrap: anywhere;
}

.launcher-mini-text span {
    overflow: hidden;
    font-size: var(--text-sm);
    color: var(--color-panel-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Editando: estrella para destacar; los tuyos, además, se renombran tocando el nombre y se borran con ✕ */
.launcher-star,
.launcher-mini-remove {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: var(--tap-min);
    height: var(--tap-min);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--color-panel-muted);
    cursor: pointer;
}

.launcher-star svg,
.launcher-mini-remove svg { width: 22px; height: 22px; }
.launcher-star[aria-pressed="true"] { color: var(--color-panel-star); }
.launcher-star[aria-pressed="true"] svg { fill: currentColor; }

/* Las flechas de ordenar los destacados, en la fila y sin chapa */
.launcher-minis .launcher-moves {
    position: static;
    display: flex;
    flex-shrink: 0;
    gap: 0;
}

.launcher-minis .launcher-moves button {
    background-color: transparent;
    color: var(--color-panel-muted);
    box-shadow: none;
}

.launcher-mini-rename {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: calc(var(--tap-min) * 2 + 8px);
    z-index: 1;
    border: 0;
    border-radius: 12px;
    background-color: transparent;
    cursor: text;
}

/* «+ Nuevo atajo», solo al editar, a lo ancho */
.launcher-shortcut-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    border: 2px dashed var(--color-panel-line);
    border-radius: 16px;
    background-color: transparent;
    color: var(--color-panel-fg);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.launcher-shortcut-new:hover { border-color: var(--color-panel-muted); }

.launcher-shortcut-new span:first-child {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    line-height: 1;
}

/* «Deshacer» unos segundos después de borrar, pegado abajo del panel */
.launcher-toast {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 6px 6px 18px;
    border-radius: 16px;
    background-color: var(--color-panel-fg);
    color: var(--color-panel-bg);
    box-shadow: var(--shadow-elevated);
}

.launcher-toast button {
    min-height: var(--tap-min);
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background-color: var(--color-panel-bg);
    color: var(--color-panel-fg);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

/* La hoja de «Nuevo atajo» (se abre desde el panel, con sus colores): sube desde abajo, se cierra con ✕, Escape o
   tocando fuera */
.launcher-sheet {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    max-height: 88dvh;
    margin: auto auto 0;
    padding: 12px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-y: auto;
    border: 0;
    border-radius: 24px 24px 0 0;
    background-color: var(--color-panel-bg);
    color: var(--color-panel-fg);
    box-shadow: var(--shadow-elevated);
}

.launcher-sheet[open] { animation: launcher-sheet-in 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.launcher-sheet::backdrop { background-color: var(--color-story-dim); }

@keyframes launcher-sheet-in {
    from { transform: translateY(100%); }
    to { transform: none; }
}

.launcher-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: var(--tap-min);
}

.launcher-sheet-back,
.launcher-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    padding: 0 8px;
    border: 0;
    border-radius: var(--radius-round);
    background-color: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.launcher-sheet-back svg,
.launcher-sheet-close svg { width: 20px; height: 20px; }
.launcher-sheet-back[hidden] { display: inline-flex; visibility: hidden; }

.launcher-sheet .launcher-dots > span[aria-hidden] { background-color: var(--color-panel-line); }
.launcher-sheet .launcher-dots > span.is-on { background-color: var(--color-panel-fg); }
.launcher-sheet .launcher-note { color: var(--color-panel-muted); }
.launcher-sheet .launcher-primary { background-color: var(--color-panel-fg); color: var(--color-panel-bg); }
.launcher-sheet .launcher-primary:disabled { background-color: var(--color-panel-raised); color: var(--color-panel-muted); }
.launcher-sheet.is-renaming .launcher-dots { visibility: hidden; }

.launcher-sheet h2 {
    margin: 8px 0 16px;
    font-size: var(--text-card);
}

.launcher-sheet-label {
    display: block;
    margin: 16px 0 8px;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-panel-muted);
}

.launcher-sheet-label:first-child { margin-top: 0; }

.launcher-sheet-field {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.launcher-sheet-field input { flex: 1 1 220px; min-width: 0; }

.launcher-sheet-error:not(:empty) {
    margin-top: 8px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-panel-error);
}

[data-sheet-step="3"] {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-sheet-step="3"][hidden] { display: none; }

/* 7. «Más»: idioma con selector segmentado, actualizar, instalar, los enlaces y la firma */
.launcher-row-label {
    flex: 1 1 auto;
    font-weight: 700;
}

.launcher-seg {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background-color: var(--color-white);
}

.launcher-seg a {
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text-muted);
}

.launcher-seg a + a { border-left: 1px solid var(--color-line); }

.launcher-seg a[aria-current="true"] {
    background-color: var(--color-ink);
    color: var(--color-white);
}

.launcher-item--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.launcher-status:not(:empty) {
    padding-bottom: 14px;
    font-size: var(--text-sm);
}

/* Más aire en «Más»: margen lateral, filas de 56 px o más y grupos bien separados, siempre con líneas finas planas */
.launcher-settings {
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
}

.launcher-settings .launcher-list + .launcher-list { margin-top: 40px; }
.launcher-settings .launcher-item { gap: 12px; }

.launcher-settings .launcher-row-open {
    gap: 14px;
    min-height: 60px;
    padding: 16px 0;
}

.launcher-settings .launcher-item--lang {
    min-height: 72px;
    padding: 14px 0;
}

.launcher-settings .launcher-signature { margin-top: 48px; }

/* Ya instalada, no se ofrece instalarla */
@media (display-mode: standalone) {
    .launcher-install { display: none; }
}

.launcher-signature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 32px;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.launcher-signature p:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.launcher-signature a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
}

.launcher-version {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

/* 8. Barra oscura de la app, como la del portal: icono y nombre, la activa resaltada; en el centro el «+» de Plusa,
   que abre el panel y, abierto, gira a ✕ como en la web (queda por encima del velo) */
.launcher-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: flex;
    align-items: stretch;
    padding: 0 max(0px, calc((100% - 560px) / 2)) env(safe-area-inset-bottom);
    border-top: 1px solid var(--color-line-dark);
    background-color: var(--color-ink);
}

.launcher-tabs-brand { display: none; }

.launcher-tab {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    height: 64px;
    color: var(--color-text-on-dark-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

.launcher-tab svg { width: 22px; height: 22px; }

.launcher-tab[aria-current="page"] {
    background-color: var(--color-ink-soft);
    color: var(--color-white);
    font-weight: 800;
}

.launcher-tab.tab-plus {
    flex: 0 0 64px;
    margin: -18px 12px 0;
}

.launcher-tab.tab-plus {
    border: 0;
    background-color: transparent;
    font: inherit;
    cursor: pointer;
}

.launcher-tab.tab-plus svg { width: 42px; height: 42px; }

/* En el móvil el «+» es solo el logo; su nombre lo lee el lector y se ve en escritorio */
.tab-plus .launcher-tab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (min-width: 720px) {
    .launcher-tiles:not(.is-list) > li { flex-basis: calc((100% - 24px) / 3); }
    .launcher-shortcuts > li { flex-basis: calc((100% - 20px) / 3); }
    .launcher-pick > li { flex-basis: 25%; }
}

/* Escritorio: columna lateral oscura, como la de Gasolinera+ y Bide+, y el contenido a su derecha */
@media (min-width: 1024px) {
    .launcher {
        margin-left: 248px;
        padding-bottom: 64px;
    }

    .launcher[data-screen="inicio"] { margin-left: 0; }

    .launcher-wrap {
        max-width: 960px;
        padding-right: 40px;
        padding-left: 40px;
    }

    .launcher-band { padding-top: 40px; }

    .launcher-tabs {
        top: 0;
        right: auto;
        width: 248px;
        flex-direction: column;
        gap: 4px;
        padding: 28px 0;
        border-top: 0;
        border-right: 1px solid var(--color-line-dark);
    }

    .launcher-tabs-brand { display: flex; padding: 0 24px 24px; }

    .launcher-tab,
    .launcher-tab.tab-plus {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        width: auto;
        height: 48px;
        margin: 0;
        padding: 0 24px;
        font-size: var(--text-md);
    }

    .launcher-tab.tab-plus::before { display: none; }
    .launcher-tab.tab-plus svg { width: 22px; height: 22px; }
    .launcher-tab.tab-plus[aria-expanded="true"] { background-color: var(--color-ink-soft); color: var(--color-white); }
    .launcher-tab.tab-plus[aria-expanded="true"] svg { transform: none; }

    /* El panel, del ancho de la columna de la app y pegado abajo */
    .launcher-panel .suite-sheet {
        right: 0;
        bottom: 0;
        left: 248px;
        max-width: 960px;
        max-height: 85vh;
        margin: 0 auto;
    }

    .tab-plus .launcher-tab-label {
        position: static;
        width: auto;
        height: auto;
        clip-path: none;
    }

    .launcher-sheet { margin: auto; border-radius: 24px; }
    .app-shell .lang-offer { bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .launcher-tile,
    .launcher-pick-icon,
    [data-launcher-mark] .plusa-piece { transition: none; }

    .launcher.is-entering .launcher-screen:not([hidden]),
    .launcher-shortcuts > li.is-new,
    .launcher-minis > li.is-new,
    .launcher-sheet[open] { animation: none; }

    .launcher-panel .suite-sheet { transform: none; transition: none; }
}
