/* SGAM Guide Bot — stili scoped (.sgam-gb). A11y: contrasto >=4.5:1, focus visibile, target 44px. */
.sgam-gb { position: fixed; right: 20px; bottom: 20px; z-index: 99999; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.sgam-gb *, .sgam-gb *::before, .sgam-gb *::after { box-sizing: border-box; }

.sgam-gb-launcher {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--sgam-gb-primary, #0A2540); color: #fff; cursor: pointer;
  font-size: 15px; font-weight: 600; box-shadow: 0 6px 20px rgba(10,37,64,.28);
}
.sgam-gb-launcher:hover { filter: brightness(1.08); }
.sgam-gb-launcher span[aria-hidden] { font-size: 18px; }

.sgam-gb-panel {
  position: absolute; right: 0; bottom: 60px; width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 110px); display: flex; flex-direction: column;
  background: #fff; border: 1px solid #E8E6E1; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(10,37,64,.30);
}
.sgam-gb-panel[hidden] { display: none; }

.sgam-gb-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--sgam-gb-primary, #0A2540); color: #fff;
}
.sgam-gb-title { font-weight: 700; font-size: 16px; flex: 1; }
.sgam-gb-icon {
  min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px; cursor: pointer; font-size: 16px;
}
.sgam-gb-icon:hover { background: rgba(255,255,255,.12); }

.sgam-gb-log { flex: 1; overflow-y: auto; padding: 14px; background: #FAFAF9; display: flex; flex-direction: column; gap: 10px; }
.sgam-gb-msg { display: flex; }
.sgam-gb-bot { justify-content: flex-start; }
.sgam-gb-user { justify-content: flex-end; }
.sgam-gb-bubble { max-width: 84%; padding: 10px 13px; border-radius: 14px; line-height: 1.45; font-size: 14.5px; }
.sgam-gb-bot .sgam-gb-bubble { background: #fff; border: 1px solid #E8E6E1; color: #1a1a1a; border-bottom-left-radius: 4px; }
.sgam-gb-user .sgam-gb-bubble { background: var(--sgam-gb-primary, #0A2540); color: #fff; border-bottom-right-radius: 4px; }

.sgam-gb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.sgam-gb-chip {
  min-height: 36px; padding: 6px 14px; border: 1px solid var(--sgam-gb-primary, #0A2540);
  background: #fff; color: var(--sgam-gb-primary, #0A2540); border-radius: 999px;
  cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.sgam-gb-chip:hover { background: var(--sgam-gb-accent, #C9A357); border-color: var(--sgam-gb-accent, #C9A357); color: #1a1a1a; }

.sgam-gb-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #E8E6E1; background: #fff; }
.sgam-gb-input { flex: 1; min-height: 44px; padding: 0 12px; border: 1px solid #CBD5E0; border-radius: 10px; font-size: 14.5px; color: #1a1a1a; }
.sgam-gb-form .sgam-gb-icon { color: var(--sgam-gb-primary, #0A2540); border-color: #CBD5E0; }
.sgam-gb-send { min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--sgam-gb-primary, #0A2540); color: #fff; font-weight: 600; cursor: pointer; font-size: 14px; }
.sgam-gb-send:hover { filter: brightness(1.08); }

/* Focus visibile (WCAG 2.4.7) */
.sgam-gb button:focus-visible, .sgam-gb input:focus-visible { outline: 3px solid var(--sgam-gb-accent, #C9A357); outline-offset: 2px; }

@media (max-width: 480px) {
  .sgam-gb { right: 12px; bottom: 12px; }
  .sgam-gb-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
  .sgam-gb-launcher-txt { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sgam-gb * { transition: none !important; animation: none !important; } }
