/* Mandat for Alexa+ · web simulator
   Page chrome = the team design system (design-system/tokens.css + components.css, copied from
   Challenges-automne-2026/design-system, Apple HIG 2026): grouped background, Liquid Glass only on the toolbar,
   one accent (#0071E3) for the one action, hierarchy by size and weight, springs on state changes.
   The device is the hero and stays a credible Amazon device: Echo Show screens are laid out at their own resolution
   (Show 15: 1920x1080, Show 8: 1280x800) then scaled, so every MCP Apps card renders exactly as on the device; the
   Alexa light bar and the Echo Dot ring keep Amazon's own cyan-blue, because that is hardware, not decoration.
   Voice states: idle, listening, thinking, speaking, confirming (waiting for an explicit yes). */

:root { --stage-max: 1640px; --talk-w: 368px; --alexa-cyan: #00caff; --alexa-blue: #1e6ef4; }

/* ---------- page ---------- */
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
svg { display: block; }
kbd { font: var(--weight-medium) 11px/1 var(--font-sans); padding: 3px 5px; border-radius: 5px; background: var(--fill-tertiary); color: var(--label); letter-spacing: 0; }

/* ---------- toolbar: identity · device · tools ---------- */
.sim-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; max-width: var(--stage-max); margin: 0 auto; width: 100%; }
.sim-id { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; min-width: 0; }
.sim-id .sim-logo { grid-row: span 2; }
.sim-id b { font: var(--weight-bold) var(--text-title3)/1.15 var(--font-display); letter-spacing: -0.02em; }
.sim-id span { font-size: var(--text-footnote); color: var(--label-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-devices { margin: 0; border: 0; min-inline-size: 0; }
.sim-devices label { height: 36px; min-width: 112px; font-size: var(--text-subhead); }
.sim-tools { position: relative; justify-self: end; }
.sim-tools .ui-icon-button, .sim-tools .ui-button { --_s: 36px; --_h: 36px; background: transparent; }
.sim-tools .ui-icon-button:hover, .sim-tools .ui-button:hover { background: var(--fill-quaternary); }
.sim-tools .ui-icon-button[aria-pressed="true"] { color: var(--label); background: transparent; }
/* language: a segmented control (EN · FR · ES) beside the tools, the active one highlighted, 44 px wide targets */
.sim-right { justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sim-right .sim-tools { justify-self: auto; }
.sim-langs { margin: 0; border: 0; min-inline-size: 0; }
.sim-langs label { height: 36px; min-width: 52px; padding: 0 10px; font-size: var(--text-subhead); font-weight: var(--weight-semibold); letter-spacing: .02em; }
.sim-langs label::after { content: ""; position: absolute; inset: -4px 0; } /* 44 px tall hit area, same visual height as the toolbar */
.sim-dev { gap: 8px; padding: 0 10px 0 12px; font-weight: var(--weight-semibold); }
.sim-dev[aria-expanded="true"] { background: var(--accent-tint) !important; color: var(--accent-text); }

/* ---------- layout ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) var(--talk-w); gap: clamp(20px, 2.4vw, 40px); padding: 8px var(--margin-wide) 48px; align-items: start; max-width: var(--stage-max); margin: 0 auto; }
.room { position: relative; display: grid; place-items: center; min-height: 360px; padding: clamp(8px, 1.6vw, 24px) 0 clamp(28px, 3.6vw, 56px); }

/* ---------- Echo Show (hardware) ---------- */
.show { --W: 1920; --H: 1080; --B: 30; --u: 1.5px; position: relative; }
body[data-device="show8"] .show { --W: 1280; --H: 800; --B: 64; --u: 1px; }
body[data-device="dot"] .show { display: none; }
.bezel {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(var(--s, .5));
  padding: calc(var(--B) * 1px); border-radius: calc(var(--B) * 1px + 18px);
  background: linear-gradient(180deg, #1b1c1f, #0a0a0c 40%, #050506);
  box-shadow: 0 0 0 2px #2a2c31, 0 0 0 3px #0b0c0e, 0 60px 120px -40px rgba(0, 0, 0, .5), 0 30px 60px -30px rgba(0, 0, 0, .4);
}
/* on a black page the frame needs its machined edge to read as an object */
:root[data-theme="dark"] .bezel { box-shadow: 0 0 0 2px #3a3c42, 0 0 0 3px #111214, inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 120px -30px rgba(120, 140, 170, .16); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bezel { box-shadow: 0 0 0 2px #3a3c42, 0 0 0 3px #111214, inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 120px -30px rgba(120, 140, 170, .16); } }
.cam { position: absolute; top: calc(var(--B) * .5px - 5px); left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #0c0d10; box-shadow: 0 0 0 2px #15161a, inset 2px 2px 3px #2c3340; }
body[data-device="show8"] .cam { left: auto; right: 96px; }
.base { display: none; }
body[data-device="show8"] .base { display: block; position: absolute; left: 12%; right: 12%; bottom: -14px; height: 28px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .3), transparent); filter: blur(6px); }

/* ---------- the Alexa+ screen (content layer, follows the appearance) ---------- */
.screen {
  --sc-bg: light-dark(#f2f2f7, #000000); --sc-label: light-dark(#000000, #ffffff);
  --sc-label-2: light-dark(#6e6e73, rgba(235, 235, 245, .64)); --sc-sep: light-dark(rgba(60, 60, 67, .18), rgba(84, 84, 88, .6));
  --sc-fill: light-dark(rgba(118, 118, 128, .12), rgba(118, 118, 128, .24)); --sc-surface: light-dark(#ffffff, #1c1c1e);
  --sc-accent: light-dark(#0071e3, #0a84ff); --sc-accent-text: light-dark(#0066cc, #3d9bff);
  position: relative; width: calc(var(--W) * 1px); height: calc(var(--H) * 1px); overflow: hidden; border-radius: 10px;
  background: var(--sc-bg); color: var(--sc-label); font-family: var(--font-display); letter-spacing: -0.012em;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: calc(var(--u) * 14);
  padding: calc(var(--u) * 26) calc(var(--u) * 48) calc(var(--u) * 34);
  transition: background-color .4s var(--ease-out), color .4s var(--ease-out);
}
.s-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: calc(var(--u) * 24); min-height: calc(var(--u) * 48); }
.heard { margin: 0; font-size: calc(var(--u) * 26); color: var(--sc-label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(calc(var(--u) * 6));
  transition: opacity var(--dur-fade) var(--ease-out), transform var(--dur-smooth) var(--ease-smooth); }
.heard.on { opacity: 1; transform: none; }
.clock { font-size: calc(var(--u) * 26); font-weight: var(--weight-semibold); color: var(--sc-label); font-variant-numeric: tabular-nums; }
body[data-screen="home"] .s-top .clock, body[data-screen="home"] .s-top .env { visibility: hidden; }

.env { display: flex; align-items: center; gap: calc(var(--u) * 12); padding: calc(var(--u) * 7) calc(var(--u) * 20) calc(var(--u) * 7) calc(var(--u) * 9); border-radius: 999px; background: var(--sc-fill); font-size: calc(var(--u) * 21); color: var(--sc-label-2); white-space: nowrap; }
.env[hidden] { display: none; }
.env b { color: var(--sc-label); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.env-ring { width: calc(var(--u) * 32); height: calc(var(--u) * 32); transform: rotate(-90deg); }
.env-ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; transition: stroke-dasharray 1s var(--ease-smooth); }
.env-ring .track { stroke: var(--sc-sep); }
.env-ring .held { stroke: color-mix(in srgb, var(--sc-accent) 45%, transparent); }
.env-ring .spent { stroke: var(--sc-accent); }

/* ambient wallpaper: full-bleed home photos like a real Echo Show home screen (wallpaper.js cross-fades them).
   Home: the photo stays sharp under a soft dark scrim weighted to the bottom-left, where the clock sits, so white text
   stays legible on any photo. During a story the photo blurs and sits under a veil in the screen's appearance,
   so the card stays the only sharp thing on screen, as on Alexa+. */
.screen { --sc-veil: light-dark(rgba(242, 242, 247, .55), rgba(0, 0, 0, .5)); } /* the home photo stays visible behind a story */
.wall { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #1d1a16; transition: background-color .5s var(--ease-out); }
.wall-img { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0;
  transition: opacity 2.4s var(--ease-out), filter .8s var(--ease-out), transform .8s var(--ease-out); }
.wall-img.on { opacity: 1; }
.wall-scrim { position: absolute; inset: 0; transition: opacity .6s var(--ease-out), background-color .6s var(--ease-out);
  background:
    linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, .5) 46%, rgba(0, 0, 0, .2) 76%, rgba(0, 0, 0, .1)),
    linear-gradient(to right, rgba(0, 0, 0, .34), transparent 60%); }
.screen > .s-top, .screen > .home, .screen > .card-slot, .screen > .s-bottom { position: relative; z-index: 1; }
.screen > .lightbar { z-index: 2; }
body:not([data-screen="home"]) .wall { background: var(--sc-bg); }
body:not([data-screen="home"]) .wall-img { filter: blur(calc(var(--u) * 14)) saturate(1.15); transform: scale(1.06); }
body:not([data-screen="home"]) .wall-scrim { background: var(--sc-veil); }
/* text drawn on the veil: secondary labels one step stronger than on a plain background, so they stay ≥ 4.5:1 */
body:not([data-screen="home"]) .screen { --sc-label-2: light-dark(#4f4f54, rgba(242, 242, 247, .86)); --sc-fill: light-dark(rgba(255, 255, 255, .62), rgba(0, 0, 0, .3)); }
/* home: white on the photo, like the device (the screen itself is dark too, in case a photo cannot load) */
body[data-screen="home"] .screen { --sc-label: #ffffff; --sc-label-2: rgba(255, 255, 255, .88); background-color: #1d1a16; }
body[data-screen="home"] .home-time, body[data-screen="home"] .home-date { text-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 3) rgba(0, 0, 0, .22); }

/* home (ambient): a real clock and a real Mandat widget, no slogan */
.home { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, calc(var(--u) * 560)); grid-template-rows: 1fr auto; align-items: end; column-gap: calc(var(--u) * 48); padding: 0 calc(var(--u) * 8) calc(var(--u) * 6); }
body[data-screen="home"] .home { display: grid; }
body[data-screen="home"] .card-slot { display: none; }
.home-clock { align-self: end; }
.home-time { font-size: calc(var(--u) * 164); font-weight: var(--weight-semibold); letter-spacing: -0.04em; line-height: .92; font-variant-numeric: tabular-nums; }
.home-date { font-size: calc(var(--u) * 32); color: var(--sc-label-2); font-weight: var(--weight-medium); margin-top: calc(var(--u) * 14); }
.home-side { align-self: end; display: grid; gap: calc(var(--u) * 18); }
.home-widget[hidden] { display: none; }
.hw-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hw-list li { display: grid; gap: calc(var(--u) * 2); padding: calc(var(--u) * 12) 0; font-size: calc(var(--u) * 24); }
.hw-list li + li { border-top: 1px solid var(--sc-sep); }
.hw-list li:last-child { padding-bottom: 0; }
.hw-list b { font-weight: var(--weight-semibold); }
.hw-list span { color: var(--sc-label-2); font-size: calc(var(--u) * 21); }
.home-widget { display: grid; gap: calc(var(--u) * 10); padding: calc(var(--u) * 26) calc(var(--u) * 30) calc(var(--u) * 28); border-radius: calc(var(--u) * 30);
  /* a frosted widget over the photo, in the screen's appearance */
  --sc-label: light-dark(#000000, #ffffff); --sc-label-2: light-dark(#3c3c43, rgba(255, 255, 255, .8));
  --sc-sep: light-dark(rgba(60, 60, 67, .2), rgba(255, 255, 255, .16)); --sc-fill: light-dark(rgba(60, 60, 67, .14), rgba(255, 255, 255, .18));
  color: var(--sc-label); text-shadow: none;
  background: light-dark(rgba(255, 255, 255, .8), rgba(28, 28, 30, .6));
  -webkit-backdrop-filter: blur(calc(var(--u) * 30)) saturate(1.6); backdrop-filter: blur(calc(var(--u) * 30)) saturate(1.6);
  box-shadow: inset 0 0 0 1px light-dark(rgba(255, 255, 255, .5), rgba(255, 255, 255, .1)), 0 calc(var(--u) * 24) calc(var(--u) * 60) calc(var(--u) * -20) rgba(0, 0, 0, .35); }
.home-widget p { margin: 0; }
.hw-context { font-size: calc(var(--u) * 21); color: var(--sc-label-2); font-weight: var(--weight-medium); display: flex; justify-content: space-between; gap: 1em; }
.hw-title { font-size: calc(var(--u) * 34); font-weight: var(--weight-bold); letter-spacing: -0.022em; line-height: 1.12; }
.hw-num { font-size: calc(var(--u) * 64); font-weight: var(--weight-bold); letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.hw-num small { font-size: .36em; font-weight: var(--weight-semibold); color: var(--sc-label-2); letter-spacing: -0.01em; margin-left: .3em; }
.hw-bar { height: calc(var(--u) * 8); border-radius: 999px; background: var(--sc-fill); overflow: hidden; display: flex; }
.hw-bar span { height: 100%; transition: width 1s var(--ease-smooth); }
.hw-bar .spent { background: var(--sc-accent); } .hw-bar .held { background: color-mix(in srgb, var(--sc-accent) 45%, transparent); }
.hw-line { font-size: calc(var(--u) * 21); color: var(--sc-label-2); font-variant-numeric: tabular-nums; }
.hw-line b { color: var(--sc-label); font-weight: var(--weight-semibold); }
.home-hint { grid-column: 1 / -1; margin: calc(var(--u) * 40) 0 0; font-size: calc(var(--u) * 24); color: var(--sc-label-2); }

/* the card (MCP App iframe); explicit cell, shared with the live activity panel (never pushed to another row) */
.card-slot { grid-row: 2; grid-column: 1; min-height: 0; overflow: hidden auto; border-radius: calc(var(--u) * 30); scrollbar-width: none; }
.card-slot::-webkit-scrollbar { display: none; }
.app-frame { width: 100%; height: 300px; border: 0; display: block; background: transparent; color-scheme: normal; opacity: 0; transition: opacity var(--dur-fade) var(--ease-out); }
.app-frame.in { opacity: 1; }
body.fullscreen .s-top .heard { visibility: hidden; }
body.fullscreen .s-bottom { display: none; }

/* live activity: what Alexa is doing right now, step by step, from the real tool calls (GET /activity).
   Glanceable from across the room: one line per step, a photo for each merchant, the price change on the right. */
.screen > .live { position: relative; z-index: 1; grid-row: 2; grid-column: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: calc(var(--u) * 18); padding: calc(var(--u) * 6) calc(var(--u) * 4) 0; }
.live[hidden] { display: none; }
body[data-live="on"] .card-slot { visibility: hidden; }
.live-title { margin: 0; font-size: calc(var(--u) * 24); font-weight: var(--weight-semibold); color: var(--sc-label-2); display: flex; align-items: center; gap: calc(var(--u) * 12); }
.live-title::before { content: ""; width: calc(var(--u) * 12); height: calc(var(--u) * 12); border-radius: 50%; background: var(--alexa-cyan); box-shadow: 0 0 calc(var(--u) * 12) var(--alexa-cyan); animation: breathe 1.4s ease-in-out infinite; }
.live[data-done] .live-title::before { animation: none; background: var(--sc-accent); box-shadow: none; }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: calc(var(--u) * 8); min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent, #000 calc(var(--u) * 18)); mask-image: linear-gradient(180deg, transparent, #000 calc(var(--u) * 18)); }
.live-list li { display: grid; grid-template-columns: calc(var(--u) * 54) minmax(0, 1fr) auto; align-items: center; column-gap: calc(var(--u) * 18); min-height: calc(var(--u) * 62);
  padding: calc(var(--u) * 6) calc(var(--u) * 22) calc(var(--u) * 6) calc(var(--u) * 6); border-radius: calc(var(--u) * 19);
  background: color-mix(in srgb, var(--sc-surface) 72%, transparent); -webkit-backdrop-filter: blur(calc(var(--u) * 20)); backdrop-filter: blur(calc(var(--u) * 20));
  animation: live-in var(--dur-smooth) var(--ease-smooth) both; }
@keyframes live-in { from { opacity: 0; transform: translateY(calc(var(--u) * 14)) scale(.985); } }
.live-ico { position: relative; width: calc(var(--u) * 54); height: calc(var(--u) * 54); border-radius: calc(var(--u) * 14); display: grid; place-items: center; overflow: hidden; background: var(--sc-fill); color: var(--sc-label-2); }
.live-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-ico .st { position: absolute; right: calc(var(--u) * 3); bottom: calc(var(--u) * 3); width: calc(var(--u) * 24); height: calc(var(--u) * 24); border-radius: 50%; display: grid; place-items: center; background: var(--sc-surface); box-shadow: 0 0 0 calc(var(--u) * 2) var(--sc-surface); }
.live-ico:not(:has(img)) .st { position: static; width: calc(var(--u) * 34); height: calc(var(--u) * 34); background: transparent; box-shadow: none; }
.st svg { width: 70%; height: 70%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.st.done { color: var(--status-ok-text); } .st.failed { color: var(--status-critical-text, #d70015); }
.st.running { border-radius: 50%; border: calc(var(--u) * 3) solid var(--sc-accent); border-right-color: transparent; animation: spin .8s linear infinite; background: transparent; box-sizing: border-box; }
.live-ico:has(img) .st.running { background: var(--sc-surface); }
.live-text { min-width: 0; display: grid; gap: calc(var(--u) * 2); }
.live-text b { font-size: calc(var(--u) * 28); font-weight: var(--weight-semibold); letter-spacing: -0.016em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-text span { font-size: calc(var(--u) * 21); color: var(--sc-label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-amt { font-size: calc(var(--u) * 30); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.02em; }
.live-amt s { font-size: .74em; font-weight: var(--weight-regular); color: var(--sc-label-2); margin-right: .2em; }
.live-amt i { font-style: normal; color: var(--sc-label-2); font-weight: var(--weight-regular); margin-right: .2em; }
li.failed .live-text b { color: var(--sc-label-2); }

/* bottom: what Alexa did, what she says, and the confirm prompt */
.s-bottom { grid-row: 3; grid-column: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 10); min-height: calc(var(--u) * 40); }
body[data-screen="home"] .s-bottom { display: none; }
.s-row { display: flex; align-items: center; gap: calc(var(--u) * 16); min-height: calc(var(--u) * 40); }
.trail { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; gap: calc(var(--u) * 22); margin: 0; padding: 0; list-style: none; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.trail.over { justify-content: flex-end; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%); mask-image: linear-gradient(90deg, transparent, #000 14%); }
.trail li { flex: none; display: inline-flex; align-items: center; gap: calc(var(--u) * 8); font-size: calc(var(--u) * 19); color: var(--sc-label-2); white-space: nowrap;
  animation: step-in var(--dur-smooth) var(--ease-smooth) both; }
.trail li svg { width: calc(var(--u) * 20); height: calc(var(--u) * 20); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.trail li:last-child { color: var(--sc-label); font-weight: var(--weight-semibold); }
@keyframes step-in { from { opacity: 0; transform: translateX(calc(var(--u) * -8)); } }
.reply { margin: 0; font-size: calc(var(--u) * 31); line-height: 1.26; font-weight: var(--weight-semibold); letter-spacing: -0.016em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.reply.long { font-size: calc(var(--u) * 26); -webkit-line-clamp: 3; }
.reply .w { opacity: .38; transition: opacity var(--dur-fade) linear; }
.reply .w.said { opacity: 1; }
.reply.err { color: var(--sc-label); }
.ask { flex: none; display: inline-flex; align-items: center; gap: calc(var(--u) * 10); font-size: calc(var(--u) * 22); font-weight: var(--weight-semibold); white-space: nowrap;
  padding: calc(var(--u) * 9) calc(var(--u) * 22) calc(var(--u) * 9) calc(var(--u) * 16); border-radius: 999px; color: var(--sc-label);
  background: color-mix(in srgb, var(--sc-accent) 16%, transparent); animation: ask-in var(--dur-bouncy) var(--ease-bouncy) both; }
.ask[hidden] { display: none; }
.ask svg { width: calc(var(--u) * 24); height: calc(var(--u) * 24); fill: none; stroke: var(--sc-accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes ask-in { from { opacity: 0; transform: scale(.9); } }

/* the Alexa light bar: bottom edge of the screen (device hardware language) */
.lightbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--u) * 9); pointer-events: none; display: grid; place-items: center; }
.lightbar span { width: 0%; height: 100%; border-radius: 999px 999px 0 0; opacity: 0; transition: width .6s var(--ease-smooth), opacity .3s var(--ease-out);
  background: linear-gradient(90deg, transparent, var(--alexa-blue) 16%, var(--alexa-cyan) 50%, var(--alexa-blue) 84%, transparent);
  box-shadow: 0 0 calc(var(--u) * 18) calc(var(--u) * 2) rgba(0, 202, 255, .45); }
body[data-state="listening"] .lightbar span { width: calc(40% + var(--lvl, 0) * 60%); opacity: 1; transition: width 90ms linear, opacity .3s; }
body[data-state="thinking"] .lightbar span { width: 100%; opacity: 1; background-size: 200% 100%; animation: sweep 1.1s linear infinite;
  background-image: linear-gradient(90deg, #0c2f73, var(--alexa-blue) 25%, #8ae6ff 50%, var(--alexa-blue) 75%, #0c2f73); }
body[data-state="speaking"] .lightbar span { width: calc(46% + var(--lvl, 0) * 34%); opacity: 1; transition: width 120ms linear; }
body[data-state="confirming"] .lightbar span { width: 26%; opacity: .9; animation: breathe 2.2s ease-in-out infinite; }
@keyframes sweep { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes breathe { 50% { opacity: .35; } }

/* ---------- Echo Dot (hardware, no screen) ---------- */
.dot { display: none; justify-items: center; width: 100%; padding-top: clamp(12px, 3vw, 40px); }
body[data-device="dot"] .dot { display: grid; }
.sphere { position: relative; width: clamp(200px, 24vw, 300px); aspect-ratio: 1; border-radius: 50%; z-index: 1;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .14), transparent 42%),
    radial-gradient(circle at 50% 120%, rgba(0, 0, 0, .55), transparent 60%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 50% 45%, #3a3c42, #1c1d21 62%, #0e0e11);
  box-shadow: inset 0 -18px 40px rgba(0, 0, 0, .55), 0 40px 60px -30px rgba(0, 0, 0, .5); }
.ring { position: absolute; left: 21%; right: 21%; bottom: 3%; height: 8%; border-radius: 50%; border: 3px solid transparent; opacity: 0; transition: border-color .4s, box-shadow .4s, opacity .4s; }
body[data-state="listening"] .ring, body[data-state="speaking"] .ring { opacity: calc(.6 + var(--lvl, 0) * .4); border-color: var(--alexa-cyan) var(--alexa-blue); box-shadow: 0 0 calc(10px + var(--lvl, 0) * 18px) 3px rgba(0, 202, 255, .55), inset 0 0 10px rgba(0, 202, 255, .5); }
body[data-state="thinking"] .ring { opacity: 1; border-color: var(--alexa-cyan) #0c2f73 var(--alexa-blue) #0c2f73; box-shadow: 0 0 14px 2px rgba(0, 202, 255, .4); animation: ringTurn 1s linear infinite; }
body[data-state="confirming"] .ring { opacity: 1; border-color: var(--alexa-cyan); box-shadow: 0 0 12px 2px rgba(0, 202, 255, .4); animation: breathe 2.2s ease-in-out infinite; }
@keyframes ringTurn { to { border-color: var(--alexa-blue) var(--alexa-cyan) #0c2f73 var(--alexa-cyan); } }
.dot-shadow { width: clamp(220px, 28vw, 360px); height: 40px; margin-top: -24px; border-radius: 50%; background: radial-gradient(closest-side, light-dark(rgba(0, 0, 0, .22), rgba(0, 0, 0, .7)), transparent); }
.dot-cc { margin: clamp(20px, 3vw, 36px) 0 0; max-width: 760px; width: 100%; text-align: center; display: grid; gap: 10px; }
.dot-cc figcaption { font-size: var(--text-footnote); color: var(--label-secondary); }
.cc-you { margin: 0; color: var(--label-secondary); font-size: clamp(15px, 1.4vw, 19px); min-height: 1.4em; }
.cc-alexa { margin: 0; font: var(--weight-semibold) clamp(19px, 2vw, 26px)/1.3 var(--font-display); letter-spacing: -0.016em; min-height: 2.6em; text-wrap: pretty; }

/* ---------- talk panel (content layer) ---------- */
.talk { position: sticky; top: 76px; display: grid; gap: 18px; padding: 18px; border-radius: var(--radius-lg); background: var(--bg-grouped-secondary); }
.talk-voice { display: flex; align-items: center; gap: 14px; }
.mic { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; flex: none; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-on);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .12);
  transition: transform var(--dur-bouncy) var(--ease-bouncy), background-color var(--dur-fade) var(--ease-out); }
.mic svg { width: 26px; height: 26px; stroke-width: 1.9; }
.mic:active { transform: scale(.92); transition-duration: var(--dur-quick); transition-timing-function: var(--ease-smooth); }
.mic::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; transform: scale(calc(.94 + var(--lvl, 0) * .3)); transition: opacity var(--dur-fade); pointer-events: none; }
body[data-state="listening"] .mic::after { opacity: calc(.3 + var(--lvl, 0) * .6); }
body[data-state="listening"] .mic { background: color-mix(in srgb, var(--accent) 88%, #000); }
.talk-voice__body { display: grid; gap: 3px; min-width: 0; }
.talk-voice__row { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.talk-voice__row b { font: var(--weight-semibold) var(--text-headline)/1.2 var(--font-sans); white-space: nowrap; }
.talk-voice .ui-voice__wave { height: 22px; transition: opacity var(--dur-fade) var(--ease-out); }
.talk-voice:is([data-state="idle"], [data-state="confirming"]) .ui-voice__wave { opacity: 0; }
.talk-voice .ui-voice__wave i { --l: 0; height: calc(3px + var(--l) * 19px); }
.talk-voice[data-state="confirming"] .ui-voice__wave i { --l: 0 !important; background: var(--status-warn); }
.talk-voice[data-state="thinking"] .ui-voice__wave i { --l: 0 !important; }
.talk-hint { font-size: var(--text-footnote); color: var(--label-secondary); }
.talk-hint.err { color: var(--status-critical-text); }

.type { display: grid; gap: 6px; }
.type-row { position: relative; display: flex; align-items: center; }
.type .ui-input { height: 48px; padding: 0 54px 0 16px; border-radius: var(--radius-full); font-size: 17px; letter-spacing: -0.02em; }
.send { position: absolute; right: 2px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--accent); color: var(--accent-on);
  transition: transform var(--dur-bouncy) var(--ease-bouncy), opacity var(--dur-fade) var(--ease-out), background-color var(--dur-fade) var(--ease-out); }
.send svg { width: 20px; height: 20px; stroke-width: 2.2; }
.send:active { transform: scale(.9); }
.send[disabled] { background: var(--fill); color: var(--label-secondary); cursor: default; }
.send[aria-busy="true"] { background: var(--accent); color: var(--accent-on); opacity: .85; }
.send .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* demo script: a grouped list, one section per story */
.script { display: grid; gap: 18px; max-height: min(60vh, 640px); overflow: auto; margin: 0 -8px; padding: 0 8px 2px; scrollbar-width: thin; overscroll-behavior: contain; }
.act { display: grid; gap: 2px; }
.act h3 { margin: 0 0 6px 8px; display: grid; gap: 1px; }
.act h3 b { font: var(--weight-semibold) var(--text-headline)/1.25 var(--font-sans); }
.act h3 span { font-size: var(--text-footnote); font-weight: var(--weight-regular); color: var(--label-secondary); }
.line { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; min-height: 44px; text-align: left; border: 0; background: transparent;
  border-radius: 12px; padding: 10px 10px; cursor: pointer; font-size: var(--text-callout); line-height: 1.38; color: var(--label);
  transition: background-color var(--dur-fade) var(--ease-out), transform var(--dur-bouncy) var(--ease-bouncy); }
.line:hover { background: var(--fill-quaternary); }
.line:active { transform: scale(.985); }
.line .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: var(--weight-semibold); color: var(--label-secondary); box-shadow: inset 0 0 0 1.5px var(--separator-opaque); font-variant-numeric: tabular-nums; }
.line .n svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.line.done { color: var(--label-secondary); }
.line.done .n { background: var(--fill-tertiary); box-shadow: none; color: var(--label-secondary); }
.line.next { background: var(--accent-tint); }
.line.next .n { background: var(--accent); color: var(--accent-on); box-shadow: none; }
.line.next::after { content: attr(data-next); position: absolute; right: 10px; top: 10px; font-size: var(--text-footnote); font-weight: var(--weight-semibold); color: var(--accent-text); }
.line.next .t { padding-right: 38px; }
.fine { margin: 0; font-size: var(--text-footnote); color: var(--label-secondary); text-align: center; }
.fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 14px 6px; margin: -14px -6px; min-height: 44px; box-sizing: border-box; }

/* ---------- account linking: Alexa's own panel on the Echo Show (not an add-on card) ---------- */
.link-card { display: grid; gap: calc(var(--u) * 30); align-content: start; padding: calc(var(--u) * 44) calc(var(--u) * 48); border-radius: calc(var(--u) * 30);
  background: color-mix(in srgb, var(--sc-surface) 86%, transparent); -webkit-backdrop-filter: blur(calc(var(--u) * 30)); backdrop-filter: blur(calc(var(--u) * 30));
  animation: live-in var(--dur-smooth) var(--ease-smooth) both; }
.lc-head { display: grid; grid-template-columns: calc(var(--u) * 88) minmax(0, 1fr) auto; gap: calc(var(--u) * 26); align-items: center; }
.lc-mark { width: calc(var(--u) * 88); height: calc(var(--u) * 88); border-radius: calc(var(--u) * 20); display: block; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
.lc-mark svg { width: 100%; height: 100%; display: block; } /* Mandat's own logo (media/brand/icon.svg) */
.lc-head b { display: block; font-size: calc(var(--u) * 50); font-weight: var(--weight-bold); letter-spacing: -0.026em; line-height: 1.08; }
.lc-head div > span { display: block; font-size: calc(var(--u) * 28); color: var(--sc-label-2); margin-top: calc(var(--u) * 6); }
.lc-phone { width: calc(var(--u) * 92); height: calc(var(--u) * 92); border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--sc-accent) 16%, transparent); color: var(--sc-accent-text); animation: breathe 2.2s ease-in-out infinite; }
.lc-phone svg { width: 48%; height: 48%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lc-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 16); }
.lc-steps li { display: flex; align-items: center; gap: calc(var(--u) * 14); padding: calc(var(--u) * 20) calc(var(--u) * 22); border-radius: calc(var(--u) * 20); background: var(--sc-fill); font-size: calc(var(--u) * 27); font-weight: var(--weight-semibold); color: var(--sc-label-2); }
.lc-steps li.now { color: var(--sc-label); box-shadow: inset 0 0 0 calc(var(--u) * 3) var(--sc-accent); background: color-mix(in srgb, var(--sc-accent) 12%, transparent); }
.lc-steps li.done { color: var(--sc-label); }
.lc-n { flex: none; width: calc(var(--u) * 40); height: calc(var(--u) * 40); border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--u) * 21); background: var(--sc-fill); font-variant-numeric: tabular-nums; }
.lc-steps li.now .lc-n { background: var(--sc-accent); color: #fff; }
.lc-steps li.done .lc-n { background: var(--status-ok, #34c759); color: #fff; }
.lc-n svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lc-note { margin: 0; font-size: calc(var(--u) * 24); color: var(--sc-label-2); }

/* ---------- the person's phone (simulated Alexa app) ---------- */
.phone-sheet { position: fixed; right: max(16px, calc((100vw - var(--stage-max)) / 2 + 16px)); bottom: 20px; z-index: var(--z-sheet); display: grid; justify-items: center; animation: phoneIn var(--dur-smooth) var(--ease-smooth) both; }
.phone-sheet[hidden] { display: none; }
@keyframes phoneIn { from { opacity: 0; transform: translateY(40px) scale(.98); } }
.phone { position: relative; margin: 0; display: grid; gap: 10px; justify-items: center; }
.phone-screen { width: min(372px, calc(100vw - 32px)); height: min(760px, calc(100dvh - 96px)); border-radius: 46px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 10px #111214, 0 0 0 11px #2b2d32, 0 40px 90px -30px rgba(0, 0, 0, .55); }
.phone-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--bg-grouped); }
.phone figcaption { font-size: var(--text-footnote); color: var(--label-secondary); padding: 4px 12px; border-radius: 999px; background: var(--bg-grouped); }
.phone-close { position: absolute; top: -6px; right: -16px; z-index: 1; background: var(--bg-elevated) !important; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
@media (max-width: 760px) {
  .phone-sheet { inset: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); align-content: center; padding: 16px; }
  .phone-screen { height: calc(100dvh - 90px); border-radius: 32px; box-shadow: 0 0 0 6px #111214; }
  .phone-close { top: 4px; right: 4px; }
}
@media (prefers-reduced-motion: reduce) { .phone-sheet, .link-card, .lc-phone { animation: none; } }

/* ---------- MCP traffic drawer (always a dark console) ---------- */
.drawer { color-scheme: dark; position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(580px, calc(100vw - 24px)); z-index: var(--z-sheet); display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: #1c1c1e; color: #fff; border-radius: var(--radius-lg); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .1), 0 30px 80px -20px rgba(0, 0, 0, .6);
  animation: drawerIn var(--dur-smooth) var(--ease-smooth); }
@keyframes drawerIn { from { opacity: 0; transform: translateX(24px); } }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: .5px solid rgba(84, 84, 88, .6); }
.dh-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dh-title b { font-size: var(--text-headline); }
#sessionInfo { font: 12px/1.4 var(--font-mono); color: rgba(235, 235, 245, .64); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sessionInfo em { font-style: normal; color: #64d2ff; }
.log { margin: 0; padding: 6px 10px 16px; overflow: auto; list-style: none; font: 12px/1.45 var(--font-mono); }
.log li { padding: 7px 8px; border-radius: 10px; }
.log li:hover { background: rgba(255, 255, 255, .04); }
.log summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; white-space: nowrap; overflow: hidden; min-height: 24px; }
.log summary::-webkit-details-marker { display: none; }
.log .dir { font-weight: 700; flex: none; min-width: 112px; }
.log .t { color: rgba(235, 235, 245, .5); flex: none; }
.log .m { color: #fff; overflow: hidden; text-overflow: ellipsis; }
.log .m i { font-style: normal; color: rgba(235, 235, 245, .64); }
.log .out .dir { color: #64d2ff; } .log .in .dir { color: #30d158; } .log .orch .dir { color: #ffb340; } .log .view .dir { color: #bf8cff; }
.log pre { margin: 8px 0 2px; padding: 10px 12px; border-radius: 10px; background: #000; color: rgba(235, 235, 245, .82); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

/* ---------- size classes ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); padding-inline: var(--margin-regular); }
  .room { min-height: 0; }
  .talk { position: static; }
  .script { max-height: none; }
}
/* touch: every target at least 44 pt (HIG) */
@media (pointer: coarse), (max-width: 1100px) {
  .sim-devices label { height: 44px; }
  .sim-tools .ui-icon-button, .sim-tools .ui-button { --_s: 44px; --_h: 44px; min-height: 44px; }
  .sim-langs label { height: 44px; min-width: 52px; font-size: 17px; }
  .drawer .ui-button, .drawer .ui-icon-button { --_h: 44px; --_s: 44px; min-height: 44px; }
  .line { min-height: 48px; }
}
@media (max-width: 1000px) {
  .sim-bar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .sim-devices { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .sim-devices label { min-width: 0; padding: 0 8px; }
}
@media (max-width: 760px) {
  .sim-bar { padding-inline: var(--margin-compact); }
  /* phone: the language gets its own full-width row under the devices, never squeezed into the top bar */
  .sim-right { display: contents; }
  .sim-tools { grid-column: 2; grid-row: 1; justify-self: end; }
  .sim-langs { grid-column: 1 / -1; grid-row: 3; width: 100%; }
  .sim-langs label { min-width: 0; }
  .sim-dev .lbl, .sim-dev kbd { display: none; }
  .sim-dev { padding: 0; width: 44px; }
  .stage { padding: 0 var(--margin-compact) 32px; }
  .talk { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .trail li, .ask, .drawer { animation: none; }
  .wall-img { transition: opacity .6s linear; transform: none !important; }
  .live-list li, .live-title::before { animation: none !important; }
  body[data-state="thinking"] .lightbar span, .ring { animation: none !important; }
}
.sim-logo { width: 30px; height: 30px; border-radius: 7px; flex: none; }
