/* PrivaEcho web companion — minimal review styling. */

:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-2: #1f2530;
  --line: #2a3140;
  --text: #e6e9ef;
  --muted: #8b95a7;
  --accent: #5b8cff;
  --ok: #34c77b;
  --err: #ff6b6b;
  --warn: #f0b429;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.muted { color: var(--muted); }

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.apibadge {
  font-size: 12px;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* layout */
.content { max-width: 820px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card + .card { margin-top: 12px; }
.block { margin-top: 8px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.12s, background 0.12s;
}
.list-item:hover { border-color: var(--accent); background: var(--panel-2); }
.row-main { min-width: 0; }
.row-main .title { font-weight: 600; }
.row-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* pills + tags */
.pill {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: capitalize;
}
.pill.active, .pill.live { color: var(--ok); border-color: var(--ok); }
.pill.finished, .pill.completed, .pill.ready { color: var(--accent); border-color: var(--accent); }
.pill.draft, .pill.new { color: var(--warn); border-color: var(--warn); }
.tag {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
}

/* transcript — chat bubbles mirroring the iOS Session Review:
   ME = amber, right-aligned; OTHER = green, left-aligned. */
.transcript { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow: auto; padding: 12px 16px; }
.tturn { display: flex; flex-direction: column; gap: 4px; max-width: 80%; }
.tturn.me { align-self: flex-end; align-items: flex-end; }
.tturn.other, .tturn.uncertain { align-self: flex-start; align-items: flex-start; }
.tturn .thead { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tturn .spk { font-weight: 700; letter-spacing: 0.05em; }
.tturn.me .spk { color: var(--warn); }
.tturn.other .spk { color: var(--ok); }
.tturn .conf { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.tturn .bubble { white-space: pre-wrap; line-height: 1.45; padding: 10px 14px; border-radius: 14px; border: 1px solid transparent; }
.tturn.me .bubble { background: rgba(240, 180, 41, 0.12); border-color: rgba(240, 180, 41, 0.25); border-bottom-right-radius: 4px; }
.tturn.other .bubble { background: rgba(52, 199, 123, 0.10); border-color: rgba(52, 199, 123, 0.22); border-bottom-left-radius: 4px; }
.tturn.uncertain .bubble { background: var(--panel-2); border-color: var(--line); }
.raw { font-size: 12px; color: var(--muted); margin: 0; white-space: pre-wrap; word-break: break-word; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 10px; }
.input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}
.input:focus { outline: none; border-color: var(--accent); }

.btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
/* High-confidence Apple button: solid white on the dark card. */
.btn.apple { width: 100%; margin-top: 8px; background: #fff; color: #0e1116; border: none; font-weight: 600; }
.btn.apple:hover { filter: brightness(0.94); }
.btn:hover { filter: brightness(1.08); }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.linkbtn.back { display: inline-block; margin-bottom: 14px; }

/* Shared helpers also used by logged-in views — kept stable. */
.lead { font-size: 15px; color: var(--text); margin: 0; line-height: 1.55; }
.section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; margin-bottom: 12px;
}
.pill.dev { color: var(--warn); border-color: var(--warn); }
.apple-glyph { font-size: 16px; line-height: 0; margin-right: 7px; }

/* ════════════════════════════════════════════════════════════════════
   PRE-LOGIN ALPHA PAGE (app.privaecho.com)
   A private invitation room: calm, dark, privacy-aware. All rules are
   scoped under .preauth so logged-in views are untouched. The "echo"
   teal/mint accent ties to the iOS brand mark; blue stays the action
   color for parity with the in-app UI.
   ════════════════════════════════════════════════════════════════════ */
.preauth {
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --echo: #5fdac4;          /* brand teal/mint — the "thinking layer" */
  --echo-soft: rgba(95, 218, 196, 0.13);
  --echo-line: rgba(95, 218, 196, 0.30);
  --pa-shell: 1140px;
  position: relative;
  isolation: isolate;
}
/* Atmosphere: two faint corner glows + a hairline column grid + fine grain,
   fixed behind all content. No blobs, no orbs — just depth. */
.preauth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(95, 218, 196, 0.10), transparent 60%),
    radial-gradient(820px 560px at 100% 0%, rgba(91, 140, 255, 0.10), transparent 55%),
    linear-gradient(180deg, #0c0f14 0%, var(--bg) 38%, #0b0e13 100%);
}
.preauth::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.018) 0 1px,
    transparent 1px 96px
  );
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 70%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 14%, #000 70%, transparent);
}

