/* replay-demo — one product, two themes, one seam.
 *
 * Every colour below is a CANONICAL Recued token (D-174 P6,
 * recued-dev/apps/webclient/build/tokens.css). The two panes are literally
 * the two halves of that token sheet: the visitor's world runs the LIGHT
 * block, the owner's Recued runs the DARK block, split at an accent seam.
 * Per the token sheet's own rule there are NO new hues — held/success carry
 * meaning by glyph + label + weight on neutral surfaces; the one accent is
 * --accent, danger is reserved. Type matches the webclient: system sans +
 * ui-monospace. Self-contained: no webfonts, no external requests.
 */

:root {
  /* Recued light tokens (page chrome + visitor pane) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-sunk: #f4f6f8;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --fg-subtle: #a1a1aa;
  --fg-muted: #71717a;
  --fg: #27272a;
  --fg-strong: #18181b;
  --accent: #0e7490;
  --accent-weak: rgba(14, 116, 144, 0.10);
  --danger: #dc2626;
  --on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04), 0 10px 28px rgba(24, 24, 27, 0.05);
  --shadow-lg: 0 28px 72px -44px rgba(24, 24, 27, 0.55);

  /* Recued dark tokens (the owner pane pulls from these) */
  --d-bg: #09090b;
  --d-surface: #18181b;
  --d-surface-sunk: #242428;
  --d-border: #27272a;
  --d-border-strong: #3f3f46;
  --d-fg-subtle: #52525b;
  --d-fg-muted: #a1a1aa;
  --d-fg: #e4e4e7;
  --d-fg-strong: #fafafa;
  --d-accent: #22c1d6;
  --d-accent-weak: rgba(34, 193, 214, 0.15);
  --d-on-accent: #061315;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 50% -12rem, var(--accent-weak), transparent 36rem),
    var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Header ─────────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  z-index: 10;
}
.header-inner {
  width: min(82rem, calc(100% - 2.5rem));
  min-height: 4rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand { font-size: 0.92rem; color: var(--fg-strong); white-space: nowrap; letter-spacing: -0.01em; }
.brand b { font-weight: 700; }
.brand span { color: var(--fg-muted); }

#tabs { display: flex; gap: 0.25rem; }
.tab {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.46rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.tab:hover { background: var(--surface-sunk); color: var(--fg); }
.tab-active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--fg-strong);
  box-shadow: var(--shadow-sm);
}
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pattern-tab-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 1.75rem;
  margin: auto 0.18rem;
  background: var(--border);
}
.pattern-tab {
  flex: 0 0 auto;
  display: grid;
  align-content: center;
  gap: 0.08rem;
  min-height: 2.55rem;
  padding: 0.35rem 0.72rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 8px;
  background: var(--accent-weak);
  color: var(--fg);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.pattern-tab:hover { border-color: var(--accent); color: var(--fg-strong); transform: translateY(-1px); }
.pattern-tab-active { border-style: solid; border-color: var(--accent); box-shadow: var(--shadow-sm); }
.pattern-tab-kicker {
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}
.pattern-tab-name { font-size: 0.69rem; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.pattern-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.controls { margin-left: auto; display: flex; gap: 0.4rem; align-items: center; }
.ctl {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 650;
  padding: 0.46rem 0.68rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.ctl:hover { border-color: var(--border-strong); color: var(--fg); transform: translateY(-1px); }
.ctl:disabled { opacity: 0.4; cursor: default; transform: none; }
.ctl-primary { min-width: 6.3rem; justify-content: center; background: var(--fg-strong); border-color: var(--fg-strong); color: var(--bg); }
.ctl-primary:hover { color: var(--bg); }
.ctl-quiet { border-color: transparent; background: transparent; }
.ctl-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ctl-on:hover { color: var(--on-accent); }
.ctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sim-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}
.sim-badge i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

/* ── Business world + story chapters ───────────────────────── */

.world-strip {
  width: min(76rem, calc(100% - 2.5rem));
  margin: 1rem auto 0;
  display: grid;
  grid-template-columns: minmax(16rem, 0.85fr) minmax(24rem, 1.15fr);
  align-items: center;
  gap: 1.25rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-sm);
}
.world-copy { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.28rem 0.55rem; }
.world-kicker {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}
#deck-name { font-size: 0.88rem; color: var(--fg-strong); }
#deck-summary { min-width: 0; font-size: 0.72rem; color: var(--fg-muted); }
#studio-return {
  flex: none;
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
#studio-return:hover { text-decoration: underline; text-underline-offset: 3px; }
#studio-return:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Story chips WRAP rather than scroll. They were an overflow-x strip with the
   scrollbar hidden, which clipped the last chip mid-word — at 1440px the
   seller deck's fifth story ("Use a service specialist") was cut off with no
   affordance that anything lay to the right, so it read as a broken layout
   rather than a scrollable strip. The chips are the story navigation; every
   one has to be visible. */
.story-tabs { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.35rem; }
.story-tab {
  flex: 0 0 auto;
  min-height: 2.2rem;
  padding: 0.42rem 0.68rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-sunk);
  color: var(--fg-muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.story-tab:hover { border-color: var(--border-strong); color: var(--fg); }
.story-tab-active { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.story-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Narration ─────────────────────────────────────────────── */

.story-copy {
  width: min(60rem, calc(100% - 2rem));
  margin: 0.9rem auto 0.75rem;
  text-align: center;
}
.story-meta {
  min-height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.story-meta span + span::before { content: '·'; margin-right: 0.7rem; color: var(--fg-subtle); }
#story-state { color: var(--accent); }
#narration {
  font-size: clamp(0.98rem, 1.5vw, 1.14rem);
  line-height: 1.5;
  color: var(--fg);
  max-width: 52rem;
  margin: 0.42rem auto 0;
  min-height: 3em;
  text-wrap: balance;
}
.narr-in { animation: narr 420ms ease both; }
@keyframes narr {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* ── Stage ─────────────────────────────────────────────────── */

#stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(76rem, calc(100% - 2.5rem));
  height: clamp(34rem, 64vh, 42rem);
  margin: 0 auto 0.75rem;
}
.stage-in { animation: stage 520ms ease both; }
@keyframes stage {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Pane-scoped token remap: components style against --p-* and render
 * correctly on either theme half. */
.pane {
  --p-surface: var(--surface);
  --p-surface-sunk: var(--surface-sunk);
  --p-border: var(--border);
  --p-border-strong: var(--border-strong);
  --p-fg-subtle: var(--fg-subtle);
  --p-fg-muted: var(--fg-muted);
  --p-fg: var(--fg);
  --p-fg-strong: var(--fg-strong);
  --p-accent: var(--accent);
  --p-accent-weak: var(--accent-weak);
  --p-on-accent: var(--on-accent);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: var(--p-fg);
  transition: opacity 280ms ease, filter 280ms ease;
}
.pane-dim { opacity: 0.68; filter: saturate(0.7); }

#pane-left {
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 16px 0 0 16px;
  box-shadow: var(--shadow-lg);
}
#pane-right {
  --p-surface: var(--d-surface);
  --p-surface-sunk: var(--d-surface-sunk);
  --p-border: var(--d-border);
  --p-border-strong: var(--d-border-strong);
  --p-fg-subtle: var(--d-fg-subtle);
  --p-fg-muted: var(--d-fg-muted);
  --p-fg: var(--d-fg);
  --p-fg-strong: var(--d-fg-strong);
  --p-accent: var(--d-accent);
  --p-accent-weak: var(--d-accent-weak);
  --p-on-accent: var(--d-on-accent);
  background: var(--d-bg);
  border: 1px solid var(--d-border);
  border-left: none;
  border-radius: 0 16px 16px 0;
  box-shadow: 0 28px 72px -42px rgba(0, 0, 0, 0.85);
}

/* the seam — the one accent, and the gate */
#stage::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, var(--accent) 16%, var(--d-accent) 84%, transparent);
  z-index: 3;
  pointer-events: none;
}

.pane-head {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  min-height: 3rem;
  padding: 0.85rem 1.1rem 0.65rem;
  color: var(--p-fg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid color-mix(in srgb, var(--p-border) 55%, transparent);
}
.pane-role { font-size: 0.56rem; letter-spacing: 0.1em; color: var(--p-fg-subtle); }
.pane-active .pane-role { color: var(--p-accent); }

.pane-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 1rem 1.15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.pane-body > .card,
.pane-body > .stack {
  width: 100%;
  max-width: 33rem;
  margin: auto;
}

.pane-action {
  min-height: 5.35rem;
  padding: 0.75rem 1.1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.76rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  min-height: 3rem;
  min-width: 12rem;
  background: var(--p-accent);
  color: var(--p-on-accent);
  box-shadow: 0 10px 28px -16px var(--p-accent);
  transition: transform 120ms ease, box-shadow 200ms ease;
}
.action-btn.idle { visibility: hidden; }
.action-btn.live { animation: breathe 1.9s ease-in-out infinite; }
.action-btn.live:hover { transform: translateY(-1px); }
.action-btn.live:active { transform: translateY(1px); }
.action-btn:focus-visible { outline: 2px solid var(--p-fg-strong); outline-offset: 2px; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 116, 144, 0); }
  50%      { box-shadow: 0 0 0 6px var(--p-accent-weak); }
}

