/* Nova — the whole app lives inside her jukebox. The viewport is the
   cabinet: a great arched top in cherry-red lacquer and chrome, neon
   sleeping in the trim channels, a speaker grille across the base, and
   the app glowing warm inside it like the lit interior of a 1950s
   jukebox she polished herself. Coca-Cola-adjacent cherry red and
   shine throughout (colour and gloss only — no logos, no marks).
   Everything is rounded; the glass is rolled glass — curved highlights,
   thick lit edges, soft internal reflections. A slow shine wipes the
   whole cabinet about every 45 seconds, like light crossing a diner
   window. Every view fades in slowly. All motion is transform/opacity/
   background-position, and all of it stops under .rm (reduced motion,
   from the OS setting or the Settings toggle).

   Milestone 5: the cabinet is built from PHOTOGRAPHS, not gradients —
   real lacquer with a diner reflected in it, real chrome, a real lit
   opalescent panel, real neon, a real grille (public/materials/,
   built by scripts/build-materials.py from the plates in assets-src/).
   CSS still does the joinery: the arch silhouette, the edge thickness,
   the shadows, and the light that moves. */

:root {
  --ink: #33231c;
  --ink-soft: #7a5f4e;
  --cream-1: #fffaf0;
  --cream-2: #f7ecd4;
  --cream-3: #ecd9b4;
  --silver-line: #d8c6a8;
  --red-hi: #ff7a56;
  --red: #d8232f;
  --red-deep: #9c0f1e;
  --red-ink: #7c0d1a;
  --lacquer: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, #f0563f 0%, var(--red) 52%, var(--red-deep) 100%);
  /* The photographic lacquer: the gloss gradient rides on top of the
     real cherry plate so small surfaces keep their pressed depth. */
  --lacquer-photo: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, rgba(240, 86, 63, 0.25), rgba(156, 15, 30, 0.30)),
    url("/materials/lacquer.webp");
  --card: linear-gradient(165deg, #fffdf6 0%, #f8efdb 55%, #eedcba 100%);
  --glass-gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 42%);
  /* The photographic chrome: real metal, diner lights and a breath of
     red neon reflected in it — the bezel, the rail, the badge. */
  --bezel: url("/materials/chrome.webp");
  --shadow: 0 18px 40px rgba(56, 42, 30, 0.20), 0 2px 8px rgba(56, 42, 30, 0.13);
  --radius: 26px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: #17100d; }
