/* Shared content module modal — independent HTML inside agent chat (Cheryce + all agents) */
html.gw-module-body-lock,
html.gw-module-body-lock body {
  overflow: hidden;
}

.gw-content-module-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 11900;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 14px;
  background: rgba(4, 6, 14, 0.88);
  backdrop-filter: blur(8px);
}

.gw-content-module-modal.is-open {
  display: flex;
}

/* Cover strip — visible on the dimmed backdrop */
.gw-content-module-cover {
  width: min(98vw, 1440px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 22, 0.72);
  flex-shrink: 0;
}

.gw-content-module-cover-text {
  margin: 0;
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.gw-content-module-cover-text strong {
  color: #f8fafc;
  font-weight: 700;
}

.gw-content-module-cover-back {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.gw-content-module-cover-back:hover {
  background: rgba(255, 255, 255, 0.16);
}

.gw-content-module-modal.is-near-full {
  padding: 6px 8px 8px;
}

.gw-content-module-modal.is-near-full .gw-content-module-panel {
  width: min(98vw, 1440px);
  max-width: none;
  max-height: calc(96vh - 52px);
  height: calc(96vh - 52px);
}

.gw-content-module-modal.is-near-full .gw-content-module-stage {
  flex: 1;
  height: auto;
  min-height: 0;
}

.gw-content-module-modal.is-expanded {
  padding: 0;
}

.gw-content-module-modal.is-expanded .gw-content-module-cover {
  display: none;
}

.gw-content-module-modal.is-expanded .gw-content-module-panel {
  width: 100%;
  max-width: none;
  max-height: 100vh;
  height: 100%;
  border-radius: 0;
}

.gw-content-module-modal.is-expanded .gw-content-module-stage {
  height: auto;
  flex: 1;
  min-height: 0;
}

.gw-content-module-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 2px solid rgba(96, 165, 250, 0.35);
  background: linear-gradient(165deg, rgba(14, 22, 38, 0.98), rgba(8, 12, 22, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* Agent themes */
.gw-content-module-modal.theme-media .gw-content-module-panel {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.15) inset,
    0 24px 64px rgba(60, 20, 100, 0.45);
}

.gw-content-module-modal.theme-media .gw-module-badge--agent,
.gw-content-module-modal.theme-media .gw-content-module-back {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(124, 58, 237, 0.55);
}

.gw-content-module-modal.theme-media .gw-content-module-return-hint {
  color: #d8b4fe;
}

.gw-content-module-modal.theme-finance .gw-content-module-panel {
  border-color: rgba(201, 169, 97, 0.55);
  box-shadow:
    0 0 0 1px rgba(201, 169, 97, 0.12) inset,
    0 24px 64px rgba(40, 32, 12, 0.45);
}

.gw-content-module-modal.theme-finance .gw-module-badge--agent,
.gw-content-module-modal.theme-finance .gw-content-module-back {
  border-color: rgba(201, 169, 97, 0.55);
  background: rgba(180, 140, 50, 0.55);
}

.gw-content-module-modal.theme-finance .gw-content-module-return-hint {
  color: #e8d5a8;
}

.gw-content-module-modal.theme-equipment .gw-content-module-panel {
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.12) inset,
    0 24px 64px rgba(80, 30, 8, 0.45);
}

.gw-content-module-modal.theme-equipment .gw-module-badge--agent,
.gw-content-module-modal.theme-equipment .gw-content-module-back {
  border-color: rgba(249, 115, 22, 0.55);
  background: rgba(234, 88, 12, 0.55);
}

.gw-content-module-modal.theme-equipment .gw-content-module-return-hint {
  color: #fdba74;
}

.gw-content-module-modal.theme-grants .gw-content-module-panel {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.12) inset,
    0 24px 64px rgba(12, 28, 64, 0.45);
}

.gw-content-module-modal.theme-grants .gw-module-badge--agent,
.gw-content-module-modal.theme-grants .gw-content-module-back {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(37, 99, 235, 0.55);
}

.gw-content-module-modal.theme-grants .gw-content-module-return-hint {
  color: #93c5fd;
}

.gw-content-module-modal.theme-deals .gw-content-module-panel {
  border-color: rgba(77, 166, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(77, 166, 255, 0.12) inset,
    0 24px 64px rgba(8, 24, 48, 0.45);
}

.gw-content-module-modal.theme-deals .gw-module-badge--agent,
.gw-content-module-modal.theme-deals .gw-content-module-back {
  border-color: rgba(255, 140, 26, 0.55);
  background: rgba(255, 140, 26, 0.55);
}

.gw-content-module-modal.theme-deals .gw-content-module-return-hint {
  color: #ffb04d;
}

.gw-content-module-modal.theme-products .gw-content-module-panel {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.12) inset,
    0 24px 64px rgba(12, 28, 64, 0.45);
}

.gw-content-module-modal.theme-products .gw-module-badge--agent,
.gw-content-module-modal.theme-products .gw-content-module-back {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(37, 99, 235, 0.55);
}

.gw-content-module-modal.theme-products .gw-content-module-return-hint {
  color: #93c5fd;
}

.gw-content-module-modal.theme-systems .gw-content-module-panel {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.12) inset,
    0 24px 64px rgba(48, 32, 8, 0.45);
}

