/* Animated app demo in the landing hero. Colors mirror the Flutter app (lib/variables.dart). */

.demo {
  --demo-ink: #16202e;
  --demo-bp: #1b3a5c;
  --demo-bp2: #234a72;
  --demo-paper: #f3eee1;
  --demo-line: #e3dcc9;
  --demo-cream: #fdfbf6;
  --demo-red: #b8432e;
  --demo-green: #4b7a5c;
  --demo-amber: #c68a2e;
  --demo-closed: #8b8478;
  --demo-muted: #5a5548;
  --demo-hint: #7a7364;
  --demo-floor: #efe9d8;
  --demo-handle: #c7c7cc;
  --demo-badge-done: #6b7f95;
  --demo-overlay: rgba(22, 32, 46, 0.45);
  --demo-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --demo-mono: "IBM Plex Mono", ui-monospace, monospace;
  --demo-display: "Oswald", "Arial Narrow", sans-serif;
  --demo-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --demo-max-h: min(760px, 86vh);
  --demo-w: min(100%, calc(var(--demo-max-h) * 414 / 868));

  justify-self: center;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: 100%;
}

.demo-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* FittedBox: the device is laid out at 414x868 and scaled to the stage width by demo.js (--demo-k). */
.demo-stage {
  position: relative;
  width: var(--demo-w);
  aspect-ratio: 414 / 868;
}

.demo-device {
  position: absolute;
  left: 0;
  top: 0;
  width: 414px;
  height: 868px;
  border-radius: 66px;
  background: linear-gradient(150deg, #4a4c52 0%, #222326 28%, #2e2f33 62%, #55575d 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.16),
    0 34px 70px rgba(28, 26, 22, 0.22),
    0 12px 24px rgba(28, 26, 22, 0.12);
  transform-origin: 0 0;
  transform: scale(var(--demo-k, 0.75));
}

.demo-device::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 61px;
  background: #0b0b0d;
}

.demo-key {
  position: absolute;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2a2b2f, #5b5d63);
}

.demo-key-action { left: -3px; top: 150px; height: 32px; }
.demo-key-up { left: -3px; top: 210px; height: 62px; }
.demo-key-down { left: -3px; top: 286px; height: 62px; }
.demo-key-power { right: -3px; top: 238px; height: 98px; background: linear-gradient(90deg, #5b5d63, #2a2b2f); }

.demo-screen {
  position: absolute;
  inset: 12px;
  overflow: hidden;
  clip-path: inset(0 round 54px);
  border-radius: 54px;
  display: flex;
  flex-direction: column;
  background: var(--demo-paper);
  color: var(--demo-ink);
  font-family: var(--demo-sans);
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.demo-screen svg {
  display: block;
  flex: none;
}

.demo-ico {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-island {
  position: absolute;
  z-index: 30;
  top: 11px;
  left: 50%;
  width: 124px;
  height: 36px;
  margin-left: -62px;
  border-radius: 20px;
  background: #000;
}

.demo-home {
  position: absolute;
  z-index: 30;
  bottom: 8px;
  left: 50%;
  width: 136px;
  height: 5px;
  margin-left: -68px;
  border-radius: 3px;
  background: var(--demo-ink);
}

/* Header */

.demo-top {
  flex: none;
  background: var(--demo-bp);
  color: var(--demo-cream);
  padding-bottom: 12px;
}

.demo-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 4px 30px 0 52px;
  font-family: -apple-system, "SF Pro Text", var(--demo-sans);
  font-size: 17px;
  font-weight: 600;
}

.demo-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-status-icons svg {
  fill: currentColor;
}

.demo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px 0 12px;
}

.demo-head .demo-ico {
  width: 24px;
  height: 24px;
}

.demo-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--demo-display);
  font-size: 23px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.demo-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 2px 16px 0;
}

.demo-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(253, 251, 246, 0.66);
  font-family: var(--demo-display);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.demo-screen[data-view="walk"] [data-tab="walk"],
.demo-screen[data-view="act"] [data-tab="act"] {
  background: var(--demo-paper);
  color: var(--demo-bp);
}

/* Body: walkthrough and act are stacked, the active one is shown. */

.demo-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.demo-walk,
.demo-act {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease, transform 0.35s var(--demo-ease);
}

.demo-act {
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
}

.demo-screen[data-view="act"] .demo-walk {
  opacity: 0;
  transform: translateX(-24px);
}

.demo-screen[data-view="act"] .demo-act {
  opacity: 1;
  transform: none;
}

/* Chips */

.demo-chips {
  flex: none;
  display: flex;
  gap: 8px;
  overflow: hidden;
  padding: 10px 16px;
  background: var(--demo-cream);
  border-bottom: 1px solid var(--demo-line);
}

.demo-chips-floor {
  background: var(--demo-floor);
}

