:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #10213d;
  background: #f3f7fb;
  font-synthesis: none;
  --page: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #10213d;
  --muted: #66738a;
  --border: #dbe4ef;
  --accent: #1677ff;
  --accent-deep: #0d5fd7;
  --success: #24a865;
  --danger: #d94b4b;
  --shadow: 0 30px 80px rgba(52, 78, 112, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(22, 119, 255, 0.08), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(36, 168, 101, 0.05), transparent 24%),
    var(--page);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
}

.chat-workbench {
  width: min(1240px, 100%);
  min-height: min(720px, calc(100vh - 80px));
  display: grid;
  grid-template-columns: minmax(330px, 38fr) minmax(520px, 62fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(219, 228, 239, 0.82);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.avatar-panel {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 36px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 255, 0.94)),
    var(--surface-soft);
  border-right: 1px solid var(--border);
}

.avatar-panel::before,
.avatar-panel::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.avatar-panel::before {
  width: 280px;
  height: 280px;
  top: -140px;
  left: -120px;
  background: rgba(22, 119, 255, 0.055);
}

.avatar-panel::after {
  width: 210px;
  height: 210px;
  right: -120px;
  bottom: -96px;
  border: 1px solid rgba(22, 119, 255, 0.12);
}

.avatar-brand {
  position: absolute;
  top: 30px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #173a6c;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #43a6ff, #0d5fd7);
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.avatar-stage {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.avatar-glow {
  position: absolute;
  z-index: -2;
  width: 74%;
  height: 74%;
  background: radial-gradient(circle, rgba(57, 166, 255, 0.32), rgba(73, 175, 255, 0.06) 54%, transparent 72%);
  filter: blur(8px);
  animation: glow-breathe 5s ease-in-out infinite;
}

.avatar-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(22, 119, 255, 0.17);
  border-radius: 50%;
}

.avatar-orbit-one {
  width: 86%;
  height: 86%;
  border-right-color: rgba(22, 119, 255, 0.54);
  animation: orbit 18s linear infinite;
}

.avatar-orbit-two {
  width: 68%;
  height: 68%;
  border-left-color: rgba(36, 168, 101, 0.42);
  animation: orbit 13s linear infinite reverse;
}

.avatar-image {
  width: 84%;
  height: 84%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 24px 28px rgba(30, 112, 190, 0.18));
  transform-origin: 50% 82%;
  animation: avatar-idle 4.8s ease-in-out infinite;
}

.avatar-stage[data-avatar-state="thinking"] .avatar-image {
  animation-duration: 1.8s;
}

.avatar-stage[data-avatar-state="speaking"] .avatar-image {
  animation: avatar-speaking 0.9s ease-in-out 3;
}

.avatar-stage[data-avatar-state="error"] .avatar-image {
  filter: grayscale(0.7) drop-shadow(0 20px 26px rgba(55, 71, 88, 0.13));
}

.avatar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: -6px;
  padding: 9px 14px;
  color: #274360;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(209, 224, 240, 0.9);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(57, 93, 126, 0.09);
  font-size: 13px;
  font-weight: 650;
  backdrop-filter: blur(10px);
}

.status-dot,
.connection-dot,
.pipeline-pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--success);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(36, 168, 101, 0.12);
}

.avatar-stage[data-avatar-state="connecting"] ~ .avatar-status .status-dot,
.avatar-stage[data-avatar-state="thinking"] ~ .avatar-status .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.avatar-stage[data-avatar-state="error"] ~ .avatar-status .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 75, 75, 0.12);
}

.avatar-caption {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.conversation-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto auto;
  background: var(--surface);
}

.conversation-header {
  min-height: 124px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 31px 36px 25px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 9px 12px;
  color: #23784c;
  background: #f0faf5;
  border: 1px solid #d5eee1;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.connection-state.is-connecting {
  color: #2b65a5;
  background: #f1f7ff;
  border-color: #d9e9fd;
}

.connection-state.is-connecting .connection-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-state.is-error {
  color: #a23232;
  background: #fff4f4;
  border-color: #f3d1d1;
}

.connection-state.is-error .connection-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 75, 75, 0.12);
}

