/* GuestChatWidget — matches yasawa-holding GuestChatWidget + chat-position.ts
   Uses site CSS variables (--bg, --elev, --ink, --muted, --line, --deep, --deep-ink, --font-serif, --font-sans)
   so zero theme tokens are changed. */
[data-guest-chat] {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  left: auto;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  font-family: var(--font-sans, ui-sans-serif, system-ui, -apple-system, sans-serif);
}

@media (max-width: 1023px) {
  [data-guest-chat] {
    right: auto !important;
    left: max(1rem, env(safe-area-inset-left)) !important;
    bottom: calc(var(--guest-chat-bar-h, 0px) + max(1rem, env(safe-area-inset-bottom)));
    align-items: flex-start;
  }
}

[data-guest-chat] .gcw-panel {
  display: flex;
  flex-direction: column;
  max-height: min(70svh, 32rem);
  width: min(calc(100vw - 2rem), 22rem);
  overflow-y: auto;
  border: 1px solid var(--line, #e6e6e6);
  background: var(--elev, #f8f8f8);
  padding: 1rem;
  color: var(--ink, #4a452a);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.12), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  box-sizing: border-box;
}

[data-guest-chat] .gcw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

[data-guest-chat] .gcw-title {
  margin: 0;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 400;
  color: var(--ink, #4a452a);
}

[data-guest-chat] .gcw-close {
  display: inline-flex;
  min-height: 2.75rem;
  min-width: 2.75rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

[data-guest-chat] .gcw-sub {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted, #6b6758);
}

[data-guest-chat] .gcw-hi {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

[data-guest-chat] .gcw-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

[data-guest-chat] .gcw-list li {
  border: 1px solid var(--line, #e6e6e6);
  background: var(--bg, #ffffff);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

[data-guest-chat] .gcw-form {
  margin-top: 1rem;
}

[data-guest-chat] .gcw-label {
  display: block;
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink, #4a452a);
}

[data-guest-chat] .gcw-form .gcw-label:first-child {
  margin-top: 0;
}

[data-guest-chat] .gcw-input,
[data-guest-chat] .gcw-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.375rem;
  border: 1px solid var(--line, #e6e6e6);
  background: var(--bg, #ffffff);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink, #4a452a);
  border-radius: 0;
}

[data-guest-chat] .gcw-textarea {
  resize: vertical;
}

[data-guest-chat] .gcw-btn-primary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  border: 0;
  background: var(--deep, #4a452a);
  color: var(--deep-ink, #ffffff);
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

[data-guest-chat] .gcw-btn-outline {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  border: 1px solid var(--line, #e6e6e6);
  background: transparent;
  color: var(--ink, #4a452a);
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

[data-guest-chat] .gcw-btn-outline:disabled,
[data-guest-chat] .gcw-btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}

[data-guest-chat] .gcw-notice {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
}

[data-guest-chat] .gcw-launcher {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: var(--deep, #4a452a);
  color: var(--deep-ink, #ffffff);
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.14), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  cursor: pointer;
}