/* ── echo mark ── */
.echo-mark { display: inline-flex; color: var(--echo); line-height: 0; }
.echo-mark svg { width: 1em; height: 1em; display: block; overflow: visible; }
.echo-mark .echo-arc-outer { opacity: 0.38; }
.brand-echo { font-size: 26px; }
.footer-echo { font-size: 20px; }

/* ── app bar ── */
.preauth .login-bar {
  padding: 14px 22px;
  background: rgba(14, 17, 22, 0.72);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.preauth .login-bar .brand { gap: 11px; text-decoration: none; color: var(--text); }
.preauth .login-bar .brand strong { font-size: 18px; letter-spacing: -0.01em; }
.preauth .login-bar .brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.preauth .login-bar .brand-sub { font-size: 12px; }
.pa-nav { display: flex; align-items: center; gap: 22px; }
.pa-nav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: color 0.15s;
}
.pa-nav a:hover { color: var(--text); }
@media (max-width: 680px) {
  .pa-nav a { display: none; }
  .pa-nav .pill.dev { display: inline-block; }
}

/* ── shared section scaffolding ── */
.preauth-main { width: 100%; }
.pa-section {
  max-width: var(--pa-shell);
  margin: 0 auto;
  padding: 64px 22px;
  scroll-margin-top: 76px;
}
.pa-section-head { max-width: 640px; margin-bottom: 30px; }
.pa-eyebrow {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--muted);
}
.pa-eyebrow.accent { color: var(--echo); }
.pa-section-head h2 {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(24px, 3.4vw, 33px); line-height: 1.12;
  margin: 12px 0 0; color: var(--text); text-transform: none;
}
.pa-section-lead { font-size: 16px; color: var(--muted); margin: 12px 0 0; line-height: 1.55; }

/* ── hero ── */
.pa-hero {
  max-width: var(--pa-shell);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 84px) 22px 40px;
  scroll-margin-top: 76px;
}
.pa-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: start;
}
.pa-hero-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(31px, 5.2vw, 56px); line-height: 1.04;
  letter-spacing: -0.018em; margin: 16px 0 0; color: #f2f5fb;
  text-wrap: balance;
}
.pa-hero-lead {
  font-size: clamp(16px, 1.9vw, 19px); color: #aeb7c7;
  line-height: 1.55; margin: 18px 0 0; max-width: 33em;
}
.pa-hero-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.pa-hero-chip {
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--echo-line); color: #d8efe9;
  background: var(--echo-soft);
}
.pa-hero-arrow { color: var(--muted); font-size: 13px; }
.pa-seehow {
  display: inline-block; margin-top: 24px;
  color: var(--echo); text-decoration: none; font-size: 14px; font-weight: 500;
}
.pa-seehow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* sign-in card — the right rail, raised above the page */
.preauth .login {
  max-width: none; margin: 0; border-radius: 16px; padding: 26px;
  background: linear-gradient(180deg, rgba(31, 37, 48, 0.7), rgba(23, 27, 34, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -28px rgba(0, 0, 0, 0.8);
}
.preauth .login-head { margin-bottom: 18px; }
.login-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--echo); margin-bottom: 9px;
}
.preauth .login-head h2 {
  font-family: var(--serif); font-weight: 500; text-transform: none;
  font-size: 24px; letter-spacing: -0.01em; color: var(--text); margin: 0 0 6px;
}
.preauth .login-sub { font-size: 14px; margin: 0; line-height: 1.45; }
.preauth .login-foot {
  font-size: 12.5px; line-height: 1.5; margin-top: 18px;
  padding-top: 15px; border-top: 1px solid var(--line);
}
.preauth .btn.apple { padding: 13px; font-size: 15.5px; border-radius: 10px; }
.preauth .login .btn.primary { border-radius: 10px; padding: 12px; }

