/*
 * The demo: a sandbox payments workspace around one protected action.
 * Layout and screen-specific rules only; tokens and components come from
 * /css/graypass.css.
 */

:root {
  --demo-max: 72rem;
}

#demo-main {
  max-width: var(--demo-max);
  padding-block: clamp(1.75rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4.5rem);
}

.journey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.journey ol {
  display: flex;
  gap: clamp(1rem, 4vw, 3rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.journey li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.journey li span,
.step-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.journey li span {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.journey li[data-state="current"] { color: var(--fg); font-weight: 600; }
.journey li[data-state="current"] span { background: var(--pink); border-color: var(--pink); color: #101114; }
.journey li[data-state="complete"] span { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.demo-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--pink);
  border-radius: 8px;
  background: var(--surface);
}
.demo-notice p { margin-top: 0.25rem; font-size: 0.9rem; color: var(--muted); max-width: 70ch; }
.demo-notice button { flex-shrink: 0; }

/* ── screens ────────────────────────────────────────────────────────── */

.screen {
  display: none;
  gap: 1.5rem;
}

body[data-screen="intro"] [data-for="intro"],
body[data-screen="workspace"] [data-for="workspace"],
body[data-screen="action"] [data-for="action"],
body[data-screen="decision"] [data-for="decision"],
body[data-screen="summary"] [data-for="summary"] {
  display: grid;
  animation: screen-in 360ms cubic-bezier(0.3, 0.7, 0.2, 1) both;
}

/* Position only. Text keeps full contrast from the first frame, so the
 * automated accessibility scan and a person landing mid-transition read the
 * same page. */
@keyframes screen-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}

.screen > .marker + .type-h1 {
  margin-top: -0.6rem;
}

.screen > .type-h1 {
  max-width: 22ch;
}

.screen > .lede {
  margin-top: -0.5rem;
}

.figure-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--faint);
}

/* ── intro ──────────────────────────────────────────────────────────── */

.intro-caption { color: var(--muted); font-size: 0.85rem; }
.privacy-details { margin-top: 0.25rem; }
.privacy-details .intro-grid > div { padding-top: 0.25rem; padding-bottom: 0.5rem; }
.privacy-details .intro-grid > div:first-child { padding-left: 0; }
.privacy-details .consent { padding-top: 1rem; border-top: 1px solid var(--line); max-width: none; }

.intro-grid {
  display: grid;
  gap: 0;
}

.intro-grid > div {
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--line);
}

.intro-grid > div:first-child {
  border-top: 0;
}

.intro-grid p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.5;
}

@media (min-width: 760px) {
  .intro-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intro-grid > div {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .intro-grid > div:first-child {
    border-left: 0;
  }
}

.consent {
  max-width: 62ch;
}

/* ── workspace ──────────────────────────────────────────────────────── */

.inline-explainer { color: var(--muted); font-size: 0.875rem; }
.inline-explainer summary { cursor: pointer; padding-block: 0.5rem; }
.inline-explainer p { max-width: 80ch; padding-top: 0.5rem; line-height: 1.6; }
.back-link { justify-self: start; min-height: 44px; }

.payout-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.payout-row {
  border-bottom: 1px solid var(--line);
}

.payout-row summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.65rem 0.25rem;
  cursor: pointer;
  list-style: none;
  border-radius: 4px;
}

.payout-row summary::-webkit-details-marker {
  display: none;
}

.payout-row summary:hover {
  background: var(--surface-2);
}

.payout-row summary > span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.payout-row summary > span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.payout-row strong {
  font-weight: 600;
}

.payout-row small {
  color: var(--muted);
  font-size: 0.8rem;
}

