/* Viewer styling follows the product's gray canvas, assistant panel and blue steps. */
.authoring-section { --authoring-accent: #0069d8; --authoring-soft: #edf5ff; padding: clamp(64px, 7vw, 104px) clamp(20px, 4.5vw, 64px); background: var(--paper); }
.authoring-section__inner { max-width: 1240px; margin: 0 auto; }
.authoring-section__header { margin: 0 auto 44px; text-align: center; }
.authoring-section__eyebrow { margin: 0 0 18px; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.authoring-section__header h2 { margin: 0; font-size: clamp(38px, 4.7vw, 62px); line-height: 1.08; font-weight: 500; letter-spacing: -.05em; }
.authoring-section__header h2 > span { color: var(--ink-3); }
.authoring-section__intro { margin: 22px auto 0; max-width: 660px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.authoring-demo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; padding: 16px; overflow: hidden; border: 1px solid #d8dade; border-radius: 20px; background: radial-gradient(ellipse at 30% 42%, #f0f1f2 0%, #e1e2e4 60%, #d8dadd 100%); color: #17191d; box-shadow: 0 16px 48px -32px #1b253336; }
.authoring-demo *, .authoring-demo *::before, .authoring-demo *::after { box-sizing: border-box; }
.authoring-demo button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.authoring-demo button:disabled { cursor: default; }
.authoring-demo button:focus-visible { outline: 3px solid var(--authoring-accent); outline-offset: 3px; }
.authoring-demo svg, .authoring-demo img { flex-shrink: 0; }
.authoring-demo svg[fill="none"] { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.authoring-demo [hidden] { display: none !important; }

.authoring-viewer { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.authoring-machine { --pump-guard-x: 52%; --pump-guard-y: 28%; position: relative; flex: 1; min-height: 340px; isolation: isolate; overflow: hidden; }
.authoring-machine > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.authoring-machine > canvas { z-index: 1; }
.authoring-demo[data-model="fallback"][data-guard="assembled"] .authoring-machine { --pump-guard-y: 48%; }
.authoring-callout { position: absolute; left: var(--pump-guard-x); top: var(--pump-guard-y); transform: translate(-7px, -54px); z-index: 2; display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #d4e3f7; border-radius: 7px; background: #fffffff5; color: #376598; font-size: 11px; line-height: 1.4; box-shadow: 0 3px 12px #283b5310; pointer-events: none; white-space: nowrap; }
.authoring-callout > span:first-child { width: 5px; height: 5px; border-radius: 50%; background: #3985ed; }
.authoring-callout::after { content: ""; position: absolute; top: 100%; left: 15px; width: 1px; height: 26px; background: #75a3dc; }
.authoring-result { padding: 19px 21px 12px; border: 1px solid #ffffffb3; border-radius: 13px; background: #fffffff2; box-shadow: 0 2px 8px #27344505; }
.authoring-result[hidden] { display: block !important; visibility: hidden; }
.authoring-demo.is-enhanced .authoring-result:not([hidden]) { animation: authoring-result-in .3s ease both; }
.authoring-result__heading { display: flex; align-items: flex-start; gap: 12px; }
.authoring-step-number { display: grid; place-items: center; width: 29px; height: 29px; flex-shrink: 0; margin-top: 1px; border-radius: 50%; color: #fff; background: var(--authoring-accent); font-size: 12px; font-weight: 500; }
.authoring-result h4 { margin: 0 0 5px; color: #141920; font-size: 15px; line-height: 1.4; font-weight: 500; letter-spacing: -.02em; }
.authoring-result__label { display: flex; align-items: center; gap: 4px; color: #5b7970; font-size: 10px; line-height: 1.5; }
.authoring-result__label svg { width: 12px; height: 12px; }
.authoring-result > p { margin: 11px 0 0 41px; color: #68707c; font-size: 12px; line-height: 1.65; }
.authoring-step-progress { height: 4px; margin-top: 20px; overflow: hidden; border-radius: 4px; background: #d9dce1; }
.authoring-step-progress > span { display: block; height: 100%; width: 33.333%; border-radius: inherit; background: #3985ed; transition: width .4s ease; }
.authoring-demo[data-command="replace"] .authoring-step-progress > span { width: 66.666%; }
.authoring-demo[data-command="restore"] .authoring-step-progress > span { width: 100%; }
.authoring-result__footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; color: #7a818a; font-size: 9px; line-height: 1.4; }
.authoring-result__footer > img { width: 72px; height: auto; opacity: .85; }
.authoring-result__footer > span { width: 66px; }
.authoring-result__footer > span:last-child { text-align: right; }

.authoring-assistant { display: flex; flex-direction: column; min-width: 0; padding: 21px 23px 13px; border: 1px solid #e9eaed; border-radius: 13px; background: #fff; }
.authoring-ai-header { display: flex; align-items: center; gap: 10px; padding-bottom: 19px; border-bottom: 1px solid #e9ebee; }
.authoring-ai-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; background: #080808; border-radius: 7px; }
.authoring-ai-avatar img { display: block; width: 22px; height: 16px; object-fit: contain; }
.authoring-ai-header h3 { margin: 0; color: #171a21; font-size: 14px; font-weight: 600; letter-spacing: -.025em; line-height: 1.4; }
.authoring-ai-header p { margin: 2px 0 0; color: #818690; font-size: 10px; line-height: 1.5; }
.authoring-ai-header__badge { margin-left: auto; padding: 3px 6px; color: #788290; background: #f2f4f7; border: 1px solid #e8ebef; border-radius: 4px; font-size: 9px; line-height: 1.4; font-weight: 500; }
.authoring-exchange { padding-top: 24px; }
.authoring-request { display: flex; flex-direction: column; align-items: flex-end; }
.authoring-request > span { padding-right: 3px; margin-bottom: 6px; color: #828993; font-size: 10px; line-height: 1.4; }
.authoring-request p { margin: 0; max-width: 94%; padding: 12px 15px; color: #fff; background: var(--authoring-accent); border-radius: 12px 12px 3px 12px; font-size: 14px; line-height: 1.65; }
.authoring-reply { display: flex; align-items: flex-start; gap: 8px; min-height: 116px; padding: 23px 0 15px; }
.authoring-reply__avatar { display: grid; place-items: center; width: 25px; height: 25px; flex-shrink: 0; border-radius: 6px; background: #080808; }
.authoring-reply__avatar img { display: block; width: 16px; height: 12px; object-fit: contain; }
.authoring-reply > p { margin: 0; padding: 11px 13px; color: #4b535f; border-radius: 3px 11px 11px; background: #f2f3f5; font-size: 13px; line-height: 1.75; }
.authoring-thinking { display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 13px; background: #f2f3f5; border-radius: 3px 11px 11px; }
.authoring-thinking > span:not(.authoring-sr-only) { width: 4px; height: 4px; border-radius: 50%; background: #6e7a89; animation: authoring-thinking 1s ease-in-out infinite; }
.authoring-thinking > span:nth-child(2) { animation-delay: .12s; }
.authoring-thinking > span:nth-child(3) { animation-delay: .24s; }
.authoring-model-status { display: flex; align-items: flex-start; gap: 6px; min-height: 29px; margin: 0 0 20px 33px; color: #76838c; font-size: 10px; line-height: 1.6; }
.authoring-model-status > svg { width: 14px; height: 14px; margin-top: 1px; color: #5e8b76; }
.authoring-demo:not([data-phase="complete"]) .authoring-model-status > svg { visibility: hidden; }
.authoring-prompts { margin-top: auto; padding-top: 17px; border-top: 1px solid #e8eaed; }
.authoring-prompts > p { margin: 0 0 10px; color: #7b828d; font-size: 11px; line-height: 1.5; }
.authoring-prompts__options { display: flex; flex-wrap: wrap; gap: 7px; }
.authoring-prompts__options button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 10px; border: 1px solid #dce1e7; border-radius: 7px; background: #fff; color: #637080; font-size: 11px; line-height: 1.4; transition: background .2s, border-color .2s; }
.authoring-prompts__options svg { width: 11px; height: 11px; opacity: .65; }
.authoring-prompts__options button[aria-pressed="true"] { color: var(--authoring-accent); background: var(--authoring-soft); border-color: #c7ddf8; }
.authoring-prompts__options button:not(:disabled):hover { background: var(--authoring-soft); border-color: #73a6e3; }
.authoring-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: #87909b; font-size: 10px; line-height: 1.4; }
.authoring-controls > div { display: flex; align-items: center; gap: 5px; }
.authoring-controls button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; color: #788390; font-size: 10px; }
.authoring-controls button svg { width: 14px; height: 14px; }
.authoring-controls button:not(:disabled):hover { color: var(--authoring-accent); background: var(--authoring-soft); }
.authoring-motion { width: 30px; }
.authoring-play-icon, .authoring-motion[aria-pressed="true"] .authoring-pause-icon { display: none; }
.authoring-motion[aria-pressed="true"] .authoring-play-icon { display: block; }
.authoring-motion:disabled { display: none; }
.authoring-demo:not(.is-enhanced) .authoring-controls > div { visibility: hidden; }
.authoring-demo[data-paused="true"] .authoring-thinking > span { animation-play-state: paused; }
.authoring-section__note { margin: 23px 0 0; text-align: center; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.authoring-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes authoring-result-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes authoring-thinking { 0%, 70%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }

@media (max-width: 1050px) {
  .authoring-demo { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 13px; gap: 12px; }
  .authoring-assistant { padding: 19px 19px 12px; }
  .authoring-callout { transform: translate(calc(-100% + 23px), -54px); }
  .authoring-callout::after { left: auto; right: 15px; }
  .authoring-result { padding: 17px 17px 12px; }
  .authoring-result > p { margin-left: 0; }
  .authoring-prompts__options button { padding: 8px; font-size: 10px; }
  .authoring-prompts__options svg { display: none; }
}
@media (max-width: 760px) {
  .authoring-section__header { margin-bottom: 30px; }
  .authoring-section__header h2 { font-size: clamp(34px, 7.5vw, 48px); }
  .authoring-section__intro { margin-top: 18px; max-width: 470px; font-size: 14px; line-height: 1.7; }
  .authoring-section__intro br { display: none; }
  .authoring-demo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "identity" "exchange" "machine" "prompts" "controls"; gap: 0; padding: 10px; border-radius: 15px; }
  .authoring-assistant { display: contents; }
  .authoring-ai-header { grid-area: identity; padding: 17px 16px 0; border: 0; border-radius: 10px 10px 0 0; background: #fff; }
  .authoring-exchange { grid-area: exchange; padding: 18px 16px 5px; background: #fff; border-radius: 0 0 10px 10px; }
  .authoring-request p { padding: 10px 13px; font-size: 13px; }
  .authoring-reply { min-height: 101px; padding: 18px 0 12px; }
  .authoring-reply > p { padding: 10px 12px; font-size: 12px; }
  .authoring-model-status { font-size: 9px; min-height: 0; margin-bottom: 13px; }
  .authoring-viewer { grid-area: machine; margin-top: 4px; gap: 2px; }
  .authoring-machine { flex: none; min-height: 0; height: clamp(230px, 50vw, 330px); }
  .authoring-callout { font-size: 10px; }
  .authoring-result { padding: 16px 15px 12px; border-radius: 10px; }
  .authoring-result h4 { font-size: 13px; }
  .authoring-step-number { width: 25px; height: 25px; font-size: 11px; }
  .authoring-result__heading { gap: 9px; }
  .authoring-result > p { font-size: 11px; margin-top: 9px; }
  .authoring-step-progress { margin-top: 16px; }
  .authoring-result__footer { font-size: 9px; }
  .authoring-prompts { grid-area: prompts; margin-top: 10px; padding: 14px 13px 0; border: 0; border-radius: 10px 10px 0 0; background: #fff; }
  .authoring-prompts__options { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr; gap: 6px; }
  .authoring-prompts__options button { min-width: 0; padding-left: 5px; padding-right: 5px; white-space: nowrap; }
  .authoring-controls { grid-area: controls; margin: 0; padding: 9px 13px 11px; background: #fff; border-radius: 0 0 10px 10px; font-size: 9px; }
  .authoring-section__note { max-width: 310px; margin: 20px auto 0; font-size: 11px; }
}
@media (max-width: 380px) {
  .authoring-section__header h2 { font-size: 32px; }
  .authoring-ai-header { padding: 15px 13px 0; }
  .authoring-ai-header h3 { font-size: 13px; }
  .authoring-ai-header p { font-size: 9px; }
  .authoring-exchange { padding: 16px 13px 4px; }
  .authoring-request p { font-size: 12px; }
  .authoring-reply > p { font-size: 11px; }
  .authoring-result { padding: 14px 13px 11px; }
  .authoring-prompts { padding: 13px 10px 0; }
  .authoring-prompts__options { gap: 4px; }
  .authoring-prompts__options button { min-height: 34px; padding: 7px 4px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .authoring-demo *, .authoring-demo *::before, .authoring-demo *::after { animation: none !important; transition: none !important; }
}
