:root {
  --lacquer: #6E0B12;   /* the field */
  --wine: #4A060B;      /* sunken surfaces */
  --oxide: #8C1119;     /* raised surfaces */
  --cinnabar: #C8202C;  /* lines, web fill */
  --flare: #FF5E4D;     /* selection, live vertex */
  --blush: #FFE6DE;     /* ink */
  --rose: #EDB2A9;      /* quiet ink */
  --hair: rgba(255, 230, 222, 0.22);
  --hair-strong: rgba(255, 230, 222, 0.5);

  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;

  --r-soft: 14px;
  --r-card: 22px;

  --ease-out: cubic-bezier(.22, .9, .3, 1);      /* decelerate into place */
  --ease-send: cubic-bezier(.2, .9, .25, 1.06);  /* a touch of overshoot */
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --stagger: 48ms;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--lacquer); }
body {
  background: var(--lacquer);
  color: var(--blush);
  font: 400 16px/1.55 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .13; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blush); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app > * { min-width: 0; }
.app {
  position: relative; z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

/* ---------- left panel (desktop) ---------- */
.panel { display: none; }
@media (min-width: 980px) {
  .app { grid-template-columns: minmax(380px, 42%) 1fr; }
  /* Three parts with different jobs, so they get different space: the brand
     sits at the top, the web takes whatever is left, and the footer group
     holds the bottom. A single uniform gap made all three read as one list. */
  .panel {
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
    row-gap: clamp(20px, 3.4vh, 40px);
    padding: clamp(32px, 4.4vh, 48px) 48px clamp(24px, 3vh, 34px);
    border-right: 1px solid var(--hair);
    overflow: hidden;
  }
}
.brand-row { display: flex; align-items: flex-start; gap: 0.12em; font-size: clamp(64px, 7vw, 104px); }
.brand-row .heart-big { width: 0.36em; height: 0.36em; margin-top: 0.12em; transform: rotate(-8deg); }
.brand-row .heart-big .hm-base { stroke-width: 3; }
.wordmark {
  font: italic 500 clamp(64px, 7vw, 104px)/0.9 var(--serif);
  letter-spacing: -0.015em;
  margin: 0;
  padding-bottom: 0.24em; /* room for the y's descender */
}
.sub { margin: 4px 0 0 0.9em; display: flex; flex-direction: column; gap: 6px; color: var(--rose); }
.sub-lede { font: italic 400 21px/1.2 var(--serif); color: var(--blush); letter-spacing: -0.005em; text-wrap: balance; }
.sub-tail { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; letter-spacing: 0.01em; }
.pips { display: inline-flex; gap: 5px; }
.pip { width: 11px; height: 11px; fill: none; stroke: var(--rose); stroke-width: 9; opacity: .55; transition: fill .3s, stroke .3s, opacity .3s, transform .3s; }
.pip.on { fill: var(--flare); stroke: var(--flare); opacity: 1; transform: scale(1.12); }
/* The item must STRETCH vertically for the svg to know the row height — a
   centred grid item sizes to its content, so `height: 100%` had nothing to
   resolve against and the drawing stayed 440px tall inside a 331px row,
   bleeding over the footer. Stretch vertically, centre horizontally. */
.web-wrap { min-height: 0; min-width: 0; display: grid; justify-items: center; align-items: stretch; }
#web { width: 100%; height: 100%; max-width: 460px; }

/* ---------- panel footer ---------- */
.panel-foot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding-top: clamp(16px, 2.4vh, 24px);
  border-top: 1px solid var(--hair);
}
.live { min-height: 52px; align-self: stretch; }
.live-row { display: flex; gap: 32px; align-items: baseline; }
.live-num { font: 500 40px/1 var(--serif); }
.live-label { font-size: 13px; color: var(--rose); margin-top: 4px; }
.live-wait { color: var(--rose); font-size: 14px; margin: 0; }
.live-wait em, .live-label { font-style: normal; }
.live-wait em { font: italic 500 22px/1 var(--serif); color: var(--blush); margin-right: 4px; }
.fine { margin: 0; font-size: 12.5px; color: var(--rose); display: flex; flex-wrap: wrap; gap: 0 6px; }
.fine span { font: italic 400 13.5px var(--serif); color: var(--blush); opacity: .85; }

