html {
  --demo-screen-cover: radial-gradient(ellipse at 86% 12%, #264b79, transparent 56%),
    radial-gradient(ellipse at 17% 79%, #172f59, transparent 52%), #0b182c;
}

.demo-hero-stage {
  position: relative; z-index: 1; display: grid; justify-items: center;
  align-content: center; gap: 20px; min-height: min(45vw, 595px); padding: 18px 0;
}
.demo-hero-phone {
  position: relative; display: block; width: min(51%, 224px); aspect-ratio: 344/798;
  padding: 5px; border-radius: 27px; background: #171d28;
  box-shadow: 2px 2px 0 1px #6b798b, 10px 24px 36px #15243b42;
  transform: perspective(930px) rotateY(-8deg) rotateZ(5deg);
  transition: transform .3s ease, box-shadow .3s ease;
}
.demo-hero-phone:hover,.demo-hero-phone:focus-visible {
  transform: perspective(930px) rotateY(-2deg) rotateZ(2deg) translateY(-4px);
  box-shadow: 2px 2px 0 1px #6b798b, 10px 27px 43px #15243b50;
}
:root:has(.demo-dock[open]:not([data-resting])) .demo-hero-phone { visibility: hidden; }
:root:has(.demo-dock[data-resting]:not([data-preparing])) .demo-hero-phone {
  background: transparent;
  box-shadow: none;
  transform: perspective(930px) rotateY(-8deg) rotateZ(5deg);
  transition: none;
}
:root:has(.demo-dock[data-resting]:not([data-preparing])) .demo-hero-phone > * { visibility: hidden; }
.demo-hero-preview {
  position: absolute; inset: 5px;
  width: calc(100% - 10px); height: calc(100% - 10px);
  border-radius: 22px; background: #fff; object-fit: contain;
}
.demo-play {
  position: absolute; right: 13px; bottom: 46px; opacity: 0;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: #fff; background: #0965bd; border: 1px solid #ffffff53;
  padding-left: 2px; box-shadow: 0 5px 16px #05122165;
}
.demo-hero-phone:hover .demo-play,.demo-hero-phone:focus-visible .demo-play { opacity: 1; }
/* Keep the static phone in place until the first Flutter frame is ready. */
.demo-dock[data-preparing] { opacity: 0; }
.demo-dock[data-preparing]:not([data-revealing]) iframe { visibility: hidden; }
:root:has(.demo-dock[data-revealing]) .demo-hero-phone { opacity: 0; transition: opacity .08s ease-out .1s; }
.demo-dock[data-preparing] :is(iframe, .demo-screen-preview, .demo-launch) { transition: none; }
.demo-hero-status {
  position: absolute; z-index: 1; bottom: -5px; inset-inline: 0; text-align: center;
  font: 600 12px/1.5 var(--mono); color: var(--muted);
}
.demo-hero-status:empty { display: none; }

.demo-hero-caption {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 12px;
  color: var(--muted); font: 600 12px/1.5 var(--mono);
}
.demo-hero-caption a,.demo-home,.demo-store,.demo-dock-links a { color: var(--ink); text-underline-offset: 4px; }
.hero-product:has(.demo-hero-stage) { aspect-ratio: auto; }
.hero-product:has(.demo-hero-stage) .orbit-two { opacity: .62; }
.demo-orbit-wheel,.demo-orbit-body { position: absolute; inset: 0; }
.demo-orbit-body {
  background: var(--ring-fills);
  mask: radial-gradient(circle closest-side, transparent 70.4%, #000 70.7% 96.2%, transparent 96.5%);
}
.demo-orbit-cap {
  position: absolute; left: var(--cap-x); top: var(--cap-y);
  width: 12.844%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%,-50%);
  background: var(--cap-color);
}


.demo-page,.demo-dialog { --demo-surface: var(--paper); --demo-line: var(--line); --demo-accent: var(--red); }
.demo-page { min-height: 100dvh; }
.demo-site-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px var(--gutter); min-height: 64px; border-bottom: 1px solid var(--line); }
.demo-home { font-size: 13px; }
.demo-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) min(37vw, 352px);
  grid-template-areas: "intro phone" "controls phone" "footer phone";
  grid-template-rows: auto auto 1fr; align-items: start; gap: 16px clamp(32px, 6vw, 85px);
  max-width: 1150px; margin-inline: auto; padding: clamp(24px, 4vw, 54px) var(--pad) 30px;
}
.demo-intro { grid-area: intro; }
.demo-kicker,.demo-dialog-head p { font: 650 12px/1.5 var(--mono); color: var(--demo-accent); }
.demo-intro h1 { margin: 8px 0 13px; font-size: clamp(49px, 5.25vw, 80px); letter-spacing: -.075em; line-height: .96; }
.demo-intro h1 span { color: var(--demo-accent); }
.demo-intro > p:last-child { max-width: 36ch; font-size: clamp(15px, 1.35vw, 18px); }
.demo-stage-foot { grid-area: footer; }
.demo-stage-foot { display: block; background: none; padding: 0; color: var(--muted); font-size: 12px; }
.demo-stage-foot p { margin-bottom: 6px; }
.demo-store { font-size: 14px; font-weight: 650; }

