.pd-demo {
  --pd-ink: #14241c;
  --pd-muted: #617168;
  --pd-line: #d5ded8;
  --pd-ease-out: var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
  container: pd-frame / inline-size;
  width: 100%;
  color: var(--pd-ink);
  font-family: var(--font-body, sans-serif);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  overflow: hidden;
  border: 1px solid #bdcdc3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 26px 60px -30px rgba(28,59,42,.24), 0 4px 10px -5px rgba(28,59,42,.08);
}
.pd-demo *, .pd-demo *::before, .pd-demo *::after { box-sizing: border-box; }
.pd-demo p, .pd-demo h3, .pd-demo h4 { margin: 0; }
.pd-demo strong { font-weight: 600; }
.pd-icon { width: 16px; height: 16px; flex-shrink: 0; display: block; }
.pd-appbar { display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--pd-line); }
.pd-brand { display: flex; align-items: center; gap: 8px; }
.pd-wordmark { font-family: var(--font-display, sans-serif); font-size: 12px; font-weight: 650; letter-spacing: -.35px; }
.pd-wordmark > span { color: #22754d; }
.pd-workspace-label { display: flex; align-items: center; gap: 7px; color: var(--pd-muted); font-size: 9px; }
.pd-workspace-label .pd-icon { width: 10px; height: 10px; }
.pd-connected { display: flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 7px; border: 1px solid #cddfd3; border-radius: 5px; background: #eff6f1; color: #386e4d; font-size: 9px; white-space: nowrap; }
.pd-ai-mark { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; background: #0c1c14; color: #10b981; }
.pd-ai-mark-small { width: 20px; height: 20px; border-radius: 6px; }
.pd-ai-mark-small svg { width: 14px; height: 14px; }
.pd-shell { min-height: 460px; display: grid; grid-template-columns: 40px 160px minmax(0, 1fr); }
.pd-rail { display: flex; flex-direction: column; align-items: center; padding: 12px 5px 10px; border-right: 1px solid #203d30; background: #142a22; }
.pd-rail-nav { display: grid; gap: 6px; }
.pd-rail-item { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #9cb8aa; }
.pd-rail-active { color: #10291f; background: #27bd86; box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.pd-owner-avatar { display: grid; place-items: center; width: 24px; height: 24px; margin-top: auto; border: 1px solid #496052; border-radius: 50%; background: #294235; color: #e9f2ed; font-size: 10px; font-weight: 600; }
.pd-sidebar { display: flex; flex-direction: column; min-width: 0; padding: 12px 7px 10px; border-right: 1px solid var(--pd-line); background: #f3f5f4; }
.pd-sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; margin-bottom: 10px; font-size: 12px; }
.pd-sidebar-heading .pd-icon { width: 14px; height: 14px; color: var(--pd-muted); }
.pd-search { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 7px; margin-bottom: 14px; border: 1px solid var(--pd-line); border-radius: 6px; background: #fff; color: #697a70; font-size: 9px; }
.pd-search .pd-icon { width: 12px; height: 12px; }
.pd-search kbd { margin-left: auto; padding: 1px 3px; border: 1px solid #e3e9e5; border-radius: 3px; color: #7a8a80; font: 8px var(--font-body, sans-serif); }
.pd-list-label { display: flex; justify-content: space-between; margin: 0 6px 6px; color: var(--pd-muted); font-size: 9px; }
.pd-list-label > span { color: #819087; }
.pd-thread { display: flex; align-items: center; gap: 7px; padding: 4px 5px; margin-bottom: 2px; border: 1px solid transparent; border-radius: 7px; }
.pd-thread-avatar { display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 23px; border-radius: 7px; color: #fff; font-size: 9px; font-weight: 600; }
.pd-thread-copy { flex: 1; min-width: 0; }
.pd-thread-copy > div { display: flex; align-items: center; gap: 4px; }
.pd-thread-copy strong { font-size: 11px; }
.pd-thread-copy time { margin-left: auto; font-size: 8px; color: #78867e; white-space: nowrap; }
.pd-thread-copy p { margin-top: 2px; color: #617168; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-thread-selected { border-color: #245a43; background: #245a43; color: #fff; }
.pd-thread-selected .pd-thread-copy p, .pd-thread-selected time { color: #c4dacf; }
.pd-thread-selected .pd-thread-avatar { box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.pd-online-list { margin-top: 15px; }
.pd-online-person { display: flex; align-items: center; gap: 7px; min-height: 23px; padding: 0 7px; }
.pd-online-person > i { width: 4px; height: 4px; border-radius: 50%; background: #218655; }
.pd-online-person > strong { font-size: 10px; }
.pd-online-person > span { margin-left: auto; color: #738179; font-size: 9px; }
.pd-sidebar-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 8px 5px 0; border-top: 1px solid var(--pd-line); }
.pd-sidebar-foot > .pd-icon:first-child { width: 25px; height: 25px; padding: 5px; border: 1px solid #d1ddd5; border-radius: 7px; background: #fff; color: #345f46; }
.pd-sidebar-foot > div { display: grid; gap: 2px; }
.pd-sidebar-foot strong { font-size: 10px; }
.pd-sidebar-foot > div > span { color: var(--pd-muted); font-size: 8px; }
.pd-sidebar-foot > .pd-icon:last-child { margin-left: auto; width: 10px; height: 10px; color: #738179; }
.pd-settings-selected { color: #1c6545; }
.pd-settings-selected > .pd-icon:first-child { border-color: #245a43; background: #245a43; color: #fff; }
.pd-workspace { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.pd-header { display: flex; flex-shrink: 0; align-items: center; gap: 8px; min-height: 50px; padding: 8px 16px; border-bottom: 1px solid var(--pd-line); }
.pd-header h3 { color: var(--pd-ink); font-family: var(--font-body, sans-serif); font-size: 12px; font-weight: 650; line-height: 1.4; letter-spacing: -.3px; }
.pd-header p { margin-top: 1px; color: var(--pd-muted); font-size: 9px; }
.pd-online-dot { display: inline-block; width: 4px; height: 4px; flex-shrink: 0; border-radius: 50%; background: #218655; }
.pd-header-avatar { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 25px; height: 27px; border-radius: 7px; background: #496a98; color: #fff; font-size: 11px; font-weight: 600; }
.pd-header-avatar > span { position: absolute; bottom: -1px; right: -2px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #218655; }
.pd-header-more { display: grid; place-items: center; width: 25px; height: 25px; margin-left: auto; border: 1px solid #e1e7e3; border-radius: 7px; color: #647b6c; }
.pd-away-badge { display: inline-block; margin-left: 7px; padding: 2px 5px; border-radius: 4px; background: #f6e4ba; color: #805319; font-size: 8px; font-weight: 500; vertical-align: middle; letter-spacing: 0; }
.pd-agent-available { display: inline-flex; flex-shrink: 0; align-items: center; gap: 5px; margin-left: auto; color: #246445; font-size: 9px; white-space: nowrap; }
.pd-agent-available + .pd-header-more { margin-left: 2px; }
.pd-demo[data-away="true"] .pd-header-avatar > span { background: #bd842c; }
.pd-stage { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.pd-chat-content { flex: 1; padding: 10px 16px 0; }
.pd-date { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: #7e8b82; font-size: 9px; }
.pd-date::before, .pd-date::after { content: ''; flex: 1; height: 1px; background: #e9eeeb; }
.pd-history { margin-bottom: 14px; }
.pd-message { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; }
.pd-person-avatar { display: grid; place-items: center; width: 20px; height: 22px; border-radius: 6px; background: #397455; color: #fff; font-size: 8px; font-weight: 600; }
.pd-message-copy { min-width: 0; max-width: 440px; }
.pd-message-head { display: flex; align-items: baseline; gap: 6px; min-height: 16px; line-height: 1.4; }
.pd-message-head strong { font-size: 11px; }
.pd-message-head > span, .pd-message-head time { color: #758279; font-size: 9px; }
.pd-message-head time { margin-left: 2px; }
.pd-message-copy > p { margin-top: 2px; color: var(--pd-ink); font-size: 12px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.pd-answer-wrap { position: relative; margin-top: 12px; }
.pd-message-byline { display: flex; align-items: center; gap: 6px; }
.pd-message-byline > strong { margin-left: 2px; font-size: 11px; }
.pd-ai-badge { padding: 2px 5px; border-radius: 4px; background: #245a43; color: #fff; font-size: 8px; line-height: 1.3; }
.pd-message-byline > time { margin-left: 2px; color: #758279; font-size: 9px; }
.pd-answer > p { max-width: 440px; padding: 5px 0 0 28px; color: var(--pd-ink); font-size: 12px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.pd-source { display: flex; align-items: center; gap: 5px; width: fit-content; max-width: calc(100% - 28px); margin: 6px 0 0 28px; padding: 4px 6px; border: 1px solid #cfdbd3; border-radius: 6px; color: #466b55; font-size: 9px; }
.pd-source > .pd-icon { width: 12px; height: 12px; }
.pd-source > .pd-icon:last-child { width: 9px; height: 9px; color: #7d9184; }
.pd-source-separator { color: #9aaba0; }
.pd-thinking { position: absolute; inset: 0 auto auto 0; display: flex; align-items: center; gap: 8px; color: var(--pd-muted); font-size: 10px; opacity: 0; pointer-events: none; }
.pd-dots { display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; }
.pd-dots i { width: 3px; height: 3px; border-radius: 50%; background: #65806e; }
.pd-composer-area { padding: 10px 14px 8px; flex-shrink: 0; }
.pd-composer { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px; border: 1px solid #bccfc2; border-radius: 8px; background: #fff; box-shadow: 0 3px 9px -4px rgba(24,51,33,.09); }
.pd-composer > .pd-icon { margin-left: 2px; color: #708578; }
.pd-composer > span:first-of-type { color: #617b6b; font-size: 11px; }
.pd-composer[data-composing="true"] { border-color: #4f8e6a; box-shadow: 0 0 0 2px rgba(57,116,85,.08); }
.pd-composer-field { display: grid; flex: 1; min-width: 0; line-height: 1.55; }
.pd-composer-field > span { grid-area: 1 / 1; align-self: center; word-break: keep-all; overflow-wrap: anywhere; }
.pd-composer-draft { visibility: hidden; color: var(--pd-ink); }
.pd-composer[data-composing="true"] .pd-composer-placeholder { visibility: hidden; }
.pd-composer[data-composing="true"] .pd-composer-draft { visibility: visible; }
.pd-send { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; margin-left: auto; border-radius: 7px; background: #245a43; color: #fff; }
.pd-send .pd-icon { width: 14px; height: 14px; }
.pd-composer-hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 6px; color: #6d8275; font-size: 9px; }
.pd-settings-content { width: 100%; max-width: 500px; padding: 18px 20px; }
.pd-settings-heading { margin-bottom: 20px; }
.pd-settings-heading h4 { font-family: var(--font-body, sans-serif); color: var(--pd-ink); font-size: 13px; font-weight: 600; letter-spacing: -.2px; }
.pd-settings-heading p { margin-top: 4px; color: var(--pd-muted); font-size: 10px; line-height: 1.6; word-break: keep-all; }
.pd-field-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #3d5446; font-size: 10px; font-weight: 500; }
.pd-field-label > span { color: #738279; font-size: 9px; font-weight: 400; }
.pd-folder-card { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #b4cdbd; border-radius: 7px; background: #f5f8f6; }
.pd-folder-icon { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px; background: #245a43; color: #fff; }
.pd-folder-icon > .pd-icon { width: 15px; height: 15px; }
.pd-folder-details { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.pd-folder-details > strong { font-size: 12px; line-height: 1.3; }
.pd-folder-details > span { color: #697e70; font-family: var(--font-mono, monospace); font-size: 9px; overflow-wrap: anywhere; }
.pd-folder-details > .pd-readonly { margin-top: 4px; font-family: var(--font-body, sans-serif); color: #316544; }
.pd-folder-check { flex-shrink: 0; color: #237a4a; padding-top: 4px; }
.pd-folder-check > .pd-icon { width: 13px; height: 13px; }
.pd-rules { margin-top: 20px; }
.pd-rules .pd-field-label { margin-bottom: 3px; }
.pd-rule-row { display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 8px; border-bottom: 1px solid #e1e8e3; font-size: 11px; }
.pd-rule-status { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; }
.pd-rule-status > span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.pd-rule-auto { color: #1c7543; }
.pd-rule-review { color: #976217; }
.pd-rule-decline { color: #68766d; }
.pd-settings-footnote { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; color: #687e70; font-size: 9px; }
.pd-settings-footnote .pd-icon { width: 12px; height: 12px; margin-top: 1px; }

/* Replay on each scene entry; stopped demos show the complete content. */
.pd-animated .pd-arrive-question { animation: pd-enter 500ms var(--pd-ease-out) 200ms both; }
.pd-animated .pd-arrive-answer { animation: pd-enter 500ms var(--pd-ease-out) 1800ms both; }
.pd-animated .pd-arrive-source { animation: pd-enter 400ms var(--pd-ease-out) 2200ms both; }
.pd-animated .pd-thinking { animation: pd-thinking-window 1250ms linear 550ms both; }
.pd-animated .pd-stage-1 .pd-arrive-answer { animation-delay: 800ms; }
.pd-animated .pd-stage-1 .pd-arrive-source { animation-delay: 1300ms; }
/* Draft in the composer, send the complete question, then stream the AI reply. */
.pd-character { position: relative; }
.pd-character-cursor::after { content: ""; position: absolute; top: .08em; bottom: .05em; right: -2px; width: 1px; background: currentColor; }
.pd-animated .pd-chat-content .pd-arrive-question { animation: pd-enter 160ms var(--pd-ease-out) var(--pd-send-at) both; }
.pd-animated .pd-chat-content .pd-arrive-answer { animation: pd-enter 160ms var(--pd-ease-out) var(--pd-answer-at) both; }
.pd-animated .pd-chat-content .pd-arrive-source { animation: pd-enter 250ms var(--pd-ease-out) var(--pd-source-at) both; }
.pd-animated .pd-chat-content .pd-thinking { animation: pd-thinking-window 600ms linear var(--pd-thinking-at) both; }
.pd-animated .pd-composer .pd-send { animation: pd-send-press 120ms var(--pd-ease-out) var(--pd-send-press-at) both; }
@keyframes pd-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pd-thinking-window { 0%, 100% { opacity: 0; } 12%, 85% { opacity: 1; } }
@keyframes pd-send-press { 0%, 100% { transform: scale(1); } 50% { transform: scale(.92); } }

@container pd-frame (max-width: 560px) {
  .pd-shell { grid-template-columns: 40px minmax(0, 1fr); }
  .pd-sidebar { display: none; }
}
@container pd-frame (max-width: 380px) {
  .pd-shell { grid-template-columns: minmax(0, 1fr); }
  .pd-rail, .pd-workspace-label { display: none; }
  .pd-header, .pd-chat-content { padding-inline: 14px; }
  .pd-answer > p { padding-left: 28px; }
  .pd-source { font-size: 8px; gap: 4px; }
  .pd-composer-area { padding-inline: 12px; }
  .pd-composer > span:first-of-type { font-size: 10px; }
  .pd-composer-hint { font-size: 8px; }
  .pd-settings-content { padding: 16px 14px; }
  .pd-settings-heading p { font-size: 9px; }
  .pd-folder-check { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-demo.pd-animated .pd-stage .pd-arrive-question, .pd-demo.pd-animated .pd-stage .pd-arrive-answer, .pd-demo.pd-animated .pd-stage .pd-arrive-source { animation: none; }
  .pd-demo.pd-animated .pd-stage .pd-thinking { animation: none; opacity: 0; }
  .pd-demo .pd-character { opacity: 1 !important; }
  .pd-demo .pd-character::after { display: none; }
  .pd-demo .pd-composer .pd-send { animation: none; }
  .pd-demo .pd-composer .pd-composer-draft { visibility: hidden; }
  .pd-demo .pd-composer .pd-composer-placeholder { visibility: visible; }
}
