/* Wardro demo v4: the page around the phone, the device, the shell (tabs,
   navigation stacks, sheets, overlays) and the components every screen
   shares. Each screen's own styles are in /assets/demo5/css/<screen>.css.
   Values come from the Wardro app (Tokens.swift, Typography.swift,
   Surfaces.swift, ButtonStyles.swift, Palette.swift, Motion.swift) or, where
   the app leaves it to the system (tab bar, bar buttons, sheets, menus,
   alerts), from iOS 26 as drawn in the app's own screenshots. */

/* ---------- The page ---------- */
body.demo {
  --frame: #0b0b0d;
  --frame-edge: #2a2a2e;
  --frame-shadow: 0 0 0 1px #000, 0 50px 120px -30px rgba(47, 191, 152, 0.22), 0 40px 80px -20px #000;
}
@media (prefers-color-scheme: light) {
  body.demo {
    --frame: #1d1d1f;
    --frame-edge: #3a3a3c;
    --frame-shadow: 0 0 0 1px rgba(24, 24, 27, 0.08), 0 50px 110px -40px rgba(8, 116, 89, 0.25), 0 30px 60px -30px rgba(24, 24, 27, 0.35);
  }
}
body.demo { height: 100dvh; min-height: 0; overflow: hidden; }
body.demo header.site { flex: none; }
.stage {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 26rem) auto; justify-content: center; align-items: center;
  gap: clamp(2rem, 8vw, 8rem);
  padding-bottom: 1.5rem;
}
.about h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin: 0 0 1rem; }
.about .eyebrow { margin: 0 0 1rem; }
.about .lede { margin-bottom: 1.5rem; }
.try { list-style: none; padding: 0; margin: 0 0 1.75rem; display: grid; gap: 0; max-width: 24rem; border-top: 1px solid var(--rule); }
.try li { margin: 0; border-bottom: 1px solid var(--rule); }
.try a { display: flex; justify-content: space-between; padding: 0.7rem 0; color: var(--soft); text-decoration: none; transition: color 0.2s, transform 0.3s var(--ease); }
.try a::after { content: "→"; color: var(--muted); transition: transform 0.3s var(--ease), color 0.2s; }
.try a:hover { color: var(--fg); transform: translateX(0.25rem); }
.try a:hover::after { color: var(--accent); transform: translateX(3px); }
.fine { color: var(--muted); font-size: 0.85rem; max-width: 34ch; margin: 0; }

/* The device: an iPhone 17 Pro drawn at its real size (402 × 874 pt screen,
   12pt bezel), scaled by main.js to fit the window (.phone takes the scaled size). */