.demo-device {
  grid-area: phone; width: 100%; max-width: 352px; height: clamp(650px, calc(100dvh - 131px), 830px);
  padding: 5px; background: #171d28; border-radius: 31px; min-width: 0; min-height: 0;
  box-shadow: 2px 1px 0 1px #697587, 11px 20px 37px #20334c35;
}
.demo-screen {
  position: relative; height: 100%; min-height: 0; overflow: hidden;
  border-radius: 26px; background: var(--demo-screen-cover);
}
.demo-screen-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff;
}
[data-ready] .demo-screen-preview { visibility: hidden; transition: visibility 0s .18s; }
.demo-screen iframe {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  visibility: hidden; opacity: 0; transition: opacity .18s ease-out;
}
[data-ready] .demo-screen iframe { visibility: visible; opacity: 1; }
[data-ready] .demo-launch { pointer-events: none; visibility: hidden; opacity: 0; transition: opacity .18s ease-out, visibility 0s .18s; }
.demo-launch {
  position: absolute; inset: auto 0 0; display: grid; align-content: center; justify-items: center; gap: 8px;
  padding: 21px 14px 18px; color: #263345; text-align: center;
  background: linear-gradient(transparent, #f7f9fc 45%);
}
.demo-launch p { font-size: 13px; color: inherit; }
.demo-launch p:empty,.demo-launch [hidden] { display: none; }
.demo-launch a { font-size: 13px; color: #095aa5; text-underline-offset: 3px; }
.demo-start { border: 0; border-radius: 100px; background: #0969c2; color: #fff; font: 680 15px/1.12 Inter,sans-serif; padding: 13px 22px; cursor: pointer; }
[data-loading] .demo-launch p::before {
  content: ""; display: inline-block; vertical-align: -.13em; width: 12px; height: 12px; margin-right: 7px;
  border-radius: 50%; border: 2px solid #0969c2; border-right-color: transparent; animation: demo-spin 1s linear infinite;
}
@keyframes demo-spin { to { transform: rotate(360deg); } }

.demo-controls { grid-area: controls; min-width: 0; min-height: 0; }
.demo-fieldset { display: block; min-inline-size: 0; padding: 0; border: 0; margin: 0; }
.demo-fieldset legend { font-weight: 760; font-size: 14px; padding: 0; margin: 0 0 7px; color: var(--ink); }
.demo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 13px; border-top: 1px solid var(--demo-line); }
.demo-actions button,.demo-reset,.demo-time button,.demo-back,.demo-switch button {
  font: 600 13px/1.3 Inter,sans-serif; color: var(--ink); background: transparent; cursor: pointer;
}
.demo-actions button { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 5px; border: 0; border-bottom: 1px solid var(--demo-line); text-align: left; padding: 5px 2px; }
.demo-actions button > span { flex: none; color: var(--muted); }
.demo-actions button[aria-pressed=true],.demo-actions button:hover,.demo-reset:hover,.demo-time button:hover { color: var(--demo-accent); }
.demo-fieldset:disabled button,.demo-fieldset:disabled select { cursor: default; opacity: .6; }
.demo-settings { border-top: 1px solid var(--demo-line); padding-top: 8px; }
.demo-settings legend { padding-right: 9px; margin-bottom: 1px; }
.demo-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.demo-selects label { font-size: 12px; color: var(--muted); font-weight: 630; }
.demo-selects select { display: block; width: 100%; margin-top: 3px; border: 1px solid var(--demo-line); border-radius: 8px; padding: 7px; background: var(--demo-surface); color: var(--ink); font: inherit; }
.demo-date { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 6px; font-size: 12px; color: var(--muted); }
.demo-date time { font: 650 12px/1.65 var(--mono); color: var(--ink); }
.demo-time { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-time button { min-height: 35px; padding: 4px 11px; border: 1px solid var(--demo-line); border-radius: 7px; }
.demo-top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.demo-reset {
  min-height: 34px; padding: 4px 10px; white-space: nowrap; border: 1px solid var(--demo-line);
  border-radius: 100px; background: var(--demo-surface); font-size: 12px;
}
.demo-reset > span { margin-right: 2px; font-size: 14px; vertical-align: -.05em; }
.demo-reset:disabled { opacity: .55; cursor: default; }

.demo-session { margin: 1px 0 0; font-size: 11px; }
.demo-session:empty { display: none; }
.demo-switch,.demo-back,.demo-app-hint,.demo-tab { display: none; }

.demo-dock {
  box-sizing: border-box;
  z-index: 20;
  color: var(--ink);
  overscroll-behavior: contain;
}
.demo-dock[data-closing] { pointer-events: none; }
.demo-dock[data-closing] :is(.demo-dialog-head, .demo-tab, .demo-controls, .demo-switch, .demo-app-hint) {
  opacity: 0;
  transition: opacity .16s ease;
}
.demo-dock::backdrop { background: rgb(14 24 38 / 43%); }
.demo-lock { overflow: hidden; }
.demo-dialog-inner { display: grid; }
.demo-dialog-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.demo-dialog-head h2 { font-size: clamp(20px, 2.65vw, 34px); letter-spacing: -.055em; line-height: 1.1; }
.demo-dialog-head p { margin-top: 3px; }
.demo-close {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--demo-line);
  background: var(--demo-surface); color: var(--ink); font: 25px/1 Arial,sans-serif; cursor: pointer;
}
.demo-close:hover { background: var(--white); color: var(--demo-accent); }


@media (max-width: 850px) {
  .demo-hero-stage { min-height: 450px; }
  .demo-hero-phone { width: min(66%, 220px); }
}
@media (max-width: 590px) {
  .hero-product:has(.demo-hero-stage) { width: 100%; }
  .demo-hero-stage { min-height: 0; padding-block: 4px 10px; gap: 15px; }
  .demo-hero-phone { width: min(58%, 206px); }
}

@media (max-width: 740px), (max-height: 650px) {
  .demo-dialog-inner,.demo-stage[data-active] {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "switch" "hint" "phone"; grid-template-rows: auto auto auto minmax(0, 1fr);
  }
  .demo-dock {
    width: min(100%, 460px); height: 100dvh; max-height: none; max-width: none;
    margin: auto; padding: 0; border: 0; overflow: hidden; background: var(--demo-surface);
  }
  .demo-dialog-inner { box-sizing: border-box; min-height: 0; height: 100%; padding: 0; gap: 0; }
  .demo-dialog-head { padding: 6px 12px; min-height: 53px; }
  .demo-dialog-head p { font-size: 11px; }
  .demo-close { width: 40px; height: 40px; }
  .demo-switch { grid-area: switch; display: flex; border-block: 1px solid var(--demo-line); padding: 3px 7px; gap: 5px; }
  .demo-switch button { flex: 1; min-height: 39px; text-align: center; border: 1px solid transparent; border-radius: 6px; }
  .demo-switch button[aria-pressed=true] { border-color: var(--demo-line); background: var(--white); }
  [data-view="controls"] .demo-device,[data-view="controls"] .demo-screen iframe { visibility: hidden; }
  [data-view="app"] .demo-app-hint:not([hidden]) { display: block; grid-area: hint; padding: 6px 12px; font-size: 12px; border-bottom: 1px solid var(--demo-line); }
  .demo-dialog [data-view="controls"] .demo-controls,.demo-stage[data-view="controls"] .demo-controls { grid-area: phone; align-self: stretch; overflow: auto; max-height: none; background: var(--demo-surface); }
  [data-view="app"] .demo-controls { display: none; }
  .demo-dialog .demo-device,.demo-stage[data-active] .demo-device {
    justify-self: center; height: 100%; width: 100%; max-width: 440px; border-radius: 0; padding: 0; box-shadow: none;
  }
  .demo-dialog .demo-screen,.demo-stage[data-active] .demo-screen { border-radius: 0; }
  .demo-controls { padding: 16px; }
  .demo-back { display: block; padding: 7px 0; border: 0; color: var(--demo-accent); margin-bottom: 10px; }
  .demo-stage {
    grid-template-areas: "intro" "phone" "footer"; grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr; padding: 25px 16px 31px; gap: 19px;
  }
  .demo-stage:not([data-active]) .demo-switch,.demo-stage:not([data-active]) .demo-controls { display: none; }
  .demo-stage:not([data-active]) .demo-device { width: min(100%, 375px); height: min(143vw, 620px); justify-self: center; }
  .demo-page:has([data-active]) { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .demo-page:has([data-active]) .demo-site-head { min-height: 48px; padding: 5px 12px; flex: none; }
  .demo-stage[data-active] { grid-template-areas: "switch" "hint" "phone"; grid-template-rows: auto auto minmax(0, 1fr); flex: 1; min-height: 0; width: 100%; margin: 0 auto; padding: 0; gap: 0; }
  .demo-stage[data-active] .demo-intro,.demo-stage[data-active] .demo-stage-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-hero-phone,.demo-screen iframe,[data-ready] :is(.demo-screen-preview, .demo-launch) { transition: none; }
  [data-loading] .demo-launch p::before { animation: none; }
}


.demo-scenario-group + .demo-scenario-group { margin-top: 14px; }
.demo-scenario-group legend { margin-bottom: 9px; font-size: 13px; color: var(--muted); }
.demo-actions { gap: 7px; border-top: 0; }
.demo-actions button {
  position: relative; justify-content: flex-start; align-items: flex-start; gap: 8px; min-height: 70px;
  padding: 9px 10px; border: 1px solid var(--demo-line); border-radius: 12px;
  background: color-mix(in srgb,var(--white),var(--demo-accent) 3%);
}
.demo-actions button:hover,.demo-actions button[aria-pressed=true] {
  border-color: color-mix(in srgb,var(--demo-accent),var(--demo-line) 55%);
  background: color-mix(in srgb,var(--white),var(--demo-accent) 7%);
}
.demo-actions .demo-scenario-icon {
  display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px;
  flex: 0 0 23px; background: color-mix(in srgb,var(--white),var(--demo-accent) 14%);
  color: var(--demo-accent); font-size: 15px; line-height: 1;
}
.demo-actions .demo-scenario-label { min-width: 0; flex: 1; color: var(--ink); }
.demo-scenario-label b { display: block; font-size: 12px; font-weight: 720; line-height: 1.2; margin-bottom: 3px; }
.demo-scenario-label small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.32; }
.demo-actions .demo-scenario-arrow { margin-left: auto; color: var(--demo-accent); }
.demo-settings { margin-top: 18px; }
.demo-back { margin-top: 9px; }
.demo-session[data-result]:not(:empty) {
  margin-top: 8px; padding: 5px 8px; border-radius: 7px; color: var(--ink);
  background: color-mix(in srgb,var(--white),var(--demo-accent) 10%);
}
.demo-dock-links { display: flex; flex-wrap: wrap; gap: 5px 11px; margin-top: 12px; font-size: 12px; }
.demo-dock-links .demo-store { font-size: inherit; }
.demo-stage .demo-device { position: relative; }
.demo-stage .demo-device::before {
  content: ""; z-index: -1; position: absolute; inset: -10% -19%; pointer-events: none;
  background: radial-gradient(ellipse at 60% 51%, color-mix(in srgb,var(--demo-accent),transparent 82%), transparent 68%);
}

@media (min-width: 741px) and (min-height: 651px) {
  .demo-dock {
    --demo-handset-width: clamp(318px, 27vw, 344px);
    --demo-drawer-width: min(362px, 40vw);
    --demo-handset-height: min(798px, calc(100dvh - 99px));
    position: fixed; inset: auto clamp(13px, 3.25vw, 65px) 25px auto; width: max-content;
    height: auto; max-width: none; max-height: none; margin: 0; padding: 17px;
    background: transparent; border: 0; overflow: visible;
  }
  .demo-dock::backdrop { background: transparent; }
  .demo-dock .demo-dialog-inner {
    grid-template-columns: var(--demo-handset-width) 5px 0px;
    grid-template-areas: "head gap controls" "phone gap controls";
    grid-template-rows: 40px var(--demo-handset-height);
    row-gap: 8px;
    transition: grid-template-columns .32s cubic-bezier(.22,.74,.24,1);
  }
  .demo-dock [data-drawer="open"] {
    grid-template-columns: var(--demo-handset-width) 28px var(--demo-drawer-width);
  }
  .demo-dock .demo-dialog-head { align-items: center; padding-inline: 5px 0; }
  .demo-dock .demo-dialog-head h2 { font-size: 18px; }
  .demo-dock .demo-dialog-head > div { padding: 3px 5px; }
  .demo-dock .demo-dialog-head p { font-size: 10px; margin-top: 1px; }
  .demo-dock .demo-close { box-shadow: 0 2px 8px #15243b20; }
  .demo-dock .demo-device { height: 100%; padding: 5px; box-shadow: 2px 2px 0 1px #778494, 10px 19px 43px #17263855; }
  .demo-dock .demo-tab {
    display: grid; grid-area: gap; place-self: center start; place-items: center; z-index: 1;
    width: 28px; height: 60px; padding: 0; transform: translateX(-6px);
    color: var(--ink); background: var(--white); font: 26px/1 Arial,sans-serif;
    border: 1px solid var(--demo-line); border-radius: 0 11px 11px 0; cursor: pointer;
    box-shadow: 7px 3px 15px #17263826;
  }
  .demo-dock .demo-tab span { transition: transform .24s; }
  .demo-dock [data-drawer="open"] .demo-tab span { transform: rotate(180deg); }
  .demo-dock .demo-controls {
    align-self: stretch; min-width: 0; overflow: auto; overscroll-behavior: contain; visibility: hidden;
    opacity: 0; padding: 16px; border-radius: 18px; border: 1px solid var(--demo-line);
    background: var(--demo-surface); box-shadow: 0 10px 30px #17263822;
    transition: opacity .25s, visibility .25s;
  }
  .demo-dock [data-drawer="open"] .demo-controls { visibility: visible; opacity: 1; }
  .demo-dock .demo-actions { grid-template-columns: 1fr; }
  .demo-dock .demo-actions button { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-dock .demo-dialog-inner,.demo-dock .demo-controls,.demo-dock .demo-tab span { transition: none; }
}

@media (max-width: 390px) {
  .demo-site-head .demo-home span { display: none; }
  .demo-actions { grid-template-columns: 1fr; }
  .demo-actions button { min-height: 52px; }
}


.demo-dock[data-resting] {
  position: absolute;
  inset: auto;
  left: var(--park-left);
  top: var(--park-top);
  width: var(--park-width);
  height: var(--park-height);
  max-width: none;
  max-height: none;
  z-index: 3;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: calc(var(--park-device-radius) * var(--park-scale));
  overflow: hidden;
  pointer-events: none;
  background: #171d28;
  box-shadow: 2px 2px 0 1px #6b798b, 10px 24px 36px #15243b42;
  transform: var(--park-tilt);
}
.demo-dock[data-resting] .demo-dialog-inner {
  display: block;
  width: var(--park-device-width);
  height: var(--park-device-height);
  padding: 0;
  transform: scale(var(--park-scale));
  transform-origin: top left;
}
.demo-dock[data-resting] .demo-dialog-inner > :not(.demo-device) { display: none; }
.demo-dock[data-resting] .demo-device {
  width: 100%;
  height: 100%;
  max-width: none;
  padding: var(--park-bezel);
  border-radius: var(--park-device-radius);
  box-shadow: none;
}

.demo-dock[data-resting] .demo-screen { border-radius: var(--park-screen-radius); }