.message-list {
  min-height: 0;
  overflow-y: auto;
  padding: 34px 36px 26px;
  scroll-behavior: smooth;
  background:
    linear-gradient(rgba(248, 251, 255, 0.76), rgba(255, 255, 255, 0.25)),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(219, 228, 239, 0.16) 32px);
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 22px;
  animation: message-in 260ms ease-out both;
}

.message-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(145deg, #43a6ff, #0d5fd7);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.message-bubble {
  max-width: min(450px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 16px;
  color: #213651;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 5px;
  box-shadow: 0 8px 24px rgba(58, 81, 109, 0.06);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble strong {
  color: var(--text);
  font-size: 14px;
}

.message time {
  display: block;
  margin-top: 6px;
  color: #95a0b1;
  font-size: 10px;
}

.message-visitor {
  justify-content: flex-end;
}

.message-visitor .message-bubble {
  color: #fff;
  background: linear-gradient(145deg, #2385ff, #146ce4);
  border-color: transparent;
  border-radius: 16px 16px 5px 16px;
  box-shadow: 0 10px 26px rgba(22, 119, 255, 0.2);
}

.message-visitor time {
  text-align: right;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 20px 36px;
  border-top: 1px solid var(--border);
}

.composer input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid #d9e2ed;
  border-radius: 12px;
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.composer input:focus {
  background: #fff;
  border-color: #8bbcff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.1);
}

.composer input:disabled {
  cursor: wait;
  opacity: 0.65;
}

.composer button {
  min-width: 92px;
  height: 48px;
  padding: 0 21px;
  color: #fff;
  background: linear-gradient(145deg, #2385ff, #1168df);
  border-radius: 12px;
  box-shadow: 0 9px 20px rgba(22, 119, 255, 0.22);
  cursor: pointer;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.composer button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(22, 119, 255, 0.28);
}

.composer button:active:not(:disabled) {
  transform: translateY(0);
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.technical-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 36px 22px;
  color: var(--muted);
  font-size: 11px;
}

.pipeline-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #43536a;
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 650;
}

.pipeline-pulse {
  width: 7px;
  height: 7px;
}

.error-message {
  margin: 0;
  padding: 10px 36px 16px;
  color: #a23232;
  background: #fff7f7;
  border-top: 1px solid #f2dcdc;
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes avatar-idle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.008); }
}

@keyframes avatar-speaking {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.022); }
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.68; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 840px) {
  .page-shell {
    display: block;
    padding: 0;
  }

  .chat-workbench {
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: 230px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }

  .avatar-panel {
    min-height: 230px;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .avatar-brand {
    top: 20px;
    left: 22px;
  }

  .avatar-stage {
    width: 180px;
  }

  .avatar-status {
    position: absolute;
    right: 22px;
    bottom: 48px;
  }

  .avatar-caption {
    position: absolute;
    right: 22px;
    bottom: 23px;
    margin: 0;
  }

  .conversation-panel {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .chat-workbench {
    grid-template-rows: 205px minmax(0, 1fr);
  }

  .avatar-panel {
    min-height: 205px;
  }

  .avatar-stage {
    width: 154px;
  }

  .avatar-caption {
    display: none;
  }

  .avatar-status {
    right: 18px;
    bottom: 29px;
  }

  .conversation-header {
    min-height: auto;
    display: block;
    padding: 22px 20px 18px;
  }

  .connection-state {
    width: fit-content;
    margin-top: 14px;
  }

  .message-list {
    padding: 24px 20px 18px;
  }

  .message-bubble {
    max-width: 76vw;
  }

  .composer {
    gap: 8px;
    padding: 15px 20px;
  }

  .composer button {
    min-width: 70px;
    padding: 0 14px;
  }

  .technical-status {
    display: block;
    padding: 0 20px 16px;
  }

  #technical-detail {
    display: block;
    margin-top: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Floating digital-human Widget v2 */
body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 22%, rgba(111, 181, 255, 0.24), transparent 30%),
    linear-gradient(145deg, #f8fbff, #eef5fc 62%, #f7fbff);
}

.demo-header {
  position: relative;
  z-index: 1;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 54px;
  padding: 0 clamp(24px, 6vw, 92px);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(205, 220, 236, 0.86);
  backdrop-filter: blur(16px);
}

.demo-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #12325d;
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.demo-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3999ff, #0d64df);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.2);
}

.demo-header nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.demo-header nav a {
  color: #42536a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.demo-action {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: 42px;
  margin-left: auto;
  padding: 0 20px;
  color: #176edb;
  background: #fff;
  border: 1px solid #9ac4f6;
  border-radius: 10px;
  font-weight: 700;
}

.demo-main {
  position: relative;
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  align-items: center;
  overflow: hidden;
  padding: 70px clamp(28px, 9vw, 140px) 110px;
}

.demo-copy {
  position: relative;
  z-index: 1;
  max-width: 630px;
}

.demo-label {
  margin: 0 0 18px;
  color: #176edb;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.demo-copy h1 {
  margin: 0;
  color: #10213d;
  font-size: clamp(42px, 5.4vw, 76px);
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.demo-copy > p:not(.demo-label) {
  max-width: 520px;
  margin: 26px 0 32px;
  color: #5f7087;
  font-size: 17px;
  line-height: 1.85;
}

.demo-copy > a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  color: #fff;
  background: #1677ff;
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(22, 119, 255, 0.22);
  text-decoration: none;
  font-weight: 750;
}

.demo-visual {
  position: relative;
  width: min(580px, 46vw);
  aspect-ratio: 1.1;
  justify-self: end;
  opacity: 0.8;
}

.demo-visual::before {
  position: absolute;
  inset: 8% 2% 0 4%;
  content: "";
  background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(209,231,252,.56));
  border: 1px solid rgba(159, 196, 231, 0.45);
  border-radius: 48% 48% 18% 18%;
  box-shadow: 0 40px 90px rgba(58, 93, 129, 0.13);
  transform: rotate(-5deg);
}