body {
  font-family: var(--sans);
  color: var(--ink);
  min-height: 100vh;
  /* The room around the cabinet: a diner at dusk, dark enough that her
     chrome and neon have something to glow against. */
  background:
    radial-gradient(1000px 620px at 12% -8%, rgba(255, 176, 110, 0.20), transparent 60%),
    radial-gradient(820px 640px at 108% 6%, rgba(216, 35, 47, 0.16), transparent 55%),
    radial-gradient(760px 560px at 50% 112%, rgba(84, 168, 158, 0.12), transparent 60%),
    linear-gradient(168deg, #2a1c15 0%, #1c130e 52%, #120c09 100%);
  background-attachment: fixed;
}
/* A whisper of brushed grain and a vignette over the whole room. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(93deg, rgba(255, 220, 180, 0.016) 0 2px, transparent 2px 5px),
    radial-gradient(120% 90% at 50% 42%, transparent 58%, rgba(0, 0, 0, 0.34) 100%);
}
#app { max-width: 560px; margin: 0 auto; padding: 36px 22px 72px; position: relative; z-index: 1; }

/* The cabinet back: a band of real cherry lacquer around a lit
   interior — the opalescent panel plate glowing across the top of the
   room inside, the real perforated grille across the base. A dark
   red-brown spread around the silhouette is the cabinet's side wall:
   the arch has thickness, and it stands in the room on a cast shadow.
   It sits behind the app (z-index -1 inside #app's stacking context)
   and never moves; the app lives in front of its glow. */
#app::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  left: 50%; top: 6px; bottom: 6px; width: min(100vw, 608px);
  transform: translateX(-50%);
  border-radius: 304px 304px 30px 30px;
  border: 5px solid transparent;
  padding: 19px;
  background-image:
    url("/materials/litpanel.webp"),
    url("/materials/grille.webp"),
    linear-gradient(168deg, #fffaf0 0%, #f6ead0 52%, #ecd9b4 100%),
    url("/materials/lacquer.webp"),
    url("/materials/chrome.webp");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 100% 340px, 100% 64px, 100% 100%, 100% 100%, 100% 100%;
  background-position: top center, bottom center, center, center, center;
  background-clip: content-box, content-box, content-box, padding-box, border-box;
  box-shadow:
    0 0 0 7px #3d0a12,
    0 0 0 9px rgba(255, 190, 150, 0.14),
    0 44px 80px rgba(0, 0, 0, 0.62),
    0 10px 26px rgba(0, 0, 0, 0.5);
}

/* The cabinet front: chrome trim rings and the neon sleeping in its
   channel, drawn as inset shadows so they follow the arch exactly —
   and the great shine: a soft band of light that wipes the whole app
   roughly every 45 seconds (about 7 seconds of travel, then rest),
   passing over glass and chrome like light across a diner window.
   Pointer-events none; it never touches reading or tapping. */
#app::after {
  content: ""; position: fixed; z-index: 60; pointer-events: none;
  left: 50%; top: 6px; bottom: 6px; width: min(100vw, 608px);
  transform: translateX(-50%);
  border-radius: 304px 304px 30px 30px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 240, 0.85),
    inset 0 0 0 5px rgba(38, 30, 28, 0.90),
    inset 0 0 0 8px rgba(216, 35, 47, 0.75),
    inset 0 0 0 11px rgba(244, 246, 247, 0.90),
    inset 0 0 22px rgba(224, 84, 54, 0.26),
    inset 0 -18px 30px rgba(84, 168, 158, 0.12),
    inset 0 26px 44px rgba(255, 190, 120, 0.13);
  background-image: linear-gradient(112deg,
    transparent 40%, rgba(255, 248, 235, 0.12) 48%,
    rgba(255, 255, 255, 0.19) 50%,
    rgba(255, 248, 235, 0.12) 52%, transparent 60%);
  background-size: 280% 100%;
  background-repeat: no-repeat;
  background-position: 130% 0;
  animation: app-shine 45s ease-in-out infinite;
}
@keyframes app-shine {
  0% { background-position: 130% 0; }
  16% { background-position: -130% 0; }
  100% { background-position: -130% 0; }
}

/* Views fade in slowly; nothing pops. */
.view { opacity: 0; transform: translateY(6px); transition: opacity 0.6s ease, transform 0.6s ease; }
.view.in { opacity: 1; transform: none; }
body.rm .view { transition: none; }