/* ---------- web svg ---------- */
.web-ring { fill: none; stroke: var(--hair); stroke-width: 1; }
.web-ring.outer { stroke: var(--hair-strong); }
.web-axis { stroke: var(--hair); stroke-width: 1; stroke-dasharray: 2 5; }
.web-axis.on { stroke: var(--hair-strong); stroke-dasharray: none; }
.web-shape { fill: var(--cinnabar); fill-opacity: .78; stroke: var(--flare); stroke-width: 2; stroke-linejoin: round; }
.web-dot { fill: var(--blush); }
.web-dot.live { fill: var(--flare); }
.web-label { fill: var(--blush); font: italic 500 17px var(--serif); }
.web-label.off { fill: var(--rose); opacity: .6; }
.web-value { fill: var(--rose); font: italic 500 13px var(--serif); }

/* ---------- chat column ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.topbar {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--hair);
}
.topbar::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--flare); transform-origin: left; transform: scaleX(var(--done, 0));
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.heart-mark { width: 34px; height: 34px; flex: none; overflow: visible; }
.hm-base { fill: rgba(74, 6, 11, .6); stroke: var(--rose); stroke-width: 4; stroke-linejoin: round; }
.hm-fill { fill: var(--flare); }
.heart-level { transition: y .5s cubic-bezier(.2,.7,.2,1); }
.topbar-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.topbar-name { font: italic 600 22px/1 var(--serif); }
.topbar-progress { font: italic 400 16px/1.2 var(--serif); color: var(--blush); margin-top: 2px; }
@media (min-width: 980px) {
  .heart-small, .topbar-name { display: none; }
  .topbar { padding: 16px 32px; }
  /* the panel carries the About link on desktop, so the topbar needn't */
  .about-top { display: none; }
}
/* the left panel is hidden below 980px — without this, About is unreachable there */
.about-top { margin-left: auto; }
.topbar .ghost + .ghost { margin-left: 0; }
@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .topbar .ghost { padding: 6px 10px; font-size: 13px; }
}

.ghost {
  background: none; border: 1px solid var(--hair); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; color: var(--blush);
}
.ghost:hover:not(:disabled) { border-color: var(--hair-strong); }
.ghost:disabled { opacity: .35; cursor: default; }

.log {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 28px 18px 40px;
  scroll-behavior: smooth;
}
/* one centered 660px column; children indent with margin-left only */
.log { padding-inline: max(18px, calc((100% - 660px) / 2)); }
@media (min-width: 980px) { .log { padding-block: 40px 56px; padding-inline: max(32px, calc((100% - 660px) / 2)); } }

/* Mary speaks directly on the field; the person replies in blush chips. */
.turn { display: grid; grid-template-columns: 22px 1fr; column-gap: 14px; margin-top: 26px; }
.turn:first-child { margin-top: 0; }
.turn .mark { width: 18px; height: 18px; margin-top: 5px; fill: var(--flare); }
.turn.cont { margin-top: 12px; }
.turn.cont .mark { visibility: hidden; }
.turn > div { min-width: 0; overflow-wrap: anywhere; }
.say { font-size: 17px; max-width: 58ch; }
.say p { margin: 0 0 .8em; }
.say p:last-child { margin-bottom: 0; }
.say strong { font-weight: 650; }
.ask { font: 500 clamp(22px, 2.6vw, 27px)/1.22 var(--serif); letter-spacing: -0.005em; max-width: 30ch; }

.me {
  display: flex; justify-content: flex-end; margin-top: 18px;
}
.me > div {
  background: var(--blush); color: var(--wine);
  border-radius: 20px 20px 6px 20px; padding: 10px 16px; max-width: 80%;
  font-size: 15.5px; white-space: pre-wrap;
}
.me.skipped > div { background: none; color: var(--rose); border: 1px dashed var(--hair-strong); }
.me ul { margin: 0; padding: 0; list-style: none; }

/* typing */
.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- inputs inside the log ---------- */
.options { margin: 16px 0 0 36px; display: grid; gap: 8px; }
.opt {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center; text-align: left;
  background: rgba(74, 6, 11, .45); border: 1px solid var(--hair); border-radius: var(--r-soft);
  padding: 12px 16px; font-size: 15.5px; line-height: 1.35;
  transition: border-color .15s, background-color .15s;
}
.opt:hover { border-color: var(--hair-strong); background: rgba(74, 6, 11, .7); }
.ring { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rose); display: grid; place-items: center; }
.opt.picked { background: var(--flare); border-color: var(--flare); color: var(--wine); }
.opt.picked .ring { border-color: var(--wine); }
.opt.picked .ring::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--wine); }

