:root {
  --ink: #171414;
  --paper: #fffaf7;
  --muted: #aaa1a0;
  --line: rgba(255, 255, 255, .16);
  --glass: rgba(20, 18, 18, .74);
  --glass-strong: rgba(20, 18, 18, .9);
  /* OPAQUE, and light enough to read as a surface. These were semi-transparent
     (alpha .76) and relied on a 3px white border to define their edge; removing the
     border on 2026-09-24 made the assistant's messages nearly invisible against the
     dark page. A bubble has to be its own surface, not a tint over the background. */
  --bubble: #574855;
  --bubble-user: #8d2a49;
  --accent: #e07461;
  --online: #53c98c;
  --error: #ff9b92;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background: #151313;
  color: var(--paper);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
button, textarea, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
[hidden] { display: none !important; }

/* --- inline SVG icon sizing ------------------------------------------------ */
svg.rail-icon, svg.tab-icon, svg.btn-svg, svg.moment-icon, svg.tag-icon, svg.ph-feature-icon, svg.brand-mark {
  width: 1em; height: 1em; display: block; fill: none; stroke: currentColor;
}
.rail-icon { width: 20px; height: 20px; }
#nav-collapse .rail-icon { width: 16px; height: 16px; }
.btn-svg { width: 18px; height: 18px; }
.moment-icon { width: 16px; height: 16px; }
.tag-icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }
.ph-feature-icon { width: 18px; height: 18px; margin-bottom: 2px; }
.brand-mark { width: 20px; height: 20px; color: var(--accent); }
.tab-icon { width: 19px; height: 19px; }
.ph-topnav-link .tab-icon { width: 17px; height: 17px; }

/* --- left icon rail (desktop chat screen only) --------------------------- */
/* The rail and top app-header belong to the chat screen only. They must not
   leak onto the landing/companion/auth pages, so they are scoped to
   body[data-route="chat"] at desktop widths (see the chat-only block below). */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 88px; z-index: 30;
  display: none; flex-direction: column; justify-content: space-between;
  padding: 18px 8px; background: #1c1519; border-right: 1px solid var(--line);
}
.rail-top, .rail-bottom { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rail-item {
  position: relative;
  width: 72px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.62); font-size: 11px;
}
.rail-item:hover { background: rgba(255,255,255,.06); color: var(--paper); }
.rail-item.active { background: rgba(224,116,97,.16); color: var(--accent); }
/* Brief 074: a named unread indicator. The count badge sits on the chat icon (mobile and
   desktop rail) and on a persona's home tile; the persona's NAME is in the aria-label and
   title, so the badge says WHO wrote, not just that something arrived. */
.unread-badge {
  position: absolute; top: 6px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; box-shadow: 0 0 0 2px rgba(39,27,35,.92);
}
.ph-tile .unread-badge { top: 8px; right: 8px; box-shadow: 0 0 0 2px rgba(0,0,0,.55); }
.rail-label { font-size: 11px; }
.rail.collapsed { width: 64px; }
.rail.collapsed .rail-label { display: none; }
/* Width must track the margin or the box overflows again by the difference. */
.rail.collapsed ~ .app-header, .rail.collapsed ~ .experience { margin-left: 64px; }
.rail.collapsed ~ .experience { width: calc(100% - 64px); }
.rail.collapsed ~ .app-header { left: 64px; }

@media (min-width: 761px) {
  body[data-route="chat"] .rail { display: flex; }
}

