* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #f3f6fb, #dde7f5);
  color: #172033;
}
.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 380px minmax(320px, 720px);
  gap: 28px;
  justify-content: center;
  align-items: center;
  padding: 32px;
}
.brand-panel, .chat-card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 55px rgba(23, 32, 51, 0.12);
}
.brand-panel {
  padding: 34px;
  text-align: center;
}
.client-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #eef4ff;
  background: #d9e3f2;
}
h1 { margin: 22px 0 6px; font-size: 30px; }
h2 { margin: 0 0 12px; font-size: 20px; color: #36527a; }
.trust-line { margin-top: 28px; color: #5c687c; }
.chat-card {
  min-height: 640px;
  overflow: hidden;
}
.lead-form { padding: 36px; }
.lead-form h3 { font-size: 28px; margin: 0 0 8px; }
.lead-form p { color: #5c687c; }
label { display: block; margin: 18px 0 8px; font-weight: bold; }
input, select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  outline: none;
}
input:focus, select:focus { border-color: #36527a; }
button {
  border: 0;
  border-radius: 12px;
  background: #172033;
  color: white;
  padding: 14px 20px;
  font-weight: bold;
  cursor: pointer;
  font-size: 15px;
}
#startChatBtn { width: 100%; margin-top: 24px; }
.error-text { color: #b42318 !important; min-height: 20px; }
.hidden { display: none !important; }
.chat-area { height: 640px; display: flex; flex-direction: column; }
.chat-header {
  padding: 18px 22px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header span { display: block; color: #16a34a; font-size: 13px; margin-top: 4px; }
.ghost-btn { background: #eef2f7; color: #172033; padding: 9px 12px; }
.messages {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  background: #f8fafc;
}
.message {
  max-width: 78%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.message.user { margin-left: auto; background: #172033; color: white; border-bottom-right-radius: 4px; }
.message.ai { margin-right: auto; background: white; color: #172033; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.typing { padding: 8px 22px; color: #64748b; font-size: 14px; }
.chat-input-row {
  padding: 16px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #edf2f7;
}
.help-text{
    display:block;
    margin-top:6px;
    color:#666;
    font-size:13px;
}
.tavus-avatar-button {
    position: fixed;
    top: 110px;
    right: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 54px;
    min-height: 230px;
    padding: 18px 10px;

    border: 0;
    border-radius: 16px 0 0 16px;

    background: linear-gradient(
        180deg,
        #163fa8 0%,
        #2468e5 100%
    );

    color: #ffffff;
    cursor: pointer;

    box-shadow: 0 8px 24px rgba(0, 40, 120, 0.3);

    transition:
        width 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.tavus-button-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);

    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tavus-live-dot {
    position: absolute;
    top: 15px;
    left: 50%;

    width: 10px;
    height: 10px;

    border-radius: 50%;
    background: #40ed83;

    transform: translateX(-50%);
    box-shadow: 0 0 0 5px rgba(64, 237, 131, 0.2);

    animation: tavusPulse 1.8s infinite;
}

.tavus-avatar-button:hover {
    width: 62px;
    box-shadow: 0 10px 30px rgba(0, 40, 120, 0.42);
}

.tavus-avatar-button:focus-visible {
    outline: 3px solid #ffcc33;
    outline-offset: 3px;
}

.tavus-avatar-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.tavus-status-message {
    position: fixed;
    top: 350px;
    right: 70px;
    z-index: 1001;

    display: none;
    max-width: 280px;
    padding: 12px 16px;

    border-radius: 10px;
    background: #ffffff;
    color: #17213a;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.tavus-status-message:not(:empty) {
    display: block;
}

@keyframes tavusPulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(64, 237, 131, 0.2);
    }

    50% {
        box-shadow: 0 0 0 9px rgba(64, 237, 131, 0);
    }
}

@media (max-width: 600px) {
    .tavus-avatar-button {
        top: 90px;
        width: 48px;
        min-height: 195px;
    }

    .tavus-button-text {
        font-size: 13px;
    }

    .tavus-status-message {
        top: 295px;
        right: 58px;
        max-width: 220px;
    }
}
.chat-input-row input { flex: 1; }
.chat-input-row button { width: 92px; }
@media (max-width: 900px) {
  .page-shell { grid-template-columns: 1fr; padding: 18px; }
  .brand-panel { padding: 24px; }
  .chat-card, .chat-area { min-height: 600px; height: 600px; }
}