h1 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; }
.tagline { color: var(--ink-soft); line-height: 1.5; }
.error { color: #a02c1d; }
.fineprint, .hint { color: var(--ink-soft); font-size: 0.82rem; }
/* The local-preview notice in the chat view: small, warm, honest — the
   lit panel's own card stock, so it belongs to the room. */
.notice {
  margin: 0 0 10px; padding: 9px 13px; border-radius: 16px;
  background: var(--glass-gloss), url("/materials/litpanel.webp"), var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 10px rgba(64, 48, 36, 0.12);
  color: var(--ink-soft); font-size: 0.85rem; line-height: 1.45;
}

/* The emblem: a brass disc in a chrome ring with a cherry channel —
   the jukebox's badge. */
.emblem {
  width: 84px; height: 84px; margin: 26px auto 10px; border-radius: 50%;
  background: var(--bezel); background-size: cover; background-position: center;
  display: grid; place-items: center;
  box-shadow: var(--shadow), inset 0 2px 6px rgba(255, 255, 255, 0.65), inset 0 -8px 14px rgba(122, 34, 18, 0.35), inset 0 0 0 3px rgba(216, 35, 47, 0.45);
}
.emblem span {
  width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff8ec, #f2dfba 55%, #d9a75e);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 2rem; color: var(--red-ink);
  box-shadow: inset 0 -4px 8px rgba(170, 70, 40, 0.25);
}
.emblem.small { width: 60px; height: 60px; margin-top: 6px; }
.emblem.small span { width: 46px; height: 46px; font-size: 1.4rem; }

/* Buttons: lacquered cherry for the primary, rolled glass-cream for
   the rest — a lit top edge, a glossy face, a pressed depth. */
.btn {
  font: 600 0.98rem var(--sans);
  border: 1px solid rgba(140, 70, 40, 0.35);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  color: var(--ink);
  background: var(--glass-gloss), var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -3px 7px rgba(64, 48, 36, 0.10), 0 4px 12px rgba(64, 48, 36, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  text-decoration: none; display: inline-block; text-align: center;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 2px 6px rgba(64, 48, 36, 0.18), 0 2px 6px rgba(64, 48, 36, 0.12); }
.btn.primary {
  background: var(--lacquer-photo); background-size: cover; background-position: center 22%;
  color: #fff8f2;
  border-color: rgba(124, 13, 26, 0.5);
  text-shadow: 0 1px 2px rgba(96, 30, 14, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 235, 215, 0.8), inset 0 -6px 12px rgba(128, 36, 18, 0.28), 0 8px 18px rgba(216, 35, 47, 0.32), 0 0 16px rgba(216, 35, 47, 0.18);
}
.btn.ghost { background: transparent; box-shadow: none; }
.btn.wide { width: 100%; }

/* Sign-in */
.signin { text-align: center; padding-top: 5vh; }
.signin h1 { font-size: 2.4rem; margin: 8px 0 4px; }
.dev-form { margin-top: 22px; text-align: left; display: grid; gap: 12px; }
.dev-form label, .settings label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
input, textarea {
  font: 400 1rem var(--sans); color: var(--ink);
  padding: 12px 14px; border-radius: 18px;
  border: 1px solid var(--silver-line);
  background: var(--glass-gloss), linear-gradient(180deg, #fffdf6, #f7efdb);
  box-shadow: inset 0 2px 5px rgba(64, 48, 36, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.9);
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; }

/* Choose at open: identities, not looks. The one face sits above the
   list as a small round mark; the twelve are name, brief, and voice. */
.choose h1 { text-align: center; margin: 10px 0 6px; }
.choose .tagline { text-align: center; max-width: 46ch; margin: 0 auto 20px; }
.choose-face {
  width: 92px; height: 92px; margin: 14px auto 4px; border-radius: 50%;
  padding: 3px; background: var(--bezel); background-size: cover; background-position: center;
  box-shadow: var(--shadow), inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 0 18px rgba(216, 35, 47, 0.22);
}
.choose-face img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 22%;
  display: block; box-shadow: inset 0 0 0 1px rgba(56, 24, 12, 0.35);
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  text-align: left; cursor: pointer; padding: 14px 14px 15px; overflow: hidden;
  border-radius: var(--radius); border: 1px solid rgba(146, 96, 66, 0.28);
  background: var(--glass-gloss), url("/materials/litpanel.webp"), var(--card);
  background-size: auto, cover, auto; background-position: 0 0, 50% 60%, 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -8px 14px rgba(64, 48, 36, 0.06), 0 10px 22px rgba(64, 48, 36, 0.13);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-family: var(--sans); color: var(--ink);
  display: flex; flex-direction: column; gap: 5px;
}
.card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, inset 0 -8px 14px rgba(64, 48, 36, 0.06), 0 16px 30px rgba(64, 48, 36, 0.2); }
.card.picked { outline: 3px solid var(--red); }
.card-name { font-family: var(--serif); font-size: 1.12rem; }
.card-tag { font-weight: 600; font-size: 0.86rem; color: var(--red-ink); }
.card-focus { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; }
.card-intro { font-size: 0.84rem; font-style: italic; color: var(--ink-soft); line-height: 1.45; border-top: 1px solid rgba(146, 96, 66, 0.18); padding-top: 7px; margin-top: 3px; }

/* The stage: the jukebox's lit interior — the opalescent panel
   photograph itself, glowing behind her window, with a thin ring of
   real neon sleeping in a channel around the arch (the ::before's
   border ring: the panel plate repaints the interior, the neon plate
   shows only in the channel between them). */
.shell { padding-top: 4px; }
.stage {
  position: relative; text-align: center;
  padding: 26px 14px 14px; margin-bottom: 14px;
  border-radius: 150px 150px 36px 36px;
  background: linear-gradient(172deg, #fbf5e8 0%, #f0e4cb 52%, #e0d0ab 100%);
  border: 1px solid rgba(146, 96, 66, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -14px 26px rgba(64, 48, 36, 0.10),
    inset 0 0 60px rgba(255, 205, 160, 0.18),
    0 14px 30px rgba(64, 48, 36, 0.13);
  overflow: hidden;
}
.stage::before {
  content: ""; position: absolute; inset: 5px; pointer-events: none; z-index: 0;
  border: 4px solid transparent; border-radius: 146px 146px 32px 32px;
  background-image: url("/materials/litpanel.webp"), url("/materials/neon.webp");
  background-size: cover, cover;
  background-position: 50% 30%, 50% 42%;
  background-repeat: no-repeat, no-repeat;
  background-clip: padding-box, border-box;
  box-shadow:
    inset 0 18px 34px rgba(255, 240, 214, 0.25),
    inset 0 -20px 34px rgba(120, 60, 30, 0.14);
}
.stage-floor {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 0;
  width: 250px; height: 34px; border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(216, 35, 47, 0.32), transparent 70%);
  filter: blur(7px); pointer-events: none;
}
.stage-meta { position: relative; z-index: 1; margin-top: 12px; }
.stage-meta .who { margin: 0; font-size: 1.55rem; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.stage-meta .role { margin: 4px auto 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; max-width: 42ch; }

/* The face window: a layered bezel — outer conic ring, a recessed
   channel, then the glass — with the loop playing under a moving sheen. */
.face-frame {
  position: relative; z-index: 1; margin: 0 auto;
  padding: 10px; border-radius: 999px 999px 38px 38px;
  background: var(--bezel); background-size: cover; background-position: 50% 30%;
  box-shadow:
    0 24px 44px rgba(84, 40, 28, 0.30),
    0 4px 12px rgba(84, 40, 28, 0.22),
    0 0 26px rgba(224, 84, 54, 0.26),
    0 0 58px rgba(84, 168, 158, 0.18),
    inset 0 2px 3px rgba(255, 246, 230, 0.85),
    inset 0 -3px 6px rgba(90, 34, 18, 0.45),
    inset 0 0 0 2px rgba(216, 35, 47, 0.30);
}
.face-frame::before {
  /* The recessed channel between bezel and glass. */
  content: ""; position: absolute; inset: 4px; border-radius: 999px 999px 34px 34px;
  box-shadow: inset 0 2px 7px rgba(64, 28, 14, 0.55), inset 0 -1px 2px rgba(255, 240, 220, 0.5);
  pointer-events: none; z-index: 3;
}
.face-frame::after {
  /* A slow light sweep across the metal itself. */
  content: ""; position: absolute; inset: 0; border-radius: 999px 999px 38px 38px; overflow: hidden;
  background: linear-gradient(115deg, transparent 44%, rgba(255, 244, 228, 0.35) 50%, transparent 56%);
  transform: translateX(-70%); animation: bezel-sheen 13s ease-in-out infinite;
  pointer-events: none; z-index: 4;
}
@keyframes bezel-sheen {
  0%, 58% { transform: translateX(-70%); }
  88%, 100% { transform: translateX(70%); }
}
.face-frame.hero { width: min(302px, 76vw); aspect-ratio: 4 / 5; }
.face-glass {
  position: relative; width: 100%; height: 100%;
  border-radius: 999px 999px 29px 29px; overflow: hidden;
  background: #201914;
  box-shadow: inset 0 0 0 1px rgba(56, 24, 12, 0.5), inset 0 -22px 34px rgba(0, 0, 0, 0.35), inset 0 12px 22px rgba(0, 0, 0, 0.18);
}
/* Rolled glass: a curved highlight domed across the top, lit side
   edges like thick vintage glass, a warm reflection pooled at the
   bottom — and the diner itself faintly reflected in the pane: the
   neon photograph screened over the glass at a whisper, so only its
   light registers, drifting across her garage like the room behind
   you is lit by tubes. The window she wiped down herself. */
.face-glass::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    radial-gradient(95% 42% at 50% -6%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.06) 55%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 26%),
    url("/materials/neon-glass.webp");
  background-size: auto, auto, cover;
  background-position: 0 0, 0 0, 50% 18%;
  background-repeat: no-repeat;
  background-blend-mode: normal, normal, screen;
  opacity: 0.42;
}
.face-glass::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(85% 38% at 50% 110%, rgba(255, 196, 150, 0.22), transparent 62%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 246, 232, 0.30),
    inset 0 -26px 34px rgba(30, 10, 5, 0.28),
    inset 18px 0 26px -12px rgba(255, 255, 255, 0.14),
    inset -18px 0 26px -12px rgba(255, 255, 255, 0.14);
}
.face-img, .face-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  display: block;
}
/* The opening film and its handoff: the film fades out over the still
   while the loop fades in under the same glass — slow crossfades,
   never a cut. The Skip chip sits quiet at the window's lower left;
   tapping it (or the window) ends the film early. */
