/* Live demos inside the service cards.
   The widgets are built by js/fx-lab.js (styles in css/fx-lab.css) and moved into the cards by js/app.js.
   Their styles are scoped to .lab, so each one keeps a .lab wrapper; here that wrapper loses the lab's own
   grid and tile chrome, because the card around it already is the frame. */

/* the lab's own host only hands its widgets over: whatever is left in it stays out of sight */
.lab[hidden] { display: none !important; }

.demo.lab { display: block; width: 100%; max-width: 460px; gap: 0; grid-template: none; }
.demo .lab-tile { display: block; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; }
.demo .lab-tile::before, .demo .lab-tile::after { display: none; }
.demo .lab-head { display: none; }
.demo .lab-well { background: rgba(255, 255, 255, .025); border-color: var(--line); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }

/* accent on the controls: dark text on the accent, like the buttons */
.demo .lab-seg-tab[aria-selected="true"], .demo .lab-seg-tab[aria-checked="true"] { color: var(--on-accent); }
.demo .lab-bubble { color: var(--on-accent); }
.demo .lab-toast-ic { color: var(--on-accent); }
.demo .lab-well-ld.is-done .lab-sp-wrap { color: var(--on-accent); }
.demo .lab-bar-fill { box-shadow: 0 0 12px var(--a-60); }
.demo .lab-toast-bar { background: var(--a-60); }
.demo .lab-chip.is-listening { border-color: var(--accent); box-shadow: 0 0 0 3px var(--a-20); }

/* widgets (toggles) */
.demo.demo-widgets { max-width: 380px; }
/* motion (notifications): wide card, controls beside the toast stack */
.demo.demo-motion { max-width: 680px; }
/* setup (loader) + keys */
.demo.demo-setup, .demo.demo-keys { max-width: 440px; }

/* theme (colour picker): compact, and it recolours the page */
.demo.demo-theme { max-width: 340px; }
.demo-theme .lab-well { gap: 12px; }
.demo-theme .lab-sv { min-height: 132px; max-height: 150px; }
.demo-theme .lab-cp-rgb, .demo-theme .lab-cp-recent, .demo-theme .lab-cp-strip:nth-child(2) { display: none; }
.demo-note { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--dim); text-align: center; }
.demo-reset { padding: 0; border: 0; background: none; color: var(--muted); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.demo-reset:hover { color: var(--text); }

/* menus: a deck of real views, the front one drops away and the next steps forward */
.deck { position: relative; width: min(100%, 560px); aspect-ratio: var(--ar, 1.3); margin-top: 13%; perspective: 1400px; }
.deck-card {
  position: absolute; inset: 0; border-radius: 12px; overflow: hidden; background: #080808; transform-origin: 50% 100%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 30px 70px -30px #000;
  transition: transform .9s var(--e), opacity .9s var(--e), filter .9s var(--e);
}
.deck-card .shot { position: absolute; inset: 0; transition: filter .6s ease; }
/* black and white at rest, the menu's own colours when you point at the card (touch screens always show colour) */
@media (hover: hover) and (pointer: fine) {
  .tile .deck-card .shot { filter: grayscale(1); }
  .tile:hover .deck-card .shot { filter: none; }
}
.deck-card[data-pos="0"] { z-index: 4; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 30px 70px -30px #000, 0 0 90px -30px var(--a-60); }
.deck-card[data-pos="1"] { z-index: 3; transform: translateY(-11%) scale(.92); filter: brightness(.55); }
.deck-card[data-pos="2"] { z-index: 2; transform: translateY(-21%) scale(.84); filter: brightness(.32); }
.deck-card[data-pos="3"] { z-index: 1; transform: translateY(-29%) scale(.76); opacity: 0; }
.deck-card.out { transform: translateY(16%) rotateX(-24deg) scale(1.03); opacity: 0; transition-duration: .42s; }
.demo-empty { font-size: 14px; color: var(--dim); }

@media (max-width: 760px) {
  .demo-motion .lab-well-nt { grid-template-columns: minmax(0, 1fr); }
}
