/* GriGsi Card Guide — shared onboarding / per-card explainers (EN + BG) */
:root {
  --ggs-accent: #c45a11;
  --ggs-accent-soft: rgba(196, 90, 17, 0.12);
}

.ggs-guide-slot {
  margin: 0 0 14px;
}

/* Dedicated mount point — collapses after dismiss (no empty band) */
.ggs-guide-anchor:not(:has(> .ggs-guide-slot)) {
  display: none;
  margin: 0;
  padding: 0;
  height: 0;
  overflow: hidden;
}

/* Floating guide overlay (Instant, Air Check, …) */
.ggs-guide-overlay-host {
  display: none;
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10050;
  max-height: min(72vh, 520px);
  overflow: auto;
  pointer-events: none;
}
.ggs-guide-overlay-host.is-open,
.ggs-guide-overlay-host.ggs-guide-overlay-host--open,
.ggs-guide-overlay-host:has(> .ggs-guide-slot) {
  display: block;
  pointer-events: auto;
}
.ggs-guide-overlay-host .ggs-guide-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Instant product pages: no site purple nav bar */
body.inst-page header.grigsi-top-bar,
body.inst-page > .grigsi-top-bar-spacer {
  display: none !important;
}

body.inst-page .ggs-help-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 198, 75, 0.45);
  color: #ffe08a;
}

body.inst-page .ggs-help-btn:hover {
  border-color: #ffc64b;
  color: #fff;
}

body.ios-theme .ggs-guide-card,
body.ios-theme .rd-guide-card {
  background: #fff !important;
  border-color: #e8e4de !important;
  color: #1c1c1e !important;
  -webkit-text-fill-color: #1c1c1e !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Cosmic ios-theme body text is white — guide panels stay light with dark ink (EN + BG) */
body.ios-theme .ggs-guide-intro-label,
body.ios-theme .rd-guide-intro-label,
body.ios-theme .ggs-guide-step-label,
body.ios-theme .rd-guide-step-label {
  color: #8e8e93 !important;
  -webkit-text-fill-color: #8e8e93 !important;
}

body.ios-theme .ggs-guide-title,
body.ios-theme .rd-guide-title {
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
}

body.ios-theme .ggs-guide-title i,
body.ios-theme .rd-guide-title i {
  color: var(--ggs-accent) !important;
  -webkit-text-fill-color: var(--ggs-accent) !important;
}

body.ios-theme .ggs-guide-body,
body.ios-theme .rd-guide-body {
  color: #444 !important;
  -webkit-text-fill-color: #444 !important;
}

body.ios-theme .ggs-guide-body :is(strong, em, b, i:not(.fas):not(.far):not(.fab)),
body.ios-theme .rd-guide-body :is(strong, em, b, i:not(.fas):not(.far):not(.fab)) {
  color: #1c1c1e !important;
  -webkit-text-fill-color: #1c1c1e !important;
}

body.ios-theme .ggs-guide-body code,
body.ios-theme .rd-guide-body code {
  color: #3a3a3c !important;
  -webkit-text-fill-color: #3a3a3c !important;
  background: #f4f2ef !important;
}

body.ios-theme .ggs-guide-body a,
body.ios-theme .rd-guide-body a,
body.ios-theme .ggs-guide-link a {
  color: var(--ggs-accent) !important;
  -webkit-text-fill-color: var(--ggs-accent) !important;
}

body.ios-theme .ggs-guide-skip,
body.ios-theme .rd-guide-skip {
  color: #8a847c !important;
  -webkit-text-fill-color: #8a847c !important;
}

body.ios-theme .ggs-guide-skip:hover,
body.ios-theme .rd-guide-skip:hover {
  color: var(--ggs-accent) !important;
  -webkit-text-fill-color: var(--ggs-accent) !important;
}

body.ios-theme .ggs-guide-lang {
  background: #faf8f5 !important;
  border-color: #d8d0c6 !important;
  color: #5a534c !important;
  -webkit-text-fill-color: #5a534c !important;
}

body.ios-theme .ggs-guide-lang:hover {
  border-color: var(--ggs-accent) !important;
  color: var(--ggs-accent) !important;
  -webkit-text-fill-color: var(--ggs-accent) !important;
}

body.ios-theme .ggs-guide-btn:not(.ggs-guide-btn--primary),
body.ios-theme .rd-guide-card .rd-btn:not(.rd-btn--primary) {
  background: #fff !important;
  border-color: #d8d0c6 !important;
  color: #5a534c !important;
  -webkit-text-fill-color: #5a534c !important;
}

.ggs-guide-topbar,
.rd-guide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ggs-guide-intro-label,
.rd-guide-intro-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8a098;
  font-weight: 700;
}

