/*
 * The membership pages, in the Suite's glass.
 *
 * Almost all of this is done by handing Paid Memberships Pro different values
 * for its own design tokens, rather than by overriding its rules. PMPro 3.x
 * draws its frontend from about thirty custom properties — 231 var() uses
 * across its two stylesheets against 16 hardcoded colours — so changing the
 * tokens changes the pages, and PMPro's own layout, spacing and responsive
 * behaviour all keep working. An override war with its stylesheet would have
 * broken on their next release; this survives it, because these are the names
 * they maintain on purpose.
 *
 * The leftovers after the token flip are at the bottom, and there are only a
 * handful: a blue focus ring, a few black shadows, and PayPal's yellow, which
 * is left alone because it is PayPal's to decide.
 *
 * Everything is scoped to body.ggp-skin, which is only added on the pages the
 * owner has ticked. Nothing here can reach the rest of the site.
 */

/* ── The tokens ───────────────────────────────────────────────────────────── */

/*
 * Declared on body, not :root, and that is deliberate.
 *
 * PMPro prints its own :root block inline in the head from its colour
 * settings. Ours would be the same specificity as theirs, so which one won
 * would come down to source order — and source order between an inline head
 * style and an enqueued stylesheet is not something to build on. body is a
 * nearer ancestor than html for everything on the page, so these win by
 * inheritance rather than by a race, whatever PMPro prints and whenever.
 */
body.ggp-skin {

  /* PMPro's five main colours. */
  --pmpro--color--base:               rgba(21,16,30,.94);
  --pmpro--color--base-2:             rgba(40,31,54,.72);
  --pmpro--color--contrast:           #F4F1F7;
  --pmpro--color--border:             rgba(255,255,255,.38);
  --pmpro--color--accent:             #C2268F;
  --pmpro--color--accent--variation:  #E86FC0;
  --pmpro--color--border--variation:  rgba(255,255,255,.14);

  /* Rounder, to sit with the login card and the Suite's panels. */
  --pmpro--base--border-radius: 16px;
  --pmpro--btn--border-radius:  12px;

  /* Ours, used further down. */
  --ggp-ink:    #F4F1F7;
  --ggp-mut:    #BFB7C9;
  --ggp-faint:  #9A92A6;
  --ggp-glass:  rgba(21,16,30,.94);
  --ggp-raise:  rgba(40,31,54,.72);
  --ggp-field:  rgba(10,8,15,.60);
  --ggp-line:   rgba(255,255,255,.14);
  --ggp-line-2: rgba(255,255,255,.38);
  --ggp-brand:  #C2268F;
  --ggp-accent: #E86FC0;
  --ggp-btn-lt: #CC3A9C;

  /*
   * The one line that does the most work on this whole page.
   *
   * PMPro writes its messages and alerts as light-dark(light, dark) — the
   * dark halves are already there, written by PMPro, and have never been
   * reachable on this site because nothing ever declared a colour scheme.
   * This switches all twenty of them over at once, so errors, warnings and
   * success notices come back as PMPro's own dark palette rather than as
   * something approximated here that would drift from theirs over time.
   *
   * It is also the only lever that reaches inside a native <select> popup,
   * which the browser draws itself and no stylesheet can touch.
   */
  color-scheme: dark;
}


/* ── The ground ───────────────────────────────────────────────────────────── */

/*
 * Split between html and body on purpose.
 *
 * The nebula canvas sits at z-index:-1, which paints it above the root
 * element's background but below every in-flow background on the page. A dark
 * colour on body therefore covers it completely — which is exactly the bug
 * that hid the nebula when the Suite's skin was first merged. The colour goes
 * on html, and body is left transparent so the field shows through.
 */
html:has(body.ggp-skin) {
  background-color: #07060B !important;
  background-image: none !important;
}

body.ggp-skin {
  background-color: transparent !important;
  background-image: none !important;
  color: var(--ggp-ink);
}

