/* mobile.css — Beam&Bark mobile chat flow */

html, body {
  min-height: 100%;
  background: var(--cream);
  overflow: hidden;
}

/* On a REAL phone the mobile shell fills the whole viewport. On a desktop
 * browser opening /m for testing we cap it at 430px so it looks like a
 * phone-shaped frame in the middle of the page. Historical bug: the cap
 * was applied unconditionally, so on modern large phones (iPhone 15 Pro
 * Max @ 430px logical width, iPhone 16 Pro Max @ 440px, Android XL @ 480px+)
 * the shell was narrower than the viewport and a strip of dead space
 * appeared to the right of the hero/upload content. Fix: only apply the
 * 430px cap at viewports wider than that (i.e., not on any actual phone).
 */
.mobile-view {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}
@media (min-width: 640px) {
  .mobile-view {
    max-width: 430px;
  }
}

/* app surface */
.m-app {
  position: absolute;
  inset: 0;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  flex-direction: column;
  background: var(--cream);
  font-family: var(--font-body);
  overflow: hidden;
}

/* ── upload ── */
.m-toprow { padding: 14px 20px 6px; display: flex; justify-content: space-between; align-items: center; }
.m-toprow .wordmark img { height: 64px; }
.toprow-right { display: flex; align-items: center; gap: 8px; }
.cash-pill { font-family: var(--font-mono); font-size: 10px; color: var(--ember); letter-spacing: 1.4px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: 99px; }
.login-pill { font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--ember); background: none; border: 1.5px solid var(--ember); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.login-pill:hover { background: var(--ember); color: var(--cream); }
.test-mode-pill {
  margin: 8px 20px 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(183, 80, 31, 0.1);
  border: 1px solid rgba(183, 80, 31, 0.22);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-align: center;
  color: var(--ember);
}
.m-hero { padding: 22px 20px 24px; }
.m-hero h1 { margin: 0; font-family: var(--font-display); font-size: 38px; line-height: 1.0; font-weight: 400; letter-spacing: -0.025em; word-spacing: 0.03em; color: var(--ink); }
.m-hero h1 em { color: var(--ember); font-style: italic; }
.m-hero p { margin: 14px 0 0; font-size: 15px; line-height: 1.45; color: rgba(26, 20, 16, 0.7); text-wrap: pretty; }
.upload-tile-wrap { padding: 0 20px 18px; }
.upload-tile {
  border: 2px dashed var(--pine-deep);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.upload-tile .circ { width: 56px; height: 56px; border-radius: 99px; margin: 0 auto 14px; background: var(--paper); border: 1px solid var(--rule); display: flex; align-items: center; justify-content: center; color: var(--burn); }
.upload-tile .big { font-family: var(--font-display); font-size: 19px; color: var(--ink); font-weight: 500; }
.upload-tile .sub { margin-top: 6px; font-size: 13px; color: rgba(26, 20, 16, 0.55); }
.start-divider { display: flex; align-items: center; gap: 12px; padding: 0 20px 18px; }
.start-divider::before, .start-divider::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.start-divider span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px; color: rgba(58, 42, 26, 0.5); text-transform: uppercase; }
.text-only-tile {
  display: block;
  width: 100%;
  border: 2px dashed var(--rule);
  border-radius: 20px;
  padding: 22px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.text-only-tile .circ { width: 48px; height: 48px; border-radius: 99px; margin: 0 auto 12px; background: var(--paper); border: 1px solid var(--rule); display: flex; align-items: center; justify-content: center; color: var(--burn); }
.text-only-tile .big { font-family: var(--font-display); font-size: 17px; color: var(--ink); font-weight: 500; }
.text-only-tile .sub { margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: rgba(26, 20, 16, 0.55); }
.sample-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px; color: rgba(58, 42, 26, 0.55); margin-bottom: 10px; }
.sample-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sample-grid.test-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sample-card { padding: 0; border: none; background: none; cursor: pointer; text-align: left; }
.sample-card .thumb { aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule); }
.sample-card.test-card .thumb { aspect-ratio: 1/1; background: var(--paper); }
.sample-card.test-card .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sample-card:disabled { opacity: 0.6; cursor: wait; }
.sample-card .nm { margin-top: 8px; font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--ink); }
.sample-card .st { font-size: 11px; color: rgba(26, 20, 16, 0.55); }
.trust-card { margin: 0 20px 24px; padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule); display: flex; align-items: center; gap: 12px; }
.trust-card .txt { font-size: 12px; line-height: 1.4; color: rgba(26, 20, 16, 0.75); }
.trust-card .txt em { font-style: italic; color: rgba(26, 20, 16, 0.55); }
.account-footer { margin: 0 20px 28px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-footer-info { font-size: 11px; color: rgba(26, 20, 16, 0.5); }
.account-logout-btn { background: none; border: none; padding: 4px 0; font-size: 12px; font-weight: 600; color: rgba(26, 20, 16, 0.55); text-decoration: underline; cursor: pointer; }
.account-logout-btn:hover { color: var(--ink); }
.account-footer-login .account-footer-info { font-size: 13px; color: rgba(26, 20, 16, 0.65); }
.account-footer-login .account-logout-btn { color: var(--ember); text-decoration: none; padding: 6px 14px; border: 1.5px solid var(--ember); border-radius: 99px; }
.account-footer-login .account-logout-btn:hover { background: var(--ember); color: var(--cream); }
.project-shelf {
  margin: 0 20px 18px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: rgba(255,255,255,0.52);
}
.project-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.project-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--ember);
}
.project-limit {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(26,20,16,0.55);
}
.project-refresh {
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--burn);
  font-size: 11px;
  padding: 6px 9px;
}
.project-card {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border: 0;
  border-top: 1px solid rgba(58,42,26,0.1);
  background: transparent;
  text-align: left;
  color: var(--ink);
}
.project-card:first-of-type { border-top: 0; }
.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--ember);
}
.project-dot.final { background: #2f7d52; }
.project-main { min-width: 0; display: grid; gap: 2px; }
.project-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}
.project-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: rgba(26,20,16,0.55);
}
.project-go { color: rgba(26,20,16,0.42); font-size: 21px; }
/* Ordered (locked) designs are dimmed so drafts you can still work on stand out. */
.project-card.is-ordered { opacity: 0.62; }
.project-card.is-ordered .project-meta { color: var(--ember); }
.project-empty {
  padding: 10px 2px 2px;
  color: rgba(26,20,16,0.56);
  font-size: 12px;
}

