/* The Services page (services.html): a short head (who we work with, the flagship services),
   then one tab per service area (a row on phones and tablets, a list down the side on desktop).
   Each panel shows the area's 3D object (js/services.js draws it into .area-stage) and a grid
   of service tiles; a tile opens the .flow pop-up showing how that service's workflow runs.
   Tokens come from css/site.css. */

:root {
  --bar-h: 72px; /* the fixed site header (64px on phones, see site.css) */
  --tabs-h: 56px;
  --stick-h: var(--tabs-h); /* what stays stuck under the header: the tab row (none on desktop) */
  --stage-bg: color-mix(in srgb, var(--paper) 45%, var(--plaster));
  --hair: color-mix(in srgb, var(--ink) 9%, transparent);
  --hair-strong: color-mix(in srgb, var(--ink) 26%, transparent);
  --brand-soft: color-mix(in srgb, var(--brand) 8%, #fff);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html { scrollbar-gutter: stable; scroll-padding-top: calc(var(--bar-h) + var(--stick-h) + 16px); }
body:has(.flow[open]) { overflow: hidden; } /* the page stays put behind the pop-up */

.svc-main [hidden], .flow [hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ page head */
.svc-main { padding-top: var(--bar-h); }
.svc-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 48px;
  padding: clamp(44px, 9vh, 96px) var(--gutter) clamp(28px, 4.5vh, 44px);
}
.svc-head h1 { font-size: var(--t-h1); line-height: 0.95; }
#svc-summary { max-width: 32ch; padding-bottom: 0.35em; font-size: var(--t-body); line-height: 1.5; color: var(--ink-2); }
.svc-noscript { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); }

/* who we work with: one quiet line */
.industries { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 18px; font-size: 0.875rem; line-height: 1.5; }
.industries-label { color: var(--ink); font-weight: 500; }
/* plain spacing, no separators: a wrapped line never starts with a stray dot */
.industries-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; color: var(--ink-2); }
.industries-list li { white-space: nowrap; }