/*
 * Themes wrap the content in their own containers with their own light
 * backgrounds, and we cannot know their class names. This finds whichever
 * ancestor actually contains a PMPro page and clears it, while excluding
 * PMPro's own cards and sections, which are supposed to have a surface.
 */
body.ggp-skin :has(.pmpro_card, .pmpro_section, .pmpro_form, .pmpro_table, .pmpro_levels_table, .ggl-card):not(
  .pmpro_card, .pmpro_card_content, .pmpro_section, .pmpro_form, .pmpro_form_fields,
  .pmpro_table, .pmpro_levels_table, .pmpro_message, .pmpro_login_wrap, .pmpro_reset_password_wrap,
  .ggl-card
) {
  background-color: transparent !important;
  background-image: none !important;
}


/* ── The container ────────────────────────────────────────────────────────── */

/*
 * PMPro sets no width, padding or margin on its wrapper — not one rule. It
 * relies entirely on the theme to inset the page, and this theme serves the
 * membership pages full-bleed, so the content sat flush against both edges of
 * the window.
 *
 * That was true before this skin existed. It was simply invisible: white
 * cards on a white page have no edge to notice, and the text looked like it
 * was in a wide column. The moment the cards had a visible border, the
 * missing container showed up as a bug, and it is a real one — a line of text
 * starting at pixel zero is genuinely hard to read.
 *
 * So the container is put here rather than left to the theme. max-width keeps
 * the order table from stretching to a 2560px monitor, where four columns
 * would be an arm's length apart.
 */
body.ggp-skin .pmpro {
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 32px);
}

/* Nothing in the page may push past that container. An avatar or a logo
   arriving at its natural size is the usual culprit. */
body.ggp-skin .pmpro img {
  max-width: 100%;
  height: auto;
}

/*
 * A wide table scrolls inside its own section instead of stretching the page.
 *
 * PMPro's responsive rules stop at rearranging the action links; the order
 * history table itself keeps all four columns at every width, so on a phone
 * it is wider than the screen and takes the whole document with it. Letting
 * the section scroll keeps the overflow in one box the finger can swipe,
 * rather than making the entire page slide sideways.
 */
@media (max-width: 782px) {
  body.ggp-skin .pmpro_section:has(.pmpro_table),
  body.ggp-skin .pmpro_card:has(.pmpro_table) {
    overflow-x: auto;
  }
}


/* ── Surfaces ─────────────────────────────────────────────────────────────── */