.payout-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.25rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.helper {
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ── protected action ───────────────────────────────────────────────── */

.action-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.action-form {
  padding: 1.25rem;
  max-width: none;
}

.consequence {
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.consequence p {
  color: var(--muted);
  font-size: 0.925rem;
}

@media (min-width: 900px) {
  .action-layout {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

/* ── decision ───────────────────────────────────────────────────────── */

.decision {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.decision:empty {
  min-height: 7rem;
  background:
    linear-gradient(90deg, var(--surface-2) 0 40%, var(--surface) 50%, var(--surface-2) 60% 100%);
  background-size: 300% 100%;
  animation: waiting 1.6s ease-in-out infinite;
}

@keyframes waiting {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.decision-allow {
  border-left-color: var(--fg);
}

.decision-challenge {
  border: 0;
  padding: 0;
  gap: 0.35rem;
  background: transparent;
}

.decision-hold {
  border-left-color: var(--hist);
}

.decision-deny {
  border-left-color: var(--pink);
  background: var(--pink-soft);
}

.decision-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}

.decision-mode {
  color: var(--faint);
  font-size: 0.85rem;
}

.decision .detail {
  font-size: 1.05rem;
  line-height: 1.5;
}

.decision .app-result,
.decision .verification {
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.5;
}

.decision .app-result strong {
  color: var(--fg);
  font-weight: 600;
}

.decision-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}
.decision-flow li { position: relative; padding: 1.5rem 1rem 0 0; border-top: 1px solid var(--line-strong); display: grid; gap: 0.3rem; align-content: start; }
.decision-flow li::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border: 1px solid var(--line-strong); background: var(--bg); border-radius: 50%; }
.decision-flow li[data-state="complete"]::before { background: var(--fg); border-color: var(--fg); }
.decision-flow li[data-state="current"]::before { background: var(--pink); border-color: var(--pink); }
.decision-flow strong { font-size: 0.9rem; }
.decision-flow span { color: var(--muted); font-size: 0.8rem; line-height: 1.5; overflow-wrap: anywhere; }
.flow-drawer .decision-flow { margin: 1.5rem 1.15rem 1rem; }
#decision-next:empty { display: none; }
#delete-status:empty { display: none; }

.codes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.codes code {
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.challenge {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-left: 3px solid var(--pink);
}

.challenge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}

.challenge .primary {
  justify-self: start;
}

.inspection-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .inspection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.trace {
  overflow: hidden;
}

.trace summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.15rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.trace summary::-webkit-details-marker {
  display: none;
}

.trace summary::after {
  content: "+";
  color: var(--faint);
  font-weight: 500;
  transition: transform 200ms ease;
}

.trace[open] summary::after {
  transform: rotate(45deg);
}

.trace[open] summary {
  border-bottom: 1px solid var(--line);
}

.trace > div,
.trace > pre {
  padding: 1rem 1.15rem;
}

.trace > div {
  display: grid;
  gap: 0.9rem;
}

.trace > pre {
  background: var(--surface);
}

#proof-drawer {
  color: var(--fg);
}

#proof-drawer[open] {
  background: var(--surface);
}

#proof-drawer pre {
  color: var(--fg);
  max-height: 26rem;
}