/* Not-applicable. Set apart from the five scored statements by a rule above it
   and a dashed edge, because it is a different kind of answer, not a sixth
   point on the scale. It must never look like the worst option. */
.opt.na {
  margin-top: 6px; border-style: dashed; border-color: var(--hair);
  background: none; color: var(--rose); font-style: italic;
  position: relative;
}
.opt.na::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: -10px;
  border-top: 1px solid var(--hair); opacity: .6;
}
.opt.na .ring { border-style: dashed; border-color: var(--hair-strong); }
.opt.na:hover:not(.picked) { border-color: var(--hair-strong); color: var(--blush); background: none; }
/* picked reads as "noted", not as a selected score */
.options .opt.na.picked {
  background: none; border-color: var(--hair-strong); color: var(--blush);
}
.options .opt.na.picked .ring { border-color: var(--blush); }
.options .opt.na.picked .ring::after { background: var(--blush); }

/* ============================================================
   About — the ontology behind the instrument.
   Reads as a printed essay rather than app chrome: the serif that
   sets Mary's questions sets the headings, and the measure stays
   near 62 characters so it can actually be read.
   ============================================================ */
/* Left-aligned with everything else in the panel. It was a flex child in a
   column, so it stretched the full width and centred its own label — which
   read as a stray centred link rather than a control. */
.about-open {
  align-self: flex-start; margin: 0;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 15px;
  background: none; border: 1px solid var(--hair); border-radius: 999px;
  font: italic 400 14px var(--serif); color: var(--rose); text-align: left;
  transition: color .18s, border-color .18s, background-color .18s, transform .18s var(--ease-out);
}
.about-open svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .22s var(--ease-out);
}
.about-open:hover {
  color: var(--blush); border-color: var(--hair-strong);
  background: rgba(255, 230, 222, .05);
}
.about-open:hover svg { transform: translateX(3px); }
.about-open:active { transform: scale(.985); }

dialog.about {
  width: min(680px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  padding: 0; border: 1px solid var(--hair-strong); border-radius: var(--r-card);
  background: var(--lacquer); color: var(--blush);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
}
dialog.about::backdrop { background: rgba(28, 2, 5, .72); backdrop-filter: blur(3px); }
dialog.about[open] { animation: aboutIn .32s var(--ease-out) both; }
dialog.about[open]::backdrop { animation: fadeIn .32s var(--ease-out) both; }
@keyframes aboutIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.about-close-form { position: sticky; top: 0; height: 0; z-index: 2; }
.about-close {
  position: absolute; right: 14px; top: 14px;
  width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1;
  background: var(--wine); color: var(--blush); border: 1px solid var(--hair);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.about-close:hover { background: var(--oxide); border-color: var(--hair-strong); }

.about-body { overflow-y: auto; max-height: min(86vh, 900px); padding: 38px 40px 32px; }
.about-head { margin-bottom: 30px; }
.about-heart { width: 22px; height: 22px; fill: var(--flare); display: block; margin-bottom: 14px; }
.about-body h2 {
  margin: 0 0 14px; font: 500 clamp(27px, 3.6vw, 34px)/1.12 var(--serif);
  letter-spacing: -0.012em; text-wrap: balance;
}
.about-lede { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--blush); max-width: 62ch; }
.about-lede strong { font-weight: 650; }

.about-body section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--hair); }
.about-body h3 {
  margin: 0 0 12px; font: italic 500 20px/1.25 var(--serif); color: var(--flare);
  letter-spacing: .002em;
}
.about-body p { margin: 0 0 13px; font-size: 15.5px; line-height: 1.62; color: var(--rose); max-width: 62ch; }
.about-body p:last-child { margin-bottom: 0; }
.about-body em { color: var(--blush); font-style: italic; }

.about-body blockquote {
  margin: 18px 0 13px; padding: 0 0 0 18px; border-left: 2px solid var(--cinnabar);
  font: italic 400 18px/1.45 var(--serif); color: var(--blush); max-width: 54ch;
}