/* the crossing ghost */
.ghost {
  position: absolute;
  top: 42%;
  width: 120px;
  height: 60px;
  border-radius: 10px;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}
.ghost-right { left: 22%; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5); }
.ghost-left  { right: 22%; background: var(--d-surface); border: 1px solid var(--d-border-strong); }
.ghost-go { transition: transform 760ms cubic-bezier(0.5, 0, 0.2, 1), opacity 760ms ease; opacity: 0.95; }
.ghost-right.ghost-go { transform: translateX(56vw) scale(0.6); opacity: 0; }
.ghost-left.ghost-go  { transform: translateX(-56vw) scale(0.6); opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .ghost { display: none; }
  .action-btn.live { animation: none; }
}

/* ── Card grammar (both panes, via --p-* tokens) ───────────── */

.stack { display: flex; flex-direction: column; gap: 0.7rem; }

.card {
  border-radius: 10px;
  padding: 1rem 1.08rem;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  box-shadow: 0 12px 30px -26px rgba(0, 0, 0, 0.6);
  animation: cardIn 320ms ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--p-fg-strong);
  margin-bottom: 0.6rem;
}

.kv-list { display: flex; flex-direction: column; gap: 0.34rem; }
.kv { display: flex; gap: 0.8rem; align-items: baseline; }
.kv-label {
  flex: 0 0 6.4rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
}
.kv-value { min-width: 0; font-size: 0.9rem; color: var(--p-fg); overflow-wrap: anywhere; }

