/* The sample-report reader. Mirrors the app's report screen inside a phone frame on desktop,
   and opens full screen on phones. Report colours are allowed here: this is a report. */

.demo { display: grid; gap: 28px; }
.demo-on .demo-fallback { display: none; }
.hero-sample { margin-top: 18px; font-weight: 600; font-size: 0.9375rem; }
.demo-js { display: none; }
.demo-on .demo-js { display: grid; }

/* ---------- Choosing ---------- */
.fights { display: grid; gap: 10px; }
.fight-card {
  display: flex; align-items: center; gap: 16px;
  text-align: left; width: 100%; padding: 16px 16px 16px 18px; border-radius: 16px; cursor: pointer;
  background: var(--sand); border: 1.5px solid var(--sand-line); color: var(--ink); font: inherit;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.fight-card:hover { border-color: var(--stone-muted); }
@media (min-width: 880px) {
  .fight-card[aria-pressed="true"] { border-color: var(--stone); background: var(--sand-raised); }
}
.fight-card .fc-title { display: block; font-family: var(--serif); font-size: 1.3125rem; line-height: 1.3; margin-bottom: 4px; }
.fight-card .fc-line { display: block; color: var(--ink-soft); }
.fight-card .fc-note { display: block; margin-top: 6px; font-size: 0.875rem; color: var(--ink-soft); }
.fc-text { flex: 1; min-width: 0; }
.fc-play {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--stone); color: var(--sand); transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.fc-play svg { margin-left: 2px; }   /* a triangle looks centred a touch right of centre */
.fight-card:hover .fc-play { background: var(--stone-pressed); }
.fight-card:active .fc-play { transform: scale(0.96); }
@media (min-width: 880px) {
  /* On desktop the card plays into the phone beside it; the open one reads as selected. */
  .fight-card[aria-pressed="true"] .fc-play { background: var(--sand-line); color: var(--ink); }
}

.as-label { font-weight: 600; font-size: 0.9375rem; margin: 6px 0 8px; }
.as { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--sand-raised); max-width: 26rem; }
.as button {
  flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 0.9375rem/1 var(--sans); cursor: pointer; padding: 0 12px;
}
.as button[aria-pressed="true"] { background: var(--stone); color: var(--sand); }
.demo-open { margin-top: 16px; width: 100%; }
.demo-hint { margin-top: 12px; }

/* ---------- The phone ---------- */
.phone { display: none; }
@media (min-width: 880px) {
  .demo { grid-template-columns: minmax(0, 1fr) 390px; gap: 48px; align-items: start; }
  .demo-open { display: none; }
  .phone {
    display: block; width: 390px; height: min(780px, calc(100svh - 48px)); min-height: 600px;
    border-radius: 48px; padding: 10px; background: var(--ink);
  }
}

.screen {
  position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--sand); border-radius: 38px; outline: none;
}
.screen:focus-visible { box-shadow: inset 0 0 0 3px var(--stone); }

.scr-top { display: flex; align-items: center; gap: 10px; padding: 16px 16px 0 16px; min-height: 52px; }
.scr-title { margin: 6px 22px 0; font-size: 0.8125rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-who { flex: 1; min-width: 0; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sand-raised); }
.scr-who button {
  flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: var(--ink); font: 600 0.875rem/1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px;
}
.scr-who button[aria-pressed="true"] { background: var(--stone); color: var(--sand); }
.scr-skip {
  flex: none; min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font: 600 0.8125rem/1 var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.scr-close {
  display: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--sand-raised); color: var(--ink); font: 600 0.9375rem/1 var(--sans); cursor: pointer;
}

.scr-tabs { display: flex; gap: 4px; margin: 6px 16px 0; padding: 4px; border-radius: 999px; background: var(--sand-raised); }
.scr-tabs button {
  flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: var(--ink-soft); font: 600 0.8125rem/1 var(--sans); white-space: nowrap;
}
.scr-tabs button[aria-selected="true"] { background: var(--sand); color: var(--ink); box-shadow: 0 1px 2px rgba(42, 39, 35, 0.12); }

.scr-parts { display: flex; gap: 16px; padding: 4px 22px 0; overflow-x: auto; scrollbar-width: none; }
.scr-parts::-webkit-scrollbar { display: none; }
.part {
  position: relative; flex: none; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 0.9375rem/1 var(--sans); color: var(--ink-soft); white-space: nowrap;
}
.part.on { color: var(--ink); font-weight: 600; }
.segs { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; gap: 3px; height: 2px; }
.seg { flex: 1; background: var(--sand-line); border-radius: 2px; overflow: hidden; }
.seg span { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform 0.45s var(--ease-out); }

.scr-cap { margin: 10px 22px 0; font-size: 0.8125rem; color: var(--ink-soft); }
.scr-body { position: relative; flex: 1; overflow-y: auto; padding: 14px 22px 20px; overscroll-behavior: contain; scrollbar-width: none; }
.scr-body::-webkit-scrollbar { display: none; }

