body.app-shell-body{height:100%;overflow:hidden;background:var(--bg);overscroll-behavior:none}
.app-shell-body{margin:0}
.app-shell{--shell-bar-height:var(--nav-height);position:fixed;left:0;right:0;top:0;height:var(--app-h,100dvh);max-width:100%;background:var(--bg);overflow:hidden;overscroll-behavior:none}
.shell-topbar{position:absolute;z-index:110;left:0;right:0;top:0;height:calc(var(--shell-bar-height) + env(safe-area-inset-top));padding-top:env(safe-area-inset-top);background:color-mix(in srgb,var(--surface) 97%,transparent);backdrop-filter:blur(18px);border-bottom:1px solid var(--border);box-sizing:border-box}
.shell-topbar::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;pointer-events:none;background:linear-gradient(90deg,transparent 0%,var(--gold-strong) 18%,var(--gold-soft) 50%,var(--gold-strong) 82%,transparent 100%);box-shadow:0 1px 6px color-mix(in srgb,var(--gold-soft) 26%,transparent);opacity:.92}
.shell-topbar-inner{height:var(--shell-bar-height);display:grid;grid-template-columns:96px minmax(0,1fr) 96px;align-items:center;gap:8px;padding:0 12px;box-sizing:border-box}
.shell-home-brand{grid-column:1/3;display:flex;align-items:center;min-width:0;height:100%}
.shell-brand-logo{width:82px;height:58px;object-fit:contain;object-position:left center;display:block;background:transparent;filter:drop-shadow(0 5px 10px rgba(0,0,0,.10))}
.shell-top-back{grid-column:1;justify-self:start;min-height:48px;width:48px}
.shell-top-title{grid-column:2;min-width:0;display:grid;gap:2px;align-content:center}
.shell-top-title[hidden],.shell-home-brand[hidden],.shell-top-actions[hidden],.shell-top-back[hidden]{display:none!important}
.shell-top-title strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:800 17px/1.1 var(--font-display);color:var(--text)}
.shell-top-title small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font:600 9px/1.2 var(--font-body)}
.shell-top-actions{grid-column:3;display:flex;justify-content:flex-end;gap:4px}
.shell-top-actions .icon-button{background:transparent;border-color:transparent;box-shadow:none}
.shell-views{position:absolute;inset:calc(var(--shell-bar-height) + env(safe-area-inset-top)) 0 calc(var(--nav-height) + env(safe-area-inset-bottom)) 0;overflow:hidden;background:var(--bg);overscroll-behavior:none}
.shell-view{position:absolute;inset:0;width:100%;height:100%;border:0;background:var(--bg);opacity:1;transform:none;transition:opacity .14s ease;touch-action:pan-y pan-x}
.shell-view[hidden]{display:none!important}
.shell-bottom-nav{position:absolute!important;left:0!important;right:0!important;bottom:0!important;transform:none!important;width:100%!important;max-width:none!important;z-index:100}
.shell-bottom-nav .nav-btn{min-height:58px}
.shell-overlay{position:fixed;inset:0;z-index:220;background:rgba(10,14,12,.58);backdrop-filter:blur(8px);display:grid;place-items:stretch;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
.shell-overlay[hidden]{display:none!important}
.shell-overlay-card{min-height:100%;display:grid;grid-template-rows:auto 1fr auto;background:var(--surface);overflow:hidden}
.shell-overlay-head{min-height:var(--nav-height);box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid var(--border);background:var(--surface);position:relative}
.shell-overlay-head::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:linear-gradient(90deg,transparent,var(--gold-strong) 18%,var(--gold-soft) 50%,var(--gold-strong) 82%,transparent)}
.shell-overlay-head>div{display:grid;gap:2px;min-width:0}.shell-overlay-head strong{font:800 16px var(--font-display)}.shell-overlay-head small{color:var(--muted);font-size:11px}
.shell-map-frame-wrap{min-height:0;background:var(--surface-2)}.shell-map-frame-wrap iframe{width:100%;height:100%;border:0;background:var(--surface-2)}
.shell-map-external{margin:10px 14px 14px;justify-content:center}
@media(min-width:760px){.app-shell{left:50%;width:min(var(--content-max),100%);transform:translateX(-50%);box-shadow:0 0 0 1px var(--border),0 18px 55px rgba(0,0,0,.10)}.shell-bottom-nav{width:min(var(--content-max),100%)!important;left:50%!important;transform:translateX(-50%)!important}.shell-overlay{left:50%;width:min(var(--content-max),100%);transform:translateX(-50%)}}

.shell-map-external[hidden]{display:none!important}.shell-overlay.local-map .shell-overlay-card{grid-template-rows:auto 1fr}

/* V10.64 · Las vistas internas del App Shell deben poder desplazarse verticalmente. */
html[data-shell-embedded="1"]{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain}
html[data-shell-embedded="1"] body{min-height:100%;overflow-x:hidden;overflow-y:visible;touch-action:pan-y}
html[data-shell-embedded="1"] .screen{width:100%;max-width:100%;min-height:100%;overflow:visible!important;overflow-x:hidden!important;touch-action:pan-y}