/* --- top header (desktop chat screen only) -------------------------------- */
.app-header {
  position: fixed; left: 88px; right: 0; top: 0; height: 64px; z-index: 25;
  display: none; align-items: center; justify-content: space-between;
  padding: 0 32px; background: #1c1519; border-bottom: 1px solid var(--line);
}
@media (min-width: 761px) {
  body[data-route="chat"] .app-header { display: flex; }
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 20px; }
.brand-name { font-size: 17px; font-weight: 700; }
.brand-tagline { color: var(--muted); font-size: 13px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-quote { padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px; color: rgba(255,255,255,.72); font-size: 12px; font-style: italic; }
#btn-account { border-radius: 50%; }

/* Sized against the space the rail (88px) and header (64px) leave, not against the
   whole viewport: `width:100%` plus those margins plus 48px padding overflowed the
   screen by 184px across and 160px down (2026-09-22). box-sizing keeps the padding
   inside the box; the chat column scrolls internally via .messages. */
/* 52/48, not 66/34. The scene was 66% of the width and, with the .scene margin below
   also removed, rendered 865x685 -- landscape, aspect 1.26 -- while the target layout is
   810x852, near square at 0.95. `background-size: cover` then cropped the top and bottom
   off a portrait subject to fill a letterbox.
   The chat column is capped at 620px rather than a share of the width: as a fraction it
   reached 720px on a 1672px viewport and kept growing on wider screens, and a message
   column past ~620px is simply harder to read. Extra width goes to the scene. */
.experience { position: relative; box-sizing: border-box; width: calc(100% - 88px); height: calc(100% - 64px); display: grid; grid-template-columns: minmax(0, 52fr) minmax(380px, 620px); justify-items: stretch; gap: 28px; padding: 28px; margin-left: 88px; margin-top: 64px; background: #271b23; overflow: hidden; }
.scene {
  position: relative;
  min-width: 0;
  min-height: 0;
  /* No inner margin: .experience already pads by 28px, and a further 48px here removed
     96px from each dimension, which is what flattened the panel.
     The ASPECT is pinned rather than left to the column widths. Capping the chat column
     meant every extra pixel of a wide screen went to the scene, so its shape drifted from
     0.85 at 1440px to 1.34 at 2560px -- it matched the target at exactly one resolution.
     3/4 holds the portrait framing at any width; the panel centres in its cell and the
     leftover space belongs to the page, not to the crop. */
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  max-height: 100%;
  max-width: 100%;
  overflow: hidden;
  /* Borderless. The 10px white frame and the hard 0 8px 0 offset shadow below read as a
     sticker pasted on the page; the target layout has the image sitting flush in a soft
     rounded panel with depth coming from blur, not from an outline. */
  border: 0;
  border-radius: 20px;
  background-color: #201c1c;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .46);
}
.scene-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.06), transparent 58%, rgba(0,0,0,.25)); }
.scene-motion-frame { position: absolute; inset: 0; display: block; overflow: hidden; }
.scene-motion-frame img, .scene-motion-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-motion-frame video { opacity: 0; pointer-events: none; }
.scene-motion-frame.is-playing video { opacity: 1; }
.scene-shade { z-index: 1; }
/* Speaking video: exactly the still's box and fit (cover on desktop, contain on phones, below). */
.scene .speech-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 1; background: #0f0b0d; z-index: 5; pointer-events: none; }
.scene-caption { position: absolute; z-index: 6;  /* above .speech-video (5): the status caption must stay visible while a clip plays */ left: 28px; bottom: 24px; display: flex; flex-direction: column; text-shadow: 0 1px 12px rgba(0,0,0,.75); }
.scene-caption strong { font-size: 24px; font-weight: 650; }
.scene-kicker { color: rgba(255,255,255,.76); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.scene-subtitle { margin-top: 2px; color: rgba(255,255,255,.78); font-size: 13px; }

.scene-live-badge {
  position: absolute; z-index: 6;   /* above .speech-video (5), like .scene-caption */ top: 20px; right: 20px; display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; background: rgba(12,10,10,.66); color: var(--paper);
  font-size: 12px; font-weight: 650; backdrop-filter: blur(6px);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px rgba(83,201,140,.18); }

.moment-card {
  position: absolute; z-index: 6; right: 20px; bottom: 22px; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border: 0; border-radius: 14px; background: rgba(12,10,10,.72); color: var(--paper);
  backdrop-filter: blur(6px); text-align: left;
}
.moment-card:hover { background: rgba(12,10,10,.86); }
.moment-icon { font-size: 16px; }
.moment-copy { display: flex; flex-direction: column; }
.moment-title { font-size: 12px; font-weight: 650; }
.moment-sub { font-size: 11px; color: rgba(255,255,255,.62); }
.moment-chevron { font-size: 16px; color: rgba(255,255,255,.6); }

.chat { position: relative; z-index: 2; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: rgba(39, 27, 35, .9); }
.profile-bar { flex: 0 0 auto; min-height: 74px; display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: rgba(18,16,16,.54); border-bottom: 1px solid var(--line); }
.avatar { width: 48px; height: 48px; flex: 0 0 48px; padding: 0; color: var(--paper); border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #3c3030; border: 2px solid rgba(255,255,255,.78); box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.avatar.has-status { border-color: var(--online); }
.avatar.has-status:focus-visible { outline: 2px solid var(--online); outline-offset: 2px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
#avatar-initial { font-size: 19px; font-weight: 650; }
.profile-copy { min-width: 0; flex: 1 1 auto; }
.profile-copy h1 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 650; }
.presence { display: flex; align-items: center; gap: 6px; color: #d5cecc; font-size: 12px; }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px rgba(83,201,140,.13); }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.07); color: var(--paper); font-weight: 700; }
.icon-button:hover:not(:disabled), .icon-button[aria-pressed="true"] { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.32); }
/* Call buttons and other stubs render disabled rather than live-looking; the shared
   button:disabled opacity is too subtle to read as "can't click this" at a glance. */
.icon-button:disabled { cursor: not-allowed; background: rgba(255,255,255,.04); }
.mobile-back, .mobile-overflow, .mobile-gear, .mobile-menu-wrap { display: none; }

.get-to-know {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 20px; background: rgba(255,255,255,.05); color: var(--paper); text-align: left;
}
.get-to-know:hover { background: rgba(255,255,255,.1); }
.get-to-know-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; font-style: italic; }
.get-to-know-copy { display: flex; flex-direction: column; }
.get-to-know-title { font-size: 12px; font-weight: 650; }
.get-to-know-sub { font-size: 10px; color: var(--muted); }

.know-panel { flex: 0 0 auto; padding: 12px 16px; background: rgba(24,20,20,.9); border-bottom: 1px solid var(--line); font-size: 13px; }
.know-panel strong { display: block; margin-bottom: 4px; }
.know-panel p { margin: 0 0 8px; }

.messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 24px 14px; display: flex; flex-direction: column; gap: 11px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.msg { width: fit-content; max-width: 94%; }
.msg .who { display: flex; justify-content: space-between; gap: 12px; margin: 0 4px 4px; color: rgba(255,255,255,.62); font-size: 10px; text-transform: uppercase; }
.msg .who .stamp { font-size: 10px; opacity: .72; font-variant-numeric: tabular-nums; }
/* "Sent", never "read" -- there is no delivery/read tracking behind this app, so the
   receipt can only honestly claim the message left the browser. */
.msg .who .receipt { font-size: 10px; letter-spacing: -1px; color: var(--online); }
/* Flat fill, no outline. The 3px white border plus the hard `0 5px 0` shadow gave every
   bubble a cut-out sticker edge; the target has soft filled bubbles that recede so the
   text is what carries. Radius raised to 18px to match, with the tail corner squared. */
.msg .body { padding: 12px 15px; border: 0; border-radius: 18px; background: var(--bubble); box-shadow: 0 2px 10px rgba(0,0,0,.22); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { align-self: flex-start; position: relative; }
/* Block 006: the parts of one split reply share a bubble; a blank line separates them. */
.msg .body .reply-part { margin-top: 1.1em; }
.msg.assistant .body { border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; }
.msg.user .body { border-bottom-right-radius: 6px; }
.msg.user .who { justify-content: flex-end; }
.msg.user .who .stamp { order: -1; }
.msg.user .body { background: var(--bubble-user); }
/* Heart reaction sits off the bubble's edge, mockup-style. DOM-only toggle -- nothing
   is persisted, so it must never look pinned/saved across a reload. */
.react-heart {
  position: absolute; right: -34px; bottom: 6px; width: 26px; height: 26px; padding: 0;
  border: 0; background: transparent; color: rgba(255,255,255,.5); display: grid; place-items: center;
}
.react-heart:hover { color: rgba(255,255,255,.8); }
.react-heart-icon { width: 18px; height: 18px; }
.react-heart[aria-pressed="true"] { color: var(--bubble-user); }
.react-heart[aria-pressed="true"] .react-heart-icon { fill: currentColor; }
.msg.pending .body { color: rgba(255,255,255,.68); font-style: italic; }
.msg.image .body { padding: 6px; }
.msg.image img { width: 100%; display: block; border-radius: 6px; cursor: pointer; }
.companion-media { width: min(100%, 340px); display: block; position: relative; overflow: hidden; border-radius: 6px; cursor: pointer; }
.companion-media > .mika-motion-frame { width: 100%; }
/* Reply-bubble photos (Block 70): same fill rules as standalone image messages, so the
   frame is exactly the picture width (owner 2026-10-02: container was wider than the image). */
.msg .body .companion-media { width: 100%; margin-top: 8px; }
.companion-media .mika-motion-frame { display: block; position: relative; overflow: hidden; background: #111; }
.companion-media .mika-motion-frame img { width: 100%; height: auto; display: block; border-radius: 0; }
.companion-media .mika-motion-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.companion-media img { width: 100%; height: auto; display: block; }
/* The bubble around a photo hugs the photo (owner 2026-10-02 screenshot: bubble stretched to
   the header row width, leaving an empty band to the right of the picture). */
.msg.image .body { box-sizing: border-box; width: min(100%, 352px); padding: 6px 6px 10px; align-self: flex-start; }
.msg.image .body > * { max-width: 100%; box-sizing: border-box; }
.msg.image .body > :not(.companion-media) { padding-left: 6px; padding-right: 6px; }
.msg.image .body .companion-media { margin-top: 0; }
.media-copy-shield { position: absolute; inset: 0; z-index: 4; display: block; background: transparent; cursor: pointer; }
.msg.image .mika-motion-frame { width: min(100%, 340px); display: block; position: relative; overflow: hidden; border-radius: 6px; cursor: pointer; background: #111; }
.msg.image .mika-motion-frame img, .msg.image .mika-motion-frame video { width: 100%; display: block; border-radius: 0; }
.msg.image .mika-motion-frame video { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.msg.image .mika-motion-frame.is-playing video { opacity: 1; }
.msg.image .cap { padding: 6px 5px 3px; color: rgba(255,255,255,.68); font-size: 11px; }

/* Browser-side copy controls are deterrents, not protection: screenshots and DevTools
   can still capture anything displayed. These rules only remove casual save/drag paths. */
.msg.image img, .scene img, .avatar img, .media-lightbox img,
.companion-media, .scene, .avatar, .media-lightbox-visual {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

body.media-lightbox-open { overflow: hidden; }
.media-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 0; background: rgba(0,0,0,.92);
}
.media-lightbox-visual { position: relative; max-width: 100vw; max-height: 100vh; }
.media-lightbox img {
  display: block; width: auto; height: auto; max-width: 100vw; max-height: 100vh;
  object-fit: contain;
}
.media-lightbox-close {
  position: fixed; z-index: 1002; top: max(12px, env(safe-area-inset-top)); right: 14px;
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--paper); background: rgba(0,0,0,.58);
  font-size: 30px; line-height: 1;
}
.media-lightbox-close:hover, .media-lightbox-close:focus-visible { background: rgba(255,255,255,.16); }
.msg .narration { margin-bottom: 6px; font-style: italic; opacity: .74; }
.msg .speech { line-height: 1.5; }
.msg .narration + .speech::before { content: "\201c"; }
.msg .narration + .speech::after { content: "\201d"; }

.composer { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 11px 14px max(13px, env(safe-area-inset-bottom)); background: var(--glass-strong); border-top: 1px solid var(--line); }
.composer textarea { flex: 1 1 auto; min-width: 0; min-height: 42px; max-height: 132px; resize: none; padding: 10px 12px; border: 1px solid rgba(255,255,255,.19); border-radius: var(--radius); outline: none; color: var(--paper); background: rgba(255,255,255,.08); }
.composer textarea::placeholder { color: rgba(255,255,255,.48); }
.composer textarea:focus { border-color: rgba(224,116,97,.9); background: rgba(255,255,255,.11); }
/* Brief 238: canon-derived starter chips under an empty chat greeting. Plain pill buttons
   above the composer, wrapping on a narrow phone; gone once the user has said anything. */
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 12px; }
.starter-chip { max-width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--paper); background: rgba(255,255,255,.07); font: 13px system-ui; line-height: 1.35; text-align: left; cursor: pointer; }
.starter-chip:hover, .starter-chip:focus-visible { border-color: var(--accent); background: rgba(255,255,255,.13); }
.composer-tool { border-radius: var(--radius); font-size: 22px; font-weight: 300; }
.emoji-tool { font-size: 17px; }
.send-button { min-width: 62px; height: 38px; padding: 0 14px; border: 0; border-radius: var(--radius); background: var(--accent); color: #211414; font-weight: 700; }

.error { flex: 0 0 auto; margin: 0 14px 10px; padding: 9px 11px; border: 1px solid rgba(255,155,146,.5); border-radius: var(--radius); color: #ffd1cd; background: rgba(112,31,31,.72); font-size: 13px; }
/* Page-level message (app.js showToast): visible from any screen, unlike .error which
   lives inside the chat panel. */
.app-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 9000;
  max-width: min(92vw, 460px); padding: 11px 15px; border: 1px solid rgba(255,155,146,.5);
  border-radius: var(--radius); color: #ffd1cd; background: rgba(60,20,20,.95); font-size: 13px;
  box-shadow: 0 6px 22px rgba(0,0,0,.45); }
.debug { flex: 0 0 auto; max-height: 42vh; overflow-y: auto; padding: 13px 16px; background: rgba(13,12,12,.96); border-top: 1px solid var(--line); font-size: 12px; }
.debug-head, .debug-service { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.debug-head input { width: 180px; min-width: 0; padding: 6px 8px; color: var(--paper); background: #282323; border: 1px solid var(--line); border-radius: 6px; }
.health { color: var(--muted); }
.health.ok { color: var(--online); }
.health.warn, .health.bad { color: var(--error); }
.state { margin: 8px 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.state dt { color: var(--muted); }
.state dd { margin: 0; }
.muted { color: var(--muted); }
button.ghost { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--paper); background: #2b2626; }
.mem { margin: 7px 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #252121; }
.conversations button { position: relative; padding-right: 22px; }
.conversations .tab-badge { top: 50%; right: 7px; transform: translateY(-50%); }
.mem-head, .mem-meta, .debug-stats, .timings { display: flex; flex-wrap: wrap; gap: 7px; }
.mem-id, .badge { color: #f0a393; }
.mem-type, .mem-meta, .debug-stats, .timings { color: var(--muted); font-size: 11px; }
.voice-controls { margin-top: 7px; }
/* Brief 209: voice is off by default; the chat-header speaker is the switch and reads
   dim while off, solid once the user has turned voice on. */
.voice-toggle { opacity: .55; }
.voice-toggle.voice-on { opacity: 1; }
.voice-play, .voice-reveal { padding: 3px 7px; border: 1px solid currentColor; border-radius: 6px; color: inherit; background: transparent; font-size: 11px; }
.split-pending { margin-top: 5px; color: var(--muted); font-size: 11px; font-style: italic; }

.audition { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.audition-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.audition-body { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.audition-row { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #252121; min-width: 0; }
.audition-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.audition-voice { font-weight: 650; }
.audition-meta { color: var(--muted); font-size: 11px; }
.audition-current { color: var(--online); border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; font-size: 10px; text-transform: uppercase; }
.audition-note { margin-top: 4px; font-size: 12px; }
.audition-clips { margin-top: 7px; display: flex; flex-direction: column; gap: 6px; }
.audition-clip { min-width: 0; }
.audition-clip-label { display: block; margin-bottom: 3px; font-size: 11px; }
.audition-clip audio { display: block; width: 100%; max-width: 100%; height: 32px; }

.login-screen { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: #151313; }
.login-panel { width: min(100%, 350px); padding: 26px; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); background: rgba(24,21,21,.9); backdrop-filter: blur(16px); box-shadow: 0 18px 55px rgba(0,0,0,.4); }
.login-avatar { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 50%; background: var(--accent); color: #271514; font-size: 21px; font-weight: 700; }
.login-panel h2 { margin: 0 0 5px; font-size: 22px; }
.login-panel p { margin: 0 0 19px; color: #bdb5b3; }
.login-panel label { display: block; margin: 12px 0; color: #d5cecc; font-size: 12px; }
.login-panel input { width: 100%; margin-top: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--paper); background: #282323; outline: none; }
.login-panel input:focus { border-color: var(--accent); }
.login-panel button { width: 100%; margin-top: 9px; padding: 10px; border: 0; border-radius: 6px; background: var(--accent); color: #211414; font-weight: 700; }
.login-error { color: var(--error); font-size: 12px; }

dialog { width: min(92%, 680px); max-height: 82vh; overflow: auto; padding: 18px; border: 1px solid #4d4443; border-radius: var(--radius); color: var(--paper); background: #201c1c; }
dialog::backdrop { background: rgba(0,0,0,.68); }
dialog .src { margin: 8px 0; padding-left: 10px; border-left: 2px solid #5e5351; }

/* --- shared page chrome (home / companion / auth) ------------------------ */
.page { position: fixed; z-index: 15; inset: 0; display: flex; flex-direction: column; background: #151313; color: var(--paper); }
/* Block 31: owner does not want a visible scrollbar anywhere scrolling happens.
   Scrolling itself is untouched -- only the bar's paint is suppressed (Firefox via
   scrollbar-width, old Edge/IE via -ms-overflow-style, WebKit/Blink via the
   pseudo-element below). */
.page-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.page-scroll::-webkit-scrollbar { display: none; }
/* Mockup background is a warm dark mauve with soft coral/pink bokeh blobs, not flat
   black. Radial gradients layered on the page background; content sits above them. */
.page-home {
  background:
    radial-gradient(420px 320px at 8% 6%, rgba(224,116,97,.30), transparent 60%),
    radial-gradient(380px 300px at 96% 28%, rgba(224,80,110,.26), transparent 60%),
    radial-gradient(460px 360px at 12% 78%, rgba(240,145,106,.20), transparent 62%),
    radial-gradient(400px 320px at 90% 96%, rgba(224,80,110,.22), transparent 60%),
    #241820;
}
.accent-grad { background: linear-gradient(90deg, #ff8a6b, #e0518f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.link-btn { border: 0; background: transparent; color: var(--accent); font-weight: 650; padding: 0; }
.btn-grad {
  padding: 13px 18px; border: 0; border-radius: 999px; color: #fff; font-weight: 700;
  background: linear-gradient(90deg, #ef5f7a, #f0916a);
  box-shadow: 0 8px 18px rgba(224,80,110,.28);
}
.btn-outline { padding: 13px 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--paper); font-weight: 650; }
.tag { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: rgba(255,255,255,.82); background: rgba(255,255,255,.05); }

/* home -- mobile scale matches the mockup's one-screen density (CHECKLIST Block 24):
   the whole page (header through tab bar) fits a 430x932 viewport without scrolling
   past the banner. Every ph-* size here was cut ~35-45% from the pre-Block-24 values,
   which rendered at ~1.7x the mockup's scale and pushed most sections below the fold. */
.ph-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px max(8px, env(safe-area-inset-top)); border-bottom: 0; }
.ph-brand { font-size: 19px; font-weight: 800; background: linear-gradient(90deg, #ff8a6b, #e0518f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-tagline { flex: 1 1 auto; text-align: right; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); line-height: 1.35; }
#home-menu { width: 34px; height: 34px; min-width: 0; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.ph-hero { padding: 10px 14px 4px; }
.ph-hero h1 { margin: 0 0 8px; font-size: 25px; line-height: 1.18; font-weight: 800; letter-spacing: -.01em; }
.ph-sub { margin: 0 0 12px; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.42; }
.ph-cta-row { display: flex; flex-direction: row; gap: 8px; margin-bottom: 12px; }
.ph-cta-row .btn-grad { flex: 0 0 56%; padding: 11px 10px; font-size: 13px; }
.ph-cta-row .btn-outline { flex: 1 1 auto; padding: 11px 10px; font-size: 13px; }
.ph-trust-row { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.ph-trust-row span { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; max-width: 110px; line-height: 1.25; }
.ph-trust-row .tag-icon { width: 12px; height: 12px; margin-right: 0; color: var(--accent); fill: none; stroke: var(--accent); stroke-width: 2.2; }
.ph-section-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.ph-section-head h2 { margin: 0; font-size: 16px; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0 14px; }
/* .ph-tile is a <button>, so without an explicit colour its text falls back to the
   UA's dark button colour: the name rendered near-black on a dark card and three
   separate scrim changes did nothing, because the background was never the problem
   (2026-09-22). */
.ph-tile { position: relative; aspect-ratio: 3/4.3; border-radius: 12px; overflow: hidden; background: #2b2222; color: var(--paper); border: 0; padding: 0; text-align: left; }
/* object-position keeps the subject in frame: a centred cover crop on a full-body
   render cuts the head off at these aspect ratios (2026-09-22). */
.ph-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
/* A gradient alone could not carry the caption: the name sits mid-card over a bright
   red pyjama check and vanished into it at two different gradient strengths
   (2026-09-22). The mockup puts the text on a solid dark band at the bottom of the
   card, so the caption gets its own opaque panel and the gradient only softens the
   join above it. */
.ph-tile-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.04) 50%, rgba(0,0,0,.5) 74%, rgba(0,0,0,.72)); }
.ph-tile-status { position: absolute; top: 6px; left: 6px; display: flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.5); font-size: 9px; }
.ph-tile-status .live-dot { background: var(--online); }
.ph-tile-status[data-status="busy"] .live-dot { background: #e0b04a; box-shadow: 0 0 0 3px rgba(224,176,74,.18); }
.ph-tile-status[data-status="offline"] .live-dot { background: #9a9190; box-shadow: 0 0 0 3px rgba(154,145,144,.18); }
.ph-tile-status[data-status="away"] .live-dot { background: #e0b04a; box-shadow: 0 0 0 3px rgba(224,176,74,.18); }
.ph-tile-heart { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.42); border: 0; color: #fff; font-size: 12px; }
.ph-tile-copy {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 8px 8px;
  background: linear-gradient(transparent, rgba(11,8,9,.92) 22%, rgba(11,8,9,.97));
  text-shadow: 0 1px 4px rgba(0,0,0,.95);
}
.ph-tile-copy strong { font-size: 11px; color: var(--paper); }
.ph-tile-copy .ph-tile-age { font-weight: 400; color: rgba(255,255,255,.75); }
.ph-tile-copy p { margin: 2px 0 5px; font-size: 8.5px; line-height: 1.3; color: rgba(255,255,255,.82); }
.ph-tile-tags { display: flex; gap: 3px; flex-wrap: wrap; }
.ph-tile-tags span { padding: 1.5px 6px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 7.5px; }
.ph-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 14px 14px 4px; }
.ph-feature { display: flex; flex-direction: column; gap: 6px; padding: 10px 8px; border: 0; border-radius: 12px; background: rgba(255,255,255,.03); font-size: 9.5px; }
.ph-feature-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ph-feature strong { font-size: 10.5px; line-height: 1.25; }
.ph-feature span { color: var(--muted); }
.ph-feature-icon-wrap { width: 30px; height: 30px; border-radius: 9px; background: rgba(224,116,97,.16); display: grid; place-items: center; margin-bottom: 2px; }
.ph-feature-icon { width: 15px; height: 15px; font-size: 15px; color: var(--accent); stroke: var(--accent); }
.ph-banner { position: relative; margin: 14px 14px 78px; padding: 16px; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #7a4a5c, #4f3040 55%, #6b3f52); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; min-height: 108px; }
.ph-banner-script { flex: 0 0 auto; width: 34%; font-family: "Brush Script MT", "Segoe Script", cursive; color: #ffb9d0; font-size: 15px; line-height: 1.22; }
.ph-banner-copy { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ph-banner-kicker { font-size: 9.5px; color: rgba(255,255,255,.72); }
.ph-banner-copy strong { font-size: 13px; line-height: 1.25; }
.ph-banner-sub { font-size: 9.5px; color: var(--muted); }
.ph-banner-photo { flex: 0 0 auto; width: 64px; height: 84px; border-radius: 12px; overflow: hidden; }
.ph-banner-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 234.9 (owner 2026-10-22): a signed-in home is the app, not the pitch. app.js sets
   hidden on these four marketing blocks once the session-gated /api/characters answers;
   signed-out visitors keep the landing exactly as it was. hidden must beat the layout
   display each block sets, and .ph-hero-row drops its now-empty hero column so the
   companion grid spans the page as in Home.dc.html. */
.page-home #home-hero[hidden],
.page-home #home-features[hidden],
.page-home #home-banner[hidden],
.page-home #home-chat-preview[hidden] { display: none; }
.ph-hero-row.home-signed-in { grid-template-columns: minmax(0, 1fr); gap: 0; }

.tab-bar { flex: 0 0 auto; display: flex; padding: 8px 4px max(8px, env(safe-area-inset-bottom)); background: rgba(28,20,26,.92); border-top: 0; }
.tab-item { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: rgba(255,255,255,.56); font-size: 10px; padding: 4px; }
.tab-item.active { color: var(--accent); }
.tab-badge { position: absolute; top: 0; right: calc(50% - 14px); width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 2px rgba(28,20,26,.92); }

/* Desktop top nav bar, shown in place of the bottom tab bar and the ph-header. */
.ph-topnav { display: none; }
.ph-topnav-brand { display: flex; align-items: center; gap: 9px; }
.ph-topnav-brand .brand-name { font-size: 17px; font-weight: 700; }
.ph-topnav-links { display: flex; align-items: center; gap: 6px; }
.ph-topnav-link {
  display: flex; align-items: center; gap: 7px; padding: 9px 16px; border: 0; border-radius: 10px;
  background: transparent; color: rgba(255,255,255,.68); font-size: 14px; font-weight: 600;
}
.ph-topnav-link:hover { background: rgba(255,255,255,.06); color: var(--paper); }
.ph-topnav-link.active { background: rgba(224,116,97,.16); color: var(--accent); }

/* companion profile */
.pc-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px max(9px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.pc-brand { flex: 1 1 auto; font-size: 20px; font-weight: 800; background: linear-gradient(90deg, #ff8a6b, #e0518f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pc-header-actions { display: flex; gap: 8px; }
.pc-carousel { position: relative; aspect-ratio: 4/5; max-height: 46vh; background: #201c1c; overflow: hidden; }
.pc-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-online-badge { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.5); font-size: 11px; }
.pc-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.42); color: #fff; display: grid; place-items: center; }
.pc-arrow-prev { left: 8px; } .pc-arrow-next { right: 8px; }
.pc-counter { position: absolute; right: 10px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.42); font-size: 10px; }
.pc-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.pc-thumb { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #201c1c; }
.pc-thumb.active { border-color: var(--accent); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-identity { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 6px 16px 0; }
.pc-online-tag { display: flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .05em; color: var(--online); font-weight: 700; }
.pc-identity-main h1 { margin: 4px 0 2px; font-size: 26px; }
.pc-age { font-weight: 400; color: var(--muted); font-size: 18px; }
.pc-tagline { margin: 0; font-size: 14px; font-weight: 650; }
.pc-identity-actions { display: flex; gap: 8px; }
.pc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px 16px 0; }
.pc-stat { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; font-size: 11px; }
.pc-stat-icon { color: var(--accent); flex: 0 0 auto; }
.pc-stat > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pc-stat strong { font-size: 12px; font-weight: 650; }
.pc-stat span { color: var(--muted); }
.pc-bio { padding: 14px 16px 0; font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.82); }
.pc-cta-row { display: flex; gap: 10px; padding: 0 16px; margin-top: 16px; }
.pc-start-chat { flex: 1 1 auto; text-align: center; }
.pc-favorite { display: none; } /* mobile mockup (Block 24) has only Start Chat; desktop adds Favorites below */
.pc-reply-note { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 8px; font-size: 11px; color: var(--muted); }
.pc-tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 16px 16px 0; }
.pc-info-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px; }
.pc-info-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 11px; }
.pc-feature-icon { font-size: 18px; }
.pc-section-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px; }
.pc-section-head h2 { margin: 0; font-size: 17px; }
.pc-about p, .pc-moments { padding: 0 16px; font-size: 13px; color: rgba(255,255,255,.8); }
.pc-about-script { display: none; }
.pc-moments { padding-bottom: 24px; }
.pc-moments-row { display: flex; gap: 8px; overflow-x: auto; padding-top: 6px; }
.pc-moments-row img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; display: block; }
.pc-moment { margin: 0; flex: 0 0 auto; }
.pc-moment figcaption { margin-top: 4px; font-size: 11px; color: rgba(255,255,255,.82); }
.pc-moment-when { display: block; font-size: 10px; color: var(--muted); }
.pc-script-annotation { display: none; }
.pc-remembers-card, .pc-remembers-note { display: none; } /* desktop-only: What Mika Remembers */
.pc-topnav { display: none; }

/* auth pages (sign in / request access) */
.page-auth .page-scroll { padding: 18px 20px max(28px, env(safe-area-inset-bottom)); }
.page-auth > .pa-card {
  width: min(100% - 32px, 460px);
  margin: max(24px, env(safe-area-inset-top)) auto max(28px, env(safe-area-inset-bottom));
  padding: 24px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(24,21,21,.9);
  box-shadow: 0 18px 55px rgba(0,0,0,.34);
}
.pa-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.pa-brand { font-size: 24px; font-weight: 800; background: linear-gradient(90deg, #ff8a6b, #e0518f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pa-tagline { text-align: right; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.pa-title { margin: 6px 0; font-size: 30px; font-weight: 800; }
.pa-sub { margin: 0 0 20px; color: rgba(255,255,255,.76); font-size: 13px; line-height: 1.5; }
.pa-form { display: flex; flex-direction: column; gap: 14px; }
.pa-form label { display: block; font-size: 12px; color: #d5cecc; }
.pa-form input, .pa-form textarea { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--paper); background: #211b1b; outline: none; font-size: 14px; }
.pa-form input:focus, .pa-form textarea:focus { border-color: var(--accent); }
.pa-form textarea { resize: vertical; }
.pa-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.4; }
.pa-check input { width: auto; margin: 2px 0 0; flex: 0 0 auto; }
.pa-check a { color: var(--accent); }
.pa-forgot { align-self: flex-end; font-size: 12px; margin-top: -6px; }
.pa-submit { width: 100%; margin-top: 4px; text-align: center; }
.pa-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.pa-divider::before, .pa-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.btn-oauth {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.04); color: var(--paper); font-weight: 650; font-size: 13px;
}
.btn-oauth:disabled, .btn-oauth[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.oauth-logo { font-weight: 800; }
.pa-switch { margin: 16px 0 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.76); }
.pa-footer { margin: 22px 0 0; text-align: center; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pa-success { padding: 10px 12px; border: 1px solid rgba(83,201,140,.5); border-radius: 8px; color: #b7ecce; background: rgba(20,60,45,.5); font-size: 13px; }

/* Desktop-only sign-in chrome (mockup 3): top bar, photo collage panel, icon+eye
   form fields. All hidden by default (mobile keeps the original single-column
   pa-header + pa-title + pa-form flow from CHECKLIST Block 24). */
.pa-topbar, .pa-collage-panel, .pa-form-title, .pa-sub-desktop, .pa-footer-desktop, .pa-footer-legal { display: none; }
.pa-sub-mobile { display: block; }
.pa-footer-mobile { display: block; }
.pa-input-wrap { position: relative; margin-top: 6px; }
.pa-input-wrap input { margin-top: 0; padding-left: 38px; }
.pa-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.pa-eye-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pa-eye-toggle:hover { color: var(--paper); background: rgba(255,255,255,.06); }
.pa-eye-toggle[aria-pressed="true"] { color: var(--accent); }
.account-back { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 16px; }
.account-section { padding: 16px 0; border-top: 1px solid var(--line); }
.account-section h2 { margin: 0 0 12px; font-size: 15px; }
.account-readonly-label { display: block; font-size: 12px; color: #d5cecc; }
.account-readonly-label input[readonly] { color: rgba(255,255,255,.78); background: rgba(255,255,255,.045); }
.account-wide-button { width: 100%; border-radius: 12px; }
.account-links { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.account-links a { color: var(--accent); font-weight: 650; text-decoration: none; }
.account-delete-note { margin-top: 12px; }

@media (min-width: 761px) {
  .page-companion .page-scroll { max-width: 480px; margin: 0 auto; }
  .page-auth .page-scroll { max-width: 420px; margin: 0 auto; }

  /* Landing page: top nav replaces the mobile ph-header + bottom tab bar from
     761px up. The mockup's actual desktop layout (hero beside a 4x2 grid, chat
     preview section) only applies >=1100px -- see that block below; this block
     covers the narrower "tablet" range with a stacked single-column layout. */
  .page-home .ph-header { display: none; }
  .page-home .tab-bar { display: none; }
  /* Mockup order: wordmark hard left, nav links immediately beside it, actions hard
     right. `justify-content: space-between` on three children centred the nav in the
     middle of the bar instead (2026-09-22); the links group now sits next to the
     wordmark and a margin-left:auto pushes the actions to the edge. */
  .page-home .ph-topnav { display: block; padding: 0; border-bottom: 1px solid var(--line); }
  .page-home .ph-topnav-inner { display: flex; align-items: center; gap: 40px; padding: 18px 56px; }
  .page-home .ph-topnav-links { display: flex; align-items: center; gap: 34px; }
  .page-home .ph-topnav-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
  /* The scrolling element must stay full width. Capping .page-scroll at 1320px put
     its scrollbar at the right edge of that column -- a vertical line down the middle
     of the screen -- and left dead margins either side (2026-09-22). The mockup is
     full-bleed with a ~56px gutter, so the width cap goes on the INNER sections, and
     only as a very wide safety limit. */
  .page-home .page-scroll { padding: 0; }
  .page-home .ph-hero-row,
  .page-home .ph-features,
  .page-home .ph-chat-preview { max-width: 1800px; margin-left: auto; margin-right: auto; padding-left: 56px; padding-right: 56px; }

  .ph-hero-row { display: grid; grid-template-columns: 1fr; gap: 32px; padding: 40px 0 24px; }
  .ph-hero { padding: 0; }
  .ph-hero h1 { font-size: 36px; }
  .ph-sub { font-size: 15px; max-width: 520px; }
  /* Block 27 defect 2: the base .ph-cta-row (line ~269) sets flex:0 0 56%/flex:1 1 auto
     for mobile density, which stretched both desktop CTAs to ~430px. Mockup 1 measures
     Start Free ~210x55 and Browse Companions ~255x55 -- natural, padding-driven widths,
     not flex-grow. */
  .ph-cta-row { flex-direction: row; margin-bottom: 0; }
  .ph-cta-row .btn-grad,
  .ph-cta-row .btn-outline { flex: 0 0 auto; width: auto; height: 58px; display: inline-flex; align-items: center; padding: 0 34px; font-size: 15px; }
  /* Mockup 1 shows all three trust items on one line. The base .ph-trust-row (line
     272) wraps and caps each span at max-width:110px for mobile, which forces "No
     credit card required" onto two lines at desktop widths too (2026-09-22). Desktop
     has plenty of horizontal room, so stop wrapping and drop the per-span cap. */
  /* Block 31 fix: 15px trust type ran "Thousands of companions" past the hero
     column's edge, colliding with the grid (trust.right measured past grid.left).
     The mockup's own trust row is ~13px, not 15px -- match it so all three items
     fit inside the ~494px hero column with clearance to spare. */
  .ph-trust-row { font-size: 13px; flex-wrap: nowrap; white-space: nowrap; margin-bottom: 0; }
  .ph-trust-row span { max-width: none; }

  .ph-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0; }
  .ph-tile { aspect-ratio: 3/4.1; }

  .ph-features { grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 40px 0 6px; }
  .ph-feature { padding: 20px 18px; font-size: 13px; }
  .ph-feature strong { font-size: 14px; }

  .ph-banner { margin: 32px 0 40px; padding: 32px; }
  .ph-banner-copy strong { font-size: 22px; }
  .ph-chat-preview { display: none; }
}

/* True desktop layout, built to CHECKLIST Block 25's DESKTOP HOME mockup:
   page-layouts/"ChatGPT Image Sep 21, 2026, 10_02_50 PM (1).png". Everything here
   is scoped to >=1100px so the 761-1099px "tablet" block above and the <=760px
   mobile block (Block 24, matched to its own mockup) do not regress. */
@media (min-width: 1100px) {
  .page-home .ph-topnav-links { display: flex; }
  .ph-topnav-word { font-size: 22px; font-weight: 800; background: linear-gradient(90deg, #ff8a6b, #e0518f); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .ph-topnav-actions { display: flex; align-items: center; gap: 12px; }
  .ph-topnav-login { padding: 9px 20px; font-size: 13px; }
  .ph-topnav-start { padding: 9px 20px; font-size: 13px; }

  /* Block 27 defect 1: mockup 1's nav sits inside the SAME centred container as the
     hero/grid/features/chat-preview below it (wordmark ~8.7% from the left edge,
     Start Free ~8.7% from the right edge of a 1672px mock). The nav previously used
     its own full-bleed padding (line ~446) while the sections below used a
     different max-width -- the two containers had different edges. Give the nav's
     inner row and every section below the same width/max-width/margin so their
     left and right edges line up. The scroller (.page-scroll) itself must stay
     full width -- see the comment at line ~449 on why a cap there breaks the
     scrollbar -- so the container goes on each inner row instead. */
  .page-home .ph-topnav-inner,
  .page-home .ph-hero-row,
  .page-home .ph-features,
  .page-home .ph-chat-preview {
    width: 82.5%; max-width: 1380px; margin-left: auto; margin-right: auto;
    padding-left: 0; padding-right: 0;
  }

  .ph-kicker { display: block; margin-bottom: 0; font-size: 13px; font-weight: 650; letter-spacing: .16em; color: rgba(255,255,255,.72); }
  /* align-items: stretch (grid default) so the grid column's outer box matches the
     hero column's full height -- owner review 2026-09-22: grid read as a small block
     floating in a big column when the row used align-items:start. */
  .ph-hero-row { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: 40px; align-items: stretch; padding: 48px 0 24px; }
  .ph-hero h1 { font-size: 44px; line-height: 1.08; }
  /* Block 31: the hero column's content box must start level with the TOP of the
     first card row and end level with the BOTTOM of the second card row, not with
     the arrows/"View all" row above the grid (mockup: kicker y~132, cards y~125;
     arrows sit above both at y~94). .ph-hero-grid-col stacks a head row (arrows +
     pill, ~44px tall) + 16px gap above the grid, so the hero's own top padding
     matches that same offset -- otherwise the kicker sits above the cards and a
     dead gap opens under the trust row. flex column + space-between then spreads
     kicker/headline/subcopy/CTAs/trust across the full height instead of leaving
     the gap at the bottom. */
  .ph-hero { display: flex; flex-direction: column; justify-content: space-between; padding: 62px 0 0; height: 100%; }
  .ph-sub { font-size: 18px; }
  .ph-hero-grid-col { display: flex; flex-direction: column; gap: 16px; height: 100%; }
  /* Block 31 fix: space-between with two children (arrows group, pill) pinned the
     arrows to the far LEFT of the header row -- that is what space-between does with
     exactly two items. The mockup wants all three controls as ONE flush-right group:
     [<] [>] [View all ->]. flex-end + a shared gap does that without a wrapper. */
  .ph-hero-grid-head { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
  .ph-carousel-arrows { display: flex; gap: 10px; }
  .ph-carousel-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--paper); display: grid; place-items: center; }
  .ph-carousel-arrow:hover { background: rgba(255,255,255,.1); }
  .ph-view-all-pill { padding: 11px 20px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 650; color: var(--paper); }
  .ph-view-all-pill:hover { background: rgba(255,255,255,.06); }

  /* flex:1 lets the grid itself grow to fill the remaining column height (after the
     head row above it); grid-auto-rows:1fr then stretches each tile row to share
     that height evenly, so tiles scale up to occupy the column instead of sitting at
     a fixed aspect-ratio with empty space below. */
  .ph-hero-grid-col .ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; align-content: start; gap: 14px; flex: 0 0 auto; }
  /* Block 31: mockup card measured directly off the 1672px-wide PNG (pixel-scanned
     column/row gaps, not eyeballed) at ~183x204 -> ~0.9 w/h. The prior aspect-ratio:
     auto let the flex row stretch tiles taller/narrower than that. The FLUX portrait
     source is 576x768 (0.75 w/h), so object-fit:cover inside a 0.9 box still crops
     top/bottom; object-position keeps the face in frame instead of centring the crop
     on the torso. */
  /* 2026-10-02: width comes from the column (min-width:0), height from the 0.9 aspect. The old
     height:100% derived the WIDTH from the row height, so between ~1100-1280px the tiles grew
     wider than their columns and overlapped each other. */
  .ph-hero-grid-col .ph-tile { aspect-ratio: 0.9; width: 100%; min-width: 0; height: auto; }
  .ph-hero-grid-col .ph-tile img { object-position: center 30%; }
  /* Owner review 2026-09-22: the base caption band (line ~298, sized for a small
     mobile tile) covered most of the portrait at these larger tile sizes. Cap the
     band's height at 32% of the tile via `top`, and use a short, soft fade instead
     of the base gradient's tall, dark stack, so the face/shoulders stay clear. Padding
     and line-height are tightened (not the band grown) to still fit the bigger text. */
  /* Block 31 fix: the 0.9 aspect-ratio shortened the tile (~170px tall in the 4x2
     grid) but the caption band/type kept its pre-Block-31 sizing, so the two-line
     blurb ("Deep conversations and cozy nights" etc) clipped at the tile's bottom
     edge on every card. Band widened to 65% (still <=35% of tile per the owner's
     cap, expressed as a distance-from-top) and type/padding/line-height tightened
     so a 2-line blurb + name + tag row all fit inside it on every one of the 8 tiles. */
  .ph-hero-grid-col .ph-tile-shade {
    top: 65%; background: linear-gradient(180deg, transparent, rgba(11,8,9,.85));
  }
  .ph-hero-grid-col .ph-tile-copy {
    top: 65%; bottom: 0; padding: 5px 8px 5px; display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(180deg, transparent, rgba(11,8,9,.55) 22%, rgba(11,8,9,.92));
  }
  .ph-hero-grid-col .ph-tile-copy strong { font-size: 13px; line-height: 1.1; }
  .ph-hero-grid-col .ph-tile-copy p { margin: 1px 0 3px; font-size: 11px; line-height: 1.18; }
  .ph-hero-grid-col .ph-tile-tags span { font-size: 10px; padding: 1.5px 7px; }

  .ph-features { padding: 44px 0 6px; }
  /* Block 27 defect 3: mockup 1 lays each feature card out as a ROW -- icon square
     on the left, title+body stacked to its right -- not icon-above-title (the base
     .ph-feature at line ~309 is flex-direction:column for mobile density). */
  .ph-feature { flex-direction: row; align-items: center; gap: 16px; padding: 22px 24px; font-size: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
  .ph-feature strong { display: block; font-size: 16px; margin-bottom: 4px; }
  .ph-feature span { font-size: 13px; line-height: 1.45; }
  /* Owner review 2026-09-22: icon read as a dot at 26px inside a dim 60px square.
     Mockup uses a ~72px coral-tinted square (soft bg + 1px coral-alpha border, faint
     glow) with a large ~36px coral stroke icon inside. Desktop only. */
  .ph-feature-icon-wrap {
    flex: 0 0 auto; width: 72px; height: 72px; border-radius: 18px; margin-bottom: 0;
    background: rgba(224,116,97,.14); border: 1px solid rgba(224,116,97,.38);
    box-shadow: 0 0 22px rgba(224,116,97,.16);
  }
  /* svg.ph-feature-icon (line ~29) sizes via 1em/font-size with higher specificity
     than a plain .ph-feature-icon width/height -- set font-size here too or the
     18px base wins and the icon stays tiny. */
  .ph-feature-icon { width: 36px; height: 36px; font-size: 36px; color: var(--accent); stroke: var(--accent); stroke-width: 1.8; }

  .ph-banner { display: none; }
  /* Block 27 defect 5: mockup 1 puts the handwriting annotation to the RIGHT of the
     "Conversations that grow with you" copy, INSIDE this section, occupying the
     right ~20% of its width, vertically centred -- not absolutely positioned above
     the section at the far edge (the old .ph-chat-preview-script had
     position:absolute; top:-48px). Adding a third grid column makes it a normal
     flex sibling of the copy column instead. */
  /* Block 29: the mock app window (rail/bubbles/photo) is gone -- replaced by a real
     screenshot of our own #/chat screen (tests/make_chat_snapshot.py ->
     generated/chat_snapshot.png). The frame is the LEFT column, sized to ~50% of the
     section per the mockup (window right edge lands near the section midpoint);
     the copy keeps ~1fr and the handwriting keeps its narrow trailing column. */
  /* Owner review 2026-09-22 (Block 30): 60% snapshot / 40% copy+handwriting -- was
     ~1.2fr/0.92fr/0.28fr (~50/37/13, and too tall). Nest copy+handwriting so their
     combined share is the trailing 40fr against the frame's 60fr. */
  .ph-chat-preview {
    display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 32px;
    align-items: center; margin: 48px 0 72px; padding: 0;
  }
  .ph-chat-preview-copy-wrap { display: grid; grid-template-columns: minmax(0, 30fr) minmax(0, 10fr); gap: 24px; align-items: center; }
  .ph-preview-frame {
    border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
    background: #1c1519; box-shadow: 0 18px 44px rgba(0,0,0,.42); line-height: 0;
  }
  /* width:100%/height:auto only -- no fixed height, no object-fit -- so the frame
     always follows the screenshot's real aspect and nothing can stretch. */
  .ph-preview-shot { display: block; width: 100%; height: auto; }

  .ph-chat-preview-copy { display: flex; flex-direction: column; gap: 12px; }
  .ph-chat-preview-copy h2 { margin: 0; font-size: 30px; line-height: 1.16; }
  .ph-chat-preview-copy p { margin: 0; max-width: 440px; color: rgba(255,255,255,.76); font-size: 14px; line-height: 1.55; }
  .ph-see-how { display: inline-flex; align-items: center; gap: 6px; padding: 12px 22px; border-radius: 999px; background: linear-gradient(90deg, #ef5f7a, #f0916a); color: #fff; font-weight: 700; width: fit-content; }
  .ph-chat-preview-script {
    display: block; justify-self: center; align-self: center;
    font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive;
    color: #f28ab0; font-size: 28px; line-height: 1.3; text-align: center;
    transform: rotate(-8deg);
  }
  .ph-chat-preview-script-heart { display: block; margin-top: 6px; font-size: 22px; }

  /* Companion profile: built to mockup 2 -- page-layouts/"ChatGPT Image Sep 21, 2026,
     10_02_50 PM (2).png". Gallery + thumbnails left, identity/bio/tags middle, stat
     panel far right, then feature cards, then About/Remembers/Moments in 3 columns. */
  .page-companion .pc-header { display: none; }
  .pc-topnav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 40px; border-bottom: 1px solid var(--line); }
  .page-companion .page-scroll { max-width: 1320px; margin: 0 auto; padding: 0 40px; }

  .pc-layout {
    display: grid; padding-top: 32px;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* equal thirds so the About / Remembers / Moments row lines up (owner 2026-09-29) */
    grid-template-areas:
      "gallery main stats"
      "features features features"
      "about remembers moments";
    column-gap: 28px; row-gap: 28px;
  }
  .pc-gallery-col { grid-area: gallery; }
  .pc-main-col { grid-area: main; display: flex; flex-direction: column; }
  .pc-stats-col { grid-area: stats; }
  .pc-info-cards { grid-area: features; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 8px 0 0; }
  .pc-about { grid-area: about; position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
  .pc-remembers { grid-area: remembers; padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
  .pc-moments { grid-area: moments; padding: 20px; border: 1px solid var(--line); border-radius: 14px; padding-bottom: 20px; margin-bottom: 48px; }
  .pc-about .pc-section-head, .pc-remembers .pc-section-head, .pc-moments .pc-section-head { padding: 0 0 10px; }
  .pc-about p, .pc-remembers-note { padding: 0; }

  .pc-carousel { aspect-ratio: 4/3.4; max-height: none; border-radius: 18px; }
  .pc-script-annotation {
    display: block; position: absolute; left: 16px; bottom: 44px; z-index: 1;
    font-family: "Brush Script MT", "Segoe Script", cursive; color: #fff; font-size: 15px;
    line-height: 1.25; text-shadow: 0 1px 10px rgba(0,0,0,.7);
  }
  .pc-thumbs { padding: 10px 0; flex-wrap: nowrap; }
  .pc-thumb { width: 64px; height: 64px; }

  .pc-identity-main h1 { font-size: 34px; }
  .pc-tagline { font-size: 16px; }
  .pc-bio { padding: 14px 0 0; }
  .pc-cta-row { padding: 0; }
  .pc-favorite { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 auto; }
  .pc-tags { padding: 16px 0 0; }

  .pc-stats { grid-template-columns: 1fr; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
  .pc-stats .pc-stat { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .pc-stats .pc-stat:last-child { border-bottom: 0; }

  .pc-about-script {
    display: block; position: absolute; right: 18px; top: 14px; font-family: "Brush Script MT", "Segoe Script", cursive;
    color: #ffb9d0; font-size: 13px; line-height: 1.2; text-align: right;
  }
  .pc-remembers-card, .pc-remembers-note { display: block; }
  .pc-remembers-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); margin-bottom: 10px; }
  .pc-remembers-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .pc-remembers-head img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
  .pc-remembers-head strong { font-size: 12px; }
  .pc-remembers-card p { margin: 0; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.85); }
  .pc-remembers-note { font-size: 12px; color: var(--muted); }

  .pc-moments-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; overflow: visible; }
  .pc-moments-row img { width: 100%; aspect-ratio: 3 / 4; height: auto; }
  .pc-moment { flex: none; min-width: 0; }
  .pc-moment figcaption { margin-top: 6px; font-size: 12px; }

  /* Sign in: built to mockup 3 -- page-layouts/"ChatGPT Image Sep 21, 2026,
     10_02_50 PM (3).png". Top bar + two-panel split in a rounded container. */
  .page-auth .page-scroll { max-width: none; margin: 0; padding: 0 40px 40px; }
  .pa-topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; }
  .pa-topbar-word { font-size: 20px; font-weight: 800; background: linear-gradient(90deg, #ff8a6b, #e0518f); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .pa-back { display: flex; align-items: center; gap: 8px; color: var(--paper); font-size: 14px; }

  .pa-split {
    display: grid; grid-template-columns: 1fr 1fr; max-width: 1180px; margin: 0 auto;
    border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: rgba(255,255,255,.02);
  }
  .pa-header, .pa-title, .pa-sub-mobile, .pa-footer-mobile { display: none; }
  .pa-form-title, .pa-sub-desktop, .pa-footer-desktop, .pa-footer-legal { display: block; }

  .pa-collage-panel { display: flex; flex-direction: column; justify-content: center; position: relative; padding: 44px; border-right: 1px solid var(--line); }
  .pa-collage-kicker { display: block; margin-bottom: 28px; font-size: 11px; font-weight: 650; letter-spacing: .12em; color: rgba(255,255,255,.7); line-height: 1.6; }
  /* Cards are tall portraits (mockup 3, ~3:4) so the 576x768 FLUX source isn't
     stretched. aspect-ratio + object-fit:cover with a fixed width (no height,
     no width:100%+height:auto) keeps faces undistorted regardless of card size
     (2026-09-22 fix -- landscape width/height pairs here previously widened faces). */
  .pa-collage { position: relative; height: 370px; margin-bottom: 28px; }
  .pa-collage-card { position: absolute; border-radius: 16px; aspect-ratio: 3 / 4; width: 260px; height: auto; object-fit: cover; object-position: center 25%; box-shadow: 0 14px 30px rgba(0,0,0,.45); border: 3px solid rgba(255,255,255,.9); }
  .pa-collage-1 { left: 8%; top: 10px; width: 260px; z-index: 2; transform: rotate(-3deg); }
  .pa-collage-2 { right: 2%; top: 0; width: 200px; z-index: 1; transform: rotate(4deg); }
  .pa-collage-3 { right: 6%; top: 103px; width: 200px; z-index: 1; transform: rotate(-2deg); }
  /* Mockup 3: this script sits in the empty margin left of the tilted photo card,
     not on top of it. left:-6px put it directly under card 1 (left:8%, width:62%),
     so the handwritten text and the photo overlapped and both became unreadable
     (2026-09-22). Card 1 doesn't start until ~8% + its own left inset, so keep the
     script inside the first ~26% of the collage width, below the kicker. */
  .pa-collage-script {
    position: absolute; left: 0; top: 96px; z-index: 3; max-width: 17%; font-family: "Brush Script MT", "Segoe Script", cursive;
    color: #ffb9d0; font-size: 13px; line-height: 1.35;
  }
  .pa-collage-caption {
    position: absolute; left: 14%; bottom: 8px; z-index: 3; font-family: "Brush Script MT", "Segoe Script", cursive;
    color: #fff; font-size: 13px; line-height: 1.25; text-shadow: 0 1px 8px rgba(0,0,0,.6);
  }
  .pa-collage-note {
    position: absolute; right: 0; bottom: -6px; z-index: 3; display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(20,16,16,.92);
    font-size: 10.5px; line-height: 1.35; box-shadow: 0 10px 24px rgba(0,0,0,.4);
  }
  .pa-collage-note svg { color: var(--accent); flex: 0 0 auto; }
  .pa-collage-title { margin: 0 0 8px; font-size: 40px; font-weight: 800; }
  .pa-collage-panel .pa-sub { margin-bottom: 20px; }
  .pa-collage-items { display: flex; flex-wrap: wrap; gap: 22px; font-size: 12px; color: rgba(255,255,255,.8); }
  .pa-collage-items span { display: flex; align-items: center; gap: 7px; }
  .pa-collage-items svg { color: var(--accent); }

  .pa-form-panel { padding: 48px; }
  .pa-form-title { margin: 0 0 8px; font-size: 32px; font-weight: 800; }
  .pa-form-panel .pa-sub { margin-bottom: 26px; }
  .pa-form { gap: 18px; }
  .pa-submit { padding: 14px; }
  .pa-footer-desktop { margin: 32px 0 4px; text-align: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .pa-footer-legal { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
  .pa-footer-legal a { color: var(--muted); margin: 0 4px; }
}

@media (max-width: 760px) {
  .rail, .app-header { display: none; }
  /* The mobile mockup goes straight from the CTA buttons to Featured Companions.
     The desktop hero image was only hidden in the 761-1100px block, so on a phone it
     rendered at aspect-ratio 4/5 full width (~537px tall) and pushed the whole
     companion grid below the fold (2026-09-22). */
  .ph-hero-art { display: none; }
  /* Full viewport on mobile: the rail and header are hidden, so the desktop
     calc(100% - 88px) sizing must be undone or the page sits 88px short. */
  .experience { display: block; position: relative; padding: 0; margin: 0; width: 100%; height: 100%; overflow-y: auto; }
  .scene {
    position: relative; margin: 0; border: 0; border-radius: 14px; overflow: hidden;
    height: 46vh; min-height: 220px; box-shadow: none;
  }
  .scene-shade { background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.22) 44%, rgba(0,0,0,.58)); }
  .scene-caption { left: 16px; bottom: 16px; }
  .scene-caption strong { font-size: 21px; }
  .scene-live-badge { display: none; }
  .moment-card { display: none; }
  .chat { position: relative; width: 100%; border: 0; background: #1c1519; }
  .profile-bar {
    min-height: 60px; padding-top: max(9px, env(safe-area-inset-top));
    background: #1c1519; border-bottom: 1px solid var(--line);
  }
  .mobile-back, .mobile-overflow, .mobile-gear { display: grid; }
  .get-to-know { display: none; }
  #btn-debug { width: 0; height: 0; min-width: 0; flex-basis: 0; border: 0; padding: 0; margin: 0; overflow: hidden; position: absolute; opacity: 0; pointer-events: none; }
  /* Same treatment as #btn-debug: the 60px mobile header has no room for two more
     circular buttons next to the name, and they're stubs anyway -- not worth the
     squeeze. Reachable later from mobile-overflow if the calls ever get built. */
  #btn-call, #btn-video { display: none; }
  .presence-dot { display: none; }
  #presence-status::before { content: "\25cf "; color: var(--online); font-size: 9px; }
  .avatar { width: 40px; height: 40px; flex-basis: 40px; }
  .messages { padding: 16px 11px 12px; }
  .msg { max-width: 88%; }
  .msg .body { background: rgba(72,54,68,.72); }
  .msg.user .body { background: rgba(105,15,34,.72); }
  /* At 88% max-width the off-bubble heart (right: -34px) would run past the viewport
     edge on assistant messages; pull it back onto the bubble corner instead. */
  .react-heart { right: 4px; bottom: -2px; background: rgba(28,21,25,.85); border-radius: 50%; }
  .composer { padding-left: 10px; padding-right: 10px; }
  .btn-image, #btn-image { border-radius: 10px; }
  .emoji-tool { display: none; }
}


/* Two-step sign-in: once a code has been emailed, the address and password are locked
   rather than cleared. Clearing them alone made the form look like it had reset itself
   and failed, with no sign a code was on its way (reported 2026-09-24). */
.is-locked {
  opacity: .55;
  cursor: not-allowed;
  background: color-mix(in srgb, currentColor 6%, transparent);
}
.pa-linkbtn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  border: 0;
  background: none;
  color: inherit;
  opacity: .7;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.pa-linkbtn:hover { opacity: 1; }

/* Home footer: Companies Act disclosure (name, number, registered office) + legal links.
   Added 2026-09-28; the auth pages carry the same text in .pa-footer-legal. */
.ph-footer { padding: 28px 16px 96px; font-size: 12px; line-height: 1.7; color: var(--muted); text-align: center; }
.ph-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 900px) {
  .page-home .ph-footer { max-width: 1800px; margin: 0 auto; padding: 36px 56px 40px; }
}

/* "More companions coming soon" page (placeholder tiles route here; owner 2026-09-29). */
.pa-soon { text-align: center; max-width: 520px; margin: 48px auto; }
.pa-soon-title { font-size: 26px; font-weight: 750; margin: 8px 0 12px; }
.pa-soon-sub { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 24px; }
.pa-soon-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Phone-only adjustments (owner 2026-09-29): the two recent moments centred under their heading.
   Block 68 (owner 2026-10-02): the chat snapshot card is back on the phone home, with its own
   phone-shaped screenshot (chat_snapshot_mobile.png, 390x844) in a narrow centred frame and the
   copy stacked below. Desktop rules above are untouched. */
@media (max-width: 760px) {
  .page-home .ph-chat-preview { display: flex; flex-direction: column; align-items: center; gap: 22px; margin: 28px 0 36px; padding: 0 20px; }
  .page-home .ph-preview-frame { width: min(300px, 82%); border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
    background: #1c1519; box-shadow: 0 14px 34px rgba(0,0,0,.42); line-height: 0; }
  .page-home .ph-preview-shot { display: block; width: 100%; height: auto; }
  .page-home .ph-chat-preview-copy-wrap { display: block; width: 100%; text-align: center; }
  .page-home .ph-chat-preview-copy { align-items: center; }
  .page-home .ph-chat-preview-copy h2 { font-size: 24px; }
  .page-home .ph-chat-preview-copy p { font-size: 14px; max-width: 340px; }
  .page-home .ph-chat-preview-script { display: none; }
  .pc-moments-row { justify-content: center; }
}

/* Phone chat layout (owner 2026-09-29): the still fills the whole screen, her avatar + name
   sit bottom-left over it, the messages occupy the lower half on top of the image, and the
   composer hugs the bottom. Scoped to the chat route so page overlays are unaffected. */
@media (max-width: 760px) {
  body[data-route="chat"] .experience { position: fixed; inset: 0; height: 100dvh; width: 100%; overflow: hidden; display: block; }
  body[data-route="chat"] .scene { position: absolute; inset: 0; height: 100%; min-height: 0; margin: 0; border-radius: 0; z-index: 0; background: #0f0b0d; }
  /* No crop: the still keeps its own proportions, pinned to the top; the space below it is
     black, and the shade fades from the picture's lower part into that black. */
  body[data-route="chat"] .scene-motion-frame img, body[data-route="chat"] .scene-motion-frame video,
  body[data-route="chat"] .scene > img,
  body[data-route="chat"] .scene .speech-video { width: 100%; height: 100%; object-fit: contain; object-position: center top; }
  body[data-route="chat"] .scene-caption { display: none; }
  body[data-route="chat"] .scene-shade { background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, transparent 22%, transparent 42%, rgba(15,11,13,.55) 58%, rgba(15,11,13,.92) 70%, #0f0b0d 82%); }
  /* Fixed to the real bottom (Safari's toolbar changes the viewport; dvh + fixed track it), no
     sideways scroll anywhere, and the list may rise to ~60 % of the screen with the oldest
     messages fading to nothing at the top so the picture shows through (owner 2026-09-29). */
  html, body[data-route="chat"], body[data-route="chat"] .experience { overflow-x: hidden; width: 100%; max-width: 100%; }
  /* Owner 2026-09-29: the i (details / reset) button is wanted on phones too: a third
     translucent circle left of the gear. Overrides the older zero-size mobile rule. */
  body[data-route="chat"] #btn-debug { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 114px; z-index: 6;
    width: 40px; height: 40px; min-width: 40px; flex-basis: auto; padding: 0; margin: 0; opacity: 1; pointer-events: auto; overflow: visible;
    border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: var(--paper); display: grid; place-items: center; font-style: italic; font-weight: 700; }
  body[data-route="chat"] #debug-panel { position: fixed; left: 8px; right: 8px; top: max(60px, calc(env(safe-area-inset-top) + 52px)); max-height: 60dvh; overflow: auto; z-index: 7; }
  body[data-route="chat"] .profile-bar .mobile-overflow { font-size: 22px; line-height: 1; }
  body[data-route="chat"] .chat { position: fixed; left: 0; right: 0; bottom: 0; height: 62dvh; max-height: 62dvh; width: 100%; background: transparent; z-index: 2; overflow: hidden; }
  body[data-route="chat"] .messages { overflow-x: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.35) 14%, #000 32%); mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.35) 14%, #000 32%); }
  body[data-route="chat"] .composer { flex: 0 0 auto; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  /* Avatar + name top-left, between the back and menu buttons (owner 2026-09-29). Phone only. */
  body[data-route="chat"] .profile-bar { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 60px; right: 60px; z-index: 6;
    background: transparent; border: 0; min-height: 0; padding: 4px 0; }
  body[data-route="chat"] .profile-bar .avatar { box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
  body[data-route="chat"] .profile-copy h1 { text-shadow: 0 1px 10px rgba(0,0,0,.85); }
  body[data-route="chat"] #presence-status { text-shadow: 0 1px 8px rgba(0,0,0,.85); }
  body[data-route="chat"] .profile-bar .mobile-back { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; z-index: 6; background: rgba(0,0,0,.45); }
  body[data-route="chat"] .profile-bar .mobile-overflow { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 6; background: rgba(0,0,0,.45); }
  body[data-route="chat"] .messages { flex: 1 1 auto; padding: 6px 11px 8px; background: transparent; }
  body[data-route="chat"] .msg .body { background: rgba(48,36,44,.82); backdrop-filter: blur(6px); }
  body[data-route="chat"] .msg.user .body { background: rgba(105,15,34,.82); }
  body[data-route="chat"] .composer { background: rgba(20,15,18,.94); border-top: 1px solid rgba(255,255,255,.08); }
}

/* Preferences (owner 2026-09-29): "Show her picture in the chat" off = text-only chat; the
   chat takes the whole width on desktop and the whole screen on phones. */
body.no-scene .scene { display: none; }
@media (min-width: 761px) { body.no-scene .experience { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  body.no-scene[data-route="chat"] .chat { height: 100dvh; max-height: 100dvh; padding-top: 64px; background: #151313; }
  body.no-scene[data-route="chat"] .messages { -webkit-mask-image: none; mask-image: none; }
  body[data-route="chat"] .profile-bar .mobile-gear { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 62px; z-index: 6; background: rgba(0,0,0,.45); font-size: 18px; }
}
.account-prefs .pa-check { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.account-prefs-note { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

/* The account page is a fixed full-screen layer with no scroll container of its own: on a
   desktop window shorter than the card (~1100px) "Start fresh" and everything below the
   password form was unreachable. (The phone rule below predates this.) */
#page-account { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* iPhone fixes (owner 2026-09-29). 1) Safari zooms the page when a focused field's font is
   under 16px and leaves it zoomed after the keyboard closes = "stretched, scrolls sideways".
   2) The account page had no scroll container, so its lower half was unreachable on phones. */
@media (max-width: 760px) {
  .composer textarea, .pa-form input, .pa-form textarea, .pa-form select { font-size: 16px; }
  #page-account { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #page-account .pa-card { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}

/* Phone chat menu (owner 2026-09-29): a single "⋮" top-right; the three actions slide down
   under it. The three separate fixed buttons are hidden on phones in favour of this. */
@media (max-width: 760px) {
  body[data-route="chat"] .profile-bar .mobile-overflow, body[data-route="chat"] .profile-bar .mobile-gear, body[data-route="chat"] #btn-debug { display: none; }
  body[data-route="chat"] .mobile-menu-wrap { display: block; position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 7; }
  body[data-route="chat"] .mobile-menu { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); color: var(--paper); display: grid; place-items: center; font-size: 22px; line-height: 1; border: 0; }
  body[data-route="chat"] .mobile-menu-sheet { position: absolute; top: 48px; right: 0; display: flex; flex-direction: column; gap: 8px;
    animation: mm-drop .16s ease-out; }
  body[data-route="chat"] .mobile-menu-sheet[hidden] { display: none; }
  body[data-route="chat"] .mobile-menu-item { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.55); color: var(--paper); border: 0;
    display: grid; place-items: center; font-size: 18px; line-height: 1; }
  body[data-route="chat"] #mm-details { font-style: italic; font-weight: 700; }
  @keyframes mm-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* --- logged-in home, profile page, chat "Home" link (/, /<id>, /<id>/chat) --- */
.ph-authed-only { display: none; }
body.authed .ph-authed-only { display: block; }
body.authed .ph-cta-row.ph-authed-only { display: flex; }
.ph-welcome { margin: 0 0 12px; }
.ph-welcome .ph-sub { margin: 4px 0 0; }
body.authed .ph-guest-only { display: none !important; }
.chat-home-link { color: var(--paper); font-size: 14px; }
.page-profile .pp-layout { max-width: 960px; margin: 0 auto; padding: 0 0 32px; display: flex; flex-direction: column; }
.pp-photo { aspect-ratio: 4/5; max-height: 52vh; background: #201c1c; overflow: hidden; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.pp-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pp-body h1 { margin: 0; font-size: 28px; }
.pp-tagline { margin: 0; color: var(--accent); font-weight: 600; }
.pp-about { margin: 0; color: rgba(255,255,255,.82); line-height: 1.5; }
.pp-facts { margin: 4px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.pp-facts dt { color: var(--muted); }
.pp-facts dd { margin: 0; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: rgba(255,255,255,.8); }
.pp-chat { align-self: stretch; margin-top: 8px; }
.pp-chat:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.35); }
.pp-media { display: flex; flex-direction: column; min-width: 0; }
.pp-photo { position: relative; }
.pp-pending { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.6); font-size: 12px; color: rgba(255,255,255,.85); }
.pp-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px 0; -webkit-overflow-scrolling: touch; }
.pp-thumb { flex: 0 0 56px; height: 80px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #201c1c; cursor: pointer; }
.pp-thumb.active { border-color: var(--accent); }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-sec { align-self: stretch; }
.pp-sec h2 { margin: 6px 0 6px; font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pp-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: rgba(255,255,255,.85); line-height: 1.45; }
@media (min-width: 900px) {
  .page-profile .pp-layout { flex-direction: row; gap: 32px; padding: 24px 40px 40px; }
  .pp-media { flex: 0 0 380px; }
  .pp-photo { max-height: none; border-radius: 16px; }
  .pp-thumbs { padding: 10px 0 0; }
  .pp-body { flex: 1 1 auto; padding: 8px 0; }
  .pp-chat { align-self: flex-start; min-width: 240px; }
}

/* Brief 223 — heart meter: a heart that fills within a stage, plus one word. */
.rel-meter {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 3px;
  color: var(--muted); font-size: 11px; line-height: 1; letter-spacing: .01em;
}
.rel-meter-profile { margin: 12px 0 2px; gap: 10px; font-size: 14px; color: var(--paper); }
.rel-heart {
  position: relative; display: inline-block; flex: 0 0 auto;
  width: var(--rel-heart-size, 20px); height: var(--rel-heart-size, 20px);
}
.rel-meter-profile { --rel-heart-size: 36px; }
.rel-heart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rel-heart-outline { fill: none; stroke: currentColor; stroke-width: 1.7; opacity: .75; }
.rel-heart-clip {
  position: absolute; left: 0; bottom: 0; width: 100%;
  height: var(--rel-fill, 0%); overflow: hidden;
}
.rel-heart .rel-heart-solid {
  position: absolute; left: 0; bottom: 0; width: 100%;
  height: var(--rel-heart-size, 20px); fill: #e0577f;
}
.rel-crack, .rel-stitch {
  fill: none; stroke: #ffd7e2; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; display: none;
}
.rel-meter[data-status="cooling"] .rel-crack,
.rel-meter[data-status="fallen_out"] .rel-crack { display: block; }
.rel-meter[data-status="mending"] .rel-stitch { display: block; }
.rel-meter[data-status="fallen_out"] .rel-heart-solid { opacity: .45; }
.rel-meter[data-anger="annoyed"] .rel-heart-solid { fill: #e08a57; opacity: .75; }
.rel-meter[data-anger="upset"] .rel-heart-solid,
.rel-meter[data-anger="angry"] .rel-heart-solid { fill: #e0455f; }
.rel-meter[data-anger="angry"] .rel-heart-outline { stroke: #ff9b92; opacity: 1; }

/* Chat still picker (Block 73): a strip that slides out of the chat-header avatar to its right.
   --still-size / --still-width are set from the avatar's rendered size by openStillPicker(). */
.profile-bar { position: relative; }
.still-strip {
  position: absolute; z-index: 8; width: 0; overflow: hidden; border-radius: 999px;
  background: var(--glass-strong); box-shadow: 0 4px 18px rgba(0,0,0,.45);
  transition: width .2s ease;
}
.still-strip[hidden] { display: none; }
.still-strip.open { width: var(--still-width); }
.still-strip-list { display: flex; flex-wrap: nowrap; gap: 4px; padding: 3px; width: max-content; }
.still-item {
  flex: 0 0 var(--still-size); width: var(--still-size); height: var(--still-size); padding: 0;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center; cursor: pointer;
  color: var(--paper); background: #3c3030; border: 2px solid rgba(255,255,255,.35);
}
.still-item img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  transform: scale(1.8); transform-origin: 50% 18%; }   /* the stills are full-body: zoom to the face */
.still-item:hover, .still-item:focus-visible { border-color: rgba(255,255,255,.85); outline: none; }
.still-item[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.still-item-profile { font: italic 700 20px/1 Georgia, serif; background: rgba(255,255,255,.1); }
@media (prefers-reduced-motion: reduce) { .still-strip { transition: none; } }

/* "Away" (amber) for coming-soon personas: landing tile + profile tag (owner 2026-10-02) */
.ph-tile-status[data-status="away"] .live-dot,
.pc-online-tag[data-status="away"] .live-dot { background: #e0b04a; box-shadow: 0 0 0 3px rgba(224,176,74,.18); }
.pc-online-tag[data-status="away"] { color: #e0b04a; }

/* Owner 2026-10-02: the chat's slide-down menu (details / settings / close) existed on phones
   only; desktop had no equivalent in the chat header. Same markup, shown in the profile bar. */
@media (min-width: 761px) {
  body[data-route="chat"] .mobile-menu-wrap { display: block; position: relative; margin-left: 4px; }
  body[data-route="chat"] .mobile-menu { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    font-size: 20px; line-height: 1; }
  body[data-route="chat"] .mobile-menu-sheet { position: absolute; top: 46px; right: 0; z-index: 20; display: flex;
    flex-direction: column; gap: 8px; animation: mm-drop .16s ease-out; }
  body[data-route="chat"] .mobile-menu-sheet[hidden] { display: none; }
  body[data-route="chat"] .mobile-menu-item { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.55);
    color: var(--paper); border: 0; display: grid; place-items: center; font-size: 17px; line-height: 1; }
  body[data-route="chat"] #mm-details { font-style: italic; font-weight: 700; }
}
@keyframes mm-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* In-page confirm (app.js confirmDialog, 2026-10-05). Replaces window.confirm for Start
   fresh: native confirms are auto-dismissed by automated browsers and some mobile webviews. */
.confirm-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5);
  display: grid; place-items: center; padding: 16px; }
.confirm-dialog { background: var(--paper, #fff); color: inherit; width: min(420px, 100%);
  border-radius: 14px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.confirm-title { margin: 0 0 8px; font-size: 19px; }
.confirm-message { margin: 0 0 18px; line-height: 1.45; white-space: pre-line; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.confirm-actions button { padding: 9px 16px; border-radius: 999px; border: 1px solid currentColor;
  background: transparent; color: inherit; font: inherit; cursor: pointer; }
.confirm-actions button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.confirm-actions .confirm-ok { background: #b23; color: #fff; border-color: #b23; }

/* Brief 034: "See How It Works" explainer dialog (native <dialog>). */
#how-it-works-dialog { width: min(520px, 100%); border: none; border-radius: 14px;
  padding: 22px; color: inherit; }
#how-it-works-dialog::backdrop { background: rgba(0,0,0,.5); }
#how-it-works-dialog h2 { margin: 0 0 12px; font-size: 20px; }
.how-it-works-list { margin: 0 0 18px; padding-left: 18px; line-height: 1.5; }
.how-it-works-list li { margin: 0 0 8px; }
#how-it-works-close { padding: 9px 18px; border-radius: 999px; border: none; cursor: pointer; }

/* ===== Brief 234 — the remaining designed screens (home, chat, menu, profile,
   sign-in/forgot, account). Structure and hierarchy from briefs/design/234/project;
   colours reuse the app's own tokens. Nothing here resizes the desktop portrait pane. */

/* --- 234.1 Home: "Waiting for you", plan line, upgrade band ----------------- */
.home-waiting { display: flex; flex-direction: column; gap: 14px; margin: 24px 0 8px; }
.home-waiting-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; }
.home-waiting-head h1 { margin: 0; font-size: 26px; font-weight: 700; }
.home-plan-line { font-size: 13px; color: #b8a9a3; }
.home-plan-upgrade { color: #f6a3b9; }
.home-waiting-rows { display: flex; gap: 16px; flex-wrap: wrap; }
.home-waiting-row { flex: 1 1 320px; display: flex; align-items: center; gap: 14px;
  min-width: 0; padding: 14px 16px; border: 1px solid #2b2125; border-radius: 16px;
  background: #1a1316; color: inherit; text-decoration: none; }
.home-waiting-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  object-position: 50% 20%; flex: none; }
.home-waiting-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.home-waiting-copy strong { font-size: 15px; font-weight: 600; }
.home-waiting-sub { font-size: 14px; color: #b8a9a3; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.home-waiting-dot { width: 10px; height: 10px; border-radius: 50%; background: #f0567a; flex: none; }

.home-upgrade-band { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 32px 0 8px; padding: 20px 24px;
  border: 1px solid #2b2125; border-radius: 16px; background: #1a1316; }
.home-upgrade-copy { display: flex; flex-direction: column; gap: 4px; }
.home-upgrade-copy span { font-size: 14px; color: #b8a9a3; }
.home-upgrade-cta { padding: 12px 20px; border-radius: 999px; text-decoration: none;
  white-space: nowrap; }

/* 4 columns on desktop, 2 on a phone (Home/HomePhone). The grid renderer is untouched. */
#home-companion-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px; }
.ph-tile-locked { opacity: .75; }
.ph-tile-lock { display: inline-flex; align-items: center; gap: 6px; }
.ph-tile-lock .btn-svg { width: 12px; height: 12px; }

/* Brief 248.3: plan lock states and the current tier. The state itself comes from
   /api/me, never from a plan table in the client. */
.plan-locked { opacity: .6; cursor: pointer; }
.plan-locked:hover, .plan-locked:focus-visible { opacity: .85; }
.plan-tier.current { outline: 2px solid #f27a9b; outline-offset: 2px; }

/* Brief 258.3: the Yearly button carries a "Coming soon" pill beside its label. In the
   minified plans style sheet the pill sat inside the 999px button with no gap and no line
   height of its own, so its box overlapped the word "Yearly". It gets its own inline box,
   a gap and nowrap here (a higher-specificity rule than the inline `.plans-toggle span`),
   and the button is a flex row so the two never share a line box. */
.plans-page .plans-toggle button { display: inline-flex; align-items: center;
  gap: 8px; line-height: 1.2; }
.plans-toggle button span { display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: 999px; background: rgba(242, 122, 155, .18); color: #f6a3b9;
  font-size: 10px; font-weight: 600; line-height: 1.4; letter-spacing: .02em;
  white-space: nowrap; }
/* The yearly figure is longer than the monthly one; keep the price row on one line. */
.plan-price { white-space: nowrap; }

/* --- 234.2 Chat header, portrait overlay, composer ------------------------- */
.chat-profile-link { font-size: 13px; color: #b8a9a3; text-decoration: none;
  align-self: flex-start; }
.chat-profile-link:hover { color: #f6a3b9; }
.chat-quota { font-size: 13px; color: #b8a9a3; padding-right: 6px; white-space: nowrap; }
.profile-bar { flex-wrap: wrap; }
/* 234.8: quiet mode and the old speaker are one control over one preference, so the header
   draws ONE mute icon. Dim while voice is on, solid while text-only is engaged. */
.chat-quiet { opacity: .55; }
.chat-quiet.on { opacity: 1; }

.scene-overlay { position: absolute; left: 0; right: 0; bottom: 124px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 0 22px; pointer-events: none; }
.scene-overlay > * { pointer-events: auto; }
.scene-overlay-kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: #d9cdc8; }
.scene-overlay-line { font-size: 15px; font-weight: 600; color: #f3ece8;
  text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.scene-overlay .rel-meter { margin: 0; }
.scene-today-picture { display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid #3a2d31; border-radius: 12px;
  background: rgba(26,19,22,.9); color: #f3ece8; font-size: 13px; text-decoration: none; }

/* --- 234.3 Chat menu: panel on desktop, bottom sheet on phone --------------- */
.chat-menu { position: fixed; top: 76px; right: 20px; z-index: 60;
  width: 340px; max-height: calc(100vh - 100px); overflow: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 10px;
  border: 1px solid #3a2d31; border-radius: 16px; background: #1a1316;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.chat-menu[hidden] { display: none; }
.chat-menu-handle { display: none; }
.chat-menu-head { display: flex; align-items: center; gap: 12px; padding: 6px 4px 12px; }
.chat-menu-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  object-position: 50% 20%; flex: none; }
.chat-menu-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.chat-menu-stage { font-size: 12px; color: #b8a9a3; }
.chat-menu-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px;
  border-radius: 10px; color: inherit; font-size: 14px; text-decoration: none; }
.chat-menu-item:hover { background: #2a1a20; }
.chat-menu-item .btn-svg { width: 18px; height: 18px; flex: none; color: #b8a9a3; }
.chat-menu-item > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-menu-sub { font-size: 12px; color: #b8a9a3; }
.chat-menu-divider { height: 1px; margin: 4px 8px; background: #2b2125; }
.chat-menu-row { align-items: center; justify-content: space-between; }
.chat-menu-row-copy { display: flex; align-items: flex-start; gap: 12px; }
.chat-menu-row-copy > span { display: flex; flex-direction: column; gap: 2px; }
.chat-menu-pace { flex-direction: column; align-items: stretch; gap: 8px; }
.chat-menu-pace .pace-toggle { margin-top: 0; width: 100%; }
.chat-menu-report { color: #b8a9a3; }
.chat-switch { width: 44px; height: 26px; border-radius: 999px; background: #3a2d35;
  position: relative; flex: none; border: 0; cursor: pointer; padding: 0; }
.chat-switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #b8a9a3; transition: left .15s ease; }
.chat-switch.on { background: #f0567a; }
.chat-switch.on span { left: 21px; background: #1a0a10; }

/* --- 234.4 Companion profile: memories and pictures ----------------------- */
.pp-sec-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.pp-sec-note { font-size: 12px; color: #b8a9a3; }
.pp-pictures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pp-picture { padding: 0; border: 0; background: none; cursor: pointer; }
.pp-picture img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 15%;
  border-radius: 10px; display: block; }
.pp-chip-muted { color: #b8a9a3; }
/* 261.2: the memories overflow pill is a real button (keyboard reachable, aria-expanded). */
.pp-chip-more { font: inherit; background: none; cursor: pointer; }
.pp-chip-more:hover { border-color: #f27a9b; color: #f3ece8; }
.pp-chip-more:focus-visible { outline: 2px solid #f27a9b; outline-offset: 2px; }

/* --- 234.5 Forgot password view ------------------------------------------ */
.forgot-card { display: flex; flex-direction: column; gap: 18px; width: min(440px, 100%);
  margin: 6vh auto; }
.forgot-back { align-self: flex-start; font-size: 14px; }
.forgot-sent { display: flex; flex-direction: column; gap: 8px; padding: 18px;
  border: 1px solid #2b2125; border-radius: 16px; background: #1a1316; }
.forgot-sent h2 { margin: 0; font-size: 20px; }
.forgot-sent p { margin: 0; font-size: 14px; line-height: 1.5; color: #b8a9a3; }

/* --- 234.6 Account: identity row and design rows -------------------------- */
.account-identity { display: flex; align-items: center; gap: 14px; }
.account-identity-avatar { width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: #3a2d31; }
.account-identity-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-identity-copy strong { font-size: 20px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid #2b2125; font-size: 15px; }
.account-row:last-of-type { border-bottom: 0; }
.account-row-copy { display: flex; flex-direction: column; gap: 2px; }
.account-row-sub { font-size: 13px; color: #b8a9a3; }
.account-row-action { padding: 9px 16px; border-radius: 999px; text-decoration: none;
  white-space: nowrap; }

@media (max-width: 900px) {
  #home-companion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-waiting-head h1 { font-size: 22px; }
  .home-waiting-rows { gap: 10px; }
  .home-waiting-row { padding: 12px; }
  .home-waiting-avatar { width: 48px; height: 48px; }
  .home-upgrade-band { flex-direction: column; align-items: stretch; }
  .home-upgrade-cta { text-align: center; }
  /* The phone chat menu is a bottom sheet, per MenuPhone.dc.html. */
  .chat-menu { top: auto; bottom: 0; left: 0; right: 0; width: auto;
    max-height: 82vh; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 10px 20px max(20px, env(safe-area-inset-bottom)); }
  .chat-menu-handle { display: block; width: 40px; height: 4px; margin: 0 auto 8px;
    border-radius: 2px; background: #3a2d31; }
  .chat-menu-item { padding: 13px 4px; border-bottom: 1px solid #2b2125; border-radius: 0; }
  .chat-menu-item:hover { background: none; }
  .chat-menu-divider { display: none; }
  /* On a phone the portrait pane is decorative and the thread covers it: the quota and the
     heart meter already sit in the header, so the overlay's own copy is not repeated over
     the conversation (ChatPhone keeps one meter line, not two). */
  .scene-overlay { display: none; }
  .pp-pictures { gap: 6px; }
}

/* --- Brief 257: first paint ------------------------------------------------ */
/* 257.3: neutral placeholder under every picture while it decodes; the image fades in on
   its own load event. A slow or missing file leaves the tile, never a black rectangle. */
.img-loading { opacity: 0; }
.img-loaded { opacity: 1; transition: opacity .25s ease; }
.scene, .pp-photo, .pp-thumb, .ph-tile {
  background-image: linear-gradient(135deg, #2b2125 0%, #1a1316 55%, #2b2125 100%);
}
.scene-motion-frame {
  background-image: linear-gradient(135deg, #2b2125 0%, #1a1316 55%, #2b2125 100%);
}
body[data-route="chat"] .scene { background-color: #21171b; }

/* 257.4: dimmed skeleton bars on the account identity until /api/me and the email read
   resolve. No empty field, no differently shaped avatar. */
.account-pending .account-identity-avatar,
.account-pending #account-identity-name,
.account-pending #account-identity-email,
.account-pending #account-email {
  color: transparent !important;
  border-color: transparent !important;
  background: linear-gradient(90deg, #2b2125 25%, #3a2d31 37%, #2b2125 63%);
  background-size: 400% 100%;
  animation: account-shimmer 1.4s ease infinite;
}
.account-pending #account-identity-name { display: inline-block; width: 168px; border-radius: 6px; }
.account-pending #account-identity-email,
.account-pending #account-email { border-radius: 6px; }
#account-email { width: 100%; }
.account-identity-copy #account-identity-email { overflow-wrap: anywhere; }
@keyframes account-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .account-pending .account-identity-avatar,
  .account-pending #account-identity-name,
  .account-pending #account-identity-email,
  .account-pending #account-email { animation: none; }
}

/* 257.5: the plan line ellipsizes its middle segment; Upgrade never shrinks or clips. */
.home-plan-line { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; }
.home-plan-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-plan-sep, .home-plan-upgrade { flex: none; white-space: nowrap; }

