#tvc-widget {
  --tvc-pink: #e60067;
  --tvc-pink-dark: #a80048;
  --tvc-orange: #ff592d;
  --tvc-ink: #351225;
  --tvc-muted: #725b67;
  --tvc-line: #f0dce5;
  position: relative;
  z-index: 99999;
  color: var(--tvc-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
#tvc-widget *, #tvc-widget *::before, #tvc-widget *::after { box-sizing: border-box; }
#tvc-widget button, #tvc-widget input, #tvc-widget select, #tvc-widget textarea { font: inherit; }
#tvc-widget button { cursor: pointer; }
#tvc-widget button:disabled { cursor: wait; opacity: .62; }
#tvc-widget :focus-visible { outline: 3px solid #2e75ff; outline-offset: 3px; }
#tvc-widget [hidden] { display: none !important; }

#tvc-widget .chat-launcher {
  position: fixed;
  z-index: 99999;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 210px;
  min-height: 82px;
  padding: 8px 21px 8px 78px;
  color: #fff;
  background: linear-gradient(135deg, #ff342c, var(--tvc-pink));
  border: 3px solid #fff;
  border-radius: 24px 24px 4px 24px;
  box-shadow: 0 18px 42px rgba(130, 0, 56, .35);
  text-align: left;
  transition: transform .2s ease, opacity .2s ease;
}
#tvc-widget .chat-launcher:hover { transform: translateY(-3px); }
#tvc-widget .chat-launcher.is-hidden { opacity: 0; transform: translateY(15px); pointer-events: none; }
#tvc-widget .launcher-label { display: block; font-size: 18px; line-height: 1.05; font-weight: 900; }
#tvc-widget .launcher-mascot {
  position: absolute; left: -24px; bottom: -7px; width: 105px; height: 105px;
  display: grid; place-items: center;
}
#tvc-widget .launcher-mascot::before {
  content: ""; position: absolute; width: 72px; height: 72px;
  background: #fff; border-radius: 50%; box-shadow: 0 6px 18px rgba(90,0,38,.17);
}
#tvc-widget .launcher-mascot img { position: relative; width: 107px; height: 107px; object-fit: contain; }