.gw-content-module-modal.theme-systems .gw-module-badge--agent,
.gw-content-module-modal.theme-systems .gw-content-module-back {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(217, 119, 6, 0.55);
}

.gw-content-module-modal.theme-systems .gw-content-module-return-hint {
  color: #fde68a;
}

.gw-content-module-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 0;
  flex-shrink: 0;
}

.gw-module-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
}

.gw-module-badge--agent {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(37, 99, 235, 0.25);
}

.gw-module-badge--scroll {
  display: none;
}

.gw-content-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gw-content-module-head-copy {
  min-width: 0;
  flex: 1;
}

.gw-content-module-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin: 0;
}

.gw-content-module-desc {
  font-size: 0.72rem;
  color: #8b9bb8;
  margin: 4px 0 0;
  line-height: 1.4;
}

.gw-content-module-usage {
  font-size: 0.68rem;
  color: #a8c5b0;
  margin: 6px 0 0;
  line-height: 1.45;
  font-style: italic;
}

.gw-content-module-return-hint {
  display: none !important;
}

.gw-content-module-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.gw-content-module-full {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  text-decoration: none;
}

.gw-content-module-full:hover {
  background: rgba(37, 99, 235, 0.32);
}

.gw-content-module-back {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.45);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.gw-content-module-back:hover {
  filter: brightness(1.08);
}

.gw-content-module-expand {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(20, 30, 48, 0.85);
  color: #e8edf8;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.gw-content-module-expand:hover,
.gw-content-module-expand.is-expanded {
  background: rgba(37, 99, 235, 0.45);
}

.gw-content-module-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 30, 48, 0.85);
  color: #e8edf8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.gw-content-module-close:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(248, 113, 113, 0.45);
}

.gw-content-module-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  height: min(68vh, 640px);
  background: #050a12;
  overflow: hidden;
}

.gw-content-module-stage.is-loading iframe {
  opacity: 0.15;
}

.gw-content-module-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050a12;
}

/* Sustainability map — scroll inside modal; iframe grows to content height */
.gw-content-module-modal.is-map-module .gw-content-module-stage {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: min(72vh, 680px);
}

.gw-content-module-modal.is-map-module.is-near-full .gw-content-module-stage {
  flex: 1;
  min-height: 0;
  height: auto;
}

.gw-content-module-modal.is-map-module .gw-content-module-stage iframe {
  position: relative;
  inset: auto;
  display: block;
  min-height: 560px;
}

.gw-content-module-modal.is-map-module .gw-module-badge--scroll {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.45);
}

.gw-content-module-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(5, 10, 18, 0.92);
}

.gw-content-module-loading[hidden] {
  display: none !important;
  pointer-events: none;
}

.gw-content-module-foot {
  display: none !important;
  padding: 8px 14px 10px;
  font-size: 0.62rem;
  color: #64748b;
  line-height: 1.4;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gw-content-module-modal.has-agent-note .gw-content-module-panel {
  overflow-x: hidden;
  overflow-y: auto;
}

.gw-content-module-modal.has-agent-note .gw-content-module-stage {
  flex: 0 0 auto;
  height: min(52vh, 420px);
  min-height: 280px;
  max-height: none;
  overflow: hidden;
}

/* Energy ticker: fixed lane height so both marquees show; note sits below in panel flow */
.gw-content-module-modal.has-agent-note.is-ticker-module .gw-content-module-stage {
  height: 292px;
  min-height: 292px;
  max-height: 292px;
}

.gw-content-module-modal.is-expanded.has-agent-note.is-ticker-module .gw-content-module-stage {
  height: 292px;
  min-height: 292px;
  max-height: 292px;
  flex: 0 0 292px;
}

.gw-content-module-modal.is-expanded.has-agent-note.is-ticker-module .gw-content-module-panel {
  height: auto;
  max-height: 100vh;
}

.gw-content-module-agent-note {
  flex-shrink: 0;
  order: 1;
  padding: 12px 14px 12px;
  border-top: 1px solid rgba(75, 140, 104, 0.28);
  background: linear-gradient(180deg, rgba(14, 33, 23, 0.92) 0%, rgba(8, 14, 24, 0.95) 100%);
}

.gw-content-module-modal.has-agent-note .gw-content-module-foot {
  flex-shrink: 0;
  order: 2;
}

.gw-agent-note-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7cb896;
  margin: 0 0 6px;
}

.gw-agent-note-body {
  font-size: 0.72rem;
  line-height: 1.55;
  color: #c8d4e6;
  margin: 0;
}

.gw-agent-note-actions {
  margin-top: 10px;
}

.gw-agent-note-cta {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(75, 140, 104, 0.45);
  background: rgba(40, 167, 69, 0.18);
  color: #b8e6c8;
  cursor: pointer;
}

