/*
 * Product Pricing Table, front-end styles.
 *
 * Layout: a semantic <table> promoted to a flat CSS Grid.
 *   Columns: [label auto] [tier 0 1fr] ... [tier N 1fr]  -> --ppt-tier-count tiers
 *   Rows:    [header] [feature 0] ... [feature M]        -> auto-sized
 * Because every grid row spans ALL columns, labels and values always align.
 *
 * Below 900px the grid is hidden and the PHP-rendered card block takes over, one
 * card per tier. The grid is deliberately NOT folded to a single column: that
 * would stack three nameless values under each label with no way to tell Pro,
 * Premium and Cluster apart.
 *
 * Colours come from the host page when it defines the PDFreactor CI tokens
 * (--pr-accent and friends, set on :root by the site's Quick CSS). The
 * fallbacks after each comma keep the plugin presentable on a site that does
 * not define them.
 */

/* ================================================================
   Tokens
   ================================================================ */

/* .ppt-modal-backdrop is listed here because the JS moves it to <body> to
   escape the page builder's stacking contexts, which puts it outside
   .ppt-wrapper. Without its own copy of the tokens every var() in the modal
   would resolve to nothing and the declarations would be dropped. */
.ppt-wrapper,
.ppt-selector,
.ppt-modal-backdrop {
    --ppt-accent:       var(--pr-accent, #e41d03);
    --ppt-accent-dark:  var(--pr-accent-dark, #c41a03);
    --ppt-border:       var(--pr-border, #e1e1e1);
    --ppt-border-strong: var(--pr-border-strong, #cfcfcf);
    --ppt-bg:           var(--pr-bg, #ffffff);
    --ppt-bg-alt:       var(--pr-bg-alt, #f5f5f5);
    --ppt-bg-stripe:    #fafafa;
    --ppt-bg-stripe-lab: #eeeeee;
    --ppt-text:         var(--pr-text, #222222);
    --ppt-text-dim:     var(--pr-text-dim, #666666);
    --ppt-text-mute:    var(--pr-text-mute, #999999);
    --ppt-success:      var(--pr-success, #15803d);
    --ppt-radius:       var(--pr-radius, 14px);
    --ppt-radius-sm:    var(--pr-radius-sm, 8px);
    --ppt-row-min-h:    44px;

    /* --ppt-label-w fixes the width of the label column. Leave it unset and the
       column falls back to minmax(150px, max-content), which grows to the
       longest label. Set it when a page needs the column width to be
       predictable. */

    /* Typography inherits from the theme (family, colour, line-height) so the
       table sits in the page rather than next to it. */
    max-width: 100%;
    margin: 0 auto;
}

/* ================================================================
   Theme-proof resets
   -----------------------------------------------------------------
   Enfold and other aggressive themes inject global rules like
     th, td { text-transform: uppercase; border: ...; padding: ... }
     table { display: table }  thead { display: table-header-group }
   which clobber the grid. !important is used ONLY on the structural
   properties that must win. Appearance keeps normal specificity.
   ================================================================ */

/* Hide utility. Raised specificity to beat .ppt-wrapper .ppt-table, which also
   uses !important for its display:grid. */
.ppt-hidden,
.ppt-wrapper .ppt-hidden,
.ppt-wrapper .ppt-table.ppt-hidden,
.ppt-wrapper .ppt-mobile-cards.ppt-hidden,
.ppt-wrapper .ppt-currency-switcher.ppt-hidden {
    display: none !important;
}

.ppt-wrapper,
.ppt-wrapper *,
.ppt-selector,
.ppt-selector *,
.ppt-modal-backdrop,
.ppt-modal-backdrop * {
    text-transform: none;
    letter-spacing: normal;
    box-sizing: border-box;
}

/* The radio inputs carry the state; themes often paint them as visible bullets. */
.ppt-selector .ppt-product-radio,
.ppt-wrapper  .ppt-product-radio {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ppt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================================================
   Product selector: one rounded switch, like the old tier.js one
   Was a row of underlined tabs, then separate pills. Now the shape visitors
   knew from the tier.js page: a single bordered pill container with equal
   segments (min 160px, 32px line), the active segment filled red. The prompt
   "Please select" is such a segment too, red while nothing is chosen.

   With product groups (Cloud / On-Premise) the same switch appears once more
   above the product row, .ppt-group-toggle with .ppt-group-pill segments, and
   there is one product row per group; the rows of the other groups carry the
   hidden attribute.
   ================================================================ */

.ppt-selector {
    margin-bottom: 30px;
}

.ppt-group-toggle {
    margin-bottom: 14px;
}

/* display:flex below would beat the UA's [hidden] rule. */
.ppt-selector .ppt-product-toggle[hidden] {
    display: none !important;
}

.ppt-product-toggle,
.ppt-group-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    width: fit-content;
    padding: 4px;
    border: 1px solid var(--ppt-border-strong);
    border-radius: 30px;
    background: var(--ppt-bg-alt);
    /* Same centre as the card: shift by half the label column, like the
       currency switcher. Zero when the page does not fix a label width. */
    margin: 0 auto;
    transform: translateX( calc( var(--ppt-label-w, 0px) / 2 ) );
}

/* !important on colour so themes that style `label` cannot recolour the text
   on the red active segment (same reason as the currency pills). */
.ppt-selector .ppt-toggle-pill,
.ppt-selector .ppt-group-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 0 22px;
    line-height: 32px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--ppt-text-dim) !important;
    background: transparent;
    border: 0;
    border-radius: 30px;
    margin: 0 3px;
    white-space: nowrap;
    user-select: none;
    transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
}

.ppt-selector .ppt-toggle-pill:hover,
.ppt-selector .ppt-group-pill:hover {
    background: var(--ppt-border);
}

.ppt-selector .ppt-toggle-pill.active,
.ppt-selector .ppt-group-pill.active {
    background: var(--ppt-accent);
    color: #fff !important;
}

.ppt-selector .ppt-toggle-pill.active:hover,
.ppt-selector .ppt-group-pill.active:hover {
    background: var(--ppt-accent);
    color: #fff !important;
}

/* "Please select" is the highlighted segment while nothing is chosen, exactly
   like the old tier.js switcher: the eye lands on the instruction, the products
   sit next to it as the choices. Once a product is picked it stays where it is,
   muted and inert, so the row does not jump; only the highlight moves. */
.ppt-selector .ppt-toggle-pill--prompt.active {
    background: var(--ppt-accent);
    color: #fff !important;
    cursor: default;
}

/* Two products: prompt in the middle (DOM order stays prompt, p1, p2 so the
   radios and labels keep their pairing). */
.ppt-product-toggle--two .ppt-toggle-pill--prompt {
    order: 1;
}

.ppt-product-toggle--two .ppt-toggle-pill--prompt + .ppt-toggle-pill {
    order: 0;
}

.ppt-product-toggle--two .ppt-toggle-pill--prompt + .ppt-toggle-pill + .ppt-toggle-pill {
    order: 2;
}

.ppt-selector .ppt-toggle-pill--prompt.ppt-toggle-pill--dismissed {
    background: transparent;
    color: var(--ppt-text-mute) !important;
    pointer-events: none;
}

/* Pages that preset a product (default_product) never show the neutral state,
   and neither does a group row with a single product: switching to its group
   selects that product at once, so the prompt would only sit there inert. */
.ppt-product-toggle--preset .ppt-toggle-pill--prompt,
.ppt-product-toggle--single .ppt-toggle-pill--prompt,
.ppt-selector--preset .ppt-toggle-pill--prompt {
    display: none;
}

/* Keyboard focus: the radios are visually hidden, so the pill carries the ring. */
.ppt-selector .ppt-toggle-pill:has(+ .ppt-product-radio:focus-visible),
.ppt-selector:has(.ppt-product-radio:not(.ppt-group-radio):focus-visible) .ppt-toggle-pill.active,
.ppt-selector:has(.ppt-group-radio:focus-visible) .ppt-group-pill.active {
    outline: 2px solid var(--ppt-accent);
    outline-offset: 2px;
}

/* ================================================================
   The grid
   ================================================================ */

.ppt-wrapper .ppt-table {
    display: grid !important;
    /* Enfold paints <table> with a default gray, which would show through the
       transparent top-left spacer cell. */
    background: transparent !important;
    /* Label column: the width in --ppt-label-w if the page sets one, otherwise
       at least 150px growing to the longest label. Tier columns: minmax(0, 1fr)
       so one wide price cannot push the last column out of view. */
    grid-template-columns: var(--ppt-label-w, minmax(150px, max-content)) repeat( var(--ppt-tier-count, 3), minmax(0, 1fr) ) !important;
    /* No frame around the whole table on purpose. The card is drawn around the
       TIER COLUMNS only, cell by cell, further down: the label column is a
       gutter that belongs to the page, not to the card.

       That is what makes the controls above and below the table line up. While
       the label column sat inside the card, the card's centre and the centre
       the eye reads were 122px apart, because the eye centres on the tiers and
       ignores the labels. Now the visible card IS the tier band, and the tabs
       and the currency switcher centre on the same thing.

       No overflow: hidden either, so a tooltip bubble may leave the table. */
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Promote thead/tbody/tr children directly into the grid. */
.ppt-wrapper .ppt-table thead,
.ppt-wrapper .ppt-table tbody,
.ppt-wrapper .ppt-table tr {
    display: contents !important;
}

/* Reset th/td defaults. No blanket `background: transparent` here: that would
   kill the label column shading and the row stripes set further down. */
.ppt-wrapper .ppt-table th,
.ppt-wrapper .ppt-table td {
    font-weight: inherit;
    text-align: inherit;
    vertical-align: inherit;
    border: 0;
    text-transform: none;
    letter-spacing: normal;
}

.ppt-label-spacer {
    /* Top-left corner stays empty even though the label column is shaded. */
    background: transparent !important;
}

/* ---- Tier headers ---- */

.ppt-wrapper .ppt-table .ppt-tier-header,
.ppt-mobile-cards .ppt-tier-header {
    border-bottom: 1px solid var(--ppt-border);
}

.ppt-tier-header {
    padding: 26px 18px;
    background: var(--ppt-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
}

/* The theme-proof reset above (.ppt-wrapper .ppt-table th { text-align:
   inherit }) outweighs the plain class rule, so the th inherits start and
   wrapped subtitles come out ragged-left inside their centred box. This
   namespaced rule wins the reset back. */
.ppt-wrapper .ppt-table th.ppt-tier-header {
    text-align: center;
}

/* A hairline between tier columns. The label column keeps no rule on its right,
   the shading already separates it. */
.ppt-wrapper .ppt-table .ppt-tier-header + .ppt-tier-header,
.ppt-wrapper .ppt-table .ppt-feature-value + .ppt-feature-value {
    border-left: 1px solid var(--ppt-border);
}

.ppt-tier-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--ppt-text);
    letter-spacing: -0.01em;
}

.ppt-tier-subtitle {
    font-size: 12.5px;
    color: var(--ppt-text-mute);
    line-height: 1.5;
    max-width: 24ch;
    flex-grow: 1; /* absorb slack so price and buttons stay bottom-aligned */
    /* Centre the text inside the absorbed slack: when subtitles wrap to
       different line counts, the gap spreads evenly above and below
       instead of pooling under the short ones. */
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppt-pricing {
    margin: 10px 0 2px;
}

.ppt-price {
    margin: 0;
    line-height: 1.1;
}

.ppt-currency {
    font-size: 18px;
    font-weight: 600;
    vertical-align: top;
    line-height: 1.9;
    color: var(--ppt-text-dim);
}

.ppt-amount {
    /* clamp so the number scales down with the column */
    font-size: clamp( 28px, 2.6vw, 38px );
    font-weight: 700;
    color: var(--ppt-text);
    letter-spacing: -0.02em;
}

.ppt-term {
    font-size: 13px;
    color: var(--ppt-text-mute);
}

.ppt-billing-note {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--ppt-text-mute);
    margin: 3px 0 0;
    /* Reserve one line so tiers stay aligned when a note is missing. */
    min-height: calc( 11.5px * 1.5 );
    text-align: center;
}

/* JS decides which currency shows; EUR is off until then. */
.ppt-price--eur {
    display: none;
}

/* ---- Buy / quote ---- */

.ppt-product-cta {
    display: none; /* JS reveals the active product's block */
    width: 100%;
}

.ppt-wrapper[data-active-product=""] .ppt-product-cta--none,
.ppt-wrapper:not([data-active-product]) .ppt-product-cta--none {
    display: block;
}

.ppt-sku {
    font-size: 11px;
    color: var(--ppt-text-mute);
    margin: 6px 0 9px;
    font-family: Monaco, "Andale Mono", "Courier New", Courier, monospace;
    text-align: center;
}

.ppt-cta-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
}

/* !important on the text colour only: a site-wide `a { color: ... }` would
   otherwise make the label invisible on the red button. */
.ppt-wrapper .ppt-btn {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border-radius: var(--ppt-radius-sm);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ppt-wrapper .ppt-btn--buy {
    background: var(--ppt-accent);
    border-color: var(--ppt-accent);
    color: #fff !important;
}

.ppt-wrapper .ppt-btn--buy:hover {
    background: var(--ppt-accent-dark);
    border-color: var(--ppt-accent-dark);
    color: #fff !important;
}

.ppt-wrapper .ppt-btn--quote {
    background: var(--ppt-bg);
    border-color: var(--ppt-border-strong);
    color: var(--ppt-text) !important;
}

.ppt-wrapper .ppt-btn--quote:hover {
    background: var(--ppt-bg-alt);
    border-color: var(--ppt-text-mute);
    color: var(--ppt-text) !important;
}

/* Maintenance mode: the wrapper carries .ppt-maintenance (from the HTML or
   from the runtime check). Buttons, SKUs and the "please select" prompt give
   way to the notice. !important because the JS sets inline display on the
   CTA blocks when a product is picked. */
.ppt-maintenance-note {
    display: none;
    margin: 10px 0 0;
    padding: 8px 10px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ppt-text-dim);
    background: var(--ppt-bg-alt);
    border-radius: var(--ppt-radius-sm);
}

.ppt-wrapper.ppt-maintenance .ppt-product-cta {
    display: none !important;
}

.ppt-wrapper.ppt-maintenance .ppt-maintenance-note {
    display: block;
}

.ppt-select-prompt {
    font-size: 12.5px;
    color: var(--ppt-text-mute);
    margin: 0;
}

/* ---- Feature rows ---- */

.ppt-feature-label,
.ppt-feature-value {
    padding: 12px 16px;
    font-size: 13.5px;
    min-height: var(--ppt-row-min-h);
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* The label column sits outside the card: no background, no rules. Its text is
   pushed to the right so each label ends next to the card edge and stays tied
   to its own row across the gutter. */
.ppt-feature-label {
    background: transparent;
    font-weight: 600;
    color: var(--ppt-text);
    gap: 6px;
    justify-content: flex-end;
    text-align: right;
    padding-right: 20px;
}

.ppt-feature-value {
    justify-content: center;
    text-align: center;
    background: var(--ppt-bg);
    border-top: 1px solid var(--ppt-border);
}

/* Alternating rows. The stripe class is set in PHP, because the grid is flat and
   nth-child cannot see row boundaries. Only the value cells are tinted; a tint
   on the label would read as a second card next to the first. */
.ppt-feature-value.stripe {
    background: var(--ppt-bg-stripe);
}

/* ---- The card, drawn around the tier columns only ----
   Cell by cell, because a CSS grid cannot take a border around a range of
   columns. Left edge: the first value in each row, which is the cell right
   after the label. Right edge: the last cell in the row. */
/* Scoped under .ppt-wrapper .ppt-table so these beat the theme-proof reset
   `.ppt-wrapper .ppt-table td { border: 0 }` further up, which is (0,2,1) and
   would otherwise erase the whole frame while the corner radii still applied,
   leaving rounded corners on nothing. */
/* The structural selectors hold before any script runs; ppt-col-first and
   ppt-col-last are set by pricing-render.js on the visible edge columns once a
   product hides tiers (the hidden cells still count for :last-child). */
.ppt-wrapper .ppt-table .ppt-label-spacer + .ppt-tier-header,
.ppt-wrapper .ppt-table .ppt-feature-label + .ppt-feature-value,
.ppt-wrapper .ppt-table .ppt-tier-header.ppt-col-first,
.ppt-wrapper .ppt-table .ppt-feature-value.ppt-col-first {
    border-left: 1px solid var(--ppt-border);
}

.ppt-wrapper .ppt-table .ppt-tier-header:last-child,
.ppt-wrapper .ppt-table .ppt-feature-value:last-child,
.ppt-wrapper .ppt-table .ppt-tier-header.ppt-col-last,
.ppt-wrapper .ppt-table .ppt-feature-value.ppt-col-last {
    border-right: 1px solid var(--ppt-border);
}

.ppt-wrapper .ppt-table .ppt-tier-header {
    border-top: 1px solid var(--ppt-border);
}

.ppt-wrapper .ppt-table .ppt-feature-value.last {
    border-bottom: 1px solid var(--ppt-border);
}

/* Corners. With no overflow: hidden on the table these have to be set on the
   four corner cells themselves. */
.ppt-label-spacer + .ppt-tier-header,
.ppt-tier-header.ppt-col-first {
    border-top-left-radius: var(--ppt-radius);
}

.ppt-tier-header:last-child,
.ppt-tier-header.ppt-col-last {
    border-top-right-radius: var(--ppt-radius);
}

.ppt-feature-label + .ppt-feature-value.last,
.ppt-feature-value.last.ppt-col-first {
    border-bottom-left-radius: var(--ppt-radius);
}

.ppt-feature-value.last:last-child,
.ppt-feature-value.last.ppt-col-last {
    border-bottom-right-radius: var(--ppt-radius);
}

/* A label that opens a modal. Dotted underline marks it as a hint, not a jump. */
.ppt-modal-trigger {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    font-weight: inherit;
    color: var(--ppt-accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.ppt-modal-trigger:hover {
    text-decoration-style: solid;
}

.ppt-feature-label a {
    color: var(--ppt-accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

/* Boolean marks. Enfold's entypo-fontello supplies the glyph through
   data-av_icon; ::before also carries a drawn fallback for sites without it. */
.ppt-bool {
    display: inline-block;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    font-size: 18px;
}

.ppt-bool::before {
    content: attr(data-av_icon);
    font-family: "entypo-fontello", sans-serif;
    font-style: normal;
    font-weight: normal;
    speak: none;
    -webkit-font-smoothing: antialiased;
}

.ppt-bool--yes {
    color: var(--ppt-success);
}

.ppt-bool--no {
    /* A cross (entypo e813), not the faint dash: next to a green check the dash
       read as "nothing here". Same mark the Support Level table uses. */
    color: var(--ppt-text-dim);
    font-size: 16px;
}

/* Value box plus optional note. The note is taken out of the flow and hung off
   the right edge of the value, so the mark stays on the column's centre line.
   The lift: the glyph's ink centre sits 2.5px above its box centre (measured
   against the entypo cross e813 at 16px); the text is then set 1px lower than
   that because its visual weight is the x-height band, and centring the full
   ink box (ascenders, parentheses) made the words look too high. */
.ppt-value {
    position: relative;
    display: inline-block;
}

.ppt-note {
    position: absolute;
    left: 100%;
    top: calc(50% - 1.5px);
    transform: translateY(-50%);
    margin-left: 6px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 400;
    color: var(--ppt-text-dim);
}

/* Just above the card breakpoint the tier columns are at their narrowest and a
   note at 12px crosses into the next column by a few pixels. */
@media ( min-width: 901px ) and ( max-width: 1100px ) {
    .ppt-note {
        font-size: 11px;
        margin-left: 4px;
    }
}

/* ================================================================
   Currency switcher: a note under the table
   "Prices shown in EUR. Show USD" in the footnote size; only the other
   currency is a link. geolocate.js has already picked the likely currency,
   so this is the correction for the odd case, not a second switch competing
   with the product pills. The two radios are still in the markup; the
   checked one's label is hidden.
   ================================================================ */

.ppt-currency-switcher {
    display: block;
    width: auto;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ppt-text-mute);
    /* pricing-render.js sets padding-left to the label column's width, so the
       text centres under the tier columns (alignCurrencyNote). */
}

/* !important on colour and display: themes style `label` and `b` freely
   (Enfold makes labels block elements, the Customizer colours `strong`). */
.ppt-wrapper .ppt-currency-note {
    color: var(--ppt-text-mute) !important;
}

.ppt-wrapper .ppt-currency-current {
    font-weight: 600;
    color: var(--ppt-text-dim) !important;
}

.ppt-wrapper .ppt-currency-pill {
    display: inline !important;
    margin: 0 0 0 6px;
    padding: 0;
    min-width: 0;
    line-height: inherit;
    font-size: inherit;
    font-weight: 600;
    color: var(--ppt-accent) !important;
    background: none;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
}

.ppt-wrapper .ppt-currency-pill:hover {
    background: none;
    text-decoration: underline;
}

.ppt-wrapper .ppt-currency-pill:has(input:checked) {
    display: none !important;
}

.ppt-wrapper .ppt-currency-pill span {
    color: inherit !important;
}

.ppt-currency-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Keyboard focus: the radio is visually hidden, so the link carries the ring. */
.ppt-wrapper .ppt-currency-pill:has(input:focus-visible) {
    outline: 2px solid var(--ppt-accent);
    outline-offset: 2px;
}

/* ================================================================
   Tooltips

   Two kinds. A per-tier tooltip is plain text and rides in a
   data-attribute, so CSS can draw it with content: attr(). A row
   tooltip may carry HTML (a list of print features, say), so its
   bubble is a real child element.
   ================================================================ */

.ppt-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--ppt-border-strong);
    background: transparent;
    color: var(--ppt-text-mute);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    vertical-align: middle;
    transition: border-color 0.15s, color 0.15s;
}

.ppt-tooltip::before {
    content: "i";
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
}

.ppt-tooltip:hover,
.ppt-tooltip:focus {
    border-color: var(--ppt-accent);
    color: var(--ppt-accent);
    outline: none;
}

/* Plain-text bubble */
.ppt-tooltip:not(.ppt-tooltip--rich)::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc( 100% + 9px );
    left: 50%;
    transform: translateX(-50%);
    background: var(--ppt-text);
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--ppt-radius-sm);
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    font-family: inherit;
    width: max-content;
    max-width: 230px;
    white-space: normal;
    text-align: center;
    line-height: 1.45;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
    z-index: 10;
}

.ppt-tooltip:not(.ppt-tooltip--rich):hover::after,
.ppt-tooltip:not(.ppt-tooltip--rich):focus::after {
    opacity: 1;
}

/* HTML bubble */
.ppt-tooltip-body {
    position: absolute;
    bottom: calc( 100% + 9px );
    left: 50%;
    transform: translateX(-50%);
    background: var(--ppt-text);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--ppt-radius-sm);
    font-size: 12px;
    font-weight: 400;
    text-align: left;
    line-height: 1.5;
    width: max-content;
    max-width: 240px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
    z-index: 10;
}

.ppt-tooltip--rich:hover .ppt-tooltip-body,
.ppt-tooltip--rich:focus .ppt-tooltip-body {
    opacity: 1;
    visibility: visible;
}

.ppt-tooltip-body ul,
.ppt-tooltip-body ol {
    margin: 0;
    padding-left: 16px;
}

.ppt-tooltip-body li {
    margin: 2px 0;
    list-style: disc;
}

.ppt-tooltip-body p {
    margin: 0 0 6px;
}

.ppt-tooltip-body p:last-child {
    margin-bottom: 0;
}

/* The theme paints strong/b in its heading color, which is near-invisible
   on the dark bubble. The site-wide customizer CSS even does it with
   !important (strong { color: ... !important }), so this must carry
   !important too; the id selector wins the tie on specificity. */
#top .ppt-tooltip-body strong,
#top .ppt-tooltip-body b {
    color: inherit !important;
}

/* ================================================================
   Modal
   ================================================================ */

.ppt-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ppt-modal-backdrop--open {
    display: flex;
}

.ppt-modal {
    background: var(--ppt-bg);
    border-radius: var(--ppt-radius);
    /* Wide enough for a three-column comparison table, which is the kind of
       content these modals carry. At 720px such a table was squeezed to 557px
       and every cell wrapped after two words. */
    max-width: 920px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    animation: ppt-modal-in 0.18s ease;
}

@keyframes ppt-modal-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ppt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--ppt-border);
    flex-shrink: 0;
}

.ppt-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--ppt-text);
}

.ppt-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--ppt-text-mute);
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.ppt-modal-close:hover {
    color: var(--ppt-accent);
}

