:root {
  --csg-ink: #f7f8fa;
  --csg-muted: #d4dce4;
  --csg-red: #e52d39;
}

body.csg-gate-active { overflow: hidden !important; }
.csg-dialog {
  box-sizing: border-box;
  width: min(860px, calc(100vw - 16px));
  max-width: none;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  color: var(--csg-ink);
  background: transparent;
  box-shadow: none;
  font-family: Inter, "Aptos", "Segoe UI", Arial, sans-serif;
}
.csg-dialog::backdrop { background: rgba(2, 9, 17, .62); backdrop-filter: blur(4px); }
.csg-dialog-fallback { position: fixed; inset: 8px auto auto 50%; transform: translateX(-50%); z-index: 999999; }
.csg-scene {
  position: relative;
  box-sizing: border-box;
  display: flex;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  flex-direction: column;
  overflow: hidden;
  padding: 16px 24px;
  border: 1px solid rgba(245, 248, 250, .5);
  border-radius: 16px;
  background-color: #253b4c;
  background-image: linear-gradient(rgba(4, 14, 24, .48), rgba(4, 14, 24, .48)), var(--csg-background-image, url("research-americana.webp?ver=1.2.5"));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .42);
}
.csg-scene-header { position: relative; z-index: 1; display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 16px; color: #fff; text-shadow: 0 2px 9px rgba(0, 0, 0, .8); }
.csg-wordmark { display: flex; min-width: 0; flex: 0 1 190px; align-items: center; }
.csg-brand-logo { display: block; width: min(190px, 100%); max-width: 100%; height: auto; object-fit: contain; filter: brightness(0) invert(1); }
.csg-research-label { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 12px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.csg-research-label span { width: 8px; height: 8px; border-radius: 50%; background: #ed3541; }
.csg-card {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: flex;
  width: min(650px, 100%);
  min-height: 0;
  flex-direction: column;
  margin: 12px auto;
  padding: 20px 24px 16px;
  overflow: hidden;
  border: 1px solid rgba(233, 241, 247, .46);
  border-radius: 16px;
  background: rgba(22, 36, 49, .7);
  box-shadow: 0 12px 32px rgba(3, 11, 19, .35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.csg-card::before { position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: rgba(255,255,255,.035); content: ""; pointer-events: none; }
.csg-art { position: absolute; top: 7px; right: 7px; width: 42%; height: 90px; opacity: .13; pointer-events: none; }
.csg-art svg { width: 100%; height: 100%; overflow: visible; }
.csg-art path { fill: none; stroke: #dbeef7; stroke-width: 1.4; }
.csg-art circle { fill: #ee4650; stroke: #fff; stroke-width: 2; }
.csg-card h1 { position: relative; max-width: 540px; margin: 0; color: #fff; font: 500 30px/1.2 Georgia, "Times New Roman", serif; text-shadow: 0 2px 12px rgba(0,0,0,.32); }
.csg-intro { position: relative; margin: 8px 0 12px; color: #edf1f5; font-size: 14px; line-height: 20px; text-shadow: 0 1px 7px rgba(0,0,0,.5); }
.csg-status { flex: 0 0 auto; min-height: 0; margin: 0 0 4px; color: #fff; font-size: 14px; line-height: 20px; text-shadow: 0 1px 5px rgba(0,0,0,.55); }
.csg-status.is-error { color: #ffd8d8; }
.csg-card form { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.csg-form-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: rgba(255,255,255,.55) rgba(0,0,0,.18); }
.csg-form-body:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.csg-consents { margin: 0; padding: 0; border: 0; }
.csg-consent-grid { display: grid; gap: 8px; }
.csg-consents .csg-consent-card { position: relative; display: flex; min-height: 44px; align-items: flex-start; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid rgba(242,247,250,.48); border-radius: 12px; color: #f8f9fa; background: rgba(26,43,57,.38); font-size: 14px; line-height: 20px; text-shadow: 0 1px 5px rgba(0,0,0,.45); cursor: pointer; }
.csg-consents .csg-consent-card:hover { border-color: rgba(255,255,255,.82); background: rgba(29,46,61,.5); }
.csg-consent-card.is-checked { border-color: #ff6970; background: rgba(109,37,47,.47); box-shadow: inset 3px 0 #ed303c, 0 5px 17px rgba(0,0,0,.16); }
.csg-consent-card input { position: absolute; top: 11px; left: 12px; width: 22px; height: 22px; margin: 0; opacity: 0; cursor: pointer; }
.csg-consent-card:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.csg-consent-check { position: relative; display: block; flex: 0 0 22px; width: 22px; height: 22px; border: 1.5px solid rgba(255,255,255,.87); border-radius: 6px; background: rgba(4,16,27,.34); pointer-events: none; }
.csg-consent-card.is-checked .csg-consent-check { border-color: #ff676f; background: #e42d3a; }
.csg-consent-card.is-checked .csg-consent-check::after { position: absolute; top: 3px; left: 7px; width: 6px; height: 11px; transform: rotate(45deg); border: solid white; border-width: 0 2px 2px 0; content: ""; }
.csg-consent-copy { display: block; }
.csg-consents a { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: #ff7177; text-underline-offset: 3px; }
.csg-legal-label { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.csg-disclaimer { margin-top: 12px; padding: 12px; border: 1px solid rgba(238,243,247,.36); border-radius: 12px; background: rgba(9,20,31,.37); }
.csg-disclaimer h2 { margin: 0 0 8px; color: #fff; font-size: 16px; line-height: 20px; font-weight: 700; }
.csg-disclaimer p { margin: 0; color: #edf1f4; font-size: 14px; line-height: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.32); }
.csg-access-note { flex: 0 0 auto; margin: 8px 0 0; color: #f5f6f8; font-size: 14px; line-height: 20px; text-shadow: 0 1px 5px rgba(0,0,0,.45); }
.csg-preview-note { align-self: flex-end; position: relative; z-index: 2; margin: -4px 8px 0; padding: 4px 8px; border: 1px solid rgba(249,222,168,.62); border-radius: 8px; color: #fff1d2; background: rgba(42,34,24,.58); font-size: 12px; line-height: 16px; }
.csg-actions { display: flex; flex: 0 0 auto; gap: 8px; margin-top: 8px; }
.csg-primary, .csg-leave, .csg-retry { min-height: 44px; border: 0; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.csg-primary { flex: 1; padding: 0 16px; color: white; background: #e12937; box-shadow: 0 4px 12px rgba(101,14,24,.35); }
.csg-primary:not(:disabled):hover { filter: brightness(1.1); }
.csg-primary:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.csg-primary:focus-visible, .csg-leave:focus-visible, .csg-retry:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.csg-leave { flex: 1; padding: 0 16px; border: 1px solid rgba(244,248,250,.65); color: #fff; background: rgba(10,24,37,.27); }
.csg-leave:hover { background: rgba(10,24,37,.5); }
.csg-retry { min-height: 34px; margin: 0 0 0 8px; padding: 0 11px; color: white; background: #dc2b39; font-size: 14px; }
.csg-noscript { position: fixed; z-index: 2147483647; inset: 0; display: grid; place-items: center; padding: 24px; color: #fff; background: #10283d; text-align: center; font: inherit; font-size: 16px; line-height: 1.5; }

@media (max-width: 600px) {
  .csg-dialog { width: calc(100vw - 16px); }
  .csg-scene { padding: 8px; }
  .csg-scene-header { min-height: 26px; gap: 8px; }
  .csg-wordmark { flex-basis: 144px; max-width: 144px; }
  .csg-brand-logo { width: min(144px, 100%); }
  .csg-research-label { gap: 6px; font-size: 12px; }
  .csg-research-label span { width: 7px; height: 7px; }
  .csg-card { margin: 8px auto; padding: 12px; border-radius: 12px; }
  .csg-card h1 { font-size: 24px; line-height: 32px; }
  .csg-intro { margin: 4px 0 8px; }
  .csg-status { margin-bottom: 4px; }
  .csg-consents .csg-consent-card { gap: 8px; padding: 8px; }
  .csg-consent-card input { top: 9px; left: 8px; }
  .csg-disclaimer { margin-top: 8px; padding: 8px; }
  .csg-access-note { margin-top: 8px; }
  .csg-actions { margin-top: 8px; }
}
@media (max-height: 620px) {
  .csg-scene { padding-top: 8px; padding-bottom: 8px; }
  .csg-card { margin-top: 8px; margin-bottom: 8px; padding-top: 8px; padding-bottom: 8px; }
  .csg-form-body { flex-basis: 0; }
}
/* Give flex children a definite viewport budget so short screens retain a readable body. */
.csg-scene { height:min(720px,calc(100vh - 16px)); height:min(720px,calc(100dvh - 16px)); }
.csg-scene-header,.csg-preview-note,.csg-card h1,.csg-intro { flex-shrink:0; }
.csg-card { flex:1 1 auto; }
.csg-status:empty { display:none; }