body.ggp-skin .pmpro_card,
body.ggp-skin .pmpro_section {
  background-color: var(--ggp-glass);
  border: 1px solid var(--ggp-line);
  border-radius: var(--pmpro--base--border-radius);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.ggp-skin .pmpro_card_title,
body.ggp-skin .pmpro_section_title,
body.ggp-skin .pmpro_form_heading {
  color: var(--ggp-ink);
  border-bottom-color: var(--ggp-line);
}

body.ggp-skin .pmpro_card_actions {
  border-top-color: var(--ggp-line);
}

/* Text that PMPro intends to be quieter than the body copy. Set explicitly,
   because a theme's muted grey was chosen against white and disappears here. */
body.ggp-skin .pmpro_asterisk,
body.ggp-skin .pmpro_form_hint,
body.ggp-skin .pmpro_small,
body.ggp-skin small,
body.ggp-skin .pmpro_data_count {
  color: var(--ggp-mut);
}


/* ── Forms ────────────────────────────────────────────────────────────────── */

body.ggp-skin .pmpro_form_label,
body.ggp-skin .pmpro_form label {
  color: var(--ggp-mut);
  font-weight: 600;
}

/*
 * background-color and not the background shorthand.
 *
 * The shorthand resets background-image too, and PMPro draws the chevron on
 * its <select> with a background-image. Writing `background` here would have
 * silently deleted the arrow from every dropdown on the checkout page — the
 * same way it once deleted the Suite's.
 */
body.ggp-skin .pmpro_form_input,
body.ggp-skin .pmpro_form input[type="text"],
body.ggp-skin .pmpro_form input[type="email"],
body.ggp-skin .pmpro_form input[type="url"],
body.ggp-skin .pmpro_form input[type="tel"],
body.ggp-skin .pmpro_form input[type="number"],
body.ggp-skin .pmpro_form input[type="search"],
body.ggp-skin .pmpro_form input[type="date"],
body.ggp-skin .pmpro_form input[type="password"],
body.ggp-skin .pmpro_form select,
body.ggp-skin .pmpro_form textarea {
  background-color: var(--ggp-field);
  color: var(--ggp-ink);
  border: 1px solid var(--ggp-line-2);
  border-radius: 11px;
}

body.ggp-skin .pmpro_form_input::placeholder,
body.ggp-skin .pmpro_form input::placeholder,
body.ggp-skin .pmpro_form textarea::placeholder {
  color: var(--ggp-faint);
  opacity: 1;
}

/*
 * The <option> colours are written out as solid values rather than inherited.
 *
 * A native dropdown popup is drawn by the operating system, outside the page,
 * and it composites a translucent colour against white rather than against
 * the page behind it. A token with alpha in it produces a white band with
 * pale text — readable in a screenshot of the closed control and unreadable
 * the moment it is opened.
 */
body.ggp-skin .pmpro_form option,
body.ggp-skin .pmpro_form optgroup,
body.ggp-skin select option,
body.ggp-skin select optgroup {
  background-color: #15111E;
  color: #F4F1F7;
}
body.ggp-skin select option:checked,
body.ggp-skin select option[selected] {
  background-color: #2A2139;
  color: #FFFFFF;
}
body.ggp-skin select option:disabled {
  color: #8E8699;
}

body.ggp-skin .pmpro_form_input:focus,
body.ggp-skin .pmpro_form input:focus,
body.ggp-skin .pmpro_form select:focus,
body.ggp-skin .pmpro_form textarea:focus {
  outline: none;
  border-color: var(--ggp-accent);
  box-shadow: 0 0 0 3px rgba(194,38,143,.26);
}

body.ggp-skin .pmpro_form_input-error,
body.ggp-skin .pmpro_form_input.pmpro_error {
  border-color: #FF7A6B;
}

body.ggp-skin input[type="checkbox"],
body.ggp-skin input[type="radio"] {
  accent-color: var(--ggp-brand);
}

/* Chrome paints its own near-white over an autofilled field. No property
   turns that off; a long inset shadow repainting the box is the only thing
   that reaches it. Without this, a saved card or address fills in as white
   text on white. */
body.ggp-skin input:-webkit-autofill,
body.ggp-skin input:-webkit-autofill:hover,
body.ggp-skin input:-webkit-autofill:focus {
  -webkit-text-fill-color: #F4F1F7;
  -webkit-box-shadow: 0 0 0 1000px #1A1526 inset;
  caret-color: #F4F1F7;
}


/* ── Buttons ──────────────────────────────────────────────────────────────── */

/*
 * The gradient stops at #CC3A9C rather than running on to the #E86FC0 used
 * for links. White on #E86FC0 measures 2.81:1, and PMPro's button text is not
 * large enough to qualify for the 3:1 allowance, so the far end of a prettier
 * gradient would be a button whose label washes out exactly where the eye
 * lands. #CC3A9C is the lightest stop on the same hue that still clears
 * 4.5:1.
 */
body.ggp-skin .pmpro_btn,
body.ggp-skin .pmpro_btn:link,
body.ggp-skin input[type="submit"].pmpro_btn,
body.ggp-skin button.pmpro_btn {
  background: linear-gradient(135deg, var(--ggp-btn-lt) 0%, var(--ggp-brand) 100%);
  border: 0;
  color: #fff;
  border-radius: var(--pmpro--btn--border-radius);
  box-shadow: 0 8px 22px rgba(194,38,143,.34);
  font-weight: 700;
}

body.ggp-skin .pmpro_btn:hover,
body.ggp-skin .pmpro_btn:focus {
  filter: brightness(1.06);
  color: #fff;
  box-shadow: 0 10px 26px rgba(194,38,143,.40);
}

/*
 * Every quieter variant has to repeat :link, and it is not decoration.
 *
 * The rule above lists .pmpro_btn:link so that an <a> styled as a button
 * picks it up. That pseudo-class costs a class's worth of specificity, which
 * makes the filled rule (0,3,1) while a plain .pmpro_btn-outline is (0,2,1) —
 * so on an <a>, which these nearly always are, the gradient won and the
 * outline button came out looking exactly like the primary one. Two buttons
 * that look equally like the thing to press, one of which cancels, is a worse
 * fault than a wrong colour.
 */
body.ggp-skin .pmpro_btn-outline,
body.ggp-skin .pmpro_btn-outline:link,
body.ggp-skin .pmpro_btn-plain,
body.ggp-skin .pmpro_btn-plain:link,
body.ggp-skin .pmpro_btn-cancel,
body.ggp-skin .pmpro_btn-cancel:link {
  background: transparent;
  border: 1px solid var(--ggp-line-2);
  color: var(--ggp-ink);
  box-shadow: none;
}
body.ggp-skin .pmpro_btn-outline:hover,
body.ggp-skin .pmpro_btn-plain:hover,
body.ggp-skin .pmpro_btn-cancel:hover {
  background: transparent;
  border-color: var(--ggp-accent);
  color: var(--ggp-ink);
  filter: none;
}

/* Cancelling and deleting should not look like the thing you came to do. */
body.ggp-skin .pmpro_btn-delete,
body.ggp-skin .pmpro_btn-delete:link {
  background: transparent;
  border: 1px solid rgba(255,122,107,.48);
  color: #FF7A6B;
  box-shadow: none;
}
body.ggp-skin .pmpro_btn-delete:hover {
  background: rgba(255,122,107,.10);
  color: #FF7A6B;
  filter: none;
}


/* ── Tables ───────────────────────────────────────────────────────────────── */

body.ggp-skin .pmpro_table,
body.ggp-skin .pmpro_levels_table {
  background-color: transparent;
  color: var(--ggp-ink);
  border-color: var(--ggp-line);
}

body.ggp-skin .pmpro_table th,
body.ggp-skin .pmpro_levels_table th {
  background-color: var(--ggp-raise);
  color: var(--ggp-ink);
  border-color: var(--ggp-line);
}

body.ggp-skin .pmpro_table td,
body.ggp-skin .pmpro_levels_table td {
  border-color: var(--ggp-line);
  color: var(--ggp-ink);
}

/* Written as a selector rather than left to PMPro's striping, which is a
   near-black on white and becomes invisible against the glass. */
body.ggp-skin .pmpro_table tr:nth-child(even) td {
  background-color: rgba(255,255,255,.03);
}
body.ggp-skin .pmpro_table tr:hover td,
body.ggp-skin .pmpro_levels_table tr:hover td {
  background-color: rgba(255,255,255,.06);
}


/* ── Links, tags and prices ───────────────────────────────────────────────── */

body.ggp-skin .pmpro_card a,
body.ggp-skin .pmpro_section a,
body.ggp-skin .pmpro_form a,
body.ggp-skin .pmpro_table a {
  color: var(--ggp-accent);
}

body.ggp-skin .pmpro_price_part-total,
body.ggp-skin .pmpro_level_cost strong {
  color: var(--ggp-accent);
}

body.ggp-skin .pmpro_tag {
  background-color: var(--ggp-raise);
  color: var(--ggp-ink);
  border: 1px solid var(--ggp-line);
}
body.ggp-skin .pmpro_tag-success {
  background-color: rgba(53,199,126,.14);
  color: #35C77E;
  border-color: rgba(53,199,126,.38);
}
body.ggp-skin .pmpro_tag-error {
  background-color: rgba(255,122,107,.12);
  color: #FF7A6B;
  border-color: rgba(255,122,107,.38);
}
body.ggp-skin .pmpro_tag-alert {
  background-color: rgba(240,217,168,.12);
  color: #F0D9A8;
  border-color: rgba(240,217,168,.34);
}


/* ── The leftovers ────────────────────────────────────────────────────────── */

/*
 * What the token flip could not reach. There are only these.
 *
 * PayPal's yellow (#ffc439) is deliberately not in the list: it is PayPal's
 * brand on PayPal's own button, people recognise it, and repainting a payment
 * button pink would make it harder to find and is not ours to change.
 */

/* A Bootstrap-era blue focus ring, hardcoded in three places. */
body.ggp-skin .pmpro_form_input:focus,
body.ggp-skin .pmpro_form .form-control:focus,
body.ggp-skin .pmpro_card input:focus {
  border-color: var(--ggp-accent);
  box-shadow: 0 0 0 3px rgba(194,38,143,.26);
}

/* Black drop shadows that read as a smudge on a dark ground. */
body.ggp-skin .pmpro_card,
body.ggp-skin .pmpro_section,
body.ggp-skin .pmpro_message {
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
}


/* ── Print ────────────────────────────────────────────────────────────────── */

/*
 * An invoice is the one page here that people put on paper, and a glass card
 * on a black ground costs a cartridge and comes out unreadable. On paper it
 * goes back to black on white, and the decoration is dropped.
 */
@media print {
  html:has(body.ggp-skin), body.ggp-skin {
    background: #fff !important;
    color: #000 !important;
  }
  body.ggp-skin {
    --pmpro--color--base: #ffffff;
    --pmpro--color--contrast: #222222;
    --pmpro--color--accent: #0c3d54;
    --pmpro--color--border: #777777;
    color-scheme: light;
  }
  body.ggp-skin .pmpro_card,
  body.ggp-skin .pmpro_section {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  body.ggp-skin .pmpro_table th,
  body.ggp-skin .pmpro_table td {
    color: #000 !important;
    border-color: #ccc !important;
    background: #fff !important;
  }
  #ggp-bg, #ggp-comet { display: none !important; }

  /*
   * The wordmark is white and pink. The bar behind it does not print, so on
   * paper the white half vanishes and the receipt is headed "writer".
   *
   * Printed dark rather than given a panel behind it: a background only
   * prints when the reader has background graphics switched on, and a logo
   * that appears or not depending on a print dialogue is the bug being fixed.
   */
  body.ggp-skin .custom-logo,
  body.ggp-skin .wp-block-site-logo img,
  body.ggp-skin .site-logo img,
  body.ggp-skin .site-title img,
  body.ggp-skin header img:not(.avatar) {
    filter: brightness(0) !important;
  }

  body.ggp-skin .site-title,
  body.ggp-skin .site-title *,
  body.ggp-skin .wp-block-site-title,
  body.ggp-skin .wp-block-site-title a {
    color: #000 !important;
  }
}


/* ── Motion ───────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  body.ggp-skin .pmpro_btn { transition: none; }
}


/* ── Breathing room, and a page that sits in the middle ───────────────────── */

/*
 * Every one of these pages began immediately under the navigation bar, with
 * the first heading touching it. PMPro sets no vertical spacing at all — the
 * same gap in its stylesheet that left the content flush against the side
 * edges — and this theme adds none on a full-bleed page.
 *
 * The space is deliberately large at the top. A heading sitting against a
 * dark navigation bar of nearly the same colour reads as part of the bar
 * rather than as the start of the page, and the eye has nowhere to land.
 */
body.ggp-skin .pmpro {
  padding-block: clamp(28px, 5vw, 56px) clamp(48px, 7vw, 88px);
}

/*
 * The page title belongs to the theme, not to PMPro, so it sits outside the
 * container and ignored every rule above — which is why "My Account" and
 * "Order History" started at the window edge while the card below them was
 * correctly inset. Lining it up with the same width and padding puts the
 * heading over its own content instead of beside it.
 */
body.ggp-skin .entry-header,
body.ggp-skin .page-header,
body.ggp-skin .entry-title,
body.ggp-skin .page-title,
body.ggp-skin .wp-block-post-title {
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 32px);
  padding-block-start: clamp(28px, 5vw, 56px);
}

/* With a title present the section below it needs less of its own. */
body.ggp-skin .entry-header + .pmpro,
body.ggp-skin .page-header + .pmpro,
body.ggp-skin .entry-title + .pmpro,
body.ggp-skin .wp-block-post-title + .pmpro {
  padding-block-start: clamp(16px, 2.5vw, 28px);
}

/* A consistent rhythm between the stacked sections. */
body.ggp-skin .pmpro_section + .pmpro_section,
body.ggp-skin .pmpro_card + .pmpro_card,
body.ggp-skin .pmpro_section + .pmpro_card,
body.ggp-skin .pmpro_card + .pmpro_section {
  margin-block-start: clamp(20px, 3vw, 32px);
}


/* ── "Membership required" ────────────────────────────────────────────────── */

/*
 * A short notice — one line and a button — stretched the full width of a
 * 1180px container, which left the button marooned at the far left of an
 * otherwise empty box. A message this small reads better centred and held to
 * a column near the length of its own sentence.
 */
body.ggp-skin .pmpro_content_message,
body.ggp-skin .pmpro_no_access,
body.ggp-skin .pmpro-no-access {
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
  padding: clamp(28px, 5vw, 44px) clamp(22px, 4vw, 38px);
}

body.ggp-skin .pmpro_content_message > *,
body.ggp-skin .pmpro_no_access > * {
  margin-inline: auto;
}

/* The icon and heading share a line and centre together. */
body.ggp-skin .pmpro_content_message h1,
body.ggp-skin .pmpro_content_message h2,
body.ggp-skin .pmpro_content_message h3,
body.ggp-skin .pmpro_no_access h1,
body.ggp-skin .pmpro_no_access h2,
body.ggp-skin .pmpro_no_access h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  text-align: center;
}