.m-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

/* ── processing ── */
.proc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; gap: 28px; }
.proc-canvas { position: relative; width: 200px; height: 200px; }
.proc-stage { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; opacity: 0; transition: opacity 600ms; }
.proc-stage.on { opacity: 1; }
.proc-partial-stage { z-index: 5; background: var(--paper); }
.proc-partial-stage img { width: 100%; height: 100%; object-fit: cover; animation: partial-in .35s ease both; }
.proc-caption { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--ink); text-align: center; min-height: 48px; }
.proc-bars { display: flex; gap: 6px; }
.proc-bar { width: 24px; height: 4px; border-radius: 99px; background: rgba(58, 42, 26, 0.15); transition: background 300ms; }
.proc-bar.on { background: var(--burn); }
.scan-overlay { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(183,80,31,0.25) 6px, rgba(183,80,31,0.25) 7px); animation: scanH 0.8s ease-in-out infinite; }

/* ── chat ── */
.chat-flow { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--cream); }
.chat-header { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); background: var(--cream); flex-shrink: 0; }
.chat-header .link { background: none; border: none; cursor: pointer; padding: 6px; margin-left: -6px; color: var(--burn); display: flex; align-items: center; gap: 4px; font-family: var(--font-body); font-size: 13px; }
.lock-btn { background: var(--burn); color: var(--cream); border: none; cursor: pointer; padding: 7px 12px; border-radius: 99px; font-family: var(--font-body); font-size: 12px; font-weight: 600; transition: opacity 0.18s ease; }
.lock-btn.is-disabled, .lock-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.knob-row { margin-top: 10px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 9px; color: rgba(58, 42, 26, 0.55); letter-spacing: 0.8px; }
.knob { display: flex; gap: 4px; }
.knob .v { color: var(--ember); font-weight: 500; }
.debug-panel {
  margin: 10px auto 0;
  width: min(92%, 330px);
  max-height: 170px;
  overflow: auto;
  border: 1px dashed rgba(183,80,31,0.35);
  border-radius: 8px;
  background: rgba(255,253,248,0.82);
  color: rgba(42,29,19,0.78);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.45;
  padding: 8px 10px;
}
.debug-panel:empty { display: none; }
.debug-panel .debug-head { color: var(--ember); font-weight: 700; letter-spacing: 0.6px; margin-bottom: 4px; }
.debug-panel .muted-line { color: rgba(42,29,19,0.52); }
.debug-panel .err-line { color: #b4231f; word-break: break-word; }
.debug-panel details { margin-top: 3px; }
.debug-panel summary { cursor: pointer; color: var(--burn); }
.debug-panel pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 86px;
  overflow: auto;
  background: rgba(42,29,19,0.08);
  border-radius: 6px;
  padding: 6px;
}
.chat-thread { flex: 1; overflow-y: auto; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bubble-row { display: flex; }
.bubble-row.user { justify-content: flex-end; }
.bubble-row.ai { justify-content: flex-start; }
.bubble-row.render-row-msg { justify-content: center; }
.bubble-row.photo-row-msg { justify-content: flex-end; }
.uploaded-photo-msg { max-width: 62%; }
.uploaded-photo-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ember); text-align: right; margin: 0 2px 5px 0; opacity: 0.8; }
.uploaded-photo-msg .rendered-shot { border-radius: 16px; border-bottom-right-radius: 5px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-family: var(--font-body); font-size: 14px; line-height: 1.4; }
.bubble.user { background: var(--burn); color: var(--cream); border-bottom-right-radius: 4px; }
.bubble.ai { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.bubble.operator { background: #fbf3e4; color: var(--ink); border: 1px solid var(--ember); border-bottom-left-radius: 4px; box-shadow: 0 1px 6px rgba(150,90,30,0.08); }
.bubble.operator .operator-label { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ember); margin-bottom: 4px; font-weight: 600; }
.bubble.operator .operator-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--ember); flex-shrink: 0; }
.bubble.operator .operator-body { white-space: pre-wrap; }
.bubble .diff { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(58,42,26,0.15); font-family: var(--font-mono); font-size: 10px; color: var(--ember); letter-spacing: 0.4px; }
.thinking-dots { display: flex; gap: 4px; padding: 2px 4px; }
.thinking-dots div { width: 6px; height: 6px; border-radius: 99px; background: var(--burn); animation: pulse 1.2s ease-in-out infinite; opacity: 0.4; }
.chip-row { padding: 6px 12px 8px; display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 12px; border-radius: 99px; background: var(--paper); border: 1px solid var(--rule); font-family: var(--font-body); font-size: 12px; color: var(--burn); cursor: pointer; white-space: nowrap; }
.chip:disabled { opacity: 0.5; cursor: wait; }
.input-bar { padding: 8px 14px 26px; flex-shrink: 0; background: var(--cream); border-top: 1px solid var(--rule); }
.input-pill { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 999px; padding: 6px 6px 6px 6px; border: 1px solid var(--rule); }
.input-pill input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--font-body); font-size: 14px; color: var(--ink); padding: 8px 0; }
.input-pill input:disabled { color: rgba(42,29,19,0.46); cursor: wait; }
.attach-btn { flex-shrink: 0; width: 32px; height: 32px; border-radius: 99px; background: transparent; color: var(--burn); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-left: 4px; transition: background 150ms; }
.attach-btn:hover { background: rgba(58,42,26,0.08); }
.attach-btn:disabled { color: rgba(42,29,19,0.3); cursor: wait; }
.send-btn { width: 36px; height: 36px; border-radius: 99px; background: rgba(58,42,26,0.2); color: var(--cream); border: none; cursor: default; display: flex; align-items: center; justify-content: center; transition: background 150ms; }
.send-btn.active { background: var(--burn); cursor: pointer; }
.send-btn:disabled { background: rgba(58,42,26,0.16); color: rgba(255,251,242,0.72); cursor: wait; }
.chat-flow.is-busy .chip-row,
.chat-flow.is-busy .input-bar { pointer-events: none; }

