/* ==========================================================================
   PARTNER PAGES (/partners, /partners/{slug}). Rebuilt 2026-11-16.
   The binding standard for these pages is docs/frontend/PARTNER-PAGES.md. Read it before adding a
   partner page. In short:
   - Site tokens only: no colour, radius or shadow of our own. Ink buttons, neutral greys,
     hairline rules (the "plain" look in site.css). No blue, no upper-case, no mono labels.
   - Every block sits on the site's page grid (var(--gutter)): a section head is heading | intro
     in halves, content below runs the full rail, and paired columns stretch to the same height.
     Nothing is capped to a character width inside a column that is wider than the text.
   - The site's three ranges, nothing else: desktop >= 1180, tablet 768-1179, phone < 768.
   - One button scale: 48 px for hero calls to action, 44 px everywhere else, 15 px text.
   ========================================================================== */

/* The dark player stage looks the same in both themes, so it carries its own neutral ink (the
   values of the site's dark theme), not a second palette. */
[data-partner-slug] {
  --stage-ink: #F2F2EE;
  --stage-ink2: #BEBEB8;
  --stage-line: #4A4A46;
}

/* ---------- Buttons: one scale ---------- */
[data-partner-slug] .tp-btn {
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

[data-partner-slug] .tp-actions .tp-btn {
  min-height: 48px;
  padding: 0 24px;
}

[data-partner-slug] .tp-btn--block {
  width: 100%;
}

/* ---------- Section head: heading | intro (and the hero's calls to action) ---------- */
.deal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px var(--gutter);
  margin-bottom: clamp(32px, 4vw, 48px);
}

.deal-head :is(.tp-h1, .tp-h2) {
  margin: 0;
  max-width: none;
  text-wrap: pretty;
}

.deal-head .tp-lede {
  margin: 0;
  max-width: none;
}

.deal-head__side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.deal-head__side .tp-actions {
  margin-top: 0;
}

/* ---------- Facts: one ruled row of label / value cells ---------- */
.deal-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin: 0 0 clamp(32px, 4vw, 48px);
}

.deal-facts > div {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line2);
}

.deal-facts dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg3);
}

.deal-facts dd {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* ---------- Live bench: the player stage beside what to check ---------- */
.deal-bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gutter);
  align-items: stretch;
}

.deal-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line2);
  border-radius: var(--radius-card);
  background: var(--panel);
  overflow: hidden;
}

.deal-stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}

.deal-stage__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.deal-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deal-tab {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line2);
  background: transparent;
  color: var(--fg2);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.deal-tab:hover {
  background: var(--bg2);
  color: var(--fg);
}

.deal-tab[aria-selected="true"] {
  background: var(--fg);
  box-shadow: none;
  color: var(--bg);
}

.deal-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The viewport is one grid cell holding the poster or the player, so a poster longer than the
   16:9 box makes the box taller instead of spilling over the bar and the caption. */
.deal-stage__viewport {
  display: grid;
  flex: 1 1 auto;
  background: var(--bg-stage);
  color: var(--stage-ink);
}

.deal-stage__viewport[data-kind="video"] {
  aspect-ratio: 16 / 9;
}

.deal-stage__viewport[data-kind="pdf"] {
  min-height: clamp(460px, 70vh, 720px);
}

.deal-stage__poster,
.deal-stage__mount {
  grid-area: 1 / 1;
  min-width: 0;
}

.deal-stage__poster[hidden],
.deal-stage__mount[hidden] {
  display: none;
}

.deal-stage__poster {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(24px, 4vw, 48px);
}

.deal-stage__poster h3 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--stage-ink);
  text-wrap: pretty;
}

.deal-stage__poster p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--stage-ink2);
}

.deal-stage__poster-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Buttons on the dark stage: the site's buttons with the ink turned round. */
[data-partner-slug] .deal-stage__poster .tp-btn--primary {
  background-color: var(--stage-ink);
  color: #111110;
}

[data-partner-slug] .deal-stage__poster .tp-btn--primary:hover {
  background-color: var(--stage-ink2);
}

[data-partner-slug] .deal-stage__poster .tp-btn--secondary {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--stage-line);
  color: var(--stage-ink);
}

[data-partner-slug] .deal-stage__poster .tp-btn--secondary:hover {
  background-color: rgba(242, 242, 238, 0.08);
}

