/* Waypoint host. A keynote stage: the device is the product, lit on a dark set, and the
   conversation is a glass sheet beside it. One grotesque (SF on Apple devices, Inter elsewhere),
   one accent family (Alexa blue to indigo), a 12-column grid on an 8 px rhythm. The device
   screen keeps Amazon's Alexa+ display tokens (Echo Show dark colors, type 48-12 px).
   Sources: Apple HIG (44 pt targets, materials, reduced motion), WCAG 2.2 (4.5:1 text,
   3:1 components and focus), Müller-Brockmann (grid, flush-left setting), Amazon Alexa+
   visual foundations. */

:root {
  color-scheme: dark;
  /* Stage: near-black set, glass surfaces, one blue accent family. */
  --bg: #050507; --canvas: #0b0b0e; --surface: rgba(26, 26, 30, .72); --surface-solid: #141417;
  --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
  --hairline: rgba(255, 255, 255, .08); --hairline-2: rgba(255, 255, 255, .14); --field: rgba(255, 255, 255, .16);
  --accent: #2997ff; --accent-strong: #0a5fd8; --accent-2: #4f46e5; --accent-ink: #ffffff; --focus: #2997ff;
  --grad-accent: linear-gradient(135deg, #0a5fd8 0%, #4f46e5 100%);
  --danger: #ff8a80;
  /* Type scale (px). */
  --t-hero: 64px; --t-display: 40px; --t-title: 24px; --t-headline: 20px; --t-body: 16px; --t-callout: 15px; --t-footnote: 14px; --t-caption: 12px;
  /* Spacing on an 8 px rhythm, with Amazon's fine steps. */
  --s-2: 2px; --s-4: 4px; --s-6: 6px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-48: 48px;
  --r-4: 4px; --r-8: 8px; --r-12: 12px; --r-16: 16px; --r-20: 20px; --r-24: 24px; --r-28: 28px; --r-40: 40px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Device: Amazon's Echo Show dark tokens. */
  --d-base: #000000; --d-card: #101114; --d-inner: #1a1c22; --d-line: rgba(255, 255, 255, .07);
  --d-ink: #f5f5f7; --d-ink-2: #a1a1a6; --d-accent: #2997ff; --d-ok: #30d158; --d-warn: #ffd60a; --d-bad: #ff6961;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; color: var(--ink); font: 400 var(--t-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01";
  /* The set: a key light over the device, a cool fill to the right, a faint floor bounce. */
  background:
    radial-gradient(1100px 680px at 28% -8%, rgba(41, 151, 255, .17), transparent 62%),
    radial-gradient(900px 620px at 96% 6%, rgba(79, 70, 229, .13), transparent 60%),
    radial-gradient(1200px 520px at 40% 112%, rgba(41, 151, 255, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-8); }
.muted, .small { color: var(--ink-2); }
.small { font-size: var(--t-footnote); }

/* ---------- Header: the only navigation layer, translucent over the set ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: var(--s-12) var(--s-24); align-items: center; justify-content: space-between;
  padding: var(--s-12) var(--s-32); background: rgba(5, 5, 7, .58);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--hairline);
}
.brand-row { display: flex; align-items: center; gap: var(--s-12); min-width: 0; }
.logo { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 0 10px rgba(41, 151, 255, .45)); }
.brand { display: block; font-size: 21px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; background: linear-gradient(100deg, #ffffff 30%, #9fd3ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: 12.5px; color: var(--ink-2); line-height: 1.3; letter-spacing: -.005em; }
.sim-tag { padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(41, 151, 255, .4); background: rgba(41, 151, 255, .1); color: #9fd3ff; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.controls { display: flex; flex-wrap: wrap; gap: var(--s-8); align-items: center; }
.menu-btn { display: none; }
.seg { position: relative; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--hairline); }
.seg button {
  position: relative; border: 0; background: transparent; color: var(--ink-2); height: 32px; min-width: 44px; padding: 0 var(--s-12);
  border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .02em; transition: background .2s, color .2s;
}
.seg button::after { content: ""; position: absolute; inset: -6px -4px; } /* 44 px hit area around a 32 px control */
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 3px rgba(0, 0, 0, .4); }
select, .btn-ghost {
  height: 40px; padding: 0 var(--s-16); border-radius: 999px; border: 1px solid var(--hairline-2); background: rgba(255, 255, 255, .06); color: var(--ink);
  font-size: 13px; font-weight: 500; transition: background .2s, border-color .2s;
}
select option { background: #1c1c1e; color: var(--ink); }
/* The device picker keeps the pill; the browser's stock arrow is replaced by one that sits inside it. */
select { -webkit-appearance: none; appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23f5f5f7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; background-size: 12px 8px; }
.btn-ghost:hover, select:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .22); }

/* ---------- Layout: 12 columns; the device leads ---------- */
.layout {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-32); align-items: stretch;
  max-width: 1480px; margin: 0 auto; padding: var(--s-48) var(--s-32) 72px;
}
.frame { grid-column: span 7; min-width: 0; display: flex; flex-direction: column; position: relative; isolation: isolate; }
.frame[data-device="voice"] { align-self: start; }
.chat-col { grid-column: span 5; }
@media (min-width: 1280px) { .frame { grid-column: span 8; } .chat-col { grid-column: span 4; } }
@media (max-width: 1040px) {
  .frame, .chat-col { grid-column: 1 / -1; }
  .layout { padding: var(--s-24) var(--s-16) var(--s-32); gap: var(--s-24); }
}

