html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: #f5f6fb;
}

.support-page {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background: #f5f6fb;
  color: #1f2430;
  font-family: Inter, Helvetica, Arial, sans-serif;
  padding: 16px 12px 92px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.support-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.support-back {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 24, 42, 0.08);
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.support-header-copy {
  min-width: 0;
  flex: 1 1 auto;
  padding-left: 6px;
}

.support-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.support-thread-meta,
.support-hint {
  font-size: 13px;
  line-height: 1.45;
  color: #768198;
}

.support-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.support-card {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  border: 1px solid #edf1f7;
  box-shadow: 0 10px 24px rgba(20, 24, 42, 0.05);
  min-width: 0;
}

.support-card-head,
.support-thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.support-card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.support-form,
.support-reply {
  display: grid;
  gap: 12px;
}

.support-form-grid,
.support-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.support-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.support-layout {
  grid-template-columns: 1fr;
}

.support-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.support-chat-wrap {
  display: grid;
  gap: 12px;
}

.support-chat-heading {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #111827;
}

.support-threads-collapsible {
  padding: 0;
  overflow: hidden;
}

.support-threads-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 20px;
  cursor: pointer;
  box-sizing: border-box;
}

.support-threads-toggle::-webkit-details-marker {
  display: none;
}

.support-threads-toggle__hint {
  color: #6f7890;
  font-size: 13px;
  font-weight: 700;
}

.support-threads-toggle .support-card-title {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.support-threads-panel {
  padding: 0 20px 20px;
  border-top: 1px solid #eef1f8;
}

.support-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}