.ppt-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ppt-text-dim);
}

/* Content pulled into the modal is a page-builder section. Outside the theme's
   #top wrapper its column div (.template-page.content) falls back to inline and
   still carries Enfold's 1px right column border, which then paints as a short
   vertical stripe at the bottom left. Make it an ordinary block without borders. */
.ppt-modal-body .template-page,
.ppt-modal-body .content {
    display: block;
    float: none;
    width: auto;
    border: 0;
}

.ppt-modal-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
}

.ppt-modal-body th,
.ppt-modal-body td {
    border: 1px solid var(--ppt-border);
    padding: 9px 14px;
    text-align: left;
    vertical-align: top;
}

.ppt-modal-body th {
    background: var(--ppt-bg-alt);
    font-weight: 600;
    color: var(--ppt-text);
}

/* The content is pulled out of a page, so it arrives inside that page's own
   wrappers, and those are built for a full-width layout: a page-builder theme
   puts 130px of vertical padding on the content wrapper and 50px of gutter on
   the container. Inside a modal that is 360px of dead space and 100px of lost
   width. Reset the wrappers a modal can reasonably expect to meet, by class
   name, and only inside the modal body.

   The list is deliberately short and additive: anything not named here keeps
   its own spacing, because it is content, not chrome. */
.ppt-modal-body .container,
.ppt-modal-body .av-content-full,
.ppt-modal-body .template-page,
.ppt-modal-body .entry-content-wrapper,
.ppt-modal-body .flex_column,
.ppt-modal-body .av_one_full {
    padding-left: 0;
    padding-right: 0;
    max-width: none;
    width: auto;
    float: none;
    margin-left: 0;
    margin-right: 0;
}

