/* DeepBuild demo: an iPhone you call your PM on, and beside it the call page from the product, filling in as the call
   goes. Built on the app's design.css; the report styles below follow style.css's call page. Light only, like the website. */
body.demo-page { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font-family: var(--font-body); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(100%, 1160px); margin: 0 auto; padding: 18px 24px; }
.demo-brand { display: inline-flex; align-items: center; gap: 3px; color: var(--text); text-decoration: none; font: 600 17px/1 var(--font-heading); letter-spacing: -.05em; }
.demo-brand img { width: 27px; height: 27px; }
.demo-pilot { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.demo-pilot:hover { background: var(--surface-hover); }
.demo-main { flex: 1; width: min(100%, 1160px); margin: 0 auto; padding: 24px 24px 72px; }
.demo-intro { text-align: center; }
.demo-title { margin: 0; font: 600 clamp(36px, 5.4vw, 52px)/1.05 var(--font-heading); letter-spacing: -.04em; }
.demo-lede { max-width: 600px; margin: 12px auto 0; font-size: 18px; line-height: 1.5; color: var(--text-secondary); text-wrap: pretty; }
.demo-title { text-wrap: balance; }
.demo-small { margin: 18px 0 0; font-size: 13px; color: var(--text-muted); text-align: center; }
.demo-error { margin: 14px auto 0; max-width: 340px; padding: 10px 12px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }

.demo-stage { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 44px; }
.demo-phone-col { display: flex; flex-direction: column; align-items: center; }

/* ── the iPhone ─────────────────────────────────────────────────────────── */
.iphone { --ios: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  position: relative; width: 332px; padding: 11px; border-radius: 58px; background: #1d1d1f;
  box-shadow: 0 0 0 1.5px #8e8c88, 0 0 0 3px #3a3a3c, 0 1px 1px 3px rgb(255 255 255 / .25) inset, 0 50px 90px -40px rgb(20 20 18 / .55), 0 18px 40px -24px rgb(20 20 18 / .35); }
.iphone::before, .iphone::after { content: ""; position: absolute; width: 4px; border-radius: 2px; background: #5d5c59; }
.iphone::before { left: -6px; top: 118px; height: 30px; box-shadow: 0 52px 0 0 #5d5c59, 0 112px 0 0 #5d5c59; }   /* action + volume */
.iphone::after { right: -6px; top: 178px; height: 74px; }                                                        /* side button */
.ios-screen { position: relative; display: flex; flex-direction: column; height: 676px; border-radius: 47px; overflow: hidden; color: #fff; font-family: var(--ios); -webkit-font-smoothing: antialiased;
  background: radial-gradient(120% 70% at 50% 0%, #6b6c72 0%, #3f4045 45%, #1f2023 100%); transition: background 600ms ease; }
.ios-screen[data-state="idle"], .ios-screen[data-state="ended"], .ios-screen[data-state="working"], .ios-screen[data-state="done"] { background: radial-gradient(120% 70% at 50% 0%, #55565b 0%, #313236 50%, #18191b 100%); }
/* each side of the status bar is centred in the space beside the island, like iOS */
.ios-bar { position: relative; display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; justify-items: center; height: 52px; padding: 4px 14px 0; font: 600 16px/1 var(--ios); letter-spacing: -.01em; }
.ios-island { position: absolute; top: 11px; left: 50%; width: 104px; height: 31px; margin-left: -52px; border-radius: 16px; background: #000; }
.ios-icons { grid-column: 3; display: inline-flex; align-items: center; gap: 5px; }
.ios-clock { grid-column: 1; }
.ios-icons svg { fill: currentColor; }

.ios-caller { padding: 34px 24px 0; text-align: center; }
.ios-name { margin: 0; font: 400 32px/1.15 var(--ios); letter-spacing: -.02em; }
.ios-sub { margin: 6px 0 0; min-height: 22px; font: 400 17px/1.3 var(--ios); color: rgb(235 235 245 / .6); font-variant-numeric: tabular-nums; }
/* on the call the timer stands where the status was; the status stays for screen readers */
.ios-screen:not([data-state="live"]) #timer { display: none; }
.ios-screen[data-state="live"] #status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ios-avatar { display: grid; place-items: center; width: 112px; height: 112px; margin: 40px auto 0; border-radius: 50%;
  background: linear-gradient(180deg, #a5a8b0 0%, #82858d 100%); color: #fff; font: 500 46px/1 var(--ios); letter-spacing: .01em; }
.ios-screen[data-state="ringing"] .ios-avatar { animation: ios-ring 1.6s ease-in-out infinite; }
@keyframes ios-ring { 0%, 100% { box-shadow: 0 0 0 0 rgb(255 255 255 / .16); } 60% { box-shadow: 0 0 0 18px rgb(255 255 255 / 0); } }

.ios-keys { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 22px 22px; margin-top: auto; padding: 0 0 46px; }
.ios-key { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; box-shadow: none; color: #fff; font: inherit; cursor: default; transition: opacity 320ms ease, transform 320ms ease; }
.ios-key i { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: rgb(255 255 255 / .18); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: background 160ms ease, color 160ms ease; }
.ios-key svg { width: 30px; height: 30px; fill: currentColor; }
.ios-key b { font: 500 13px/1 var(--ios); color: #fff; letter-spacing: 0; }
.ios-key.is-off { opacity: .45; }
button.ios-key:not(:disabled) { cursor: pointer; }
button.ios-key:disabled { opacity: .45; }
button.ios-key:not(:disabled):hover i { background: rgb(255 255 255 / .26); }
button.ios-key:focus-visible { outline: none; }
button.ios-key:focus-visible i { outline: 3px solid #fff; outline-offset: 3px; }
.ios-slash { stroke: transparent; }
#mute[aria-pressed="true"] i { background: #fff; color: #1d1d1f; }
#mute[aria-pressed="true"] .ios-slash { stroke: currentColor; }
.ios-round { display: grid; place-items: center; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%; color: #fff; box-shadow: none; cursor: pointer; transition: filter 160ms ease, transform 160ms ease; }
.ios-round svg { width: 34px; height: 34px; fill: currentColor; }
.ios-round.is-call, .ios-round.is-call:is(:hover, :active):not(:disabled) { background: #34c759; color: #fff; }
.ios-round.is-end, .ios-round.is-end:is(:hover, :active):not(:disabled) { background: #ff3b30; color: #fff; }
button.ios-key:is(:hover, :active):not(:disabled) { background: none; color: #fff; }
button.ios-key:disabled { cursor: default; }
.ios-round.is-end svg { transform: rotate(135deg); }
.ios-round:hover { filter: brightness(1.08); }
.ios-round:active { transform: scale(.94); }
.ios-round:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* before and after a call only the call button shows */
.ios-screen:is([data-state="idle"], [data-state="ended"], [data-state="working"], [data-state="done"]) .ios-key:not(.ios-main) { opacity: 0; visibility: hidden; transform: translateY(8px); }
.ios-home { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: rgb(255 255 255 / .9); }

/* ── the report: the call page ──────────────────────────────────────────── */
.report { display: flex; flex-direction: column; height: 698px; min-width: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgb(20 20 18 / .04), 0 24px 60px -40px rgb(20 20 18 / .25); overflow: hidden; }
.report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 22px 32px 10px; }
.report-head h2 { margin: 0; font: 600 18px/1.3 var(--font-heading); letter-spacing: -.02em; }
.report-meta { margin: 0; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-views { display: flex; gap: 24px; flex-shrink: 0; margin: 0 32px; padding: 0; border-bottom: 1px solid var(--border); }
.report-views button { min-height: 40px; padding: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; box-shadow: none; color: var(--text-muted); font-size: 14px; font-weight: 600; margin-bottom: -1px; cursor: pointer; }
.report-views button:hover { background: transparent; color: var(--text); }
.report-views button[aria-selected="true"] { border-bottom-color: var(--text); color: var(--text); }
.report-body { flex: 1; min-height: 0; display: flex; }
.report-pane { flex: 1; min-width: 0; overflow: auto; padding: 28px 32px 36px; scrollbar-gutter: stable; }
.report-pane:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.report-pane > * { animation: ask-rise 200ms ease both; }

.context-empty-title, .issue h2 { margin: 0; font-size: 24px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.awaiting { margin: 12px 0; font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.report-working { display: flex; align-items: center; gap: 12px; margin: 10px 0 16px; color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
.report-working deepbuild-working { flex: none; font-size: 20px; color: var(--text); --db-signal: var(--signal); }
.shimmer-text { background: linear-gradient(90deg, var(--text-muted) 0%, var(--text-muted) 35%, var(--text) 50%, var(--text-muted) 65%, var(--text-muted) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ask-shimmer 1.8s linear infinite; }
@keyframes ask-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes ask-rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.issue + .issue { margin-top: 48px; }
.issue-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.impact p { max-width: 720px; margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
.priority-line { display: flex; align-items: center; gap: 8px; }
.estimate-label { font-size: 13px; color: var(--text-muted); }
.badge.high, .badge.medium { color: var(--warning); background: var(--warning-bg); }
.badge.critical { color: var(--danger); background: var(--danger-bg); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 260px)); gap: 20px 40px; margin: 0 0 28px; }
.field dt, .field-label { margin: 0 0 4px; font-size: 13px; color: var(--text-muted); }
.field dd { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.commitments, .missing { margin: 0 0 24px; }
.commitments h3, .missing h3 { margin: 0 0 10px; font: 600 13px/1.4 var(--font-body); color: var(--text-muted); }
.commitments p { margin: 6px 0; font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.missing ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--text-muted); }

.notes-summary { margin: 0 0 28px; font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
.long-note + .long-note { margin-top: 40px; }
.long-note h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.long-note h4 { margin: 20px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.long-note p { margin: 0; font-size: 15px; line-height: 1.55; }
.long-note ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.55; }
.note-context { font-size: 13px; color: var(--text-muted); }

.transcript { padding: 20px 28px 28px; }
.turn { width: fit-content; max-width: 88%; margin: 0 0 18px; font-size: 15px; line-height: 1.5; }
.turn.manager { margin-left: auto; }
.speaker { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.turn.manager .speaker { justify-content: flex-end; }
.speaker strong { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.speaker svg { width: 13px; height: 13px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; }
.utterance { margin: 0; padding: 9px 13px; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; background: var(--surface); overflow-wrap: anywhere; }
.turn.manager .utterance { border-color: transparent; border-radius: 14px 14px 4px 14px; background: var(--surface-selected); }
.call-ended, .call-started { display: flex; align-items: center; gap: 12px; margin: 24px 0 4px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.call-ended::before, .call-ended::after, .call-started::before, .call-started::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.call-notice { margin: 4px 0 20px; }
.call-notice .call-started { margin: 0 0 6px; }
.call-notice .notice-text { margin: 0; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.45; }

.demo-next { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 32px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.demo-primary { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); font: 600 14px/1 var(--font-body); text-decoration: none; }
.demo-primary:hover { background: var(--accent-hover); }

.demo-foot { display: flex; justify-content: center; gap: 20px; padding: 24px; font-size: 13px; color: var(--text-muted); }
.demo-foot a { color: var(--text-muted); text-decoration: none; }
.demo-foot a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 900px) {
  .demo-stage { grid-template-columns: 1fr; gap: 36px; margin-top: 32px; }
  .report { height: auto; min-height: 320px; }
  .report-pane { overflow: visible; }
}
@media (max-width: 600px) {
  .demo-main { padding: 16px 16px 56px; }
  .demo-head { padding: 14px 16px; }
  .demo-lede { font-size: 16px; }
  .iphone { width: 300px; border-radius: 52px; padding: 10px; }
  .ios-screen { height: 610px; border-radius: 42px; }
  .ios-keys { grid-template-columns: repeat(3, 70px); gap: 18px 20px; padding-bottom: 40px; }
  .ios-key i, .ios-round { width: 70px; height: 70px; }
  .ios-avatar { width: 96px; height: 96px; margin-top: 30px; font-size: 40px; }
  .report-head { padding: 18px 18px 8px; }
  .report-views { margin: 0 18px; }
  .report-pane { padding: 22px 18px 28px; }
  .transcript { padding: 18px 18px 24px; }
  .demo-next { padding: 14px 18px; }
  .issue h2, .context-empty-title { font-size: 22px; }
  .turn { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ios-screen[data-state] .ios-avatar { animation: none; }
  .shimmer-text { animation: none; color: var(--text-secondary); background: none; }
  .report-pane > *, .ios-key { animation: none; transition: none; }
}