.phone { position: relative; width: 426px; height: 898px; }
.device {
  position: absolute; left: 0; top: 0; width: 426px; height: 898px; padding: 12px;
  border-radius: 68px; background: var(--frame);
  box-shadow: var(--frame-shadow), inset 0 0 0 1.5px var(--frame-edge), inset 0 0 0 5px #000;
  transform-origin: 0 0;
}
.device .app { width: 402px; height: 874px; border-radius: 56px; }
.island { position: absolute; z-index: 30; left: 50%; top: 23px; width: 124px; height: 36px; margin-left: -62px; border-radius: 18px; background: #000; pointer-events: none; }

/* Phone-sized browsers: the app is the page, edge to edge, no fake phone. */
@media (max-width: 52rem) {
  body.demo header.site, .about { display: none; }
  .stage { display: block; padding: 0; max-width: none; height: 100%; }
  .phone, .device { position: fixed; inset: 0; width: auto; height: auto; padding: 0; border-radius: 0; box-shadow: none; background: none; transform: none !important; }
  .device .app { width: 100%; height: 100%; border-radius: 0; touch-action: pan-x pan-y; } /* the app does not zoom: no page pinch */
  .island, .app .statusbar, .app .home-indicator { display: none; }
  /* Safari paints its own bars (status bar, the floating toolbar) from the
     page: give it the app's page colour, not the site's. */
  html, body.demo { background: #000; }
}
@media (max-width: 52rem) and (prefers-color-scheme: light) { html, body.demo { background: #fff; } }
@media (min-width: 52.01rem) { .app .first-note { display: none; } }
/* The keyboard is up (main.js): it covers where the tab bar was. */
.app.kb-open { --tabbar-h: 0px; --tabbar-gap: 6px; --safe-bottom: 0px; }
.app.kb-open .tabbar { visibility: hidden; }
body.bare .app .first-note { display: none; }

/* ---------- The app: tokens ----------
   Dark (the app's default look): page #000, grouped greys #1C1C1E / #2C2C2E
   (Surface), Pine #0D9571 (AccentColor dark), primary fill #F4F4F2 on
   #0E0E10 (PrimarySurface), secondary = label at 60%, tonal fills =
   secondary at 15% (ButtonStyles). Light: the app's light values. */
.app {
  --bg: #000;
  --card: #1c1c1e;
  --card2: #2c2c2e;
  --ink: #fff;
  --sub: rgba(235, 235, 245, 0.6);
  --faint: rgba(235, 235, 245, 0.3);
  --fill: rgba(235, 235, 245, 0.09);
  --fill-strong: rgba(235, 235, 245, 0.16);
  --line: rgba(84, 84, 88, 0.6);
  --acc: #0d9571;
  --acc-ink: #0d9571;
  --on-acc: #000;   /* AccentSetting onAccent: black on the dark-mode accent */
  --acc-tint: rgba(13, 149, 113, 0.16);
  --acc-tint-strong: rgba(13, 149, 113, 0.26);
  --primary: #f4f4f2;
  --on-primary: #0e0e10;
  --red: #ff453a;
  --me: #f4f4f2;
  --on-me: #0e0e10;
  --field: rgba(28, 28, 30, 0.9);
  /* Liquid Glass, as the app's bars draw it on iOS 26 */
  --glass: rgba(30, 30, 32, 0.94);
  --glass-strong: rgba(36, 36, 38, 0.99);
  /* Materials. Every glass surface is opaque enough to look like the app's
     even where backdrop-filter is not drawn (Playwright's WebKit, some
     desktop GPUs): in the app nothing behind the tab bar or a bar button is
     readable (51-tabbar-closeup-*, 52-topbar-closeup-*), only a dark tint.
     Where the blur is drawn it adds the soft colour of what is behind. The
     tab bar is solid: the app's is a flat dark (or light) grey at rest. */
  --tabbar-bg: rgb(22, 22, 24);
  --mat-regular: rgba(44, 44, 46, 0.92);
  --mat-thick: rgba(30, 30, 32, 0.95);
  --mat-sheet: rgba(30, 30, 32, 0.985);
  --tab-acc: #27b38a;
  --tabbar-solid: rgba(28, 28, 30, 0.97);
  --tabbar-rim: rgba(255, 255, 255, 0.1);
  --glass-rim: rgba(255, 255, 255, 0.13);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  --glass-blur: blur(14px) saturate(1.7);
  --tab-on: rgba(255, 255, 255, 0.14);
  --seg-bg: #1c1c1e;
  --seg-on: #636366;
  --menu-bg: rgba(40, 40, 42, 0.96);
  --menu-line: rgba(255, 255, 255, 0.1);
  --scrim: rgba(0, 0, 0, 1);
  --sheet-bg: #1c1c1e;
  --sheet-page: #1c1c1e;
  --sheet-card: #2c2c2e;
  --sheet-card2: #3a3a3c;
  --cell-line: rgba(255, 255, 255, 0.07);
  --dot-ring: rgba(255, 255, 255, 0.25);
  --badge-bg: rgba(0, 0, 0, 0.55);
  --x-bg: #48484a;
  --halo-rgb: 255, 255, 255;
  --spring: #5baa72; --on-spring: #000;
  --summer: #dda632; --on-summer: #000;
  --fall: #d07340; --on-fall: #fff;
  --winter: #5390cb; --on-winter: #fff;
  --off: #8e8e93;

  /* Type (Typography.swift: New York semibold titles; Apple's text styles) */
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --text: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --t-body: 17px; --t-callout: 16px; --t-sub: 15px; --t-foot: 13px; --t-cap: 12px; --t-cap2: 11px;
  --t-bar: 20px; --t-title: 22px; --t-large: 28px;
  /* Space and radius (Tokens.swift) */
  --s-xs: 4px; --s-snug: 6px; --s-s: 8px; --s-m: 12px; --s-l: 16px; --s-xl: 24px;
  --r-badge: 8px; --r-thumb: 10px; --r-card: 12px; --r-panel: 14px; --r-hero: 16px;
  /* Motion (Motion.swift): press easeOut 0.12, receipt snappy 0.2, crossfade easeInOut 0.3 */
  --press: 0.12s cubic-bezier(0, 0, 0.58, 1);
  --receipt: 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
  --crossfade: 0.3s cubic-bezier(0.42, 0, 0.58, 1);
  /* Layout the shell measures (env.js probes these) */
  --safe-top: 62px; --safe-bottom: 34px;
  --bar-h: 44px;
  --tabbar-h: 62px;
  --tabbar-gap: 21px;

  position: relative; overflow: hidden; isolation: isolate;
  background: var(--bg); color: var(--ink);
  font: 400 var(--t-body)/1.29 var(--text); letter-spacing: -0.022em;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 52rem) {
  .app { --safe-top: max(6px, env(safe-area-inset-top, 0px)); --safe-bottom: env(safe-area-inset-bottom, 0px); --tabbar-gap: max(12px, calc(env(safe-area-inset-bottom, 0px) - 12px)); }
}
@media (prefers-color-scheme: light) {
  .app {
    --bg: #fff;
    --card: #f2f2f7;
    --card2: #e5e5ea;
    --ink: #000;
    --sub: rgba(60, 60, 67, 0.6);
    --faint: rgba(60, 60, 67, 0.3);
    --fill: rgba(60, 60, 67, 0.09);
    --fill-strong: rgba(60, 60, 67, 0.15);
    --line: rgba(60, 60, 67, 0.22);
    --acc: #0f775c;
    --acc-ink: #0f775c;
    --on-acc: #fff;
    --acc-tint: rgba(15, 119, 92, 0.1);
    --acc-tint-strong: rgba(15, 119, 92, 0.17);
    --primary: #1a1a1d;
    --on-primary: #fff;
    --red: #d70015;
    --me: #1a1a1d;
    --on-me: #fff;
    --field: rgba(255, 255, 255, 0.92);
    --glass: rgba(255, 255, 255, 0.94);
    --glass-strong: rgba(255, 255, 255, 0.99);
    --tabbar-bg: rgb(250, 250, 252);
    --mat-regular: rgba(242, 242, 247, 0.93);
    --mat-thick: rgba(255, 255, 255, 0.95);
    --mat-sheet: rgba(250, 250, 252, 0.985);
    --tab-acc: var(--acc-ink);
    --tabbar-solid: rgba(250, 250, 252, 0.97);
    --tabbar-rim: rgba(0, 0, 0, 0.06);
    --glass-rim: rgba(0, 0, 0, 0.05);
    --glass-hi: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    --tab-on: rgba(0, 0, 0, 0.07);
    --seg-bg: #eeeef0;
    --seg-on: #fff;
    --menu-bg: rgba(250, 250, 252, 0.96);
    --scrim: rgba(0, 0, 0, 0.63); /* a sheet's dim reads 0.22 black in light mode (app/34-*-light), 0.35 in dark */
    --menu-line: rgba(0, 0, 0, 0.08);
    --sheet-bg: #fff;
    --sheet-page: #fff;
    --sheet-card: #f2f2f7;
    --sheet-card2: #e5e5ea;
    --cell-line: rgba(0, 0, 0, 0.08);
    --dot-ring: rgba(0, 0, 0, 0.2);
    --x-bg: #8e8e93;
    --halo-rgb: 0, 0, 0;
    --spring: #4e9a63; --on-spring: #fff;
    --summer: #d49a1e; --on-summer: #000;
    --fall: #c4622f; --on-fall: #fff;
    --winter: #3f7db8; --on-winter: #fff;
  }
  .app img[data-halo] { --halo: 0 !important; }
  .app img[data-halo-l] { --halo: var(--halo-l) !important; }
}

/* ---------- Resets inside the app ---------- */
.app *, .app *::before, .app *::after { box-sizing: border-box; }
.app button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; letter-spacing: inherit; }
.app a { color: inherit; text-decoration: none; }
.app :focus { outline: none; }
.app :focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 10px; }
.app h1, .app h2, .app h3, .app p, .app ul { margin: 0; }
.app ul { padding: 0; }
.app img { -webkit-user-drag: none; }
.app input, .app textarea { -webkit-user-select: text; user-select: text; }
/* The site's own rules (site.v7.css) must not reach into the app: its
   document `section` (grey --soft text, a grid, padding and a rule on top)
   matched every page, which is why bar titles, headings and names drew grey
   instead of the label colour; its `.btn` added a border, 15px type and a hover lift;
   `strong` took the site's colour. */
/* Element rules of the site's sheet, undone under :where(.app) (no weight, so
   any screen class still wins): pages, sheets and overlays alike. */
:where(.app) section { display: block; padding: 0; border: 0; gap: 0; color: inherit; grid-template-columns: none; }
:where(.app) section > h2 { font: inherit; color: inherit; margin: 0; }
:where(.app) section > div { max-width: none; }
:where(.app) section > div > :last-child { margin-bottom: 0; }
:where(.app) h1 { font: inherit; letter-spacing: inherit; margin: 0; }
:where(.app) ol { margin: 0; padding: 0; }
:where(.app) li { margin: 0; }
:where(.app) strong { color: inherit; }
:where(.app) table { font-size: inherit; }
:where(.app) th, :where(.app) td { border: 0; padding: 0; }
.app a.btn, .app button.btn { border: 0; font-size: var(--t-body); line-height: 1.2; text-decoration: none; }
.app .btn:hover:not(.is-pressed) { transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.probe { position: absolute; left: 0; top: 0; width: 0; visibility: hidden; pointer-events: none; }
.probe-safe-top { height: var(--safe-top); }
.probe-safe-bottom { height: var(--safe-bottom); }

/* ---------- Icons (core/icons.js): outline at the regular weight, fills for .fill ---------- */
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.i .f { fill: currentColor; stroke: none; }
.i .fs { fill: currentColor; }
.i .k { stroke: var(--knock, var(--bg)); }
.i .kf { fill: var(--knock, var(--bg)); stroke: none; }
.i .heavy { stroke-width: 2.1; }
.i .thin { stroke-width: 1.3; }
.i .dash { stroke-dasharray: 2.2 2.4; }
.i .gear { stroke-width: 3.2; stroke-dasharray: 2.3 2.05; stroke-linecap: butt; }

/* ---------- The shell ---------- */
.scene, .tabpanes, .tabpane, .navstack, .modal-layer, .overlay-layer { position: absolute; inset: 0; }
.scene { transform-origin: 50% 0; background: var(--bg); }
.scene.is-receded, .sheet.is-receded { border-radius: 38px; overflow: hidden; }
.tabpane { visibility: hidden; }
.tabpane.is-on { visibility: visible; }
.navstack { overflow: hidden; }
.modal-layer { z-index: 20; pointer-events: none; }
.modal-layer > * { pointer-events: auto; }
.overlay-layer { z-index: 40; pointer-events: none; }
.overlay-layer > * { pointer-events: auto; }

/* A page: its content slides (push/pop), its bar stays and cross-fades. */
.page { position: absolute; inset: 0; }
.page.is-under { visibility: hidden; }
.page-content { position: absolute; inset: 0; background: var(--bg); will-change: transform; }
.in-tx .page-content { box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18); }
.page-scroll { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.page-scroll::-webkit-scrollbar { display: none; }
.page-body { min-height: 100%; padding: calc(var(--safe-top) + var(--bar-h) + 10px) var(--s-l) calc(var(--tabbar-h) + var(--tabbar-gap) + 40px); }
.page.no-bar .page-body { padding-top: calc(var(--safe-top) + 8px); }
.page-dim { position: absolute; inset: 0; z-index: 3; background: rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; will-change: opacity; }
.page-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 28px; z-index: 2; pointer-events: none; }

/* The bar: transparent over the page, with the iOS 26 scroll-edge blur once the page scrolls under it. */
.page-bar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); align-items: center; gap: var(--s-s);
  height: calc(var(--safe-top) + var(--bar-h) + 8px); padding: calc(var(--safe-top)) var(--s-l) 8px;
  pointer-events: none;
}
.page-bar > * { pointer-events: auto; }
.page-bar::before {
  content: ""; position: absolute; inset: 0 0 -18px; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--bg) 50%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
  opacity: 0; transition: opacity var(--crossfade);
}
.page.is-scrolled .page-bar::before { opacity: 1; }
.page.no-bar .page-bar { display: none; }
.bar-side { display: flex; align-items: center; gap: var(--s-m); min-width: 0; min-height: 44px; }
.bar-side.end { justify-content: flex-end; }
.bar-title { font: 600 var(--t-bar)/1.15 var(--serif); letter-spacing: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Glass bar buttons (44pt round, accent glyph; capsules with words) ---------- */
.app .glass {
  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; min-width: 44px; border-radius: 22px;
  background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 0.5px var(--glass-rim), inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  transition: transform var(--press), opacity var(--press);
}
.app .glass.round { width: 44px; padding: 0; }
.app .glass.round .i { width: 24px; height: 24px; }
.app .glass.pill { padding: 0 16px; font-size: var(--t-body); font-weight: 500; white-space: nowrap; }
.app .glass.pill .i { width: 19px; height: 19px; }
.app .glass.accent { color: var(--acc-ink); }
.app .glass.prominent { background: var(--acc); color: var(--on-acc); font-weight: 600; }
.app .glass.is-on { background: var(--acc-tint-strong); color: var(--acc-ink); }
.app .glass:disabled { opacity: 0.4; }
/* The profile mark: 36pt, inside its own 44pt glass button (ProfileAvatarButton in a SoloToolbarItem; 52-topbar-closeup). */
.avatar { flex: none; display: block; width: 44px; height: 44px; padding: 4px; border-radius: 50%; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 0 0 0.5px var(--glass-rim), var(--glass-shadow); transition: transform var(--press), opacity var(--press); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 12%; display: block; }

/* ---------- Tab bar: the iOS 26 floating capsule ----------
   21pt in from the sides and the bottom, 62pt tall, five tabs, the
   selected one on a lighter capsule in Pine; labels 10pt semibold. */
.tabbar {
  position: absolute; z-index: 10; left: 21px; right: 21px; bottom: var(--tabbar-gap); height: var(--tabbar-h);
  display: flex; padding: 4px 9px; border-radius: 31px;
  background: var(--tabbar-solid);
  box-shadow: inset 0 0 0 1px var(--tabbar-rim), inset 0 1px 0 var(--glass-hi), 0 8px 24px rgba(0, 0, 0, 0.4);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabbar { background: var(--tabbar-bg); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
}
@media (prefers-color-scheme: light) { .tabbar { box-shadow: inset 0 0 0 1px var(--tabbar-rim), 0 8px 28px rgba(0, 0, 0, 0.1); } }
/* The pill steps one tab width per tab (nav.js movePill); what is drawn is a little wider than the tab, as iOS 26 draws it. */
.tabbar-pill { position: absolute; left: 9px; top: 4px; bottom: 4px; width: calc((100% - 18px) / var(--tabs, 5)); will-change: transform; }
.tabbar-pill::before { content: ""; position: absolute; inset: 0 -5px; border-radius: 27px; background: var(--tab-on); }
.tab { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink); font: 500 10px/1.2 var(--text); letter-spacing: 0.01em; transition: transform var(--press), color 0.2s; }
.tab .i { width: 28px; height: 28px; }
.tab[aria-current] { color: var(--tab-acc, var(--acc-ink)); }
.tab span { white-space: nowrap; }

/* ---------- Sheets and covers (core/sheet.js) ---------- */
.sheet-wrap { position: absolute; inset: 0; }
.sheet-wrap.is-leaving { pointer-events: none; }
.sheet-dim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; will-change: opacity; }
.sheet {
  position: absolute; left: 0; right: 0; top: 0; overflow: hidden;
  border-radius: 38px 38px 0 0; background: var(--sheet-bg);
  box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25); will-change: transform; transform-origin: 50% 0;
}
.sheet .page-content { background: var(--sheet-page); }
/* Inside a dark sheet (#1C1C1E) the grouped greys step up one, as iOS's elevated colours do. */
.sheet { --card: var(--sheet-card); --card2: var(--sheet-card2); --seg-bg: var(--sheet-card); }
.sheet .page-bar::before { background: linear-gradient(var(--sheet-page) 50%, transparent); }
.sheet .page-body { padding-top: calc(var(--bar-h) + 22px); padding-bottom: calc(var(--safe-bottom) + 32px); }
.sheet .page.no-bar .page-body { padding-top: 24px; }
.sheet .page-bar { height: calc(var(--bar-h) + 20px); padding-top: 14px; }
.sheet-grabber { position: absolute; z-index: 8; left: 50%; top: 5px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--faint); }
.sheet-grabber::after { content: ""; position: absolute; inset: -14px -40px; }
/* The inset iOS 26 sheet (sheet.js floating), until it reaches the large detent. */
.sheet-wrap.is-floating .sheet { left: 8px; right: 8px; border-radius: 38px; transition: left 0.3s, right 0.3s, border-radius 0.3s; }
.sheet-wrap.is-floating.is-large .sheet { left: 0; right: 0; border-radius: 38px 38px 0 0; }
/* clearThrough: nothing dimmed, and the screen behind takes taps. */
.modal-layer > .sheet-wrap.is-clear { pointer-events: none; }
.modal-layer > .sheet-wrap.is-clear .sheet { pointer-events: auto; }
/* Below the large detent a page in a sheet ends where the screen does. */
.sheet-host > .page .page-scroll { bottom: var(--sheet-under, 0px); }
.sheet-content { position: relative; }
.is-mini .sheet-host { height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.mini-sheet { padding: 24px 16px 12px; }
.is-cover .sheet { border-radius: 0; box-shadow: none; background: var(--bg); }
.is-cover .sheet .page-content { background: var(--bg); }
.is-cover .sheet .page-body { padding-top: calc(var(--safe-top) + var(--bar-h) + 10px); }
.is-cover .sheet .page-bar { height: calc(var(--safe-top) + var(--bar-h) + 8px); padding-top: var(--safe-top); }

/* ---------- Menus, alerts, dialogs (core/overlay.js) ---------- */
.overlay { position: absolute; inset: 0; }
.overlay-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); opacity: 0; }
.menu {
  position: absolute; min-width: 220px; max-width: 290px; padding: 6px 0; border-radius: 24px;
  background: var(--menu-bg); color: var(--ink);
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 18px 50px rgba(0, 0, 0, 0.35);
  will-change: transform, opacity;
}
.menu-title { padding: 8px 18px 6px; color: var(--sub); font-size: var(--t-foot); text-align: center; }
.menu-section + .menu-section { border-top: 6px solid var(--menu-line); margin-top: 4px; padding-top: 4px; }
.menu-head { padding: 8px 18px 4px; color: var(--sub); font-size: var(--t-foot); }
.app .menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 18px 0 14px; font-size: var(--t-body); transition: background var(--press); }
.menu-item.is-pressed, .app .menu-item:hover { background: var(--fill-strong); }
.menu-icon { width: 22px; display: flex; justify-content: center; }
.menu-icon .i { width: 19px; height: 19px; }
.menu-item.is-destructive { color: var(--red); }
.menu-label { display: flex; flex-direction: column; min-width: 0; padding: 4px 0; }
.menu-sub { color: var(--sub); font-size: var(--t-foot); line-height: 1.25; }
.menu-text { padding: 4px 18px 8px; color: var(--sub); font-size: var(--t-foot); line-height: 1.3; }
.menu-head + .menu-text { padding-top: 2px; }
.app .alert-field { display: block; width: 100%; height: 36px; margin-top: 14px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill-strong); color: var(--ink); font: inherit; font-size: var(--t-sub); -webkit-appearance: none; appearance: none; }
.alert-field::placeholder { color: var(--sub); }
.app .alert-field:focus-visible { outline: none; }
.menu-item[aria-disabled="true"] { opacity: 0.35; }
.alert {
  position: absolute; left: 50%; top: 50%; width: 300px; padding: 22px 18px 16px; border-radius: 34px; text-align: center;
  background: var(--menu-bg); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
}
.alert-title { font: 600 var(--t-body)/1.3 var(--text); }
.alert-msg { margin-top: 6px !important; font-size: var(--t-sub); line-height: 1.35; color: var(--ink); }
.alert-btns { display: flex; gap: 10px; margin-top: 18px; }
.alert-btns.is-stacked { flex-direction: column; }
.app .alert-btn { flex: 1; min-height: 48px; border-radius: 24px; background: var(--fill-strong); font-weight: 500; text-align: center; transition: transform var(--press), opacity var(--press); }
.app .alert-btn.is-default:last-child { background: var(--acc); color: var(--on-acc); font-weight: 600; }
.alert-btn.is-destructive { color: var(--red); }
.dialog-card { position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-bottom) + 8px); display: grid; gap: 8px; }
.dialog-group, .app .dialog-btn.is-cancel { border-radius: 26px; background: var(--menu-bg); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: inset 0 0 0 0.5px var(--glass-rim); overflow: hidden; }
.dialog-head { padding: 14px 18px 12px; text-align: center; color: var(--sub); font-size: var(--t-foot); border-bottom: 0.5px solid var(--line); }
.dialog-title { font-weight: 600; }
.app .dialog-btn { display: block; width: 100%; min-height: 56px; text-align: center; font-size: 19px; color: var(--acc-ink); border-top: 0.5px solid var(--line); }
.dialog-head + .dialog-btn, .dialog-group > .dialog-btn:first-child { border-top: 0; }
.app .dialog-btn.is-cancel { font-weight: 600; border-top: 0; }
.dialog-btn.is-destructive { color: var(--red); }

