:root{--device-top:0px;--device-bottom:0px}
:root[data-device="framed"]{--device-top:44px;--device-bottom:28px;scrollbar-width:none}
.app{min-height:100dvh;display:flex;flex-direction:column;background:var(--bg)}
/* App header: native 56px bar over the page. Back on the left, centered title, one contextual action on the right. A soft blur appears once content scrolls under it. */
.app-header{position:sticky;top:0;z-index:var(--layer-sticky);display:grid;grid-template-columns:minmax(var(--control-xl),1fr) auto minmax(var(--control-xl),1fr);align-items:center;gap:var(--space-2);min-height:calc(var(--header-height) + max(env(safe-area-inset-top),var(--device-top)));padding:max(env(safe-area-inset-top),var(--device-top)) var(--space-3) 0;background:color-mix(in srgb,var(--bg) 86%,transparent);backdrop-filter:saturate(1.4) blur(16px);-webkit-backdrop-filter:saturate(1.4) blur(16px)}
.app-header>:first-child{justify-self:start}.app-header>:last-child{justify-self:end}
.app-header .button--icon{--control-height:var(--touch-target);background:var(--bg-surface);box-shadow:var(--shadow-sm)}
.app-header__title{display:flex;flex-direction:column;align-items:center;gap:calc(var(--space-1) / 4);min-width:0;text-align:center}
.app-header__title>:first-child{font-size:var(--text-md);line-height:var(--line-height-compact);font-weight:var(--weight-semibold);letter-spacing:var(--letter-spacing-snug)}
.app-header__title>:nth-child(2){font-size:var(--text-xs);line-height:var(--line-height-compact);color:var(--fg-muted)}
.app-header .button[data-variant="link"]{--control-height:var(--touch-target);font-size:var(--text-ui)}
.app-content{flex:1;width:100%;min-width:0;padding:var(--space-4) var(--space-5) var(--space-8)}
.bottom-nav{position:sticky;bottom:0;z-index:var(--layer-sticky);display:flex;justify-content:space-around;min-height:var(--nav-height);padding:var(--space-2) var(--space-3) max(var(--space-2),max(env(safe-area-inset-bottom),var(--device-bottom)));background:var(--bg-surface);box-shadow:var(--shadow-md);margin-top:auto}
.bottom-nav__item{display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center;gap:var(--space-1);min-height:var(--touch-target);color:var(--fg-muted);text-decoration:none;font-size:var(--text-xs);line-height:var(--line-height-compact);font-weight:var(--weight-semibold);border-radius:var(--radius-sm)}.bottom-nav__item[aria-current="page"]{color:var(--fg)}
/* Sheet: rounded 32px top, grab handle, title row with a round close. */
.sheet{inset:auto 0 0;margin:0 auto;max-width:var(--content-sm);width:100%;max-height:90dvh;padding:var(--space-2) var(--space-6) max(var(--space-6),max(env(safe-area-inset-bottom),var(--device-bottom)));border-radius:var(--radius-2xl) var(--radius-2xl) 0 0;box-shadow:var(--shadow-sheet)}
.sheet[open]{animation:sheet-up var(--motion-slow) var(--ease-out)}
.sheet::before{content:'';display:block;width:2.25rem;height:var(--space-1);margin:0 auto var(--space-4);border-radius:var(--radius-full);background:var(--border)}
.sheet[data-size="full"]{inset:0;max-height:100dvh;height:100dvh;max-width:100%;border-radius:0;padding-top:max(var(--space-6),max(env(safe-area-inset-top),var(--device-top)))}.sheet[data-size="full"]::before{display:none}
@media(min-width:768px){.sheet:not([data-size="full"]){inset:0;margin:auto;max-height:calc(100dvh - var(--space-16));border-radius:var(--radius-2xl);padding-bottom:var(--space-6)}.sheet:not([data-size="full"])::before{display:none}.sheet[open]{animation:dialog-in var(--motion-normal) var(--ease-out)}}
@keyframes sheet-up{from{transform:translateY(100%)}to{transform:none}}
/* Sticky action bar: a floating rounded slab that keeps the primary action in thumb reach. It stays in document flow. */
.sticky-actions{position:sticky;bottom:max(var(--space-3),max(env(safe-area-inset-bottom),var(--device-bottom)));z-index:var(--layer-sticky);display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center;margin:0 var(--space-3) max(var(--space-3),max(env(safe-area-inset-bottom),var(--device-bottom)));padding:var(--space-3) var(--space-3) var(--space-3) var(--space-5);border-radius:var(--radius-xl);background:var(--bar-bg);color:var(--bar-fg);box-shadow:var(--shadow-lg)}
.sticky-actions>.button:only-child{flex:1}
.list-row{display:flex;align-items:center;gap:var(--space-3-5);min-height:var(--space-16);padding-block:var(--space-3);border-bottom:var(--border-width) solid var(--border);text-decoration:none;color:var(--fg);font-weight:var(--weight-regular)}.list-row:last-child{border-bottom:0}.list-row__body{display:flex;flex:1;flex-direction:column;gap:calc(var(--space-1) / 2);min-width:0}.list-row__title{font-weight:var(--weight-semibold)}.list-row__description{color:var(--fg-muted);font-size:var(--text-sm);line-height:var(--line-height-normal)}a.list-row:hover,button.list-row:hover{color:var(--fg)}a.list-row:hover .list-row__title{text-decoration:underline;text-underline-offset:4px}
.list-row__icon{display:grid;place-items:center;flex:none;width:var(--touch-target);height:var(--touch-target);border-radius:var(--radius-full);background:var(--bg-subtle);color:var(--fg)}
button.list-row{width:100%;border:0;border-bottom:var(--border-width) solid var(--border);background:transparent;text-align:left}button.list-row:last-child{border-bottom:0}
.safe-bottom{padding-bottom:max(var(--space-4),max(env(safe-area-inset-bottom),var(--device-bottom)))}.scroll-region{overflow:auto;overscroll-behavior:contain;min-height:0}
