
    :root { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f7f1e6; background: #171a16; }
    * { box-sizing: border-box; }
    html, body { margin: 0; min-height: 100%; }
    body { overflow: hidden; }
    button, input { font: inherit; }
    button { -webkit-tap-highlight-color: transparent; }
    .bar { position: relative; isolation: isolate; width: 100%; height: 100vh; height: 100dvh; min-height: 470px; overflow: hidden; background: #191916; }
    .scene, .veil { position: absolute; inset: 0; pointer-events: none; }
    .scene { background: url("states/01_idle.png") center center / cover no-repeat; }
    .veil { background: linear-gradient(180deg, rgba(12,17,15,.44) 0%, transparent 21%, transparent 48%, rgba(13,16,14,.25) 69%, rgba(12,14,12,.82) 100%); }
    .place { position: absolute; top: max(24px, env(safe-area-inset-top)); left: clamp(22px, 4vw, 66px); z-index: 2; display: flex; align-items: center; gap: 12px; color: rgba(255,247,230,.91); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 650; text-shadow: 0 1px 10px #000a; }
    .place::before { content: ""; width: 19px; height: 1px; background: #e8ba76; }
    .conversation { position: absolute; z-index: 2; left: 50%; bottom: calc(114px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(660px, calc(100% - 40px)); max-height: min(35vh, 310px); overflow: auto; scrollbar-width: thin; scrollbar-color: #c2a47766 transparent; display: flex; flex-direction: column; gap: 9px; padding: 4px 2px; mask-image: linear-gradient(transparent, #000 20%, #000); }
    .line { max-width: 85%; padding: 12px 16px; border: 1px solid rgba(248,231,197,.2); border-radius: 16px 16px 16px 5px; background: rgba(21,28,25,.79); box-shadow: 0 8px 28px #0003; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff8ec; font-size: 15px; line-height: 1.5; animation: appear .32s ease both; }
    .line.guest { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: rgba(238,226,201,.92); border-color: transparent; color: #27312b; }
    .line .speaker { display: block; margin-bottom: 3px; color: #d5b77f; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
    @keyframes appear { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
    .composer { position: absolute; z-index: 3; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; width: min(660px, calc(100% - 40px)); min-height: 66px; padding: 8px 9px 8px 21px; border: 1px solid rgba(255,240,208,.42); border-radius: 20px; background: rgba(247,241,227,.96); box-shadow: 0 18px 50px #0007; }
    .composer:focus-within { outline: 2px solid #dbad70; outline-offset: 2px; }
    .composer input { min-width: 0; flex: 1; height: 45px; border: 0; outline: none; background: transparent; color: #223029; font-size: 16px; }
    .composer input::placeholder { color: #65716a; opacity: 1; }
    .icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 0; border-radius: 13px; background: transparent; color: #607168; }
    .icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mic { cursor: default; opacity: .6; }
    .send { background: #263d34; color: #fff8e9; cursor: pointer; transition: background .2s, transform .2s; }
    .send:hover { background: #3e5a49; }
    .send:active { transform: scale(.95); }
    .send:disabled { opacity: .55; cursor: wait; }
    .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; }
    @media (max-width: 700px) {
      .bar { min-height: 0; }
      .scene { background-position: center 38%; }
      .veil { background: linear-gradient(180deg, #111a15a6, transparent 20%, transparent 47%, #11171245 68%, #111512e8 100%); }
      .place { top: calc(16px + env(safe-area-inset-top)); left: 18px; font-size: 10px; letter-spacing: .15em; }
      .conversation { bottom: calc(100px + env(safe-area-inset-bottom)); width: calc(100% - 28px); max-height: min(32vh, 260px); }
      .line { font-size: 14px; padding: 10px 13px; max-width: 90%; }
      .composer { bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 24px); min-height: 62px; padding-left: 16px; border-radius: 18px; }
      .icon { width: 43px; height: 43px; }
    }
    @media (max-height: 610px) { .conversation { max-height: 24vh; bottom: calc(89px + env(safe-area-inset-bottom)); } .composer { bottom: calc(10px + env(safe-area-inset-bottom)); min-height: 58px; } }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
  
.scene-layer { will-change:opacity; position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; opacity:0; transition:opacity 550ms ease; }
.scene-layer.visible { opacity:1; }
.status { position:absolute; z-index:3; bottom:calc(94px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:min(660px,calc(100% - 40px)); font-size:12px; color:#fff8ec; text-shadow:0 1px 4px #000; }
.session-reset { position:absolute; z-index:3; right:20px; top:22px; border:0; color:#fff8ec; background:#17221b99; padding:8px; border-radius:8px; cursor:pointer; }
@media(max-width:700px) { .scene-layer { object-position:center 38%; } .status { bottom:calc(80px + env(safe-area-inset-bottom)); } .session-reset { top:42px; right:15px; font-size:11px; } }
@media(prefers-reduced-motion:reduce) { .scene-layer { transition:none; } }
/* Local testing controls. Added to the DOM only on loopback hosts. */
.bar { min-height:0; }
.place { flex-wrap:wrap; max-width:65%; gap:8px; }
.place span { flex-basis:100%; font-size:9px; letter-spacing:.12em; opacity:.75; margin-left:27px; }
.line { flex-shrink:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.conversation { mask-image:none; max-height:min(36dvh,310px); }
.status { bottom:calc(96px + env(safe-area-inset-bottom)); font-size:11px; pointer-events:none; }
.demo-tools { position:absolute; z-index:5; right:20px; top:65px; width:260px; max-height:calc(100% - 150px); overflow:auto; border-radius:10px; color:#fff8ec; font-size:12px; }
.demo-tools:not([open]) { width:auto; }
.demo-tools summary { text-align:right; cursor:pointer; padding:8px 10px; background:#17221bc9; border-radius:8px; }
.demo-tools[open] { background:#17221bf5; border:1px solid #d5b77f55; padding:8px; box-shadow:0 8px 24px #0006; }
.demo-tools p { line-height:1.5; margin:8px; }
.demo-tools label, .demo-tools output { display:block; margin:8px; }
.demo-tools select, .demo-tools button { font:inherit; color:#fff8ec; background:#30463b; border:1px solid #a18b6666; padding:9px; border-radius:6px; width:calc(100% - 16px); margin:4px 8px; }
@media(max-width:700px) { .place {max-width:68%;font-size:10px;} .session-reset {top:14px;right:12px;max-width:100px;} .demo-tools {top:49px;right:12px;} .status {bottom:calc(78px + env(safe-area-inset-bottom));} .conversation {max-height:32dvh;bottom:calc(108px + env(safe-area-inset-bottom));} }
@media(max-height:500px) { .conversation { max-height:35%;bottom:103px; } .place span {display:none;} .status {bottom:77px;} }

/* Explicit local preview control can demonstrate fades when OS motion is reduced. */
.scene[data-preview-motion="true"] .scene-layer { transition:opacity 550ms ease !important; }

.line.notice { font-size:13px; background:rgba(26,30,27,.9); border-style:dashed; color:#e6dccb; }

/* Public UX: keep the original bar scene and give the chat a clear entry point. */
.mode-badge { position:absolute; z-index:3; top:78px; left:clamp(22px,4vw,66px); max-width:calc(100% - 44px); padding:8px 11px; border:1px solid #d5b77f66; border-radius:8px; background:#17221bd9; color:#f2d9ae; font-size:11px; line-height:1.4; }
.suggestions { position:absolute; z-index:3; left:50%; bottom:calc(108px + env(safe-area-inset-bottom)); transform:translateX(-50%); display:flex; flex-wrap:wrap; gap:8px; width:min(660px,calc(100% - 40px)); }
.suggestions[hidden] { display:none; }
.suggestions button { background:#192c24e8; color:#fff8ec; border:1px solid #d5b77f80; border-radius:22px; padding:11px 15px; min-height:44px; cursor:pointer; font-size:13px; }
.bar:has(.suggestions:not([hidden])) .conversation { bottom:calc(172px + env(safe-area-inset-bottom)); }
button:focus-visible, select:focus-visible, summary:focus-visible { outline:2px solid #e8ba76; outline-offset:3px; }
.demo-tools summary { min-height:44px; display:flex; align-items:center; justify-content:flex-end; }
.session-reset { min-height:44px; }
.line { animation:none; }
.scene[data-state="listening"] { --scene-shift:1; }
@media(max-width:700px) {
  .mode-badge { top:84px; left:14px; font-size:10px; }
  .demo-tools { top:123px; right:12px; max-height:calc(100% - 230px); }
  .place { max-width:calc(100% - 126px); line-height:1.4; }
  .place span { margin-left:0; }
  .suggestions { bottom:calc(104px + env(safe-area-inset-bottom)); width:calc(100% - 28px); gap:6px; }
  .suggestions button { font-size:12px; padding:9px 12px; }
  .bar:has(.suggestions:not([hidden])) .conversation { bottom:calc(214px + env(safe-area-inset-bottom)); max-height:23%; }
}
@media(max-height:550px) {
  .mode-badge { top:64px; font-size:9px; padding:4px 7px; }
  .demo-tools { top:99px; max-height:calc(100% - 180px); }
  .suggestions { display:none; }
  .bar:has(.suggestions:not([hidden])) .conversation { bottom:108px; max-height:30%; }
}