/* ---------- Device chrome (framed phone only) ---------- */
.statusbar { position: absolute; z-index: 50; left: 0; right: 0; top: 0; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 12px 34px 0 46px; pointer-events: none; color: var(--ink); }
.sb-time { font: 600 17px/1 var(--text); letter-spacing: -0.01em; width: 54px; text-align: center; }
.sb-right { display: flex; align-items: center; gap: 6px; }
.sb-signal { width: 18px; height: 12px; fill: currentColor; }
.sb-wifi { width: 16px; height: 12px; fill: currentColor; }
.sb-battery { position: relative; width: 27px; height: 13px; border-radius: 4px; border: 1px solid currentColor; opacity: 0.95; }
.sb-battery::after { content: ""; position: absolute; right: -3.5px; top: 4px; width: 1.5px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; opacity: 0.5; }
.sb-battery i { position: absolute; inset: 1.5px; right: 4px; border-radius: 2px; background: currentColor; }
.home-indicator { position: absolute; z-index: 50; left: 50%; bottom: 8px; width: 140px; height: 5px; margin-left: -70px; border-radius: 3px; background: var(--ink); opacity: 0.85; pointer-events: none; }
.first-note {
  position: absolute; z-index: 15; left: 50%; bottom: calc(var(--tabbar-gap) + var(--tabbar-h) + 10px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; max-width: calc(100% - 32px); padding: 0 4px 0 14px; height: 34px; border-radius: 17px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 0.5px var(--glass-rim), var(--glass-shadow);
  font-size: var(--t-foot); color: var(--sub); white-space: nowrap; transition: opacity 0.3s, transform 0.3s;
}
.first-note span { overflow: hidden; text-overflow: ellipsis; }
.first-note button { display: grid; place-items: center; width: 30px; height: 30px; color: var(--sub); }
.first-note .i { width: 14px; height: 14px; stroke-width: 2.2; }
/* Today's floating "+" sits where the note would: the note goes above it. */
.app:has(.tab[data-tab="today"][aria-current]) .first-note { bottom: calc(var(--tabbar-gap) + var(--tabbar-h) + 84px); }
.first-note.is-gone { opacity: 0; transform: translate(-50%, 8px); }

/* ---------- Press feedback (ButtonStyles: primary 0.8 + 0.97, tonal 0.7, quiet 0.5, all easeOut 0.12) ---------- */
.app .is-pressed { opacity: 0.7; }
.app .glass.is-pressed, .app .avatar.is-pressed { transform: scale(0.92); opacity: 1; filter: brightness(1.25); }
.app .tab.is-pressed { transform: scale(0.92); opacity: 1; }
.app .btn.is-pressed, .app .btn-wide.is-pressed { opacity: 0.8; transform: scale(0.985); }
.app .tile.is-pressed, .app .ocard.is-pressed { opacity: 1; }
.app .tile.is-pressed .tile-pic, .app .ocard.is-pressed .ocard-pic { transform: scale(0.96); }
.app .link.is-pressed { opacity: 0.5; }
.app .chip.is-pressed, .app .cap.is-pressed { opacity: 0.7; transform: scale(0.97); }
.app .alert-btn.is-pressed, .app .dialog-btn.is-pressed { opacity: 0.6; }

/* ---------- Components ---------- */
/* Search field (the app's capsule search, 44pt) */
.search { position: relative; display: block; margin: 0 0 var(--s-m); }
.search .i { position: absolute; left: 14px; top: 11px; width: 21px; height: 21px; color: var(--sub); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 44px; border-radius: 22px; border: 0;
  background: var(--field); color: var(--ink); font: inherit; font-size: var(--t-body);
  box-shadow: inset 0 0 0 0.5px var(--glass-rim), var(--glass-shadow); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--sub); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:disabled { opacity: 0.55; }

/* Segmented control (32pt, the thumb slides; dom.js placeSegments) */
.seg { position: relative; display: flex; height: 32px; padding: 2px; margin: 0 0 var(--s-m); border-radius: 16px; background: var(--seg-bg); }
.seg-thumb { position: absolute; left: 2px; top: 2px; bottom: 2px; width: calc((100% - 4px) / var(--n, 2)); border-radius: 14px; background: var(--seg-on); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); transition: transform 0.35s cubic-bezier(0.3, 1.2, 0.4, 1); }
.seg-thumb.no-anim { transition: none; }
.app .seg-item { position: relative; flex: 1; display: grid; place-items: center; font-size: var(--t-sub); font-weight: 500; letter-spacing: -0.01em; }
.seg-item[aria-current] { font-weight: 600; }

