/* The accepted A workspace keeps the real library and form components. */
.pw-editor{min-width:0}.pw-editor .pers-editor-top{gap:20px;align-items:flex-start}.pw-editor .pers-editor-actions{justify-content:flex-end;max-width:58%}.pw-editor .pers-panel{padding:26px 28px}.pw-workspace-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 24px;border-top:1px solid var(--border,#dddfdf);border-bottom:1px solid var(--border,#dddfdf);background:#faf9f6}.pw-workspace-toolbar>div:first-child{flex:1;min-width:0}.pw-workspace-toolbar>.pers-actions{flex-shrink:0}.pw-setup-bar{display:flex;align-items:end;gap:12px;min-width:0}.pw-setup-choice{display:grid;gap:6px;flex:1;min-width:0}.pw-setup-choice label{font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:#62666d}.pw-setup-choice select{width:100%;min-height:42px;max-width:100%;padding:9px 32px 9px 12px;border:1px solid #d5d7d9;border-radius:7px;background:#fff;font:inherit;text-overflow:ellipsis}.pw-shared-note{margin:0;padding:14px 28px;color:#60656e;font-size:12px;border-bottom:1px solid #e6e6e1}.pw-session-strip{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:12px 24px;background:#edf3ee;border-bottom:1px solid #d5e2d8;font-size:12px}.pw-session-strip>span{min-width:0;overflow-wrap:anywhere}.pw-session-strip>.pers-actions{flex-shrink:0}.pw-voice-choice{display:flex;gap:10px;align-items:center}.pw-voice-choice select{flex:1;min-width:0}.pw-checkbox{display:flex!important;align-items:center;gap:9px;margin-top:14px!important;font-weight:400!important}.pw-checkbox input{width:17px!important;min-height:17px!important;flex:none}.pw-content-choice{padding:16px;border:1px solid #e7d7b9;border-radius:8px;background:#fcf6ea;margin:20px 0}.pw-content-choice>p{margin:0 0 12px}.pw-content-choice>label{display:block;margin-bottom:7px;font-weight:600}.pw-content-choice>select{width:100%;min-height:42px;border:1px solid #d6d1c8;border-radius:6px;background:#fff;padding:8px;font:inherit}.pw-default{margin-top:28px;padding-top:20px;border-top:1px solid #dedfdd}.pw-default>p{font-size:12px;color:#60656e}.pw-connections>h3:not(:first-child){margin-top:36px}.pw-connection{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 0;border-bottom:1px solid #e1e2de}.pw-connection>div{min-width:0}.pw-connection p{margin:5px 0;color:#60656e;font-size:12px;overflow-wrap:anywhere}.pw-connection>.pers-button{flex-shrink:0}.pw-connections>a{margin-top:20px}.pw-editor .pers-tabs button{background:transparent;color:#636770}.pw-editor .pers-tabs button[aria-selected=true]{color:#202124;border-bottom-color:#202124}.pw-editor .pers-tabs{padding:0 16px}.pw-editor .pers-tabs button{white-space:nowrap}.pw-editor input:focus-visible,.pw-editor select:focus-visible,.pw-editor button:focus-visible,.pw-test-panel button:focus-visible{outline:3px solid #496ac7;outline-offset:3px}.pw-editor .pers-button:disabled,.pw-test-panel .pers-button:disabled{opacity:.45}
@media(max-width:1200px){.pw-workspace-toolbar{align-items:stretch;flex-direction:column}.pw-editor .pers-editor-actions{max-width:65%}.pw-workspace-toolbar>.pers-actions{justify-content:flex-start}}
@media(max-width:700px){.pw-editor .pers-editor-top{flex-direction:column;padding:18px}.pw-editor .pers-editor-actions{max-width:100%;justify-content:flex-start}.pw-editor .pers-panel{padding:20px 16px}.pw-workspace-toolbar{padding:16px;gap:14px}.pw-setup-bar{flex-wrap:wrap}.pw-setup-choice{flex-basis:100%}.pw-shared-note{padding:12px 16px}.pw-session-strip{align-items:flex-start;flex-direction:column;padding:14px 16px}.pw-connection{align-items:flex-start;flex-direction:column}.pw-editor .pers-tabs{padding:0 6px}.pw-editor .pers-tabs button{font-size:12px;padding-inline:12px}.pw-content-choice{padding:14px}.pw-editor .pers-actions{flex-wrap:wrap}}
.pw-more{margin-top:24px}.pw-more summary{cursor:pointer;font-size:12px;color:#60656e;padding:8px 0}.pw-more>.pers-actions{margin-top:12px}
.pw-editor>[data-pers-action="back-settings"]{margin:16px 24px}.pw-editor .pers-editor-actions{display:flex;flex-wrap:wrap}.pw-editor .pers-editor-actions>.pers-button{flex:0 0 auto;white-space:nowrap}.pw-editor .pers-editor-actions>.pers-save-control{flex:0 0 auto}.pw-editor .pers-editor-actions>.pers-primary{flex-basis:auto}
@media(max-width:700px){.pw-editor .pers-editor-actions{width:100%;max-width:100%;gap:12px;row-gap:26px}.pw-editor .pers-editor-actions>.pers-button{min-width:max-content;max-width:100%;padding-inline:12px}.pw-editor>[data-pers-action="back-settings"]{margin:16px}.pw-editor .pers-more-actions{flex:0 0 auto}}

/* Content actions stay at the page level; saved combinations belong to Appearance. */
.pw-editor .pers-editor-actions { align-items:center; padding-bottom:0; row-gap:12px; }
.pw-editor .pers-editor-actions > .pers-button { min-height:44px; }
.pw-editor .pers-version-state { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
.pw-editor .pers-version-state .pers-draft-status { position:static; white-space:normal; }
.pw-appearance .pw-setup-bar { flex-wrap:wrap; margin:0 0 20px; }
.pw-appearance .pw-setup-choice { min-width:180px; }
.pw-appearance .pw-setup-choice label { font-size:14px; font-weight:600; letter-spacing:normal; text-transform:none; color:var(--ink); }
.pw-appearance .pw-setup-choice select { min-height:44px; }
@media(max-width:700px) {
  .pw-editor .pers-editor-actions { row-gap:12px; }
  .pw-appearance .pw-setup-bar > .pers-button { white-space:normal; text-align:left; }
}
.pers-history-snapshot{padding:20px 24px;margin:0 0 20px;border:1px solid var(--border,#dddfdf);border-radius:8px;background:#faf9f6}.pers-history-snapshot h4{margin:0 0 16px}.pers-history-snapshot dl{margin:0}.pers-history-snapshot dl>div+div{margin-top:16px}.pers-history-snapshot dt{font-size:12px;font-weight:600;color:#62666d}.pers-history-snapshot dd{margin:5px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}

.pers-history-language{margin-top:20px}.pers-history-language summary{cursor:pointer;padding:10px 0;font-weight:600}.pers-history-language dl{padding-top:12px}

/* Stable editor + conversation surface. The preview slot is never redrawn. */
#personalitiesRoot{container-type:inline-size}
.pw-editor{container-type:inline-size;overflow:visible}
.pw-editor .pers-editor-top>div:first-child{flex:1 1 auto;min-width:0}
.pw-workspace{display:grid;grid-template-columns:minmax(0,1fr);align-items:start}
.pw-form{min-width:0}
.pw-form>[data-pers-action="back-settings"]{margin:16px 24px}
.pw-preview-slot[hidden],.pw-test-panel[hidden],.pw-stage>[hidden]{display:none!important}
.pw-preview-open>.pw-workspace{grid-template-columns:minmax(0,1fr) 360px;gap:24px}
.pw-preview-slot{min-width:0;padding:0 20px 24px 0;align-self:start;position:sticky;top:84px}
.pw-test-panel{padding:16px 0 0;min-width:0;color:var(--ink,#25231C);font-size:14px;line-height:1.5}
.pw-test-heading{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:16px}
.pw-test-heading h3{font-size:16px;margin:0;line-height:1.5}
.pw-test-heading .pers-button{flex:none;min-height:32px;padding:4px 10px;font-size:12px}
.pw-hide-narrow{display:none}
.pw-preview-source{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin:0 0 4px}
.pw-preview-source>span{color:var(--muted,#68645C)}
.pw-preview-voice{margin:0 0 14px;color:var(--muted,#68645C);font-size:12px;overflow-wrap:anywhere}
.pw-live-label{font-size:11px;padding:2px 6px;border:1px solid var(--line,#EAE8E2);border-radius:4px}
.pw-stage{position:relative;min-width:0;aspect-ratio:4/5;max-height:56dvh;overflow:hidden;border-radius:10px;border:1px solid var(--line,#EAE8E2);background:#F8F7F4}
.pw-stage .pers-voice-host,.pw-poster{position:absolute;inset:0;width:100%;height:100%;min-height:0}
.pw-stage iframe,.pw-poster video{width:100%;height:100%;border:0;object-fit:contain;display:block}
.pw-poster{display:grid;place-items:center;color:var(--muted,#68645C);text-align:center;padding:0}
.pw-poster>span{padding:24px}
.pw-test-status{margin:12px 0;font-size:12px;color:var(--muted,#68645C);min-height:18px}
.pw-test-changed{font-size:12px;margin:8px 0;color:#886117}
.pw-test-actions{gap:8px}
.pw-test-actions .pers-button{min-height:40px;font-size:13px}
.pw-test-panel .pw-response-checks{margin-top:14px;border:0;background:transparent;color:var(--muted,#68645C);padding:4px 0;font-size:12px;min-height:32px;text-decoration:underline;text-underline-offset:3px}
.pw-test-panel .pers-error{font-size:12px;margin:10px 0;overflow-wrap:anywhere}
.pw-session-strip{padding:10px 24px;background:var(--surface-soft,#F8F7F4);border-top:1px solid var(--line,#EAE8E2);border-bottom:0}
@container(max-width:1039px){
 .personalities:has(.pw-preview-open)>.pers-header,
 .personalities:has(.pw-preview-open)>[data-pers-global-notices],
 .personalities:has(.pw-preview-open) .pers-content-language,
 .personalities:has(.pw-preview-open)>[data-pers-messages]>.pers-success{display:none}
 .pw-preview-open .pers-editor-top{display:block;padding:16px 16px 6px}
 .pw-preview-open .pers-editor-top>div:first-child>[data-pers-action="back"],
 .pw-preview-open .pers-editor-top .pers-version-state,
 .pw-preview-open .pers-editor-top .pers-editor-actions{display:none}
 .pw-preview-open .pers-editor-title{margin:0}
 .pw-preview-open>.pw-workspace{grid-template-columns:minmax(0,1fr);gap:0}
 .pw-preview-open>.pw-workspace>.pw-form{display:none}
 .pw-preview-slot{position:static;padding:0 24px 24px}
 .pw-test-panel{max-width:440px;margin:0 auto}
 .pw-stage{max-height:min(42dvh,400px)}
 .pw-hide-wide{display:none}.pw-hide-narrow{display:inline}
 .pw-preview-open .pers-editor-actions>[data-pers-action="save"],.pw-preview-open .pers-editor-actions>[data-pers-action="publish"]{display:none}
}
@container(min-width:1040px){.pw-preview-open .pers-role-grid{grid-template-columns:1fr}}
@media(max-width:700px){.pw-preview-slot{padding:0 16px 20px}.pw-test-panel{padding-top:10px}.pw-test-heading{align-items:center}.pw-test-heading h3{font-size:15px}.pw-form>[data-pers-action="back-settings"]{margin:16px}.pw-session-strip{padding:10px 16px}}
