/* Chatbot Customizer: the live preview in the device frame, the version drawer, the preview-only labels, and the
   phone layout (docs/CHATBOT_CUSTOMIZER.md). */
.exact-preview .reference-device{padding:0;overflow:hidden}
.customizer-preview{position:relative;width:100%;height:100%;min-height:495px;background:#f1efe9;overflow:hidden;font-family:var(--cp-font-body);color:var(--cp-text);text-align:left}
.customizer-preview-page{position:absolute;inset:0;padding:14px;display:grid;grid-template-rows:12px 60px 60px;gap:10px;align-content:start;opacity:.55}
.customizer-preview-page span{display:block;background:#dcd8cf;border-radius:4px}
.customizer-preview-page span:first-child{width:40%}
.customizer-preview-dialog{position:absolute;right:10px;bottom:10px;width:calc(100% - 20px);max-width:300px;height:calc(100% - 20px);max-height:470px;display:flex;flex-direction:column;background:var(--cp-surface);color:var(--cp-text);border:1px solid rgba(18,18,18,.12);border-radius:16px;box-shadow:0 18px 40px rgba(0,0,0,.18);overflow:hidden}
.customizer-preview[data-device=phone] .customizer-preview-dialog{inset:0;width:100%;max-width:none;height:100%;max-height:none;border-radius:0;border:0}
.customizer-preview[data-device=phone] .customizer-preview-page,.customizer-preview[data-device=phone] .customizer-preview-launcher{display:none}
.customizer-preview[data-device=desktop] .customizer-preview-dialog{max-width:280px;max-height:260px}
.customizer-preview-launcher{position:absolute;right:14px;bottom:14px;width:34px;height:34px;border-radius:50%;background:var(--cp-primary);display:grid;place-items:center;box-shadow:0 6px 16px rgba(0,0,0,.22)}
.customizer-preview-launcher img{width:24px;height:24px;border-radius:50%}
.customizer-preview[data-position=bottom-left] .customizer-preview-dialog,.customizer-preview[data-position=top-left] .customizer-preview-dialog,.customizer-preview[data-position=bottom-left] .customizer-preview-launcher,.customizer-preview[data-position=top-left] .customizer-preview-launcher{right:auto;left:10px}
.customizer-preview[data-position=top-left] .customizer-preview-dialog,.customizer-preview[data-position=top-right] .customizer-preview-dialog,.customizer-preview[data-position=top-left] .customizer-preview-launcher,.customizer-preview[data-position=top-right] .customizer-preview-launcher{bottom:auto;top:10px}
.customizer-preview[data-position=bottom-left] .customizer-preview-launcher,.customizer-preview[data-position=top-left] .customizer-preview-launcher{left:14px}
.customizer-preview[data-position=top-left] .customizer-preview-launcher,.customizer-preview[data-position=top-right] .customizer-preview-launcher{top:14px}
.customizer-preview[data-device=desktop] .customizer-preview-launcher{display:none}
.customizer-preview-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid rgba(18,18,18,.1)}
.customizer-preview-logo{flex:0 0 28px;width:28px;height:28px;border-radius:50%;background:var(--cp-primary);color:var(--cp-on-primary);overflow:hidden;display:grid;place-items:center}
.customizer-preview-logo img{width:100%;height:100%;object-fit:cover}
.customizer-preview-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--cp-font-title);font-weight:var(--cp-weight-title);font-size:calc(var(--cp-size-title) * .7)}
.customizer-preview-close{color:var(--cp-text);opacity:.6;font-size:16px}
.customizer-preview-body{flex:1;overflow:hidden;padding:10px 12px;display:flex;flex-direction:column;gap:10px;font-size:calc(var(--cp-size-body) * .78);font-weight:var(--cp-weight-body)}
.customizer-preview-row{display:flex;gap:7px;align-items:flex-start}
.customizer-preview-row.is-user{justify-content:flex-end}.customizer-preview-row.is-user .customizer-preview-bubble{border-radius:var(--cp-radius-bubble);border-bottom-left-radius:var(--cp-radius-bubble)}
.customizer-preview-states{display:inline-flex;border:1px solid #d4d9e2;border-radius:7px;overflow:hidden;margin:0 0 14px}.customizer-preview-states button{border:0;background:#fff;color:#555;font-size:12px;padding:7px 12px;cursor:pointer}.customizer-preview-states button[aria-pressed=true]{background:#e5e6e7;color:#111}
.customizer-preview-avatar{flex:0 0 26px;width:26px;height:26px;border-radius:50%;overflow:hidden;border:2px solid #fff;box-shadow:0 4px 10px rgba(0,0,0,.12);background:#fff}
.customizer-preview-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.customizer-preview-meta{display:block;font-family:var(--cp-font-accent);font-weight:var(--cp-weight-accent);font-size:calc(var(--cp-size-accent) * .75);opacity:.6;margin-bottom:3px}
.customizer-preview-bubble{margin:0;padding:7px 10px;background:var(--cp-bubble);color:var(--cp-on-bubble);border-radius:var(--cp-radius-bubble);line-height:1.4;max-width:220px}
.customizer-preview-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-left:33px}
.customizer-preview-card{display:flex;flex-direction:column;gap:2px;padding:7px 8px;border:1px solid rgba(18,18,18,.14);border-radius:9px;background:var(--cp-surface)}
.customizer-preview-card strong{font-size:.95em;font-weight:600}
.customizer-preview-card small{font-size:.78em;opacity:.65;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.customizer-preview-chips{display:flex;flex-wrap:wrap;gap:5px;padding-left:33px}
.customizer-preview-chips span{padding:4px 9px;border:1px solid #cecece;border-radius:8px;background:#fff;color:var(--cp-text);font-size:.85em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.customizer-preview-composer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 10px 10px;padding:6px 6px 6px 12px;border:1px solid rgba(18,18,18,.14);border-radius:999px;font-size:11px;opacity:.9}
.customizer-preview-composer span{opacity:.55}
.customizer-preview-composer b{width:22px;height:22px;border-radius:50%;background:var(--cp-primary)}
.customizer-preview-note{font-size:12px;line-height:1.5;color:#777;max-width:400px;margin:10px auto 0;text-align:center}
.customizer-tag{display:inline-block;padding:1px 7px;border-radius:999px;background:#fff4ce;color:#7a5a0a;font-size:11px;font-weight:600;letter-spacing:.3px;margin-right:4px;vertical-align:middle}
.customizer-preview-only,.customizer-live-note{margin:4px 0 12px;max-width:560px}
/* The tab strip's negative margin matched a 36px content padding; this section pads 8px on the right. */
body[data-section=chatbot] .reference-tabs{margin-right:-8px}
/* Version drawer (Figma 1:5003) */
.brand-history .brand-history-toggle{width:199px;height:44px;border:1px solid #d5dae3;border-radius:10px;background:#fff;font-size:15px;cursor:pointer}
.version-panel{margin-top:10px;width:100%;max-width:300px;border:1px solid #e3e6ec;border-radius:14px;background:#fff;box-shadow:0 10px 30px rgba(0,0,0,.08);padding:14px;text-align:left}
.version-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:12px}
.version-panel-head strong{display:block;font-size:16px}
.version-panel-head small{color:#777;font-size:12px}
.version-close{border:0;background:none;font-size:18px;cursor:pointer;color:#555}
.version-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;max-height:420px;overflow:auto}
.version-item{border:1px solid #e3e6ec;border-radius:10px;padding:10px 12px;background:#fff}
.version-item.is-latest{background:#eef0ff;border-color:#d7dcff}.version-item.is-active .version-when small{color:#1f6b3a}
.version-head{display:flex;align-items:center;gap:8px}
.version-head strong{font-size:14px;flex:1}
.version-badge{font-size:10px;font-weight:700;letter-spacing:.4px;padding:2px 7px;border-radius:999px;background:#4f46e5;color:#fff}
.version-delete{border:0;background:none;color:#8a8f99;font-size:18px;line-height:1;cursor:pointer;padding:0 2px}
.version-when{margin:6px 0 8px;font-size:12px;color:#333}
.version-when small{display:block;color:#888;font-size:11px}
.version-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.version-restore{border:1px solid #4f46e5;color:#4f46e5;background:#fff;border-radius:7px;padding:5px 10px;font-size:12px;cursor:pointer}
.version-restore:disabled{opacity:.5;cursor:default}
.version-active{font-size:11px;color:#555;border:1px solid #d9dce3;border-radius:999px;padding:3px 8px;background:#fff}
.version-empty{font-size:12px;color:#777;padding:4px 0}
.version-foot{margin:10px 0 0;font-size:11px;color:#888}
/* Phone and narrow layouts: nothing wider than the viewport. */
@media(max-width:700px){
 body[data-section=chatbot] .main-content{padding-right:16px;overflow-x:hidden}
 body[data-section=chatbot] .reference-customizer,.exact-builder{width:100%;max-width:100%}
 .brand-type-row>div{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);gap:6px}
 .brand-shapes{gap:6px}.shape-sample{min-width:0}
 .brand-positions,.store-scope-options{grid-template-columns:1fr 1fr;max-width:100%}
 .brand-reference-palette{flex-wrap:wrap}
 .builder-actions{grid-template-columns:1fr}
 .exact-preview{max-width:100%}.exact-preview .reference-device{width:100%;max-width:300px}
 .version-panel{max-width:100%}
}