body.ggp-skin .pmpro_content_message p,
body.ggp-skin .pmpro_no_access p {
  color: var(--ggp-mut);
  max-width: 46ch;
}

/* Space between the sentence and the button it belongs to. */
body.ggp-skin .pmpro_content_message .pmpro_btn,
body.ggp-skin .pmpro_no_access .pmpro_btn {
  margin-block-start: clamp(16px, 3vw, 24px);
}


/* ── Text that was there but could not be read ────────────────────────────── */

/*
 * The invoice's "INR 1,299.00 paid on 29 October" line is a table caption.
 * PMPro colours captions from its own muted value, which this skin never
 * flipped because nothing else on the page used it — so the line was drawn in
 * a dark grey on a near-black card and effectively disappeared. It is the one
 * line on a receipt a customer actually looks for.
 *
 * Measured against the card behind it, the muted token gives 9.7:1 — well
 * past the 4.5:1 this text needs, and still visibly quieter than the ink
 * around it at 16.8:1, which is the point of a caption.
 */
body.ggp-skin .pmpro caption,
body.ggp-skin .pmpro_table caption,
body.ggp-skin .pmpro_invoice caption {
  color: var(--ggp-mut);
  text-align: left;
  caption-side: top;
  padding-block-end: .75em;
}

/*
 * "INR 1,299.00 paid on 29 October" is an <h3 class="pmpro_font-large">, not
 * a caption — which is why the first attempt at this missed it entirely. It
 * was drawn in PMPro's own heading colour, a near-black meant for a white
 * page, on a near-black card.
 *
 * It is the one line on a receipt a customer actually looks for, so it gets
 * the full ink rather than the muted tone: 16.8:1 against the card.
 */
