* {
  box-sizing: border-box;
}

:root {
  --ink: #0f172a;
  --muted: #667085;
  --line: #dbe4ef;
  --panel: #ffffff;
  --soft: #f7f9fc;
  --blue: #2f5df5;
  --navy: #102033;
  --teal: #0f8f87;
  --green: #14a456;
  --amber: #c27803;
  --danger: #b42318;
  --shadow: 0 26px 80px rgba(15, 23, 42, 0.16);
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(47, 93, 245, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 143, 135, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f7fbff 0%, #eef6f7 48%, #f6f8fc 100%);
  background-size: 45px 45px, 45px 45px, auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.support-shell {
  display: grid;
  height: 100vh;
  height: 100dvh;
  place-items: center;
  padding: 22px;
}

.support-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(500px, 1.26fr);
  width: min(1140px, 100%);
  height: min(760px, calc(100vh - 44px));
  height: min(760px, calc(100dvh - 44px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(202, 213, 226, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.support-info {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  min-height: 0;
  overflow: hidden;
  padding: 36px;
  color: #ffffff;
  background:
    linear-gradient(155deg, #101c2e 0%, #143a4e 54%, #128b82 100%);
}

.support-info::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 38%);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #ffffff;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
}

.brand strong {
  font-size: 22px;
  letter-spacing: 0;
}

.info-copy {
  position: relative;
  margin: auto 0;
}

.info-copy span {
  display: inline-flex;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.info-copy h1 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.info-copy p {
  max-width: 480px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.55;
}

.chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #f8fafc;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
}

.chat-head div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(23, 163, 74, 0.12);
}

.chat-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--green);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 28px;
  background: #f8fafc;
}

.chat-messages::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #edf3f8;
}

.chat-messages::-webkit-scrollbar-thumb {
  border: 2px solid #edf3f8;
  border-radius: 999px;
  background: #94a3b8;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.message {
  display: grid;
  gap: 8px;
  max-width: min(78%, 560px);
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.48;
  white-space: pre-line;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.message strong {
  font-size: 11px;
  text-transform: uppercase;
}

.message.bot {
  align-self: flex-start;
  border: 1px solid rgba(203, 213, 225, 0.86);
  background: #ffffff;
}

.message.user {
  align-self: flex-end;
  color: #ffffff;
  background: linear-gradient(135deg, #2f5df5, #1d4ed8);
}

.message.user strong {
  color: rgba(255, 255, 255, 0.82);
}

.message.bot strong {
  color: var(--teal);
}

.message.typing {
  width: 86px;
  min-height: 48px;
}

.message.typing span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
}

.message.typing i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  animation: typingPulse 1s ease-in-out infinite;
}

.message.typing i:nth-child(2) {
  animation-delay: 0.14s;
}

.message.typing i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  background: #ffffff;
}

.quick-replies button {
  min-height: 34px;
  border: 1px solid rgba(47, 93, 245, 0.22);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--blue);
  background: #f6f8ff;
  font-size: 14px;
  font-weight: 800;
}

.quick-replies button:hover,
.quick-replies button:focus-visible {
  outline: none;
  border-color: var(--blue);
  background: #eaf1ff;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 18px 16px;
  background: #ffffff;
}

.chat-form input {
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.chat-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.chat-form button {
  min-width: 96px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #2f5df5, #1d4ed8);
  font-weight: 900;
}

.chat-form button:hover,
.chat-form button:focus-visible {
  outline: none;
  box-shadow: 0 10px 24px rgba(47, 93, 245, 0.25);
}

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

@media (max-width: 880px) {
  .support-shell {
    place-items: stretch;
    padding: 0;
  }

  .support-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .support-info {
    gap: 14px;
    padding: 16px 18px;
  }

  .info-copy {
    margin: 0;
  }

  .info-copy h1 {
    font-size: 26px;
    line-height: 1.05;
  }

  .info-copy p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.35;
  }

  .chat-card {
    min-height: 0;
    height: auto;
    overflow: hidden;
  }
}

@media (max-width: 560px) {
  .support-info {
    display: flex;
    min-height: 0;
    height: 64px;
    padding: 12px 16px;
  }

  .brand span {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 18px;
  }

  .info-copy {
    display: none;
  }

  .chat-head {
    min-height: 58px;
    padding: 0 16px;
  }

  .chat-messages {
    gap: 12px;
    padding: 14px;
  }

  .message {
    max-width: 94%;
    padding: 13px 14px;
  }

  .quick-replies {
    gap: 7px;
    padding: 10px 14px;
  }

  .quick-replies button {
    min-height: 34px;
    font-size: 13px;
  }

  .chat-form {
    grid-template-columns: 1fr;
    padding: 12px 14px 14px;
  }

  .chat-form button {
    width: 100%;
  }
}
