/* Portfolio chat: floating "Ask about me" button and panel (see chat.js). Uses the site's theme colours. */
.gs-chat-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--color-primary); color: var(--color-on-primary, #fff);
  font: 600 0.8rem/1 inherit; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.gs-chat-btn:hover { transform: translateY(-2px); }
.gs-chat-btn svg { width: 18px; height: 18px; }
.gs-chat-open .gs-chat-btn { opacity: 0; pointer-events: none; }

.gs-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 61;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-surface-raised, var(--color-surface)); color: var(--color-text-default);
  border: 1px solid var(--color-border-default); border-radius: 18px;
  box-shadow: 0 16px 48px rgb(0 0 0 / 0.22);
  opacity: 0; transform: translateY(12px) scale(0.98); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.gs-chat-open .gs-chat { opacity: 1; transform: none; pointer-events: auto; }

.gs-chat-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-default);
}
.gs-chat-head strong { display: block; font-size: 0.95rem; }
.gs-chat-head span { display: block; font-size: 0.75rem; color: var(--color-text-muted); }
.gs-chat-close {
  margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--color-text-muted); font-size: 1.3rem; line-height: 1;
}
.gs-chat-close:hover { background: color-mix(in oklab, var(--color-text-default) 8%, transparent); }

.gs-chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.gs-chat-msg {
  max-width: 85%; padding: 10px 13px; border-radius: 14px;
  font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.gs-chat-msg.bot { align-self: flex-start; background: color-mix(in oklab, var(--color-text-default) 6%, transparent); border-bottom-left-radius: 4px; }
.gs-chat-msg.me { align-self: flex-end; background: var(--color-primary); color: var(--color-on-primary, #fff); border-bottom-right-radius: 4px; }

.gs-chat-msg a { color: inherit; text-decoration: underline; }

.gs-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-chat-chips button {
  padding: 7px 11px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.8rem;
  background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary);
}
.gs-chat-chips button:hover { background: color-mix(in oklab, var(--color-primary) 10%, transparent); }
.gs-chat-chips button.more { border-style: dashed; }
.gs-chat-go {
  display: block; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--color-primary); font: 600 0.8rem inherit;
}
.gs-chat-go:hover { text-decoration: underline; }

.gs-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border-default); }
.gs-chat-form input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 0.9rem;
  border: 1px solid var(--color-border-default); background: var(--color-surface); color: var(--color-text-default);
}
.gs-chat-form input:focus { outline: 2px solid var(--color-primary); outline-offset: -1px; }
.gs-chat-form button {
  padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--color-primary); color: var(--color-on-primary, #fff); font: 600 0.85rem inherit;
}

@media (max-width: 480px) {
  .gs-chat-btn { right: 16px; bottom: 16px; padding: 12px; }
  .gs-chat-btn span { display: none; }
  .gs-chat { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(75dvh, 560px); }
}
@media (prefers-reduced-motion: reduce) {
  .gs-chat, .gs-chat-btn { transition: none; }

}
