/* Reuse the font files and palette from Eventmate's ticket and attendee pages. */
@font-face { font-family: "Eventmate Inter"; src: url("/ticket-assets/Inter-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Eventmate Inter"; src: url("/ticket-assets/Inter-Medium.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Eventmate Inter"; src: url("/ticket-assets/Inter-SemiBold.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Eventmate Inter"; src: url("/ticket-assets/Inter-Bold.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
.em-chat-overlay[hidden], .em-chat [hidden] { display: none !important; }
body.em-chat-open { overflow: hidden; }
.em-chat-overlay { position: fixed; inset: 0; z-index: 11000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(23, 23, 23, .24); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.em-chat {
  --em-ink: #252526; --em-muted: #717174; --em-purple: #6125e1; --em-purple-hover: #4b18bd;
  --em-line: #e9e9eb; --em-surface: #f8f8f9; --em-reply: #f2f2f4;
  color-scheme: light; color: var(--em-ink); background: #fff;
  width: min(490px, 100%); height: min(740px, calc(100dvh - 48px)); display: flex; flex-direction: column;
  border: 1px solid var(--em-line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .1), 0 2px 8px rgba(0, 0, 0, .04);
  font: 400 15px/1.5 "Eventmate Inter", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
.em-chat *, .em-chat *::before, .em-chat *::after { box-sizing: border-box; }
.em-chat :is(h2, h3, summary) { font-family: inherit; }
.em-chat :is(button, a, textarea) { font: inherit; letter-spacing: inherit; margin: 0; }
.em-chat :is(button, a) { cursor: pointer; touch-action: manipulation; }
.em-chat button {
  appearance: none; min-height: 44px; border: 1px solid var(--em-line); border-radius: 10px; padding: 10px 12px;
  background: #fff; color: var(--em-ink); font-size: 14px; font-weight: 500; line-height: 1.4; white-space: normal; text-align: left;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.em-chat button:hover:not(:disabled) { background: var(--em-surface); border-color: #d8d8dc; }
.em-chat button:active:not(:disabled) { background: var(--em-reply); }
.em-chat button:disabled { opacity: .45; cursor: default; }
.em-chat :focus-visible { outline: 2px solid #77777d; outline-offset: 2px; }
.em-chat .em-chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.em-chat-header { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--em-line); }
.em-chat-header > div { min-width: 0; flex: 1; }
.em-chat-header h2 { margin: 0; font-size: 14px; line-height: 1.45; font-weight: 500; color: var(--em-ink); }
.em-chat-header p { margin: 3px 0 0; font-size: 12px; font-weight: 400; line-height: 1.4; color: var(--em-muted); overflow-wrap: anywhere; }
.em-chat-avatar { display: block; width: 24px; height: 24px; flex: 0 0 24px; object-fit: contain; }
.em-chat-header .em-chat-close { display: grid; place-items: center; width: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--em-muted); }
.em-chat :is(.em-chat-close, .em-chat-photo) svg { display: block; flex: none; }
.em-chat-body { position: relative; flex: 1; min-height: 0; }
.em-chat-messages { height: 100%; padding: 20px; overflow: auto; overscroll-behavior: contain; scroll-behavior: auto; overflow-anchor: none; }
.em-chat-thread { display: flex; flex-direction: column; gap: 16px; }
.em-chat-thread > * { flex-shrink: 0; }
.em-chat-status { padding: 0 4px; font-size: 13px; color: var(--em-muted); overflow-wrap: anywhere; }
.em-chat-status button, .em-chat-feedback button { display: block; margin-top: 8px; }
.em-chat-message { align-self: flex-start; max-width: 94%; min-width: 0; margin: 0; padding: 5px 0; overflow-wrap: anywhere; }
.em-chat-message p { white-space: pre-wrap; margin: 0; font-size: 15px; line-height: 1.55; }
.em-chat-intro p { font-size: 13px; color: var(--em-muted); line-height: 1.6; }
.em-chat-question > p:not(.em-chat-question-progress) { font-weight: 500; }
.em-chat-message .em-chat-question-progress { margin: 0 0 5px; font-size: 11px; font-weight: 400; color: var(--em-muted); }
.em-chat-message a { color: #7656ad; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.em-chat-message img { display: block; max-width: 100%; max-height: 330px; margin-top: 10px; border-radius: 8px; object-fit: contain; }
.em-chat-own { align-self: flex-end; max-width: 86%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--em-reply); }
.em-chat-attachment { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; vertical-align: middle; font-size: 13px; font-weight: 500; line-height: 1.5; }
.em-chat-attachment-icon { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 7px; background: #e7e7eb; color: #646469; }
.em-chat-message .em-chat-attachment + p { margin-top: 6px; font-size: 14px; }
.em-chat-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.em-chat-actions:empty { display: none; }
.em-chat-actions a { display: block; padding: 10px 12px; border: 1px solid var(--em-line); border-radius: 10px; }
.em-chat-card, .em-chat-review { align-self: stretch; max-width: 100%; border: 0; }
.em-chat-review { padding: 8px 0; border-radius: 0; background: transparent; }
.em-chat-review-body > p:first-child { font-size: 14px; }
.em-chat-card { margin-top: 4px; padding: 16px; border-radius: 12px; background: var(--em-surface); }
.em-chat-card.em-chat-outcome { padding: 14px; border: 1px solid var(--em-line); background: #fff; }
.em-chat-card.em-chat-success { border-color: transparent; background: #f7faf8; }
.em-chat-outcome .em-chat-card-heading { gap: 10px; }
.em-chat-card.em-chat-outcome h3 { font-size: 15px; margin: 2px 0 0; }
.em-chat-outcome .em-chat-card-icon { width: 28px; height: 28px; flex-basis: 28px; }
.em-chat-outcome .em-chat-card-actions { margin-top: 14px; }
.em-chat-card-heading { display: flex; align-items: flex-start; gap: 11px; }
.em-chat-card-heading > div { min-width: 0; flex: 1; }
.em-chat-card-icon { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--em-reply); color: var(--em-muted); }
.em-chat-card-icon svg { display: block; width: 17px; height: 17px; }
.em-chat-card-icon[data-tone="success"] { color: #198754; background: #e4f3e9; }
.em-chat-card-icon[data-tone="attention"] { color: #94641a; background: #faf3e7; }
.em-chat-card h3 { margin: 3px 0 5px; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.025em; }
.em-chat-card .em-chat-card-event, .em-chat-card .em-chat-card-note { font-size: 13px; color: var(--em-muted); line-height: 1.55; }
.em-chat-card .em-chat-card-note { margin-top: 10px; }
.em-chat-card-heading .em-chat-card-note { margin-top: 5px; }
.em-chat-card .em-chat-amount { margin-top: 14px; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.em-chat-card [data-ticket-count] { margin-top: 4px; }
.em-chat-review-complete { border: 0; border-radius: 0; padding: 0; background: transparent; }
.em-chat-review-content > summary { width: fit-content; padding: 8px 0; color: var(--em-muted); font-size: 13px; line-height: 1.5; cursor: pointer; }
.em-chat-review-complete .em-chat-review-body { padding: 4px 0 8px; }
.em-chat-review-complete .em-chat-review-body p { font-size: 13px; color: var(--em-muted); }
.em-chat-order-details { margin-top: 8px; font-size: 13px; color: var(--em-muted); }
.em-chat-order-details summary { padding: 6px 0; cursor: pointer; }
.em-chat-order-details p { margin: 6px 0; font-size: 13px; }
.em-chat-card-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.em-chat-card-actions > .em-chat-primary { width: 100%; align-self: stretch; }
.em-chat-card-secondary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; margin-top: 4px; }
.em-chat-card-secondary > .em-chat-order-details { flex: 1 1 auto; min-width: 0; margin: 0; }
.em-chat-card-secondary > .em-chat-order-details[open] { flex-basis: 100%; }
.em-chat-card-secondary summary { width: fit-content; min-height: 36px; padding: 8px 0; font-size: 12px; line-height: 20px; }
.em-chat-card-secondary summary::marker { font-size: 10px; }
.em-chat-card-secondary .em-chat-actions { display: contents; }
.em-chat .em-chat-card-secondary .em-chat-secondary { min-height: 36px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; font-size: 12px; line-height: 20px; text-align: left; }
.em-chat .em-chat-card-secondary :is(summary, .em-chat-secondary):hover:not(:disabled) { color: var(--em-ink); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.em-chat-followup { align-self: stretch; max-width: 100%; margin-top: -8px; padding: 0; }
.em-chat .em-chat-followup .em-chat-secondary { display: block; width: fit-content; min-height: 44px; margin: 0 auto; padding: 8px 12px; border: 0; background: transparent; font-size: 13px; line-height: 20px; }
.em-chat .em-chat-followup .em-chat-secondary:hover:not(:disabled) { color: var(--em-ink); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.em-chat-card-actions:empty, .em-chat-card-secondary:empty, .em-chat-card-secondary:has(> .em-chat-actions:only-child:empty), .em-chat-feedback:empty { display: none; }
.em-chat .em-chat-primary {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px;
  border: 1px solid transparent; border-radius: 10px; background: var(--em-purple); color: #fff;
  font-size: 14px; font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none;
}
.em-chat .em-chat-secondary { text-align: center; color: var(--em-muted); border-color: transparent; background: transparent; font-weight: 400; text-decoration: none; }
.em-chat-feedback { margin-top: 12px; font-size: 13px; color: var(--em-muted); }
.em-chat-pending { opacity: .8; }
.em-chat-pending small { display: block; margin-top: 6px; font-size: 12px; color: var(--em-muted); }
.em-chat-pending button { display: block; margin-top: 8px; font-size: 13px; }
.em-chat-typing { align-self: flex-start; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--em-reply); }
.em-chat-typing-dots { display: flex; gap: 4px; align-items: center; height: 10px; }
.em-chat-typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--em-muted); animation: em-chat-typing 1s ease-in-out infinite; }
.em-chat-typing-dots i:nth-child(2) { animation-delay: .12s; }
.em-chat-typing-dots i:nth-child(3) { animation-delay: .24s; }
@keyframes em-chat-typing { 0%, 65%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .em-chat-typing-dots i { animation: none; } }
.em-chat-form { flex-shrink: 0; margin: 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--em-line); }
.em-chat-compose { display: flex; align-items: flex-end; gap: 4px; padding: 5px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: 14px; }
.em-chat-compose:focus-within { border-color: #a3a3a9; box-shadow: 0 0 0 1px rgba(37, 37, 38, .08); }
.em-chat-compose textarea {
  display: block; flex: 1; min-width: 0; resize: none; max-height: 110px; min-height: 44px; padding: 10px 8px; border: 0; border-radius: 8px;
  font-size: 16px; font-weight: 400; line-height: 1.5; background: transparent; color: var(--em-ink);
}
.em-chat-compose textarea::placeholder { color: #85838a; opacity: 1; }
.em-chat-compose textarea:focus, .em-chat-compose textarea:focus-visible { outline: none; box-shadow: none; }
.em-chat-compose .em-chat-photo { display: grid; place-items: center; width: 44px; flex: 0 0 44px; padding: 0; border-color: transparent; background: transparent; color: var(--em-muted); }
.em-chat-compose .em-chat-send { flex: none; background: var(--em-purple); color: #fff; border-color: transparent; text-align: center; }
.em-chat .em-chat-primary:disabled, .em-chat-compose .em-chat-send:disabled { background: var(--em-reply); color: var(--em-muted); opacity: 1; }
/* Explicit primary states prevent generic hover styles from washing out white labels. */
.em-chat .em-chat-send:hover:not(:disabled), .em-chat .em-chat-primary:hover:not(:disabled) { background: var(--em-purple-hover); color: #fff; border-color: transparent; }
.em-chat .em-chat-send:active:not(:disabled), .em-chat .em-chat-primary:active:not(:disabled) { background: #3b1199; color: #fff; border-color: transparent; }
.em-chat-preview { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.em-chat-preview img { height: 64px; width: 64px; object-fit: cover; border-radius: 8px; }
.em-chat .em-chat-new { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 14px; white-space: nowrap; box-shadow: 0 3px 16px rgba(38, 30, 58, .1); }
@media (max-width: 600px) {
  .em-chat-overlay { padding: 0; }
  .em-chat { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .em-chat-header { padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
  .em-chat-card { padding: 14px; }
  .em-chat-review { padding: 6px 0; }
  .em-chat-review-complete { padding: 0; }
  .em-chat-messages { padding: 16px; }
  .em-chat-form { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) { .em-chat :is(button, a) { transition: none; } }

.em-chat-ticket-options { display: grid; gap: 0; margin-top: 12px; }
.em-chat-ticket-option { min-width: 0; padding: 16px 0; border: 0; border-radius: 0; }
.em-chat-ticket-option + .em-chat-ticket-option { border-top: 1px solid var(--em-line); }
.em-chat-selection .em-chat-ticket-option { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: start; }
.em-chat-ticket-copy { min-width: 0; }
.em-chat-ticket-copy h4 { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; }
.em-chat-ticket-copy .em-chat-ticket-price { margin-top: 7px; font-size: 14px; }
.em-chat-counter { display: flex; align-items: center; background: var(--em-surface); border-radius: 9px; margin-top: -4px; }
.em-chat-counter button { display: grid; place-items: center; width: 36px; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 19px; font-weight: 400; }
.em-chat-counter output { min-width: 21px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.em-chat-ticket-unavailable .em-chat-ticket-copy { color: var(--em-muted); }
.em-chat-ticket-unavailable .em-chat-counter { background: transparent; }
.em-chat-selection-footer { flex-shrink: 0; border-top: 1px solid var(--em-line); padding: 12px 20px max(14px,env(safe-area-inset-bottom)); background: #fff; }
.em-chat-selection-footer > .em-chat-primary { width: 100%; }
.em-chat .em-chat-selection-footer > .em-chat-secondary { display: block; width: fit-content; min-height: 44px; margin: 4px auto -6px; padding: 8px 12px; border: 0; background: transparent; font-size: 13px; line-height: 20px; }
.em-chat .em-chat-selection-footer > .em-chat-secondary:hover:not(:disabled) { color: var(--em-ink); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.em-chat-selection-footer summary { width: fit-content; padding: 4px 0 10px; font-size: 12px; color: var(--em-muted); cursor: pointer; }
.em-chat-selection-breakdown { max-height: 28dvh; overflow: auto; padding-bottom: 12px; }
.em-chat-selection-breakdown .em-chat-receipt { margin-top: 0; }
.em-chat-selection-breakdown .em-chat-totals { margin-top: 0; }
.em-chat-selection-error { margin: 0 0 8px; font-size: 12px; color: #9a4828; }
@media (max-width: 600px) { .em-chat-selection-footer { padding-left: 16px; padding-right: 16px; } }
.em-chat-receipt { margin-top: 14px; }
.em-chat-ticket-option .em-chat-receipt { margin-top: 0; }
.em-chat-ticket-line + .em-chat-ticket-line { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--em-line); }
.em-chat-ticket-line h4 { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; }
.em-chat-message .em-chat-ticket-description, .em-chat-message .em-chat-ticket-quantity { margin-top: 4px; font-size: 13px; color: var(--em-muted); line-height: 1.5; }
.em-chat-totals { display: grid; gap: 6px; margin: 14px 0 0; font-size: 13px; color: var(--em-muted); font-variant-numeric: tabular-nums; }
.em-chat-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.em-chat-totals dt { min-width: 0; overflow-wrap: anywhere; }
.em-chat-totals dd { margin: 0; flex-shrink: 0; text-align: right; }
.em-chat-totals .em-chat-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--em-line); color: var(--em-ink); font-weight: 600; font-size: 15px; }
.em-chat-totals .em-chat-amount { font-size: 17px; margin: 0; }
.em-chat-ticket-options + .em-chat-actions { margin-top: 14px; }

.em-chat-catalog-tools .em-chat-actions { margin-top: 0; gap: 0; }
.em-chat-catalog-tools .em-chat-secondary { padding: 8px 0; min-height: 44px; text-align: left; }
.em-chat-message .em-chat-ticket-quantity { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.em-chat-ticket-quantity > span:last-child { flex-shrink: 0; }
