/* Public guide feedback. Keep the launcher clear of the safe area. */
.guide-chat-launch {
  position: fixed; z-index: 90;
  right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: .65rem; min-height: 54px;
  padding: .75rem 1.35rem .75rem 1.1rem;
  border: 1px solid #ffffffb3; border-radius: 999px;
  background: linear-gradient(155deg, #fffdf5, #eee9da);
  color: #163f30; box-shadow: 0 6px 24px #001b2426, 0 2px 5px #001b2414, inset 0 1px 0 #fff;
  font: 700 .96rem var(--sans); letter-spacing: .035em; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.guide-chat-launch-icon {
  position: relative; display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; color: #246b50;
}
.guide-chat-launch-icon > svg { width: 25px; height: 25px; }
.guide-chat-dot {
  position: absolute; top: -.2rem; right: -.2rem;
  width: .65rem; height: .65rem; border: 2px solid var(--bg-mid);
  border-radius: 50%; background: var(--vermillion);
}
@media (hover: hover) {
  .guide-chat-launch:hover { transform: translateY(-2px); box-shadow: 0 10px 28px #001b2433, 0 2px 6px #001b2414; }
}
.guide-chat-launch:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .guide-chat-launch { transition: none; }
  .guide-chat-launch:hover, .guide-chat-launch:active { transform: none; }
}
.guide-chat {
  position: fixed; inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto;
  width: min(410px, calc(100vw - 2rem)); max-height: min(720px, calc(100dvh - 2rem));
  margin: 0; padding: 0; overflow: hidden; color: var(--ink); background: var(--bg-deep);
  border: 1px solid var(--glass-stroke-hi); border-radius: 22px; box-shadow: 0 14px 70px #0006;
}
.guide-chat[open] { display: flex; flex-direction: column; }
.guide-chat::backdrop { background: #0006; }
.guide-chat-head { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: .75rem; padding: .55rem 1rem; border-bottom: 1px solid var(--glass-stroke); }
.guide-chat-head h2 { font: 700 1.12rem var(--sans); }
.guide-chat-head button { flex: none; min-width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: var(--glass-shine); color: var(--ink); font: 1.6rem var(--sans); cursor: pointer; }
.guide-chat-actions { display: flex; align-items: center; gap: .35rem; }
.guide-chat-head [data-guide-chat-clear] { padding-inline: .55rem; border-radius: 10px; background: transparent; color: var(--ink-soft); font: 600 .78rem var(--sans); }
.guide-chat-head [data-guide-chat-clear]:disabled { visibility: hidden; }
.guide-chat-content { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.guide-chat-messages { display: grid; gap: .5rem; padding: .85rem 1rem; }
.guide-chat-greeting { color: var(--ink-soft); font-size: .9rem; line-height: 1.55; }
.guide-chat-message { display: grid; gap: .15rem; max-width: 88%; border: 1px solid var(--glass-stroke); border-radius: 14px; padding: .4rem .65rem; background: var(--glass-bg); }
.guide-chat-message[data-from="visitor"] { justify-self: end; border-end-end-radius: 4px; background: color-mix(in srgb, var(--bg-mid) 89%, var(--jade)); }
.guide-chat-message[data-from="admin"] { justify-self: start; border-end-start-radius: 4px; border-color: var(--emerald-bright); }
.guide-chat-message strong, .guide-chat-delivery { color: var(--ink-soft); font-size: .76rem; }
.guide-chat-message p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.guide-chat-message button { justify-self: start; border: 0; padding: .3rem 0; background: none; color: var(--jade); font: inherit; text-decoration: underline; cursor: pointer; }
.guide-chat form { display: grid; gap: .55rem; border-top: 1px solid var(--glass-stroke); padding: .85rem 1rem 1rem; background: var(--glass-bg); }
.guide-chat label { font-size: .81rem; font-weight: 650; }
.guide-chat select, .guide-chat textarea, .guide-chat input { width: 100%; min-width: 0; min-height: 40px; color: var(--ink); background: var(--bg-mid); border: 1px solid var(--glass-stroke-hi); border-radius: 9px; padding: .38rem .55rem; font: 1rem var(--sans); }
.guide-chat textarea { resize: vertical; max-height: 8rem; }
.guide-chat [hidden] { display: none; }
.guide-chat [data-guide-chat-start] { border: 0; gap: .8rem; padding: 1rem; }
.guide-chat [data-guide-chat-start] label { display: grid; gap: .28rem; }
.guide-chat-note, .guide-chat-status { color: var(--ink-soft); font-size: .74rem; line-height: 1.45; }
.guide-chat-status:empty { display: none; }
.guide-chat-status:not(:empty) { padding: .35rem 1rem .8rem; }
.guide-chat form .btn { justify-self: end; min-height: 44px; }
.guide-chat form .btn:disabled { opacity: .55; cursor: wait; }
@media (max-width: 480px) {
  .guide-chat form .btn { justify-self: stretch; justify-content: center; }
}
.guide-chat-launch:focus-visible, .guide-chat :focus-visible { outline: 2px solid var(--lantern); outline-offset: 2px; }

.registration-chat {
  --sans: "Hanken Grotesk", "Noto Sans SC", system-ui, sans-serif;
  --ease: ease-out;
  --bg-deep: var(--surface-solid);
  --bg-mid: var(--bg);
  --ink-soft: var(--ink-muted);
  --glass-stroke: var(--border);
  --glass-stroke-hi: var(--border);
  --glass-shine: var(--surface-2);
  --glass-bg: var(--surface-2);
  --jade: var(--accent-strong);
  --emerald-bright: var(--accent);
  --lantern: var(--ring);
  --vermillion: var(--danger);
}
.registration-chat .guide-chat form .btn--primary {
  background: var(--primary);
  color: var(--primary-text);
}
.registration-chat .guide-chat-launch {
  right: max(.75rem, env(safe-area-inset-right));
  bottom: max(.75rem, env(safe-area-inset-bottom));
  gap: .4rem;
  min-height: 44px;
  padding: .5rem .85rem;
  border-color: var(--border-strong);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-glass);
  letter-spacing: normal;
}
.registration-chat .guide-chat-launch-icon,
.registration-chat .guide-chat-launch-icon > svg {
  width: 20px;
  height: 20px;
  color: var(--accent-strong);
}