.about-table-wrap { overflow-x: auto; margin: 0 0 15px; }
.about-table { border-collapse: collapse; width: 100%; min-width: 440px; font-size: 14px; }
.about-table th, .about-table td { text-align: left; padding: 9px 14px 9px 0; vertical-align: top; }
.about-table thead th {
  font: 500 11.5px var(--sans); text-transform: uppercase; letter-spacing: .08em;
  color: var(--rose); border-bottom: 1px solid var(--hair-strong); padding-bottom: 8px;
}
.about-table tbody tr { border-bottom: 1px solid var(--hair); }
.about-table tbody tr:last-child { border-bottom: 0; }
.about-table td:first-child { color: var(--blush); font-weight: 550; white-space: nowrap; }
.about-table td { color: var(--rose); }

.about-foot { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--hair); }
.about-foot p { font-size: 13px; color: var(--rose); opacity: .85; margin: 0; }

@media (max-width: 560px) {
  .about-body { padding: 30px 22px 26px; }
  .about-body blockquote { font-size: 16.5px; }
}

/* ============================================================
   The two rooms
   ============================================================ */
.rooms { margin: 18px 0 0 36px; display: grid; gap: 10px; }
.room {
  display: grid; gap: 5px; text-align: left;
  background: rgba(74, 6, 11, .45); border: 1px solid var(--hair); border-radius: var(--r-card);
  padding: 17px 20px 18px;
  transition: border-color .18s, background-color .18s, transform .18s var(--ease-out);
}
.room:hover { border-color: var(--hair-strong); background: rgba(74, 6, 11, .75); transform: translateY(-1px); }
.room:active { transform: translateY(0) scale(.995); }
.room-name { font: 500 19px/1.25 var(--serif); color: var(--blush); }
.room-note { font-size: 14px; line-height: 1.5; color: var(--rose); max-width: 46ch; }
.rooms .room.picked { background: var(--blush); border-color: var(--blush); }
.rooms .room.picked .room-name, .rooms .room.picked .room-note { color: var(--wine); }

/* the chamber's doors reuse .opt, with a second line */
.doors .opt { align-items: start; }
.doors .opt .ring { margin-top: 2px; }
.door-name { display: block; }
.door-blurb { display: block; margin-top: 3px; font-size: 13.5px; color: var(--rose); line-height: 1.45; }
.options.doors .opt.picked .door-blurb { color: var(--wine); opacity: .78; }

/* ---------- the chamber's panel ---------- */
/* Both panel bodies occupy the same grid row; the room decides which shows.
   The exchange web means nothing in a room that does not measure. */
.web-wrap, .chamber-wrap, .after-wrap { grid-row: 2; }
.chamber-wrap, .after-wrap { display: none; min-height: 0; flex-direction: column; align-items: flex-start; gap: 14px; overflow: hidden; }
body[data-room="chamber"] .web-wrap, body[data-room="after"] .web-wrap { display: none; }
body[data-room="chamber"] .chamber-wrap { display: flex; }
body[data-room="after"] .after-wrap { display: flex; }
body[data-room="after"] .live, body[data-room="after"] .sub-tail { display: none; }
body[data-room="after"] .panel-foot { gap: 12px; }

/* the decay list carries a signal line under each name */
.mirror.decay li { display: grid; gap: 1px; }
.m-sig { font-size: 12.5px; color: var(--rose); opacity: .78; font-style: italic; }

/* ---------- the pathways dialog ---------- */
.band-list { list-style: none; margin: 0; padding: 0; }
.band { padding: 20px 0; border-bottom: 1px solid var(--hair); }
.band:last-child { border-bottom: 0; }
.band-head { margin-bottom: 11px; }
.band-name { display: block; font: italic 500 18px var(--serif); color: var(--flare); }
.band-note { display: block; margin-top: 2px; font-size: 13px; color: var(--rose); opacity: .85; }
.band-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.band-items li {
  display: grid; gap: 3px; padding: 11px 15px;
  background: rgba(74, 6, 11, .45); border-radius: var(--r-soft);
  border-left: 2px solid var(--hair-strong);
}
.pw-name { font-size: 15px; color: var(--blush); font-weight: 550; }
.pw-mech { font-size: 13.5px; line-height: 1.5; color: var(--rose); }
.pw-signal { margin-top: 3px; font: italic 400 14px var(--serif); color: var(--blush); opacity: .9; }

/* assessment copy that means nothing in this room */
body[data-room="chamber"] .live { display: none; }
body[data-room="chamber"] .sub-tail { display: none; }
body[data-room="chamber"] .panel-foot { gap: 12px; }