.form-note, .sim-note {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--p-fg-muted);
}

/* covers */

.cover { margin: auto; text-align: center; padding: 2rem 1rem; }
.kicker {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
  margin-bottom: 0.6rem;
}
.cover-name {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--p-fg-strong);
  text-wrap: balance;
}
.cover-line { margin-top: 0.55rem; font-size: 0.85rem; color: var(--p-fg-muted); }

/* slots */

.slot-days { display: flex; gap: 0.9rem; }
.slot-day { flex: 1; }
.slot-day-name {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
  margin-bottom: 0.4rem;
}
.slot-list { display: flex; flex-direction: column; gap: 0.35rem; }
.slot {
  border: 1px solid var(--p-border);
  border-radius: 6px;
  padding: 0.42rem 0.5rem;
  font-size: 0.84rem;
  text-align: center;
  background: var(--p-surface-sunk);
  color: var(--p-fg);
}
.slot-picked {
  background: var(--p-accent);
  border-color: var(--p-accent);
  color: var(--p-on-accent);
  font-weight: 600;
}

/* checkout */

.checkout-card { max-width: 24rem; margin: auto; width: 100%; }
.checkout-brand {
  font-weight: 700;
  color: var(--p-fg-strong);
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--p-border);
}
.checkout-total-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--p-border);
  font-weight: 600;
  color: var(--p-fg-strong);
}
.checkout-total { font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* seller catalog + metered access */

.catalog-card { max-width: 29rem; margin: auto; width: 100%; }
.catalog-subtitle {
  margin: -0.32rem 0 0.72rem;
  font-size: 0.78rem;
  color: var(--p-fg-muted);
}
.offer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.offer-card {
  min-width: 0;
  border: 1px solid var(--p-border);
  border-radius: 8px;
  padding: 0.66rem 0.72rem;
  background: var(--p-surface-sunk);
}
.offer-selected { border-color: var(--p-accent); background: var(--p-accent-weak); }
.offer-topline { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.offer-kind {
  font-size: 0.56rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
}
.offer-price { font-size: 0.72rem; font-weight: 700; color: var(--p-accent); white-space: nowrap; }
.offer-seller { margin-top: 0.26rem; font-size: 0.56rem; letter-spacing: 0.07em; color: var(--p-fg-muted); }
.offer-name { margin-top: 0.2rem; font-size: 0.86rem; font-weight: 700; color: var(--p-fg-strong); }
.offer-detail { margin-top: 0.18rem; font-size: 0.68rem; line-height: 1.38; color: var(--p-fg-muted); }

.access-card { max-width: 28rem; margin: auto; width: 100%; }
.access-heading { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.access-plan { min-width: 0; font-size: 0.96rem; font-weight: 700; color: var(--p-fg-strong); }
.access-state {
  flex: none;
  border: 1px solid var(--p-border-strong);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
}
.access-active { border-color: var(--p-accent); color: var(--p-accent); background: var(--p-accent-weak); }
.access-details { margin-top: 0.65rem; padding-top: 0.55rem; border-top: 1px solid var(--p-border); }
.usage-list { display: flex; flex-direction: column; gap: 0.72rem; margin-top: 0.8rem; }
.usage-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.usage-label { font-size: 0.8rem; font-weight: 650; color: var(--p-fg-strong); }
.usage-count { font-size: 0.66rem; color: var(--p-fg); }
.usage-meter {
  display: block;
  width: 100%;
  height: 0.38rem;
  margin-top: 0.28rem;
  border: 0;
  border-radius: 999px;
  background: var(--p-border);
}
.usage-meter::-webkit-meter-bar { border: 0; border-radius: 999px; background: var(--p-border); }
.usage-meter::-webkit-meter-optimum-value { border-radius: 999px; background: var(--p-accent); }
.usage-meter::-moz-meter-bar { border-radius: 999px; background: var(--p-accent); }
.usage-meta { margin-top: 0.2rem; font-size: 0.56rem; letter-spacing: 0.05em; color: var(--p-fg-muted); }

.api-card { max-width: 28rem; margin: auto; width: 100%; }
.api-eyebrow { font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-accent); }
.api-card .card-title { margin: 0.15rem 0 0.6rem; }
.api-endpoint {
  border: 1px solid var(--p-border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  background: var(--p-surface-sunk);
  font-size: 0.66rem;
  color: var(--p-fg-strong);
  overflow-wrap: anywhere;
}
.api-section { margin: 0.66rem 0 0.3rem; font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-fg-muted); }
.api-payload .kv-label { flex-basis: 5.2rem; }
.api-response { margin-top: 0.55rem; border-top: 1px solid var(--p-border); }
.api-response-body { font-size: 0.82rem; line-height: 1.45; color: var(--p-fg); }
.api-pending { margin-top: 0.65rem; font-size: 0.64rem; color: var(--p-fg-muted); }

/* bounded local CLI invocation — presented as a tool seam, never a shell */

.cli-command {
  border: 1px solid var(--p-border);
  border-radius: 6px;
  padding: 0.58rem 0.62rem;
  background: var(--p-surface-sunk);
  font-size: 0.66rem;
  line-height: 1.45;
  color: var(--p-fg-strong);
  overflow-wrap: anywhere;
}
.cli-prompt { color: var(--p-accent); font-weight: 800; }
.cli-state {
  display: inline-flex;
  margin-top: 0.52rem;
  border: 1px solid var(--p-border-strong);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-accent);
}
.cli-details { margin-top: 0.68rem; padding-top: 0.58rem; border-top: 1px solid var(--p-border); }

/* public social channels + the local publishing queue */

.social-card { max-width: 29rem; margin: auto; width: 100%; }
.social-empty {
  min-height: 7rem;
  display: grid;
  place-items: center;
  border: 1px dashed var(--p-border-strong);
  border-radius: 8px;
  color: var(--p-fg-muted);
  font-size: 0.82rem;
}
.social-posts { display: flex; flex-direction: column; gap: 0.55rem; }
.social-post { border: 1px solid var(--p-border); border-radius: 8px; padding: 0.65rem 0.72rem; background: var(--p-surface-sunk); }
.social-post-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.social-network { font-size: 0.68rem; font-weight: 750; color: var(--p-fg-strong); }
.social-state {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-accent);
}
.social-handle { margin-top: 0.08rem; font-size: 0.58rem; color: var(--p-fg-muted); }
.social-body { margin-top: 0.45rem; font-size: 0.8rem; line-height: 1.42; color: var(--p-fg); }