.demo-visual span {
  position: absolute;
  right: 10%;
  width: 68%;
  height: 13%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(184, 207, 229, 0.7);
  border-radius: 18px;
  box-shadow: 0 15px 34px rgba(65, 101, 137, 0.08);
}
.demo-visual span:nth-child(1) { top: 25%; }
.demo-visual span:nth-child(2) { top: 44%; right: 18%; width: 58%; }
.demo-visual span:nth-child(3) { top: 63%; right: 7%; width: 74%; }

.widget-root {
  position: fixed;
  z-index: 2147483000;
  right: 24px;
  bottom: 24px;
  color: #10213d;
}

.widget-launcher {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: end center;
  overflow: visible;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid #fff;
  border-radius: 34px;
  box-shadow: 0 18px 46px rgba(31, 80, 130, 0.24), 0 0 0 1px rgba(22,119,255,.12);
  cursor: pointer;
  isolation: isolate;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 160ms ease;
}

.widget-launcher:hover {
  transform: translateY(-4px);
  box-shadow: 0 23px 52px rgba(31, 80, 130, 0.29), 0 0 0 1px rgba(22,119,255,.18);
}

.widget-launcher:focus-visible,
.icon-button:focus-visible,
.mode-tab:focus-visible,
.record-button:focus-visible,
.text-composer input:focus-visible,
.text-composer button:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.3);
  outline-offset: 3px;
}

.launcher-halo {
  position: absolute;
  z-index: -1;
  inset: -10px;
  background: radial-gradient(circle, rgba(35, 147, 255, 0.28), transparent 68%);
  border-radius: 42px;
  animation: widget-breathe 3s ease-in-out infinite;
}

.widget-launcher img {
  width: 104%;
  height: 104%;
  display: block;
  object-fit: cover;
  object-position: center 12%;
  border-radius: 31px;
}

.launcher-online {
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  background: #24a865;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 9px rgba(36, 168, 101, 0.36);
}

.launcher-greeting {
  position: absolute;
  right: 74px;
  bottom: 109px;
  width: max-content;
  max-width: 210px;
  padding: 11px 15px;
  color: #2b405b;
  background: #fff;
  border: 1px solid #dce6f0;
  border-radius: 14px 14px 3px 14px;
  box-shadow: 0 12px 30px rgba(49, 79, 109, 0.14);
  font-size: 13px;
  font-weight: 650;
  animation: greeting-in 450ms 500ms ease both;
}