/* Chips (32pt capsules; selected = Pine with the count and a check) */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-s); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--s-l)); padding: 0 var(--s-l) 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar, .strip::-webkit-scrollbar { display: none; }
.app .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--card); font-size: var(--t-body); white-space: nowrap; transition: background var(--receipt), color var(--receipt), transform var(--press), opacity var(--press); }
.chip-n { color: var(--sub); font-size: var(--t-foot); }
.chip .i { width: 15px; height: 15px; stroke-width: 2.3; }
.app .chip.is-on { background: var(--acc); color: var(--on-acc); }
.chip.is-on .chip-n { color: var(--on-acc); opacity: 0.85; }
.dot { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--dot-ring); }

/* Garment tiles: a square, no card, the cut-out at its type's share (--x) with the 5.5% margin */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-m); }
.grid.c1 { grid-template-columns: minmax(0, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.app .tile, .app .ocard { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.tile-pic, .ocard-pic { position: relative; display: block; width: 100%; transition: transform var(--press); }
.tile-pic { aspect-ratio: 1; border-radius: var(--r-card); }
.tile-pic > img { position: absolute; left: 50%; top: 50%; width: calc(89% * var(--x, 0.86)); height: calc(89% * var(--x, 0.86)); transform: translate(-50%, -50%); object-fit: contain; }
.app img { --halo: 0; }
.tile-pic img:is([data-halo], [data-halo-l]) { filter: drop-shadow(0 0 5px rgba(var(--halo-rgb), var(--halo))); }
.lay img:is([data-halo], [data-halo-l]) { filter: drop-shadow(0 0 3.5px rgba(var(--halo-rgb), var(--halo))); }
.tile-name { margin-top: var(--s-xs); font-size: var(--t-cap); line-height: 1.25; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-sub { margin-top: 2px; font-size: var(--t-cap2); color: var(--sub); letter-spacing: 0; }
.badge { position: absolute; right: 4px; bottom: 4px; display: inline-flex; padding: 2px 6px; border-radius: 999px; background: var(--badge-bg); color: #fff; font-size: var(--t-cap2); font-weight: 600; letter-spacing: 0; }
.strip { display: flex; gap: var(--s-m); overflow-x: auto; margin: 0 calc(-1 * var(--s-l)); padding: 0 var(--s-l); scrollbar-width: none; }
.strip > * { flex: 0 0 88px; }

/* Outfits: the flat lay on the page and the corner glyph */
.ogrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-m); }
.ocard-pic { aspect-ratio: 2 / 3; }
.glyph { align-self: flex-end; line-height: 0; margin-top: 2px; color: var(--ink); }
.glyph .i { width: 16px; height: 16px; }
/* An outfit tile's try-on (OutfitGridTile): the photograph fills the tile's box, rounded, its 3:4 box
   reserved before it loads; and the fallback glyph when the tile drew less than its mode promised. */
.otry { position: absolute; inset: 4px; overflow: hidden; border-radius: var(--r-card); background: var(--card); }
.otry img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.ofall { position: absolute; z-index: 2; right: 4px; bottom: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.ofall .i { width: 13px; height: 13px; stroke-width: 2.1; }
/* Two pictures of one outfit in one box, crossfading (Motion.crossfade: easeInOut 0.3 s). */
.xf { position: relative; display: block; }
.xf > .xf-side { position: absolute; inset: 0; display: block; transition: opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1); }
.xf > .xf-side.is-off { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .xf > .xf-side { transition: none; } }
.lay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lay-in { position: relative; display: block; width: 100%; height: 100%; }
.lay-p { position: absolute; display: block; }
.lay-p img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Cards, headings, rows */
.card { margin-top: var(--s-m); padding: var(--s-l); border-radius: var(--r-panel); background: var(--card); }
.label { margin: 22px 0 10px !important; font: 400 var(--t-cap)/1 var(--text); letter-spacing: 0.04em; text-transform: uppercase; color: var(--sub); }
.card-head { margin: 0 0 var(--s-m) !important; font: 600 18px/1.2 var(--serif); letter-spacing: 0.02em; font-variant: small-caps; }
.card-head span, .group span { margin-left: 4px; color: var(--sub); font: 400 var(--t-sub) var(--text); font-variant: normal; letter-spacing: 0; }
.group { margin: 14px 0 8px !important; font: 600 20px/1.2 var(--text); letter-spacing: -0.01em; }
.title { margin: var(--s-l) 0 2px !important; font: 600 var(--t-title)/1.2 var(--serif); letter-spacing: 0; text-align: center; text-wrap: balance; }
.title span { color: var(--sub); }
.kind { margin-bottom: 14px !important; color: var(--sub); text-align: center; font-size: var(--t-sub); }
.quiet { color: var(--sub); }
.center { text-align: center; }
.empty { padding: 3rem 0; color: var(--sub); text-align: center; }
.rows { margin-top: var(--s-m); padding: 0 var(--s-l); border-radius: var(--r-panel); background: var(--card); }
.app .row { display: flex; align-items: center; gap: var(--s-m); width: 100%; min-height: 52px; padding: 10px 0; border-top: 0.5px solid var(--line); text-align: left; transition: opacity var(--press); }
.row:first-child { border-top: 0; }
.row > .i { width: 24px; height: 24px; color: var(--acc-ink); }
.row b { display: block; font-weight: 400; }
.row small { display: block; color: var(--sub); font-size: var(--t-foot); }

/* Buttons (ButtonStyles.swift) */
.app .btn-wide { display: flex; align-items: center; justify-content: center; gap: var(--s-s); width: 100%; min-height: 50px; padding: 0 var(--s-l); border-radius: var(--r-panel); background: var(--primary); color: var(--on-primary); font-weight: 600; transition: transform var(--press), opacity var(--press); }
.app .btn-wide .i { width: 20px; height: 20px; }
.app .btn-wide.tonal { background: var(--fill-strong); color: var(--ink); font-weight: 600; }
.app .btn-wide:disabled { opacity: 0.4; cursor: default; }
.app .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 0 var(--s-l); border-radius: 25px; background: var(--primary); color: var(--on-primary); font-weight: 600; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22); transition: transform var(--press), opacity var(--press); }
.app .btn:disabled { background: var(--card); color: var(--sub); box-shadow: none; }
.app .cap { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--fill-strong); font-size: var(--t-sub); font-weight: 600; white-space: nowrap; transition: transform var(--press), opacity var(--press), color var(--receipt); }
.app .cap .i { width: 15px; height: 15px; stroke-width: 2.2; }
.app .cap.is-on { color: var(--sub); }
.app .link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--acc-ink); font-size: var(--t-sub); transition: opacity var(--press); }
.link .i { width: 18px; height: 18px; }