/* the flagship services: a slim strip that opens their pop-ups */
.featured { padding: 0 var(--gutter) clamp(32px, 5vh, 48px); }
.featured-label { margin-bottom: 12px; font-size: 0.875rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.featured-list { display: grid; gap: 10px; }
.feature {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  min-height: 76px; margin: 0; padding: 14px 20px 14px 14px; border: 0; border-radius: 18px; cursor: pointer;
  font: inherit; text-align: left; color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--hair);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 180ms ease, transform 180ms var(--ease-out);
}
.feature-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--brand); }
.feature-icon svg { display: block; }
.feature-text { display: grid; gap: 3px; min-width: 0; }
.feature-name { font-size: 1.02rem; font-weight: 500; line-height: 1.25; letter-spacing: -0.012em; }
.feature-line { font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.feature-cta { font-size: 0.875rem; font-weight: 500; color: var(--brand); white-space: nowrap; }
@media (hover: hover) {
  .feature:hover { box-shadow: inset 0 0 0 1px var(--hair-strong); }
  .feature:hover .feature-cta { text-decoration: underline; text-underline-offset: 4px; }
}
.feature:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 18px; }
.feature:active { transform: scale(0.99); }
@media (max-width: 559px) {
  .feature { gap: 14px; min-height: 68px; padding: 12px 14px 12px 12px; border-radius: 16px; }
  .feature:focus-visible { border-radius: 16px; }
  .feature-icon { width: 42px; height: 42px; border-radius: 12px; }
}
@media (max-width: 1023px) {
  .feature { grid-template-columns: auto minmax(0, 1fr); }
  .feature-cta { display: none; }
}
@media (min-width: 760px) {
  .featured-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ------------------------------------------------------------------ tabs */
.tabs-sentinel { height: 0; }
.tabs-bar {
  position: sticky; top: var(--bar-h); z-index: 10; min-height: var(--tabs-h);
  background: var(--paper); box-shadow: 0 1px 0 var(--line);
}
/* phones: the row scrolls sideways inside itself, never the page; the cut edge fades */
.tabs-scroll {
  --fl: 0px; --fr: 0px;
  position: relative; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll.fade-l { --fl: 36px; }
.tabs-scroll.fade-r { --fr: 36px; }
.tabs { display: flex; gap: 2px; width: max-content; min-width: 100%; padding: 0 calc(var(--gutter) - 12px); }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: var(--tabs-h); padding: 0 12px;
  border: 0; border-radius: 0; background: none; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  font: 500 0.95rem/1 var(--font); letter-spacing: -0.005em; color: var(--ink-2);
  transition: color 160ms ease;
}
.tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--brand); transform: scaleX(0); transition: transform 260ms var(--ease-out);
}
.tab:hover, .tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--ink-2); background: color-mix(in srgb, var(--ink) 7%, transparent);
  transition: background-color 160ms ease, color 160ms ease;
}
.tab[aria-selected="true"] .tab-count { color: #fff; background: var(--brand); }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -6px; border-radius: 12px; }

/* ------------------------------------------------------------------ panels */
.panels { padding: clamp(36px, 6vh, 64px) var(--gutter) clamp(80px, 13vh, 140px); }
.area { display: grid; gap: 32px; }
.area-title { font-size: clamp(1.85rem, 1.35rem + 1.6vw, 2.8rem); line-height: 1.03; }
.area-intro { margin-top: 14px; max-width: 40ch; font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

/* the area's 3D object: one shared canvas, moved into the active panel's stage */
.area-stage {
  position: relative; margin-top: 24px; height: clamp(220px, 58vw, 300px); border-radius: 22px; overflow: hidden;
  background: var(--stage-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 5%, transparent);
}
.stage-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 500ms ease; }
.stage-canvas.is-on { opacity: 1; }
.no-3d .area-stage { display: none; }

/* ------------------------------------------------------------------ service tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles > li { display: flex; min-width: 0; }
.tile {
  position: relative; flex: 1; min-width: 0; min-height: 116px; margin: 0; padding: 13px 13px 15px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; gap: 14px 6px;
  border: 0; border-radius: 16px; background: var(--plaster); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair);
  font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}
.tile-icon {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: var(--brand); background: var(--brand-soft);
  transition: background-color 200ms ease, color 200ms ease, transform 320ms var(--ease-out);
}
.tile-icon svg, .flow-icon svg, .step-chip svg { display: block; }
.tile .kind { justify-self: end; }
.tile-name {
  grid-column: 1 / -1; align-self: end;
  font-size: 0.93rem; font-weight: 500; line-height: 1.28; letter-spacing: -0.012em; text-wrap: pretty; overflow-wrap: break-word;
}
@media (hover: hover) {
  .tile:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--hair-strong); }
  .tile:hover .tile-icon { color: #fff; background: var(--brand); transform: translateY(-2px); }
}
.tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 16px; background: #fff; }
.tile:focus-visible .tile-icon { color: #fff; background: var(--brand); }
.tile:active { transform: scale(0.985); }

/* Core / Add-on / Pilot */
.kind {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 500; line-height: 1; letter-spacing: 0.005em; white-space: nowrap;
  color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.kind[data-kind="core"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: none; }
.kind[data-kind="pilot"] { color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 38%, transparent); }

.kinds { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 24px 0 0; font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }
.kinds > div { display: flex; align-items: center; gap: 9px; }
.kinds dt, .kinds dd { margin: 0; }

/* a tab change: text and tiles rise in, one after another */
@media (prefers-reduced-motion: no-preference) {
  .area.is-entering .area-text { animation: svc-rise 460ms var(--ease-out) both; }
  .area.is-entering .tiles > li { animation: svc-rise 460ms var(--ease-out) both; animation-delay: calc(40ms + min(var(--i, 0), 14) * 22ms); }
  .area.is-entering .kinds { animation: svc-fade 460ms ease 260ms both; }
}
@keyframes svc-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes svc-fade { from { opacity: 0; } }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
  .tile { min-height: 132px; padding: 16px 16px 18px; gap: 18px 8px; border-radius: 18px; }
  .tile:focus-visible { border-radius: 18px; }
  .tile-icon { width: 40px; height: 40px; border-radius: 12px; }
  .tile-name { font-size: 0.98rem; }
}

/* tablets: text beside the object, tiles below */
@media (min-width: 700px) and (max-width: 1023px) {
  .area-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; }
  .area-stage { margin-top: 0; height: 300px; }
}