/* lock-in modal */
.lock-overlay { position: absolute; inset: 0; z-index: 20; background: rgba(26,20,16,0.55); display: flex; align-items: flex-end; animation: fadeIn 200ms ease; }
.lock-sheet { background: var(--cream); width: 100%; border-top-left-radius: 24px; border-top-right-radius: 24px; padding: 24px 20px 38px; animation: slideUp 300ms cubic-bezier(0.2,0.8,0.2,1); }
.lock-sheet .drag { width: 40px; height: 4px; background: rgba(58,42,26,0.2); border-radius: 99px; margin: 0 auto 18px; }
.lock-sheet h3 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; word-spacing: 0.02em; line-height: 1.05; }
.lock-sheet p { margin: 8px 0 16px; font-size: 14px; color: rgba(26,20,16,0.7); line-height: 1.45; }
.lock-sheet .holder { width: 180px; margin: 0 auto 20px; }
.lock-sheet .btns { display: flex; gap: 10px; }
.lock-sheet .btns button { padding: 14px; border-radius: 99px; font-family: var(--font-body); font-size: 15px; font-weight: 600; cursor: pointer; }
.lock-sheet .keep { flex: 1; background: transparent; border: 1.5px solid var(--burn); color: var(--burn); }
.lock-sheet .lock { flex: 1.4; background: var(--burn); border: none; color: var(--cream); }

