/* Waffles' window — the viewer stylesheet (design/viewer.css, adopted).
   Plain CSS, no build step. Every colour and size comes from tokens.css.
   Class names are the contract with DESIGN.md; the page-only section at the
   end styles the VIEWER-CONTRACT §4.1 ids the design has no component for.
   Layout: the world (three.js canvas, or the map) fills the viewport; a
   header pill floats at the top; a journal sheet rises from the bottom in
   three states (peek / half / full); a chat bar is pinned under it. On wide
   screens the sheet becomes a side panel and the world takes the rest. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
code { font-family: inherit; background: var(--card-2); padding: 0 6px; border-radius: 6px; }
q { quotes: "“" "”"; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- his face (shared <symbol id="i-face">) ----------
   The symbol carries three mouths, two eye sets and brows; tokens.css sets
   the --mouth, --eyes and --brows switches per mood so one drawing serves every state. */
.face { display: block; width: 40px; height: 40px; flex: none; }

/* ---------- the world ---------- */
.world {
  position: fixed; inset: 0;
  background: var(--sky);
  overflow: hidden;
}
.world canvas, .world .scene, .world picture, .world img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover;
}
/* a name tag over him; the page sets --tag-x/--tag-y from the projection */
.world-tag {
  position: absolute;
  left: var(--tag-x, 50%); top: var(--tag-y, 50%);
  transform: translate(-50%, -100%);
  padding: 4px 11px 5px;
  background: var(--tag-bg); color: var(--tag-ink);
  font-size: var(--fs-meta); font-weight: 800; letter-spacing: .02em; line-height: 1.2;
  border-radius: 999px; white-space: nowrap; pointer-events: none;
}
.world-tag::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--tag-bg); border-bottom: 0;
}
/* honest note when the 3D view can't run (shown with [data-view="map"]) */
.world-note {
  position: absolute; left: var(--gutter); right: var(--gutter);
  top: calc(var(--pill-top) + var(--pill-h) + 12px);
  padding: 8px 14px; border-radius: 14px;
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-soft);
  font-size: var(--fs-small); text-align: center;
}
.world[data-view="3d"] .world-note { display: none; }

/* ---------- header pill ---------- */
.pill {
  position: fixed; z-index: 30;
  top: var(--pill-top); left: 50%; transform: translateX(-50%);
  height: var(--pill-h); max-width: calc(100% - 2 * var(--gutter));
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 6px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  white-space: nowrap;
}
.pill-name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-name); line-height: 1; padding-top: 2px; }
.pill-needs { display: flex; gap: 10px; margin-left: 2px; padding-left: 12px; border-left: 2px dotted var(--line); }
.pill-need {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--level, var(--ink-2));
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.pill-need svg { width: 22px; height: 22px; flex: none; }

/* ---------- the sheet ----------
   Height-based: `top` moves between the three states, so every state scrolls
   to the end of its content and nothing hides behind the chat bar. */
.sheet {
  position: fixed; z-index: 20;
  left: 0; right: 0;
  top: var(--sheet-top-full);
  bottom: calc(var(--chat-h) + var(--safe-b));
  background: var(--paper);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex; flex-direction: column;
  transition: top var(--dur) var(--ease);
  touch-action: none;
}
.sheet[data-state="peek"] { top: calc(100% - var(--chat-h) - var(--safe-b) - var(--peek-h)); }
.sheet[data-state="half"] { top: var(--sheet-top-half); }
.sheet[data-state="full"] { top: var(--sheet-top-full); }
.sheet.is-dragging { transition: none; }

