/*
 * Compensation-model screens on the public guides (templates/core/guides/_models.html, drawn by
 * core/js/guide-models.js). Every colour is a --ds-* token, so the stages follow light and dark mode.
 * The drawings sit on a 352 x 390 canvas that guide-models.js scales to its box through --gm-scale.
 */

/* ---------- one screen ---------- */

.gm-screen {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: var(--ds-space-4) 0 var(--ds-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-8);
  box-sizing: border-box;
  min-width: 0;
}

.gm-lede {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-text-muted);
  text-wrap: pretty;
}

/* App-style option card: model name and tagline, the selected look of the listing form */
.gm-model {
  position: relative;
  box-sizing: border-box;
  background: var(--ds-surface);
  border: 1.5px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-12);
  padding: var(--ds-space-12) 52px var(--ds-space-12) var(--ds-space-16);
}

.gm-model--sel {
  background: var(--ds-accent-soft);
  border-color: var(--ds-text);
}

.gm-model__name {
  display: block;
  margin: 0;
  font-family: var(--ds-font-family);
  font-size: 17px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--ds-text);
}

.gm-model__tag {
  display: block;
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-text-muted);
}

.gm-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ds-inverse);
  box-shadow: inset 0 0 0 1.5px var(--ds-inverse-edge);
  color: var(--ds-accent);
  font-size: 13px;
  display: grid;
  place-items: center;
}

.gm-model__check {
  position: absolute;
  right: var(--ds-space-16);
  top: 50%;
  transform: translateY(-50%);
}

.gm-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-8);
}

/* ---------- stage box and canvas ---------- */

.gm-stagebox {
  position: relative;
  flex: 0 0 auto;
  height: clamp(240px, 44dvh, 420px);
  background: var(--ds-surface);
  border: 1.5px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-24);
  overflow: hidden;
}

.gm-stage {
  position: absolute;
  inset: 0;
}

.gm-example {
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 2;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  color: var(--ds-text-muted);
  background: var(--ds-surface-subtle);
  border-radius: var(--ds-radius-pill);
  padding: 3px 9px;
}

.gm-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 352px;
  height: 390px;
  transform-origin: 0 0;
  transform: translate(
      calc(-176px * var(--gm-scale, 1)),
      calc(-195px * var(--gm-scale, 1))
    )
    scale(var(--gm-scale, 1));
  font-family: var(--ds-font-family);
  font-size: 15px;
  color: var(--ds-text);
}

.gm-fill {
  position: absolute;
  inset: 0;
}

.gm-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}

/* ---------- copy under the stage ---------- */

.gm-copy {
  min-width: 0;
}

.gm-copy__a {
  margin: 0;
  font-size: clamp(15px, 2.5dvh, 19px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-text);
  text-wrap: balance;
}

.gm-copy__b {
  margin: var(--ds-space-8) 0 0;
  font-size: clamp(13px, 1.9dvh, 15px);
  line-height: 1.4;
  color: var(--ds-text);
  text-wrap: pretty;
}

.gm-copy__b:empty {
  display: none;
}

.gm-copy__c {
  margin: var(--ds-space-8) 0 0;
  padding: var(--ds-space-8) var(--ds-space-12);
  font-size: clamp(12.5px, 1.8dvh, 14px);
  line-height: 1.4;
  color: var(--ds-text);
  background: var(--ds-accent-soft);
  border: 1.5px solid var(--ds-text);
  border-radius: var(--ds-radius-12);
  text-wrap: pretty;
}

@media (max-height: 700px) {
  .gm-lede {
    display: none;
  }
}

@media (max-height: 600px) {
  .gm-copy__b {
    display: none;
  }
}

/* Wide screens: the stage beside its copy inside the 720px column */
@media (min-width: 760px) and (min-height: 520px) {
  .gm-body {
    flex-direction: row;
    gap: var(--ds-space-16);
    align-items: stretch;
  }

  .gm-stagebox {
    flex: 1 1 55%;
    height: auto;
    aspect-ratio: 352 / 390;
  }

  .gm-copy {
    flex: 1 1 45%;
    align-self: center;
  }

  .gm-copy__a {
    font-size: 21px;
  }

  .gm-copy__b {
    font-size: 16px;
  }

  .gm-copy__c {
    font-size: 14px;
  }
}

/* ---------- pills, fields, text on the canvas ---------- */

.gm-pill {
  position: absolute;
  padding: 5px 12px;
  border-radius: var(--ds-radius-pill);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.gm-pill--soft {
  background: var(--ds-accent-soft);
  border: 1.5px solid var(--ds-text);
  color: var(--ds-text);
}

.gm-pill--ink {
  background: var(--ds-inverse);
  box-shadow: inset 0 0 0 1.5px var(--ds-inverse-edge);
  color: var(--ds-accent);
}

.gm-pill--success {
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-text);
}