.ppt-modal-body .container,
.ppt-modal-body .template-page,
.ppt-modal-body .av-content-full {
    padding-top: 0;
    padding-bottom: 0;
}

/* First and last child flush with the modal padding, whatever they are. */
.ppt-modal-body > *:first-child,
.ppt-modal-body .container > *:first-child,
.ppt-modal-body .template-page > *:first-child {
    margin-top: 0;
}

.ppt-modal-body > *:last-child,
.ppt-modal-body .container > *:last-child,
.ppt-modal-body .template-page > *:last-child {
    margin-bottom: 0;
}

/* ================================================================
   Cards, one per tier. Shown below 900px instead of the grid.
   ================================================================ */

.ppt-mobile-cards {
    display: none;
}

.ppt-mobile-card {
    border: 1px solid var(--ppt-border);
    border-radius: var(--ppt-radius);
    overflow: hidden;
    background: var(--ppt-bg);
}

.ppt-mobile-cards .ppt-tier-header {
    border-bottom: 1px solid var(--ppt-border);
    background: var(--ppt-bg-alt);
}

.ppt-mobile-cards .ppt-tier-subtitle {
    max-width: 30ch;
}

.ppt-mobile-feature {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 11px 16px;
    font-size: 13.5px;
    border-top: 1px solid var(--ppt-border);
}