/* desktop: the tabs become a list down the side, held in view; the panel fills the rest */
@media (min-width: 1024px) {
  :root { --stick-h: 0px; }
  .svc-areas {
    display: grid; grid-template-columns: clamp(220px, 19vw, 272px) minmax(0, 1fr); column-gap: clamp(40px, 4.5vw, 80px);
    align-items: start; padding: clamp(28px, 5vh, 48px) var(--gutter) clamp(80px, 13vh, 140px);
    border-top: 1px solid var(--line);
  }
  .tabs-bar { position: sticky; top: calc(var(--bar-h) + 28px); z-index: auto; min-height: 0; background: none; box-shadow: none; }
  .tabs-scroll { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .tabs { flex-direction: column; gap: 0; width: auto; min-width: 0; padding: 0; box-shadow: inset 1px 0 0 var(--line); }
  .tab {
    width: 100%; height: auto; min-height: 48px; padding: 12px 10px 12px 18px; justify-content: space-between;
    white-space: normal; text-align: left; line-height: 1.3; border-radius: 0 12px 12px 0;
    transition: color 160ms ease, background-color 160ms ease;
  }
  .tab::after { top: 10px; bottom: 10px; left: 0; right: auto; width: 2px; height: auto; border-radius: 0 2px 2px 0; transform: scaleY(0); }
  .tab[aria-selected="true"]::after { transform: scaleY(1); }
  .tab:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
  .tab[aria-selected="true"] { background: none; }
  .tab:focus-visible { outline-offset: -2px; border-radius: 0 12px 12px 0; }
  .panels { padding: 0; }
  .area-stage { height: 320px; }
}
/* wide: the area's text beside its object, the tiles below */
@media (min-width: 1200px) {
  .area-lead { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
  .area-stage { margin-top: 0; height: clamp(280px, 38vh, 380px); }
}

/* ------------------------------------------------------------------ the pop-up */
.flow {
  --pad: 40px;
  width: min(820px, calc(100% - 32px)); max-width: none; max-height: min(900px, calc(100dvh - 40px)); /* % of the viewport without the reserved scrollbar gutter */
  margin: auto; padding: 0; border: 0; border-radius: 24px; overflow: hidden;
  background: var(--plaster); color: var(--ink); font-family: var(--font);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent), 0 48px 100px -40px rgba(28, 30, 35, 0.55);
}
/* body scrolls; previous/next and the two actions stay in view along the bottom */
.flow[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "body body" "pager actions";
  animation: flow-in 280ms var(--ease-out);
}
.flow::backdrop { background: rgba(28, 30, 35, 0.44); }
.flow[open]::backdrop { animation: flow-fade 220ms ease; }

.flow-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 42px; height: 42px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--plaster); color: var(--ink); transition: background-color 160ms ease;
}
.flow-close:hover { background: color-mix(in srgb, var(--ink) 7%, var(--plaster)); }
.flow-close:focus-visible { border-radius: 50%; outline-offset: 0; }

.flow-body { grid-area: body; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 36px var(--pad) 34px; }
.flow h3 { margin: 0; font-size: 0.95rem; font-weight: 500; letter-spacing: -0.005em; }

.flow-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; padding-right: 44px; }
.flow-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }
.flow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; font-size: 0.85rem; color: var(--ink-2); }
#flow-title { font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.2rem); line-height: 1.06; }
#flow-title:focus { outline: none; }
.flow-short { margin-top: 10px; max-width: 48ch; font-size: 1.05rem; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }

.flow-sec { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.flow-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 22px; }
.flow-key { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--ink-2); }
.flow-key span { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.flow-none { font-size: 0.95rem; line-height: 1.55; color: var(--ink-2); }

/* "How it works": icon chips in a row, joined by a line a blue dot travels along
   (js/services-page.js animates .track-run and .track-fill; the stacked layout sets --axis: y) */
.flow-how { container: how / inline-size; }
.diagram { --chip: 52px; --row: 60px; position: relative; padding-top: 4px; }
.steps {
  position: relative; z-index: 1; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
}
.step { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 6px; text-align: center; }
.step-chip {
  flex: none; width: var(--chip); height: var(--chip); border-radius: 16px; display: grid; place-items: center;
  background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, var(--line));
}
.step.is-ai .step-chip { background: var(--brand); color: #fff; box-shadow: none; }
.step-label { max-width: 16ch; font-size: 0.86rem; line-height: 1.32; text-wrap: balance; }
.track {
  position: absolute; z-index: 0; top: calc(4px + var(--chip) / 2 - 1px);
  left: calc(50% / var(--n, 4)); right: calc(50% / var(--n, 4)); height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--brand) 16%, var(--line));
}
.track-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--brand); transform-origin: 0 50%; transform: scaleX(0); }
.track-run { position: absolute; inset: 0; opacity: 0; transform: translateX(-100%); }
.track-dot {
  position: absolute; top: 50%; right: -6px; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--plaster);
}
@container how (max-width: 520px) {
  .diagram { --axis: y; --chip: 44px; }
  .steps { grid-template-columns: minmax(0, 1fr); grid-auto-rows: var(--row); }
  .step { flex-direction: row; gap: 16px; padding: 0; text-align: left; }
  .step-label { max-width: none; font-size: 0.92rem; }
  .step-chip { border-radius: 14px; }
  .track { top: calc(4px + var(--row) / 2); bottom: calc(var(--row) / 2); left: calc(var(--chip) / 2 - 1px); right: auto; width: 2px; height: auto; }
  .track-fill { transform-origin: 50% 0; transform: scaleY(0); }
  .track-run { transform: translateY(-100%); }
  .track-dot { top: auto; right: auto; bottom: -6px; left: 50%; margin: 0 0 0 -6px; }
}