.chamber-h { margin: 0; font: 500 clamp(24px, 2.8vw, 31px)/1.15 var(--serif); letter-spacing: -0.008em; }
.chamber-h span { color: var(--flare); }
.chamber-lede { margin: 0; font: italic 400 15px/1.5 var(--serif); color: var(--rose); max-width: 38ch; }
.mirror { list-style: none; margin: 2px 0 0; padding: 0; min-height: 0; overflow-y: auto; width: 100%; }
.mirror li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: clamp(5px, .9vh, 9px) 0; border-bottom: 1px solid var(--hair); font-size: 13.5px;
}
.mirror li:last-child { border-bottom: 0; }
.m-from { color: var(--rose); }
.m-arrow { color: var(--cinnabar); }
.m-to { color: var(--blush); font-style: italic; font-family: var(--serif); font-size: 15px; }

/* ---------- the conversions dialog ---------- */
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv { padding: 18px 0; border-bottom: 1px solid var(--hair); }
.conv:last-child { border-bottom: 0; }
.conv-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 7px; }
.conv-from { font-size: 14px; color: var(--rose); }
.conv-arrow { color: var(--cinnabar); }
.conv-to { font: italic 500 18px var(--serif); color: var(--blush); }
.conv-old { margin: 0 0 9px; font-size: 13.5px; color: var(--rose); opacity: .85; max-width: 58ch; }
.conv-phrase {
  margin: 0; padding: 11px 15px; border-left: 2px solid var(--flare);
  background: rgba(74, 6, 11, .5); border-radius: 0 var(--r-soft) var(--r-soft) 0;
  font: italic 400 16px/1.5 var(--serif); color: var(--blush); max-width: 54ch;
}
.chamber-result .tier-name { font-size: clamp(22px, 2.4vw, 27px); }

@media (max-width: 540px) { .rooms { margin-left: 0; } }

/* a stat whose value is a phrase, not a number — keep it on one line */
.stat dd.wordy { font-size: .5em; line-height: 1.25; text-wrap: balance; }

/* the standing note on the result card */
.unestablished {
  margin: 0 0 18px; padding: 12px 16px;
  border: 1px dashed var(--hair-strong); border-radius: var(--r-soft);
  color: var(--rose); font-size: 14.5px; line-height: 1.5;
}

.chips { margin: 16px 0 0 36px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chip {
  background: rgba(74, 6, 11, .45); border: 1px solid var(--hair); border-radius: 999px;
  padding: 9px 16px; font-size: 15px;
}
.chip:hover { border-color: var(--hair-strong); }
.chip.picked, .chip.primary { background: var(--blush); color: var(--wine); border-color: var(--blush); }

/* Likert matrix */
.likert {
  margin: 16px 0 0 36px; background: var(--wine); border-radius: var(--r-card);
  padding: 8px 18px 18px; box-shadow: inset 0 1px 0 rgba(255,230,222,.08);
}
.lk-row { padding: 16px 0; border-bottom: 1px solid var(--hair); }
.lk-row:last-of-type { border-bottom: 0; }
.lk-name { font: italic 600 19px/1.2 var(--serif); }
.lk-prompt { color: var(--rose); font-size: 14px; margin: 2px 0 12px; }
.lk-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lk-dot {
  background: none; border: 0; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; line-height: 1.2; color: var(--rose); text-align: center;
}
.lk-dot .ring { width: 26px; height: 26px; }
.lk-dot:hover .ring { border-color: var(--blush); }
.lk-dot[aria-checked="true"] { color: var(--blush); }
.lk-dot[aria-checked="true"] .ring { background: var(--flare); border-color: var(--flare); }
.lk-dot[aria-checked="true"] .ring::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--wine); }
.likert .continue { margin-top: 14px; }

.primary-btn {
  background: var(--blush); color: var(--wine); border: 0; border-radius: 999px;
  padding: 11px 22px; font-weight: 600; font-size: 15px;
}
.primary-btn:disabled { opacity: .35; cursor: default; }

