.tep-assistant-dialog {
  width: min(610px, calc(100% - 28px));
  height: min(820px, calc(100dvh - 28px));
  max-height: 820px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #35536a;
  background: #07131d;
  color: #fff;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.72);
}

.tep-assistant-dialog [hidden] {
  display: none !important;
}

.tep-assistant-dialog::backdrop {
  background: rgba(1, 5, 8, 0.82);
  backdrop-filter: blur(6px);
}

.tep-assistant-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 3px minmax(0, 1fr) auto auto;
}

.tep-assistant-header {
  min-height: 76px;
  padding: 13px 15px 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #223847;
  background: #06101a;
}

.tep-assistant-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tep-assistant-avatar,
.tep-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #169df9;
  background: linear-gradient(135deg, #0c9cff, #0568ae);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.7px;
}

.tep-assistant-avatar {
  width: 44px;
  height: 44px;
  font-size: 13px;
}

.tep-assistant-identity > span:last-child {
  display: flex;
  flex-direction: column;
}

.tep-assistant-identity strong {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.tep-assistant-identity small {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #91a9ba;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.tep-assistant-identity small i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.65);
}

.tep-assistant-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a5263;
  background: #0a1924;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

.tep-assistant-progress {
  overflow: hidden;
  background: #0e2130;
}

.tep-assistant-progress span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #078de8, #29b3ff);
  transition: width 220ms ease;
}

.tep-assistant-log {
  min-height: 0;
  padding: 23px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #2d536c #07131d;
  background:
    radial-gradient(circle at 85% 10%, rgba(7, 149, 255, 0.08), transparent 30%),
    #07131d;
}

.tep-chat-row {
  margin: 0 0 14px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.tep-chat-row.customer {
  justify-content: flex-end;
}

.tep-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
}

.tep-chat-row p {
  max-width: min(430px, calc(100% - 42px));
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #263f51;
  background: #0c1d29;
  color: #dbe8f0;
  font-size: 13px;
  line-height: 1.48;
}

.tep-chat-row.assistant p {
  border-radius: 3px 13px 13px 13px;
}

.tep-chat-row.customer p {
  border-color: #167cc0;
  border-radius: 13px 3px 13px 13px;
  background: #086aa9;
  color: #fff;
}

.tep-assistant-form {
  padding: 17px 20px 15px;
  border-top: 1px solid #223847;
  background: #091823;
}

.tep-assistant-response {
  min-width: 0;
}

.tep-assistant-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.tep-input-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tep-input-field > span,
.tep-choice-field legend {
  color: #a9bfce;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tep-input-field input,
.tep-input-field textarea {
  width: 100%;
  border: 1px solid #385267;
  border-radius: 0;
  outline: 0;
  background: #06111a;
  color: #fff;
  font: inherit;
  font-size: 14px;
}

.tep-input-field input {
  height: 48px;
  padding: 0 13px;
}

.tep-input-field textarea {
  min-height: 92px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.45;
}

.tep-input-field input:focus,
.tep-input-field textarea:focus {
  border-color: #139ef8;
  box-shadow: 0 0 0 2px rgba(19, 158, 248, 0.16);
}

.tep-input-field input::placeholder,
.tep-input-field textarea::placeholder {
  color: #61798a;
}

.tep-optional-label {
  color: #6f8798;
  font-size: 9px;
}

.tep-choice-field {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 0;
}

.tep-choice-field legend {
  margin-bottom: 8px;
}

.tep-choice {
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #355064;
  background: #07131d;
  color: #d6e3eb;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.tep-choice:hover,
.tep-choice:focus-visible,
.tep-choice.is-selected {
  border-color: #139ef8;
  background: #0a3552;
  color: #fff;
}

.tep-assistant-controls {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tep-assistant-back,
.tep-assistant-next,
.tep-assistant-send,
.tep-assistant-call {
  min-height: 43px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #159ff9;
  background: #0c8fe5;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}

.tep-assistant-back {
  border-color: #3b5263;
  background: transparent;
  color: #b8c9d5;
}

.tep-assistant-next {
  margin-left: auto;
}

.tep-submit-direct {
  width: 100%;
}

.tep-submit-direct:disabled {
  cursor: wait;
  opacity: 0.72;
}

.tep-send-secondary {
  width: 100%;
  margin-top: 8px;
  border-color: #25d366;
  background: transparent;
  color: #d9ffe7;
}

.tep-assistant-success {
  padding: 18px;
  border: 1px solid #267957;
  background: linear-gradient(145deg, rgba(24, 111, 76, 0.25), rgba(8, 26, 36, 0.95));
  text-align: center;
}

.tep-success-check {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: #05150b;
  font-size: 24px;
  font-weight: 900;
}

.tep-assistant-success .tep-success-label {
  margin: 0 0 5px;
  color: #7cebab;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.tep-assistant-success > strong {
  display: block;
  color: #fff;
  font-size: 18px;
  letter-spacing: 0.8px;
}

.tep-assistant-success > p:not(.tep-success-label) {
  margin: 12px auto 15px;
  max-width: 430px;
  color: #bfd0dc;
  font-size: 12px;
  line-height: 1.55;
}

.tep-assistant-success-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tep-assistant-success .tep-send-secondary {
  margin: 0;
}

.tep-assistant-call {
  border-color: #436074;
  background: #0a1924;
  color: #dceaf3;
}

.tep-assistant-footer {
  min-height: 43px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #223847;
  background: #050d14;
  color: #6f8798;
  font-size: 8px;
  line-height: 1.4;
}

.tep-assistant-reset {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #4e687b;
  background: transparent;
  color: #a9bfce;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
}

.tep-assistant-review {
  border: 1px solid #315064;
  background: #06111a;
}

.tep-review-heading {
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #294354;
  background: #0b2130;
}

.tep-review-heading span {
  color: #3fb6ff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tep-review-heading strong {
  margin-top: 3px;
  font-size: 16px;
  text-transform: uppercase;
}

.tep-assistant-review dl {
  max-height: 195px;
  margin: 0;
  overflow-y: auto;
  scrollbar-color: #2d536c #07131d;
}

.tep-assistant-review dl > div {
  padding: 9px 14px;
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 13px;
  border-bottom: 1px solid #1e3443;
}

.tep-assistant-review dt {
  color: #6f8798;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.tep-assistant-review dd {
  margin: 0;
  color: #e3edf3;
  font-size: 11px;
  line-height: 1.4;
}

.tep-assistant-review > p {
  margin: 0;
  padding: 12px 14px;
  color: #8ca3b3;
  font-size: 10px;
  line-height: 1.45;
}

.tep-assistant-send {
  width: calc(100% - 28px);
  margin: 0 14px 12px;
  gap: 8px;
  border-color: #25d366;
  background: #25d366;
  color: #062d17;
}

.tep-send-status {
  min-height: 18px;
  padding: 0 14px 12px;
  display: block;
  color: #7ee5a4;
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 620px) {
  .tep-assistant-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
  }

  .tep-assistant-header {
    min-height: 69px;
  }

  .tep-assistant-log {
    padding: 18px 14px;
  }

  .tep-assistant-form {
    padding: 14px;
  }

  .tep-choice-field {
    grid-template-columns: 1fr;
    max-height: 224px;
    overflow-y: auto;
  }

  .tep-assistant-review dl {
    max-height: 170px;
  }

  .tep-assistant-review dl > div {
    grid-template-columns: 105px 1fr;
  }

  .tep-assistant-footer {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tep-assistant-progress span {
    transition: none;
  }
}