/* ── confirm ── */
.confirm { flex: 1; padding: 40px 24px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; overflow-y: auto; }
.confirm .check { width: 64px; height: 64px; border-radius: 99px; background: var(--burn); color: var(--cream); display: flex; align-items: center; justify-content: center; }
.confirm h2 { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.05; font-weight: 400; letter-spacing: -0.025em; word-spacing: 0.03em; color: var(--ink); }
.confirm h2 em { color: var(--ember); font-style: italic; }
.confirm .sub { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(26,20,16,0.7); max-width: 280px; text-wrap: pretty; }
.confirm .preview-holder { width: 70%; max-width: 220px; margin-top: 8px; }
.receipt { margin-top: 14px; padding: 16px; width: 100%; background: var(--paper); border-radius: 12px; border: 1px solid var(--rule); text-align: left; }
.receipt .row { display: flex; justify-content: space-between; font-size: 13px; }
.receipt .loc { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--rule); font-family: var(--font-mono); font-size: 10px; color: rgba(58,42,26,0.6); letter-spacing: 1px; }
.bonus-card { margin-top: 14px; padding: 18px; width: 100%; background: var(--cream); border: 2px dashed var(--ember); border-radius: 14px; position: relative; text-align: left; }
.bonus-card .tab { position: absolute; top: -10px; left: 14px; padding: 2px 8px; background: var(--cream); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px; color: var(--ember); }
.bonus-card .head { font-family: var(--font-display); font-size: 20px; line-height: 1.1; font-weight: 500; color: var(--ink); letter-spacing: -0.015em; }
.bonus-card .head em { color: var(--ember); font-style: italic; }
.bonus-card .body { font-size: 12px; line-height: 1.4; color: rgba(26,20,16,0.6); margin-top: 8px; }
.bonus-card .copy { margin-top: 12px; width: 100%; padding: 10px; border-radius: 99px; background: var(--ember); color: var(--cream); border: none; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; }
.restart { margin-top: 10px; background: none; border: none; cursor: pointer; font-family: var(--font-display); font-style: italic; font-size: 14px; color: rgba(26,20,16,0.55); }

/* Prominent "way back" actions near the top of the confirm screen so the
   customer never has to scroll past the receipt + referral card to continue. */
.confirm-actions-top { display: flex; gap: 10px; width: 100%; max-width: 320px; margin: 4px 0 2px; }
.confirm-actions-top .restart {
  margin-top: 0; flex: 1; padding: 13px 14px; border-radius: 12px;
  font-style: normal; font-family: var(--font-body); font-size: 14px; font-weight: 600;
  background: var(--burn); color: var(--cream); border: none;
}
.confirm-actions-top .restart.secondary {
  background: transparent; color: var(--burn); border: 1.5px solid var(--rule);
}

/* ── live preview (wood plank with engraving) ── */
.live-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: filter 400ms ease; }
.live-inner.rect { flex-direction: row; gap: 14px; padding: 18px; }
.live-inner.square { flex-direction: column; gap: 6px; padding: 22px; }
.live-subject { transform-origin: center; transition: transform 500ms cubic-bezier(0.4,0,0.2,1); display: flex; align-items: center; justify-content: center; }
.live-text-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 20px; }