/* ---------- Conversation: a glass sheet beside the device ---------- */
.chat-col {
  --chat-h: max(560px, calc(100vh - 152px));
  position: sticky; top: 112px; display: flex; flex-direction: column; gap: var(--s-12); min-width: 0; min-height: var(--chat-h); max-height: var(--chat-h);
  padding: var(--s-20) var(--s-20) var(--s-16); border-radius: var(--r-28);
  background: linear-gradient(180deg, rgba(32, 32, 37, .74), rgba(16, 16, 19, .74));
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 40px 90px -40px rgba(0, 0, 0, .85);
}
/* Narrow screens: no blur on the sheet, since a filtered ancestor would hold the fixed composer inside it. */
@media (max-width: 1040px) { .chat-col { position: static; height: auto; min-height: 0; max-height: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(180deg, rgba(30, 30, 35, .94), rgba(18, 18, 21, .94)); } .transcript { max-height: 420px; } }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-8); padding: 0 var(--s-4); }
.chat-head > span:first-child { font-size: 17px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.toggle { display: inline-flex; gap: var(--s-6); align-items: center; font-size: 13px; color: var(--ink-2); cursor: pointer; }
/* A drawn box and tick in the system's colours, not the browser's blue square. */
.toggle input { -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 1.5px solid var(--field); background: rgba(255, 255, 255, .06); cursor: pointer; transition: background .15s, border-color .15s; }
.toggle input::before { content: ""; width: 10px; height: 10px; background: var(--accent-ink); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transform: scale(0); transition: transform .15s var(--ease); }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::before { transform: scale(1); }
.toggle input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.transcript { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-8); padding: var(--s-4) var(--s-2); overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.bubble { max-width: 84%; padding: 10px 15px; border-radius: 20px; font-size: var(--t-callout); line-height: 1.47; letter-spacing: -.005em; white-space: pre-wrap; animation: rise .36s var(--ease) both; }
.bubble.user { align-self: flex-end; background: var(--grad-accent); color: var(--accent-ink); border-bottom-right-radius: 6px; box-shadow: 0 8px 24px -12px rgba(41, 151, 255, .6); }
.bubble.assistant { align-self: flex-start; background: rgba(255, 255, 255, .075); color: var(--ink); border-bottom-left-radius: 6px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.empty-chat { align-self: flex-start; margin: auto 0; max-width: 30ch; padding: 0 var(--s-4); text-align: left; color: var(--ink-2); font-size: var(--t-callout); line-height: 1.5; }
.thinking { display: flex; align-items: center; gap: var(--s-8); color: var(--ink-2); font-size: 13px; padding: 0 var(--s-4); }
.thinking[hidden] { display: none; }
.dots { display: inline-flex; gap: var(--s-6); }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(41, 151, 255, .7); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-3px); opacity: 1; } }
.trace { display: flex; flex-wrap: wrap; gap: var(--s-6); font-size: var(--t-caption); color: var(--ink-2); padding: 0 var(--s-4); }
.trace:empty { display: none; }
.trace .step { padding: 2px var(--s-8); border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--hairline); font-variant-numeric: tabular-nums; }
.trace .step.err { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-6); }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hairline-2); background: rgba(255, 255, 255, .045);
  color: var(--ink); font-size: 13px; text-align: left; transition: background .2s, border-color .2s, transform .15s;
}
.chip:hover { background: rgba(41, 151, 255, .14); border-color: rgba(41, 151, 255, .5); }
.chip:active { transform: scale(.97); }
/* The composer: one pill holding the microphone, the field and the send arrow, as in Messages. */
.input { display: flex; gap: var(--s-6); align-items: flex-end; padding: 5px; border-radius: 27px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .4); transition: border-color .2s, box-shadow .2s; }
.input:focus-within { border-color: rgba(41, 151, 255, .7); box-shadow: 0 0 0 4px rgba(41, 151, 255, .18); }
/* The box grows with what is typed, up to three lines, then scrolls (like a messaging app). */
.input textarea { flex: 1; min-width: 0; box-sizing: border-box; height: 42px; min-height: 42px; max-height: calc(3 * 1.35em + 18px); padding: 9px var(--s-8); border: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--t-body); line-height: 1.35; resize: none; overflow-y: auto; overscroll-behavior: contain; }
.input textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input textarea:focus { outline: none; }
.input button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; flex: none; border-radius: 50%; border: 0; color: var(--ink); transition: transform .15s, background .2s, opacity .2s; }
.input button#mic { background: rgba(255, 255, 255, .08); }
.input button#mic:hover { background: rgba(255, 255, 255, .14); }
.input button#mic.listening { background: var(--d-accent); color: #001827; box-shadow: 0 0 0 6px rgba(41, 151, 255, .22), 0 0 24px rgba(41, 151, 255, .6); }
.input button#send { background: var(--grad-accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(41, 151, 255, .8); }
.input button:active { transform: scale(.94); }

/* ---------- Device: an Echo Show, lit like a product shot ---------- */
.screen {
  position: relative; display: flex; flex-direction: column; flex: 1 1 auto; overflow: hidden; min-height: 620px; color: var(--d-ink);
  border: 14px solid #0c0c0f; border-radius: 44px;
  background: radial-gradient(140% 90% at 50% -12%, #0d1a2f 0%, #05070b 52%, #000 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .1),
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    0 60px 110px -46px rgba(0, 0, 0, .95),
    0 30px 120px -60px rgba(41, 151, 255, .45);
  animation: device-in .9s var(--ease) both;
}
/* Glass: a soft diagonal reflection across the display. */
.screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(118deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 30%); }
/* The device's light on the floor; it brightens while the device listens or speaks. */
.frame::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -40px; height: 70px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(41, 151, 255, .34), transparent 72%); filter: blur(22px); opacity: .55; transition: opacity .5s var(--ease);
}
.frame:has(.lightbar[data-state="speaking"])::after, .frame:has(.lightbar[data-state="listening"])::after { opacity: 1; }
.frame[data-device="voice"]::after { display: none; }
/* Focus stays visible on the always-dark device screen (WCAG 1.4.11). */
.screen :focus-visible { outline-color: var(--d-accent); }
.frame[data-device="mobile"] { max-width: 400px; margin: 0 auto; width: 100%; }
.frame[data-device="mobile"] .screen { border-radius: 48px; border-width: 10px; }
.frame[data-device="voice"] .screen { min-height: 0; }
.frame[data-device="voice"] .stage > :not(.reply) { display: none; }
.frame[data-device="voice"] .topbar .brand-s { display: none; }
.frame[data-device="voice"] .topbar .conn { display: none; }