.gm-pill--warning {
  background: var(--ds-status-warning-bg);
  color: var(--ds-status-warning-text);
}

.gm-pill--active {
  background: var(--ds-status-active-bg);
  color: var(--ds-status-active-text);
}

.gm-field-label {
  position: absolute;
  top: 34px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-text-muted);
}

.gm-field-box {
  position: absolute;
  top: 58px;
  width: 148px;
  height: 44px;
  box-sizing: border-box;
  border: 1.5px solid var(--ds-border-subtle);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 16px;
  line-height: 20px;
  color: var(--ds-text);
}

.gm-x-a {
  left: 18px;
}

.gm-x-b {
  left: 186px;
}

.gm-unit {
  float: right;
  color: var(--ds-text-muted);
}

/* SVG parts shared by the stages */
.gm-axis {
  stroke: var(--ds-border-subtle);
  stroke-width: 1.5px;
}

.gm-bar {
  fill: var(--ds-border);
}

.gm-bar-over {
  fill: var(--ds-accent);
  stroke: var(--ds-text);
  stroke-width: 1.5px;
}

.gm-baseline {
  stroke: var(--ds-text);
  stroke-width: 2px;
  stroke-dasharray: 7 6;
}

.gm-baseline-label {
  fill: var(--ds-text);
  font-size: 14px;
  font-weight: 600;
  text-anchor: end;
}

.gm-tick {
  fill: var(--ds-text-muted);
  font-size: 13px;
  text-anchor: middle;
}

.gm-pie {
  fill: var(--ds-surface-subtle);
  stroke: var(--ds-border-subtle);
  stroke-width: 1.5px;
}

.gm-pie-rest {
  fill: var(--ds-surface);
  stroke: var(--ds-text);
  stroke-width: 1.5px;
  stroke-dasharray: 5 5;
}

.gm-pie-done {
  fill: var(--ds-accent);
  stroke: var(--ds-text);
  stroke-width: 1.5px;
}

.gm-chip {
  fill: var(--ds-surface);
  stroke: var(--ds-border-subtle);
  stroke-width: 1.5px;
}

.gm-chip--on {
  fill: var(--ds-inverse);
  stroke: var(--ds-inverse-edge);
}

.gm-chip-text {
  fill: var(--ds-text-muted);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
}

.gm-chip-text--on {
  fill: var(--ds-accent);
}

.gm-cell {
  fill: var(--ds-surface-subtle);
  stroke: var(--ds-border-subtle);
  stroke-width: 1.5px;
  stroke-dasharray: 4 4;
}

.gm-cell-paid {
  fill: var(--ds-accent-soft);
  stroke: var(--ds-text);
  stroke-width: 1.5px;
}

.gm-cell-amount {
  fill: var(--ds-text);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
}

.gm-cell-month {
  fill: var(--ds-text-muted);
  font-size: 11.5px;
  text-anchor: middle;
}

/* ---------- equity ---------- */

.gm-eq-issued {
  left: 18px;
  top: 34px;
  opacity: 0;
}

.gm-eq-milestone,
.gm-eq-vested {
  position: absolute;
  left: 0;
  width: 352px;
  text-align: center;
}

.gm-eq-milestone {
  top: 316px;
  font-size: 21px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ds-text);
}

.gm-eq-vested {
  top: 348px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-text-muted);
}

.gm-eq-full {
  left: 50%;
  top: 344px;
  transform: translateX(-50%);
  opacity: 0;
}

/* ---------- hybrid ---------- */

.gm-hy-month {
  position: absolute;
  left: 186px;
  top: 44px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ds-text);
}

.gm-hy-vesting {
  position: absolute;
  left: 186px;
  top: 74px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-text-muted);
}

.gm-hy-floor {
  position: absolute;
  left: 18px;
  top: 172px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ds-text);
}

.gm-hy-paid {
  position: absolute;
  right: 18px;
  top: 172px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-text-muted);
}

.gm-hy-tip {
  left: 186px;
  top: 112px;
  padding: 4px 10px;
  font-size: 12.5px;
  line-height: 18px;
  opacity: 0;
}

/* ---------- revenue share ---------- */

.gm-rev-pill {
  left: 18px;
  top: 354px;
  opacity: 0;
}

/* ---------- milestone ---------- */

.gm-ms {
  position: absolute;
  left: 18px;
  top: 34px;
  width: 316px;
  height: 350px;
  opacity: 0;
}

.gm-ms-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 316px;
  height: 100px;
  box-sizing: border-box;
  border: 1.5px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-12);
}

.gm-ms-num {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--ds-surface-subtle);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-status-success-text);
}