.scr-bar { display: flex; gap: 10px; padding: 8px 22px 18px; }
.scr-back {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--sand-raised);
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.scr-next { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.scr-next:disabled { background: var(--sand-line); color: var(--ink-soft); cursor: default; }

/* ---------- Pieces ---------- */
.pieces { display: grid; gap: 12px; }
.piece.enter { animation: rise 0.5s var(--ease-out) both; }
@keyframes rise { from { opacity: 0.001; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.q {
  display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  padding: 13px 14px; border-radius: 16px; border: 0;
}
.q-me { background: #EAF1ED; }
.q-partner { background: #EAEFE6; }
.q-who { display: flex; align-items: center; gap: 7px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.q-me .dot, .dot.me { background: var(--you); }
.q-partner .dot, .dot.partner { background: var(--partner); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.q-text { display: block; font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; }

mark {
  color: inherit; background: transparent; border-radius: 4px; padding: 0 2px; margin: 0 -2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-color 0.45s var(--ease-out);
}
mark.on { background: var(--mark); }

.p-comment, .p-note { font-size: 1.0625rem; line-height: 1.55; margin: 2px 0; }
.p-note.past { color: rgba(42, 39, 35, 0.78); }
.p-label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
.p-label.block { margin: 28px 0 12px; }
.p-label.block:first-child { margin-top: 0; }
.p-labelled { padding: 4px 0; }
.p-labelled p:last-child { font-size: 1.0625rem; line-height: 1.6; }
.p-serif { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; }
.p-serif.lg { font-size: 1.1875rem; }
.p-soft, .soft { color: var(--ink-soft); }
.p-soft { font-size: 0.9375rem; margin-top: 6px; }
.p-raised { background: var(--sand-raised); border-radius: 16px; padding: 14px 16px; }
.p-tint { border-radius: 16px; padding: 13px 15px; }
.p-tint.orange { background: var(--report-orange-tint); }
.p-tint.yellow { background: var(--report-yellow-tint); margin-top: 14px; }
.p-hl { margin: 0 0 6px; }
.hl.blue { background: var(--you); }
.p-headline { font-family: var(--serif); font-weight: 500; font-size: 1.3125rem; line-height: 1.25; margin: 0 0 4px; }

/* ---------- Overview pages ---------- */
.ov p { margin: 0 0 12px; line-height: 1.65; }
.ov-head { font-size: 1.75rem; line-height: 1.25; margin: 6px 0 16px; }
.sub-title { font-family: var(--serif); font-weight: 500; font-size: 1.3125rem; margin: 0 0 10px; }
.sub .hl { font-size: 0.875rem; font-weight: 600; }
.rule { border: 0; border-top: 1px solid var(--sand-line); margin: 22px 0; }
.out { list-style: none; margin: 0; padding: 0; }
.out li + li { border-top: 1px solid var(--sand-line); }
.out-row {
  display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left; padding: 14px 0;
  border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer;
}
.out-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); flex: none; transform: translateY(-2px); }
.out-text { flex: 1; display: grid; gap: 4px; }
.out-text .soft { font-size: 0.9375rem; }
.out-chev { color: var(--ink-soft); transition: transform 0.25s var(--ease-out); }
.out-chev.open { transform: rotate(180deg); }
.out-quotes { display: grid; gap: 8px; padding-bottom: 14px; }
.fin [data-fin-join] { margin: 4px 0 18px; }
.fin .text-btn { margin: 0 0 6px; }
.fin-support { margin-top: 18px; }
.fin:has(.done) .fin-ask { display: none; }   /* once joined, the question has been answered */
.fin .signup .field-row { flex-direction: column; }

/* ---------- Transcript sheet ---------- */
.scr-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 58%; z-index: 3;
  background: var(--sand); border-top: 1px solid var(--sand-line); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 24px rgba(42, 39, 35, 0.10);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.35s var(--ease-out);
}
.scr-sheet.up { transform: none; }
.sheet-grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--sand-line); margin: 8px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 6px 22px; }
.sheet-title { margin: 0; font-weight: 600; }
.sheet-done { min-height: 44px; padding: 0 6px; border: 0; background: none; font: 600 1.0625rem/1 var(--sans); color: var(--ink); cursor: pointer; }
.sheet-lines { position: relative; list-style: none; margin: 0; padding: 4px 22px 22px; overflow-y: auto; flex: 1; }
.t-line { padding: 10px 8px; margin: 0 -8px; border-radius: 10px; display: grid; gap: 2px; }
.t-line .q-who { margin: 0; }
.t-sound { padding: 8px 0; font-style: italic; color: var(--ink-soft); font-size: 0.9375rem; }
.t-line.flash { animation: flash 1.1s ease-out 0.25s both; }
@keyframes flash { 0%, 45% { background: var(--report-yellow-tint); } 100% { background: transparent; } }

/* ---------- Phones: the reader opens full screen ---------- */
@media (max-width: 879px) {
  .demo.reading .phone {
    display: block; position: fixed; inset: 0; z-index: 50; background: var(--sand);
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  }
  .demo.reading .screen { border-radius: 0; }
  .demo.reading .scr-close { display: inline-flex; align-items: center; }
  html.demo-lock, html.demo-lock body { overflow: hidden; }
  html.demo-lock .dock { display: none !important; }
}

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .piece.enter, .t-line.flash { animation: none; }
  .t-line.flash { background: var(--report-yellow-tint); }
}