/* the handle: grip + the Right-now strip; tap or drag anywhere on it */
.handle {
  flex: none; appearance: none; border: 0; background: transparent; color: inherit;
  width: 100%; padding: 8px var(--gutter) 10px; text-align: left; cursor: grab;
  display: flex; flex-direction: column; gap: 6px; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
}
.handle:active { cursor: grabbing; }
.handle:focus-visible { outline-offset: -3px; }
.grip { width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 2px; }
.now-eyebrow { font-size: var(--fs-meta); font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.now { display: flex; align-items: center; gap: 12px; }
.now .face { width: 48px; height: 48px; }
.now-body { flex: 1; min-width: 0; }
.now-goal {
  display: block; font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: var(--fs-goal); line-height: 1.15; text-wrap: balance;
  font-variation-settings: "SOFT" 100, "opsz" 36;
}
.now-step { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: var(--fs-small); color: var(--ink-2); min-width: 0; }
.now-step b { color: var(--sage-ink); font-weight: 800; white-space: nowrap; }
.now-step .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segs { display: inline-flex; gap: 3px; flex: none; }
.segs i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.segs i.is-done { background: var(--sage); }
.segs i.is-running { background: var(--mood); }

/* the pages */
.pages {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding: 2px var(--gutter) 32px;
  display: flex; flex-direction: column; gap: 14px;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}
.sheet[data-state="peek"] .pages { overflow: hidden; }

.page {
  position: relative; background: var(--card); border-radius: var(--radius);
  padding: 18px 18px 22px; box-shadow: var(--shadow-soft);
}
.page::after { /* storybook page number from data-page */
  content: attr(data-page); position: absolute; right: 16px; bottom: 9px;
  font-family: var(--font-display); font-style: italic; font-size: var(--fs-meta); color: var(--muted);
}
.page-title {
  font-size: var(--fs-title); font-weight: 800; font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 48; margin-bottom: 4px;
}
.rule {
  height: 10px; margin: 6px 0 14px; background: var(--line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C 20 2, 40 9, 62 5 S 100 2, 122 6 S 160 9, 182 4 S 222 3, 238 6' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C 20 2, 40 9, 62 5 S 100 2, 122 6 S 160 9, 182 4 S 222 3, 238 6' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.rule--mood { background: var(--mood); opacity: .8; }
.lede { font-size: var(--fs-small); color: var(--ink-2); }
.meta { font-size: var(--fs-meta); color: var(--muted); }
.kicker { font-family: var(--font-text); font-size: var(--fs-meta); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.kicker:first-of-type { margin-top: 0; }

/* ---- how he feels ---- */
.mood { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.mood .face { width: 112px; height: 112px; }
.mood-word {
  font-family: var(--font-display); font-size: var(--fs-mood); font-weight: 800; line-height: 1;
  font-variation-settings: "SOFT" 100, "opsz" 72; color: var(--mood);
}
.mood-strength { display: inline-flex; align-items: center; gap: 4px; margin: 8px 0 6px; }
.mood-strength i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.mood-strength i.on { background: var(--mood); }
.mood-strength small { margin-left: 6px; color: var(--muted); font-size: var(--fs-meta); }
.mood-because { font-size: var(--fs-small); color: var(--ink-2); font-style: italic; }
.needs { display: grid; gap: 10px; margin-top: 18px; }
.need { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.need p { font-size: var(--fs-small); color: var(--ink-2); padding-top: 4px; }
.stamp {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  border: 1.5px solid var(--level, var(--line)); color: var(--level, var(--ink-2));
  background: color-mix(in srgb, var(--level, var(--line)) 14%, var(--card-2));
  font-size: 14px; font-weight: 800;
}
.need:not([data-level]) .stamp { border-style: dashed; }
.stamp svg { width: 20px; height: 20px; }

/* ---- what he is doing ---- */
.goal-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.2; text-wrap: balance; font-variation-settings: "SOFT" 100, "opsz" 36; }
.goal-origin { font-size: var(--fs-meta); color: var(--muted); font-style: italic; margin-top: 2px; }
.steps { margin-top: 14px; display: grid; gap: 9px; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; font-size: 16px; }
.step-box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); margin-top: 1px; display: grid; place-items: center; color: var(--sage-ink); }
.step-box svg { width: 16px; height: 16px; }
.step.is-done .step-box { border-color: var(--sage); background: var(--sage-soft); }
.step.is-done .step-text { color: var(--muted); }
.step.is-running .step-box { border-color: var(--mood); background: color-mix(in srgb, var(--mood) 22%, var(--card)); color: var(--mood); }
.step.is-running .step-text { font-weight: 800; }
.step.is-failed .step-box { border-color: var(--alarm); color: var(--alarm); }
.step-state { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 4px; white-space: nowrap; }
.step.is-running .step-state { color: var(--mood); }
.step.is-done .step-state { color: var(--sage-ink); }
.goal-why { margin-top: 14px; padding-top: 12px; border-top: 2px dotted var(--line); font-size: var(--fs-small); color: var(--ink-2); }
.goal-why b { font-family: var(--font-display); font-style: italic; font-weight: 700; color: var(--ink); }

/* ---- what his mind decided ---- */
.mind-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.mind-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--honey); box-shadow: 0 0 0 4px var(--honey-soft); }
body[data-mind="ok"] .mind-status::before { background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
body[data-mind="down"] .mind-status::before { background: var(--alarm); box-shadow: 0 0 0 4px var(--alarm-soft); }
.entries { display: grid; gap: 12px; }
.entry { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.entry-kind { font-family: var(--font-display); font-style: italic; font-size: var(--fs-small); color: var(--terracotta); padding-top: 2px; min-width: 74px; }
.entry-text { font-size: 16px; }
.entry .when { display: block; }

/* ---- agenda ---- */
.agenda { display: grid; gap: 8px; }
.agenda-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: 16px; }
.agenda-item::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--terracotta); margin-top: 8px; }
.agenda-item.is-someday::before { background: transparent; border: 2px dashed var(--muted); width: 12px; height: 12px; margin-top: 7px; }
.agenda-item.is-paused::before { background: var(--honey); }
.agenda-origin { display: block; font-size: var(--fs-meta); color: var(--muted); font-style: italic; }
.agenda-origin::before { content: "— "; }