.demo-chip {
  flex: none;
  padding: 6px 11px;
  border: 1px solid var(--demo-line);
  border-radius: 12px;
  background: var(--demo-paper);
  font-family: var(--demo-mono);
  font-size: 14px;
  line-height: 1.28;
}

.demo-chips-floor .demo-chip {
  padding: 5px 10px;
  background: var(--demo-cream);
  font-size: 13px;
}

.demo-chip.is-on {
  border-color: var(--demo-bp);
  background: var(--demo-bp);
  color: var(--demo-cream);
}

.demo-chips-floor .demo-chip.is-on {
  border-color: var(--demo-bp2);
  background: var(--demo-bp2);
}

/* Buttons */

.demo-btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--demo-bp);
  border-radius: 6px;
  background: var(--demo-bp);
  color: var(--demo-cream);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.demo-btn-white {
  background: var(--demo-cream);
  color: var(--demo-bp);
}

.demo-btn-red {
  border-color: var(--demo-red);
  background: var(--demo-red);
}

.demo-btn-lg {
  height: 46px;
  padding: 0 18px;
  font-size: 16px;
}

.demo-btn-wide {
  display: flex;
  width: 100%;
}

.demo-plus {
  width: 18px;
  height: 18px;
}

.demo-plus circle {
  fill: rgba(255, 255, 255, 0.2);
}

.demo-plus path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.demo-link {
  color: var(--demo-bp);
  font-size: 16px;
}

/* Plan */

.demo-upload {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--demo-cream);
  border-bottom: 1px solid var(--demo-line);
}

.demo-version {
  color: var(--demo-muted);
  font-size: 14px;
}

.demo-plan {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.demo-paper {
  position: relative;
  width: 346px;
  aspect-ratio: 340 / 300;
  margin-right: 20px;
  background: #fffefa;
  box-shadow: 0 1px 0 var(--demo-line), 0 0 0 1px rgba(22, 32, 46, 0.04);
}

.demo-drawing {
  width: 100%;
  height: 100%;
  font-family: var(--demo-sans);
}

.demo-walls path {
  fill: none;
  stroke: #2c3440;
  stroke-width: 5;
  stroke-linecap: square;
}

.demo-windows rect {
  fill: #fffefa;
  stroke: #2c3440;
  stroke-width: 1;
}

.demo-doors path,
.demo-fixtures path,
.demo-fixtures rect,
.demo-fixtures circle,
.demo-fixtures ellipse {
  fill: none;
  stroke: #6b7280;
  stroke-width: 1;
}

.demo-doors path {
  stroke-dasharray: 2 2;
}

.demo-dim path {
  fill: none;
  stroke: #9aa0a8;
  stroke-width: 0.8;
}

.demo-dim text {
  fill: #6b7280;
  font-family: var(--demo-mono);
  font-size: 7px;
}

.demo-rooms text {
  fill: var(--demo-ink);
  font-size: 9.5px;
  text-anchor: middle;
}

.demo-rooms .demo-area {
  font-size: 8.5px;
  text-decoration: underline;
}

.demo-rooms .demo-room-sm {
  font-size: 7.5px;
}

.demo-caption {
  fill: var(--demo-muted);
  font-size: 7.5px;
  text-anchor: end;
}

.demo-marker,
.demo-spot {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
}

.demo-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--demo-cream);
  background: var(--demo-amber);
  box-shadow: 0 0 4px rgba(22, 32, 46, 0.24);
  color: var(--demo-cream);
  font-family: var(--demo-mono);
  font-size: 11px;
  font-weight: 600;
}

.demo-marker.is-done { background: var(--demo-bp); }
.demo-marker.is-overdue { background: var(--demo-red); }
.demo-marker.is-closed { background: var(--demo-green); }

.demo-marker-new {
  visibility: hidden;
  font-size: 14px;
}

.demo-marker-new.is-shown {
  visibility: visible;
}

.demo-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 8px;
}

.demo-round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--demo-line);
  border-radius: 50%;
  background: var(--demo-cream);
  box-shadow: 0 2px 6px rgba(22, 32, 46, 0.12);
}

.demo-round svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--demo-bp);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Info bar under the plan */

.demo-info {
  flex: none;
  display: grid;
  background: var(--demo-cream);
  border-top: 1px solid var(--demo-line);
}

.demo-info-row {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.28s var(--demo-ease), visibility 0s linear 0.28s;
}

.demo-info-center {
  justify-content: center;
}

.demo-screen[data-info="counts"] [data-info-row="counts"],
.demo-screen[data-info="placing"] [data-info-row="placing"],
.demo-screen[data-info="confirm"] [data-info-row="confirm"] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.demo-counts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 16px;
  font-size: 13px;
}

.demo-count {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.demo-count::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--demo-amber);
}

