:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111820;
  background: #eaf3f7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-image:
    linear-gradient(rgb(106 151 171 / 13%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(106 151 171 / 13%) 1px, transparent 1px);
  background-size: 54px 54px;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.chat-account-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid #c2d4dc;
  background: rgb(255 255 255 / 94%);
}

.chat-account-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.chat-account-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.chat-account-brand span {
  display: grid;
}

.chat-account-brand strong {
  font-size: 20px;
}

.chat-account-brand small {
  color: #667985;
}

.chat-account-home {
  border: 1px solid #9fb2bd;
  border-radius: 6px;
  padding: 10px 14px;
  background: #fff;
  color: #17242b;
  font-weight: 750;
  text-decoration: none;
}

.chat-account-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: #51707e;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-auth {
  display: grid;
  min-height: 620px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: clamp(32px, 7vw, 100px);
}

.chat-auth-copy h1 {
  max-width: 720px;
  margin: 0 0 18px;
  font-size: clamp(38px, 5.5vw, 72px);
  line-height: 1.02;
}

.chat-auth-copy p:last-child {
  max-width: 680px;
  color: #4f6672;
  font-size: 19px;
  line-height: 1.55;
}

.chat-auth-panel {
  padding: 26px;
  border: 1px solid #b8cad3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgb(26 57 72 / 14%);
}

.chat-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid #c2d2da;
  border-radius: 6px;
  background: #edf3f5;
}

.chat-auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4f626c;
  font-weight: 800;
  cursor: pointer;
}

.chat-auth-tabs button.is-active {
  background: #fff;
  color: #111820;
  box-shadow: 0 1px 4px rgb(31 52 62 / 12%);
}

.chat-auth-form {
  display: grid;
  gap: 15px;
}

.chat-auth-form h2,
.chat-auth-form p {
  margin: 0;
}

.chat-auth-form label {
  display: grid;
  gap: 6px;
  color: #314650;
  font-size: 14px;
  font-weight: 750;
}

.chat-auth-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 48px;
  border: 1px solid #96abb6;
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: #111820;
}

.chat-auth-form label small {
  color: #697d87;
  font-weight: 500;
}

.chat-auth-form > button[type="submit"] {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: #007f8c;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.chat-auth-consent {
  display: flex !important;
  align-items: flex-start;
  gap: 8px !important;
  font-weight: 500 !important;
  line-height: 1.4;
}

.chat-auth-consent input {
  margin-top: 3px;
}

.chat-auth-consent a,
.link-button {
  color: #0a727d;
}

.link-button {
  justify-self: start;
  border: 0;
  padding: 2px 0;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
}

.chat-auth-message {
  min-height: 20px;
  margin: 16px 0 0;
  color: #9b2626;
  line-height: 1.4;
}

.chat-auth-message.is-success {
  color: #1f6c43;
}

.chat-cabinet {
  display: grid;
  min-height: calc(100vh - 170px);
  overflow: hidden;
  grid-template-columns: 340px minmax(0, 1fr);
  border: 1px solid #afc2cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgb(26 57 72 / 14%);
}

.chat-list-panel {
  min-width: 0;
  border-right: 1px solid #c8d7de;
  background: #f5f8fa;
}

.chat-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
}

.chat-list-head h1 {
  margin: 0;
  font-size: 30px;
}

.chat-new-button,
.chat-thread-paused button,
.chat-thread-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: #007f8c;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.chat-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 20px;
  border-block: 1px solid #d2dee4;
  color: #526672;
  font-size: 13px;
}

.chat-user-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-row button {
  border: 0;
  background: transparent;
  color: #526672;
  cursor: pointer;
  text-decoration: underline;
}

.chat-list {
  display: grid;
  max-height: calc(100vh - 285px);
  overflow: auto;
}

.chat-list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #d3dfe5;
  padding: 15px 20px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-list-item.is-active {
  background: #dff0f3;
  box-shadow: inset 4px 0 #007f8c;
}

.chat-list-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-item span {
  color: #687b85;
  font-size: 12px;
}

.chat-thread-panel {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(240px, 1fr) auto auto auto;
}

.chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #c8d7de;
  background: #e8f3f7;
}

.chat-thread-head > div {
  display: grid;
  gap: 3px;
}

.chat-thread-head strong {
  font-size: 20px;
}

.chat-thread-head span {
  color: #637985;
  font-size: 13px;
}

.chat-list-toggle {
  display: none;
}

.chat-thread-messages {
  display: flex;
  overflow: auto;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: #fff;
}

.thread-message {
  display: grid;
  max-width: 78%;
  gap: 5px;
}

.thread-message.is-visitor {
  align-self: end;
  justify-items: end;
}

.thread-message.is-arkhip {
  align-self: start;
  justify-items: start;
}

.thread-bubble,
.thread-welcome {
  margin: 0;
  border: 1px solid #c5d2d8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f4f7f8;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.thread-message.is-visitor .thread-bubble {
  border-color: #167f88;
  background: #dff3f4;
}

.thread-message time {
  color: #6a7b85;
  font-size: 11px;
}

.thread-files {
  display: grid;
  gap: 5px;
}

.thread-files a {
  border: 1px solid #b9c8cf;
  border-radius: 6px;
  padding: 8px 10px;
  color: #126f79;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.chat-thread-paused {
  display: grid;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #c8d7de;
}

.chat-thread-paused p {
  margin: 0;
  color: #526672;
}

.chat-thread-form {
  display: grid;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid #c8d7de;
}

.chat-thread-form textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid #9fb2bd;
  border-radius: 6px;
  padding: 10px 12px;
}

.chat-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.chat-thread-files {
  color: #667985;
  font-size: 12px;
}

.chat-thread-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
}

.chat-file-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid #9fb2bd;
  border-radius: 6px;
  padding: 8px 12px;
  background: #f8fafb;
  font-weight: 750;
  cursor: pointer;
}

.chat-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.chat-thread-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #586c77;
  font-size: 12px;
  line-height: 1.4;
}

.chat-thread-consent input {
  margin-top: 2px;
}

.chat-thread-consent a {
  color: #126f79;
}

.chat-thread-footer {
  display: flex;
  justify-content: flex-end;
  padding: 11px 22px 16px;
}

.chat-thread-footer button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 1px solid #8599a4;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.chat-thread-error {
  position: absolute;
  right: 18px;
  bottom: 78px;
  max-width: calc(100% - 36px);
  margin: 0;
  border: 1px solid #e0b5b5;
  border-radius: 6px;
  padding: 9px 12px;
  background: #fff0f0;
  color: #8d2020;
  font-size: 13px;
}

@media (max-width: 780px) {
  .chat-account-main {
    width: 100%;
    padding: 0;
  }

  .chat-auth {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 16px;
  }

  .chat-auth-copy h1 {
    font-size: 42px;
  }

  .chat-auth-panel {
    padding: 20px;
  }

  .chat-cabinet {
    min-height: calc(100vh - 74px);
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .chat-list-panel {
    display: none;
    position: absolute;
    inset: 74px 0 0;
    z-index: 10;
    border-right: 0;
  }

  .chat-cabinet.show-list .chat-list-panel {
    display: block;
  }

  .chat-list-toggle {
    display: block;
    border: 1px solid #8fa5b0;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    font-weight: 750;
  }

  .chat-thread-panel {
    min-height: calc(100vh - 74px);
  }

  .chat-thread-messages,
  .chat-thread-head,
  .chat-thread-form,
  .chat-thread-footer {
    padding-inline: 14px;
  }

  .thread-message {
    max-width: 88%;
  }
}