/* ── real AI render (gpt-image-1) ── */
.rendered-shot { width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); box-shadow: 0 8px 24px rgba(58,42,26,0.18); background: var(--paper); }
.rendered-shot img { display: block; width: 100%; height: auto; }
.rendered-shot.render-result { aspect-ratio: 1 / 1; }
.rendered-shot.render-result img { width: 100%; height: 100%; object-fit: contain; }
.render-partial { position: relative; }
.render-partial img { animation: partial-in .35s ease both; }
.partial-badge { position: absolute; left: 10px; bottom: 10px; padding: 6px 10px; border-radius: 999px; background: rgba(26,20,16,.78); color: #fff; font-size: 12px; font-weight: 700; }
@keyframes partial-in { from { opacity: .25; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
.render-stream-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(58,42,26,0.18);
  isolation: isolate;
  overflow-anchor: none;
  contain: layout paint;
}
.render-stream-stage img { overflow-anchor: none; }
.render-stream-image,
.render-stream-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; }
.render-stream-image { display: block; object-fit: cover; transition: opacity .3s ease, filter .35s ease; }
.render-stream-image:not(.has-partial) { filter: saturate(.7) brightness(.72); }
.render-stream-image.has-partial { object-fit: contain; animation: partial-in .4s ease both; }
.render-stream-placeholder > * { width: 100%; height: 100%; }
.render-stream-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(20,14,10,.72), transparent 46%);
  pointer-events: none;
}
.render-stream-stage.is-complete::after { display: none; }
.render-stream-scan {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 3px;
  top: -4px;
  background: rgba(255,246,220,.92);
  box-shadow: 0 0 16px 4px rgba(255,214,126,.65);
  animation: render-scan 2.2s ease-in-out infinite;
}
.render-stream-status {
  position: absolute;
  z-index: 4;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}