.publish-card { max-width: 28rem; margin: auto; width: 100%; }
.publish-heading { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.publish-state {
  flex: none;
  border: 1px solid var(--p-border-strong);
  border-radius: 999px;
  padding: 0.2rem 0.48rem;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-accent);
}
.publish-targets { margin-top: 0.78rem; display: flex; flex-direction: column; gap: 0.42rem; }
.publish-target {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.48rem 0.58rem;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  background: var(--p-surface-sunk);
}
.publish-target-name { font-size: 0.78rem; font-weight: 650; color: var(--p-fg-strong); }
.publish-target-state { text-align: right; font-size: 0.58rem; color: var(--p-fg-muted); }

/* mail + chat */

.mail-from {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--p-fg-muted);
}
.mail-subject {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--p-fg-strong);
  margin: 0.25rem 0 0.4rem;
  overflow-wrap: anywhere;
}
.mail-body { min-width: 0; font-size: 0.87rem; line-height: 1.5; color: var(--p-fg); overflow-wrap: anywhere; }

.chip-row { display: flex; gap: 0.4rem; margin-top: 0.65rem; flex-wrap: wrap; }
.chip {
  font-family: var(--mono);
  font-size: 0.64rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--p-accent);
  color: var(--p-accent);
  background: var(--p-accent-weak);
}
.chip-action { border-style: dashed; }