.opening-video { transition: opacity 0.8s ease; }
.opening-video.done { opacity: 0; }
.face-video.fade-in { opacity: 0; transition: opacity 0.8s ease; }
.face-video.fade-in.go { opacity: 1; }
.opening-skip {
  position: absolute; left: 14px; bottom: 12px; z-index: 6;
  font: 600 0.68rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  color: #ffeeda; background: rgba(24, 12, 8, 0.55);
  border: 1px solid rgba(255, 238, 220, 0.35); border-radius: 999px;
  padding: 6px 11px; cursor: pointer;
}
/* The light shift: a slow sheen crossing the glass, like light moving in the room. */
.face-sheen {
  position: absolute; inset: -20%; z-index: 2;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 240, 225, 0.16) 50%, transparent 58%);
  transform: translateX(-65%);
  animation: sheen 11s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%, 55% { transform: translateX(-65%); }
  85%, 100% { transform: translateX(65%); }
}
.face-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(120% 90% at 50% 38%, transparent 55%, rgba(20, 8, 4, 0.38) 100%);
}
.face-live {
  position: absolute; right: 16px; bottom: 14px; z-index: 5;
  display: flex; align-items: center; gap: 5px;
  font: 600 0.66rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffeeda; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.face-live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff9d5c; box-shadow: 0 0 9px rgba(255, 157, 92, 0.85);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Tabs: a real chrome selector rail, seated in the page — polished
   metal with the diner reflected in it; the active stop is a
   lacquered cherry pill, like the jukebox's selector buttons. */
.tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.02) 55%, rgba(40, 26, 20, 0.10)),
    url("/materials/chrome.webp");
  background-size: cover; background-position: 50% 42%;
  border: 1px solid rgba(40, 30, 25, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -2px 6px rgba(30, 20, 16, 0.28), 0 4px 10px rgba(64, 48, 36, 0.14);
  margin-bottom: 16px;
}
.tabs button {
  flex: 1; border: 0; background: rgba(255, 250, 240, 0.22); cursor: pointer;
  font: 600 0.92rem var(--sans); color: #43332a;
  text-shadow: 0 1px 0 rgba(255, 252, 245, 0.55);
  padding: 9px 4px; border-radius: 999px;
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.tabs button.on {
  background: var(--lacquer-photo); background-size: cover; background-position: center 22%; color: #fff8f2;
  text-shadow: 0 1px 2px rgba(96, 30, 14, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 238, 220, 0.75), inset 0 -4px 8px rgba(128, 36, 18, 0.25), 0 3px 8px rgba(124, 13, 26, 0.35);
}

/* Chat */
.thread { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 14px; }
.msg { display: flex; animation: rise 0.55s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 86%; padding: 11px 15px; border-radius: 22px; line-height: 1.55; font-size: 0.98rem;
  background: var(--glass-gloss), url("/materials/litpanel.webp"), var(--card);
  background-size: auto, cover, auto; background-position: 0 0, 50% 70%, 0 0;
  border: 1px solid rgba(146, 96, 66, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -6px 10px rgba(64, 48, 36, 0.06),
    0 6px 14px rgba(64, 48, 36, 0.12),
    0 1.5px 3px rgba(64, 48, 36, 0.10);
  border-bottom-left-radius: 8px;
}
.msg.user .bubble {
  background: var(--lacquer-photo); background-size: cover; background-position: center 22%;
  color: #fff8f2; border-color: rgba(124, 13, 26, 0.45);
  border-bottom-left-radius: 22px; border-bottom-right-radius: 8px;
  text-shadow: 0 1px 1px rgba(96, 30, 14, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 220, 0.75),
    inset 0 -6px 10px rgba(128, 36, 18, 0.22),
    0 6px 14px rgba(216, 35, 47, 0.24),
    0 1.5px 3px rgba(64, 48, 36, 0.12);
}
.bubble.typing span {
  display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%;
  background: var(--red); animation: pulse 1.1s ease-in-out infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
.composer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 10px; }
.composer textarea {
  flex: 1; resize: none; max-height: 120px; border-radius: 22px;
  box-shadow: inset 0 2px 5px rgba(64, 48, 36, 0.10), 0 6px 16px rgba(64, 48, 36, 0.13);
}
.composer .send { border-radius: 22px; padding: 12px 18px; }

/* Conversations */
#conv-search { margin-top: 12px; }
.conv-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.conv {
  display: flex; gap: 8px; align-items: stretch;
  border-radius: var(--radius); border: 1px solid rgba(146, 96, 66, 0.25);
  background: var(--glass-gloss), var(--card);
  box-shadow: inset 0 1px 0 #fff, inset 0 -6px 10px rgba(64, 48, 36, 0.05), 0 6px 14px rgba(64, 48, 36, 0.1);
  padding: 8px;
}
.conv.on { outline: 2px solid var(--red); }
.conv-open { flex: 1; text-align: left; background: none; border: 0; cursor: pointer; display: grid; gap: 3px; padding: 6px 8px; font-family: var(--sans); min-width: 0; }
.conv-title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { font-size: 0.8rem; color: var(--ink-soft); }
.conv-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.conv-ren {
  border: 1px solid rgba(146, 96, 66, 0.3); background: transparent;
  color: var(--red-ink); border-radius: 999px; padding: 7px 12px; cursor: pointer; font: 600 0.8rem var(--sans);
}
.conv-del {
  align-self: center; border: 1px solid rgba(150, 60, 40, 0.3); background: transparent;
  color: #a03d22; border-radius: 999px; padding: 7px 12px; cursor: pointer; font: 600 0.8rem var(--sans);
}
.conv-del.confirm { background: #a02c1d; color: #fff; }
.conv-rename-input { flex: 1; min-width: 0; }
.empty { color: var(--ink-soft); text-align: center; padding: 22px 0; }

/* Settings */
.settings { display: grid; gap: 16px; }
.settings label.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.settings label.check input { width: auto; }
.settings-actions { display: grid; gap: 10px; margin-top: 18px; }
.saved { color: var(--red-ink); font-weight: 600; margin: 0; }

/* Reduced motion: the face rests as a still, the great shine never
   wipes, views snap, nothing drifts. */
body.rm .face-sheen, body.rm .face-frame::after, body.rm .face-live .dot,
body.rm .bubble.typing span, body.rm .msg, body.rm #app::after { animation: none !important; }
body.rm .face-video { display: none; }
@media (prefers-reduced-motion: reduce) {
  .face-sheen, .face-frame::after, .face-live .dot, .msg, #app::after { animation: none !important; }
  .face-video { display: none; }
  .view { transition: none; }
}

@media (max-width: 420px) {
  .face-frame.hero { width: min(272px, 78vw); }
  .stage { border-radius: 110px 110px 32px 32px; }
  .stage-meta .who { font-size: 1.32rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