/* V10.64 · encabezado único persistente. Las reglas de vistas embebidas viven en styles/screens.css. */
@media(max-width:430px){.shell-topbar-inner{grid-template-columns:78px minmax(0,1fr) 92px;padding-left:10px;padding-right:10px}.shell-brand-logo{width:70px;height:52px}.shell-top-title strong{font-size:16px}}


/* V10.64 · visualViewport: el teclado solo reduce la altura útil; no cambia escala/ancho. */
html.mpn-keyboard-open,html.mpn-keyboard-open body{overflow:hidden}
.app-shell{contain:layout paint}
.shell-views,.shell-view{max-width:100%;min-width:0}
@media(min-width:760px){
  .app-shell{right:auto}
  .shell-bottom-nav{left:0!important;right:0!important;width:100%!important;transform:none!important}
}

/* V10.64 · Las barras fija superior/inferior nunca participan del rebote del contenido. */
.shell-topbar,.shell-bottom-nav{transform:translateZ(0);will-change:auto;overscroll-behavior:none}

/* V10.76.9 · globos globales de mensajes */
.shell-badge-host{position:relative}.shell-unread-badge{position:absolute;z-index:4;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#c62828;color:#fff;font:800 8px/1 var(--font-display);box-shadow:0 0 0 2px var(--surface)}.shell-unread-badge[hidden]{display:none}.shell-top-actions .shell-unread-badge{right:-4px;top:-5px}.shell-bottom-nav .nav-unread-badge{right:calc(50% - 19px);top:3px}


/* V10.76.9 · alertas operativas: dorado = requiere atención. */
.shell-bottom-nav .nav-btn.business-attention-gold{background:var(--gloss-gold);color:var(--on-gold);box-shadow:var(--shine-gold)}
.shell-bottom-nav .nav-btn.business-attention-gold .icon,.shell-bottom-nav .nav-btn.business-attention-gold span{color:var(--on-gold)}
.shell-business-alert{position:fixed;left:50%;top:calc(62px + env(safe-area-inset-top));z-index:180;width:min(430px,calc(100% - 20px));transform:translateX(-50%);display:grid;grid-template-columns:minmax(0,1fr) 38px;align-items:center;overflow:hidden;border-radius:17px;background:var(--gloss-gold);color:var(--on-gold);box-shadow:var(--shine-gold),0 14px 36px rgba(24,34,29,.18)}.shell-business-alert[hidden]{display:none}.shell-business-alert-main{min-width:0;min-height:58px;border:0;background:transparent;color:inherit;display:flex;align-items:center;gap:10px;padding:9px 10px;text-align:left;cursor:pointer}.shell-business-alert-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.28)}.shell-business-alert-icon .icon{width:20px;height:20px}.shell-business-alert-main span:last-child{min-width:0}.shell-business-alert-main b,.shell-business-alert-main small{display:block}.shell-business-alert-main b{font:900 11px var(--font-display)}.shell-business-alert-main small{margin-top:2px;font:750 9px var(--font-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shell-business-alert-close{width:34px;height:34px;margin-right:5px;border:0;border-radius:10px;background:rgba(255,255,255,.26);color:inherit;font-size:20px;cursor:pointer}

.shell-driver-gps{flex-shrink:0;margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:66px;min-height:44px;padding:7px 10px;border:1px solid #c7d9cf;border-radius:22px;background:#f5faf7;color:#204c3b;font:inherit;font-size:.85rem;font-weight:700}
.shell-driver-gps[hidden]{display:none}
.shell-driver-gps i{width:9px;height:9px;border-radius:50%;background:#bf8c14}
.shell-driver-gps[data-state=ready] i{background:#168652}
.shell-driver-gps[data-state=error] i{background:#bd3f3f}
.shell-top-title:has(+.shell-driver-gps:not([hidden])){min-width:0;flex:1}
.shell-top-title:has(+.shell-driver-gps:not([hidden])) strong{font-size:1.1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}

.shell-driver-gps{grid-column:3;grid-row:1;justify-self:end}


/* Solo mientras el chat de Lupe está abierto: la vista acaba en el borde
   real de la barra inferior, no en el alto nominal de navegación. */
.app-shell.shell-lupe-chat-active .shell-views{
 bottom:var(--mpn-lupe-nav-inset,calc(var(--nav-height) + env(safe-area-inset-bottom)));
}
.app-shell.shell-lupe-chat-active .shell-top-title{
 grid-column:2;
}


/* Only linked business Owner screens: no empty left column from the
   suppressed global back arrow. The native bottom navigation stays intact. */
.app-shell.shell-linked-owner-navigation .shell-top-title{
 grid-column:1/3;
}

/* Public business pages use their own business name; retain the existing shell back action. */
.shell-public-business-header .shell-topbar{height:calc(64px + env(safe-area-inset-top));background:transparent;backdrop-filter:none;border:0;pointer-events:none}
.shell-public-business-header .shell-topbar::after{display:none}
.shell-public-business-header .shell-topbar-inner{height:64px;display:flex;align-items:center;padding:0 10px;pointer-events:none}
.shell-public-business-header .shell-top-title,.shell-public-business-header .shell-home-brand,.shell-public-business-header .shell-top-actions{display:none!important}
.shell-public-business-header .shell-top-back{pointer-events:auto;flex:none;margin:0}
.shell-public-business-header .shell-views{top:env(safe-area-inset-top)}

/* Owner home embedded header: back action remains fixed while business identity aligns beside it. */
@media(max-width:759px){
 html[data-shell-embedded="1"] body>.screen>.screen-head.shell-owner-business-identity{display:flex!important;align-items:center!important;gap:10px!important;min-height:72px!important;padding:8px 14px!important;margin:0!important}
 html[data-shell-embedded="1"] .screen-head.shell-owner-business-identity>.back-btn{display:grid!important;flex:0 0 48px!important;width:48px!important;height:48px!important;min-height:48px!important;margin:0!important}
 html[data-shell-embedded="1"] .screen-head.shell-owner-business-identity>.screen-title{display:block!important;flex:1 1 auto!important;min-width:0!important;margin:0!important}
 .shell-owner-business-mark{display:flex;align-items:center;gap:10px;min-width:0}
 .shell-owner-business-mark>.owner-business-logo{flex:0 0 52px;width:52px;height:52px;object-fit:contain;border-radius:50%;border:1px solid var(--border,#dce7e1);background:#fff}
 .shell-owner-business-mark>span{display:grid;gap:1px;min-width:0}
 .shell-owner-business-mark small{font-size:10px;font-weight:800;letter-spacing:.07em;color:var(--brand,#005c43)}
 .shell-owner-business-mark strong{font-size:clamp(17px,5vw,22px);line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text,#18221d)}
 .shell-owner-business-mark em{font-size:11px;line-height:1.2;font-style:normal;color:var(--muted,#61706a)}
 html[data-shell-embedded="1"] .shell-owner-business-refresh{display:grid!important;flex:0 0 42px!important;width:42px!important;height:42px!important;min-height:42px!important;margin:0!important;padding:7px!important}
 html[data-shell-embedded="1"] .owner-business-home>.mobile-business-head{display:none!important}
}

/* Linked business home: place the business logo and name beside the existing back arrow. */
.app-shell.shell-owner-business-home .shell-topbar-inner{grid-template-columns:48px minmax(0,1fr) 44px}
.app-shell.shell-owner-business-home .shell-top-back{grid-column:1;grid-row:1;justify-self:start}
.app-shell.shell-owner-business-home .shell-top-title{grid-column:2;grid-row:1;min-width:0}
.app-shell.shell-owner-business-home .shell-top-title strong{white-space:normal;overflow:visible}
.app-shell.shell-owner-business-home .shell-top-title small{display:none!important}
.shell-owner-business-mark{display:flex;align-items:center;gap:10px;min-width:0}
.shell-owner-business-logo{display:block;flex:0 0 52px;width:52px;height:52px;object-fit:contain;border-radius:50%;border:1px solid var(--border);background:var(--surface)}
.shell-owner-business-copy{display:grid;gap:1px;min-width:0}
.shell-owner-business-copy small{font:800 10px/1.1 var(--font-body);letter-spacing:.07em;color:var(--brand)}
.shell-owner-business-copy b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text);font:800 clamp(17px,5vw,22px)/1.15 var(--font-display)}
.shell-owner-business-copy em{font:600 11px/1.2 var(--font-body);font-style:normal;color:var(--muted)}
@media(max-width:430px){.app-shell.shell-owner-business-home .shell-topbar-inner{grid-template-columns:48px minmax(0,1fr) 40px;gap:6px;padding-left:10px;padding-right:10px}.shell-owner-business-logo{flex-basis:46px;width:46px;height:46px}.shell-owner-business-mark{gap:8px}}

/* Community owns its compact header and composer; the shell owns keyboard size. */
/* Follow the parent's visible origin once; the iframe uses this shell's height. */
.app-shell.shell-courier-community{top:var(--app-top,0px)}
.app-shell.shell-courier-community .shell-topbar,
.app-shell.shell-courier-community .shell-bottom-nav{display:none!important}
.app-shell.shell-courier-community .shell-views{top:env(safe-area-inset-top);bottom:0}


/* Service conversations follow the same parent viewport as the courier group. */
.app-shell.shell-courier-service-chat{top:var(--app-top,0px)}
.app-shell.shell-courier-service-chat .shell-topbar,
.app-shell.shell-courier-service-chat .shell-bottom-nav{display:none!important}
.app-shell.shell-courier-service-chat .shell-views{top:env(safe-area-inset-top);bottom:0}