/* Three (or two) numbers in a card */

/* CostChip ("✦ 1", ui.js costChip): .quaternary of the label it sits on, so it reads on the primary fill and on a tonal one. */
.cost { position: relative; flex: none; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 11px; font: 600 var(--t-foot)/1 var(--text); letter-spacing: 0; font-variant-numeric: tabular-nums; isolation: isolate; }
.cost::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: currentColor; opacity: 0.16; }
.cost .i { width: 13px; height: 13px; }
.cost.sm { height: 16px; padding: 0 5px; gap: 2px; border-radius: 8px; font-size: var(--t-cap2); }
.cost.sm .i { width: 10px; height: 10px; }
.credit-line { display: flex; align-items: center; gap: 4px; font-size: var(--t-cap); color: var(--sub); letter-spacing: 0; }
.credit-line .i { width: 11px; height: 11px; }

/* The "Demo: …" line at the foot of every prepared screen */
.demo-line { margin: var(--s-xl) 0 0 !important; padding-top: var(--s-m); border-top: 0.5px solid var(--line); color: var(--sub); font-size: var(--t-foot); line-height: 1.4; letter-spacing: -0.005em; }

/* ---------- Motion that is CSS ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes v4-arrive { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
  @keyframes v4-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes v4-gone { to { opacity: 0; visibility: hidden; } }
  @keyframes v4-spin { to { transform: rotate(360deg); } }
  @keyframes v4-pulse { 50% { opacity: 0.3; transform: scale(0.8); } }
  .arrive { animation: v4-arrive 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
