/* shell: rem base, fixed frame, bottom tab bar with the gooey pill */
* { box-sizing: border-box; }
/* The one fixed-px value: the base of the rem scale */
html { font-size: calc(16px * var(--ui-scale)); -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font: var(--fs-m) / 1.7 var(--font); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { display: inline-flex; }
.ico svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.boot { padding: 1.5rem; text-align: center; }

/* Shell */
#app { position: fixed; inset: 0; width: 100%; max-width: 56rem; margin-inline: auto; display: flex; flex-direction: column; background: var(--bg); }
.header { flex: none; background: var(--bar); color: var(--on-bar); padding: calc(env(safe-area-inset-top) + 1rem) 1.125rem 1.5rem; }
.header-body { min-height: var(--header-h); display: flex; align-items: center; gap: .75rem; }
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .75rem 1rem 1.5rem; }

#app.immersive > .header, #app.immersive:not(.with-bar) > .nav { display: none; } /* tab mode keeps the bar under the page (D129) */
#app.immersive .view { padding: 0; position: relative; }

.empty { display: grid; justify-items: center; gap: .5rem; text-align: center; padding: 3.5rem 1.5rem; }
.empty h2 { font-size: var(--fs-l); font-weight: var(--fw-bold); }
.empty p { color: var(--muted); max-width: 32ch; }

.nav { position: relative; flex: none; display: flex; gap: .25rem; background: var(--card); border-top: 1px solid var(--line); padding: .375rem .5rem calc(env(safe-area-inset-bottom) + .375rem); }
.nav-item { flex: 1; min-width: 0; position: relative; z-index: 1; min-height: calc(var(--nav-h) - .75rem); display: grid; justify-items: center; align-content: center; gap: .125rem; font-size: var(--fs-s); color: var(--muted); border-radius: .875rem; }
.nav-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.on { color: var(--on-brand); font-weight: var(--fw-bold); }
.nav-item .ico { transition: transform var(--t-press); } .nav-item:active .ico { transform: scale(.88); }
/* Gooey pill (like Nowroz Pakhsh) */
.nav-pill { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; opacity: 0; will-change: transform; transition: transform 250ms cubic-bezier(1, .2, .1, 1.2); }
.nav-pill.ready { opacity: 1; } /* first placement only: it never fades during a tab change */
.nav-pill.still { transition: none; }
.nav-pill i { display: block; width: 100%; height: 100%; border-radius: .875rem; background: var(--brand-strong); }
.nav-pill.go i { animation: navGoo 250ms ease 1; }
@keyframes navGoo { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.45, .6); } }
.view.enter { animation: viewIn var(--t-spring) var(--spring) 1; }
@keyframes viewIn { from { transform: translateY(.5rem); } }
/* One-tap Nowroz entry status (R-AUTH-12) */
.nz-in { position: fixed; inset-inline: 1rem; top: calc(env(safe-area-inset-top, 0px) + .75rem); z-index: 60; padding: .75rem 1rem; border-radius: .875rem; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: var(--fs-m); text-align: center; box-shadow: 0 6px 20px var(--lift); }
.nz-in.bad { color: var(--bad-ink); border-color: var(--bad); }