.render-stream-label { font-size: 14px; line-height: 1.25; font-weight: 800; }
.render-stream-sub { margin-top: 3px; font-size: 11px; line-height: 1.35; opacity: .84; }
.render-stream-status .render-spin { flex: 0 0 auto; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes render-scan { 0% { top: -4px; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: calc(100% + 4px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .render-stream-scan { animation: none; top: 50%; opacity: .5; } }
/* Lazy-load state for a historical render (see hydrateHistoricalRender() in mobile.js) */
.rendered-shot.rendered-shot-loading { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.rendered-shot.small { border-radius: 10px; box-shadow: 0 4px 14px rgba(58,42,26,0.15); }
.rendered-shot.uploaded-source img { aspect-ratio: 1 / 1; object-fit: cover; }
.render-workbench {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}
.render-message {
  width: 100%;
  max-width: 340px;
  margin: 2px auto;
}
.render-card-meta { margin-bottom: 8px; }
.render-card-meta .live-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--ember);
  text-align: center;
}
.render-history-note { margin: 4px auto; }
.render-saved-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--muted, #8a7a66);
  background: rgba(58,42,26,0.05);
  border: 1px dashed var(--rule, #e2d8c8);
  border-radius: 10px;
  padding: 7px 10px;
  text-align: center;
}
.render-message .knob-row { margin-top: 6px; }
.render-message .rendered-shot,
.render-message .render-workbench,
.render-message .render-loading {
  width: 100%;
}
.render-workbench .uploaded-source {
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(58,42,26,0.2);
}
.render-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 22px rgba(58,42,26,0.08);
}
.render-status .render-spin {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}
.render-status-title {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.1;
  color: var(--ink);
}
.render-status-sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.4px;
  color: rgba(58,42,26,0.55);
}
.render-loading { position: relative; }
.render-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(244,237,224,0.74); backdrop-filter: blur(2px); border-radius: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--burn); text-transform: uppercase; }
.render-spin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(183,80,31,0.25); border-top-color: var(--ember); animation: ig-spin 0.8s linear infinite; }
@keyframes ig-spin { to { transform: rotate(360deg); } }
.render-failed {
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
  text-align: center;
}
.render-failed-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}
.render-failed-sub {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(26,20,16,0.62);
}
.render-inline-btn {
  margin-top: 10px;
  padding: 8px 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--cream);
  color: var(--burn);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
}
.render-row { margin-top: 10px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.render-btn { padding: 9px 16px; border-radius: 99px; background: var(--ember); color: var(--cream); border: none; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; cursor: pointer; letter-spacing: 0.2px; transition: transform 120ms ease, background 200ms ease; }
.render-btn:active { transform: scale(0.96); }
.render-btn.ghost { background: transparent; color: rgba(26,20,16,0.55); border: 1px solid var(--rule); }
.render-btn.lock-primary { min-width: 168px; background: var(--burn); }

/* ── OTP / lock-in sheet additions ── */
.sheet-back { align-self: flex-start; background: none; border: none; cursor: pointer; font-family: var(--font-body); font-size: 13px; color: rgba(26,20,16,0.55); padding: 0; margin-bottom: 2px; }
.otp-field { width: 100%; margin-top: 6px; }
.otp-field input { width: 100%; box-sizing: border-box; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--paper); font-family: var(--font-mono); font-size: 18px; letter-spacing: 2px; color: var(--ink); text-align: center; outline: none; transition: border-color 160ms ease; }
.otp-field input:focus { border-color: var(--ember); }
.otp-label { margin-top: 4px; font-size: 11px; font-weight: 700; color: rgba(26,20,16,0.62); text-transform: uppercase; letter-spacing: 0.8px; }
.otp-field.name-field input { font-family: var(--font-body); font-size: 16px; letter-spacing: 0; text-align: left; }
.otp-err { min-height: 16px; margin-top: 6px; font-size: 12px; color: #b4231f; text-align: center; }
.dev-hint { display: inline-block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--ember); }
.fineprint { margin-top: 10px; font-size: 10.5px; line-height: 1.4; color: rgba(26,20,16,0.45); text-align: center; }
.fineprint a { color: rgba(26,20,16,0.62); text-decoration: underline; }
.consent-opt { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); cursor: pointer; }
.consent-opt input { margin-top: 1px; width: 16px; height: 16px; accent-color: var(--ember); flex-shrink: 0; }
.consent-opt span { font-size: 12px; line-height: 1.4; color: rgba(26,20,16,0.72); }
.consent-opt.required { border-color: var(--ember); background: rgba(181,101,29,0.06); margin-top: 14px; }
.consent-opt.required span { color: rgba(26,20,16,0.82); }
.btns .lock[disabled], .btns .lock[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.lock-sheet .lock[disabled] { opacity: 0.6; cursor: default; }

.input-bar { padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }

/* Turnstile widget container inside the OTP sheet */
.turnstile-box { display: flex; justify-content: center; margin: 10px 0 4px; min-height: 0; transform: scale(0.92); transform-origin: center; }

/* ── In-app toast (replaces native alert) ── */
.toast-host {
  position: fixed;
  left: 0; right: 0;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 9000;
  display: flex;
  justify-content: center;
  padding: 0 14px;
  pointer-events: none;
}
.toast {
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
  background: var(--ink, #1a1410);
  color: #fff8ee;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  padding: 13px 16px;
  border-radius: 14px;
  box-shadow: 0 14px 34px -10px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity .24s ease, transform .24s ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info { border-left: 4px solid var(--ember, #c95821); }
.toast-error { background: #7a1f12; border-left: 4px solid #f0a58c; }

/* ── online / demo entry points (v88) ──────────────────────────────────────
   The booth customer can look up and ask; the online one cannot. A persistent
   launcher on every screen opens the channels the shop actually has. Bottom
   LEFT on purpose — the bottom right is where the chat composer and the
   lock-in CTA live, and this must never sit over the primary action. */
.contact-launcher {
  position: fixed;
  left: max(12px, calc(50% - 244px));
  bottom: 14px;
  z-index: 60;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule, #e5dcc9);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(6px);
  color: var(--ink, #1a1410);
  font: 700 12px/1 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.contact-launcher:hover { border-color: var(--wood, #c8893f); }
.contact-sheet .contact-rows { display: grid; gap: 8px; margin: 6px 0 14px; }
.contact-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--rule, #e5dcc9); background: var(--card, #faf5ea);
  text-decoration: none; color: inherit;
}
.contact-row:hover { border-color: var(--wood, #c8893f); }
.contact-label { font-weight: 800; font-size: 14px; }
.contact-go { font-size: 12px; color: var(--muted, #6b5f4a); }
.contact-empty { font-size: 13px; color: var(--muted, #6b5f4a); }
/* The attribution question on the lock-in sheet. Full width, same visual
   language as the OTP inputs it sits beside. */
.source-select {
  width: 100%; padding: 12px; margin-bottom: 4px;
  border-radius: 10px; border: 1px solid var(--rule, #e5dcc9);
  background: var(--card, #faf5ea); color: inherit;
  font: 500 15px/1.2 'Inter', system-ui, sans-serif;
}
.source-select:focus { border-color: var(--wood, #c8893f); outline: none; }
