:root{--device-top:0px;--device-bottom:0px;--safe-top:max(env(safe-area-inset-top),var(--device-top));--safe-bottom:max(env(safe-area-inset-bottom),var(--device-bottom))}
:root[data-device="framed"]{--device-top:44px;--device-bottom:28px;scrollbar-width:none}
:root[data-device="framed"] ::-webkit-scrollbar{display:none}
/* The app background is the olive gradient stage; content scrolls inside .app-content. */
.app{position:relative;isolation:isolate;min-height:100dvh;display:flex;flex-direction:column;background:var(--app-bg);background-color:var(--bg)}
.app-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2-5);padding:calc(var(--space-2) + var(--safe-top)) var(--space-4) var(--space-2);background:transparent}
.app-header__title{flex:1;min-width:0;font-size:var(--text-body-lg);font-weight:var(--weight-bold);text-align:center}
.app-header[data-align="start"] .app-header__title{text-align:left;font-size:var(--text-5xl);letter-spacing:var(--letter-spacing-tight);line-height:var(--line-height-tight)}
.app-content{flex:1;display:flex;flex-direction:column;gap:var(--space-3-5);padding:var(--space-2) var(--space-4) var(--space-10);min-width:0}
/* With a tab bar, content reserves room so the last card clears the floating bar. */
.app:has(.bottom-nav) .app-content{padding-bottom:calc(var(--space-28) + var(--safe-bottom))}
/* Bottom navigation: a floating glass pill, 64px tall, inset 14px from the device edges. */
.bottom-nav{position:fixed;left:var(--space-3-5);right:var(--space-3-5);bottom:max(var(--space-4),calc(var(--safe-bottom) - var(--space-1)));z-index:var(--layer-sticky);display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;align-items:center;max-width:calc(var(--content-sm) - var(--space-6));margin-inline:auto;min-height:var(--nav-height);padding:var(--space-1);border:1px solid var(--nav-edge);border-radius:var(--radius-3xl);background:var(--nav-glass);box-shadow:var(--nav-shadow);-webkit-backdrop-filter:blur(32px) saturate(180%);backdrop-filter:blur(32px) saturate(180%)}
.bottom-nav__item{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--space-0-5);min-height:3.5rem;border-radius:var(--radius-2xl);color:var(--fg-subtle);text-decoration:none;font-size:var(--text-2xs);font-weight:var(--weight-semibold);letter-spacing:var(--letter-spacing-wide);transition:background var(--motion-normal) var(--ease),color var(--motion-normal) var(--ease)}
.bottom-nav__item .icon{width:1.5rem;height:1.5rem}
.bottom-nav__item[aria-current="page"]{color:var(--fg);background:var(--tab-on);font-weight:var(--weight-bold)}
.bottom-nav__item:active{transform:scale(.94)}
.bottom-nav__count{position:absolute;top:var(--space-1);left:calc(50% + var(--space-1));display:grid;place-items:center;min-width:1.125rem;height:1.125rem;padding:0 var(--space-1);border-radius:var(--radius-full);background:var(--citron);color:var(--on-citron);box-shadow:0 0 0 2px var(--nav-ring);font-size:var(--text-2xs);font-weight:var(--weight-extrabold);letter-spacing:var(--letter-spacing)}
/* Sheets rise from the bottom with a 32px top radius and a grab handle. */
.sheet{inset:auto 0 0;margin:0 auto;max-width:var(--content-sm);width:100%;max-height:92dvh;border-radius:var(--radius-3xl) var(--radius-3xl) 0 0;border-width:1px 0 0;padding:var(--space-2-5) var(--space-5) max(var(--space-8),var(--safe-bottom))}
.sheet::before{content:'';display:block;width:2.5rem;height:.3125rem;margin:0 auto var(--space-4);border-radius:var(--radius-full);background:var(--line-strong)}
.sheet[open]{animation:sheet-in var(--motion-slow) var(--ease-out-expo)}
.sheet[data-size="full"]{inset:0;max-height:100dvh;height:100dvh;max-width:100%;border-radius:0;border:0;padding-top:max(var(--space-6),var(--safe-top))}.sheet[data-size="full"]::before{display:none}
@keyframes sheet-in{from{transform:translateY(100%)}}
.sticky-actions{position:sticky;bottom:0;z-index:var(--layer-sticky);display:flex;flex-direction:column;gap:var(--space-1);padding:var(--space-4) var(--space-4) max(var(--space-6),var(--safe-bottom));background:transparent}.sticky-actions>.button{width:100%}
/* List rows live inside one card, separated by 1px lines; the first row has no top rule. */
.list-row{display:flex;align-items:center;gap:var(--space-3-5);min-height:var(--space-16);padding-block:var(--space-3-5);border-top:1px solid var(--line);text-decoration:none;color:var(--fg);text-align:left;width:100%;background:transparent;border-inline:0;border-bottom:0}
.list-row:first-child{border-top:0}.list-row__body{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-0-5)}
.list-row__title{font-size:var(--text-body);font-weight:var(--weight-semibold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__description{color:var(--fg-muted);font-size:var(--text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
a.list-row:active,button.list-row:active{opacity:.6}
.safe-bottom{padding-bottom:max(var(--space-4),var(--safe-bottom))}.scroll-region{overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:none}