.chat-channel {
  font-size: 0.68rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  color: var(--p-fg-muted);
  margin-bottom: 0.6rem;
}
.chat-scroll { display: flex; flex-direction: column; gap: 0.45rem; }
.bubble {
  max-width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 10px 10px 10px 4px;
  background: var(--p-surface-sunk);
  border: 1px solid var(--p-border);
  font-size: 0.85rem;
  line-height: 1.42;
  align-self: flex-start;
  color: var(--p-fg);
}
.bubble-recued {
  background: var(--p-surface);
  border-color: var(--p-border-strong);
}

.blank-pane { flex: 1; display: flex; align-items: center; justify-content: center; }
.blank-line { font-size: 0.88rem; font-style: italic; color: var(--p-fg-subtle); }

/* owner grammar */

.owner-card-head {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
  margin-bottom: 0.7rem;
}

.owner-empty { font-size: 0.85rem; color: var(--p-fg-muted); font-style: italic; }

/* HELD carries meaning by glyph + label + weight on NEUTRAL surfaces —
 * the token sheet forbids a new amber/green hue (D-174 / WCAG 1.4.1). */
.held-card {
  border: 1px solid var(--p-border);
  border-left: 3px solid var(--p-border-strong);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  background: var(--p-surface);
  animation: cardIn 320ms ease both;
}
.held-card.is-held {
  border-left-color: var(--p-fg-strong);
  background: var(--p-surface-sunk);
}
.held-kind {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
}
.held-card.is-held .held-kind { color: var(--p-fg-strong); font-weight: 700; }
.held-title { font-size: 0.9rem; font-weight: 600; color: var(--p-fg-strong); margin: 0.22rem 0 0.14rem; }
.held-meta { font-size: 0.75rem; color: var(--p-fg-muted); }

