.support-launcher {
  position: fixed;
  z-index: 19;
  right: max(20px, calc((100vw - 520px) / 2 + 16px));
  bottom: calc(94px + env(safe-area-inset-bottom));
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 19px;
  background: linear-gradient(145deg, #849389 0%, #52645a 48%, #34483e 100%);
  box-shadow: 0 9px 26px rgb(52 72 62 / 30%);
  color: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.support-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgb(52 72 62 / 36%);
}

.support-launcher svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-page]:not([data-page="home"]) .support-launcher {
  display: none;
}

.support-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  box-shadow: none;
  font-family: inherit;
}

.support-dialog[open] {
  display: flex;
  flex-direction: column;
}

.support-dialog::backdrop {
  background: var(--color-background);
}

.support-dialog-header {
  display: flex;
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: calc(76px + env(safe-area-inset-top));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) max(20px, calc((100vw - 860px) / 2)) 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}

.support-dialog-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.support-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--color-primary-gradient);
  box-shadow: 0 5px 12px rgb(0 0 0 / 14%);
  color: white;
  font-size: 21px;
  font-weight: 700;
}

.support-dialog-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.support-dialog-header p {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.support-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text-secondary);
  font-size: 24px;
  line-height: 1;
}

.support-content {
  width: min(100%, 900px);
  min-height: 0;
  flex: 1 1 auto;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(18px, 4vw, 32px) calc(28px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.support-intro {
  margin: 0 0 18px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.support-form {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 17px;
  background: #fbfcfb;
}

.support-form label {
  margin-top: 5px;
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 650;
}

.support-form input,
.support-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 13px;
}

.support-form textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.5;
}

.support-form input:focus,
.support-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.support-primary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--color-primary-gradient);
  box-shadow: 0 6px 15px rgb(0 0 0 / 14%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.support-primary:disabled {
  cursor: wait;
  opacity: .65;
}

.support-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.support-section-heading h3,
.support-detail-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.support-section-heading > span {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 99px;
  background: #f0f1ef;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.support-ticket-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.support-ticket-row {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: #fff;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
}

.support-ticket-row:hover {
  border-color: #c5d1c7;
  background: #f4f7f4;
}

.support-ticket-row-top,
.support-detail-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.support-ticket-row-top strong,
.support-ticket-number {
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .35px;
}

.support-ticket-subject {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-ticket-date,
.support-detail-heading > p {
  color: var(--color-text-secondary);
  font-size: 11px;
}

.support-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.support-status-pending {
  background: #fff7e8;
  color: #9a6200;
}

.support-status-waiting_for_customer {
  background: #edf5ef;
  color: #24714a;
}

.support-status-closed {
  background: #fff1f0;
  color: #b42318;
}

.support-empty,
.support-loading,
.support-closed-note,
.support-wait-note {
  margin: 14px 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.support-error,
.support-notice {
  margin: 0 0 13px;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.5;
}

.support-error {
  background: #fff2f0;
  color: #b42318;
}

.support-notice {
  background: #ecfdf3;
  color: #027a48;
}

.support-signin {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: #fbfcfb;
}

.support-signin p {
  margin: 0 0 12px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.support-back {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.support-detail-heading {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: #fbfcfb;
}

.support-detail-heading > div {
  justify-content: flex-start;
}

.support-detail-heading > p {
  margin: 0;
}

.support-thread {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.support-message {
  max-width: 92%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: #fff;
}

.support-message-admin {
  justify-self: start;
  background: #fff;
}

.support-message-customer {
  justify-self: end;
  border-color: #dce7de;
  background: #edf4ee;
}

.support-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.support-message p {
  margin: 8px 0 0;
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.support-reply-form {
  margin-top: 15px;
}

.support-welcome {
  margin-bottom: 22px;
}

.support-eyebrow {
  display: block;
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.2px;
}

.support-welcome h3,
.support-list-heading h3,
.support-create-heading h3 {
  margin: 8px 0 6px;
  font-size: clamp(23px, 4vw, 30px);
  font-weight: 650;
  letter-spacing: -.7px;
}

.support-welcome > p,
.support-list-heading > p,
.support-create-heading > p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.support-search {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 0 13px;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: #f9faf9;
  color: var(--color-text-secondary);
}

.support-search > span {
  font-size: 23px;
  line-height: 1;
}

.support-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 13px;
}

.support-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.support-entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.support-entry-card {
  display: grid;
  min-width: 0;
  min-height: 82px;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.support-entry-card:hover,
.support-topic-card:hover {
  transform: translateY(-1px);
  border-color: #c5ccc5;
  box-shadow: 0 8px 20px rgb(16 24 40 / 6%);
}

.support-entry-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #f2f4f1, #e9ede9);
}

.support-entry-icon,
.support-topic-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #849389 0%, #52645a 48%, #34483e 100%);
  color: white;
  font-size: 22px;
  font-weight: 500;
}

.support-entry-icon-soft {
  background: #f0f2ef;
  color: #52645a;
}

.support-entry-card > span:nth-child(2),
.support-topic-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.support-entry-card strong,
.support-topic-card strong {
  font-size: 13px;
  font-weight: 650;
}

.support-entry-card small,
.support-topic-card small {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.support-entry-arrow {
  justify-self: end;
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
}

.support-topics {
  margin-top: 30px;
}

.support-section-heading {
  margin-bottom: 13px;
}

.support-section-heading h3 {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.25px;
}

.support-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.support-topic-card {
  display: grid;
  min-width: 0;
  min-height: 74px;
  grid-template-columns: 42px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.support-topic-card .support-topic-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f0f2ef;
  color: #52645a;
  font-size: 19px;
}

.support-security-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 21px 0 0;
  padding: 13px 14px;
  border: 1px solid #e9ede9;
  border-radius: 13px;
  background: #f8faf8;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

.support-security-note span {
  color: #52645a;
  font-size: 17px;
}

.support-topic-heading {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: linear-gradient(135deg, #f7f8f6, #fff);
}

.support-topic-heading .support-topic-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 25px;
}

.support-topic-heading h3 {
  margin: 0;
  font-size: clamp(21px, 4vw, 26px);
  font-weight: 650;
  letter-spacing: -.5px;
}

.support-topic-heading > p,
.support-topic-footer > p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.support-steps {
  margin-top: 24px;
}

.support-steps h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
}

.support-steps ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: support-step;
}

.support-steps li {
  display: grid;
  min-height: 52px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: #fff;
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.55;
  counter-increment: support-step;
}

.support-steps li::before {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  background: #edf0ed;
  color: #52645a;
  content: counter(support-step);
  font-size: 11px;
  font-weight: 700;
}

.support-topic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 18px;
  border-radius: 16px;
  background: #f7f8f6;
}

.support-topic-footer > p {
  max-width: 420px;
}

.support-topic-footer .support-primary,
.support-empty-card .support-primary {
  flex: 0 0 auto;
  gap: 9px;
}

.support-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 17px;
}

.support-back:first-letter {
  font-size: 19px;
}

.support-list-heading,
.support-create-heading {
  margin-bottom: 21px;
}

.support-refresh {
  margin: -6px 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.support-list-heading h3,
.support-create-heading h3 {
  font-size: clamp(22px, 4vw, 28px);
}

.support-field-hint {
  margin-top: -5px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.support-empty-card {
  display: grid;
  justify-items: center;
  padding: 36px 22px;
  border: 1px dashed #d9ded9;
  border-radius: 18px;
  background: #fbfcfb;
  text-align: center;
}

.support-empty-card > span {
  color: #7a897e;
  font-size: 30px;
}

.support-empty-card h3 {
  margin: 10px 0 5px;
  font-size: 16px;
}

.support-empty-card p {
  max-width: 330px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .support-launcher {
    right: 18px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: 50px;
    height: 50px;
    border-radius: 17px;
  }

  .support-dialog {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  .support-dialog-header {
    min-height: calc(68px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }

  .support-content {
    width: 100%;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  }

  .support-form {
    padding: 13px;
  }

  .support-entry-actions,
  .support-topic-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .support-entry-card {
    min-height: 72px;
  }

  .support-topics {
    margin-top: 25px;
  }

  .support-topic-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
    padding: 15px;
  }

  .support-topic-footer .support-primary,
  .support-empty-card .support-primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-launcher {
    transition: none;
  }
}

.support-dialog.support-chat-open .support-dialog-header {
  justify-content: flex-start;
  padding-left: max(16px, env(safe-area-inset-left));
}

.support-dialog.support-chat-open {
  top: var(--support-visual-top, 0px);
  height: var(--support-visual-height, 100dvh);
  max-height: var(--support-visual-height, 100dvh);
}

.support-dialog.support-chat-open .support-brand-mark {
  display: none;
}

.support-dialog.support-chat-open .support-close {
  order: -1;
  margin-right: 0;
}

.support-dialog.support-chat-open .support-dialog-header h2 {
  font-size: 15px;
}

.support-dialog.support-chat-open .support-content {
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 0;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

.support-chat-open .support-detail-heading {
  flex: 0 0 auto;
  gap: 5px;
  padding: 12px max(16px, calc((100vw - 760px) / 2));
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
}

.support-chat-open .support-detail-heading > div {
  gap: 10px;
}

.support-chat-open .support-detail-heading h3 {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-open .support-thread {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  margin: 0;
  padding: 16px max(16px, calc((100vw - 760px) / 2));
  overflow-x: hidden;
  overflow-y: auto;
  background: #f6f7f5;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.support-chat-open .support-message {
  max-width: min(88%, 560px);
}

.support-chat-open #support-live-error,
.support-chat-open .support-notice {
  flex: 0 0 auto;
  margin: 8px 16px 0;
}

.support-chat-composer {
  z-index: 1;
  flex: 0 0 auto;
  padding: 10px max(14px, calc((100vw - 760px) / 2)) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
}

.support-chat-reply-form {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 9px;
}

.support-chat-reply-form textarea {
  width: 0;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  max-height: 116px;
  padding: 12px 15px;
  border-radius: 23px;
  font-size: 16px !important;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.support-chat-reply-form textarea:focus {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.support-chat-send {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #718679 0%, #526b5a 100%);
  box-shadow: 0 4px 12px rgb(0 0 0 / 14%);
  color: #fff;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.support-chat-send:disabled {
  cursor: wait;
  opacity: .65;
}

.support-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.support-chat-composer .support-closed-note {
  margin: 0;
  padding: 10px 0;
  text-align: center;
}

@media (max-width: 600px) {
  .support-dialog.support-chat-open .support-dialog-header {
    min-height: calc(58px + env(safe-area-inset-top));
    padding: calc(6px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-left)) 6px;
  }

  .support-dialog.support-chat-open .support-close {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    margin-right: 8px;
  }

  .support-chat-open .support-detail-heading {
    padding: 10px max(14px, env(safe-area-inset-left));
  }

  .support-chat-open .support-thread {
    padding: 12px max(12px, env(safe-area-inset-left));
  }

  .support-chat-open .support-message {
    max-width: 90%;
  }

  .support-chat-composer {
    padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
  }

  .support-chat-reply-form {
    gap: 6px;
  }

  .support-chat-send {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}