.ggs-guide-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ggs-guide-lang {
  min-width: 2.1rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #d8d0c6;
  background: #faf8f5;
  color: #5a534c;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  line-height: 1.2;
}

.ggs-guide-lang:hover {
  border-color: var(--ggs-accent);
  color: var(--ggs-accent);
}

.ggs-guide-skip,
.rd-guide-skip {
  border: none;
  background: none;
  color: #8a847c;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ggs-guide-skip:hover,
.rd-guide-skip:hover {
  color: var(--ggs-accent);
}

.ggs-guide-card,
.rd-guide-card {
  background: #fff;
  border: 1px solid #e8e4de;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.ggs-guide-card--compact {
  padding: 16px 18px;
  margin-bottom: 12px;
}

.ggs-guide-progress,
.rd-guide-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ggs-guide-dot,
.rd-guide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd8d0;
}

.ggs-guide-dot.is-active,
.rd-guide-dot.is-active {
  background: var(--ggs-accent);
  transform: scale(1.15);
}

.ggs-guide-dot.is-done,
.rd-guide-dot.is-done {
  background: #8fd4a8;
}

.ggs-guide-step-label,
.rd-guide-step-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8a098;
}

.ggs-guide-title,
.rd-guide-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: #333;
}

.ggs-guide-title i,
.rd-guide-title i {
  color: var(--ggs-accent);
  margin-right: 8px;
}

.ggs-guide-card--compact .ggs-guide-title,
.ggs-guide-card--compact .rd-guide-title {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.ggs-guide-body,
.rd-guide-body {
  margin: 0 0 14px;
  line-height: 1.55;
  color: #444;
  font-size: 0.95rem;
}

.ggs-guide-body code,
.rd-guide-body code {
  font-size: 0.8rem;
  background: #f4f2ef;
  padding: 1px 4px;
  border-radius: 4px;
}

.ggs-guide-link,
.rd-guide-link {
  margin: 0 0 14px;
}

.ggs-guide-nav,
.rd-guide-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.ggs-guide-nav--end {
  justify-content: flex-end;
}

.ggs-guide-btn {
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid #d8d0c6;
  background: #fff;
  color: #5a534c;
  cursor: pointer;
}

.ggs-guide-btn:hover {
  border-color: var(--ggs-accent);
  background: var(--ggs-accent-soft);
}

.ggs-guide-btn--primary {
  background: linear-gradient(135deg, #a84e0c 0%, var(--ggs-accent) 100%);
  border-color: var(--ggs-accent);
  color: #fff;
}

.ggs-guide-btn--primary:hover {
  filter: brightness(1.05);
}

.ggs-guide-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.ios-theme .ggs-guide-btn--primary {
  background: linear-gradient(135deg, #a84e0c 0%, var(--ggs-accent) 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: var(--ggs-accent) !important;
}

/* Help ? button — same on all products */
.ggs-help-btn,
.rd-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #d8d0c6;
  background: #faf8f5;
  color: #8a847c;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.ggs-help-btn:hover,
.rd-help-btn:hover {
  border-color: var(--ggs-accent);
  color: var(--ggs-accent);
}
.ggs-section-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Dark glass product panels (Air Check, Reach, Noise, …) — keep ? readable */
body.ios-theme :is(.lr-card, .ac-deck, .ac-search-guide, .ni-card) .ggs-help-btn,
body.ios-theme :is(.lr-card, .ac-deck, .ac-search-guide, .ni-card) .rd-help-btn {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: #d8d0c6 !important;
  color: #5a534c !important;
  -webkit-text-fill-color: #5a534c !important;
}
body.ios-theme :is(.lr-card, .ac-deck, .ac-search-guide, .ni-card) .ggs-help-btn:hover,
body.ios-theme :is(.lr-card, .ac-deck, .ac-search-guide, .ni-card) .rd-help-btn:hover {
  border-color: var(--ggs-accent) !important;
  color: var(--ggs-accent) !important;
  -webkit-text-fill-color: var(--ggs-accent) !important;
}
/* Light hub sections — default ? chip stays dark on white */
body.ios-theme.page-hub .section.section-light .ggs-help-btn,
body.ios-theme.page-hub .section.section-light .rd-help-btn,
body.ios-theme main.section.section-light .ggs-help-btn,
body.ios-theme main.section.section-light .rd-help-btn {
  background: #faf8f5 !important;
  border-color: #d8d0c6 !important;
  color: #5a534c !important;
  -webkit-text-fill-color: #5a534c !important;
}