.widget-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 390px;
  height: min(680px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 176px minmax(126px, 1fr) auto auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(207, 221, 235, 0.94);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(25, 59, 94, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transform-origin: right bottom;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}

.widget-root.is-open .widget-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.widget-root.is-open .widget-launcher,
.widget-root.is-open .launcher-greeting {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.9);
}

.widget-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px 10px 14px;
  background: #fff;
  border-bottom: 1px solid #e2e9f1;
}

.widget-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.widget-identity > img {
  width: 43px;
  height: 43px;
  object-fit: cover;
  object-position: center 12%;
  background: #eef7ff;
  border: 2px solid #d6eaff;
  border-radius: 14px;
}

.widget-identity h2 {
  margin: 0 0 4px;
  color: #10213d;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.01em;
}

.widget-identity p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #24a865;
  font-size: 11px;
}

.widget-identity p span {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(36, 168, 101, 0.11);
}

.widget-identity p strong { font-weight: 700; }
.widget-identity p.is-error { color: #d94b4b; }
.widget-identity p.is-connecting { color: #1677ff; }

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #56677d;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
}
.icon-button:hover { color: #10213d; background: #f1f5f9; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.digital-human-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f7fbff, #eaf6ff);
  border-bottom: 1px solid #dce7f1;
  isolation: isolate;
}

.digital-human-stage::before,
.digital-human-stage::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid rgba(22, 119, 255, 0.17);
  border-radius: 50%;
}
.digital-human-stage::before { width: 220px; height: 220px; left: 12px; top: -25px; }
.digital-human-stage::after { width: 150px; height: 150px; right: 18px; top: 4px; border-color: rgba(36,168,101,.15); }

.stage-glow {
  position: absolute;
  z-index: -1;
  width: 210px;
  height: 150px;
  bottom: -30px;
  background: radial-gradient(circle, rgba(40, 155, 255, 0.3), transparent 70%);
  filter: blur(8px);
}

#avatar-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(28, 105, 174, 0.14));
}

.avatar-state-text {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 5px 9px;
  color: #34506e;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(208, 224, 239, .92);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.message-list {
  min-height: 0;
  overflow-y: auto;
  padding: 17px 14px 10px;
  background: #fbfdff;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 15px;
  animation: message-in 220ms ease-out both;
}

.message-avatar {
  width: 27px;
  height: 27px;
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center 12%;
  background: #eaf5ff;
  border: 1px solid #d5e9fd;
  border-radius: 9px;
}

.message-bubble {
  max-width: 270px;
  display: block;
  padding: 10px 12px;
  color: #2a3e57;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 6px 18px rgba(62, 85, 109, 0.05);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message time {
  display: block;
  margin-top: 4px;
  color: #9aa6b6;
  font-size: 9px;
}

.message-visitor { justify-content: flex-end; }
.message-visitor .message-bubble {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 7px 18px rgba(22, 119, 255, 0.17);
}
.message-visitor time { text-align: right; }

.message-body {
  min-width: 0;
}

.message-content-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.message-visitor .message-content-row {
  justify-content: flex-end;
}

.message-speech-button,
.voice-transcript-toggle {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d7e3ef;
  border-radius: 9px;
  color: #42617f;
  background: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.message-speech-button svg,
.voice-transcript-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-speech-button {
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(62, 85, 109, 0.08);
}

.message-speech-button:hover,
.message-speech-button:focus-visible {
  color: #0d67db;
  border-color: #9bc8ff;
  background: #f2f8ff;
}

.message-speech-button:active,
.voice-transcript-toggle:active {
  transform: scale(0.96);
}

.message-speech-button.is-playing {
  color: #fff;
  border-color: #1677ff;
  background: #1677ff;
}

.message-speech-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.message-audio {
  width: 218px;
  height: 32px;
  display: block;
  margin-top: 7px;
}

.voice-audio-row {
  width: 218px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.voice-audio-row .message-audio {
  width: 150px;
  min-width: 0;
  flex: 1 1 auto;
  margin-top: 0;
}

.voice-transcript-toggle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
}

.voice-transcript-toggle:hover,
.voice-transcript-toggle:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.24);
}