.deal-stage__mount {
  position: relative;
  min-height: 100%;
}

.deal-stage__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.deal-stage__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--fg2);
}

/* What to check, beside the stage: rows of label and plain-text value, the action at the foot. */
.deal-inspector {
  display: flex;
  flex-direction: column;
}

.deal-inspector .sw-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 4px 20px 20px;
}

.deal-inspector .tp-field-row {
  display: block;
  padding: 14px 0;
}

.deal-inspector .tp-field-row__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg3);
}

.deal-inspector .tp-field-row__value {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.deal-inspector__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

/* IDs for the engineers: a disclosure at the foot of a panel. */
.deal-tech {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.deal-tech summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg2);
}

.deal-tech summary:hover {
  color: var(--fg);
}

.deal-tech__ids {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 4px;
}

.deal-tech__ids div {
  min-width: 0;
}

.deal-tech__ids dt {
  font-size: 13px;
  color: var(--fg3);
}

.deal-tech__ids dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* ---------- A pair of equal-height columns (steps | tool) ---------- */
.deal-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 4vw, 48px) var(--gutter);
  align-items: stretch;
}

.deal-pair > * {
  min-width: 0;
}

.deal-pair .tp-steps {
  margin-top: 0;
}

/* Steps share out the column's height, so their last rule meets the foot of the panel beside. */
.deal-pair > .tp-steps,
.deal-pair > div > .tp-steps:only-child {
  height: 100%;
}

.deal-pair .tp-steps li {
  flex: 1 1 auto;
}

/* The code panel on the hub's integration section fills its column's height. */
.deal-pair > .tp-window {
  display: flex;
  flex-direction: column;
}

.deal-pair > .tp-window .sw-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.deal-pair > .tp-window .tp-callout {
  margin-top: auto;
}

/* ---------- Inline screenshot check ---------- */
.scanner-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line2);
  border-radius: var(--radius-card);
  background: var(--panel);
}

.scanner-box__h {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
}

.scanner-box__p {
  margin: -8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg2);
}

.scan-drop {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed var(--line2);
  border-radius: 8px;
  background: var(--bg2);
  text-align: center;
  cursor: pointer;
}

.scan-drop:hover,
.scan-drop.is-over,
.scan-drop:focus-within {
  border-color: var(--fg2);
}

.scan-drop.has-files {
  border-style: solid;
  border-color: var(--fg);
}

.scan-drop__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.scan-drop__text {
  font-size: 15px;
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.scan-drop.has-files .scan-drop__text {
  color: var(--fg);
  font-weight: 600;
}

.scan-drop__btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line2);
  background: var(--panel);
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.scan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.scan-status {
  flex: 1 1 200px;
  margin: 0;
  font-size: 14px;
  color: var(--fg2);
}

.scan-status:empty {
  display: none;
}

.scan-verdict {
  padding: 16px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--bg2);
}

.scan-verdict--err {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.scan-badge {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
}

.scan-badge--match {
  color: var(--ok);
}

.scan-badge--err {
  color: var(--danger);
}

.scan-dl {
  display: grid;
  grid-template-columns: minmax(110px, 140px) minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0 0 10px;
  font-size: 14px;
}

.scan-dl dt {
  color: var(--fg3);
}

.scan-dl dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.scan-chance {
  margin: 8px 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.scan-caveat {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg2);
}

.scan-asset-field select {
  width: 100%;
}

.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--bg2);
}

.key-box code {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  background: none;
  padding: 0;
}

.key-box .tp-btn {
  flex: none;
}

/* ---------- The decision: options in a row, then one confirm panel ---------- */
.deal-choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px var(--gutter);
}

.deal-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line2);
  border-radius: var(--radius-card);
  background: var(--panel);
  cursor: pointer;
}

.deal-choice:hover {
  border-color: var(--fg2);
}

.deal-choice:focus-within {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.deal-choice.is-selected {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

.deal-choice input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--fg);
  cursor: pointer;
}

.deal-choice__tag {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg3);
}

.deal-choice__title {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.deal-choice__desc {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg2);
}

/* Open, not boxed: a rule above it, and its fields sit on the same columns as the options. */
.deal-form {
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--line2);
}

.deal-form__h {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.deal-chosen {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--fg2);
}

.deal-chosen strong {
  color: var(--fg);
}