.ppt-mobile-feature:first-of-type {
    border-top: 0;
}

.ppt-mobile-stripe {
    background: var(--ppt-bg-stripe);
}

.ppt-mobile-feature-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ppt-text-dim);
    margin-right: 0;
}

.ppt-mobile-feature-value {
    text-align: right;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--ppt-text);
}

/* On the cards the note is in the flow, in front of the mark. */
.ppt-mobile-feature-value .ppt-note {
    position: static;
    transform: none;
    margin: 0 6px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--ppt-text-dim);
}

.ppt-mobile-cards .ppt-cta-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
}

/* ================================================================
   Narrow viewports
   ================================================================ */

@media ( max-width: 900px ) {
    /* The grid cannot be folded to one column, see the file header. */
    .ppt-wrapper .ppt-table {
        display: none !important;
    }

    .ppt-mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 22px;
    }

    .ppt-product-toggle {
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        max-width: 340px;
    }

    /* The group switch stays a row: two short labels share the width. */
    .ppt-group-toggle {
        transform: none;
        width: 100%;
        max-width: 340px;
    }

    .ppt-selector .ppt-group-pill {
        flex: 1;
        min-width: 0;
        padding: 0 10px;
        line-height: 40px;
    }

    /* Stacked segments inside the same rounded container, prompt on top again. */
    .ppt-selector .ppt-toggle-pill,
    .ppt-product-toggle--two .ppt-toggle-pill--prompt,
    .ppt-product-toggle--two .ppt-toggle-pill--prompt + .ppt-toggle-pill,
    .ppt-product-toggle--two .ppt-toggle-pill--prompt + .ppt-toggle-pill + .ppt-toggle-pill {
        order: 0;
        min-width: 0;
        margin: 0;
        line-height: 40px;
    }

    /* Near the edge the bubble would run off screen, so pin it to the right. */
    .ppt-tooltip-body {
        left: auto;
        right: -6px;
        transform: none;
        max-width: 74vw;
    }
}