body.ggp-skin .pmpro_font-large,
body.ggp-skin #pmpro_order_single-items h3,
body.ggp-skin .pmpro_card .pmpro_font-large,
body.ggp-skin .pmpro_section .pmpro_font-large {
  color: var(--ggp-ink);
}

/* PMPro's own quiet-text helpers, for the same reason. */
body.ggp-skin .pmpro .pmpro_font-x-small,
body.ggp-skin .pmpro .pmpro_font-small,
body.ggp-skin .pmpro .pmpro_text-muted,
body.ggp-skin .pmpro small {
  color: var(--ggp-mut);
}

/* Nothing in a card may fall back to a colour the card cannot show. */
body.ggp-skin .pmpro_card,
body.ggp-skin .pmpro_section {
  color: var(--ggp-ink);
}


/* ── Rounded tables ───────────────────────────────────────────────────────── */

/*
 * The order table met the card's rounded corner with four sharp ones, which
 * reads as a component dropped in from somewhere else.
 *
 * border-radius is ignored on a table using border-collapse: collapse, so the
 * borders move onto the cells and the table itself carries the outline. The
 * corner cells are rounded as well as the table, because clipping a table
 * with overflow is unreliable across browsers while the corner cells are not.
 */
body.ggp-skin .pmpro_table,
body.ggp-skin .pmpro_levels_table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--ggp-line);
  border-radius: 14px;
  overflow: hidden;
}

