/* Immersive Micro-Theater is a complete frontend bundle with no classic theme dependency. */
#wpcss-widget-root.wpcss-theme-immersive-micro-theater,
.wpcss-inline-support.wpcss-theme-immersive-micro-theater {
  --imt-primary: var(--wpcss-primary, #6d5dfc);
  --imt-cyan: #59d8d0;
  --imt-ink: #eef4ff;
  --imt-muted: #9ba9bd;
  --imt-line: rgba(226, 232, 240, 0.1);
  --imt-light-x: 70%;
  --imt-light-y: 22%;
  color: var(--imt-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

#wpcss-widget-root.wpcss-theme-immersive-micro-theater {
  position: fixed;
  bottom: 24px;
  z-index: 999999;
}

#wpcss-widget-root.wpcss-theme-immersive-micro-theater.wpcss-position-right { right: 24px; left: auto; }
#wpcss-widget-root.wpcss-theme-immersive-micro-theater.wpcss-position-left { right: auto; left: 24px; }
#wpcss-widget-root.wpcss-theme-immersive-micro-theater.wpcss-imt-is-open { inset: 0; width: 100vw; height: 100dvh; }

.wpcss-imt-app,
.wpcss-imt-app * { box-sizing: border-box; }
.wpcss-imt-app button,
.wpcss-imt-app input,
.wpcss-imt-app textarea,
.wpcss-imt-app select { font: inherit; }
.wpcss-imt-app button { cursor: pointer; }

.wpcss-imt-launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 140px;
  min-height: 50px;
  padding: 0 17px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  background: rgba(10, 16, 29, 0.94);
  color: #fff;
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(18px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.wpcss-imt-launcher:hover { transform: translateY(-2px); }
.wpcss-imt-launcher-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%; background: color-mix(in srgb, var(--imt-primary) 32%, rgba(255, 255, 255, 0.07)); }
.wpcss-imt-launcher-icon::before { content: "AI"; font-size: 9px; font-weight: 800; }
.wpcss-imt-launcher-text { font-size: 12px; font-weight: 700; }
.wpcss-imt-launcher-status { color: #8ee4cf; font-size: 9.5px; }
.wpcss-imt-launcher-style-bubble .wpcss-imt-launcher { min-width: 54px; width: 54px; min-height: 54px; padding: 0; justify-content: center; }
.wpcss-imt-launcher-style-bubble .wpcss-imt-launcher-text,
.wpcss-imt-launcher-style-bubble .wpcss-imt-launcher-status { display: none; }
.wpcss-imt-launcher-style-glass .wpcss-imt-launcher { background: rgba(20, 30, 48, 0.7); }
.wpcss-imt-launcher-style-outline .wpcss-imt-launcher { border-color: color-mix(in srgb, var(--imt-primary) 50%, transparent); background: rgba(9, 15, 27, 0.74); }

.wpcss-imt-veil {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(118deg, color-mix(in srgb, var(--imt-primary) 17%, rgba(3, 7, 17, 0.55)), rgba(3, 7, 17, 0.5) 42%, rgba(6, 17, 25, 0.58)),
    rgba(4, 8, 18, 0.5);
  backdrop-filter: blur(24px) saturate(125%);
  animation: imtVeilIn 0.42s ease both;
}

.wpcss-imt-stage {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(1160px, calc(100vw - 72px));
  height: min(760px, calc(100dvh - 72px));
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(7, 13, 25, 0.16);
  box-shadow: none;
  transform: translate(-50%, -50%);
  animation: imtStageIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wpcss-imt-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: linear-gradient(90deg, color-mix(in srgb, var(--imt-primary) 7%, transparent), transparent 34%, rgba(89, 216, 208, 0.035));
  pointer-events: none;
}

.wpcss-imt-stage-header {
  position: relative;
  z-index: 2;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 22px;
  border-bottom: 1px solid var(--imt-line);
}
.wpcss-imt-header-copy { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; }
.wpcss-imt-title-line { display: inline-flex; align-items: center; gap: 8px; }
.wpcss-imt-title-line strong { color: #f3f7ff; font-size: 13px; font-weight: 690; }
.wpcss-imt-agent-pill { display: inline-flex; align-items: center; gap: 5px; color: #8ee4cf; font-size: 9.5px; font-style: normal; font-weight: 650; }
.wpcss-imt-agent-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #59d8a7; box-shadow: 0 0 9px rgba(89, 216, 167, 0.58); }
.wpcss-imt-agent-offline .wpcss-imt-agent-pill { color: #9ba9bd; }
.wpcss-imt-agent-offline .wpcss-imt-agent-pill::before { background: #748399; box-shadow: none; }
.wpcss-imt-header-subtitle { min-width: 0; overflow: hidden; color: #8998ae; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.wpcss-imt-context-toggle { display: none; min-height: 30px; padding: 0 10px; border: 1px solid var(--imt-line); border-radius: 0; background: transparent; color: #b6c3d5; font-size: 10px; }
.wpcss-imt-icon-button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; background: rgba(255, 255, 255, 0.045); color: #d4deec; font-size: 19px; }

.wpcss-imt-stage-body { position: relative; z-index: 1; flex: 1; min-height: 0; }
.wpcss-imt-layout { height: 100%; display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(270px, 0.76fr); }
.wpcss-imt-conversation-plane { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 18px 24px 20px; overflow: hidden; border-right: 1px solid var(--imt-line); }
.wpcss-imt-stage-start .wpcss-imt-conversation-plane { overflow-y: auto; }
.wpcss-imt-context-plane { min-width: 0; min-height: 0; overflow-y: auto; padding: 12px 20px 20px; scrollbar-width: none; }
.wpcss-imt-context-plane::-webkit-scrollbar { display: none; }
.wpcss-imt-context-section { padding: 13px 0 16px; border-bottom: 1px solid rgba(226, 232, 240, 0.08); }
.wpcss-imt-context-section:last-child { border-bottom: 0; }

.wpcss-imt-welcome { margin: 0 0 18px; padding: 2px 0 12px; border-bottom: 1px solid rgba(226, 232, 240, 0.075); }
.wpcss-imt-welcome-copy { display: block; max-width: 620px; color: #b9c5d6; font-size: 13px; line-height: 1.7; }
.wpcss-imt-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.wpcss-imt-field { display: grid; gap: 5px; color: #8392a8; font-size: 10px; font-weight: 620; }
.wpcss-imt-field:has(textarea),
.wpcss-imt-field:nth-last-of-type(1) { grid-column: 1 / -1; }
.wpcss-imt-field input,
.wpcss-imt-field textarea { width: 100%; border: 0; border-bottom: 1px solid rgba(226, 232, 240, 0.13); border-radius: 0; outline: 0; background: rgba(255, 255, 255, 0.018); color: var(--imt-ink); padding: 11px 8px; font-size: 12.5px; line-height: 1.5; }
.wpcss-imt-field textarea { min-height: 132px; max-height: 220px; resize: vertical; }
.wpcss-imt-field input:focus,
.wpcss-imt-field textarea:focus { border-bottom-color: color-mix(in srgb, var(--imt-primary) 72%, #7dd3fc); background: rgba(255, 255, 255, 0.035); }
.wpcss-imt-start-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-top: 4px; }
.wpcss-imt-start-actions .wpcss-imt-submit { grid-column: 2; grid-row: 1; }
.wpcss-imt-start-actions .wpcss-imt-error { grid-column: 1 / -1; }

.wpcss-imt-scene-title { flex: 0 0 auto; padding: 0 2px 16px; }
.wpcss-imt-scene-title strong,
.wpcss-imt-scene-title span { display: block; }
.wpcss-imt-scene-title strong { color: #f2f6fd; font-size: 19px; font-weight: 650; }
.wpcss-imt-scene-title span { margin-top: 5px; color: #8493aa; font-size: 10.5px; }

.wpcss-imt-presets-title { display: block; margin-bottom: 9px; color: #c2cddd; font-size: 10.5px; font-weight: 650; }
.wpcss-imt-presets { display: grid; gap: 3px; }
.wpcss-imt-preset-item { border-bottom: 1px solid rgba(226, 232, 240, 0.06); }
.wpcss-imt-preset-item:last-child { border-bottom: 0; }
.wpcss-imt-preset-question { position: relative; width: 100%; min-height: 40px; padding: 8px 20px 8px 0; border: 0; border-radius: 0; background: transparent; color: #b9c6d7; text-align: left; font-size: 11px; line-height: 1.4; }
.wpcss-imt-preset-question::after { content: "›"; position: absolute; top: 9px; right: 2px; color: color-mix(in srgb, var(--imt-primary) 72%, #9dddf1); font-size: 15px; }
.wpcss-imt-preset-answer { padding: 1px 0 10px; }
.wpcss-imt-preset-answer p { margin: 0 0 8px; color: #8291a7; font-size: 10px; line-height: 1.55; }
.wpcss-imt-preset-use { min-height: 28px; padding: 0 9px; border: 1px solid rgba(226, 232, 240, 0.1); border-radius: 0; background: rgba(255, 255, 255, 0.035); color: #b9c8db; font-size: 9.5px; }

.wpcss-imt-service-summary,
.wpcss-imt-status-summary { display: grid; gap: 6px; }
.wpcss-imt-service-summary strong,
.wpcss-imt-status-summary strong { color: #cbd6e5; font-size: 10.5px; font-weight: 650; }
.wpcss-imt-service-summary span,
.wpcss-imt-status-summary span { color: #7f8fa6; font-size: 9.5px; line-height: 1.5; }
.wpcss-imt-service-summary strong::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--imt-cyan); box-shadow: 0 0 9px rgba(89, 216, 208, 0.5); vertical-align: 1px; }

.wpcss-imt-history-switcher { position: relative; display: grid; gap: 7px; }
.wpcss-imt-history-switcher span { color: #c2cddd; font-size: 10.5px; font-weight: 650; }
.wpcss-imt-history-switcher select { width: 100%; min-height: 34px; padding: 0 22px 0 0; overflow: hidden; border: 0; border-bottom: 1px solid rgba(226, 232, 240, 0.11); border-radius: 0; outline: 0; appearance: none; background: transparent; color: #91a0b5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.wpcss-imt-history-switcher::after { content: "⌄"; position: absolute; right: 2px; bottom: 11px; color: #718198; font-size: 10px; pointer-events: none; }

.wpcss-imt-messages { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 11px; overflow-y: auto; padding: 4px 5px 18px; scrollbar-width: none; perspective: 900px; }
.wpcss-imt-messages::-webkit-scrollbar { display: none; }
.wpcss-imt-message { display: flex; flex-direction: column; gap: 4px; transition: transform 0.22s ease-out; animation: imtMessageIn 0.34s ease both; }
.wpcss-imt-message-user,
.wpcss-imt-message-guest { align-items: flex-end; }
.wpcss-imt-message-agent { align-items: flex-start; }
.wpcss-imt-message-system { align-items: center; }
.wpcss-imt-message-meta { padding: 0 6px; color: #687891; font-size: 9px; }
.wpcss-imt-message-bubble { max-width: 75%; padding: 10px 13px; border: 1px solid rgba(226, 232, 240, 0.075); border-radius: 13px; background: rgba(255, 255, 255, 0.045); color: #dce6f3; font-size: 12px; line-height: 1.55; word-break: break-word; }
.wpcss-imt-message-agent .wpcss-imt-message-bubble { border-bottom-left-radius: 2px; }
.wpcss-imt-message-user .wpcss-imt-message-bubble,
.wpcss-imt-message-guest .wpcss-imt-message-bubble { border-color: color-mix(in srgb, var(--imt-primary) 40%, rgba(226, 232, 240, 0.08)); border-bottom-right-radius: 2px; background: color-mix(in srgb, var(--imt-primary) 42%, rgba(22, 31, 49, 0.74)); color: #fff; }
.wpcss-imt-message-system .wpcss-imt-message-bubble { max-width: 90%; border: 0; background: transparent; color: #85d7c2; font-size: 10.5px; }

.wpcss-imt-reply-form { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 0 0; border-top: 1px solid rgba(226, 232, 240, 0.09); }
.wpcss-imt-reply-form > textarea { width: 100%; min-height: 46px; max-height: 92px; resize: none; border: 0; border-bottom: 1px solid rgba(226, 232, 240, 0.11); border-radius: 0; outline: 0; background: rgba(255, 255, 255, 0.02); color: var(--imt-ink); padding: 10px 8px; font-size: 12px; line-height: 1.5; }
.wpcss-imt-reply-form > textarea:focus { border-bottom-color: color-mix(in srgb, var(--imt-primary) 70%, #7dd3fc); background: rgba(255, 255, 255, 0.035); }
.wpcss-imt-reply-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wpcss-imt-submit,
.wpcss-imt-secondary { min-height: 32px; padding: 0 13px; border-radius: 0; font-size: 10.5px; font-weight: 650; }
.wpcss-imt-submit { border: 1px solid color-mix(in srgb, var(--imt-primary) 58%, rgba(255, 255, 255, 0.15)); background: color-mix(in srgb, var(--imt-primary) 66%, rgba(20, 30, 47, 0.82)); color: #fff; }
.wpcss-imt-secondary { border: 1px solid var(--imt-line); background: transparent; color: #9cabc0; }
.wpcss-imt-submit:disabled,
.wpcss-imt-secondary:disabled { cursor: not-allowed; opacity: 0.5; }

.wpcss-imt-upload-box { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wpcss-imt-upload-box input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.wpcss-imt-upload-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wpcss-imt-upload-button,
.wpcss-imt-upload-clear { min-height: 28px; padding: 0 9px; border: 1px solid var(--imt-line); border-radius: 0; background: transparent; color: #a6b5c8; font-size: 9.5px; }
.wpcss-imt-upload-clear { color: #e4aa83; }
.wpcss-imt-upload-hint { min-width: 0; overflow: hidden; color: #718198; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.wpcss-imt-upload-preview { display: flex; flex-wrap: wrap; gap: 5px; }
.wpcss-imt-upload-thumb { width: 40px; height: 40px; overflow: hidden; border: 1px solid var(--imt-line); border-radius: 0; }
.wpcss-imt-upload-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.wpcss-imt-message-bubble .wpcss-message-images { display: flex; flex-wrap: wrap; gap: 6px; }
.wpcss-imt-message-bubble .wpcss-message-images a { display: block; overflow: hidden; }
.wpcss-imt-message-bubble .wpcss-message-images img { display: block; width: 104px; height: 104px; object-fit: cover; }
.wpcss-imt-message-bubble.is-image-only { padding: 2px; border: 0; background: transparent; }

.wpcss-imt-notice,
.wpcss-imt-muted,
.wpcss-imt-error { font-size: 10.5px; line-height: 1.55; }
.wpcss-imt-notice { margin-bottom: 10px; padding: 8px 0; border-bottom: 1px solid rgba(226, 232, 240, 0.08); color: #9eacc0; }
.wpcss-imt-muted { margin: 10px 0; color: #8493a9; }
.wpcss-imt-error { color: #f3a6a6; }
.wpcss-imt-error:empty { display: none; }

.wpcss-imt-image-drawer { position: absolute; inset: 0; z-index: 20; display: flex; background: rgba(3, 7, 16, 0.92); }
.wpcss-imt-image-drawer-panel { position: relative; flex: 1; display: grid; place-items: center; padding: 20px; }
.wpcss-imt-image-drawer-panel > img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.wpcss-imt-image-drawer-head { position: absolute; inset: 14px 14px auto; display: flex; align-items: center; gap: 10px; }
.wpcss-imt-image-drawer-head strong { min-width: 0; flex: 1; overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.wpcss-imt-image-drawer-head .wpcss-imt-icon-button { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, 0.74); background: rgba(3, 7, 16, 0.82); font-size: 22px; }

@keyframes imtVeilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes imtStageIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes imtMessageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  #wpcss-widget-root.wpcss-theme-immersive-micro-theater { right: 10px !important; left: auto !important; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  #wpcss-widget-root.wpcss-theme-immersive-micro-theater.wpcss-imt-is-open { inset: 0 !important; }
  .wpcss-imt-stage { width: 100vw; height: 100dvh; }
  .wpcss-imt-stage-header { flex-basis: 54px; padding: 0 13px; }
  .wpcss-imt-context-toggle { display: inline-flex; align-items: center; }
  .wpcss-imt-layout { display: block; }
  .wpcss-imt-conversation-plane { height: 100%; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-right: 0; }
  .wpcss-imt-context-plane { position: absolute; inset: 54px 0 0; z-index: 5; display: none; padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px)); background: rgba(5, 10, 21, 0.96); backdrop-filter: blur(24px); }
  .wpcss-imt-context-open .wpcss-imt-context-plane { display: block; }
  .wpcss-imt-context-open .wpcss-imt-conversation-plane { visibility: hidden; }
  .wpcss-imt-form { grid-template-columns: 1fr; }
  .wpcss-imt-field,
  .wpcss-imt-field:has(textarea),
  .wpcss-imt-field:nth-last-of-type(1) { grid-column: 1; }
  .wpcss-imt-field textarea { min-height: 96px; }
  .wpcss-imt-scene-title strong { font-size: 16px; }
  .wpcss-imt-message-bubble { max-width: 86%; }
}

@media (prefers-reduced-motion: reduce) {
  .wpcss-imt-veil,
  .wpcss-imt-stage,
  .wpcss-imt-message { animation: none; }
  .wpcss-imt-message { transition: none; }
  .wpcss-imt-launcher { transition: none; }
}