/* ---- recent moments ---- */
.moments { position: relative; padding-left: 4px; }
.moments::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 14px; border-left: 2px dashed var(--line); }
.moment { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 7px 0; }
.moment-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--card-2); border: 2px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.moment-icon svg { width: 15px; height: 15px; }
.moment[data-kind="built"] .moment-icon { color: var(--terracotta); border-color: var(--terracotta-soft); background: var(--terracotta-soft); }
.moment[data-kind="found"] .moment-icon { color: var(--honey-ink); border-color: var(--honey-soft); background: var(--honey-soft); }
.moment[data-kind="ate"] .moment-icon { color: var(--sage-ink); border-color: var(--sage-soft); background: var(--sage-soft); }
.moment-text { font-size: 16px; padding-top: 2px; }
.moment .when { padding-top: 6px; white-space: nowrap; }
.when { font-size: 12px; color: var(--muted); }

/* ---- messages ---- */
.waiting { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.waiting::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--honey); box-shadow: 0 0 0 4px var(--honey-soft); flex: none; }
.letters { display: grid; gap: 12px; }
.letter { position: relative; background: var(--card-2); border-radius: 16px; padding: 12px 14px; font-size: 16px; }
.letter-from { font-family: var(--font-display); font-style: italic; font-weight: 700; color: var(--terracotta); margin-right: 6px; }
.letter--reply { background: color-mix(in srgb, var(--mood) 18%, var(--card-2)); margin-left: 20px; }
.letter--reply .letter-from { color: var(--ink-2); }
.letter .when { display: block; margin-top: 4px; }
.leave { margin-top: 16px; padding-top: 14px; border-top: 2px dotted var(--line); display: grid; gap: 8px; }
.leave label { font-size: var(--fs-meta); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.leave input, .leave textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card-2);
  padding: 10px 12px; resize: none; font-size: 16px;
}
.leave input::placeholder, .leave textarea::placeholder, .chat input::placeholder { color: var(--muted); }
.leave-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.leave-hint { font-size: var(--fs-meta); color: var(--muted); font-style: italic; }
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 10px 18px;
  background: var(--terracotta); color: var(--on-terracotta); font-weight: 800; font-size: var(--fs-small);
  box-shadow: var(--shadow-soft); cursor: pointer; white-space: nowrap;
}

/* ---- what he has learned ---- */
.notes { display: grid; gap: 10px; }
.note { padding: 12px 14px; border-radius: 16px; background: var(--card-2); border-left: 4px solid var(--honey); }
.note h4 { font-size: 17px; margin-bottom: 2px; }
.note p { font-size: var(--fs-small); color: var(--ink-2); }
.note-basis { font-family: var(--font-text); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--sage-ink); margin-left: 6px; }
.note[data-basis="guess"] { border-left-color: var(--line); }
.note[data-basis="guess"] .note-basis { color: var(--muted); }

/* ---- people ---- */
.people { display: grid; gap: 10px; }
.person { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; background: var(--sage-soft); color: var(--sage-ink); }
.person:nth-child(2n) .avatar { background: var(--honey-soft); color: var(--honey-ink); }
.person:nth-child(3n) .avatar { background: var(--terracotta-soft); color: var(--terracotta); }
.person-name { font-weight: 800; }
.person-about { font-size: 14px; color: var(--ink-2); }

/* ---- footer ---- */
.world-status { text-align: center; font-size: var(--fs-meta); color: var(--muted); padding: 4px 0 0; }
.world-status .line { display: block; font-style: italic; }

/* ---------- chat bar ---------- */
.chat {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  height: calc(var(--chat-h) + var(--safe-b));
  padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: var(--paper-2); border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.chat input {
  flex: 1; min-width: 0; height: 50px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); padding: 0 18px; font-size: 16px;
}
.chat .send {
  flex: none; width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--terracotta); color: var(--on-terracotta); display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
}
.chat .send svg { width: 24px; height: 24px; }

/* ---------- motion ---------- */
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.segs i.is-running { animation: pulse 2.4s ease-in-out infinite; }
.step.is-running .step-box { animation: breathe 3.4s ease-in-out infinite; }
.mind-status::before, .waiting::before { animation: pulse 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .segs i.is-running, .step.is-running .step-box, .mind-status::before, .waiting::before { animation: none; }
}