body.ggp-skin .pmpro_table th,
body.ggp-skin .pmpro_table td,
body.ggp-skin .pmpro_levels_table th,
body.ggp-skin .pmpro_levels_table td {
  border: 0;
  border-block-end: 1px solid var(--ggp-line);
  /* Stated rather than inherited from PMPro: removing the cell borders above
     is the kind of change that quietly takes the padding with it. */
  padding-block: .85em;
  padding-inline: 1.1em;
}

/*
 * Only a heading cell in the head is a heading.
 *
 * The invoice puts the description in a <th> inside <tbody> — it is a row
 * label, not a column heading — so the header background was painting the
 * "Basic for order …" cell and leaving the amount beside it on the plain
 * card. That is the mismatched block in the middle of the receipt: two cells
 * of one row wearing two different surfaces.
 */
body.ggp-skin .pmpro_table thead th,
body.ggp-skin .pmpro_levels_table thead th {
  background-color: var(--ggp-raise);
  color: var(--ggp-ink);
}

body.ggp-skin .pmpro_table tbody th,
body.ggp-skin .pmpro_levels_table tbody th {
  background-color: transparent;
  color: var(--ggp-ink);
  font-weight: 600;
  text-align: left;
}

/* The account line under the description is secondary, and reads as such. */
body.ggp-skin .pmpro_table tbody th p {
  margin-block: .35em 0;
  font-weight: 400;
  font-size: .925em;
  color: var(--ggp-mut);
}

