/* Public GPM assistant and local guidance widget */
.gh-launch {
  position: fixed;
  right: 24px;
  bottom: 74px;
  z-index: 35;
  display: flex;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, #17325c 0%, #0d1e38 100%);
  color: #ffffff;
  border: 1px solid rgba(139, 186, 230, 0.45);
  border-radius: 30px;
  padding: 12px 20px;
  min-height: 48px;
  box-shadow: 0 10px 32px rgba(10, 24, 46, 0.28), 0 2px 8px rgba(0, 0, 0, 0.1);
  font: 700 13px/1.4 var(--sans, -apple-system, BlinkMacSystemFont, Arial, sans-serif);
  letter-spacing: -.1px;
  transition: transform .2s var(--ease-out, ease), box-shadow .2s, background-color .2s;
}
.gh-launch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.gh-launch:hover {
  background: linear-gradient(135deg, #1f4277 0%, #12284b 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(10, 24, 46, 0.38);
}
.gh-launch small { font: 600 11px var(--sans, Arial, sans-serif); opacity: .85; }

.gh-dialog {
  position: fixed;
  inset: auto 24px 24px auto;
  margin: 0;
  width: min(470px, calc(100vw - 32px));
  max-width: none;
  height: min(740px, calc(100dvh - 36px));
  max-height: none;
  padding: 0;
  border: 1px solid #c8d9ec;
  border-radius: 22px;
  background: #f8fafc;
  color: #0e1e38;
  box-shadow: 0 28px 100px rgba(7, 21, 37, 0.4);
  font: 14px/1.6 var(--sans, -apple-system, BlinkMacSystemFont, Arial, sans-serif);
  overflow: hidden;
  z-index: 80;
}
.gh-dialog::backdrop { background: rgba(8, 23, 40, 0.45); backdrop-filter: blur(4px); }
.gh-shell { height: 100%; display: flex; flex-direction: column; }

.gh-heading {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #132a4e 0%, #0c1b33 100%);
  color: #ffffff;
  flex-shrink: 0;
}
.gh-heading h2 { font: 700 19px/1.3 var(--sans, Arial, sans-serif); letter-spacing: -.4px; margin: 0; }
.gh-heading small { display: block; color: #cbd5e1; font-size: 11px; margin-top: 3px; font-weight: 500; }
.gh-close {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background .2s, transform .15s;
}
.gh-close:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }

.gh-notice {
  padding: 10px 18px;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  border-bottom: 1px solid #dce5ef;
  color: #52647a;
  background: #f1f5fa;
  flex-shrink: 0;
  font-weight: 500;
}

.gh-topics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 16px;
  background: #f1f5fa;
  border-bottom: 1px solid #dce5ef;
  flex-shrink: 0;
}
.gh-topics button {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid #d0deee;
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 38px;
  background: #ffffff;
  color: #1e3a63;
  box-shadow: 0 1px 4px rgba(14, 30, 56, 0.04);
  transition: background .15s, border-color .15s, transform .15s;
}
.gh-topics button:hover {
  background: #eef5ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.gh-log {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 70px;
  flex: 1;
  padding: 12px 18px;
  scroll-behavior: auto;
}
.gh-message {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #dce5f0;
  border-radius: 16px 16px 16px 4px;
  margin: 10px 0;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(14, 30, 56, 0.04);
}
.gh-message p { margin: 0; font-size: 13px; line-height: 1.65; white-space: pre-line; }
.gh-message h3 { font: 700 15px/1.4 var(--sans, Arial, sans-serif); margin: 0 0 8px; color: #0e1e38; }
.gh-message a {
  display: inline-block;
  min-height: 40px;
  padding: 10px 8px 2px 0;
  margin-right: 10px;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  text-decoration: underline;
}
.gh-message small { display: block; color: #64748b; font-size: 10px; margin-top: 8px; line-height: 1.6; }
.gh-message .gh-important {
  border-left: 3px solid #d97706;
  padding: 8px 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  font-weight: 500;
  border-radius: 0 8px 8px 0;
  margin-top: 8px;
}

.gh-own {
  background: #e0eeff;
  border-color: #bfdbfe;
  color: #0c2d6b;
  margin-left: 28px;
  border-radius: 16px 16px 4px 16px;
}
.gh-choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #d2e1f2;
  border-radius: 10px;
  background: #f8faff;
  padding: 10px 12px;
  min-height: 44px;
  font: 600 12px/1.5 var(--sans, Arial, sans-serif);
  margin-top: 8px;
  color: #1e40af;
  transition: border-color .15s, background .15s;
}
.gh-choice:hover { border-color: #2563eb; background: #edf4fe; }

.gh-stepnav { display: flex; gap: 8px; margin-top: 10px; }
.gh-stepnav .gh-choice { width: auto; flex: 1; text-align: center; }

.gh-input {
  padding: 14px 18px 16px;
  border-top: 1px solid #d9e4ef;
  background: #ffffff;
  flex-shrink: 0;
}
.gh-input label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 8px; color: #475569; text-transform: uppercase; letter-spacing: .4px; }
.gh-input-row { display: flex; gap: 8px; }
.gh-input-row input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  font: 14px var(--sans, Arial, sans-serif);
  color: #0e1e38;
  outline-offset: 3px;
  transition: border-color .2s;
}
.gh-input-row input:focus { border-color: #3b82f6; }
.gh-send {
  background: var(--accent-gradient, #205ee8);
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  min-width: 52px;
  padding: 8px 16px;
  font: 700 13px var(--sans, Arial, sans-serif);
  flex: 0 0 auto;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(32, 94, 232, 0.28);
  transition: transform .15s, opacity .15s;
}
.gh-send:disabled { opacity: .5; cursor: wait; }
.gh-send:active { transform: scale(.96); }

.gh-ai-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.gh-ai-send, .gh-ai-cancel {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #cad7e7;
  border-radius: 10px;
  font: 700 12px/1.3 var(--sans, Arial, sans-serif);
  transition: background .15s, transform .15s;
}
.gh-ai-send { background: #205ee8; color: #ffffff; border-color: #205ee8; box-shadow: 0 2px 8px rgba(32, 94, 232, 0.25); }
.gh-ai-send:hover { background: #174ab8; }
.gh-ai-send:disabled { opacity: .55; cursor: wait; }
.gh-ai-cancel { background: #ffffff; color: #1e3a63; }
.gh-ai-cancel:hover { background: #f1f5fa; }
.gh-reset { display: block; border: 0; background: none; font: 600 11px var(--sans, Arial, sans-serif); color: #64748b; min-height: 32px; margin: 0 0 0 auto; }
.gh-reset:hover { color: #0e1e38; text-decoration: underline; }
.gh-message .gh-consent-query { margin-top: 10px; padding: 10px; border-left: 3px solid #60a5fa; background: #f0f7ff; border-radius: 0 8px 8px 0; font-size: 12px; }

.gh-dialog :focus-visible, .gh-launch:focus-visible { outline: 3px solid #3b82f6; outline-offset: 3px; }
body.gpm-dialog-open { overflow: hidden; }
body.gpm-dialog-open .mobile-cta { visibility: hidden; }

@media (max-width: 700px) {
  .gh-launch { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; padding: 10px 14px; }
  .intro3d-in-view .gh-launch { bottom: calc(12px + env(safe-area-inset-bottom)); width: 48px; justify-content: center; font-size: 0; gap: 0; padding: 12px; }
  .gh-launch small { display: none; }
  .gh-dialog {
    inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px;
    width: calc(100vw - 16px);
    height: min(670px, calc(100dvh - 24px));
    border-radius: 20px;
  }
  .gh-heading { padding: 14px 16px 10px; }
  .gh-notice { font-size: 10px; padding: 8px 16px; }
  .gh-topics { gap: 5px; padding: 8px 12px; }
  .gh-topics button { font-size: 10px; min-height: 34px; }
  .gh-input { padding: 10px 14px; }
  .gh-input-row input { font-size: 16px; }
  .gh-log { padding: 0 14px 8px; }
}

@media (max-height: 520px) {
  .gh-topics { display: flex; flex-wrap: nowrap; overflow: auto; flex-shrink: 0; }
  .gh-topics button { flex-shrink: 0; min-height: 30px; }
  .gh-notice { display: none; }
  .gh-reset { min-height: 26px; }
  .gh-heading { padding: 8px 12px; }
  .gh-dialog { height: calc(100dvh - 16px); }
  .gh-ai-send, .gh-ai-cancel { min-height: 32px; padding: 6px 10px; }
  .gh-ai-actions { margin-top: 4px; }
  .gh-log { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) { .gh-dialog * { scroll-behavior: auto; } }
@media (forced-colors: active) { .gh-launch, .gh-send, .gh-heading { background: Canvas; color: CanvasText; border: 1px solid ButtonText; } }
@media print { .gh-launch, .gh-dialog { display: none !important; } }
