:root {
  color-scheme: light;
  --ink: #303740;
  --ink-strong: #1f2b34;
  --muted: #5d6b73;
  --rose: #d5718c;
  --rose-dark: #8e344d;
  --paper: #fffdfb;
  --surface: #ffffff;
  --ice: #c9e4f2;
  --line: #d8e1e5;
  --status-open: #f4cad9;
  --status-selected: #c9e4f2;
  --status-closed: #8996a6;
  --status-review: #e5e8eb;
  --focus: #8e344d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: 16px/1.55 "Avenir Next", Avenir, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; }
button, a, summary, input, select, textarea, .land { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea, summary, a, .land { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Programmatically focused headings are landmarks, not controls; keep a soft visible cue without a red box. */
#card-title:focus-visible, #gulf-title:focus-visible { outline: none; box-shadow: 0 2px 0 #526f7e; }

.gtpm-app { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 clamp(12px, 2.7vw, 40px); }
.eyebrow { margin: 0 0 10px; color: #9b5269; font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.08; }
h1, .form-intro h2 { margin: 0; font: 500 clamp(38px, 5.5vw, 70px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
h2 { margin: 0; font: 500 clamp(26px, 3vw, 36px)/1.1 Georgia, "Times New Roman", serif; }
h3 { margin: 0; font: 500 clamp(26px, 3vw, 34px)/1.1 Georgia, "Times New Roman", serif; }
em { color: var(--rose); font-style: normal; }
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); align-items: end; gap: clamp(18px, 5vw, 70px); padding: clamp(24px, 4vw, 52px) 0 clamp(24px, 3.5vw, 42px); }
.intro-copy { max-width: 520px; padding-bottom: 4px; }
.intro-copy h2 { margin-bottom: 10px; font-size: clamp(23px, 2.2vw, 30px); }
.intro-copy p { margin: 0; color: var(--muted); }
html[data-gtpm-embed-mode="distributor"] .intro { display: none; }

.explorer { padding: clamp(16px, 3vw, 34px); border: 1px solid #e4e6e7; border-radius: 24px; background: linear-gradient(132deg, #fbf0f3 0%, #f8f8f7 43%, #edf6f8 100%); box-shadow: 0 16px 45px #31414a0b; }
.sectionhead { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.sectionhead > p { max-width: 410px; margin: 0 0 2px; color: var(--muted); font-size: 14px; }
.sectionhead .eyebrow { margin-bottom: 8px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(250px, .8fr); align-items: start; gap: clamp(16px, 2vw, 28px); }
.market-controls { min-width: 0; }
label { display: block; margin: 10px 0 6px; color: var(--ink-strong); font-size: 14px; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; border: 1px solid #bdcbd1; border-radius: 10px; background: var(--surface); color: var(--ink-strong); }
input::placeholder { color: #65727a; opacity: 1; }
textarea { min-height: 100px; resize: vertical; }
#no-match, .data-status { margin: 8px 0; color: var(--muted); font-size: 14px; }
.data-status:empty { display: none; }

.gulf-open, .primary-action, .actions button, .card-continue {
  display: inline-flex; min-height: 46px; justify-content: center; align-items: center; gap: 10px;
  padding: 10px 16px; border: 1px solid #a8bac1; border-radius: 10px;
  background: var(--surface); color: var(--ink-strong); font-weight: 750; text-align: center; text-decoration: none; cursor: pointer;
}
.gulf-open { width: 100%; justify-content: space-between; margin: 13px 0 0; }
.gulf-open:hover, .card-continue:hover { border-color: var(--rose-dark); background: #fff8fa; }
.gulf-open[aria-expanded="true"] { border-color: var(--rose-dark); box-shadow: 0 0 0 2px #d5718c25; }
button:disabled { border-color: #bec8cd; background: #e0e5e8; color: #45535c; cursor: not-allowed; }
.icon-button { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #a8bac1; border-radius: 50%; background: white; color: var(--ink-strong); font-size: 24px; line-height: 1; cursor: pointer; }
.gulf-panel { margin: 10px 0 14px; padding: clamp(14px, 2vw, 22px); border: 1px solid #cddbe0; border-radius: 18px; background: #fffdfc; box-shadow: 0 12px 30px #273d480e; }
.gulf-panel[hidden] { display: none; }
.gulf-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.gulf-heading .eyebrow { margin-bottom: 6px; }
.gulf-heading h3 { font-size: 25px; }
.gulf-policy-note { margin: 12px 0 4px; color: #33434c; font-size: 14px; }
.gulf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 10px; }
.gulf-market {
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 3px;
  min-width: 0; min-height: 60px; padding: 9px 11px; border: 1px solid #aab8c0;
  border-left: 5px solid var(--status-closed); border-radius: 11px; background: #edf1f3;
  color: var(--ink-strong); text-align: left; cursor: pointer;
}
.gulf-market[data-status="OPEN"] { border-left-color: #b45974; background: #fdf1f5; }
.gulf-market[data-status="PRODUCT_SELECTED"] { border-left-color: #5a8295; background: #eff8fc; }
.gulf-market[data-status="REVIEW_REQUIRED"] { border-left: 5px dashed #65717b; background: var(--status-review); }
.gulf-market strong { font-size: 14px; line-height: 1.2; }
.gulf-market span { color: #34434c; font-size: 12px; line-height: 1.2; }
.gulf-market:hover { border-color: #667985; background: #e4ebef; }
.gulf-panel .hint { margin: 8px 0 0; }

.map-disclosure { margin-top: 14px; }
.map-disclosure > summary {
  display: flex; min-height: 48px; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 13px; border: 1px solid #d5e0e4; border-radius: 11px;
  background: #f9fcfc; color: var(--ink-strong); font-size: 14px; font-weight: 750; cursor: pointer; list-style: none;
}
.map-disclosure > summary::-webkit-details-marker { display: none; }
.map-disclosure > summary::after { content: "+"; flex: 0 0 auto; color: #8e344d; font-size: 22px; line-height: 1; }
.map-disclosure[open] > summary::after { content: "−"; }
.summary-note { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; text-align: right; }
#mapwrap { margin-top: 10px; padding: clamp(10px, 1.5vw, 16px); border: 1px solid #d5e1e5; border-radius: 15px; background: #fbfefe; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 15px; margin: 0 0 12px; padding: 0; list-style: none; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; color: var(--ink-strong); font-size: 12px; font-weight: 650; }
.swatch { flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid #66757d; border-radius: 4px; background: var(--status-open); }
.legend-item[data-status="OPEN"] .swatch { background: var(--status-open); }
.legend-item[data-status="PRODUCT_SELECTED"] .swatch { background: var(--status-selected); }
.legend-item[data-status="TERRITORY_CLOSED"] .swatch { background: var(--status-closed); }
.legend-item[data-status="REVIEW_REQUIRED"] .swatch { border: 2px dashed #65717b; background: var(--status-review); }
#map { display: block; width: 100%; height: auto; border-radius: 8px; touch-action: pan-x pan-y pinch-zoom; }
.land { cursor: pointer; stroke: #fff; stroke-width: .7; vector-effect: non-scaling-stroke; }
.land[data-status="OPEN"] { fill: var(--status-open); }
.land[data-status="PRODUCT_SELECTED"] { fill: var(--status-selected); }
.land[data-status="TERRITORY_CLOSED"] { fill: var(--status-closed); }
.land[data-status="REVIEW_REQUIRED"] { fill: var(--status-review); stroke: #65717b; stroke-width: 1; stroke-dasharray: 2 1.5; }
.land:hover { filter: brightness(.94); }
.land.selected { stroke: #263743; stroke-width: 2.5; paint-order: stroke fill; }
.land:focus-visible { stroke: #263743; stroke-width: 3; paint-order: stroke fill; }
.map-disclaimer { margin: 11px 0 0; color: #47565e; font-size: 13px; font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; }
.touch-hint { display: none; }
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  .keyboard-hint { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
  .touch-hint { display: block; }
}
.map-error { padding: 13px; border: 1px solid #b8c3c8; border-radius: 10px; background: #f1f3f4; }

#card { min-width: 0; min-height: 220px; padding: clamp(20px, 2.5vw, 30px); border: 1px solid #e1e4e5; border-radius: 18px; background: var(--surface); box-shadow: 0 12px 30px #2839410a; scroll-margin-top: 16px; }
.card-kicker { display: block; color: #56636a; font-size: 11px; letter-spacing: .13em; line-height: 1.5; }
#card h3 { margin: 25px 0 12px; }
.status { display: inline-flex; margin: 0 0 8px; padding: 7px 12px; border: 1px solid transparent; border-radius: 999px; color: var(--ink-strong); font-size: 12px; font-weight: 800; line-height: 1.3; }
.status[data-status="OPEN"] { background: var(--status-open); }
.status[data-status="PRODUCT_SELECTED"] { background: var(--status-selected); }
.status[data-status="TERRITORY_CLOSED"] { background: var(--status-closed); color: #1f2b34; }
.status[data-status="REVIEW_REQUIRED"] { border: 2px dashed #65717b; background: var(--status-review); color: #26313a; }
.status-visible[aria-hidden="true"] { display: inline; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.card-continue { min-height: 44px; margin-top: 8px; font-size: 14px; }

.formsection { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(20px, 5vw, 72px); padding: clamp(32px, 6vw, 76px) 0 28px; }
.form-disclosure { margin: 0; }
.form-disclosure > summary { display: none; }
html[data-gtpm-embed-mode="distributor"] .form-disclosure { margin-top: 18px; }
html[data-gtpm-embed-mode="distributor"] .form-disclosure > summary {
  display: flex; min-height: 48px; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 13px; border: 1px solid #d5e0e4; border-radius: 11px;
  background: #fff; color: var(--ink-strong); font-size: 14px; font-weight: 750; cursor: pointer; list-style: none;
}
.form-disclosure > summary::-webkit-details-marker { display: none; }
.form-disclosure > summary::after { content: "+"; flex: 0 0 auto; color: var(--rose-dark); font-size: 22px; line-height: 1; }
.form-disclosure[open] > summary::after { content: "−"; }
html[data-gtpm-embed-mode="distributor"] .form-disclosure > .formsection { padding-top: 24px; }
.form-intro { max-width: 460px; }
.form-intro .eyebrow { margin-bottom: 12px; }
.form-intro h2 { font-size: clamp(34px, 4.5vw, 58px); }
.form-intro > p:last-child { max-width: 380px; color: var(--muted); }
form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px 16px; }
form label { margin: 0; }
form input, form select, form textarea { margin-top: 5px; }
.full-row { grid-column: 1 / -1; }
.primary-action { width: fit-content; min-height: 48px; border-color: #8e344d; background: #8e344d; color: #fff; }
.primary-action:hover { background: #71283e; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.actions[hidden] { display: none; }
.actions button { min-height: 44px; }
.actions p { flex: 1 1 100%; margin: 2px 0 0; }
#message { max-height: 380px; overflow: auto; margin: 0; padding: 16px; border: 1px solid #d4dfe3; border-radius: 12px; background: #f7fafb; color: #26313a; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.disclaimer { margin: 20px 0 0; padding: 18px 0 24px; border-top: 1px solid var(--line); color: #526168; font-size: 13px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1.3fr) minmax(230px, .8fr); }
  .explorer { border-radius: 20px; }
}
@media (max-width: 760px) {
  .gtpm-app { padding-inline: 10px; }
  .intro, .layout, .formsection { grid-template-columns: minmax(0, 1fr); }
  .intro { gap: 10px; padding: 20px 2px 18px; }
  .intro h1 { font-size: clamp(36px, 8.5vw, 54px); }
  .intro-copy h2 { font-size: 23px; }
  .intro-copy p { font-size: 15px; }
  .explorer { padding: 15px; border-radius: 18px; }
  .sectionhead { display: block; margin-bottom: 14px; }
  .sectionhead h2 { font-size: 30px; }
  .sectionhead > p { margin-top: 9px; font-size: 14px; }
  .layout { gap: 13px; }
  .market-controls label { margin-top: 8px; }
  .market-controls input, .market-controls select { min-height: 50px; }
  .gulf-open { min-height: 48px; }
  #card { min-height: 0; padding: 18px; }
  #card h3 { margin: 13px 0 10px; font-size: 29px; }
  .formsection { gap: 12px; padding: 30px 2px 18px; }
  .form-intro h2 { font-size: 37px; }
  form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .full-row { grid-column: 1; }
  .primary-action { width: 100%; }
  .actions button { flex: 1 1 100%; }
  .summary-note { max-width: 42%; font-size: 11px; }
}
@media (max-width: 380px) {
  .gtpm-app { padding-inline: 7px; }
  .explorer { padding: 12px; }
  .gulf-grid { grid-template-columns: minmax(0, 1fr); }
  .gulf-market { grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 52px; gap: 8px; }
  .gulf-market strong { font-size: 14px; }
  .gulf-market span { max-width: 105px; text-align: right; }
  .map-disclosure > summary { align-items: flex-start; flex-wrap: wrap; }
  .summary-note { max-width: none; margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