.demo-count.is-done::before { background: var(--demo-bp); }
.demo-count.is-overdue::before { background: var(--demo-red); }
.demo-count.is-closed::before { background: var(--demo-green); }

.demo-count b {
  font-weight: inherit;
  border-radius: 4px;
}

.demo-hint {
  color: var(--demo-bp);
  font-size: 13px;
}

.demo-meta {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--demo-cream);
  border-top: 1px solid var(--demo-line);
}

.demo-meta span {
  display: grid;
  gap: 2px;
  padding: 8px 16px;
  font-family: var(--demo-mono);
  font-size: 12px;
}

.demo-meta span + span {
  border-left: 1px solid var(--demo-line);
}

.demo-meta small {
  color: var(--demo-closed);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Act */

.demo-act-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px 0;
}

.demo-act-actions .demo-btn {
  height: 38px;
  font-size: 15px;
}

.demo-act-group {
  display: grid;
  gap: 4px;
  padding: 24px 16px 12px;
  border-bottom: 1px solid var(--demo-line);
}

.demo-act-group b {
  color: var(--demo-bp);
  font-family: var(--demo-display);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
}

.demo-act-group span {
  color: var(--demo-muted);
  font-family: var(--demo-mono);
  font-size: 12px;
}

.demo-act-item {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--demo-line);
  background: #fff;
}

.demo-act-item b {
  font-size: 15px;
  font-weight: 600;
}

.demo-act-item span {
  color: var(--demo-muted);
  font-size: 13px;
}

.demo-act-item p {
  display: flex;
  gap: 6px;
  margin: 4px 0 0;
}

.demo-act-item i {
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--demo-amber);
  color: var(--demo-cream);
  font-size: 12px;
  font-style: normal;
}

.demo-act-item i.is-done { background: var(--demo-badge-done); }
.demo-act-item i.is-overdue { background: var(--demo-red); }
.demo-act-item i.is-closed { background: var(--demo-green); }

/* Bottom navigation */

.demo-nav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 88px;
  padding: 8px 6px 26px;
  background: #fff;
  box-shadow: 0 -8px 16px rgba(22, 32, 46, 0.04);
}

.demo-nav span {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  color: var(--demo-closed);
  font-size: 11.5px;
}

.demo-nav svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-nav .is-on {
  color: var(--demo-bp);
  font-weight: 600;
}

.demo-badge {
  position: absolute;
  top: -5px;
  left: 50%;
  min-width: 17px;
  height: 17px;
  margin-left: 1px;
  border: 1.5px solid #fff;
  border-radius: 9px;
  background: var(--demo-red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
}

/* Overlay and sheets */

.demo-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--demo-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.demo-screen:not([data-sheet=""]) .demo-overlay {
  opacity: 1;
}

.demo-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  padding: 0 16px 34px;
  border-radius: 18px 18px 0 0;
  background: var(--demo-cream);
  box-shadow: 0 -10px 30px rgba(22, 32, 46, 0.12);
  transform: translateY(105%);
  transition: transform 0.34s var(--demo-ease);
}

.demo-screen[data-sheet="defect"] .demo-sheet-defect,
.demo-screen[data-sheet="email"] .demo-sheet-email {
  transform: none;
}

.demo-sheet-defect {
  top: 196px;
  overflow: hidden;
}

.demo-sheet-scroll {
  transition: transform 0.45s var(--demo-ease);
}

.demo-handle {
  display: block;
  width: 36px;
  height: 5px;
  margin: 8px auto 6px;
  border-radius: 3px;
  background: var(--demo-handle);
}

.demo-sheet-title {
  margin: 6px 0 12px;
  color: var(--demo-bp);
  font-family: var(--demo-display);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.demo-sheet-text {
  margin: 0 0 20px;
  color: var(--demo-muted);
}

.demo-label {
  margin: 14px 0 6px;
  color: var(--demo-muted);
  font-size: 13px;
  font-weight: 500;
}

.demo-sheet-title + .demo-label {
  margin-top: 0;
}

.demo-input {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--demo-line);
  border-radius: 6px;
  background: var(--demo-paper);
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.demo-input.is-focus {
  border-color: var(--demo-bp);
}

.demo-textarea {
  align-items: flex-start;
  min-height: 64px;
  padding-top: 12px;
}

.demo-placeholder {
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--demo-hint);
}

.demo-textarea.is-filled .demo-placeholder {
  visibility: hidden;
}

.demo-caret {
  width: 1.5px;
  height: 20px;
  margin-left: 1px;
  background: var(--demo-bp);
  opacity: 0;
}

.demo-input.is-focus .demo-caret {
  animation: demo-caret 1s steps(1) infinite;
}

.demo-select {
  justify-content: space-between;
}

.demo-select .demo-ico {
  width: 20px;
  height: 20px;
  color: var(--demo-ink);
}

.demo-float {
  flex-wrap: wrap;
  align-content: center;
  height: 52px;
}

