.dsb-feature-gate {
    --dsb-feature-gate-border: var(--dsb-border-light, #dde5ef);
    --dsb-feature-gate-bg: var(--dsb-bg-page, #f7f9fc);
    --dsb-feature-gate-text: var(--dsb-text-color, #233247);
    --dsb-feature-gate-muted: var(--dsb-text-muted, #687789);
    --dsb-feature-gate-accent: var(--theme-action, #22b14c);
    border: 1px solid var(--dsb-feature-gate-border);
    border-radius: 14px;
    background: var(--dsb-feature-gate-bg);
    color: var(--dsb-feature-gate-text);
}

.dsb-feature-gate--inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.dsb-feature-gate--card,
.dsb-feature-gate--page {
    padding: 28px;
    text-align: center;
}

.dsb-feature-gate--dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    opacity: .72;
    cursor: not-allowed;
}

/* The design guide's locked action (entitlement-gates-demo.html, scenario 3): the real control,
   dimmed and unusable, with a compact upgrade pill next to it.

   Laid out as ONE inline control, not display:contents. Under display:contents the pill became a
   second item in whatever row hosted the button, which is how it used to break out of a tight
   toolbar; as one inline-flex box the pair travels together wherever the caller puts it. */
.dsb-feature-gate--button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    /* The wrapper is a layout box, not a surface -- the base .dsb-feature-gate rule paints a
       card, which has no business around a button. */
    border: 0;
    border-radius: 0;
    background: none;
}

.dsb-feature-gate__content--button-disabled {
    display: contents;
    pointer-events: none;
    user-select: none;
}

.dsb-feature-gate__content--button-disabled .dsb-btn {
    background: var(--theme-action-dark) !important;
    border-color: var(--theme-action-dark) !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: .45 !important;
}

/* The guide swaps the action's own icon for a padlock. Done here rather than at the six call
   sites, so none of them has to know it is being gated. f023 is Font Awesome's lock; the weight
   is restated because the glyph only exists in the solid face. */
.dsb-feature-gate__content--button-disabled .dsb-btn > i:first-child::before {
    content: "\f023";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
}

.dsb-feature-gate__upgrade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--dsb-alert-warning-bg);
    /* !important because vendor.css:41045 paints EVERY anchor with
       a { color:#0089d0 !important } -- it beats any specificity this rule could reach, and the
       pill is a link. Same workaround as dsb.css:1370, which documents the same trap. */
    color: var(--dsb-alert-warning-text) !important;
    border: 1px solid var(--dsb-alert-warning-border);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    flex: none;
}

.dsb-feature-gate__upgrade:hover,
.dsb-feature-gate__upgrade:focus-visible {
    background: var(--dsb-warn-bg);
    color: var(--dsb-alert-warning-text) !important;
    text-decoration: none;
}

.dsb-feature-gate--disabled,
.dsb-feature-gate--page {
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

/* --table is a <tr>, not a surface: no border, no radius, no 160px height — all of that belongs
   to the <div> inside the cell. Left here it would apply to the row, where border-radius does
   nothing and a min-height can only stretch the table. */
.dsb-feature-gate--table {
    border: 0;
    border-radius: 0;
    background: none;
}

.dsb-feature-gate--table > td {
    padding: 0;
}

.dsb-feature-gate__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 16px 20px;
    background: var(--dsb-feature-gate-bg);
    border-top: 1px solid var(--dsb-feature-gate-border);
    border-bottom: 1px solid var(--dsb-feature-gate-border);
}

.dsb-feature-gate__row-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Claim a readable width before yielding any to the CTA. */
    flex: 1 1 260px;
}

.dsb-feature-gate__row-copy span {
    color: var(--dsb-feature-gate-muted);
}

/* The CTA's 14px top margin is calculated for a centred panel; on the row it sits beside the
   copy and belongs on its centre line. */
.dsb-feature-gate__row .dsb-feature-gate__cta {
    margin-top: 0;
    flex: none;
    white-space: nowrap;
}

.dsb-feature-gate__content--disabled {
    filter: grayscale(1);
    opacity: .35;
    pointer-events: none;
    user-select: none;
}