#tvc-widget .chat-panel {
  position: fixed;
  z-index: 100000;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: min(410px, calc(100vw - 32px));
  height: min(690px, calc(100dvh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #f8e8ef;
  border-radius: 28px 28px 10px 28px;
  box-shadow: 0 24px 70px rgba(81, 10, 42, .22);
  transform: translateY(18px) scale(.97);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#tvc-widget .chat-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }
#tvc-widget .chat-header {
  min-height: 86px; padding: 15px 16px; display: flex; align-items: center; gap: 12px;
  color: #fff; background: linear-gradient(120deg, #ff3e27, var(--tvc-pink) 72%);
}
#tvc-widget .chat-avatar {
  width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center;
  background: #fff; border-radius: 17px; box-shadow: 0 8px 20px rgba(90,0,39,.2);
}
#tvc-widget .chat-avatar img { width: 68px; height: 68px; object-fit: contain; }
#tvc-widget .chat-heading { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
#tvc-widget .chat-heading strong { font-size: 19px; }
#tvc-widget .chat-heading small { font-size: 12px; color: rgba(255,255,255,.9); }
#tvc-widget .icon-button {
  width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center;
  color: #fff; background: rgba(255,255,255,.13); border: 0; border-radius: 14px; font-size: 29px;
}
#tvc-widget .progress-wrap { padding: 12px 17px 11px; background: #fffafd; border-bottom: 1px solid var(--tvc-line); }
#tvc-widget .progress-copy { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--tvc-muted); font-size: 12px; font-weight: 700; }
#tvc-widget .back-button { min-height: 32px; padding: 0 7px 0 2px; color: var(--tvc-pink-dark); background: transparent; border: 0; font-weight: 800; }
#tvc-widget .progress-track { height: 5px; margin-top: 7px; overflow: hidden; background: #f4dce7; border-radius: 99px; }
#tvc-widget .progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--tvc-orange), var(--tvc-pink)); border-radius: inherit; transition: width .25s ease; }
#tvc-widget .chat-body {
  flex: 1 1 auto; min-height: 0; padding: 20px 17px 24px; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #fff 0%, #fffafd 100%);
  scrollbar-width: thin; scrollbar-color: #efc7d9 transparent;
}
#tvc-widget .message-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 14px; }
#tvc-widget .message-row.user { justify-content: flex-end; }
#tvc-widget .mini-avatar { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; background: #fff0f5; border-radius: 9px; overflow: hidden; }
#tvc-widget .mini-avatar img { width: 36px; height: 36px; object-fit: contain; }
#tvc-widget .bubble {
  max-width: 84%; padding: 12px 14px; color: #432237; background: #fff0f5;
  border: 1px solid #f6dce7; border-radius: 17px 17px 17px 5px; font-size: 14px; line-height: 1.46;
}
#tvc-widget .user .bubble { color: #fff; background: var(--tvc-pink); border-color: var(--tvc-pink); border-radius: 17px 17px 5px 17px; }
#tvc-widget .bubble strong { color: var(--tvc-pink-dark); }
#tvc-widget .privacy-note, #tvc-widget .consent-note { margin: 8px 0 13px 36px; color: #5e4553; font-size: 12px; line-height: 1.45; }
#tvc-widget .choice-list { display: grid; gap: 9px; margin: 9px 0 3px 36px; }
#tvc-widget .choice-button, #tvc-widget .primary-button, #tvc-widget .secondary-button {
  width: 100%; min-height: 48px; padding: 11px 14px; color: var(--tvc-pink-dark);
  background: #fff; border: 1.5px solid #efbfd4; border-radius: 14px;
  text-align: left; font-weight: 780; line-height: 1.25;
}
#tvc-widget .choice-button:hover, #tvc-widget .secondary-button:hover { background: #fff0f5; border-color: var(--tvc-pink); }
#tvc-widget .primary-button { color: #fff; background: linear-gradient(135deg, #ed2038, var(--tvc-pink)); border-color: transparent; text-align: center; }
#tvc-widget .secondary-button { text-align: center; }
#tvc-widget .button-stack { display: grid; gap: 9px; margin: 14px 0 0 36px; }
#tvc-widget .button-stack .consent-note { margin: 0 0 2px; }
#tvc-widget .form-card { margin: 9px 0 3px 36px; padding: 14px; background: #fff; border: 1px solid var(--tvc-line); border-radius: 16px; box-shadow: 0 8px 24px rgba(93,24,56,.06); }
#tvc-widget .form-card .consent-note { margin: 4px 0 12px; }
#tvc-widget .field { display: grid; gap: 7px; margin-bottom: 12px; }
#tvc-widget .field label, #tvc-widget .field-label { color: #4d2d3e; font-size: 12px; font-weight: 800; }
#tvc-widget .field input, #tvc-widget .field textarea, #tvc-widget .field select {
  width: 100%; min-height: 48px; padding: 11px 12px; color: var(--tvc-ink);
  background: #fffafd; border: 1.5px solid #e8d5de; border-radius: 12px;
}
#tvc-widget .field textarea { min-height: 108px; resize: vertical; }
#tvc-widget .field-hint { color: var(--tvc-muted); font-size: 11px; }
#tvc-widget .form-error { margin: 8px 0 0; color: #b60032; font-size: 12px; font-weight: 700; }
#tvc-widget .checkbox-list { display: grid; gap: 9px; }
#tvc-widget .check-row { min-height: 44px; display: flex; align-items: flex-start; gap: 9px; padding: 10px; background: #fffafd; border: 1px solid var(--tvc-line); border-radius: 11px; font-size: 13px; }
#tvc-widget .check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--tvc-pink); flex: 0 0 auto; }
#tvc-widget .summary-card { margin: 9px 0 3px 36px; padding: 14px; background: #fff; border: 1px solid var(--tvc-line); border-radius: 16px; }
#tvc-widget .summary-row { padding: 10px 0; border-bottom: 1px solid #f3e7ed; }
#tvc-widget .summary-row:first-child { padding-top: 0; }
#tvc-widget .summary-row:last-child { padding-bottom: 0; border-bottom: 0; }
#tvc-widget .summary-row span { display: block; margin-bottom: 3px; color: var(--tvc-muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
#tvc-widget .summary-row strong { display: block; color: #402034; font-size: 13px; overflow-wrap: anywhere; }
#tvc-widget .success-mark { width: 62px; height: 62px; margin: 6px auto 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ff4f2e, var(--tvc-pink)); border-radius: 21px; font-size: 30px; }
#tvc-widget .centered { text-align: center; }
#tvc-widget .centered .bubble { max-width: 100%; }
#tvc-widget .chat-footer { min-height: 42px; padding: 8px 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--tvc-muted); background: #fff; border-top: 1px solid var(--tvc-line); font-size: 10px; }
#tvc-widget .chat-footer button { min-height: 30px; padding: 0 6px; color: var(--tvc-pink-dark); background: transparent; border: 0; font-size: 11px; font-weight: 800; }
#tvc-widget a { color: var(--tvc-pink-dark); text-decoration: underline; }

@media (max-width: 560px) {
  #tvc-widget .chat-launcher { right: 14px; bottom: 14px; width: 195px; min-height: 76px; }
  #tvc-widget .chat-panel { right: 0; bottom: 0; width: 100%; height: min(770px, 100dvh); border-radius: 24px 24px 0 0; }
  #tvc-widget .chat-header { padding-top: max(15px, env(safe-area-inset-top)); }
  #tvc-widget .chat-footer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #tvc-widget *, #tvc-widget *::before, #tvc-widget *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