.demo-float small {
  flex: 0 0 100%;
  color: var(--demo-muted);
  font-size: 12px;
  line-height: 1.2;
}

.demo-float .demo-value {
  min-height: 21px;
}

.demo-float .demo-caret {
  height: 18px;
}

.demo-sheet-email .demo-btn-wide {
  margin-top: 20px;
}

.demo-btn-text {
  transition: opacity 0.15s ease;
}

.demo-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(253, 251, 246, 0.35);
  border-top-color: var(--demo-cream);
  border-radius: 50%;
  opacity: 0;
  animation: demo-spin 0.7s linear infinite;
}

.demo-btn.is-loading .demo-btn-text {
  opacity: 0;
}

.demo-btn.is-loading .demo-spinner {
  opacity: 1;
}

.demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-row-save {
  gap: 24px;
  margin-top: 20px;
}

/* Voice note */

.demo-voice > div {
  display: none;
  align-items: center;
  gap: 12px;
}

.demo-screen[data-voice="idle"] .demo-voice-idle,
.demo-screen[data-voice="rec"] .demo-voice-rec {
  display: flex;
}

.demo-screen[data-voice="player"] .demo-voice-player {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.demo-voice > div.is-in {
  animation: demo-fade-in 0.28s var(--demo-ease);
}

.demo-rec {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--demo-red);
  font-family: var(--demo-mono);
  font-size: 14px;
}

.demo-rec i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--demo-red);
  animation: demo-pulse 1s ease-in-out infinite;
}

.demo-rec b {
  font-weight: 500;
}

.demo-player {
  display: flex;
  align-items: center;
  width: 100%;
}

.demo-play {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 8px 8px 8px 0;
}

.demo-play .demo-ico {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  color: var(--demo-ink);
}

.demo-ico-pause,
.demo-play.is-playing .demo-ico-play {
  opacity: 0;
}

.demo-play.is-playing .demo-ico-pause {
  opacity: 1;
}

.demo-player-time {
  color: var(--demo-muted);
  font-family: var(--demo-mono);
  font-size: 11px;
}

.demo-track {
  position: relative;
  flex: 1;
  height: 2px;
  margin-left: 12px;
  background: var(--demo-line);
}

.demo-track i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: var(--demo-bp);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.demo-track b {
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--demo-bp);
}

/* Photos */

.demo-thumbs {
  display: none;
  margin-bottom: 10px;
}

.demo-thumbs.is-shown {
  display: flex;
}

.demo-thumb {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--demo-line);
  border-radius: 6px;
}

.demo-thumb svg {
  width: 100%;
  height: 100%;
}

/* System alert (CupertinoAlertDialog) */

.demo-alert {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.demo-alert-box {
  display: grid;
  width: 270px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(250, 250, 250, 0.94);
  text-align: center;
  transform: scale(1.12);
  transition: transform 0.3s var(--demo-ease);
  font-family: -apple-system, "SF Pro Text", var(--demo-sans);
}

.demo-alert-box b {
  padding: 19px 16px 2px;
  font-size: 17px;
  font-weight: 600;
}

.demo-alert-box span {
  padding: 0 16px 19px;
  font-size: 13px;
}

.demo-alert-box i {
  padding: 11px 16px;
  border-top: 0.5px solid rgba(60, 60, 67, 0.29);
  color: var(--demo-bp);
  font-size: 17px;
  font-style: normal;
}

.demo-screen[data-alert="on"] .demo-alert {
  opacity: 1;
}

.demo-screen[data-alert="on"] .demo-alert-box {
  transform: none;
}

/* Camera flash */

.demo-flash {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

/* Finger */

.demo-finger {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 26;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.demo-finger.is-shown {
  opacity: 1;
}

.demo-finger i {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: rgba(22, 32, 46, 0.28);
  box-shadow: 0 3px 10px rgba(22, 32, 46, 0.3);
}

.demo-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid rgba(22, 32, 46, 0.25);
  pointer-events: none;
}

/* Scenario segments under the phone */

.demo-segs {
  display: flex;
  gap: 10px;
  width: var(--demo-w);
}

.demo-seg {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 13px/1.2 var(--font);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.2s ease;
}

.demo-seg:hover,
.demo-seg[aria-pressed="true"] {
  color: var(--ink);
}

.demo-seg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.demo-seg i {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.demo-seg b {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.demo-seg.is-done b {
  transform: scaleX(1);
}

@keyframes demo-caret {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

@keyframes demo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

@keyframes demo-fade-in {
  from { opacity: 0; transform: translateY(4px); }
}

@media (max-width: 720px) {
  .demo {
    --demo-max-h: min(640px, calc(100vh - 120px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo *,
  .demo *::before,
  .demo *::after {
    transition: none !important;
    animation: none !important;
  }
}