/* ---------- results card ---------- */
.result {
  margin: 22px 0 0 36px; background: var(--wine); border-radius: var(--r-card);
  padding: 26px 24px 22px; box-shadow: inset 0 1px 0 rgba(255,230,222,.08);
}
.tier-n { font-size: 14px; color: var(--rose); }
.tier-name { font: italic 500 clamp(30px, 4vw, 40px)/1.05 var(--serif); margin: 4px 0 0; letter-spacing: -0.01em; }
.tier-note { color: var(--rose); font-size: 14px; margin: 8px 0 0; }
.result-web { width: min(100%, 340px); display: block; margin: 18px auto 6px; overflow: visible; }
.result-web .web-label { font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--hair); }
.stat dt { font-size: 13px; color: var(--rose); }
.stat dd { margin: 2px 0 0; font: 500 30px/1.05 var(--serif); }
.stat dd small { font: 400 14px var(--sans); color: var(--rose); margin-left: 3px; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.flags { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--hair); font-size: 14.5px; }
.flags p { margin: 0 0 6px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.offline { font-size: 13px; color: var(--rose); margin-top: 8px; }

/* ---------- safety card ---------- */
.safety {
  margin: 22px 0 0 36px; background: var(--blush); color: var(--wine);
  border-radius: var(--r-card); padding: 22px 24px;
}
.safety h2 { font: italic 600 26px/1.15 var(--serif); margin: 0 0 8px; }
.safety p { margin: 0 0 10px; }
.safety ul { margin: 10px 0 14px; padding-left: 18px; }
.safety li { margin-bottom: 6px; }
.safety a { color: var(--lacquer); font-weight: 650; }
.safety .ghost { border-color: rgba(74,6,11,.35); color: var(--wine); }

/* ---------- composer ---------- */
.composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair);
  background: rgba(74, 6, 11, .55);
}
@media (min-width: 980px) { .composer { padding: 14px 32px 18px; } }
.composer { --ctl: 44px; }
.composer > button {
  flex: none; height: var(--ctl); padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
.composer textarea {
  flex: 1; min-width: 0; resize: none; max-height: 160px; min-height: var(--ctl);
  background: var(--lacquer); border: 1px solid var(--hair); border-radius: calc(var(--ctl) / 2);
  padding: 11px 18px; font-size: 16px; line-height: 20px; color: var(--blush);
  transition: border-color .15s, box-shadow .15s;
}
.composer textarea:focus-visible { outline: none; border-color: var(--blush); box-shadow: 0 0 0 3px rgba(255, 230, 222, .16); }
.composer textarea::placeholder { color: var(--rose); opacity: .8; }
.composer textarea:disabled { opacity: .55; }
.send {
  background: var(--blush); color: var(--wine); border: 0; border-radius: 999px;
  font-weight: 600; min-width: 76px;
}
.send:disabled { opacity: .35; cursor: default; }

/* the opener: Mary's first line lands a size up */
.log > .turn:first-child .say p:first-child { font-size: 1.12em; }

/* ============================================================
   Motion
   Mary writes onto the field; the person sends replies to it.
   Those are different gestures, so they move differently: Mary's
   lines come into focus from below, replies arrive from the right
   where they were typed, and a set of choices cascades instead of
   landing as one slab. Nothing leaves by vanishing.
   ============================================================ */

/* generic fallback for anything else entering the log */
.enter { animation: settle .38s var(--ease-out) both; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Mary ---- */
/* the heart and the words arrive separately, so a turn is not one slab */
.turn.enter { animation: none; }
.turn.enter .mark { animation: markIn .52s var(--ease-out) both; }
.turn.enter .say { animation: sayIn .46s var(--ease-out) both; }
.turn.enter .ask { animation: askIn .62s var(--ease-out) both; }

@keyframes markIn {
  from { opacity: 0; transform: scale(.55) rotate(-16deg); }
  to { opacity: 1; transform: none; }
}
/* the brief blur is the whole difference between "appeared" and "came into focus" */
@keyframes sayIn {
  from { opacity: 0; transform: translateY(9px); filter: blur(1.6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
/* the question is the hero of each step, so it takes its time */
@keyframes askIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ---- the person ---- */
.me.enter { animation: none; }
.me.enter > div { animation: meIn .4s var(--ease-send) both; transform-origin: 100% 100%; }
@keyframes meIn {
  from { opacity: 0; transform: translate(16px, 8px) scale(.94); }
  to { opacity: 1; transform: none; }
}

/* ---- a set of choices cascades ---- */
.chips.enter, .options.enter, .likert.enter { animation: fadeIn .3s var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.chips.enter .chip,
.options.enter .opt,
.likert.enter .lk-row,
.likert.enter .continue { animation: choiceIn .42s var(--ease-out) both; }
@keyframes choiceIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.chips.enter :nth-child(2), .options.enter :nth-child(2), .likert.enter :nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
.chips.enter :nth-child(3), .options.enter :nth-child(3), .likert.enter :nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.chips.enter :nth-child(4), .options.enter :nth-child(4), .likert.enter :nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.chips.enter :nth-child(5), .options.enter :nth-child(5), .likert.enter :nth-child(5) { animation-delay: calc(var(--stagger) * 4); }
.chips.enter :nth-child(6), .options.enter :nth-child(6), .likert.enter :nth-child(6) { animation-delay: calc(var(--stagger) * 5); }
.chips.enter :nth-child(7), .options.enter :nth-child(7), .likert.enter :nth-child(7) { animation-delay: calc(var(--stagger) * 6); }
.chips.enter :nth-child(n+8), .options.enter :nth-child(n+8), .likert.enter :nth-child(n+8) { animation-delay: calc(var(--stagger) * 7); }

/* ---- touch feedback ---- */
.chip, .opt { transition: border-color .15s, background-color .15s, color .15s, transform .18s var(--ease-out); }
.chip:hover:not(.picked), .opt:hover:not(.picked) { transform: translateY(-1px); }
.chip:active, .opt:active { transform: translateY(0) scale(.985); }
/* placed after the entrance rules so the confirm beat wins on click */
.chips .chip.picked, .options .opt.picked { animation: confirm .3s var(--ease-out); }
@keyframes confirm {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

/* ---- leaving ----
   answered widgets and spent typing dots collapse their own height, so
   the next bubble slides up into the space instead of the column jumping */
.leaving {
  overflow: hidden; pointer-events: none;
  opacity: 0; transform: translateY(-6px);
  margin-top: 0; padding-top: 0; padding-bottom: 0;
  animation: none !important;
  transition: height .3s var(--ease-soft), margin-top .3s var(--ease-soft),
              padding .3s var(--ease-soft), opacity .22s ease-out,
              transform .3s var(--ease-soft);
}
/* the options you didn't take dissolve first; the one you picked rides out last */
.leaving .chip:not(.picked), .leaving .opt:not(.picked) {
  opacity: 0; transform: scale(.94);
  animation: none !important;
  transition: opacity .16s ease-out, transform .16s ease-out;
}
.leaving .chip.picked, .leaving .opt.picked { animation: none !important; }

/* ---- a whole screen rebuild (Back) re-settles rather than cutting ---- */
.log.rebuilt { animation: fadeIn .32s var(--ease-out); }

@media (max-width: 540px) {
  .composer { --ctl: 42px; gap: 6px; }
  .composer > button { padding: 0 14px; font-size: 14px; }
  .composer textarea { padding: 10px 16px; }
  .send { min-width: 0; }
  .options, .chips, .likert, .result, .safety { margin-left: 0; }
  .likert { padding: 6px 14px 16px; }
  .result { padding: 22px 18px 20px; }
  .turn { grid-template-columns: 18px 1fr; column-gap: 10px; }
  .turn .mark { width: 14px; height: 14px; }
  .say { font-size: 16.5px; }
}

/* Reduce motion, don't delete it: travel, blur and overshoot come off,
   a short opacity fade stays so changes are still legible as changes. */
@media (prefers-reduced-motion: reduce) {
  .log { scroll-behavior: auto; }
  .enter,
  .turn.enter .mark, .turn.enter .say, .turn.enter .ask,
  .me.enter > div,
  .chips.enter, .options.enter, .likert.enter,
  .chips.enter .chip, .options.enter .opt,
  .likert.enter .lk-row, .likert.enter .continue,
  .chips .chip.picked, .options .opt.picked,
  .log.rebuilt { animation: fadeIn .2s linear both; animation-delay: 0s; }
  .chip:hover:not(.picked), .opt:hover:not(.picked), .chip:active, .opt:active { transform: none; }
  .leaving { transition: opacity .15s linear; transform: none; }
  dialog.about[open] { animation: fadeIn .2s linear both; }
  .leaving .chip:not(.picked), .leaving .opt:not(.picked) { transform: none; }
  .about-open, .about-open svg { transition: color .15s, border-color .15s; }
  .about-open:hover svg, .about-open:active { transform: none; }
  .pip, .topbar::after, .heart-level { transition: none; }
  .typing i { animation: none; opacity: .7; }
}