.deal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px var(--gutter);
  margin-top: 20px;
}

.deal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.deal-field--full {
  grid-column: 1 / -1;
}

.deal-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.deal-field input,
.deal-field select,
.deal-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.4 var(--font-sans);
}

.deal-field textarea {
  resize: vertical;
}

.deal-field :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 1px;
}

.deal-field input::placeholder,
.deal-field textarea::placeholder {
  color: var(--fg3);
  opacity: 1;
}

.deal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.deal-next {
  flex: 1 1 260px;
  margin: 0 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg2);
}

.deal-err {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}

.deal-err:empty {
  display: none;
}

.deal-ok {
  padding: 20px;
  border: 1px solid var(--ok);
  border-radius: var(--radius-card);
  background: var(--ok-bg);
  color: var(--fg);
}

.deal-ok h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--ok);
}

.deal-ok p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Comparison table: column names in the text face ---------- */
[data-partner-slug] .vps-table thead th,
[data-partner-slug] .vps-table tbody td::before {
  font-family: var(--font-sans);
  letter-spacing: 0;
}

[data-partner-slug] .vps-table thead th {
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Hub: the three-stage strip ---------- */
[data-partner-slug] .rw-stage__top {
  flex-wrap: wrap;
  gap: 4px 12px;
}

[data-partner-slug] .rw-stage__step,
[data-partner-slug] .rw-stage__badge {
  white-space: nowrap;
}

[data-partner-slug] .rw-stage__badge,
[data-partner-slug] .rw-stage__badge--ok {
  color: var(--fg2);
}

/* ---------- Desktop: 1180 px and wider ---------- */
@media (width >= 1180px) {
  .deal-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  /* In a half column the site's 50 px headline cannot fit a long word such as a domain name
     (shepheardwalwyn.com clipped at 1180 px); scale it with the column instead. */
  .deal-head .tp-h1 {
    font-size: clamp(36px, 3.3vw, 48px);
    text-wrap: balance;
  }

  /* Thirds, so the panel beside the stage starts on the same line as the third option card. */
  .deal-bench {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deal-bench > .deal-stage {
    grid-column: span 2;
  }

  .deal-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* One shared set of rows (tag, title, description) across the three cards, so every title
     and every description starts on the same line whatever the wrapping. */
  .deal-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 0;
  }

  .deal-choice {
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .deal-choice > span {
    display: contents;
  }

  .deal-choice input[type="radio"] {
    grid-row: 1;
  }

  .deal-choice :is(.deal-choice__tag, .deal-choice__title, .deal-choice__desc) {
    grid-column: 2;
  }

  .deal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Tablet: 768 to 1179 px ---------- */
@media (768px <= width < 1180px) {
  /* The checks sit under the stage in two columns, so the panel is not one long list. */
  .deal-inspector .sw-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .deal-inspector .tp-field-row:last-of-type {
    border-bottom: 1px solid var(--line);
  }

  .deal-inspector :is(.deal-inspector__actions, .deal-tech) {
    grid-column: 1 / -1;
  }

  .deal-inspector__actions {
    flex-direction: row;
  }

  .deal-inspector__actions .tp-btn {
    flex: 1 1 0;
  }

  .deal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Phone: below 768 px ---------- */
@media (width < 768px) {
  .deal-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 16px;
  }

  .deal-stage__viewport[data-kind="pdf"] {
    min-height: clamp(420px, 68svh, 560px);
  }

  .deal-stage__bar,
  .deal-stage__foot {
    padding: 12px 14px;
  }

  .deal-stage__poster {
    padding: 24px 20px;
  }

  .deal-tabs,
  .deal-stage__actions {
    width: 100%;
  }

  .deal-tab {
    flex: 1 1 0;
    padding: 0 10px;
    white-space: nowrap;
  }

  .scan-dl {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One full-width button per row, as in the site's hero and closing bands. */
  :is(.deal-stage__poster-btns, .deal-stage__actions, .scan-actions, .deal-actions, .deal-head__side .tp-actions) {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  [data-partner-slug] :is(.deal-stage__poster-btns, .deal-stage__actions, .scan-actions, .deal-actions, .deal-head__side .tp-actions) .tp-btn {
    width: 100%;
    justify-content: center;
  }

  .deal-next {
    margin: 4px 0 0;
  }

}
