/*
 * iHow Memory customer-support demo: iOS 27 / Liquid Glass-inspired customer surface.
 * This is synthetic demo UI, not Core, CRM, or P1 packaged proof.
 * The phone stays human-facing; governance language belongs in the explainer and governance.html.
 */
:root {
  color-scheme: light;
  --canvas: #f2f2f7;
  --canvas-deep: #e9e9f0;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --surface-soft: rgba(255, 255, 255, .48);
  --label: #1c1c1e;
  --secondary: #6e6e73;
  --tertiary: #8e8e93;
  --separator: rgba(60, 60, 67, .16);
  --fill: rgba(118, 118, 128, .12);
  --blue: #007aff;
  --blue-soft: rgba(0, 122, 255, .11);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, .12);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, .13);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, .11);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-phone: 0 34px 70px rgba(28, 28, 30, .18), 0 10px 24px rgba(28, 28, 30, .10);
  --shadow-float: 0 14px 34px rgba(28, 28, 30, .10), 0 2px 8px rgba(28, 28, 30, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { min-height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--label);
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(255, 255, 255, .92), transparent 68%),
    linear-gradient(145deg, var(--canvas) 0%, var(--canvas-deep) 100%);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea { font: inherit; }

button {
  border: 0;
  cursor: pointer;
}

button:disabled { cursor: not-allowed; opacity: .48; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .35);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- shared desktop navigation ---------- */
.surface-nav {
  position: fixed;
  z-index: 60;
  top: 50%;
  left: 20px;
  display: grid;
  width: 172px;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 14px 34px rgba(28, 28, 30, .10), 0 2px 8px rgba(28, 28, 30, .05);
  transform: translateY(-50%);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
}
.surface-nav-brand { display: flex; align-items: center; gap: 9px; padding: 2px 3px 12px; border-bottom: 1px solid var(--separator); color: var(--label); font-size: 13px; font-weight: 720; text-decoration: none; }
.surface-nav-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #2581ff, #1760cf); font-size: 11px; font-weight: 800; box-shadow: 0 7px 18px rgba(23, 105, 224, .24); }
.surface-nav-links { display: grid; gap: 5px; margin-top: 10px; }
.surface-nav-link { display: flex; min-height: 42px; align-items: center; padding: 0 12px; border-radius: 11px; color: var(--secondary); font-size: 13px; font-weight: 650; text-decoration: none; transition: background-color .18s ease, color .18s ease; }
.surface-nav-link:hover { color: var(--label); background: rgba(118, 118, 128, .09); }
.surface-nav-link.is-active { color: var(--blue); background: var(--blue-soft); }
.surface-nav-link.is-active::before { width: 3px; height: 16px; margin-right: 9px; border-radius: 999px; background: var(--blue); content: ""; }
.surface-nav-note { margin: 10px 3px 0; color: var(--tertiary); font-size: 10px; }

/* ---------- desktop presentation stage ---------- */
.demo-stage {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(360px, 520px);
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 8vw, 120px);
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 54px);
  margin: 0 auto;
  padding: 36px 0 52px;
}

.phone-demo {
  display: grid;
  justify-items: center;
}

.phone-frame {
  position: relative;
  isolation: isolate;
  width: min(390px, 100%);
  height: min(820px, calc(100vh - 96px));
  min-height: 680px;
  padding: 0;
  overflow: hidden;
  border: 10px solid #111113;
  border-radius: 50px;
  background: #111113;
  box-shadow: var(--shadow-phone);
}

.phone-frame::after {
  position: absolute;
  z-index: 30;
  inset: -10px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 50px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .78);
  content: "";
  pointer-events: none;
}


.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 40px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(242, 242, 247, .72)),
    var(--canvas);
}

.app-top {
  position: relative;
  z-index: 20;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 25px 18px 10px;
  border-bottom: 1px solid rgba(60, 60, 67, .12);
  background: rgba(250, 250, 252, .72);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
  backdrop-filter: blur(26px) saturate(1.35);
}