.dsb-feature-gate__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(247, 249, 252, .82);
    backdrop-filter: blur(2px);
}

.dsb-feature-gate__panel {
    max-width: 460px;
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(22, 34, 51, .14);
    text-align: center;
}

.dsb-feature-gate__panel h2,
.dsb-feature-gate__panel h3,
.dsb-feature-gate--card h3 {
    margin-top: 0;
}

.dsb-feature-gate__panel p,
.dsb-feature-gate--card p {
    color: var(--dsb-feature-gate-muted);
}

.dsb-feature-gate__cta {
    margin-top: 14px;
}

.dsb-feature-gate__link {
    color: var(--dsb-feature-gate-accent);
    font-weight: 700;
}

/* THE QUIET MARKER (design guide V2 2.27.21's .dg2-lock). A 22px stadium in a faint navy wash —
   never a signal colour, never a banner, never animated. The brief it answers is that a company
   which does not want the feature must be able to read past the fact that it exists.

   It carries NO plan name. The guide's marker reads "Pro", which assumes the feature is sold in a
   plan of that name; we do not know which plan carries any given feature, so the marker is the
   padlock alone and the feature's own title travels as its title/aria-label. */
.dsb-feature-gate__lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 22px;
    min-width: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(29, 45, 73, .07);
    color: var(--dsb-navy-soft);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex: none;
}

/* The marker as a door: the same stadium as a link to the upgrade, and its yellow QUOTA variant —
   "0 of 3 left" — for a count that is spent (the guide's .dg2-lock--quota, §15's count marker). */
a.dsb-feature-gate__lock { text-decoration: none; transition: background-color .18s ease; }
a.dsb-feature-gate__lock:hover { background: rgba(29, 45, 73, .12); color: var(--dsb-navy-soft); }
a.dsb-feature-gate__lock:focus-visible { outline: 2px solid var(--theme-secondary); outline-offset: 2px; }
.dsb-feature-gate__lock--quota,
a.dsb-feature-gate__lock--quota:hover { background: var(--dsb-warn-bg); color: var(--dsb-warn-ink); }
a.dsb-feature-gate__lock--quota:hover { background: rgba(240, 194, 57, .36); }

/* THE PREVIEW VEIL (V2 2.27.54 / 2.27.55). A visual module that is not in plan keeps its head and is
   drawn under a light veil — sample data, never the company's own — with ONE panel that explains and
   offers to look (Preview) or, where the plan carries demos, to try the real thing (Demo, with its
   count). The panel sells nothing; the marker in the head stays the one door to the upgrade.
   The veil lies inside the module's plot box, so it covers the chart and never the head. */
.dsb-feature-gate__veil {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 19.2px;
    background: rgba(255, 255, 255, .5);
    transition: opacity .18s ease;
}
.dsb-feature-gate__veil[hidden] { display: none; }
.dsb-feature-gate__veil--blur {
    background: rgba(255, 255, 255, .42);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}
.dsb-feature-gate__veil-panel {
    width: min(400px, 100%);
    padding: 22.4px 24px 20.8px;
    background: #fff;
    border-radius: var(--dsb-radius-lg);
    box-shadow: 0 0 0 1px var(--dsb-border-color), 0 24px 56px -22px rgba(15, 23, 38, .4);
    text-align: center;
}
.dsb-feature-gate__veil-panel h4 {
    margin: 0 0 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-weight: 800;
    font-size: 17.6px;
    letter-spacing: -.01em;
    color: var(--dsb-head-color);
}
.dsb-feature-gate__veil-panel p {
    margin: 0 0 16px;
    font-size: 14.4px;
    line-height: 1.5;
    color: var(--dsb-text-muted);
}
.dsb-feature-gate__veil-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9.6px;
    flex-wrap: wrap;
}
.dsb-feature-gate__count { font-size: 12.8px; color: var(--dsb-text-muted); }
.dsb-feature-gate__count[hidden],
.dsb-feature-gate__lock[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    .dsb-feature-gate__veil { transition: none; }
}
