/* ════════════════════════════════════════════════════════════════
   Meridian "Proposal Hub" — the fictional product inside the demo.
   Design system inferred from hifi-dashboard.html and extended to
   S2 (Proposal Prep) and S3 (Review & Sign-off).
   ════════════════════════════════════════════════════════════════ */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --ink: #111827;
  --soft: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --brand: #3b3f8f;
  --brand-2: #5a5fd0;
  --accent: #e07a3f;
  --mine: #2563eb;
  --mine-bg: #eff4ff;
  --wait: #b45309;
  --wait-bg: #fef6e7;
  --un: #6b7280;
  --un-bg: #f3f4f6;
  --ok: #15803d;
  --ok-bg: #eaf6ee;
  --miss: #c0453c;
  --miss-bg: #fdf0ef;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 12px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --app-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Stage: fixed 1440×900 canvas, scaled to fit any display ──── */
#stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0d1018;
  overflow: hidden;
  /* nothing inside is interactive — every click advances the script */
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
#stage[hidden] { display: none; }

#canvas {
  width: 1440px; height: 900px;
  flex: none;
  transform-origin: center center;
  display: flex;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--app-font);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

/* every svg icon in the app renders as a stroked line icon */
#canvas svg, #counter svg {
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  width: 18px; height: 18px; flex: none;
}

/* ── Icon rail ──────────────────────────────────────────────── */
.rail {
  width: 64px; flex: none;
  background: linear-gradient(180deg, #2c2f6e, #3b3f8f);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 8px;
}
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: #fff; color: #2c2f6e;
  font-weight: 800; font-size: 18px; letter-spacing: -.02em;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.ric {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #b9bce8;
}
.ric.active { background: rgba(255,255,255,.16); color: #fff; }
.rail .spacer { flex: 1; }
.rail .me {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #e07a3f, #f0a36c);
  border: 2px solid rgba(255,255,255,.5);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Top bar ────────────────────────────────────────────────── */
.top {
  height: 64px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px;
  padding: 0 28px;
}
.top h1 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.top .crumb { font-size: 12px; color: var(--faint); font-weight: 600; }
.top .spacer { flex: 1; }
.search {
  flex: 1; max-width: 420px; margin-left: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font-size: 13px; color: var(--faint);
  display: flex; align-items: center; gap: 9px;
}
.search svg { width: 15px; height: 15px; }
.bell {
  position: relative; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--soft);
}
.bell i {
  position: absolute; top: -5px; right: -5px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800; font-style: normal;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9999px; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}
.bell i.bump { animation: bump .5s var(--ease); }
@keyframes bump {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.45); }
}
.newbtn {
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 700;
  border-radius: 10px; padding: 10px 16px;
  box-shadow: var(--shadow);
}

/* ── Contextual sub-bar (S2 / S3) ───────────────────────────── */
.ctxbar {
  height: 48px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  font-size: 13px;
}
.ctxbar[hidden] { display: none; }
.ctx-back { display: flex; align-items: center; gap: 6px; color: var(--soft); font-weight: 600; }
.ctx-back svg { width: 15px; height: 15px; }
.ctx-sep { width: 1px; height: 18px; background: var(--line); }
.ctxbar b { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; }
.ctxbar .spacer { flex: 1; }
.ctx-meta { font-size: 12px; color: var(--faint); font-weight: 600; }