.brand { display: grid; min-width: 0; gap: 0; }
.brand-name { margin: 0; font-size: 15px; font-weight: 720; letter-spacing: -.015em; }
.brand-sub { min-height: 14px; margin: 1px 0 0; color: var(--secondary); font-size: 10px; transition: color .2s ease; }
.app-shell[data-busy="true"] .brand-sub { color: var(--blue); }
.app-top-actions { display: flex; align-items: center; gap: 11px; margin-left: auto; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); transition: background-color .2s ease, box-shadow .2s ease; }
.app-shell[data-busy="true"] .online-dot { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); animation: online-pulse 1.2s ease-in-out infinite; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--separator); border-radius: 50%; color: var(--secondary); background: rgba(255, 255, 255, .54); transition: transform .22s ease, background-color .22s ease, color .22s ease; }
.icon-button:hover { color: var(--label); background: rgba(255, 255, 255, .88); }
.icon-button:active { transform: scale(.93); }
.demo-mark { align-self: start; margin-left: -4px; color: var(--tertiary); font: 9px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; }

.status-banner { position: absolute; z-index: 30; top: 70px; right: 14px; left: 14px; padding: 10px 13px; border: 1px solid rgba(60, 60, 67, .12); border-radius: 15px; background: rgba(255, 255, 255, .86); color: var(--label); box-shadow: var(--shadow-float); font-size: 12px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: glass-drop .24s cubic-bezier(.2, .75, .25, 1); }
.status-banner[data-tone="ok"], .status-banner[data-tone="positive"] { background: rgba(231, 249, 237, .90); color: #19733a; }
.status-banner[data-tone="error"], .status-banner[data-tone="danger"] { background: rgba(255, 238, 237, .92); color: #b42318; }

.app-main { display: grid; flex: 1 1 auto; min-height: 0; grid-auto-rows: max-content; align-content: start; gap: 14px; padding: 18px 16px 28px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 18px 0 28px; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(60, 60, 67, .16) transparent; -webkit-overflow-scrolling: touch; }
.app-main::-webkit-scrollbar { width: 4px; }
.app-main::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(60, 60, 67, .18); }
.app-main section { min-width: 0; }
.app-main h3 { margin: 0 0 8px; color: var(--secondary); font-size: 11px; font-weight: 650; letter-spacing: .04em; }

/* Specific product context, shown instead of a generic welcome panel. */
.scenario-context { position: relative; z-index: 1; padding: 13px 15px; border: 1px solid rgba(255, 255, 255, .74); border-radius: 20px; background: rgba(255, 255, 255, .78); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 6px 18px rgba(28, 28, 30, .04); }
.scenario-context-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 10px; }
.context-product { color: var(--secondary); font-size: 10px; }
.context-model { grid-row: 1 / span 2; grid-column: 2; color: var(--blue); font: 680 11px/1 var(--mono); }
.context-issue { font-size: 14px; font-weight: 680; letter-spacing: -.015em; }

