/* Geo-Surface context-aware support assistant. Kept separate so the feature can
   be removed or ported without disturbing the application shell. */

body.gsa-support-open { overflow: hidden; }

.gsa-support-launcher {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 0;
  cursor: pointer;
}

body.gsa-ux #appHeader .gsa-header-icon-button.gsa-support-launcher {
  position: relative !important;
  inset: auto !important;
  order: 5;
  width: auto !important;
  min-width: 126px;
  height: 34px;
  flex: 0 0 auto !important;
  padding: 0 10px 0 6px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  color: #eafff8 !important;
  border: 1px solid rgba(52, 211, 153, 0.58) !important;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.12)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 4px rgba(2, 44, 34, 0.2) !important;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  transform: none !important;
}

body.gsa-ux #appHeader .gsa-header-icon-button.gsa-support-launcher:hover,
body.gsa-ux #appHeader .gsa-header-icon-button.gsa-support-launcher:focus-visible {
  color: #fff !important;
  border-color: rgba(110, 231, 183, 0.88) !important;
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.32), rgba(5, 150, 105, 0.2)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(2, 44, 34, 0.28) !important;
  outline: 2px solid rgba(110, 231, 183, 0.38);
  outline-offset: 2px;
}

body.gsa-ux #appHeader .gsa-header-icon-button.gsa-support-launcher > i {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  color: #d1fae5;
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  font-size: 11px !important;
}

.gsa-support-launcher__label {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
}

.gsa-support-launcher--floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12980;
  min-width: 92px;
  height: 42px;
  gap: 7px;
  padding: 0 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gsa-support-launcher--floating:hover,
.gsa-support-launcher--floating:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.5);
  outline: 3px solid rgba(110, 231, 183, 0.55);
  outline-offset: 2px;
}

.gsa-support-launcher i { font-size: 14px; }

.gsa-support-backdrop {
  position: fixed;
  inset: var(--gsa-topbar-height, 60px) 0 0;
  display: none;
  z-index: 12990;
  background: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(1px);
}

.gsa-support-backdrop.is-open { display: block; }

.gsa-support-panel {
  position: fixed;
  top: calc(var(--gsa-topbar-height, 60px) + 12px);
  right: 12px;
  z-index: 13000;
  box-sizing: border-box;
  width: min(400px, calc(100vw - 24px));
  height: min(760px, calc(100dvh - var(--gsa-topbar-height, 60px) - 24px));
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #1f2937;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.7);
  border-radius: 15px;
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.28);
  transform: translateX(calc(100% + 24px));
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s ease, visibility 0s linear 0.22s;
}

.gsa-support-panel,
.gsa-support-panel * { box-sizing: border-box; }

.gsa-support-panel.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.gsa-support-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 11px 12px 10px 15px;
  color: #fff;
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

.gsa-support-header__avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #065f46;
  background: #d1fae5;
}

.gsa-support-header__copy { min-width: 0; flex: 1; }
.gsa-support-header__title { display: block; font-size: 15px; font-weight: 800; }
.gsa-support-header__status { display: block; margin-top: 1px; font-size: 10.5px; opacity: 0.86; }

.gsa-support-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.gsa-support-icon-btn:hover,
.gsa-support-icon-btn:focus-visible { background: rgba(255, 255, 255, 0.24); outline: none; }

.gsa-support-privacy {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 13px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  color: #475569;
  background: #ecfdf5;
  font-size: 10.5px;
  line-height: 1.4;
}

.gsa-support-privacy summary,
.gsa-support-privacy[open] > summary {
  padding: 0;
  color: #065f46;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.gsa-support-privacy p { margin: 7px 0 0; }

.gsa-support-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 11px 13px 8px;
  scroll-behavior: smooth;
}

.gsa-support-message { display: flex; margin: 0 0 12px; }
.gsa-support-message--user { justify-content: flex-end; }

.gsa-support-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gsa-support-message--assistant .gsa-support-bubble {
  color: #243447;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  white-space: normal;
}