.claims td,
.claims th {
  padding: 0.5rem 0.5rem;
  font-size: 0.82rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

#proof-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── summary ────────────────────────────────────────────────────────── */

.timeline {
  margin-left: 0.4rem;
}

.timeline li {
  display: grid;
  gap: 0.15rem;
}

.timeline .when {
  color: var(--faint);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.timeline .what {
  font-weight: 600;
}

.timeline .detail {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.summary-grid {
  display: grid;
  gap: 1rem;
}

.summary-grid > section {
  display: grid;
  gap: 0.5rem;
  padding: 1.15rem 1.25rem;
}

.summary-grid p {
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.5;
}

@media (min-width: 760px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.versions {
  display: grid;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem;
}

.versions h2 {
  font-size: 1rem;
  font-weight: 600;
}

.versions dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.4rem 1.25rem;
  font-size: 0.9rem;
}

.versions dt {
  color: var(--faint);
  font-weight: 600;
}

.versions dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ── footer note ────────────────────────────────────────────────────── */

.site-footer .footer-meta span:first-child {
  max-width: 60ch;
}

/* ── small screens ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .journey { align-items: flex-start; margin-bottom: 1.5rem; gap: 0.5rem; }
  .journey ol { flex: 1; gap: 0.5rem; }
  .journey li { flex: 1; flex-direction: column; align-items: flex-start; font-size: 0.72rem; line-height: 1.35; }
  .journey > button { font-size: 0.75rem; padding-inline: 0.4rem; }
  .intro-steps { grid-template-columns: 1fr; }
  .intro-steps li, .intro-steps li + li { display: grid; grid-template-columns: 2rem 1fr; padding: 1rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .intro-steps h2 { margin-top: 0; }
  .intro-steps .step-index { padding-top: 0.15rem; }
  .intro-steps p { grid-column: 2; max-width: none; }
  .privacy-details .intro-grid > div { padding-left: 0; padding-top: 0.8rem; padding-bottom: 0.8rem; }
  .workspace-guide, .demo-notice { flex-direction: column; align-items: stretch; gap: 0.8rem; }
  .continue-bar > .actions { width: 100%; }
  .destination-strip > .pill { margin-left: 0; }
  .decision-flow { grid-template-columns: 1fr 1fr; gap: 1.25rem 0; }
  .challenge .meta { grid-template-columns: 1fr; gap: 0.25rem; }
  .challenge .meta dd + dt { margin-top: 0.5rem; }
  .payout-row summary,
  .review-queue li {
    flex-wrap: wrap;
  }

  .payout-row summary > span:last-child {
    text-align: left;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .actions .primary,
  .actions .secondary {
    width: 100%;
  }

  .versions dl,
  .consequence .meta {
    grid-template-columns: 1fr;
    gap: 0.15rem 0;
  }

  .versions dt,
  .consequence .meta dt {
    margin-top: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none !important;
  }

  .decision:empty {
    animation: none;
    background: var(--surface-2);
  }
}

/* A guided experience: one activity, one next step, optional live detail. */
:root { --demo-max: 50rem; }
#demo-main { padding-block: clamp(1.5rem, 4vw, 3rem) 3.5rem; }
.intro-focus { display: grid; justify-items: start; gap: 1.2rem; padding-block: clamp(1rem, 4vw, 3rem) 1rem; }
.intro-focus .type-h1 { max-width: 13ch; font-size: clamp(2.8rem, 6.4vw, 5.25rem); line-height: 1.02; letter-spacing: -0.065em; }
.intro-focus .lede { max-width: 47ch; }
.intro-focus > .primary { margin-top: 0.35rem; }
.intro-route { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; padding-top: 1rem; color: var(--muted); font-size: 0.83rem; }
.journey { gap: 0.75rem; margin-bottom: 1.6rem; }
.journey ol { gap: clamp(0.65rem, 2.5vw, 1.5rem); }
.journey-tools { display: flex; gap: 0.35rem; flex-shrink: 0; }
.journey-tools button { font-size: 0.76rem; padding: 0.4rem; }
.stage-heading { display: grid; gap: 0.7rem; }
.stage-heading .type-h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.1; letter-spacing: -0.045em; }
.stage-heading .lede { font-size: 1rem; max-width: 57ch; }
.guided-workspace { gap: 1.1rem; }
.activity-stage { background: var(--surface); overflow: hidden; }
.guided-task { padding: 1.3rem 1.5rem; min-height: 16rem; }
.guided-task label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.55rem; }
.guided-task textarea { width: 100%; min-height: 9rem; resize: vertical; font-family: var(--font-sans); font-size: 1.05rem; line-height: 1.55; background: var(--bg); }
.task-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.task-caption strong { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.task-context { color: var(--muted); font-size: 0.86rem; margin-bottom: 0.8rem; }
.task-controls { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1.5rem; background: var(--bg); border-top: 1px solid var(--line); }
.task-position { margin-right: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.task-controls button { font-size: 0.8rem; padding: 0.55rem 0.85rem; }
.guided-task .payout-list { gap: 0; border-top: 1px solid var(--line); }
.guided-task .payout-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.guided-task .payout-row summary { padding: 0.75rem 0.25rem; font-size: 0.88rem; }
.guided-task .payout-row summary > span:last-child { margin-left: auto; padding-right: 1.5rem; }
.guided-task .payout-detail { padding: 0.25rem 0.25rem 0.7rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.guided-task .payout-detail p { font-size: 0.8rem; color: var(--muted); }
.statement-scroll { height: 14rem; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); }
.statement-row { padding: 1.25rem; border-bottom: 1px solid var(--line); }
.statement-row > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.statement-row span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.statement-row p { margin-top: 0.45rem; font-size: 0.85rem; color: var(--muted); }
.statement-row button { margin-top: 0.5rem; }
.sampling-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; padding: 0.3rem 0; }
.local-sampling, .server-sampling { display: grid; align-content: start; gap: 0.4rem; }
.server-sampling { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.sampling-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.76rem; color: var(--muted); }
.sampling-light { width: 6px; height: 6px; border-radius: 50%; background: var(--fg); }
.sampling-light.is-paused { background: var(--line-strong); }
.activity-pulses { display: flex; gap: 4px; align-items: center; height: 25px; }
.pulse-bar { flex: 1; max-width: 9px; border-radius: 2px; background: var(--pink); height: 3px; transition: height 120ms ease; }
.pulse-bar.level-0 { background: var(--line-strong); }
.pulse-bar.level-1 { height: 7px; }
.pulse-bar.level-2 { height: 13px; }
.pulse-bar.level-3 { height: 19px; }
.pulse-bar.level-4 { height: 25px; }
#local-event-count, #coverage-count { font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
#coverage-detail, #window-timing { color: var(--muted); font-size: 0.75rem; line-height: 1.4; }
#window-timing { font-variant-numeric: tabular-nums; }
.sampling-strip > button { justify-self: start; font-size: 0.75rem; padding: 0; }
.enrollment-gate { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.45rem 0.6rem; padding-top: 1.15rem; border-top: 1px solid var(--line-strong); }
.enrollment-gate > .dot { margin-top: 0.4rem; }
.enrollment-gate strong { font-size: 0.88rem; }
.enrollment-gate .helper { margin-top: 0.3rem; font-size: 0.8rem; line-height: 1.5; }
.enrollment-gate > button { grid-column: 2; justify-self: start; margin-top: 0.5rem; }
.task-alternative { color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.task-alternative button { font-size: inherit; }
.collection-context { color: var(--muted); font-size: 0.86rem; border-left: 2px solid var(--pink); padding-left: 0.85rem; }
.action-layout { display: flex; flex-direction: column; gap: 1rem; }
.action-form { padding: 1.3rem 1.5rem; }
.current-destination { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.75rem; font-size: 0.85rem; }
.current-destination > span, .current-destination > p { color: var(--muted); }
.current-destination > p { flex-basis: 100%; font-size: 0.8rem; }
.experiment-panel { display: grid; gap: 0.7rem; padding: 1.3rem 1.5rem; background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--pink); border-radius: 8px; }
.experiment-panel > p:not(.marker) { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.experiment-panel .actions { margin-top: 0.3rem; gap: 0.65rem; }
.experiment-panel .actions button { font-size: 0.82rem; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.comparison:empty { display: none; }
.comparison > div { display: grid; gap: 0.35rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.comparison span, .comparison small { color: var(--muted); font-size: 0.75rem; }
.comparison strong { font-size: 0.87rem; }
.telemetry-panel { display: grid; gap: 1rem; margin-top: 1.5rem; padding: 1.25rem; background: var(--surface); }
.telemetry-panel header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.telemetry-panel header h2 { margin-top: 0.35rem; }
.telemetry-panel section { display: grid; gap: 0.65rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.telemetry-panel h3 { font-size: 0.9rem; }
.telemetry-panel dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 0.75rem; font-size: 0.79rem; }
.telemetry-panel dt { color: var(--muted); }
.telemetry-panel dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.telemetry-panel .fineprint { font-size: 0.74rem; }
.telemetry-claims { margin-block: 0.75rem; }
@media (min-width: 1100px) {
  body[data-telemetry="open"] #demo-main { max-width: 50rem; width: calc(100% - 400px); margin-left: max(1.5rem, calc((100vw - 1200px) / 2)); margin-right: 0; }
  .telemetry-panel { position: fixed; width: 19rem; top: 6rem; right: 1.5rem; bottom: 1.5rem; margin: 0; overflow-y: auto; align-content: start; z-index: 20; box-shadow: 0 8px 28px rgb(0 0 0 / 5%); }
}
@media (max-width: 640px) {
  #demo-main { padding-top: 1.25rem; }
  .screen { gap: 1rem; }
  .intro-focus { gap: 1rem; padding-top: 0.75rem; }
  .intro-focus .lede { font-size: 1rem; }
  .intro-route { gap: 0.45rem; font-size: 0.73rem; }
  .journey { flex-wrap: wrap; gap: 0.5rem; padding-bottom: 0.65rem; margin-bottom: 1.15rem; }
  .journey ol { flex-basis: 100%; gap: 0.7rem; }
  .journey li { flex-direction: row; align-items: center; gap: 0.35rem; font-size: 0.68rem; }
  .journey li span { width: 1.35rem; height: 1.35rem; flex-shrink: 0; font-size: 0.65rem; }
  .journey-tools { width: 100%; justify-content: space-between; }
  .journey-tools button { padding: 0.25rem 0; }
  .guided-workspace { gap: 0.95rem; }
  .stage-heading { gap: 0.55rem; }
  .stage-heading .lede { font-size: 0.92rem; }
  .guided-task { padding: 1rem; min-height: 14rem; }
  .guided-task textarea { min-height: 8rem; font-size: 1rem; }
  .task-caption { font-size: 0.72rem; }
  .task-controls { padding: 0.7rem 1rem; gap: 0.3rem; }
  .task-controls button { font-size: 0.73rem; padding: 0.55rem 0.6rem; }
  .sampling-strip { gap: 0.5rem 1rem; }
  .server-sampling { padding-left: 1rem; }
  .sampling-label { font-size: 0.68rem; }
  #local-event-count, #coverage-count { font-size: 0.78rem; }
  #coverage-detail, #window-timing { font-size: 0.7rem; }
  .enrollment-gate { padding-top: 0.85rem; }
  .enrollment-gate > button { grid-column: 1 / -1; justify-self: stretch; }
  .guided-task .payout-row summary > span:last-child { padding-right: 1rem; }
  .action-form, .experiment-panel { padding: 1rem; }
  .comparison { gap: 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-bar { transition: none; }
}
.identity-readout { display: grid; gap: 0.4rem; padding: 1rem 1.2rem; border-left: 3px solid var(--line-strong); background: var(--surface); }
.identity-readout[data-state="familiar"] { border-left-color: var(--pink); }
.identity-readout .marker { font-size: 0.68rem; }
.identity-readout strong { font-size: 1.05rem; letter-spacing: -0.02em; }
.identity-readout p { color: var(--muted); font-size: 0.8rem; line-height: 1.5; max-width: 65ch; }
/* Keep activity, real feedback, and the available next step together. */
body[data-screen="workspace"] #demo-main { padding-top: 1.5rem; }
.journey { margin-bottom: 1.1rem; padding-bottom: 0.9rem; }
.guided-task { min-height: 0; padding: 1rem 1.25rem; }
.guided-task textarea { min-height: 6rem; height: 7rem; }
.task-controls { padding: 0.65rem 1.25rem; }
.enrollment-gate { grid-template-columns: auto minmax(0, 1fr) auto; padding-top: 0.9rem; }
.enrollment-gate > button { grid-column: 3; grid-row: 1; align-self: center; margin: 0 0 0 0.7rem; font-size: 0.83rem; }
.enrollment-gate .helper { font-size: 0.77rem; }
.telemetry-heading { display: flex; gap: 0.8rem; align-items: start; justify-content: space-between; }
.telemetry-heading h2 { margin-top: 0.35rem; }
.identity-readout { gap: 0.3rem; padding: 0.85rem 1rem; }
@media (max-width: 640px) {
  body[data-screen="workspace"] #demo-main { padding-top: 1rem; }
  .journey { margin-bottom: 0.95rem; padding-bottom: 0.6rem; }
  .guided-task { padding: 0.85rem 1rem; min-height: 0; }
  .guided-task textarea { min-height: 6rem; height: 6.5rem; }
  .task-controls { padding: 0.6rem 1rem; }
  .enrollment-gate { grid-template-columns: auto minmax(0, 1fr); }
  .enrollment-gate > button { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; margin: 0.35rem 0 0; }
}
.enrollment-gate > .dot { width: 7px; height: 7px; border: 0; border-radius: 50%; background: var(--line-strong); }
.enrollment-gate > .dot.coverage-sparse { background: var(--muted); }
.enrollment-gate > .dot.coverage-basic,
.enrollment-gate > .dot.coverage-rich { background: var(--fg); }
.action-layout { align-items: stretch; }
.identity-readout[data-state="attention"] { border-left-color: var(--pink); background: var(--pink-soft); }
.enrollment-gate > .dot.coverage-partial { background: var(--muted); }
.enrollment-gate > .dot.coverage-sufficient { background: var(--fg); }

/* Optional sensing stays secondary to the current activity. */
.sensing-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.sensing-toolbar > span { color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.sensing-toolbar > button { flex-shrink: 0; font-size: 0.75rem; }
.eye-quick-actions { display: flex; flex-shrink: 0; gap: 0.5rem; }
.eye-quick-actions button { font-size: 0.75rem; }
.telemetry-tools { display: flex; align-items: center; gap: 0.75rem; }
.telemetry-jump { font-size: 0.73rem; }
.journey { flex-wrap: wrap; }
.journey ol { flex: 1 1 100%; justify-content: space-between; }
.journey-tools { width: 100%; justify-content: space-between; }
.journey-tools { flex-wrap: wrap; }
.journey-tools .telemetry-toggle { padding: 0.45rem 0.7rem; border-color: var(--pink); font-size: 0.75rem; }
.telemetry-toggle[aria-expanded="true"]::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 0.5rem; border-radius: 50%; background: var(--pink); }
.signal-path { display: grid; gap: 1rem; }
.signal-path > section { border: 0; padding: 0; }
.signal-path h3 { display: flex; gap: 0.5rem; align-items: center; }
.signal-path h3 > span { color: var(--muted); font-family: var(--font-mono, monospace); font-size: 0.7rem; }
#telemetry-receipt-summary { font-size: 0.8rem; color: var(--muted); }
#telemetry-cue { font-size: 0.9rem; line-height: 1.5; }
#telemetry-cue[data-state="familiar"] { border-left: 3px solid var(--pink); padding-left: 0.65rem; }
.eye-heading { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }
.eye-heading .pill { font-size: 0.65rem; }
.eye-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.eye-actions button { font-size: 0.72rem; }
#eye-display-controls { display: grid; gap: 0.6rem; }
#eye-display-controls label { font-size: 0.77rem; }
#eye-preview { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
#eye-video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); background: var(--fg); }
#eye-preview figcaption { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.65rem; font-size: 0.7rem; color: var(--muted); }
.telemetry-receipts { border-top: 1px solid var(--line); padding-top: 1rem; }
.telemetry-receipts > summary { font-size: 0.8rem; font-weight: 500; cursor: pointer; }
.telemetry-receipts > div { margin-top: 1rem; }
.handoff-guide { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }
.handoff-guide summary { color: var(--fg); cursor: pointer; }
.handoff-guide p { margin-top: 0.75rem; }
.summary-grid { grid-template-columns: 1fr; }
#gaze-overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
#eye-calibration { position: fixed; inset: 0; margin: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; background: var(--bg, #f4f4f1); color: var(--fg); }
#eye-calibration::backdrop { background: var(--bg, #f4f4f1); }
#calibration-target { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.calibration-copy { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(26rem, calc(100% - 3rem)); text-align: center; display: grid; justify-items: center; gap: 1rem; }
.calibration-copy > p:not(.marker) { font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
#eye-calibration-progress { width: 8rem; height: 4px; accent-color: var(--pink); }
#eye-calibration.is-tracking .calibration-copy { top: 0; left: 0; transform: none; width: 100%; padding: 0.65rem 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.9rem; align-items: center; }
#eye-calibration.is-tracking h2 { font-size: 0.8rem; }
#eye-calibration.is-tracking #eye-calibration-detail { display: none; }
#eye-calibration.is-tracking .marker { font-size: 0.65rem; }
#eye-calibration.is-tracking button { font-size: 0.7rem; padding: 0.45rem 0.65rem; }
#eye-calibration.is-tracking progress { width: 4rem; }
@media (min-width: 1100px) {
  .telemetry-jump { display: none; }
  .telemetry-panel { width: 20rem; }
  body[data-telemetry="open"] #demo-main { width: calc(100% - 425px); }
}
@media (max-width: 640px) {
  .journey ol { gap: 0.45rem; }
  .journey li { flex-direction: column; align-items: start; font-size: 0.62rem; gap: 0.35rem; }
  .sensing-toolbar { gap: 0.5rem; }
  .sensing-toolbar > span { font-size: 0.7rem; }
  .sensing-toolbar > button { padding: 0.5rem 0.65rem; font-size: 0.7rem; }
  .eye-quick-actions { flex-direction: column; gap: 0.4rem; }
  .eye-quick-actions button { padding: 0.5rem 0.65rem; font-size: 0.7rem; }
  .telemetry-tools { gap: 0.45rem; }
  .telemetry-jump { font-size: 0.65rem; }
  .telemetry-panel { padding: 1rem; }
  #eye-calibration.is-tracking h2 { display: none; }
  #eye-calibration.is-tracking .calibration-copy { gap: 0.35rem 0.5rem; padding: 0.45rem; }
}
@media (max-width: 360px) {
  .journey-tools .telemetry-toggle { font-size: 0.7rem; padding: 0.4rem 0.45rem; }
}