/* ---------- desktop: side panel ---------- */
@media (min-width: 960px) {
  .world { right: var(--panel-w); }          /* the renderer sizes to the uncovered area */
  .world-note { left: 50%; right: auto; width: min(560px, 60%); transform: translateX(-50%); }
  .pill { left: calc((100% - var(--panel-w)) / 2); top: 20px; }
  .chat {
    left: calc((100% - var(--panel-w)) / 2); right: auto; bottom: 22px; transform: translateX(-50%);
    width: min(560px, calc(100% - var(--panel-w) - 48px)); height: auto; padding: 8px;
    border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  }
  .chat input { border-color: transparent; background: var(--card-2); }
  .sheet, .sheet[data-state] {
    top: 0; bottom: 0; left: auto; right: 0; width: var(--panel-w);
    border-radius: 0; box-shadow: none; border-left: 1px solid var(--line);
    transition: none; touch-action: auto;
  }
  .handle { cursor: default; padding-top: 18px; border-radius: 0; }
  .grip { display: none; }
  .sheet[data-state="peek"] .pages { overflow: auto; }
  .pages { padding: 4px 20px 28px; }
}

/* ---------- page-only parts (VIEWER-CONTRACT §4.1 ids) ----------
   The renderer mounts its canvas in .world#stage; the follow / map chips sit
   low on the right of the world, the lost-context banner takes the note's
   slot under the pill, chat.js fills .chat and the letters, and the leave
   form is chat.js's createOffer inside p. 6. No colours of their own. */
.world canvas { touch-action: none; outline: none; }
.world canvas.lost { visibility: hidden; }
.world canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.world-tag, .world-note { z-index: 2; }
.world-tag[hidden] { display: none; }
.world-tools {
  position: fixed; z-index: 15; right: var(--gutter);
  bottom: calc(var(--chat-h) + var(--safe-b) + var(--peek-h) + 12px);
  display: flex; gap: 6px;
}
.world-tools button {
  appearance: none; border: 0; border-radius: 999px; height: 32px; padding: 0 12px;
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-soft); cursor: pointer;
  font-size: var(--fs-meta); font-weight: 800; letter-spacing: .02em;
}
.world-tools button[aria-pressed="true"] { background: var(--sage-soft); color: var(--sage-ink); }
.world-tools button[hidden] { display: none; }
.banner {
  position: fixed; z-index: 35; left: var(--gutter); right: var(--gutter);
  top: calc(var(--pill-top) + var(--pill-h) + 12px);
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 12px 10px 16px; border-radius: 18px;
  background: var(--card); color: var(--alarm); border: 1.5px solid var(--alarm-soft); box-shadow: var(--shadow);
  font-size: var(--fs-small); font-weight: 800;
}
.banner[hidden] { display: none; }
.banner .btn { background: var(--alarm); flex: none; padding: 8px 14px; }
#journal { display: flex; flex-direction: column; gap: 14px; }
#credits { font-size: 12px; font-style: italic; color: var(--muted); text-align: center; padding: 0 8px 4px; }
#credits a { color: inherit; }
.lede, .agenda-empty, .entry--empty, .moment--empty, .letter--empty { font-size: var(--fs-small); color: var(--muted); font-style: italic; }
.entry--empty, .moment--empty { display: block; padding: 0; }
.letter--empty { background: transparent; padding: 0; }
.letter, .entry-text, .moment-text, .note p, .step-text, .agenda-item, .mood-because, .goal-why, .need p { overflow-wrap: anywhere; }
.mood-strength[hidden], .mood-because[hidden], .goal-origin[hidden], .goal-why[hidden], .waiting[hidden] { display: none; }
.moment[data-kind="said"] .moment-icon { color: var(--mood); border-color: color-mix(in srgb, var(--mood) 30%, var(--card-2)); background: color-mix(in srgb, var(--mood) 18%, var(--card-2)); }
.step-box svg { display: block; }
.step-text code { display: inline-block; max-width: 100%; vertical-align: bottom; }
/* chat.js renders the bar's form into .chat and the letters into p. 6 */
.chat-form { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.chat .chat-name { flex: 0 1 6.5em; min-width: 4.5em; padding: 0 12px; }
.chat .chat-text { flex: 1 1 auto; }
.chat-reply {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(100% + 8px);
  padding: 8px 14px; border-radius: 14px; text-align: center;
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-soft); font-size: var(--fs-small);
}
.chat-reply:empty { display: none; }
.leave-reply { font-size: var(--fs-meta); color: var(--muted); font-style: italic; }
.leave-reply:empty { display: none; }
@media (min-width: 960px) {
  .world-tools { right: calc(var(--panel-w) + 20px); bottom: 30px; }
  .banner { left: calc((100% - var(--panel-w)) / 2); right: auto; width: min(560px, 60%); transform: translateX(-50%); }
  .chat-reply { left: 8px; right: 8px; }
}