.conversation-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.msg { position: relative; max-width: 86%; padding: 11px 13px 9px; border: 1px solid rgba(60, 60, 67, .10); border-radius: 19px; background: rgba(255, 255, 255, .86); box-shadow: 0 3px 12px rgba(28, 28, 30, .045); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; transform-origin: bottom left; animation: message-in .34s cubic-bezier(.2, .85, .22, 1) both; }
.msg-agent { border-bottom-left-radius: 6px; }
.msg-customer { margin-left: auto; border-color: rgba(0, 122, 255, .10); border-bottom-right-radius: 6px; color: #fff; background: linear-gradient(145deg, #158cff, #0877eb); box-shadow: 0 5px 14px rgba(0, 122, 255, .14); transform-origin: bottom right; }
.msg-system { justify-self: center; max-width: 100%; padding: 2px 6px; border: 0; border-radius: 0; background: transparent; color: var(--secondary); box-shadow: none; font-size: 11px; text-align: center; }
.msg-streaming::after { display: inline-block; width: 2px; height: 1em; margin-left: 2px; border-radius: 2px; background: var(--blue); vertical-align: -2px; content: ""; animation: caret-blink .7s steps(1) infinite; }
.msg-time { display: block; min-height: 10px; margin-top: 4px; color: var(--tertiary); font: 9px/1 var(--mono); }
.msg-customer .msg-time { color: rgba(255, 255, 255, .68); }
.msg-typing { min-width: 58px; min-height: 40px; padding: 14px 15px; }
.typing-dots { display: flex; align-items: center; gap: 4px; height: 10px; }
.typing-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--tertiary); animation: typing-bounce 1.05s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .14s; }
.typing-dots i:nth-child(3) { animation-delay: .28s; }
.conversation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; animation: actions-in .3s cubic-bezier(.2, .8, .25, 1) both; }
.conversation-action { min-height: 42px; padding: 0 15px; border: 1px solid rgba(0, 122, 255, .18); border-radius: 999px; color: var(--blue); background: rgba(255, 255, 255, .82); box-shadow: 0 3px 10px rgba(0, 122, 255, .05); font-size: 13px; font-weight: 650; transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.conversation-action[data-tone="primary"] { border-color: var(--blue); color: #fff; background: var(--blue); box-shadow: 0 5px 14px rgba(0, 122, 255, .18); }
.conversation-action:hover { border-color: rgba(0, 122, 255, .35); background: rgba(255, 255, 255, .96); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 122, 255, .10); }
.conversation-action[data-tone="primary"]:hover { color: #fff; background: #087ff4; }
.conversation-action:active { transform: scale(.97); }
.scenario-card:disabled { cursor: wait; opacity: .62; transform: none; }
.icon-button:disabled { cursor: wait; opacity: .48; }

.memory-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; width: 100%; min-height: 0; padding: 14px 15px; border: 1px solid rgba(60, 60, 67, .10); border-radius: 19px; background: rgba(255, 255, 255, .72); color: var(--label); text-align: left; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 6px 18px rgba(28, 28, 30, .045); transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease; animation: card-in .38s cubic-bezier(.2, .8, .25, 1) both; }
.memory-card:hover { border-color: rgba(0, 122, 255, .30); transform: translateY(-1px); }
.memory-card[data-status="paused"], .memory-card[data-status="suppressed"] { border-color: rgba(255, 159, 10, .34); }
.memory-card[data-status="forgotten"] { border-color: rgba(255, 59, 48, .30); }
.memory-kicker { grid-column: 1; color: var(--secondary); font: 9px/1.2 var(--mono); letter-spacing: .04em; }
.memory-fact { grid-column: 1 / -1; font-size: 13px; font-weight: 650; line-height: 1.45; }
.memory-source { grid-column: 1; color: var(--secondary); font-size: 10px; }
.status-chip { grid-row: 1; grid-column: 2; display: inline-flex; align-items: center; align-self: start; min-height: 23px; padding: 0 8px; border: 1px solid rgba(60, 60, 67, .14); border-radius: 999px; background: rgba(255, 255, 255, .62); color: var(--secondary); font-size: 10px; font-weight: 650; white-space: nowrap; }
.status-chip[data-status="active"] { border-color: rgba(52, 199, 89, .28); background: var(--green-soft); color: #198b3d; }
.status-chip[data-status="pending"], .status-chip[data-status="paused"], .status-chip[data-status="suppressed"] { border-color: rgba(255, 159, 10, .30); background: var(--orange-soft); color: #9a5c00; }
.status-chip[data-status="forgotten"] { border-color: rgba(255, 59, 48, .28); background: var(--red-soft); color: #b42318; }

.order-result, .knowledge-source { position: relative; overflow: hidden; padding: 15px 16px; border: 1px solid rgba(0, 122, 255, .12); border-radius: 20px; background: rgba(255, 255, 255, .82); box-shadow: 0 12px 28px rgba(28, 28, 30, .08), inset 0 1px 0 rgba(255, 255, 255, .9); animation: result-in .48s cubic-bezier(.18, .9, .22, 1) both; }
.order-result::before, .knowledge-source::before { position: absolute; top: 0; left: 16px; width: 38px; height: 3px; border-radius: 0 0 999px 999px; background: var(--blue); content: ""; }
.result-eyebrow { margin: 0; color: var(--blue); font: 650 9px/1.2 var(--mono); letter-spacing: .04em; }
.order-result h3, .knowledge-source h3 { margin: 7px 0 10px; color: var(--label); font-size: 14px; letter-spacing: -.015em; }
.result-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid rgba(60, 60, 67, .09); font-size: 12px; }
.result-label { color: var(--secondary); }
.result-value { font-weight: 620; overflow-wrap: anywhere; }
.result-note { margin: 9px 0 0; color: var(--tertiary); font-size: 9px; }

.handoff { padding: 16px; border: 1px solid rgba(0, 122, 255, .16); border-radius: 22px; background: rgba(255, 255, 255, .62); box-shadow: var(--shadow-float); animation: glass-rise .32s cubic-bezier(.2, .8, .25, 1); }
.handoff h3 { color: var(--label); font-size: 15px; }
.handoff-summary { display: grid; gap: 9px; }
.handoff-field { display: grid; grid-template-columns: 76px 1fr; gap: 10px; font-size: 12px; }
.handoff-field dt { color: var(--secondary); }
.handoff-field dd { margin: 0; overflow-wrap: anywhere; }

.human-agent { padding: 16px; border: 1px solid rgba(48, 209, 88, .20); border-radius: 22px; background: rgba(255, 255, 255, .72); box-shadow: var(--shadow-float); animation: glass-rise .32s cubic-bezier(.2, .8, .25, 1); }
.human-agent-profile { display: flex; align-items: center; gap: 11px; }
.human-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 2px solid rgba(255, 255, 255, .88); border-radius: 50%; color: #fff; background: linear-gradient(145deg, #4568dc, #6f86d6); box-shadow: 0 5px 14px rgba(69, 104, 220, .24); font-size: 16px; font-weight: 750; }
.human-agent-meta { display: grid; gap: 3px; }
.human-agent-meta strong { color: var(--label); font-size: 14px; }
.human-agent-meta span { color: var(--secondary); font-size: 11px; }
.human-online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, .12); }
.human-thread { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.human-thread .msg { animation-duration: .28s; }
.human-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 0 53px; }
.human-actions button { min-height: 42px; padding: 7px 10px; border: 1px solid rgba(0, 122, 255, .18); border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 680; }
.human-actions button[data-selected="true"] { color: #fff; background: var(--blue); }
.human-actions button:disabled:not([data-selected="true"]) { opacity: .42; }
.human-note { margin: 9px 0 0 53px; color: var(--tertiary); font-size: 10px; line-height: 1.45; }

.composer { position: relative; z-index: 20; display: flex; flex: 0 0 auto; gap: 8px; padding: 10px 14px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(60, 60, 67, .10); background: rgba(250, 250, 252, .86); box-shadow: 0 -10px 28px rgba(28, 28, 30, .035); -webkit-backdrop-filter: blur(26px) saturate(1.35); backdrop-filter: blur(26px) saturate(1.35); }
.composer input { flex: 1; min-width: 0; height: 44px; padding: 0 15px; border: 1px solid rgba(60, 60, 67, .12); border-radius: 17px; color: var(--label); background: rgba(255, 255, 255, .88); font-size: 15px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); transition: opacity .2s ease, background-color .2s ease; }
.composer input::placeholder { color: var(--tertiary); }
/* ---------- desktop two-scenario selector ---------- */
.stage-explainer { align-self: center; max-width: 520px; padding: 8px 0; }
.explainer-eyebrow { margin: 0 0 15px; color: var(--blue); font-size: 11px; font-weight: 720; letter-spacing: .12em; }
.stage-explainer > h1 { max-width: 500px; margin: 0; font-size: clamp(32px, 4vw, 48px); font-weight: 720; line-height: 1.08; letter-spacing: -.045em; }
.scenario-cards { display: grid; gap: 12px; margin-top: 30px; }
.scenario-card { display: grid; gap: 7px; width: 100%; min-height: 118px; padding: 18px 20px; border: 1px solid rgba(255, 255, 255, .68); border-radius: 23px; color: var(--label); background: rgba(255, 255, 255, .48); text-align: left; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76), 0 8px 22px rgba(28, 28, 30, .05); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2); transition: transform .22s ease, border-color .22s ease, background-color .22s ease; }
.scenario-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .70); }
.scenario-card[aria-current="page"] { border-color: rgba(0, 122, 255, .34); background: rgba(240, 247, 255, .72); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 12px 28px rgba(0, 122, 255, .10); }
.scenario-card-title { color: var(--blue); font-size: 14px; font-weight: 700; }
.scenario-card-body { color: var(--secondary); font-size: 13px; line-height: 1.52; }
.scenario-caption { min-height: 66px; margin: 18px 0 0; padding: 15px 17px; border: 1px solid rgba(255, 255, 255, .66); border-radius: 19px; background: rgba(255, 255, 255, .44); color: var(--secondary); font-size: 12px; line-height: 1.5; }
.explainer-note { margin: 11px 0 0; color: var(--tertiary); font-size: 11px; }
.demo-footer { min-height: 54px; padding: 0 24px 22px; color: var(--tertiary); text-align: center; font-size: 10px; }
.demo-footer p { margin: 0; }