/* ── the loop: copy + artifact rows ── */
.pa-loop { display: flex; flex-direction: column; gap: 26px; }
.pa-stage { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: center; }
.pa-stage-copy { max-width: 30em; }
.pa-step-index {
  font-family: var(--serif); font-size: 30px; line-height: 1;
  color: var(--echo); opacity: 0.85;
}
.pa-stage-copy h3 {
  font-family: var(--serif); font-weight: 500; text-transform: none;
  font-size: 22px; letter-spacing: -0.01em; color: var(--text); margin: 10px 0 8px;
}
.pa-stage-copy p { color: #aab3c3; line-height: 1.6; margin: 0; font-size: 15.5px; }

/* ── product artifacts ── */
.pa-art {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, rgba(31, 37, 48, 0.55), rgba(20, 24, 30, 0.9));
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.85);
}
.art-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.art-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.art-dot.ok { background: var(--ok); }
.art-echo { font-size: 17px; }
.art-kicker {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.art-tag {
  margin-left: auto; flex-shrink: 0;
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel-2);
  white-space: nowrap;
}
.art-tag.live { color: var(--echo); border-color: var(--echo-line); background: var(--echo-soft); }
.art-body { padding: 6px 18px 16px; }
.art-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.art-row:first-of-type { border-top: none; }
.art-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent);
}
.art-text { font-size: 15px; line-height: 1.4; color: var(--text); }

/* hint artifact — the warm/echo in-the-moment layer */
.art-hint { border-color: var(--echo-line); }
.art-hint .art-body { padding-top: 14px; }
.hint-row {
  position: relative; padding: 12px 14px 12px 30px; margin-bottom: 10px;
  border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.4; color: var(--text);
}
.hint-row:last-child { margin-bottom: 0; }
.hint-row::before {
  content: ""; position: absolute; left: 13px; top: 17px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--echo);
}
.hint-row.primary { background: var(--echo-soft); border-color: var(--echo-line); }
.art-foot {
  padding: 11px 18px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.015);
}

/* debrief artifact */
.art-overview { margin: 12px 0 14px; line-height: 1.5; color: var(--text); font-size: 15px; }
.art-check { list-style: none; margin: 6px 0 0; padding: 0; }
.art-check li { position: relative; padding-left: 24px; margin: 7px 0; line-height: 1.4; font-size: 14.5px; }
.art-check li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--ok); font-weight: 700; font-size: 13px;
}
.art-next {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.art-next > div { font-size: 15px; line-height: 1.4; }

/* ── use cases ── */
.pa-usecases {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
}
.pa-usecase {
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 20px;
  background: rgba(23, 27, 34, 0.55);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.pa-usecase:hover { border-color: var(--echo-line); transform: translateY(-2px); background: rgba(31, 37, 48, 0.6); }
.pa-uc-cat {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--echo);
}
.pa-uc-title { font-weight: 600; font-size: 16px; margin: 9px 0 7px; color: var(--text); }
.pa-uc-desc { font-size: 14px; line-height: 1.5; }

/* ── trust / privacy ── */
.pa-trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pa-trust-item { display: flex; gap: 13px; align-items: flex-start; }
.pa-trust-tick {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--echo-soft); border: 1px solid var(--echo-line);
  color: var(--echo); font-size: 13px; font-weight: 700; margin-top: 1px;
}
.pa-trust-title { font-weight: 600; font-size: 15.5px; color: var(--text); margin-bottom: 3px; }
.pa-trust-item .muted { font-size: 14px; line-height: 1.5; }

/* ── alpha expectations ── */
.pa-alpha { padding-top: 24px; }
.pa-alpha-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(26px, 4vw, 44px);
  background:
    radial-gradient(700px 300px at 0% 0%, rgba(95, 218, 196, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(31, 37, 48, 0.7), rgba(20, 24, 30, 0.92));
}
.pa-alpha-card h2 {
  font-family: var(--serif); font-weight: 500; text-transform: none;
  font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.01em;
  color: var(--text); margin: 12px 0 0; line-height: 1.12;
}
.pa-alpha-card > p { color: #aeb7c7; font-size: 16px; line-height: 1.6; margin: 14px 0 0; max-width: 46em; }
.pa-alpha-list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.pa-alpha-list li { position: relative; padding-left: 22px; color: #aab3c3; line-height: 1.55; font-size: 14.5px; }
.pa-alpha-list li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--echo);
}
.pa-alpha-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.preauth .btn.primary,
.preauth .btn.ghost {
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; padding: 11px 18px;
}
.preauth .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.preauth .btn.ghost:hover { border-color: var(--echo-line); filter: none; }