.support-field input,
.support-field textarea,
.support-field select,
.support-reply textarea {
  width: 100%;
  border: 1px solid #d9deea;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.support-field input,
.support-dd__header {
  min-height: 56px;
}

.support-field input:focus,
.support-field textarea:focus,
.support-field select:focus,
.support-reply textarea:focus {
  outline: none;
  border-color: rgba(100, 82, 254, 0.45);
  box-shadow: 0 0 0 4px rgba(100, 82, 254, 0.08);
  background: #fff;
}

.support-field select[hidden] {
  display: none !important;
}

.support-dd {
  position: relative;
}

.support-dd__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0.7px solid #d9deea;
  border-radius: 14px;
  padding: 14px 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.support-dd__icons {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.support-dd__icons::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 12px;
  height: 7px;
  background: url('/register/img/chevron_down_figma.svg') no-repeat center center / contain;
  opacity: 0.9;
  transform: rotate(180deg);
  transition: transform 120ms ease;
}

.support-dd.is-open .support-dd__icons::before {
  transform: rotate(0deg);
}

.support-dd__header:focus,
.support-dd.is-open .support-dd__header {
  outline: none;
  border-color: rgba(100,83,248,.85);
  box-shadow: inset 0 0 0 2px rgba(100,83,248,.95);
}

.support-dd__text {
  min-width: 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #2A2A2A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-dd__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #FFFFFF;
  border: 1px solid #F2F4F7;
  border-radius: 8px;
  box-shadow: 0px 4px 6px -2px rgba(16,24,40,0.03),
              0px 12px 16px -4px rgba(16,24,40,0.08);
  padding: 0;
  margin: 0;
  list-style: none;
  display: none;
  z-index: 10;
  max-height: 220px;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.support-dd__menu::-webkit-scrollbar { width: 0; height: 0; }
.support-dd.is-open .support-dd__menu { display: block; }

.support-dd__item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #333333;
  user-select: none;
  position: relative;
  padding-right: 36px;
}

.support-dd__item:hover { background: #F8FAFF; }

.support-dd__item.selected {
  background: #EAF3FC;
  color: #6452FE;
}

.support-dd__item::after {
  content: "";
  width: 15px;
  height: 11px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: url('/register/img/check.svg') no-repeat center center / contain;
  opacity: 0;
}

.support-dd__item.selected::after { opacity: 1; }

.support-context-card {
  border: 1px solid #e4e8f3;
  border-radius: 16px;
  background: #f9fbff;
  min-height: 56px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
}

.support-context-label {
  font-size: 12px;
  font-weight: 800;
  color: #8a93a8;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.support-context-value {
  margin-top: 6px;
  color: #4f5970;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.support-actions {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.support-actions--hint {
  justify-content: flex-start;
  margin-top: -4px;
}

.support-upload {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.support-upload input[type="file"] {
  display: none;
}

.support-upload__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px dashed #d3daea;
  background: #fff;
  color: #5146ca;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}

.support-upload__button:disabled,
.support-primary--icon:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.support-upload__hint {
  color: #768198;
  font-size: 13px;
  line-height: 1.45;
}

.support-upload__hint--inline {
  display: none;
}

.support-upload--reply {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-upload--reply .support-upload__button {
  border-style: solid;
  background: #f4f1ff;
}

.support-upload__button--icon {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 14px;
  color: #6452fe;
}

.support-upload__hint--inline {
  font-size: 12px;
  font-weight: 700;
  color: #6a7288;
}

.support-reply__composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.support-primary,
.support-secondary {
  border: 0;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.support-primary {
  background: #6452fe;
  color: #fff;
  box-shadow: 0 12px 24px rgba(100, 82, 254, 0.2);
}

.support-primary--wide {
  width: 100%;
  min-width: 0;
  font-size: 15px;
}

.support-primary--icon {
  width: 48px;
  min-width: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.support-primary:disabled {
  opacity: 0.5;
  box-shadow: none;
}

.support-secondary {
  background: #eef0ff;
  color: #4d42c7;
}

.support-secondary--danger {
  background: linear-gradient(180deg, #ff6b6b 0%, #f04f4f 100%);
  color: #fff;
}

.support-thread-list,
.support-messages {
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.support-thread-list {
  display: grid;
  align-content: start;
}

.support-thread-item {
  display: block;
  width: 100%;
  border: 1px solid #e4e8f3;
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  min-width: 0;
}

.support-thread-item.active {
  border-color: #6452fe;
  box-shadow: 0 10px 24px rgba(100, 82, 254, 0.12);
}

.support-thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.support-thread-subject {
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.support-thread-subtitle {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #222938;
  overflow-wrap: anywhere;
}

.support-thread-chips,
.support-thread-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-thread-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.support-thread-head {
  align-items: flex-start;
  padding: 0 2px 12px;
  border-bottom: 1px solid #eef1f8;
  margin-bottom: 0;
}

.support-thread-info {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.support-thread-meta {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.support-thread-actions .support-secondary {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 13px;
  box-shadow: none;
}

.support-status--open {
  background: #eef2ff;
  color: #4f46e5;
}

.support-status--pending {
  background: #fff7d6;
  color: #a16207;
}

.support-status--resolved {
  background: #dcfce7;
  color: #15803d;
}

.support-status--closed,
.support-status--deleted {
  background: #fee2e2;
  color: #dc2626;
}

.support-thread-chips {
  margin-bottom: 8px;
}

.support-chip-sm,
.support-thread-badge {
  border-radius: 999px;
  background: #f3f4ff;
  color: #5146ca;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
}

.support-status {
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef0ff;
  color: #4d42c7;
  font-size: 11px;
  font-weight: 800;
}

.support-thread-preview {
  font-size: 13px;
  color: #5e667a;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.support-messages {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 14px;
  padding: 18px 18px 6px;
  background: #f7f8fc;
  border: 1px solid #e8edf5;
  border-radius: 24px;
  min-width: 0;
}

.support-reply {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e7ebf5;
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
}

.support-reply input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #e3e8f4;
  border-radius: 14px;
  background: #f5f7fb;
  font: inherit;
  color: #1f2430;
  box-sizing: border-box;
}

.support-reply input:focus {
  outline: none;
  border-color: rgba(100, 82, 254, 0.45);
  box-shadow: 0 0 0 4px rgba(100, 82, 254, 0.08);
  background: #fff;
}

.support-message-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(44%, 360px);
}

.support-message-wrap--user {
  align-self: flex-end;
  align-items: flex-end;
}

.support-message-wrap--agent {
  align-self: flex-start;
  align-items: flex-start;
}

.support-message-wrap--system {
  align-self: center;
  align-items: center;
  width: min(64%, 520px);
  max-width: min(64%, 520px);
}

.support-message {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  padding: 10px 12px 9px;
  border-radius: 22px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.support-message-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  margin-bottom: 4px;
  opacity: 0.72;
}

.support-message.support-message-user {
  align-items: flex-end;
  background: linear-gradient(180deg, #f1eeff 0%, #e7e1ff 100%);
  color: #2b2448;
  border: 1px solid rgba(135, 117, 255, 0.18);
  border-bottom-right-radius: 8px;
}

.support-message.support-message-user .support-message-title,
.support-message.support-message-user .support-message-delete,
.support-message.support-message-user .support-message-meta {
  color: rgba(43, 36, 72, 0.62);
}

.support-message.support-message-agent {
  background: #fff;
  color: #1f2430;
  border: 1px solid rgba(160, 171, 187, 0.18);
  border-bottom-left-radius: 8px;
}

.support-message.support-message-system {
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  background: #f8fafd;
  color: #4f5970;
  border: 1px solid #dbe2f0;
  box-shadow: none;
  border-radius: 12px;
}

.support-message-meta {
  font-size: 10px;
  opacity: 0.68;
  padding: 0 6px;
  line-height: 1.2;
  white-space: nowrap;
}

.support-message-wrap--user .support-message-meta {
  color: rgba(43, 36, 72, 0.62);
}

.support-message-wrap--agent .support-message-meta,
.support-message-wrap--system .support-message-meta {
  color: #7a8398;
}

.support-message-attachments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.support-message-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(100, 82, 254, 0.08);
  color: #2a2a2a;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.support-message-attachment span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.support-message-attachment:hover {
  background: rgba(100, 82, 254, 0.13);
}

.support-message-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.support-message:hover .support-message-actions {
  opacity: 1;
  pointer-events: auto;
}

.support-message-delete {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.support-empty {
  align-self: center;
  width: min(100%, 360px);
  padding: 18px 14px;
  text-align: center;
  color: #768198;
  font-size: 14px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  padding: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: #A0ABBB;
  font-family: "Inter", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  padding: 8px 0;
  transition: color 0.2s ease;
  cursor: pointer;
}

.nav-item.active {
  color: #6452fe;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
}

@media (max-width: 980px) {
  .support-page {
    padding: 16px 14px 88px;
  }

  .support-content {
    gap: 16px;
  }

  .support-form-grid {
    grid-template-columns: 1fr;
  }

  .support-actions,
  .support-thread-head {
    flex-direction: column;
    align-items: stretch;
  }

  .support-thread-badges {
    justify-content: flex-start;
  }

  .support-thread-actions {
    justify-content: flex-start;
  }

  .support-upload {
    width: 100%;
    flex: 1 1 auto;
  }

  .support-primary--wide {
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
  }
}

@media (max-width: 720px) {
  .support-page {
    padding: 12px 12px 82px;
  }

  .support-header {
    gap: 12px;
    margin-bottom: 12px;
  }

  .support-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: 0 0 40px;
  }

  .support-header-copy {
    padding-left: 10px;
  }

  .support-title {
    font-size: 22px;
  }

  .support-card {
    padding: 16px;
    border-radius: 18px;
  }

  .support-card-title,
  .support-chat-heading {
    font-size: 22px;
  }

  .support-field {
    gap: 5px;
    font-size: 12px;
  }

  .support-field input,
  .support-field textarea,
  .support-dd__header {
    min-height: 52px;
    padding: 12px 13px;
  }

  .support-dd__text,
  .support-dd__item {
    font-size: 15px;
    line-height: 1.35;
  }

  .support-context-card {
    min-height: 0;
    padding: 10px 12px;
  }

  .support-context-value {
    font-size: 12px;
    -webkit-line-clamp: 3;
  }

  .support-actions {
    gap: 10px;
  }

  .support-upload__hint {
    font-size: 12px;
    line-height: 1.35;
  }

  .support-threads-toggle {
    min-height: 60px;
    padding: 16px;
  }

  .support-threads-toggle__hint {
    font-size: 12px;
  }

  .support-threads-panel {
    padding: 0 16px 16px;
  }

  .support-card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .support-card-head .support-secondary {
    width: 100%;
  }

  .support-thread-item {
    padding: 12px;
    border-radius: 16px;
  }

  .support-thread-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .support-thread-subject {
    font-size: 13px;
    line-height: 1.35;
  }

  .support-thread-preview {
    font-size: 12px;
    line-height: 1.4;
  }

  .support-thread-head {
    gap: 10px;
    padding: 0 0 10px;
  }

  .support-thread-subtitle {
    margin-top: 0;
    font-size: 15px;
  }

  .support-thread-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .support-thread-actions .support-secondary {
    width: 100%;
  }

  .support-thread-badges {
    gap: 6px;
  }

  .support-thread-badge {
    font-size: 10px;
    padding: 5px 8px;
  }

  .support-messages {
    min-height: 280px;
    max-height: 48vh;
    margin-top: 12px;
    padding: 14px 12px 6px;
    border-radius: 18px;
    gap: 12px;
  }

  .support-message-wrap {
    max-width: 92%;
    gap: 4px;
  }

  .support-message {
    font-size: 12px;
    padding: 9px 11px 8px;
    border-radius: 18px;
  }

  .support-message.support-message-system,
  .support-message-wrap--system {
    width: 100%;
    max-width: 100%;
  }

  .support-message-title {
    font-size: 9px;
    margin-bottom: 3px;
  }

  .support-message-meta {
    font-size: 10px;
    padding: 0 4px;
  }

  .support-message-attachment {
    max-width: 100%;
    padding: 8px 10px;
    font-size: 11px;
  }

  .support-reply {
    margin-top: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .support-reply input {
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }

  .support-reply__composer {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .support-upload__button--icon,
  .support-primary--icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .bottom-nav {
    height: 64px;
  }

  .nav-item {
    font-size: 11px;
  }

  .support-upload__hint--inline {
    display: none;
  }
}

@media (max-width: 520px) {
  .support-page {
    padding: 10px 10px 80px;
  }

  .support-title,
  .support-chat-heading {
    font-size: 20px;
  }

  .support-thread-actions {
    grid-template-columns: 1fr;
  }

  .support-threads-toggle {
    padding: 14px 16px;
  }

  .support-threads-toggle__hint {
    font-size: 11px;
  }

  .support-messages {
    min-height: 250px;
    max-height: 46vh;
  }
}