.stamp {
  margin-top: 0.75rem;
  font-size: 0.62rem;
  color: var(--p-fg-muted);
  border-top: 1px dashed var(--p-border);
  padding-top: 0.55rem;
}

.arm-state {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--p-fg-muted);
}
.arm-state.armed { color: var(--p-accent); font-weight: 700; }

.schedule-card { max-width: 28rem; margin: auto; width: 100%; }
.schedule-details { margin-top: 0.72rem; padding-top: 0.62rem; border-top: 1px solid var(--p-border); }

.why-head {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
  margin: 0.7rem 0 0.3rem;
}
.why-list { padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.why-list li { font-size: 0.79rem; color: var(--p-fg); }

.saw-panel {
  margin-top: 0.75rem;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  background: var(--p-surface-sunk);
}
.saw-head {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
  margin-bottom: 0.4rem;
}
.saw-row { font-size: 0.79rem; display: flex; gap: 0.3rem; align-items: baseline; padding: 0.12rem 0; }
.saw-model { font-family: var(--mono); color: var(--p-fg-muted); }
.saw-arrow { color: var(--p-fg-subtle); }
.saw-real { color: var(--p-fg-strong); font-weight: 600; }

.held-banner {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--p-fg-strong);
  border: 1px dashed var(--p-border-strong);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  text-align: center;
  background: var(--p-surface-sunk);
}

.bucket-strip { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.bucket {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  border: 1px solid var(--p-border);
  border-radius: 999px;
  padding: 0.26rem 0.6rem;
  color: var(--p-fg-muted);
}
.bucket-live { border-color: var(--p-accent); color: var(--p-fg); }
.bucket-n { font-family: var(--mono); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.bucket-live .bucket-n { color: var(--p-accent); font-weight: 700; }
.bucket-name { font-size: 0.64rem; letter-spacing: 0.04em; text-transform: uppercase; }

.cal-row {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.42rem 0.5rem;
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--p-fg);
}
.cal-time { font-family: var(--mono); color: var(--p-fg-muted); font-size: 0.72rem; flex: 0 0 3.2rem; }
.cal-fresh { background: var(--p-accent-weak); border: 1px solid var(--p-accent); }
.cal-fresh .cal-title { color: var(--p-fg-strong); font-weight: 600; }

.phone-card { max-width: 21rem; margin: auto; width: 100%; }

.server-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--p-accent);
  margin: 0 auto 0.8rem;
  box-shadow: 0 0 0 4px var(--p-accent-weak);
}

.close-card { margin: auto; text-align: center; max-width: 24rem; width: 100%; }
.tally-row { display: flex; justify-content: center; gap: 1.6rem; margin-bottom: 0.9rem; }
.tally-n {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--p-accent);
}
.tally-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-fg-muted);
  margin-top: 0.15rem;
}
.thesis {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--p-fg);
  text-wrap: balance;
}

.mono { font-family: var(--mono); }

/* ── Progress + footer ─────────────────────────────────────── */