.gsa-support-message--assistant .gsa-support-bubble p { margin: 0 0 9px; }
.gsa-support-message--assistant .gsa-support-bubble p:last-child { margin-bottom: 0; }
.gsa-support-message--assistant .gsa-support-bubble ul,
.gsa-support-message--assistant .gsa-support-bubble ol { margin: 5px 0 9px; padding-left: 21px; }
.gsa-support-message--assistant .gsa-support-bubble li { margin: 3px 0; }
.gsa-support-message--assistant .gsa-support-bubble code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.92em;
}
.gsa-support-message--assistant .gsa-support-markdown-heading { color: #0f172a; }

.gsa-support-message--user .gsa-support-bubble {
  color: #fff;
  background: #047857;
  border-bottom-right-radius: 4px;
}

.gsa-support-message--system .gsa-support-bubble {
  max-width: 100%;
  width: 100%;
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 11.5px;
}

.gsa-support-typing { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; }
.gsa-support-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: gsa-support-dot 1.15s infinite ease-in-out; }
.gsa-support-typing span:nth-child(2) { animation-delay: 0.16s; }
.gsa-support-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes gsa-support-dot { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-4px); opacity: 1; } }

.gsa-support-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 13px; }
.gsa-support-action {
  padding: 6px 9px;
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  color: #065f46;
  background: #ecfdf5;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.gsa-support-action:hover,
.gsa-support-action:focus-visible { background: #d1fae5; outline: none; }

.gsa-support-intents {
  margin: -2px 0 13px;
  padding: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid #a7f3d0;
  border-radius: 11px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}

.gsa-support-intents > strong {
  grid-column: 1 / -1;
  color: #065f46;
  font-size: 13px;
}

.gsa-support-intents > span {
  grid-column: 1 / -1;
  margin: -4px 0 1px;
  color: #64748b;
  font-size: 10.5px;
}

.gsa-support-intent {
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  color: #164e3f;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.gsa-support-intent > i:first-child { color: #059669; text-align: center; }
.gsa-support-intent > i:last-child { display: none; }
.gsa-support-intent:hover,
.gsa-support-intent:focus-visible {
  border-color: #34d399;
  background: #f0fdf4;
  outline: 2px solid rgba(16, 185, 129, 0.16);
  outline-offset: 1px;
}

.gsa-support-consent {
  margin: 2px 0 10px;
  padding: 8px 9px;
  display: grid;
  gap: 5px;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  color: #334155;
  background: #f0fdf4;
  font-size: 10.5px;
  line-height: 1.3;
}
.gsa-support-consent__note { color: #475569; font-size: 9.5px; }
.gsa-support-consent label {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0;
  color: #065f46;
  font-weight: 700;
  cursor: pointer;
}
.gsa-support-consent input[type="checkbox"],
.gsa-support-human-form__diagnostic input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 16px;
  margin: 1px 0 0;
  padding: 0;
}

.gsa-support-composer {
  flex: 0 0 auto;
  padding: 8px 11px 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.gsa-support-composer__tools { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.gsa-support-map-btn {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  background: #fff;
  font-size: 10.5px;
  cursor: pointer;
}
.gsa-support-map-btn.is-attached { border-color: #34d399; color: #065f46; background: #ecfdf5; }
.gsa-support-map-btn:disabled { cursor: wait; opacity: 0.6; }
.gsa-support-map-note { display: none; }

body.gsa-context-help-picking,
body.gsa-context-help-picking * { cursor: help !important; }

.gsa-context-help-target {
  outline: 3px solid #0d9488 !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

.gsa-context-help-hint {
  position: fixed;
  z-index: 2147483646;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 28px);
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 9px;
  color: #fff;
  background: #0f766e;
  box-shadow: 0 8px 24px rgba(15,23,42,.28);
  font-size: 12px;
  font-weight: 700;
}

.gsa-context-help-hint span {
  color: #ccfbf1;
  font-size: 10px;
  font-weight: 500;
}

.gsa-context-help-popover {
  position: fixed;
  z-index: 2147483645;
  width: min(340px, calc(100vw - 24px));
  padding: 15px;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  color: #334155;
  background: #fff;
  box-shadow: 0 14px 40px rgba(15,23,42,.25);
  font: 12px/1.45 Inter, Arial, sans-serif;
}

.gsa-context-help-kicker {
  display: block;
  margin: 0 28px 5px 0;
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.gsa-context-help-title {
  display: block;
  padding-right: 26px;
  color: #0f172a;
  font-size: 15px;
}

.gsa-context-help-copy { margin: 7px 0 12px; }

.gsa-context-help-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
}

.gsa-context-help-close:hover,
.gsa-context-help-close:focus-visible { color: #0f172a; background: #f1f5f9; outline: none; }

.gsa-context-help-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.gsa-context-help-actions button {
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #0f766e;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.gsa-context-help-actions button:hover,
.gsa-context-help-actions button:focus-visible { border-color: #5eead4; background: #f0fdfa; outline: none; }

.gsa-support-composer__row { display: flex; align-items: flex-end; gap: 7px; }
.gsa-support-input {
  flex: 1;
  min-height: 74px;
  max-height: 160px;
  resize: none;
  padding: 10px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #1f2937;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}
.gsa-support-input:focus { border-color: #10b981; outline: 3px solid rgba(16, 185, 129, 0.13); }

.gsa-support-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #047857;
  cursor: pointer;
}
.gsa-support-send:disabled { cursor: wait; opacity: 0.55; }
.gsa-support-send:hover:not(:disabled),
.gsa-support-send:focus-visible { background: #065f46; outline: none; }

.gsa-support-footnote { margin-top: 5px; color: #94a3b8; font-size: 9px; text-align: center; }

.gsa-support-human-form {
  margin: 2px 0 14px;
  padding: 13px;
  border: 1px solid #6ee7b7;
  border-radius: 11px;
  color: #334155;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  font-size: 11.5px;
  line-height: 1.4;
}

.gsa-support-human-form > strong { display: block; color: #065f46; font-size: 13.5px; }
.gsa-support-human-form > p { margin: 5px 0 11px; color: #475569; }

.gsa-support-human-form__field { display: block; margin-top: 9px; color: #334155; font-weight: 700; }
.gsa-support-human-form__field > span { display: block; margin-bottom: 4px; }
.gsa-support-human-form__field input,
.gsa-support-human-form__field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #1f2937;
  background: #fff;
  font: inherit;
  font-weight: 400;
  line-height: 1.4;
}
.gsa-support-human-form__field textarea { min-height: 190px; resize: vertical; white-space: pre-wrap; }
.gsa-support-human-form__field input:focus,
.gsa-support-human-form__field textarea:focus { border-color: #10b981; outline: 3px solid rgba(16, 185, 129, 0.13); }

.gsa-support-human-form__diagnostic {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 11px;
  color: #475569;
  cursor: pointer;
}
.gsa-support-human-form__diagnostic input { margin-top: 2px; }

.gsa-support-human-form__preview { margin-top: 9px; color: #475569; }
.gsa-support-human-form__preview summary { color: #065f46; font-weight: 700; cursor: pointer; }
.gsa-support-human-form__preview pre {
  max-height: 190px;
  overflow: auto;
  margin: 7px 0 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  font: 9px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gsa-support-human-form__trap { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.gsa-support-human-form__status { min-height: 17px; margin-top: 8px; color: #9a3412; font-weight: 700; }
.gsa-support-human-form__buttons { display: flex; justify-content: flex-end; gap: 7px; margin-top: 7px; }
.gsa-support-human-form__buttons button {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.gsa-support-human-form__cancel { border: 1px solid #cbd5e1; color: #475569; background: #fff; }
.gsa-support-human-form__send { border: 1px solid #047857; color: #fff; background: #047857; }
.gsa-support-human-form__buttons button:disabled { cursor: wait; opacity: 0.55; }
.gsa-support-human-form__cancel:hover:not(:disabled),
.gsa-support-human-form__cancel:focus-visible { background: #f1f5f9; outline: none; }
.gsa-support-human-form__send:hover:not(:disabled),
.gsa-support-human-form__send:focus-visible { background: #065f46; outline: none; }

.gsa-support-highlight {
  position: relative;
  z-index: 11002 !important;
  animation: gsa-support-highlight 1.1s ease-in-out 3;
  outline: 4px solid rgba(16, 185, 129, 0.72) !important;
  outline-offset: 3px !important;
}
@keyframes gsa-support-highlight { 0%, 100% { outline-color: rgba(16,185,129,.25); } 50% { outline-color: rgba(16,185,129,.95); } }

@media (max-width: 600px) {
  .gsa-support-panel {
    top: var(--gsa-topbar-height, 56px);
    right: 0;
    width: 100vw;
    height: calc(100dvh - var(--gsa-topbar-height, 56px));
    border-width: 1px 0 0;
    border-radius: 0;
  }
  .gsa-support-backdrop { background: rgba(15, 23, 42, 0.12); }
  .gsa-support-bubble { max-width: 92%; }
}

@media (max-width: 350px) {
  .gsa-support-intents { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  body.gsa-ux #appHeader .gsa-header-icon-button.gsa-support-launcher {
    width: 34px !important;
    min-width: 34px;
    padding: 0 !important;
  }
  body.gsa-ux #appHeader .gsa-header-icon-button.gsa-support-launcher
    .gsa-support-launcher__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gsa-support-panel,
  .gsa-support-launcher { transition: none; }
  .gsa-support-typing span,
  .gsa-support-highlight { animation: none; }
}