.topbar { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--s-12); height: 56px; padding: 0 var(--s-32); font-size: 13px; color: var(--d-ink-2); }
.topbar .clock { justify-self: start; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.topbar .brand-s { display: inline-flex; align-items: center; gap: var(--s-8); font-size: var(--t-caption); font-weight: 600; color: var(--d-ink); letter-spacing: .14em; text-transform: uppercase; }
.topbar .brand-s svg { flex: none; filter: drop-shadow(0 0 6px rgba(41, 151, 255, .55)); }
.topbar .conn { justify-self: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--s-8); }
/* A status dot, like a device status bar: green and softly pulsing while the server answers. */
.topbar .conn:not(:empty)::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--d-ok, #30d158); box-shadow: 0 0 0 0 rgba(48, 209, 88, .5); animation: conn-pulse 2.4s ease-out infinite; }
@keyframes conn-pulse { 0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); } }
@media (prefers-reduced-motion: reduce) { .topbar .conn:not(:empty)::before { animation: none; } }
.topbar::after { content: ""; position: absolute; left: var(--s-32); right: var(--s-32); bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .10) 20%, rgba(255, 255, 255, .10) 80%, transparent); pointer-events: none; }
/* The home screen shows its own large clock, so the small one steps back. */

.stage { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--s-20); padding: var(--s-8) var(--s-32) var(--s-32); }