/* ── footer ── */
.pa-footer {
  max-width: var(--pa-shell); margin: 0 auto; padding: 30px 22px 56px;
  border-top: 1px solid var(--line);
}
.pa-footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.pa-footer-brand strong { font-size: 15px; }
.pa-footer .muted { font-size: 13px; line-height: 1.55; max-width: 60ch; margin: 0; }

/* ── consent gate ── */
.pa-consent-wrap { max-width: 520px; margin: 0 auto; width: 100%; }
.pa-consent { padding: 28px; }
.consent-list { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 18px; }
.consent-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); cursor: pointer; line-height: 1.4; font-size: 14.5px;
  transition: border-color 0.12s;
}
.consent-row:hover { border-color: var(--echo-line); }
.consent-cb {
  margin: 1px 0 0; width: 17px; height: 17px; flex-shrink: 0;
  accent-color: var(--echo); cursor: pointer;
}
.consent-continue { width: 100%; }
.preauth .login .slot { margin-top: 10px; }
.pa-footer-org { margin-top: 10px; }
.pa-footer-links { margin-top: 14px; font-size: 13px; }
.pa-footer-links a { color: var(--muted); text-decoration: none; }
.pa-footer-links a:hover { color: var(--echo); text-decoration: underline; text-underline-offset: 3px; }
.pa-footer-sep { color: var(--line); margin: 0 9px; }

/* ── page-load reveal (one orchestrated entrance) ── */
@media (prefers-reduced-motion: no-preference) {
  .pa-hero-copy > *,
  .pa-hero-signin { animation: pa-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .pa-hero-copy > *:nth-child(1) { animation-delay: 0.02s; }
  .pa-hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
  .pa-hero-copy > *:nth-child(3) { animation-delay: 0.14s; }
  .pa-hero-copy > *:nth-child(4) { animation-delay: 0.20s; }
  .pa-hero-copy > *:nth-child(5) { animation-delay: 0.26s; }
  .pa-hero-signin { animation-delay: 0.16s; }
}
@keyframes pa-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ── desktop / tablet ── */
@media (min-width: 760px) {
  .pa-hero-grid { grid-template-columns: 1.18fr 0.82fr; gap: 44px; align-items: center; }
  .pa-stage { grid-template-columns: 0.9fr 1.1fr; gap: 40px; }
  /* alternate the artifact side for rhythm */
  .pa-stage:nth-child(even) .pa-stage-copy { order: 2; }
  .pa-stage:nth-child(even) .pa-stage-art { order: 1; }
  .pa-loop { gap: 44px; }
  .pa-usecases { grid-template-columns: repeat(3, 1fr); }
  .pa-trust-list { grid-template-columns: 1fr 1fr; gap: 22px 34px; }
}
@media (min-width: 540px) and (max-width: 759px) {
  .pa-usecases { grid-template-columns: 1fr 1fr; }
}

/* ── workflow diagram (compact node flow on the pre-login page) ── */
.wf-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.wf-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}
.wf-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--echo);
  border: 1px solid var(--echo-line);
  background: var(--echo-soft);
}
.wf-icon svg { width: 22px; height: 22px; display: block; }
.wf-label { font-weight: 600; font-size: 14px; }
.wf-sub { font-size: 12px; margin-top: 1px; }
.wf-arrow {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(90deg);
  align-self: center;
  height: 18px;
}
/* scene: two people + phone on a table line */
.wf-node-scene { gap: 12px; }
.wf-scene { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; }
.wf-scene-row { display: flex; align-items: flex-end; gap: 9px; color: var(--text); }
.wf-scene-row svg { width: 20px; height: 20px; display: block; }
.wf-phone { color: var(--echo); }
.wf-table { width: 74px; border-top: 2px solid var(--line); }
.wf-caption { text-align: center; margin: 14px auto 0; max-width: 460px; font-size: 13px; }

/* Tighter rhythm: the flow should bridge the hero and the "Prepare. Stay
   present. Reflect." loop, not sit in a tall isolated slab. Trim the section's
   own padding, the title→diagram gap, and pull the following section up so the
   three read as one continuous movement. */
.wf-section { padding-top: 30px; padding-bottom: 38px; }
.wf-section .pa-section-head { margin-bottom: 18px; }
.wf-section + .pa-section { padding-top: 32px; }

