.support-launcher, .support-dialog {
  --support-bottom: max(16px, env(safe-area-inset-bottom));
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
}
.support-launcher {
  bottom: var(--support-bottom);
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--on-action);
  background: var(--action);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  box-shadow: 0 8px 24px #101b3140;
  cursor: pointer;
}
:root[data-keyboard="open"] .support-launcher { visibility: hidden; }
body:has(.pwa-install) .support-launcher { display: none; }
.support-launcher svg, .support-head svg { width: 22px; height: 22px; flex: none; }
.support-dialog {
  inset: auto max(16px, env(safe-area-inset-right)) var(--support-bottom) auto;
  margin: 0;
  width: min(414px, calc(100% - 32px));
  max-height: min(690px, calc(100dvh - 32px));
  padding: 0;
  border: 1px solid var(--ui-border);
  background: var(--surface);
  color: var(--text);
}
.support-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.support-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--ui-tint); }
.support-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; }
.support-head h2 svg { color: var(--action); }
.support-content { display: grid; gap: 12px; overflow: auto; overscroll-behavior: contain; padding: 12px; min-height: 0; }
.support-content :is(h3,p,ol) { margin: 0; }
.support-content h3 { font-size: 1rem; }
.support-hint { color: var(--muted, var(--text-muted)); font-size: .875rem; }
.support-questions {
  display: grid; gap: 4px; max-block-size: min(49dvh, 400px);
  overflow: auto; overscroll-behavior: contain; padding: 3px;
}
.support-questions summary {
  display: list-item; align-content: center; cursor: pointer; padding: 8px 10px;
  color: var(--text); font-weight: 600; font-size: .875rem;
}
.support-questions details[open] summary { color: var(--action); background: var(--ui-tint); }
.support-questions details p { padding: 8px 12px 12px; font-size: .875rem; }
.support-dialog form, .support-dialog label { display: grid; gap: 8px; }
.support-dialog :is(input,textarea) {
  width: 100%; min-width: 0; padding: 8px; color: var(--text);
  background: var(--surface); font: inherit; border: 1px solid var(--ui-control-border);
}
.support-dialog textarea { resize: vertical; max-height: 144px; }
.support-dialog button { font: inherit; cursor: pointer; }
.support-button, .support-primary { padding: 8px 12px; color: var(--action); background: var(--surface); border: 1px solid var(--ui-border); }
.support-primary { color: var(--on-action); background: var(--action); font-weight: 700; }
.support-close { display: grid; place-items: center; width: 48px; padding: 0; }
.support-error { color: var(--error-text, #9a271d); }
.support-error:empty { display: none; }
.support-messages {
  display: grid; align-content: start; gap: 8px; padding: 8px; min-height: 100px; max-height: 260px;
  border: 1px solid var(--ui-border); border-radius: 12px; overflow: auto; list-style: none;
}
.support-messages li { justify-self: start; max-width: 90%; padding: 6px 10px; border-radius: 12px; background: var(--ui-tint); overflow-wrap: anywhere; }
.support-messages li[data-author="visitor"] { justify-self: end; border: 1px solid var(--ui-border); background: var(--surface); }
.support-messages strong { color: var(--action); font-size: .75rem; }
.support-messages li p { white-space: pre-wrap; }
.staff-support { display: grid; grid-template-columns: minmax(0,.7fr) minmax(0,1fr); gap: 16px; }
.staff-support .support-messages { max-height: 460px; }
.staff-support .support-messages li[data-author="visitor"] { justify-self: start; }
.staff-support .support-messages li[data-author="staff"] { justify-self: end; }
.payment-qr {
  display: block; box-sizing: border-box; inline-size: min(100%, 210px); block-size: auto;
  margin-inline: auto; border-radius: 8px; image-rendering: pixelated;
}
.staff-support .masir-nav-item[aria-current] { font-weight: 800; }
@media (max-width: 1023px) {
  body:has(.has-nav) .support-launcher { bottom: calc(var(--nav-clearance, 68px) + 12px); }
}
@media (max-width: 650px) {
  .staff-support { grid-template-columns: minmax(0,1fr); }
  .support-launcher { padding-inline: 12px; }
  body:has(.has-nav) .support-launcher {
    justify-content: center; inline-size: 48px; padding: 0;
  }
  body:has(.has-nav) .support-launcher span {
    position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