/* The Alexa light: a glowing bar along the bottom edge. */
.lightbar {
  position: absolute; left: 22%; right: 22%; bottom: 0; height: 5px; border-radius: 999px 999px 0 0; opacity: 0; transition: opacity .3s;
  background: linear-gradient(90deg, #64d2ff, var(--d-accent), #6e6cff, var(--d-accent), #64d2ff); background-size: 200% 100%;
  box-shadow: 0 0 22px 4px rgba(41, 151, 255, .55), 0 0 60px 10px rgba(41, 151, 255, .25);
}
.lightbar[data-state="listening"] { opacity: 1; animation: lb-breathe 1.2s ease-in-out infinite; }
.lightbar[data-state="thinking"] { opacity: 1; animation: lb-sweep 1.1s linear infinite; }
.lightbar[data-state="speaking"] { opacity: 1; animation: lb-sweep 2.4s linear infinite, lb-breathe .8s ease-in-out infinite; }
@keyframes lb-sweep { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes lb-breathe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ---------- Home screen: the time, the date, and an invitation ---------- */
.home { display: none; position: relative; margin-top: var(--s-24); }
.stage:not(.active):has(#hero:empty):has(.cards:empty) .home { display: block; }
.home-time {
  position: relative; z-index: 1; font-size: 120px; font-weight: 200; line-height: .92; letter-spacing: -.045em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 30%, #b9c6d8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-time .ampm { margin-left: var(--s-12); font-size: 28px; font-weight: 400; letter-spacing: 0; color: var(--d-ink-2); -webkit-text-fill-color: var(--d-ink-2); }
.home-date { position: relative; z-index: 1; margin-top: var(--s-12); font-size: var(--t-headline); font-weight: 500; color: var(--d-ink-2); letter-spacing: -.01em; }
.home-date::first-letter { text-transform: uppercase; }
/* The device's sign of life: a slow light that turns through the accent colors, as Siri's glow does. */
.home::after {
  content: ""; position: absolute; top: -24px; right: 8px; width: 220px; height: 220px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, #64d2ff, #2997ff, #5e5ce6, #bf5af2, #2997ff, #64d2ff);
  filter: blur(36px); opacity: .5; mix-blend-mode: screen; animation: orb-spin 4.8s var(--ease) 1 both;
}
@keyframes orb-spin { to { transform: rotate(360deg); } }

/* Empty state: the capabilities, set as a short quiet list at the foot of the screen. */
.welcome { display: flex; flex-direction: column; gap: var(--s-12); margin-top: auto; padding-top: var(--s-16); }
.welcome[hidden] { display: none; }
.stage.active .welcome { display: none; }
.stage.active:has(.cards:empty) .welcome { display: flex; }
.welcome-intro { margin: 0; font-size: var(--t-caption); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--d-ink-2); }
.welcome-tags { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-8); list-style: none; margin: 0; padding: 0; }
.welcome-tags li { color: var(--d-ink); font-size: var(--t-callout); }
.welcome-tags li:not(:last-child)::after { content: "·"; margin-left: var(--s-8); color: var(--d-ink-2); }

/* ---------- Hero: the trip as an editorial block ---------- */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-24);
  padding: 28px 32px; border-radius: var(--r-28);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(41, 151, 255, .30), transparent 55%),
    radial-gradient(100% 120% at 100% 100%, rgba(94, 92, 230, .24), transparent 60%),
    linear-gradient(180deg, #121a2a, #0a0c11);
  border: 1px solid rgba(255, 255, 255, .09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 24px 48px -28px rgba(0, 0, 0, .9);
  animation: rise .5s var(--ease) both;
}
.hero:empty { display: none; }
.h-main { min-width: 0; }
.h-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-8); color: var(--d-ink-2); font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.h-kicker .ico { width: 16px; height: 16px; color: #8ccaff; }
.h-dest { margin: var(--s-6) 0 0; font-size: var(--t-hero); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.h-stats { margin-top: var(--s-16); display: flex; align-items: center; gap: var(--s-24); }
.h-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-8); color: var(--d-ink-2); font-size: var(--t-callout); font-variant-numeric: tabular-nums; }
.h-stats .ring { width: 84px; height: 84px; }
.h-stats .r-v b { font-size: 20px; }
/* The globe: the group's routes to the destination, on the hero's right. */
.h-globe { width: 288px; aspect-ratio: 1; margin: -20px -16px -20px 0; pointer-events: none; }
.h-globe[hidden] { display: none; }
.h-globe canvas { display: block; width: 100%; height: 100%; }
.h-count b { color: var(--d-ink); font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
/* The actions run under the whole hero, so the globe never squeezes them. */
.h-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-8); }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8); min-height: 40px; padding: 0 var(--s-16) 0 var(--s-12);
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .07); color: var(--d-ink);
  font-size: var(--t-footnote); font-weight: 500; transition: background .2s, border-color .2s, transform .15s;
}
.act .ico { width: 18px; height: 18px; color: #9fd3ff; }
.act:hover { background: rgba(255, 255, 255, .14); }
.act:active { transform: scale(.97); }
.act[data-action="panel"] { background: rgba(41, 151, 255, .2); border-color: rgba(41, 151, 255, .45); }
.act[data-action="panel"]:hover { background: rgba(41, 151, 255, .3); }

.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 7; }
.r-bg { stroke: rgba(255, 255, 255, .08); }
.r-fg { stroke: url(#wpRing); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(48, 209, 88, .4)); animation: ring-move 1.1s var(--ease) both; }
@keyframes ring-move { from { stroke-dashoffset: var(--from); } }
.r-v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-variant-numeric: tabular-nums; }
.r-v b { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.r-v span { font-size: var(--t-caption); color: var(--d-ink-2); text-transform: uppercase; letter-spacing: .12em; }

/* ---------- Spoken reply: short, one focal point ---------- */
/* Before the first question the greeting is the invitation under the clock. */
.stage:not(.active) .headline { margin-top: var(--s-24); font-size: 34px; font-weight: 600; line-height: 1.12; letter-spacing: -.028em; max-width: 21ch; -webkit-line-clamp: unset; overflow: visible; display: block; }
.reply { display: flex; flex-direction: column; gap: var(--s-8); }
.headline { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.36; letter-spacing: -.016em; color: #ececf1; max-width: 44ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.headline:empty { display: none; }
/* Shown when the spoken reply is clamped: the full reply is in the chat. */
.more-cue { margin: 0; font-size: var(--t-caption); color: var(--d-ink-2); letter-spacing: .01em; }
.more-cue[hidden] { display: none; }

/* ---------- Cards: one material, hairline rows, no ornament ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-12); align-items: start; }
.frame[data-device="mobile"] .cards, .frame[data-device="voice"] .cards { grid-template-columns: 1fr; }
.card {
  min-width: 0; padding: var(--s-20) var(--s-24); border-radius: var(--r-24);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)), var(--d-card);
  border: 1px solid var(--d-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 40px -28px rgba(0, 0, 0, .9);
  animation: rise .45s var(--ease) both;
}
.cards > .card:nth-child(2) { animation-delay: .06s; }
.cards > .card:nth-child(3) { animation-delay: .12s; }
.cards > .card:nth-child(n + 4) { animation-delay: .18s; }
.card .ch { margin-bottom: var(--s-12); }
.card .ch h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.018em; }
.card .sub { margin-top: var(--s-2); font-size: 13px; color: var(--d-ink-2); }
.src { margin-top: var(--s-16); padding-top: var(--s-12); border-top: 1px solid var(--d-line); font-size: var(--t-caption); color: var(--d-ink-2); }
.ico { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.pill { font-size: var(--t-caption); font-weight: 500; padding: 2px var(--s-8); border-radius: 999px; white-space: nowrap; }
.pill.warn { background: rgba(255, 214, 10, .14); color: var(--d-warn); }
.pill.blocked { background: rgba(255, 105, 97, .14); color: var(--d-bad); }
.muted-s { color: var(--d-ink-2); margin: 0; font-size: var(--t-footnote); }
.more { font-size: var(--t-caption); margin-top: var(--s-8); }
.card.wide { grid-column: 1 / -1; }
.cards > .card:only-child { grid-column: 1 / -1; }
/* A long list of rules takes two columns and lays its rules out in as many columns as fit, so a short card beside it is not left beside a tall empty one. */
.cards > .k-rules { grid-column: span 2; }
.k-rules .rules { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: start; }
.frame[data-device="mobile"] .cards > .k-rules, .frame[data-device="voice"] .cards > .k-rules { grid-column: auto; }
.cards > .k-packing:only-child .check { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: var(--s-16); }

.row { display: flex; justify-content: space-between; gap: var(--s-16); padding: 10px 0; border-top: 1px solid var(--d-line); font-size: var(--t-footnote); }
.row:first-of-type { border-top: 0; }
.row .label { font-weight: 600; display: flex; align-items: baseline; min-width: 0; }
.row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; background: #8a909a; flex: none; transform: translateY(-1px); }
.row.ok .dot { background: var(--d-ok); box-shadow: 0 0 8px rgba(48, 209, 88, .55); }
.row.warn .dot { background: var(--d-warn); box-shadow: 0 0 8px rgba(255, 214, 10, .45); }
.row.blocked .dot { background: var(--d-bad); box-shadow: 0 0 8px rgba(255, 105, 97, .5); }
.row .value { text-align: right; color: var(--d-ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.row.long { flex-direction: column; gap: var(--s-4); }
.row.long .value { text-align: left; color: var(--d-ink-2); line-height: 1.5; -webkit-line-clamp: 3; }

.verdict { display: flex; gap: var(--s-12); align-items: flex-start; padding: var(--s-12) 0; border-top: 1px solid var(--d-line); }
.verdict:first-of-type { border-top: 0; padding-top: 0; }
.verdict .ico { width: 32px; height: 32px; border-radius: 50%; padding: 7px; }
.verdict.ok .ico { background: rgba(48, 209, 88, .14); color: var(--d-ok); }
.verdict.warn .ico { background: rgba(255, 214, 10, .14); color: var(--d-warn); }
.verdict.blocked .ico { background: rgba(255, 105, 97, .14); color: var(--d-bad); }
.v-name { font-size: var(--t-caption); color: var(--d-ink-2); }
.v-main { font-size: var(--t-headline); font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.v-sub { font-size: var(--t-footnote); color: var(--d-ink-2); }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-8); }
.rules li { padding: var(--s-12) var(--s-16); border-radius: var(--r-16); background: var(--d-inner); }
.rules li.sev { box-shadow: inset 3px 0 0 var(--d-bad); }
.rules li:not(.sev) { box-shadow: inset 3px 0 0 var(--d-warn); }
.r-top { display: flex; justify-content: space-between; gap: var(--s-8); align-items: center; margin-bottom: var(--s-6); }
.r-cat { font-size: var(--t-caption); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--d-ink-2); }
.rules p { margin: 0; font-size: var(--t-footnote); line-height: 1.5; }

.money .m-from { color: var(--d-ink-2); font-size: var(--t-footnote); }
.money .m-to { margin: var(--s-4) 0 var(--s-6); font-size: 48px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.money .m-ppp { font-size: var(--t-footnote); color: var(--d-ink-2); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); }
.tile { padding: var(--s-12) var(--s-16); border-radius: var(--r-16); background: var(--d-inner); }
.tile .ico { color: var(--d-accent); margin-bottom: var(--s-6); }
.t-k { font-size: var(--t-caption); color: var(--d-ink-2); }
.t-v { font-size: var(--t-body); font-weight: 600; }

.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #64d2ff, var(--d-accent)); transition: width .6s var(--ease); }
.k-packing .sub { margin: var(--s-8) 0 var(--s-8); }
.check { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tick { display: flex; gap: var(--s-12); align-items: center; width: 100%; min-height: 40px; text-align: left; background: transparent; border: 0; color: var(--d-ink); padding: var(--s-6) var(--s-8); border-radius: var(--r-12); font-size: var(--t-footnote); transition: background .2s; }
.tick:hover { background: rgba(255, 255, 255, .05); }
.tick .ico { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #6e6e73; color: transparent; padding: 2px; transition: background-color .2s, border-color .2s; }
.tick.just .ico { animation: tick-pop .42s var(--ease); }
@keyframes tick-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.tick.on .ico { background: var(--d-ok); border-color: var(--d-ok); color: #06210f; box-shadow: 0 0 10px rgba(48, 209, 88, .45); }
.tick.on span { color: var(--d-ink-2); text-decoration: line-through; }
.avoid { margin-top: var(--s-12); padding: var(--s-12) var(--s-16); border-radius: var(--r-16); background: rgba(255, 105, 97, .08); border: 1px solid rgba(255, 105, 97, .14); }
.a-h { display: flex; gap: var(--s-6); align-items: center; font-size: var(--t-footnote); font-weight: 600; color: var(--d-bad); margin-bottom: var(--s-4); }
.avoid p { margin: var(--s-4) 0 0; font-size: var(--t-footnote); line-height: 1.5; }

.k-day .d-n { font-size: var(--t-caption); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--d-accent); }
.k-day h2 { margin-top: var(--s-2) !important; }
.k-day.free { padding: var(--s-12) var(--s-16); }
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-12); }
.slots li { display: flex; gap: var(--s-12); }
.slots .ico { color: var(--d-warn); margin-top: 2px; }
.s-k { font-size: var(--t-caption); color: var(--d-ink-2); letter-spacing: .06em; text-transform: uppercase; }
.s-v { font-size: var(--t-footnote); font-weight: 500; }
.s-note { font-size: var(--t-caption); color: var(--d-warn); margin-top: var(--s-2); }

.k-brief .ring { width: 104px; height: 104px; margin: 0 auto var(--s-12); }
.k-brief .r-v b { font-size: 24px; }
.pending { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-8); }
.pending li { display: flex; gap: var(--s-8); font-size: var(--t-footnote); }
.pending .ico { color: var(--d-warn); }
.ok-line { display: flex; gap: var(--s-8); align-items: center; margin: 0; color: var(--d-ok); font-size: var(--t-footnote); }

/* Climate: the high and low as figures, a bar on a -10 to 40 °C scale, the rain, and what to pack. */
.clim-sub { margin: -6px 0 var(--s-12); }
.clim { display: grid; gap: var(--s-12); margin-bottom: var(--s-12); }
.clim-temps { display: flex; align-items: baseline; gap: var(--s-12); font-variant-numeric: tabular-nums; }
.clim-hi { font-size: 56px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.clim-lo { font-size: 32px; font-weight: 400; letter-spacing: -.03em; color: var(--d-ink-2); }
.clim-bar { position: relative; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.clim-bar span { position: absolute; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, #64d2ff, #30d158 45%, #ffd60a 75%, #ff9f0a); background-size: 300px 100%; box-shadow: 0 0 12px rgba(100, 210, 255, .35); }
.clim-meta { display: flex; align-items: center; gap: var(--s-6); font-size: var(--t-footnote); color: var(--d-ink-2); }
.clim-meta .ico { width: 16px; height: 16px; color: #64d2ff; }
.clim-advice .ico { color: #9fd3ff; }
.h-clim { display: inline-flex; align-items: center; gap: var(--s-4); margin-left: var(--s-4); padding: 2px var(--s-8) 2px var(--s-6); border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--d-ink); font-variant-numeric: tabular-nums; }
.h-clim .ico { width: 14px; height: 14px; color: #ffd60a; }

.sub-h { margin: var(--s-16) 0 var(--s-8); font-size: var(--t-caption); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--d-ink-2); }
.bal { margin: var(--s-8) 0; }
.bal-top { display: flex; justify-content: space-between; gap: var(--s-12); font-size: var(--t-footnote); font-variant-numeric: tabular-nums; }
.bal-top b { font-weight: 600; }
.bal.pos .bal-top b { color: var(--d-ok); }
.bal.neg .bal-top b { color: var(--d-warn); }
.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: var(--s-6); }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #64d2ff, var(--d-accent)); transition: width .5s var(--ease); }
.fair { padding: var(--s-12) 0; border-top: 1px solid var(--d-line); }
.fair:first-of-type { border-top: 0; padding-top: 0; }
.fair.low .bar span { background: var(--d-warn); }
.fair.clash .bar span { background: var(--d-bad); }
.avoid-chip { display: inline-flex; align-items: center; gap: var(--s-6); margin-top: var(--s-6); font-size: var(--t-caption); color: var(--d-bad); }
.avoid-chip .ico { width: 16px; height: 16px; }

/* ---------- MCP App panel: covers the screen ---------- */
.apps:empty { display: none; }
.apps.open { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; gap: var(--s-8); padding: var(--s-12); background: var(--d-base); animation: fade .3s var(--ease) both; }
.apps.open iframe { flex: 1 1 0; min-height: 0; width: 100%; border: 0; border-radius: var(--r-20); background: var(--d-base); color-scheme: dark; }
.apps .close { align-self: flex-end; min-height: 36px; padding: 0 var(--s-16); border-radius: 999px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .08); color: var(--d-ink); font-size: 13px; font-weight: 500; }
.apps .close:hover { background: rgba(255, 255, 255, .14); }
.apps:not(.open) { display: none; }
.form { position: absolute; inset: auto var(--s-16) var(--s-16) var(--s-16); z-index: 3; padding: var(--s-20); border-radius: var(--r-20); background: rgba(26, 28, 34, .94); border: 1px solid var(--d-line); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.form label { display: block; margin: var(--s-8) 0 var(--s-4); font-size: var(--t-footnote); }
.form input[type="text"] { width: 100%; min-height: 40px; padding: 0 var(--s-12); border-radius: var(--r-12); border: 1px solid #6e6e73; background: var(--d-base); color: var(--d-ink); }
.form .actions { display: flex; gap: var(--s-8); margin-top: var(--s-12); }

@media (max-width: 1040px) {
  /* The composer stays reachable: on narrow screens the conversation sits under the device. */
  /* --kb is the height of the on-screen keyboard (set from the visual viewport), so the bar rides above it instead of hiding under it. */
  .input { position: fixed; left: var(--s-12); right: var(--s-12); bottom: calc(var(--s-12) + var(--kb, 0px) + env(safe-area-inset-bottom)); z-index: 20; background: rgba(28, 28, 32, .82); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9); }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
.toast { position: fixed; left: 50%; bottom: var(--s-24); transform: translateX(-50%); z-index: 30; padding: var(--s-8) var(--s-16); border-radius: 999px; background: rgba(245, 245, 247, .96); color: #1d1d1f; font-size: var(--t-footnote); font-weight: 500; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7); animation: toast-in .3s var(--ease) both; }
/* The phone offset comes after the base position, so it wins; the entrance keeps the centring. */
@media (max-width: 1040px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Footer: developer details, out of the way ---------- */
.foot { max-width: 1480px; margin: 0 auto; padding: 0 var(--s-32) var(--s-48); display: flex; flex-direction: column; gap: var(--s-12); font-size: var(--t-footnote); color: var(--ink-2); }
@media (max-width: 1040px) { .foot { padding: 0 var(--s-16) var(--s-32); } }
.foot details { padding: var(--s-12) var(--s-16); border-radius: var(--r-16); background: rgba(255, 255, 255, .035); border: 1px solid var(--hairline); }
.foot summary { cursor: pointer; font-weight: 500; color: var(--ink-2); }
.log-key { margin: var(--s-8) 0 0; }
.log { margin: var(--s-8) 0 0; max-height: 440px; overflow: auto; }
.log-row { margin-top: var(--s-8); padding: 8px 10px 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--tool) 18%, transparent); border: 1px solid color-mix(in srgb, var(--tool) 55%, transparent); border-left: 8px solid var(--tool); }
.log-row[data-kind="call"] { box-shadow: 0 0 22px color-mix(in srgb, var(--tool) 28%, transparent); }
.log-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.log-head time { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink-3); }
.log-kind { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--tool); color: var(--on-tool); }
.log-row[data-kind="answer"] .log-kind, .log-row[data-kind="note"] .log-kind { background: transparent; color: var(--tool); box-shadow: inset 0 0 0 1.5px var(--tool); }
.log-tool { font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 4px 8px; border-radius: 8px; background: var(--tool); color: var(--on-tool); }
.log-row[data-key="brain"] .log-tool { background: #1a1400; color: #ffe14a; box-shadow: inset 0 0 0 2px #ffe14a; }
.log-name:empty { display: none; }
.log-name { font-weight: 700; color: var(--ink); }
.log-what { margin: 4px 0 0; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.log-body { margin: 4px 0 0; color: var(--ink-3); font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }

/* ---------- The header: the controls fold into a Settings menu before they wrap into a second row ---------- */
@media (max-width: 1180px) {
  .top { padding: var(--s-8) var(--s-16); gap: var(--s-8); }
  .menu-btn { display: inline-flex; align-items: center; }
  .controls { display: none; grid-template-columns: auto auto; justify-content: start; gap: var(--s-6); }
  .controls.open { display: grid; width: 100%; }
  select, .btn-ghost { height: 36px; padding: 0 var(--s-12); font-size: 13px; }
  .seg button { height: 30px; }
}

/* ---------- Small screens: the same system, tighter ---------- */
@media (max-width: 560px) {
  /* The tag that says this is a simulated host stays; the words before it go. */
  .tagline span:first-child { display: none; }
  .frame .screen, .frame[data-device="mobile"] .screen { border-width: 0; border-radius: var(--r-28); }
  .frame::after { bottom: -24px; }
  .screen { min-height: 560px; }
  .chat-col { padding: var(--s-16); border-radius: var(--r-24); }
  .bubble { max-width: 90%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; }
  .chip { flex: none; white-space: nowrap; }
}
@media (pointer: coarse) {
  button, .chip, select { min-height: 44px; }
  .act, .apps .close, .toggle { min-height: 44px; }
  .input button { width: 44px; height: 44px; }
  .foot summary { min-height: 44px; padding: 12px 0; }
  .seg button { min-height: 40px; }
}

/* ---------- Autopilot: the preparation as a live run of tool calls ---------- */
.act.primary { background: var(--grad-accent); border-color: rgba(120, 170, 255, .5); color: #fff; font-weight: 600; box-shadow: 0 8px 24px -10px rgba(41, 120, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.act.primary .ico { color: #fff; }
.act.primary:hover { background: linear-gradient(135deg, #1a6ff0 0%, #5b52f0 100%); }
.k-mission { position: relative; overflow: hidden; container-type: inline-size; scroll-margin-top: 132px; }
.k-mission::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 120%; background: radial-gradient(closest-side, rgba(41, 151, 255, .16), transparent); pointer-events: none; }
.m-progress { position: relative; height: 4px; margin: 0 0 var(--s-16); border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.m-progress span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2997ff, #64d2ff 60%, #30d158); box-shadow: 0 0 14px rgba(100, 210, 255, .6); transition: width .5s var(--ease); }
.mission { position: relative; display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.m-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: var(--s-12); padding: var(--s-8) var(--s-12); border-radius: 14px;
  opacity: 0; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 45ms); transition: background .3s; }
.m-ico { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .18); color: transparent; transition: background .25s, border-color .25s, color .25s; }
.m-ico .ico { width: 14px; height: 14px; }
.m-text { display: grid; min-width: 0; }
.m-name { font-size: var(--t-callout); font-weight: 500; color: var(--d-ink-2); transition: color .25s; }
/* The result wraps: on a narrow card it is the part worth reading, so it is never cut. */
.m-res { font-size: 13px; color: var(--d-ink-2); overflow-wrap: anywhere; }
.m-res:empty { display: none; }
.m-by { font-size: var(--t-caption); color: var(--d-ink-2); opacity: .8; overflow-wrap: anywhere; }
.m-by:empty { display: none; }
.m-tool { font: 500 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #9fd3ff; padding: 5px 8px; border-radius: 8px; background: rgba(41, 151, 255, .1); border: 1px solid rgba(41, 151, 255, .18); white-space: nowrap; }
.m-ms { min-width: 52px; text-align: right; font-size: var(--t-caption); color: var(--d-ink-2); font-variant-numeric: tabular-nums; }
.m-step[data-state="run"] { background: rgba(41, 151, 255, .1); }
.m-step[data-state="run"] .m-name, .m-step[data-state="done"] .m-name { color: var(--d-ink); }
.m-step[data-state="run"] .m-ico { border-color: rgba(41, 151, 255, .35); border-top-color: #64d2ff; animation: orb-spin .8s linear infinite; box-shadow: 0 0 12px rgba(100, 210, 255, .45); }
.m-step[data-state="done"] .m-ico { background: var(--d-ok); border-color: var(--d-ok); color: #00210b; animation: tick-pop .35s var(--ease); }
.m-step[data-state="done"] .m-res { color: var(--d-ink); }
.m-step[data-state="skip"] .m-ico { border-style: dashed; }
.m-step[data-state="skip"] .m-tool { opacity: .5; }
.m-step[data-state="err"] .m-ico { background: rgba(255, 105, 97, .18); border-color: var(--d-bad); }
.m-step[data-state="err"] .m-res { color: var(--d-bad); }
/* Steps that run at the same time share a rail on the left, lit while any of them runs. */
.m-step[data-par]::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 2px; background: rgba(100, 210, 255, .28); transition: background .3s, box-shadow .3s; }
.m-step[data-par="first"]::before { top: 12px; border-radius: 2px 2px 0 0; }
.m-step[data-par="last"]::before { bottom: 12px; border-radius: 0 0 2px 2px; }
.mission:has([data-phase="2"][data-state="run"]) [data-phase="2"][data-par]::before,
.mission:has([data-phase="3"][data-state="run"]) [data-phase="3"][data-par]::before { background: #64d2ff; box-shadow: 0 0 10px rgba(100, 210, 255, .7); }
.m-foot { display: grid; gap: var(--s-8); margin-top: var(--s-12); padding-top: var(--s-12); border-top: 1px solid var(--d-line); font-size: var(--t-caption); color: var(--d-ink-2); }
.m-foot:empty { display: none; }
.m-stats { color: var(--d-ink); font-size: var(--t-footnote); font-weight: 500; font-variant-numeric: tabular-nums; }
.m-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-6); }
.m-srcs-h { margin-right: var(--s-2); }
.m-src { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); color: var(--d-ink); white-space: nowrap; animation: fade .4s var(--ease) both; }
/* A narrow card (a phone, the mobile device) drops the tool names; the steps keep their results and times. */
@container (max-width: 520px) {
  .m-step { grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--s-8); padding: var(--s-8); }
  .m-tool { display: none; }
}
.k-mission.m-done .m-progress span { background: linear-gradient(90deg, #30d158, #64d2ff); }

/* The phone hero follows the device's own width as well: the Móvil device is narrow on a wide screen. */
.frame[data-device="mobile"] .hero { grid-template-columns: minmax(0, 1fr); padding: var(--s-20); border-radius: var(--r-24); row-gap: var(--s-16); }
.frame[data-device="mobile"] .h-dest { font-size: 40px; }
.frame[data-device="mobile"] .h-count b { font-size: 24px; }
.frame[data-device="mobile"] .h-stats { gap: var(--s-16); margin-top: var(--s-12); }
.frame[data-device="mobile"] .h-stats .ring { width: 72px; height: 72px; }
.frame[data-device="mobile"] .h-stats .r-v b { font-size: 17px; }
.frame[data-device="mobile"] .h-globe { grid-row: 1; justify-self: center; width: 232px; margin: -8px 0 -12px; }
.frame[data-device="mobile"] .h-actions { display: grid; grid-template-columns: 1fr 1fr; }
.frame[data-device="mobile"] .act.primary { grid-column: 1 / -1; }
/* Every action in the phone hero is one height, so a label that wraps does not make its row taller. */
.frame[data-device="mobile"] .act { min-height: 44px; }

/* ---------- Motion: calm, short, and never required ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes device-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .card, .bubble, .hero { animation-name: fade; }
  .dots i, .lightbar, .r-fg, .tick.just .ico, .home::after, .screen { animation: none; }
  .m-step { opacity: 1; animation: none; }
  .m-step[data-state] .m-ico { animation: none; }
  .lightbar[data-state]:not([data-state="idle"]) { opacity: 1; }
}

/* Screen-reader-only text: live regions that announce status without showing it. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Brand chips (web/brands.js): a flat icon by kind, or the brand's own mark when Logos is on. */
.row.has-brands { flex-wrap: wrap; }
.brands { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; margin-top: 2px; }
.bchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: var(--d-ink); white-space: nowrap; max-width: 100%; }
.bchip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.bchip svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bchip .lg { display: none; fill: currentColor; stroke: none; width: auto; height: 15px; max-width: 46px; }
.bchip .lg.gl { fill: none; stroke: currentColor; width: 15px; }
.logos .bchip .g { display: none; }
.logos .bchip .lg { display: block; }
.bchip.b-card svg { color: #8fb4ff; } .bchip.b-wallet svg { color: #7ee0b5; } .bchip.b-ride svg { color: #ffd37a; }
.bchip.b-delivery svg { color: #ff9f8a; } .bchip.b-shop svg { color: #d7a8ff; } .bchip.b-transit svg { color: #8ae0ff; }
.row .label .bchip { margin-right: 2px; }
@media (max-width: 560px) { .bchip { font-size: 11.5px; padding: 3px 9px 3px 6px; } }

/* ---------- Simulated devices have a fixed size; what does not fit scrolls inside the screen ---------- */
.stage { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
.stage::-webkit-scrollbar { width: 6px; }
.stage::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 6px; }
/* Echo Show: a landscape 16:10 display (10.1 inch, 1280 x 800). */
.frame[data-device="show"] { align-self: start; }
.frame[data-device="show"] .screen { flex: none; width: 100%; aspect-ratio: 16 / 10; min-height: 0; max-height: calc(100vh - 150px); }
/* Phone: 9:19.5, about 390 x 844, never taller than the window. */
.frame[data-device="mobile"] { align-self: start; align-items: center; width: auto; max-width: none; justify-self: center; }
.frame[data-device="mobile"] .screen { flex: none; height: min(844px, calc(100vh - 150px)); aspect-ratio: 9 / 19.5; width: auto; min-height: 0; }
/* On a real phone the page is the device: the screen takes the width and grows with its content, as before. */
@media (max-width: 560px) {
  .frame[data-device="show"] .screen, .frame[data-device="mobile"] .screen { aspect-ratio: auto; height: auto; max-height: none; min-height: 560px; width: 100%; }
  .frame[data-device="mobile"] { width: 100%; align-items: stretch; }
  .stage { overflow-y: visible; }
}

/* A long amount ("JPY 172,946") scales to the card instead of running out of it. */
.card.k-budget { container-type: inline-size; }
.money .m-to { font-size: clamp(24px, 11cqw, 48px); white-space: nowrap; }


/* ---------- The phone layout follows the width of the screen, so the simulated phone gets it on a desktop too ---------- */
.screen { container-type: inline-size; container-name: screen; }
@container screen (max-width: 560px) {
  .cards > .k-rules { grid-column: auto; }
  .stage { padding: var(--s-8) var(--s-16) var(--s-24); gap: var(--s-16); }
  .topbar { padding: 0 var(--s-16); gap: var(--s-6); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .topbar .brand-s { display: none; }
  .home { margin-top: var(--s-16); }
  .home-time { font-size: 76px; }
  .home-time .ampm { font-size: 20px; margin-left: var(--s-8); }
  .home-date { font-size: 17px; }
  .home::after { width: 200px; height: 200px; top: -50px; right: -40px; }
  /* Phones: the globe sits on top like a cover image, the text runs full width under it. */
  .hero { grid-template-columns: minmax(0, 1fr); padding: var(--s-20); border-radius: var(--r-24); row-gap: var(--s-16); }
  .h-dest { font-size: 40px; }
  .h-count b { font-size: 24px; }
  .h-stats { gap: var(--s-16); margin-top: var(--s-12); }
  .h-stats .ring { width: 72px; height: 72px; }
  .h-stats .r-v b { font-size: 17px; }
  .h-globe { grid-row: 1; justify-self: center; width: 232px; margin: -8px 0 -12px; }
  .h-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .act { padding: 0 var(--s-8); }
  .act.primary { grid-column: 1 / -1; }
  .headline { font-size: 18px; }
  .stage:not(.active) .headline { font-size: 26px; }
  .card { padding: var(--s-16) var(--s-20); }
  .h-actions .act { min-width: 0; justify-content: center; text-align: center; }
  .h-dest { overflow-wrap: anywhere; }
}

/* A link under each stop of the day plan: the place's hours and map. */
.slots .s-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.slots .s-map { display: inline-block; font-size: 12px; font-weight: 500; color: #9fd3ff; text-decoration: none; border-bottom: 1px solid rgba(159, 211, 255, .35); }
.slots .s-map:hover { color: #fff; border-bottom-color: #fff; }
.cards > .plan-note { grid-column: 1 / -1; margin: 0; }

.slots .s-h { margin-top: 3px; font-size: 12px; color: var(--d-ink-2); line-height: 1.4; }
.slots .s-hours .s-src { opacity: .6; }
.slots .s-flag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.slots .s-flag.bad { background: rgba(255, 105, 97, .16); color: #ff9a94; }
.slots .s-flag.warn { background: rgba(255, 214, 10, .14); color: #ffd60a; }

.bchip.linked { text-decoration: none; cursor: pointer; }
.bchip.linked:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); }
.brands.app-links { gap: 4px 14px; margin-top: 0; }
.brands.app-links .s-map { margin-top: 0; }

/* ---------- Places near the traveler: a tile each, with a credited photo ---------- */
.hls { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-12); }
.hl { display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-16); background: var(--d-inner); overflow: hidden; }
.hl .ph { position: relative; aspect-ratio: 16 / 10; background: rgba(255, 255, 255, .04); }
.hl .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hl .ph-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s-6) var(--s-12); font-size: 11px; color: rgba(255, 255, 255, .85); text-decoration: none; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-b { padding: var(--s-12) var(--s-16) var(--s-16); display: grid; gap: var(--s-4); align-content: start; }
.hl .s-d { font-size: var(--t-footnote); color: var(--d-ink-2); line-height: 1.45; }
.hl .s-local { font-size: var(--t-caption); color: var(--d-ink-2); }
.hl .ph-km { display: inline-block; margin-right: var(--s-8); padding: 1px var(--s-8); border-radius: 999px; background: rgba(41, 151, 255, .18); color: #9fd0ff; letter-spacing: .02em; text-transform: none; }
.cards > .k-places { grid-column: 1 / -1; }

/* ---------- The country guide: facts, each with its source; the quote opens under it ---------- */
.g-alert { margin: 0 0 var(--s-12); padding: var(--s-12) var(--s-16); border-radius: var(--r-16); background: rgba(255, 105, 97, .14); color: #ffb3ad; font-size: var(--t-footnote); font-weight: 600; }
.g-facts, .g-over { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-8); }
.g-facts { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.g-fact { padding: var(--s-12) var(--s-16); border-radius: var(--r-16); background: var(--d-inner); display: grid; gap: var(--s-4); align-content: start; }
.g-phrase b { font-size: var(--t-body); }
.g-phrase span { color: var(--d-ink-2); font-size: var(--t-footnote); }
.g-text { font-size: var(--t-footnote); line-height: 1.5; }
.g-q summary { cursor: pointer; font-size: var(--t-caption); color: var(--d-ink-2); letter-spacing: .04em; }
.g-q q { display: block; margin-top: var(--s-4); font-size: var(--t-caption); color: var(--d-ink-2); line-height: 1.45; quotes: none; font-style: italic; }
.g-over li { display: flex; justify-content: space-between; gap: var(--s-12); padding: var(--s-8) var(--s-16); border-radius: var(--r-16); background: var(--d-inner); font-size: var(--t-footnote); }
.cards > .k-guide { grid-column: 1 / -1; }

.s-travel { margin-top: var(--s-2); font-size: var(--t-caption); color: var(--d-ink-2); }
.s-travel::before { content: "↳ "; }
