.support-entry-button {
  min-width: 7rem;
}

.support-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: flex-end;
}

.support-dialog {
  box-sizing: border-box;
  width: min(46rem, calc(100vw - 2rem));
  height: min(52rem, calc(100dvh - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border, #cfdadd);
  border-radius: 1rem;
  background: var(--surface, #fff);
  color: var(--text, #21343c);
  box-shadow: 0 1.5rem 4rem rgb(9 30 43 / 24%);
}

@supports not (height: 100dvh) {
  .support-dialog {
    height: min(52rem, calc(100vh - 2rem));
    max-height: calc(100vh - 2rem);
  }
}

.support-dialog::backdrop {
  background: rgb(8 22 31 / 62%);
  backdrop-filter: blur(3px);
}

.support-dialog-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.support-dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border, #d8e1e5);
  background: var(--surface-muted, #eef4f6);
}

.support-dialog-toolbar strong {
  font-size: 1rem;
}

.support-dialog-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.25rem;
}

.support-dialog-body h2 {
  margin: .2rem 0 .65rem;
}

.support-transcript {
  min-height: 0;
  margin: .65rem 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .75rem;
  border: 1px solid var(--border, #d8e1e5);
  border-radius: .8rem;
  background: var(--surface-muted, #f4f7f8);
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

.support-transcript-empty {
  margin: .5rem;
  color: var(--muted, #65757c);
  text-align: center;
}

.support-transcript-messages {
  display: grid;
  gap: .75rem;
}

.support-message {
  width: min(88%, 34rem);
  padding: .75rem .9rem;
  border: 1px solid var(--border, #d8e1e5);
  border-radius: .85rem;
  background: #fff;
}

.support-message-customer {
  justify-self: end;
  border-bottom-right-radius: .25rem;
  background: #edf3ff;
}

.support-message-staff {
  justify-self: start;
  border-bottom-left-radius: .25rem;
  background: #fff;
}

.support-message header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted, #65757c);
  font-size: .8rem;
}

.support-message p {
  margin: .45rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-message small {
  display: block;
  margin-top: .4rem;
  color: var(--muted, #65757c);
}

.support-message small[data-state='failed'] {
  color: var(--danger, #a52f35);
}

.support-context-note {
  margin: 0;
  color: var(--muted, #65757c);
  font-size: .8rem;
  line-height: 1.3;
}

.support-form {
  display: grid;
  gap: .45rem;
  margin-top: 0;
}

.support-form label {
  margin-bottom: 0;
}

.support-form textarea {
  min-height: 2.75rem;
  max-height: 5.5rem;
  overflow-y: hidden;
  padding: .65rem .8rem;
  line-height: 1.35;
  resize: none;
  scrollbar-width: none;
}

.support-form textarea::-webkit-scrollbar {
  display: none;
}

.support-form .field-help {
  display: block;
  margin-top: .2rem;
  line-height: 1.3;
}

.support-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
}

#supportStatus {
  margin: .75rem 0 0;
}

#supportStatus[data-state='error'] {
  color: var(--danger, #a52f35);
}

#supportStatus[data-state='ok'] {
  color: var(--success, #216c4b);
}

@media (max-height: 720px) {
  .support-dialog {
    height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .support-dialog-toolbar {
    padding: .75rem 1rem;
  }

  .support-dialog-body {
    padding: .85rem 1rem;
  }

  .support-dialog-body > .section-kicker {
    display: none;
  }

  .support-dialog-body h2 {
    margin-top: 0;
    font-size: 1.2rem;
  }

  .support-dialog-body > h2 + p {
    margin: 0 0 .35rem;
    font-size: .9rem;
  }

  .support-transcript {
    margin: .65rem 0;
  }

  .support-context-note {
    font-size: .8rem;
    line-height: 1.35;
  }
}

@media (max-width: 640px) {
  .support-banner-actions,
  .support-form-actions {
    width: 100%;
    justify-content: stretch;
  }

  .support-banner-actions > *,
  .support-form-actions > * {
    flex: 1;
  }

  .support-message {
    width: 94%;
  }
}


/* Build 115: clear support conversation without adding another scroll owner. */
.support-form-action-spacer { flex: 1; }
.support-clear-button {
  color: var(--danger, #a52f35);
  text-decoration: underline;
  text-underline-offset: .18em;
}
.support-clear-button:hover,
.support-clear-button:focus-visible {
  background: color-mix(in srgb, var(--danger, #a52f35) 10%, transparent);
}
@media (max-width: 640px) {
  .support-form-action-spacer { display: none; }
  .support-form-actions { flex-wrap: wrap; }
  .support-clear-button { flex-basis: 100%; }
}


/* Build 128: stable support-title help alignment. */
.support-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}
.support-title-row h2 {
  margin: .2rem 0 .65rem;
}
.support-title-row .support-help-link {
  flex: 0 0 auto;
  margin-bottom: .65rem;
}
.support-dialog-intro {
  margin-top: 0;
}
@media (max-width: 560px) {
  .support-title-row { align-items: flex-start; flex-direction: column; gap: .4rem; }
  .support-title-row h2,
  .support-title-row .support-help-link { margin-bottom: 0; }
}