.progress-wrap {
  width: min(48rem, calc(100% - 2rem));
  min-height: 2.25rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 6.5rem minmax(10rem, 1fr) 11rem;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.61rem;
  color: var(--fg-muted);
}
#progress-label { text-align: right; }
#progress-note { text-align: left; }
#dots { display: flex; justify-content: center; gap: 0.28rem; }
.dot {
  width: min(2rem, 6vw);
  height: 3px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: all 200ms ease;
}
.dot-done { background: var(--fg-subtle); }
.dot-now { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}
.footer-inner {
  width: min(76rem, calc(100% - 2.5rem));
  min-height: 3.7rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.footer-inner p { margin: 0; }
.footer-inner b { color: var(--fg); }
footer a {
  flex: none;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ── Small screens: stack the worlds ───────────────────────── */

@media (max-width: 860px) {
  .header-inner { width: calc(100% - 1.6rem); flex-wrap: wrap; gap: 0.7rem 1rem; padding: 0.75rem 0; }
  .brand { order: 1; }
  #tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  #tabs::-webkit-scrollbar { display: none; }
  .world-strip { width: calc(100% - 1.6rem); grid-template-columns: 1fr; gap: 0.65rem; }
  .story-tabs { justify-content: flex-start; }
  .controls { order: 2; }
  .sim-badge { display: none; }
  #stage { grid-template-columns: 1fr; width: calc(100% - 1.6rem); height: auto; }
  #pane-left { border-radius: 14px 14px 0 0; border-right: 1px solid var(--border); border-bottom: none; }
  #pane-right { border-radius: 0 0 14px 14px; border-left: 1px solid var(--d-border); border-top: none; }
  #stage::before {
    left: 0; right: 0; top: auto; bottom: auto;
    height: 2px; width: auto;
    top: 50%;
    background: linear-gradient(90deg, transparent, var(--accent) 16%, var(--d-accent) 84%, transparent);
  }
  .pane { min-height: 21rem; }
  .pane-body { min-height: 14rem; }
  .controls { margin-left: auto; }
  .progress-wrap { grid-template-columns: auto minmax(8rem, 1fr); }
  #progress-label { text-align: left; }
  #progress-note { grid-column: 1 / -1; text-align: center; margin-top: -0.35rem; }
  .footer-inner { width: calc(100% - 1.6rem); padding: 0.9rem 0; flex-direction: column; text-align: center; gap: 0.45rem; }
}

@media (max-width: 600px) {
  .header-inner { align-items: flex-start; }
  .brand { width: 100%; }
  #tabs { flex-wrap: wrap; overflow-x: visible; }
  .pattern-tab-divider { display: none; }
  .pattern-tab { width: 100%; grid-template-columns: auto 1fr; align-items: baseline; gap: 0.55rem; min-height: 2.35rem; }
  .controls { order: 4; width: 100%; margin-left: 0; }
  .ctl { flex: 1; }
  .ctl-quiet { flex: 0 0 auto; }
  .story-copy { margin-top: 0.9rem; }
  .world-strip { margin-top: 0.75rem; padding: 0.72rem; }
  #deck-summary { width: 100%; }
  #studio-return { margin-left: 0; }
  .story-meta { flex-wrap: wrap; gap: 0.2rem 0.55rem; }
  #narration { min-height: 4.5em; font-size: 0.96rem; }
  .pane-head { min-height: 2.7rem; padding: 0.7rem 1rem 0.55rem; }
  .pane-body { padding: 0.8rem; }
  .pane-action { min-height: 4.7rem; padding: 0.55rem 0.8rem 0.8rem; }
  .action-btn { width: min(100%, 18rem); }
  .saw-row { flex-wrap: wrap; }
  .saw-model, .saw-real { min-width: 0; overflow-wrap: anywhere; }
  .offer-list { grid-template-columns: 1fr; }
  .tally-row { gap: 0.65rem; }
  .tally { flex: 1; min-width: 0; }
  .progress-wrap { width: calc(100% - 1.6rem); }
  .dot { width: auto; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .ghost { display: none; }
}