/* ---------- glass sheets and dialogs ---------- */
dialog { width: min(430px, calc(100vw - 24px)); padding: 0; border: 1px solid rgba(255, 255, 255, .72); border-radius: 28px; color: var(--label); background: rgba(250, 250, 252, .88); box-shadow: 0 24px 70px rgba(28, 28, 30, .24); -webkit-backdrop-filter: blur(34px) saturate(1.35); backdrop-filter: blur(34px) saturate(1.35); }
dialog::backdrop { background: rgba(28, 28, 30, .34); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
dialog > form { padding: 22px; }
dialog h2 { margin: 0; font-size: 20px; font-weight: 720; letter-spacing: -.025em; }
.dialog-hint { margin: 7px 0 16px; color: var(--secondary); font-size: 12px; line-height: 1.5; }
dialog label { display: block; margin: 14px 0 6px; color: var(--secondary); font-size: 12px; font-weight: 620; }
dialog textarea { width: 100%; min-height: 72px; padding: 11px 13px; resize: vertical; border: 1px solid var(--separator); border-radius: 15px; color: var(--label); background: rgba(255, 255, 255, .72); font-size: 15px; line-height: 1.45; }
.dialog-actions, .source-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dialog-actions button, .source-actions button, .sheet-close { flex: 1 1 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--separator); border-radius: 15px; color: var(--label); background: rgba(255, 255, 255, .68); font-size: 13px; font-weight: 650; }
#correct-submit-button { border-color: var(--blue); color: #fff; background: var(--blue); }
#forget-button, #forget-submit-button { border-color: rgba(255, 59, 48, .20); color: var(--red); background: var(--red-soft); }
#ticket-button { border-color: rgba(0, 122, 255, .20); color: var(--blue); background: var(--blue-soft); }
.sheet-close { width: 100%; margin-top: 9px; color: var(--secondary); background: transparent; }