.voice-transcript {
  width: 218px;
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.voice-transcript[hidden] {
  display: none;
}

.voice-transcript strong {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.voice-transcript span {
  font-size: 11px;
  line-height: 1.55;
}

.message-image-link {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  background: #edf4fb;
  border-radius: 10px;
}

.message-image {
  width: min(230px, 100%);
  max-height: 210px;
  display: block;
  object-fit: cover;
}

.message-file {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  color: inherit;
  font-size: 11px;
  text-decoration: underline;
}

.input-dock {
  padding: 9px 12px 12px;
  background: #fff;
  border-top: 1px solid #dce5ef;
}

.mode-tabs {
  width: fit-content;
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  padding: 3px;
  background: #f1f5f9;
  border-radius: 10px;
}

.mode-tab {
  min-width: 76px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  color: #65758a;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
}

.mode-tab.is-active {
  color: #116bdf;
  background: #fff;
  box-shadow: 0 3px 10px rgba(49, 75, 102, 0.09);
}
.mode-tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.text-composer {
  display: grid;
  grid-template-columns: 40px 1fr 44px;
  gap: 8px;
}

.text-composer[hidden] { display: none; }

.text-composer input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  color: #10213d;
  background: #fbfdff;
  border: 1px solid #d3dfeb;
  border-radius: 11px;
  outline: 0;
  font-size: 13px;
}
.text-composer input:focus { background: #fff; border-color: #87b8f6; box-shadow: 0 0 0 3px rgba(22,119,255,.09); }

.text-composer button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1677ff;
  border-radius: 12px;
  box-shadow: 0 7px 17px rgba(22,119,255,.2);
  cursor: pointer;
}
.text-composer button:disabled,
.text-composer input:disabled { cursor: not-allowed; opacity: .55; }
.text-composer button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.text-composer .image-upload-button {
  width: 40px;
  color: #55708f;
  background: #eef4fa;
  box-shadow: none;
}
.text-composer .image-upload-button:hover { color: #126dde; background: #e4effc; }

.voice-composer {
  min-height: 168px;
  display: grid;
  justify-items: center;
  align-content: center;
}
.voice-composer[hidden] { display: none; }

.microphone-picker {
  width: min(270px, 100%);
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 5px 9px;
  color: #607590;
  background: #f3f7fb;
  border: 1px solid #e0e8f2;
  border-radius: 9px;
}
.microphone-picker svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.microphone-picker select { min-width: 0; color: #425a77; background: transparent; border: 0; outline: 0; font-size: 10px; text-overflow: ellipsis; }
.microphone-picker select:disabled { opacity: .65; }

.voice-wave {
  height: 23px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
}
.voice-wave i { width: 3px; height: 7px; background: #83b9f8; border-radius: 4px; }
.voice-wave i:nth-child(2), .voice-wave i:nth-child(6) { height: 13px; }
.voice-wave i:nth-child(3), .voice-wave i:nth-child(5) { height: 19px; }
.voice-wave i:nth-child(4) { height: 23px; }

.record-button {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1677ff;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(22,119,255,.11), 0 10px 24px rgba(22,119,255,.24);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.record-button:disabled { cursor: not-allowed; opacity: .5; }
.record-button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.voice-composer strong { margin-top: 10px; color: #1d3553; font-size: 13px; }
.voice-composer > span { margin-top: 3px; color: #8a98a9; font-size: 10px; }

.widget-root.is-recording .record-button { background: #d94b4b; box-shadow: 0 0 0 8px rgba(217,75,75,.11), 0 10px 24px rgba(217,75,75,.2); transform: scale(1.04); }
.widget-root.is-recording .voice-wave i { background: #1677ff; animation: wave 620ms ease-in-out infinite alternate; }
.widget-root.is-recording .voice-wave i:nth-child(2) { animation-delay: -90ms; }
.widget-root.is-recording .voice-wave i:nth-child(3) { animation-delay: -180ms; }
.widget-root.is-recording .voice-wave i:nth-child(4) { animation-delay: -270ms; }
.widget-root.is-recording .voice-wave i:nth-child(5) { animation-delay: -360ms; }
.widget-root.is-recording .voice-wave i:nth-child(6) { animation-delay: -450ms; }

.error-message {
  margin: 0;
  padding: 8px 13px;
  color: #a23232;
  background: #fff5f5;
  border-top: 1px solid #f0d7d7;
  font-size: 10px;
  line-height: 1.45;
}

@keyframes widget-breathe { 0%, 100% { opacity: .58; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes greeting-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes wave { from { transform: scaleY(.45); opacity: .55; } to { transform: scaleY(1.35); opacity: 1; } }

@media (max-width: 760px) {
  .demo-header nav { display: none; }
  .demo-main { grid-template-columns: 1fr; padding: 52px 26px 140px; }
  .demo-visual { position: absolute; right: -120px; bottom: 20px; width: 500px; opacity: .45; }
  .demo-copy h1 { font-size: clamp(38px, 12vw, 58px); }
}

@media (max-width: 520px) {
  .demo-header { height: 66px; padding: 0 18px; }
  .demo-action { display: none; }
  .demo-main { min-height: calc(100vh - 66px); padding: 48px 22px 150px; }
  .demo-copy > p:not(.demo-label) { font-size: 15px; }
  .widget-root { right: 12px; bottom: 12px; }
  .widget-panel { width: calc(100vw - 24px); height: min(680px, calc(100vh - 24px)); }
  .widget-launcher { width: 88px; height: 88px; border-radius: 29px; }
  .widget-launcher img { border-radius: 26px; }
  .launcher-greeting { right: 62px; bottom: 96px; }
}

/* Floating digital-human Widget v3 — mascot and conversation are independent layers */
.widget-root {
  right: 22px;
  bottom: 18px;
  width: 158px;
  height: 205px;
  pointer-events: none;
}

.widget-launcher {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  width: 158px;
  height: 205px;
  display: block;
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  isolation: isolate;
  transition: transform 180ms ease;
}

.widget-launcher:hover {
  transform: translateY(-3px);
  box-shadow: none;
}

.widget-launcher:focus-visible,
.icon-button:focus-visible,
.record-button:focus-visible,
.text-composer input:focus-visible,
.text-composer button:focus-visible,
.microphone-settings summary:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.3);
  outline-offset: 3px;
}

.launcher-halo {
  position: absolute;
  z-index: -2;
  inset: 18px 0 8px;
  background: radial-gradient(circle at 52% 48%, rgba(55, 163, 255, 0.24), transparent 68%);
  border-radius: 50%;
  animation: widget-breathe 3s ease-in-out infinite;
}

.launcher-shadow {
  position: absolute;
  z-index: -1;
  right: 18px;
  bottom: 1px;
  width: 116px;
  height: 17px;
  background: radial-gradient(ellipse, rgba(15, 50, 89, 0.24), transparent 68%);
  filter: blur(4px);
}

.launcher-character {
  position: absolute;
  inset: 0;
  display: block;
  contain: paint;
  filter: drop-shadow(0 15px 20px rgba(27, 102, 172, 0.18));
}

#avatar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.launcher-online {
  position: absolute;
  right: 19px;
  bottom: 27px;
  width: 14px;
  height: 14px;
  background: #22a966;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(34, 169, 102, 0.35);
}

.avatar-state-text {
  position: absolute;
  right: 30px;
  bottom: 8px;
  padding: 4px 9px;
  color: #31506f;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(207, 222, 237, 0.96);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(43, 77, 112, 0.12);
  font-size: 10px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.launcher-greeting {
  z-index: 5;
  right: 116px;
  bottom: 172px;
  max-width: 248px;
  padding: 10px 14px;
  border: 1px solid #cad9e8;
  border-radius: 15px 15px 3px 15px;
  box-shadow: 0 12px 30px rgba(49, 79, 109, 0.14);
  pointer-events: none;
  white-space: nowrap;
}

.widget-panel {
  position: absolute;
  z-index: 5;
  right: 128px;
  bottom: 26px;
  width: 350px;
  height: min(500px, calc(100vh - 42px));
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) auto auto;
  overflow: visible;
  background: #fff;
  border: 1px solid rgba(194, 211, 228, 0.96);
  border-radius: 19px;
  box-shadow: 0 26px 68px rgba(25, 59, 94, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(12px, 10px) scale(0.96);
  transform-origin: right bottom;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}

.widget-root.is-open .widget-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0) scale(1);
}

.widget-root.is-open .widget-launcher {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.widget-root.is-open .launcher-greeting {
  display: none;
}

.widget-header {
  min-height: 58px;
  padding: 8px 9px 8px 12px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e4ebf2;
  border-radius: 19px 19px 0 0;
}

.widget-identity { gap: 9px; }

.widget-identity-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(145deg, #44a6ff, #136ce1);
  border-radius: 11px;
  box-shadow: 0 7px 17px rgba(22, 119, 255, 0.2);
  font-size: 15px;
  font-weight: 850;
}

.widget-identity h2 {
  margin-bottom: 2px;
  font-size: 14px;
}

.widget-identity p { font-size: 10px; }

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.icon-button svg { width: 18px; height: 18px; }

.message-list {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 13px 8px;
  background: linear-gradient(180deg, #fbfdff, #f7faff);
}

.message { margin-bottom: 13px; }
.message-bubble { max-width: 248px; }
.message-agent .message-body { max-width: calc(100% - 35px); }
.message-agent .message-bubble { max-width: 238px; }

.input-dock {
  position: relative;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #dce5ef;
  border-radius: 0 0 19px 19px;
}

.voice-feedback {
  position: absolute;
  right: 10px;
  bottom: calc(100% + 7px);
  left: 10px;
  z-index: 6;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: #536980;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e2ee;
  border-radius: 11px;
  box-shadow: 0 10px 25px rgba(35, 69, 103, 0.14);
  font-size: 10px;
  backdrop-filter: blur(12px);
}

.voice-feedback[hidden] { display: none; }
.voice-feedback strong { flex: 0 0 auto; color: #203954; font-size: 11px; }
.voice-feedback > span:not(.voice-feedback-dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-feedback-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: #1677ff;
  border-radius: 50%;
}

.widget-root.is-recording .voice-feedback-dot {
  background: #df4b4b;
  box-shadow: 0 0 0 4px rgba(223, 75, 75, 0.12);
  animation: widget-breathe 900ms ease-in-out infinite;
}

.microphone-settings { position: relative; margin-left: auto; flex: 0 0 auto; }
.microphone-settings summary { color: #176edb; cursor: pointer; font-weight: 720; list-style: none; }
.microphone-settings summary::-webkit-details-marker { display: none; }
.microphone-settings label {
  position: absolute;
  right: -3px;
  bottom: calc(100% + 10px);
  width: 258px;
  display: grid;
  gap: 6px;
  padding: 10px;
  color: #58708c;
  background: #fff;
  border: 1px solid #d8e3ee;
  border-radius: 11px;
  box-shadow: 0 13px 32px rgba(34, 66, 99, 0.18);
}
.microphone-settings select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  color: #28415d;
  background: #f5f8fb;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
}

.text-composer {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 38px 38px;
  align-items: center;
  gap: 6px;
}

.text-composer input {
  height: 42px;
  padding: 0 11px;
  background: #f8fafc;
  border-color: #d5e0eb;
  border-radius: 11px;
  font-size: 12px;
}

.text-composer button,
.text-composer .image-upload-button,
.text-composer .record-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.text-composer .image-upload-button {
  width: 36px;
  height: 36px;
  color: #58718e;
  background: transparent;
}

.text-composer .record-button {
  color: #37526f;
  background: #fff;
  border: 1px solid #d5e1ec;
  box-shadow: none;
  touch-action: manipulation;
}

.text-composer .record-button:hover { color: #176edb; background: #eef6ff; border-color: #b9d5f4; }
.text-composer .record-button svg { width: 19px; height: 19px; }

.widget-root.is-recording .text-composer .record-button {
  color: #fff;
  background: #df4b4b;
  border-color: #df4b4b;
  box-shadow: 0 0 0 5px rgba(223, 75, 75, 0.12);
  transform: none;
}

.error-message {
  overflow: hidden;
  border-radius: 0 0 19px 19px;
}

@media (max-width: 520px) {
  .widget-root {
    right: 10px;
    bottom: 8px;
    width: 116px;
    height: 152px;
  }

  .widget-launcher {
    width: 116px;
    height: 152px;
  }

  .launcher-greeting {
    right: 83px;
    bottom: 132px;
    max-width: calc(100vw - 108px);
  }

  .avatar-state-text { right: 18px; bottom: 4px; }
  .launcher-online { right: 9px; bottom: 22px; }

  .widget-panel {
    right: 0;
    bottom: 143px;
    width: calc(100vw - 20px);
    height: min(590px, calc(100vh - 168px));
    transform-origin: right bottom;
  }

  .message-bubble { max-width: min(270px, calc(100vw - 104px)); }
}

/* First-run Chatwoot binding */
.binding-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 27, 54, .42);
  backdrop-filter: blur(10px);
  animation: binding-fade-in 220ms ease-out both;
}

.binding-modal[hidden] { display: none; }
.widget-root.is-awaiting-binding { opacity: 0; pointer-events: none; }
.widget-actions { display: flex; align-items: center; gap: 2px; }

.binding-card {
  width: min(480px, 100%);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(206, 221, 239, .9);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(16, 44, 82, .24);
  animation: binding-card-in 280ms cubic-bezier(.2,.8,.2,1) both;
}

.binding-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(120deg, #1268dd, #2698ff);
}

.binding-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 12px;
  font-weight: 850;
}

.binding-header div { display: grid; gap: 3px; }
.binding-header strong { font-size: 15px; letter-spacing: .01em; }
.binding-header div span { color: rgba(255,255,255,.78); font-size: 11px; }
.binding-step { margin-left: auto; color: rgba(255,255,255,.76); font-size: 11px; font-weight: 700; }

.binding-body { padding: 28px 30px 24px; }
.binding-eyebrow { margin: 0 0 7px; color: #1677ff; font-size: 11px; font-weight: 760; letter-spacing: .08em; }
.binding-body h2 { margin: 0; color: #10213d; font-size: 27px; line-height: 1.2; letter-spacing: -.03em; }
.binding-description { margin: 12px 0 22px; color: #667892; font-size: 13px; line-height: 1.7; }

.binding-form { display: grid; gap: 14px; }
.binding-form label { display: grid; gap: 7px; color: #344966; font-size: 12px; font-weight: 680; }
.binding-form input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: #132845;
  background: #fbfdff;
  border: 1px solid #d8e3ef;
  border-radius: 11px;
  outline: 0;
  font: inherit;
  font-weight: 500;
}
.binding-form input[readonly] { color: #65758a; background: #f3f7fb; }
.binding-form input:focus { background: #fff; border-color: #65a9f7; box-shadow: 0 0 0 3px rgba(22,119,255,.1); }

.binding-form button {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 3px;
  color: #fff;
  background: #1677ff;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(22,119,255,.2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 740;
}
.binding-form button:hover { background: #0d69e3; transform: translateY(-1px); }
.binding-form button:disabled { cursor: wait; opacity: .68; transform: none; }
.binding-form button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.binding-status { min-height: 18px; margin: 12px 0 0; color: #708097; font-size: 11px; text-align: center; }
.binding-status.is-error { color: #b33c3c; }
.binding-status.is-success { color: #178756; }
.binding-security { display: flex; align-items: flex-start; gap: 7px; margin: 14px 0 0; padding-top: 14px; color: #8693a5; border-top: 1px solid #edf1f6; font-size: 10px; line-height: 1.5; }
.binding-security svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: #5e9ee9; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@keyframes binding-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes binding-card-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
  .binding-modal { padding: 14px; align-items: center; }
  .binding-card { border-radius: 20px; }
  .binding-header { min-height: 68px; padding: 0 18px; }
  .binding-body { padding: 23px 20px 20px; }
  .binding-body h2 { font-size: 24px; }
}

/* Cross-site iframe host mode. The parent embed loader owns the viewport size. */
html.widget-frame,
html.widget-frame body {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.widget-frame .demo-header,
.widget-frame .demo-main {
  display: none;
}

.widget-frame #widget-rebind {
  display: none;
}

.widget-frame .widget-root {
  right: 14px;
  bottom: 10px;
}

@media (max-width: 520px) {
  .widget-frame .widget-root {
    right: 8px;
    bottom: 8px;
  }
}