/* The totals row closes the table, so it carries a little more weight. */
body.ggp-skin .pmpro_table tfoot td {
  background-color: rgba(255,255,255,.04);
  font-weight: 700;
}

/* No rule below the final row, whichever section it lives in. */
body.ggp-skin .pmpro_table tfoot tr:last-child > *,
body.ggp-skin .pmpro_table tbody:last-child tr:last-child > *,
body.ggp-skin .pmpro_levels_table tbody:last-child tr:last-child > * {
  border-block-end: 0;
}

/* Top corners: the first row, which is in thead when there is one. */
body.ggp-skin .pmpro_table thead tr:first-child > *:first-child,
body.ggp-skin .pmpro_levels_table thead tr:first-child > *:first-child {
  border-start-start-radius: 13px;
}
body.ggp-skin .pmpro_table thead tr:first-child > *:last-child,
body.ggp-skin .pmpro_levels_table thead tr:first-child > *:last-child {
  border-start-end-radius: 13px;
}

/* Bottom corners: tfoot when present, otherwise the last body row. */
body.ggp-skin .pmpro_table tfoot tr:last-child > *:first-child,
body.ggp-skin .pmpro_table tbody:last-child tr:last-child > *:first-child,
body.ggp-skin .pmpro_levels_table tbody:last-child tr:last-child > *:first-child {
  border-end-start-radius: 13px;
}
body.ggp-skin .pmpro_table tfoot tr:last-child > *:last-child,
body.ggp-skin .pmpro_table tbody:last-child tr:last-child > *:last-child,
body.ggp-skin .pmpro_levels_table tbody:last-child tr:last-child > *:last-child {
  border-end-end-radius: 13px;
}