#source-sheet { position: fixed; inset: auto 0 0; width: min(430px, 100%); max-height: 88dvh; margin: 0 auto; border-bottom: 0; border-radius: 30px 30px 0 0; }
#source-sheet > form { max-height: 88dvh; overflow-y: auto; padding: 10px 22px calc(20px + env(safe-area-inset-bottom)); }
#source-sheet > form::before { display: block; width: 38px; height: 5px; margin: 2px auto 14px; border-radius: 999px; background: rgba(60, 60, 67, .24); content: ""; }
.source-fields { margin: 16px 0 0; }
.source-field { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(60, 60, 67, .11); }
.source-field:last-child { border-bottom: 0; }
.source-field dt { color: var(--secondary); font-size: 12px; }
.source-field dd { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
#source-ticket, #source-recorded-at { font-family: var(--mono); font-size: 12px; }

/* ---------- motion ---------- */
@keyframes online-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.75); opacity: .5; } }
@keyframes message-in { from { opacity: 0; transform: translateY(12px) scale(.965); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes actions-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .38; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes caret-blink { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes result-in { from { opacity: 0; transform: translateY(16px) scale(.97); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes glass-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes glass-drop { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes dot-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.78); } }
@keyframes sheet-up { from { opacity: .4; transform: translateY(22%); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dialog-in .28s cubic-bezier(.2, .8, .25, 1); }
  #source-sheet[open] { animation: sheet-up .34s cubic-bezier(.2, .85, .24, 1); }
  .check-item:nth-child(2) { animation-delay: .04s; }
  .check-item:nth-child(3) { animation-delay: .08s; }
  .check-item:nth-child(4) { animation-delay: .12s; }
}

@media (max-width: 860px) {
  body { background: var(--canvas); }
  .demo-stage { display: block; width: 100%; height: 100vh; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  .phone-demo { display: block; height: 100%; }
  .phone-frame { width: 100%; height: 100%; min-height: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .phone-frame::before, .phone-frame::after, .phone-status-bar { display: none; }
  .app-shell { height: 100%; min-height: 0; border-radius: 0; }
  .app-top { min-height: 58px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .stage-explainer, .demo-footer { display: none; }
  .surface-nav { display: none; }
}
@media (max-width: 360px) {
  .app-main { padding-inline: 12px; }
  .next-actions { grid-template-columns: 1fr; }
  .source-field { grid-template-columns: 76px 1fr; }
  .source-actions { display: grid; grid-template-columns: 1fr; }
}

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