.gallery-chat {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 30;
  font-size: 15px;
  line-height: 1.5;
}
.gallery-chat button, .gallery-chat textarea { font: inherit; }
.gallery-chat button { cursor: pointer; }
.gallery-chat-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid var(--green-dark);
  border-radius: 30px;
  background: var(--green-dark);
  color: #fffaf0;
  box-shadow: 0 5px 20px rgb(47 41 35 / 20%);
}
.gallery-chat-toggle:hover, .gallery-chat-send:hover { background: #4c5c4d; }
.gallery-chat-panel {
  width: min(370px, calc(100vw - 40px));
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  box-shadow: 0 12px 40px rgb(47 41 35 / 22%);
}
.gallery-chat-panel[hidden] { display: none; }
.gallery-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 16px 20px 22px;
  background: var(--sage);
}
.gallery-chat-eyebrow { margin: 0 0 4px; font-size: 12px; }
.gallery-chat-header h2 { margin: 0; font-family: var(--display-font); font-size: 21px; font-weight: 500; line-height: 1.3; }
.gallery-chat-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 28px !important;
  line-height: 1;
}
.gallery-chat-close:hover { background: rgb(255 250 240 / 35%); }
.gallery-chat-body { padding: 20px 22px; }
.gallery-chat-body > p:first-child { margin: 0 0 18px; }
.gallery-chat label { display: block; margin-bottom: 7px; font-weight: 500; }
.gallery-chat textarea {
  display: block;
  width: 100%;
  min-height: 105px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  color: var(--ink);
  font-size: 16px;
}
.gallery-chat-help { margin: 10px 0 16px; font-size: 13px; color: #57564b; }
.gallery-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--green-dark);
  border-radius: 7px;
  background: var(--green-dark);
  color: #fffaf0;
}
.gallery-chat-alternative { margin: 16px 0 0; font-size: 13px; }
.gallery-chat-alternative a { text-underline-offset: 3px; }
.gallery-chat :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (max-width: 480px) {
  .gallery-chat { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .gallery-chat-panel { width: calc(100vw - 24px); max-height: calc(100dvh - 100px); }
  .gallery-chat-toggle { min-height: 50px; padding: 12px 16px; }
}