/* "How we set it up" (a numbered sequence) beside "You give us" */
.flow-cols { display: grid; gap: 28px 44px; }
.flow-cols h3 { margin-bottom: 18px; }
@media (min-width: 680px) {
  .flow-cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.flow-setup { list-style: none; margin: 0; padding: 0; counter-reset: setup; }
.flow-setup li {
  position: relative; counter-increment: setup; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px;
  padding-bottom: 16px; font-size: 0.95rem; line-height: 1.45;
}
.flow-setup li:last-child { padding-bottom: 0; }
.flow-setup li::before {
  content: counter(setup); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--brand);
  background: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent);
}
.flow-setup li:not(:last-child)::after {
  content: ""; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1px;
  background: color-mix(in srgb, var(--brand) 20%, var(--line));
}
.flow-setup li span { padding-top: 2px; }
.flow-needs-wrap { align-self: start; padding: 20px 22px 22px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--hair); }
.flow-needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.flow-needs li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; font-size: 0.95rem; line-height: 1.45; }
.flow-needs li::before { content: ""; width: 6px; height: 6px; margin-top: 0.55em; border-radius: 2px; background: var(--brand); }

/* previous / next, and the actions */
.flow-pager {
  grid-area: pager; display: flex; align-items: center; gap: 2px;
  padding: 14px 0 14px calc(var(--pad) - 12px); border-top: 1px solid var(--line);
}
.pager-btn {
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--ink); transition: background-color 160ms ease;
}
.pager-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pager-btn:focus-visible { border-radius: 50%; outline-offset: 0; }
.flow-pos { min-width: 3.8em; text-align: center; font-size: 0.85rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.flow-actions {
  grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px var(--pad) 14px 16px; border-top: 1px solid var(--line);
}
.btn-line {
  display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 999px;
  font: 500 0.95rem/1 var(--font); color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 24%, transparent); transition: box-shadow 160ms ease;
}
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.flow-actions .btn:focus-visible, .flow-actions .btn-line:focus-visible { border-radius: 999px; }

/* moving between services: the content slides in from the side it came from */
.flow-swap.swap-next { animation: swap-next 240ms var(--ease-out); }
.flow-swap.swap-prev { animation: swap-prev 240ms var(--ease-out); }
@keyframes swap-next { from { opacity: 0; transform: translateX(16px); } }
@keyframes swap-prev { from { opacity: 0; transform: translateX(-16px); } }
@keyframes flow-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(48px); } }
@keyframes flow-fade { from { opacity: 0; } }

/* ------------------------------------------------------------------ phones */
@media (max-width: 760px) {
  :root { --bar-h: 64px; --tabs-h: 52px; }
  .btn-line { padding: 10px 14px; font-size: 0.875rem; }
}

/* the pop-up becomes a sheet: previous/next and close along the top, the actions stacked below */
@media (max-width: 600px) {
  .flow { --pad: 20px; width: 100%; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .flow[open] {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "pager close" "body body" "actions actions";
    animation-name: sheet-in;
  }
  .flow-close { position: static; grid-area: close; width: 44px; height: 44px; margin: 10px 10px 0 0; }
  .flow-pager { padding: 10px 0 0 8px; border-top: 0; }
  .pager-btn { width: 44px; height: 44px; }
  .flow-body { padding: 14px var(--pad) 26px; }
  .flow-head { gap: 14px; padding-right: 0; }
  .flow-icon { width: 44px; height: 44px; border-radius: 13px; }
  .flow-sec { margin-top: 24px; padding-top: 22px; }
  .flow-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .flow-actions > * { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .track-run, .track-fill { display: none; }
  .flow[open], .flow[open]::backdrop, .flow-swap.swap-next, .flow-swap.swap-prev { animation: none; }
  .tab, .tab::after, .tab-count, .tile, .tile-icon, .feature, .stage-canvas, .flow-close, .pager-btn, .btn-line { transition: none; }
}