@media (min-width: 760px) {
  /* stretch so all five cards share one height even when a sublabel wraps */
  .wf-flow { flex-direction: row; align-items: stretch; justify-content: center; gap: 6px; }
  .wf-section { padding-top: 26px; padding-bottom: 34px; }
  .wf-section + .pa-section { padding-top: 28px; }
  .wf-node {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 9px;
    padding: 16px 12px;
  }
  .wf-arrow { transform: none; align-self: center; flex: 0 0 auto; }
}

/* ── temporary private-build install link + modal ── */
.pa-pbuild-link {
  display: inline-block;
  margin-top: 13px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pa-pbuild-link:hover { color: var(--echo); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(6, 8, 12, 0.72);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.modal {
  width: 100%;
  max-width: 560px;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; margin: 0; }
.modal-close {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 14px; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }
.modal-body { padding: 18px 20px; }
.modal-lead { margin: 0 0 4px; line-height: 1.55; }
.modal-section { margin-top: 18px; }
.modal-section h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); margin: 0 0 8px;
}
.modal-steps { margin: 0; padding-left: 20px; }
.modal-steps li { margin: 5px 0; line-height: 1.5; }
.modal-note { margin: 20px 0 0; font-size: 13px; line-height: 1.5; }
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.modal-foot .btn {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-foot .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.modal-foot .btn.ghost:hover { border-color: var(--accent); filter: none; }

/* logged-in hero + empty state */
.hero { margin-bottom: 18px; }
.hero h1 { margin-bottom: 6px; }
.hero .lead { max-width: 640px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* destructive actions (data-rights deletes) */
.btn.danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn.danger:hover { background: rgba(255, 107, 107, 0.10); filter: none; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.danger-prompt { font-size: 13px; }

/* ── top bar: quiet user chip ── */
.user-chip { display: flex; align-items: center; gap: 10px; }
.chip-sep { font-size: 12px; }
.user-email {
  font-size: 13px; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── logged-in dashboard ── */
.content.dashboard { max-width: 900px; }
.dash-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 24px;
}
.dash-head-text { min-width: 0; }
.dash-head h1 { font-size: 24px; margin: 0 0 6px; }
.dash-head .lead { max-width: 560px; }
.dash-cta { margin-top: 4px; flex-shrink: 0; }

.list-count { margin-bottom: 12px; }
.guide-list { margin: 0; }
.guide-card {
  display: flex; flex-direction: column; gap: 8px;
  border-radius: 8px; padding: 15px 18px; cursor: pointer; margin-bottom: 10px;
  transition: border-color 0.12s, background 0.12s;
}
.guide-card:hover { border-color: var(--accent); background: var(--panel-2); }
.gc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gc-top .pill { flex-shrink: 0; white-space: nowrap; }
.gc-title {
  font-weight: 600; font-size: 16px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gc-meta { display: flex; flex-wrap: wrap; align-items: center; font-size: 13px; }
.gc-meta > span:not(:first-child)::before {
  content: "·"; margin: 0 8px; color: var(--muted); opacity: 0.7;
}
.gc-cat { color: var(--text); }
.gc-objective {
  font-size: 13.5px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* polished empty dashboard */
.empty-dash { border-radius: 8px; padding: 28px 24px; }
.empty-dash .empty-title { font-size: 19px; margin-bottom: 6px; }
.empty-dash .empty-lead { max-width: 520px; margin: 0; }
.empty-dash .cta-row { margin-top: 18px; }
.use-cases { margin-top: 24px; }
.use-case-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.use-case {
  font-size: 13px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}

@media (min-width: 760px) {
  .content.dashboard { padding-top: 30px; }
  .dash-head h1 { font-size: 27px; }
  .dash-head .lead { font-size: 15.5px; }
  .gc-title { font-size: 17px; }
  .gc-objective { font-size: 14px; }
}
@media (max-width: 600px) {
  .dash-head { flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .dash-cta { width: 100%; }
  .user-email { display: none; }
}
.empty {
  padding: 28px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.empty-title { font-weight: 600; margin-bottom: 4px; }
.empty .muted { max-width: 460px; margin: 0 auto; }

/* stars */
.stars { display: flex; gap: 4px; }
.star {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--line);
  cursor: pointer;
  padding: 0;
}
.star.on { color: var(--warn); }

/* authoring (Phase 2) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: 14px; }
.field .req { color: var(--warn); }
.field .help, .help { font-size: 12px; }
.row-inline { display: flex; gap: 8px; align-items: flex-start; }
.row-inline .input { flex: 1; }
.list.compact .list-item { padding: 10px 14px; margin-bottom: 6px; }
.list-item.static { cursor: default; }
.list-item.static:hover { border-color: var(--line); background: var(--panel); }
.prep .block { margin-top: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* conversation playbook */
.pb-card { margin-bottom: 10px; border-radius: 8px; }
.pb-card > h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; }
.pb-field + .pb-field { margin-top: 12px; }
.pb-field h4 { font-size: 13px; font-weight: 600; color: var(--accent); margin: 0 0 4px; }
.pb-field p { margin: 0; white-space: pre-wrap; }
.pb-text { line-height: 1.5; }
.pb-field ul, .pb-list { margin: 0; padding-left: 18px; }
.pb-field li, .pb-list li { margin: 3px 0; line-height: 1.45; }
.pb-cues { list-style: none; padding-left: 0; }
.pb-cues li { position: relative; padding-left: 18px; }
.pb-cues li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.pb-more {
  margin-top: 8px; font-size: 13px;
}
.pill.ready-strong { color: var(--ok); border-color: var(--ok); }
.pill.ready-usable { color: var(--accent); border-color: var(--accent); }
.pill.ready-insufficient { color: var(--warn); border-color: var(--warn); }

/* "At a glance" summary card — the playbook hero */
.pb-glance {
  border-radius: 8px;
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.06);
  margin-bottom: 14px;
}
.glance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.glance-head h3 { margin: 0; font-size: 16px; }
.glance-block + .glance-block { margin-top: 14px; }
.glance-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); display: block; margin-bottom: 5px;
}
.glance-goal { margin: 0; line-height: 1.5; }
.glance-block .pb-list li { margin: 4px 0; }

/* secondary section headings (sessions, sources) */
.section-quiet { color: var(--muted); font-size: 15px; }
.sources-secondary { margin-top: 28px; opacity: 0.92; }
.sources-secondary .src-count { font-size: 13px; }
.src-tools { margin-top: 12px; }
.src-tools > summary {
  cursor: pointer; font-size: 13px; color: var(--accent);
  padding: 8px 0; user-select: none; list-style: none;
}
.src-tools > summary::-webkit-details-marker { display: none; }
.src-tools > summary::before { content: "+ "; }
.src-tools[open] > summary::before { content: "− "; }
.src-tools[open] > summary { margin-bottom: 8px; }

/* source rows */
.source-row { align-items: flex-start; }
.src-head { display: flex; align-items: center; gap: 8px; }
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
}
.badge.src-url { color: var(--accent); border-color: var(--accent); }
.badge.src-document { color: var(--ok); border-color: var(--ok); }
.src-origin { font-size: 12px; margin-top: 3px; word-break: break-all; }
.src-preview { font-size: 12px; margin-top: 4px; }
.src-date { font-size: 12px; flex-shrink: 0; white-space: nowrap; }

/* templates: gap below search, tag-filter chips */
.chat-cta { display: inline-block; margin: 8px 0 16px; }
.templates-list { margin-top: 14px; display: block; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font: inherit;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* brief-builder chat */
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 2px;
  margin: 12px 0;
}
.bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 12px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.bubble.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble.bubble-error { border-color: var(--err); color: var(--err); }

/* thinking placeholder: "Thinking" + three pulsing dots */
.bubble.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; }
.dots > span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
  display: inline-block; animation: dot-pulse 1.2s infinite ease-in-out both;
}
.dots > span:nth-child(2) { animation-delay: 0.18s; }
.dots > span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* finish affordance becomes prominent once the playbook is usable/strong */
.finish-card.ready { border-color: var(--ok); background: rgba(52, 199, 123, 0.06); }

/* notes */
.note { padding: 12px 14px; border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.note.error { color: var(--err); border: 1px solid var(--err); background: rgba(255, 107, 107, 0.08); }
.note.ok { color: var(--ok); border: 1px solid var(--ok); background: rgba(52, 199, 123, 0.08); }
.slot:empty { display: none; }