.gw-agent-note-cta:hover {
  background: rgba(40, 167, 69, 0.32);
}

.gw-content-module-modal.theme-finance.has-agent-note .gw-content-module-agent-note {
  border-top-color: rgba(201, 169, 97, 0.35);
  background: linear-gradient(180deg, rgba(32, 28, 14, 0.92) 0%, rgba(8, 14, 24, 0.95) 100%);
}

.gw-content-module-modal.theme-finance .gw-agent-note-label {
  color: #e8c974;
}

.gw-content-module-modal.theme-finance .gw-agent-note-cta {
  border-color: rgba(201, 169, 97, 0.45);
  background: rgba(201, 169, 97, 0.15);
  color: #f0dfa0;
}

.gw-content-module-modal.theme-media.has-agent-note .gw-content-module-agent-note {
  border-top-color: rgba(168, 85, 247, 0.35);
}

.gw-content-module-modal.theme-media .gw-agent-note-label {
  color: #d8b4fe;
}

.gw-content-module-modal.theme-media .gw-agent-note-cta {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(124, 58, 237, 0.2);
  color: #e9d5ff;
}

@media (max-width: 720px) {
  .gw-content-module-head {
    flex-direction: column;
  }

  .gw-content-module-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .gw-module-badge--scroll {
    margin-left: 0;
  }

  .gw-content-module-cover {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Module tablets in agent turn UI */
.module-tablets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.module-tablet {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(15, 25, 42, 0.55);
}

.module-tablet-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e8edf8;
  margin: 0 0 4px;
}

.module-tablet-desc {
  font-size: 0.68rem;
  color: #8b9bb8;
  margin: 0 0 4px;
  line-height: 1.4;
}

.module-tablet-usage {
  font-size: 0.65rem;
  color: #93b8a8;
  margin: 0 0 8px;
  line-height: 1.4;
  font-style: italic;
}

.module-tablet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-tablet-open {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.25);
  color: #fff;
  cursor: pointer;
}

.module-tablet-open:hover {
  background: rgba(37, 99, 235, 0.4);
}

.module-tablet--map {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(30, 18, 48, 0.72);
}

.module-tablet-open--primary {
  background: rgba(124, 58, 237, 0.45);
  border-color: rgba(168, 85, 247, 0.55);
}

.module-tablet-open--primary:hover {
  background: rgba(124, 58, 237, 0.65);
}

.map-module-launch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.42);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(37, 99, 235, 0.18));
}

.map-module-launch-preview {
  flex: 0 1 auto;
  max-width: 38%;
  min-width: 0;
}

.map-module-launch-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

.map-module-launch-img {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  min-height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: #0d1524;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.map-module-launch-img img {
  width: 100%;
  height: 100%;
  min-height: 52px;
  max-height: 64px;
  object-fit: contain;
  image-rendering: crisp-edges;
}

.map-module-launch-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0;
}

.map-module-launch-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-module-launch-meta {
  font-size: 0.64rem;
  color: #cbd5e1;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-module-launch-chip {
  display: none;
}

.map-module-launch-foot {
  display: none;
  font-size: 0.62rem;
  color: rgba(219, 234, 254, 0.72);
  line-height: 1.35;
  margin-top: 2px;
}

.map-module-launch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.map-module-launch-copy {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 8px;
  font-size: 0.62rem;
  font-weight: 400;
  color: #e8d9a8;
  line-height: 1.35;
  text-align: center;
  align-self: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-module-launch-btn {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(124, 58, 237, 0.85);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.map-module-launch-btn:hover {
  background: rgba(168, 85, 247, 0.95);
}

.map-module-launch-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
}

.map-module-launch-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 720px) {
  .map-module-launch-bar {
    flex-wrap: wrap;
  }
  .map-module-launch-preview {
    max-width: 100%;
    flex: 1 1 100%;
  }
  .map-module-launch-copy {
    flex: 1 1 100%;
    -webkit-line-clamp: 2;
    font-size: 0.6rem;
  }
  .map-module-launch-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .map-module-launch-foot {
    display: none;
  }
}

.inline-map-open {
  display: inline;
  margin: 0 2px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: rgba(124, 58, 237, 0.18);
  color: #e9d5ff;
  font: inherit;
  font-size: 0.92em;
  font-weight: 600;
  cursor: pointer;
  vertical-align: baseline;
}

.inline-map-open:hover {
  background: rgba(124, 58, 237, 0.32);
  border-color: rgba(168, 85, 247, 0.65);
}

.module-tablet-full {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  text-decoration: none;
}

.module-tablet-full:hover {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.28);
}

.product-sample-card.is-module .product-sample-link,
.product-sample-card.is-map-module .product-sample-link {
  cursor: pointer;
  display: flex;
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: inherit;
  color: inherit;
  padding: 0;
}

.product-sample-card.is-map-module .product-sample-img-wrap {
  position: relative;
}

.gw-module-open-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  pointer-events: none;
}