/* ── Screens ────────────────────────────────────────────────── */
.screen { flex: 1; min-height: 0; display: none; position: relative; }
.screen.active { display: flex; flex-direction: column; }
.screen.entering { animation: screenIn .32s var(--ease) both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.content {
  flex: 1; min-height: 0;
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 18px;
}

/* ════════════════ S1 · DASHBOARD ════════════════ */
.greet { display: flex; align-items: baseline; justify-content: space-between; flex: none; }
.greet h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.greet .date { font-size: 13px; color: var(--soft); font-weight: 600; }
.greet .date b { font-weight: 800; color: var(--ink); }

.recolabel {
  flex: none; margin-bottom: -8px;
  font-size: 11px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--soft);
}
.reco { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
  position: relative; overflow: hidden;
  transition: opacity .35s var(--ease), background .35s var(--ease);
}
.rcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--accent);
  transition: background .35s var(--ease);
}
.rcard.first::before { background: var(--brand-2); }
.rcard .ico {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--mine-bg); color: var(--mine);
  display: flex; align-items: center; justify-content: center;
}
.rcard .ico.wait { background: var(--wait-bg); color: var(--wait); }
.rcard .ico.accent { background: #fdeee4; color: var(--accent); }
.rcard .ico.done { background: var(--ok-bg); color: var(--ok); }
.rcard .rtext { min-width: 0; }
.rcard b { font-size: 13.5px; display: block; letter-spacing: -.01em; }
.rcard span { font-size: 12px; color: var(--soft); }
.rcard .go {
  margin-left: auto; flex: none;
  font-size: 12px; font-weight: 800; color: var(--brand);
  background: #eef0fb; border-radius: 8px; padding: 7px 12px;
  display: flex; align-items: center; gap: 5px;
}
.go-arrow { width: 13px; height: 13px; stroke-width: 2.2; }
.rcard.settled { background: #fbfcfd; }
.rcard.settled::before { background: var(--ok); }
.rcard.settled .go { display: none; }

/* kanban */
.board {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.col {
  background: #eceef4; border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; min-height: 0;
}
.col h3 {
  flex: none;
  font-size: 11.5px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--soft);
  display: flex; align-items: center; gap: 8px; padding: 2px 4px;
}
.col h3 .cnt {
  background: #fff; border-radius: 9999px;
  font-size: 11px; padding: 2px 8px; color: var(--ink);
}
.col h3 .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.colcards { display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.card {
  background: var(--surface); border-radius: 12px;
  padding: 13px 14px; box-shadow: var(--shadow);
  border: 1px solid transparent;
  flex: none;
}
.card.hero { border-color: var(--mine); box-shadow: 0 0 0 3px rgba(37,99,235,.12), var(--shadow); }
.card.hero.waiting { border-color: var(--wait); box-shadow: 0 0 0 3px rgba(180,83,9,.12), var(--shadow); }
.card.landing { animation: land .55s var(--ease) both; }
@keyframes land {
  0%   { opacity: 0; transform: translateY(-16px) scale(.97); }
  60%  { opacity: 1; transform: translateY(2px) scale(1); }
  100% { opacity: 1; transform: none; }
}
.chead { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.cava {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  font-size: 12px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.card b { font-size: 13.5px; letter-spacing: -.01em; display: block; }
.card .meta { font-size: 11.5px; color: var(--soft); line-height: 1.45; margin-bottom: 9px; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag {
  font-size: 10px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: 6px; padding: 4px 8px; white-space: nowrap;
}
.t-mine { background: var(--mine-bg); color: var(--mine); }
.t-wait { background: var(--wait-bg); color: var(--wait); }
.t-un   { background: var(--un-bg);   color: var(--un); }
.due { font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.due.ok { color: var(--ok); }
.faces { display: flex; }
.faces[hidden] { display: none; }
.face { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; margin-left: -6px; }
.f1 { background: #8ea3c0; } .f2 { background: #c0a48e; } .f3 { background: #9c8ec0; }
.prog { height: 4px; border-radius: 2px; background: #eef0f4; margin-top: 10px; overflow: hidden; }
.prog[hidden] { display: none; }
.prog i { display: block; height: 100%; border-radius: 2px; background: var(--brand-2); }

/* ready-for-review toast */
.toast {
  position: absolute; right: 28px; bottom: 24px;
  width: 505px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  animation: toastIn .45s var(--ease) both;
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.toast-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--ok-bg); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
}
.toast-ico svg { stroke-width: 2.4; }
.toast-body { min-width: 0; }
.toast-body b { display: block; font-size: 13px; letter-spacing: -.01em; line-height: 1.35; }
.toast-body span { font-size: 11.5px; color: var(--soft); }
.toast-cta {
  margin-left: auto; flex: none;
  font-size: 12px; font-weight: 800; color: #fff; background: var(--brand);
  border-radius: 8px; padding: 8px 13px;
  display: flex; align-items: center; gap: 5px;
}

/* ════════════════ Shared panes ════════════════ */
.pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
.pane-eyebrow {
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
}
.pane-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; margin-top: 3px; }

/* ════════════════ S2 · PROPOSAL PREP ════════════════ */
.s2grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}
.pane-head {
  flex: none;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
}
.gather {
  margin-left: auto; flex: none;
  display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 9999px; padding: 7px 14px;
  font-size: 12px; font-weight: 600; color: var(--soft);
}
.gather[hidden] { display: none; }
.gather.done { background: var(--ok-bg); border-color: #cfe7d8; color: var(--ok); font-weight: 700; }
.gather-check { width: 14px; height: 14px; stroke-width: 2.6; }
.spinner {
  width: 14px; height: 14px; flex: none;
  border: 2px solid #d7dbe4;
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.srcgrid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 14px;
  padding: 16px 18px 18px;
}
.src {
  background: #fbfcfe; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px;
  display: flex; flex-direction: column; min-height: 0;
}
.src-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex: none; }
.src-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--mine-bg); color: var(--mine);
}
.src-ico svg { width: 15px; height: 15px; }
.src-head b { font-size: 13px; font-weight: 800; letter-spacing: -.01em; display: block; }
.src-head span { font-size: 10.5px; color: var(--faint); font-weight: 600; }
.src-status {
  margin-left: auto; flex: none;
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 5px; padding: 3px 7px;
  background: var(--un-bg); color: var(--faint);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.src.filled .src-status { background: var(--ok-bg); color: var(--ok); }
.src.filled .src-status.gaps { background: var(--wait-bg); color: var(--wait); }

.src ul { list-style: none; display: flex; flex-direction: column; }
.src li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 11.5px;
  border-bottom: 1px solid #eef0f5;
}
.src li:last-child { border-bottom: 0; }
.src li .lbl { color: var(--soft); }
.src li .val {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; color: var(--ok);
  opacity: 0; transform: translateY(-3px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.src li .val svg { width: 13px; height: 13px; stroke-width: 2.6; }
.src li.gap .val { color: var(--miss); }
.src li .skel {
  margin-left: auto; width: 46px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #e9ecf2 25%, #f4f6fa 50%, #e9ecf2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  transition: opacity .25s var(--ease);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.src.filled li .val { opacity: 1; transform: none; transition-delay: var(--d, 0ms); }
.src.filled li .skel { opacity: 0; transition-delay: var(--d, 0ms); }
.src.filled li.gap { background: linear-gradient(90deg, var(--miss-bg), transparent 70%); }

.src-foot {
  margin-top: auto; padding-top: 10px;
  font-size: 10px; font-weight: 600;
  color: var(--faint);
  letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Chat ───────────────────────────────────────────────────── */
.chatpane { overflow: hidden; }
.chat-head {
  flex: none; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.agent-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  position: relative;
}
.agent-dot::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}
.chat-head b { font-size: 13px; font-weight: 800; display: block; letter-spacing: -.01em; }
.chat-head span { font-size: 11px; color: var(--faint); font-weight: 600; }

.chat-log {
  flex: 1; min-height: 0;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
  justify-content: flex-end;
  /* messages scrolled off the top fade out instead of cutting hard */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 26px);
}
/* empty state, suppressed while a line is being typed into the composer */
.chat-log:empty::before {
  margin: auto; max-width: 250px;
  text-align: center; font-size: 12px; line-height: 1.55; color: var(--faint);
}
#s2log:empty::before { content: "The agent will open the conversation here."; }
#s3log:empty::before { content: "Ask why an answer was framed the way it was, or request a change."; }
.chat-log.hushed:empty::before { content: none; }

.msg {
  max-width: 86%;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 12.5px; line-height: 1.5;
  animation: msgIn .28s var(--ease) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.msg.ai {
  align-self: flex-start;
  background: var(--bg); border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}
.msg.user {
  align-self: flex-end;
  background: var(--brand); color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.msg.typing { display: flex; gap: 4px; padding: 13px 14px; }
.msg.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--faint);
  animation: dot 1.1s var(--ease) infinite;
}
.msg.typing i:nth-child(2) { animation-delay: .16s; }
.msg.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes dot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.composer {
  flex: none; position: relative;
  border-top: 1px solid var(--line);
  padding: 12px 14px 12px 18px;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  background: var(--surface);
}
.composer-text { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.composer-text::after {
  content: ""; display: inline-block;
  width: 1.5px; height: 14px; margin-left: 1px;
  background: var(--brand-2);
  vertical-align: -2px;
  opacity: 0;
}
.composer.typing .composer-text::after { opacity: 1; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.composer-ph {
  position: absolute; left: 18px;
  font-size: 12.5px; color: var(--faint);
  transition: opacity .15s var(--ease);
}
.composer.typing .composer-ph, .composer.filled .composer-ph { opacity: 0; }
.composer .send {
  margin-left: auto; flex: none;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--un-bg); color: var(--faint);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.composer .send svg { width: 15px; height: 15px; }
.composer.typing .send { background: var(--brand); color: #fff; }

/* ════════════════ S3 · REVIEW & SIGN-OFF ════════════════ */
.s3grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }

.assetpane { padding: 16px 18px 18px; gap: 0; }
.assetlist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.asset {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px;
  display: flex; align-items: center; gap: 11px;
  background: #fbfcfe;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.asset-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--un-bg); color: var(--soft);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.asset b { font-size: 13px; font-weight: 800; display: block; letter-spacing: -.01em; }
.asset span { font-size: 11px; color: var(--soft); }
.asset.sel {
  border-color: var(--mine); background: var(--mine-bg);
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.asset.sel .asset-ico { background: var(--mine); color: #fff; }

/* provenance summary — reinforces where the draft came from */
.prov { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.prov-eyebrow {
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 10px;
}
.prov ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.prov li {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12px; color: var(--soft);
}
.prov li b { font-size: 13px; font-weight: 800; color: var(--ink); min-width: 20px; }
.prov li span {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--faint); background: var(--un-bg);
  border-radius: 5px; padding: 3px 7px;
}
.prov-gap {
  margin-top: 12px;
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--miss);
  background: var(--miss-bg); border-radius: 8px; padding: 8px 10px;
}
.prov-gap svg { width: 13px; height: 13px; stroke-width: 2.4; }

.signoff-wrap { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.signoff {
  background: var(--brand); color: #fff;
  border-radius: 10px; padding: 13px 14px;
  font-size: 12.5px; font-weight: 700; line-height: 1.35;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  transition: transform .18s var(--ease), background .18s var(--ease), opacity .25s var(--ease);
}
.signoff svg { width: 17px; height: 17px; }
.signoff.pressed { transform: scale(.97); background: #32356f; }
.signoff.spent { opacity: .45; }

.confirm {
  background: var(--ok-bg); border: 1px solid #cfe7d8;
  border-radius: 12px; padding: 13px 14px;
  animation: msgIn .4s var(--ease) both;
}
.confirm[hidden] { display: none; }
.confirm-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 800; color: var(--ok);
  letter-spacing: -.01em; margin-bottom: 10px;
}
.confirm-head svg { width: 15px; height: 15px; stroke-width: 2.6; }
.confirm-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.confirm-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: #2f6b47; font-weight: 600;
}
.confirm-list li svg { width: 14px; height: 14px; opacity: .8; }
.confirm-list li b { font-weight: 800; color: var(--ok); }
#reminderDay { transition: background .3s var(--ease); border-radius: 3px; padding: 0 2px; }
#reminderDay.flash { background: #fde68a; }

.rightcol { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.previewpane { flex: 1; min-height: 0; }
.preview-head {
  flex: none; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.preview-meta { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.preview-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.preview-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--faint);
}

/* spreadsheet-style Q&A */
.sheet { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet th, .sheet td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 12px;
  font-size: 11.5px; line-height: 1.45;
  text-align: left; vertical-align: top;
}
.sheet th {
  background: #f7f8fb; color: var(--soft);
  font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  position: sticky; top: 0;
}
.sheet col.c1 { width: 34%; }
.sheet td.q { color: var(--soft); font-weight: 600; }
.sheet td.a { color: var(--ink); }
.sheet tr:last-child td { border-bottom: 0; }
.sheet td:last-child { border-right: 0; }
.sheet tr.focus td { background: #fcfdff; }

td.a.swapping { opacity: 0; transform: translateY(-4px); }
td.a { transition: opacity .3s var(--ease), transform .3s var(--ease), background 1.6s var(--ease); }
/* must out-specify `.sheet tr.focus td`, which targets this very cell */
.sheet td.a.flash {
  background: #fdeaa8;
  box-shadow: inset 3px 0 0 var(--accent);
  transition: background .18s var(--ease), box-shadow .18s var(--ease);
}
.edited-pill {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 7px; vertical-align: 1px;
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: #fdeee4;
  border-radius: 4px; padding: 2px 5px;
}

.chatpane.short { flex: none; height: 296px; }

/* ── Step counter (hidden by default, toggled with C) ────────── */
#counter {
  position: fixed; right: 14px; bottom: 12px; z-index: 200;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.45);
  border-radius: 6px; padding: 4px 9px;
  letter-spacing: .04em;
  pointer-events: none;
}
#counter[hidden] { display: none; }
#counter b { color: #fff; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  #canvas *, .toast, .card.landing, .screen.entering { animation: none !important; }
}