.gm-ms-title {
  position: absolute;
  left: 62px;
  top: 12px;
  width: 240px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ds-text);
}

.gm-ms-amount {
  left: 14px;
  top: 62px;
}

.gm-ms-tagwrap {
  position: absolute;
  right: 14px;
  top: 62px;
  perspective: 300px;
}

.gm-ms-tag {
  position: relative;
  opacity: 0;
}

.gm-ms-eyebrow {
  position: absolute;
  left: 2px;
  top: 116px;
  font-size: 12.5px;
  line-height: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ds-text-muted);
}

.gm-ms-trigger {
  position: absolute;
  left: 2px;
  top: 138px;
  font-size: 19px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ds-text);
}

.gm-ms-vis {
  position: absolute;
  left: 0;
  top: 176px;
  width: 316px;
  height: 130px;
}

.gm-ms-steps {
  position: absolute;
  left: 0;
  top: 286px;
}

.gm-bar-label,
.gm-bar-value {
  position: absolute;
  top: 6px;
  font-size: 14px;
  line-height: 20px;
}

.gm-bar-label {
  left: 2px;
  color: var(--ds-text-muted);
}

.gm-bar-value {
  right: 2px;
  font-weight: 600;
  color: var(--ds-text);
}

.gm-track,
.gm-track-fill {
  position: absolute;
  left: 2px;
  top: 36px;
  height: 14px;
  box-sizing: border-box;
  border-radius: 7px;
}

.gm-track {
  width: 312px;
  background: var(--ds-status-neutral-bg);
}

.gm-track-fill {
  background: var(--ds-accent);
  border: 1.5px solid var(--ds-text);
}

.gm-date {
  position: absolute;
  left: 2px;
  top: 0;
  width: 96px;
  height: 100px;
  box-sizing: border-box;
  border-radius: var(--ds-radius-12);
  border: 1.5px solid var(--ds-border-subtle);
  overflow: hidden;
  background: var(--ds-surface);
}

.gm-date--met {
  border-color: var(--ds-text);
  background: var(--ds-accent-soft);
}

.gm-date-head {
  height: 28px;
  background: var(--ds-inverse);
  color: var(--ds-on-inverse);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 28px;
}

.gm-date-num {
  font-size: 38px;
  font-weight: 700;
  text-align: center;
  line-height: 68px;
  color: var(--ds-text);
}

.gm-date-note,
.gm-date-state {
  position: absolute;
  left: 116px;
  font-size: 14px;
  line-height: 20px;
}

.gm-date-note {
  top: 22px;
  color: var(--ds-text-muted);
}

.gm-date-state {
  top: 48px;
  font-weight: 600;
  color: var(--ds-text);
}

.gm-step-line {
  stroke: var(--ds-border-subtle);
  stroke-width: 2px;
}

.gm-step-line--on {
  stroke: var(--ds-text);
}

.gm-dot {
  fill: var(--ds-surface);
  stroke: var(--ds-border-subtle);
  stroke-width: 1.5px;
}

.gm-dot--on {
  fill: var(--ds-inverse);
  stroke: var(--ds-inverse-edge);
}

.gm-step-check {
  fill: var(--ds-accent);
  font-size: 13px;
  text-anchor: middle;
}

.gm-step-num {
  fill: var(--ds-text-muted);
  font-size: 12px;
  text-anchor: middle;
}

.gm-step-label {
  fill: var(--ds-text-muted);
  font-size: 13px;
  text-anchor: middle;
}

.gm-step-label--on {
  fill: var(--ds-text);
  font-weight: 600;
}

/* ---------- choosing: the four models as cards ---------- */

.gm-pick {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, minmax(84px, 140px));
  gap: var(--ds-space-12);
  padding: var(--ds-space-12);
  align-content: center;
  box-sizing: border-box;
}

.gm-pick-option {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  min-height: 84px;
  padding: var(--ds-space-16) var(--ds-space-12);
  font: inherit;
  text-align: left;
  color: var(--ds-text);
  cursor: pointer;
  background: var(--ds-surface);
  border: 1.5px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-12);
}

.gm-pick-option--sel {
  background: var(--ds-accent-soft);
  border-color: var(--ds-text);
  padding-right: 46px;
}

.gm-pick-option .gm-check {
  position: absolute;
  right: var(--ds-space-12);
  top: var(--ds-space-12);
}

.gm-pick-option:focus-visible {
  outline: 2px solid var(--ds-focus-ring);
  outline-offset: 2px;
}

.gm-pick-name {
  display: block;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
}

.gm-pick-tag {
  display: block;
  margin-top: var(--ds-space-4);
  font-size: 13px;
  line-height: 18px;
  color: var(--ds-text-muted);
}
