/**
 * Page Designer — Rich Text block — dedicated styles
 *
 * STRICT ISOLATION: every selector in this file uses the pd-blk-rt-*
 * namespace. ZERO selectors are shared with other blocks, panels, or
 * tools. Deletion of this file is non-destructive — only the Rich Text
 * block stops styling, nothing else changes.
 */

/* ──────────────────────────────────────────────────────────────────────
 * v2.9.378 — H-tag conversion isolation
 *
 * The Format dropdown stamps `.pd-blk-rt-htag` on every <h1>-<h6> it
 * produces (and clones it onto a per-level marker class so each level
 * can carry its natural font-size). Doubled-class selectors give a
 * specificity of (0,2,0) which beats any Pattern B rule on the block
 * — `[data-pd-blk-rt-uid="…"] h6` is (0,1,1) — WITHOUT !important.
 *
 *   text-align: inherit  → cascades from the block root, the alignment
 *                          buttons stay in control.
 *   font-size: <em>      → matches the user-agent natural sizing for
 *                          each level. A previous slider-applied
 *                          font-size on the paragraph can no longer
 *                          leak into the new heading.
 *
 * Strict isolation: classes in this block use the pd-blk-rt-htag
 * prefix. Grep-confirmed unused module-wide before introducing.
 * ──────────────────────────────────────────────────────────────────── */
/* v2.9.382 — Header Text theme is the single source of truth for
 * h-tag font-family / font-size / font-weight / colour / line-height
 * etc. The Theme rule lives at pd_global_styles.js:617 and selects
 * `h1, h2, h3, h4, h5, h6, [data-pd-block="heading"]…`. Earlier
 * versions of this file overrode the theme by hard-coding em sizes
 * here, which is exactly what the user just flagged.
 *
 * What we still need to enforce per-block:
 *  - text-align: inherit so the block-root alignment buttons keep
 *    full control of heading alignment (otherwise a Pattern B rule
 *    targeting `[data-pd-blk-rt-uid="…"] h6` could lock alignment
 *    independently of the parent block's text-align).
 *
 * Everything sizing / weight / family / colour is intentionally
 * absent — Theme > Header Text owns all of that. */
/* v3.7.829 — headings FOLLOW the Global Theme's Header alignment token by
 * default (so the theme's alignment reaches them in the editor canvas AND on the
 * live page, regardless of a centred section). Fallback `inherit` keeps the old
 * per-section behaviour when no theme token is present. A deliberate per-block
 * alignment (panel edit → #id rule) still out-specifies this and wins. */
.pd-blk-rt-htag.pd-blk-rt-htag {
    text-align: var(--pd-header-align, inherit);
}

/* Legacy fallback for headings inside text blocks that don't have
 * the .pd-blk-rt-htag class (dropped before v2.9.378 stamped the
 * class on conversion). Same alignment-inheritance guarantee. */
[data-pd-block="text"][data-pd-block] h1,
[data-pd-block="text"][data-pd-block] h2,
[data-pd-block="text"][data-pd-block] h3,
[data-pd-block="text"][data-pd-block] h4,
[data-pd-block="text"][data-pd-block] h5,
[data-pd-block="text"][data-pd-block] h6 {
    text-align: inherit;
}

/* ──────────────────────────────────────────────────────────────────────
 * On-canvas appearance — the rendered Rich Text wrapper inside the
 * GrapesJS canvas iframe.
 * ────────────────────────────────────────────────────────────────────── */
.pd-blk-rt {
    padding: 16px;
    line-height: 1.6;
    font-family: inherit;
    color: inherit;
    min-height: 60px;
}
.pd-blk-rt h1, .pd-blk-rt h2, .pd-blk-rt h3,
.pd-blk-rt h4, .pd-blk-rt h5, .pd-blk-rt h6 {
    margin: 0 0 12px;
    line-height: 1.25;
}
.pd-blk-rt p {
    margin: 0 0 12px;
}
.pd-blk-rt ul, .pd-blk-rt ol {
    margin: 0 0 12px;
    padding-left: 28px;
}
.pd-blk-rt li {
    margin-bottom: 4px;
}
/* v2.9.5: vendor `text` block (renders as <p data-pd-block="text">) has
 * no `.pd-blk-rt` wrapper class, so the rule above doesn't apply to it.
 * Browser default `<ol>`/`<ul>` padding gets reset by GrapesJS canvas
 * CSS, which causes decimal/alpha markers ("1.", "a.", "I.") to render
 * outside the left edge of the block. Dedicated selector uses the
 * `data-pd-block` stamp so this stays isolated to Text/Heading blocks. */
[data-pd-block="text"] ol,
[data-pd-block="text"] ul,
[data-pd-block="heading"] ol,
[data-pd-block="heading"] ul {
    /* v2.9.12: padding-left in `em` so the reserved marker lane scales
     * with the list's font-size. Fixed-px padding clipped large bullets
     * / numerals outside the block when the slider bumped font size. */
    padding-left: 1.6em;
    margin: 0 0 12px;
}
/* v2.9.13: market-standard long-word containment (Elementor / Webflow
 * / Squarespace / Wix all ship this). A single big word at a huge
 * slider-set font size would otherwise clip past the container's
 * right edge. `overflow-wrap: break-word` only kicks in when a word
 * actually exceeds the line — no visual effect on normal text. */
[data-pd-block="text"],
[data-pd-block="heading"] {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}
[data-pd-block="text"] li,
[data-pd-block="heading"] li {
    margin-bottom: 4px;
}
.pd-blk-rt blockquote {
    margin: 0 0 12px;
    padding: 8px 16px;
    border-left: 3px solid color-mix(in srgb, currentColor 25%, transparent); /* v3.7.17 — neutral accent, no admin token */
    color: inherit; /* follows General Text colour */
    font-style: italic;
}
.pd-blk-rt pre {
    margin: 0 0 12px;
    padding: 12px;
    background: color-mix(in srgb, currentColor 6%, transparent); /* v3.7.17 — neutral code surface, no admin token */
    border-radius: 4px;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 13px;
    overflow-x: auto;
}
.pd-blk-rt a {
    color: var(--pd-link-color, currentColor); /* v3.7.17 — Global Theme > Links colour, not admin token */
    text-decoration: underline;
}
/* Empty-state hint — when content is blank, show a placeholder so the
 * block is still visible/clickable on the canvas. Uses ::before so it
 * doesn't pollute the actual content string. */
.pd-blk-rt:empty::before {
    content: 'Click to edit Rich Text block →';
    color: var(--at-color-card-foreground);
    font-style: italic;
    font-size: 14px;
}

/* ──────────────────────────────────────────────────────────────────────
 * Sidebar panel chrome — the dedicated Rich Text settings panel
 * Uses Catppuccin colors to match other block panels.
 * ────────────────────────────────────────────────────────────────────── */
.pd-blk-rt-panel {
    /* Panel chrome inherits from .pd-dsp panel base styles in editor.css */
}

/* Toolbar container above the editor — 12-tab layout (v2.0.81) */
.pd-blk-rt-toolbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    background: var(--at-color-card);
    border-bottom: 1px solid var(--at-color-border);
}

/* ── 12 square tabs arranged 2 rows × 6 cols ───────────────────────── */
/* Mirrors .pd-typ-btn-group segmented style — connected row, single
 * border around the whole row, dividers between cells, no per-cell
 * border-radius. Two stacked rows so users see all 12 categories. */
.pd-blk-rt-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}
.pd-blk-rt-tab-row {
    display: flex;
    gap: 0;
    border: 1px solid var(--at-color-border);
    border-radius: 6px;
    overflow: hidden;
}
.pd-blk-rt-tab {
    flex: 1;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--at-color-card);
    border: none;
    border-right: 1px solid var(--at-color-border);
    color: var(--at-color-card-foreground);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: all 0.15s;
}
.pd-blk-rt-tab:last-child {
    border-right: none;
}
/* v2.9.205: orphan row holding the lone Auto-Behaviors button — shrink the
 * row to one column-width so the button sizes like its 6-per-row siblings
 * instead of stretching across the whole panel. */
.pd-blk-rt-tab-row-single {
    align-self: flex-start;
    width: calc(100% / 6);
}
/* v2.6.13: partial-row modifier (.pd-blk-rt-tab-row-pad) removed.
 * The orphan 4th row holding the lone Stats tab no longer exists —
 * Stats was promoted into row 2's last slot, so every row is now
 * uniformly 6 wide and the partial-row workaround is unnecessary. */
.pd-blk-rt-tab .fa { font-size: 14px; }
.pd-blk-rt-tab:hover {
    color: var(--at-color-card-foreground);
    background: var(--at-color-card);
}
.pd-blk-rt-tab-active {
    background: #89b4fa;
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-tab-active:hover {
    background: #74c7ec;
    color: var(--at-color-card-foreground);
}

/* Tab body container — only the active body is visible */
.pd-blk-rt-tab-bodies {
    display: block;
    padding: 6px 0 2px;
    border-top: 1px solid var(--at-color-border);
}
.pd-blk-rt-tab-body {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.pd-blk-rt-tab-body-active {
    display: flex;
}

/* Horizontal icon-button strip used inside tabs that mix flat buttons
 * with full-width fields (inline / align / lists / inserts / editing /
 * links). The strip itself flows horizontally with wrap; the surrounding
 * tab body still stacks vertically. */
.pd-blk-rt-btn-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
}

/* ── Full-width field rows — Typography-style ─────────────────────────
 * Visual mirror of the Typography panel's field layout (label above,
 * full-width control below) but namespaced under pd-blk-rt-* so the
 * Rich Text panel cannot collide with .pd-dsp-field / .pd-dsp-input.
 * Strict isolation rule applies even when the LOOK is identical. */
.pd-blk-rt-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pd-blk-rt-field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.pd-blk-rt-field-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--at-color-card-foreground);
    font-weight: 600;
    margin: 0;
}
/* Globe icon — marks fields that apply to the entire block (not just
 * selected text). Sits at the far right of the label row. */
.pd-blk-rt-field-scope {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--at-color-card-foreground);
    font-size: 11px;
    cursor: help;
    transition: color 0.15s;
}
.pd-blk-rt-field-scope:hover {
    color: var(--at-color-primary);
}
.pd-blk-rt-field-scope .fa {
    font-size: 11px;
}
.pd-blk-rt-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.pd-blk-rt-input:focus {
    border-color: #89b4fa;
    background: var(--at-color-card);
}
.pd-blk-rt-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #6c7086 50%),
        linear-gradient(135deg, #6c7086 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 50%,
        calc(100% - 9px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 24px;
    cursor: pointer;
}
.pd-blk-rt-text {
    font-family: inherit;
}

/* Full-width colour picker — mirrors .pd-dsp-color visual.
   padding: 0 matches Settings → Header Text picker frame strength;
   border-color uses themed token (already overridden in
   pd_slideout_panels_theme.css for runtime, fallback hex preserved). */
.pd-blk-rt-color {
    width: 100%;
    height: 32px;
    box-sizing: border-box;
    background: var(--at-color-input, #181825);
    border: 1px solid var(--at-color-border, #313244);
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s;
}
.pd-blk-rt-color:hover {
    border-color: var(--at-color-border, #45475a);
}
.pd-blk-rt-color::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 3px;
    overflow: hidden;
}
.pd-blk-rt-color::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* Slider field — slider + live numeric label + unit */
.pd-blk-rt-slider-field {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-blk-rt-slider {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    height: 4px;
    background: var(--at-color-card);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.pd-blk-rt-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #89b4fa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--at-color-border);
    transition: transform 0.1s;
}
.pd-blk-rt-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.pd-blk-rt-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #89b4fa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--at-color-border);
}
.pd-blk-rt-slider-val {
    font-size: 11px;
    color: var(--at-color-card-foreground);
    font-weight: 600;
    min-width: 32px;
    text-align: right;
}
.pd-blk-rt-slider-unit {
    font-size: 10px;
    color: var(--at-color-card-foreground);
    min-width: 18px;
}

/* ─── Insert Link modal ──────────────────────────────────────────────
 * Centered overlay card appended to document.body. Strict isolation:
 * every class is .pd-blk-rt-link-modal-* and shares NOTHING with the
 * inline panel modals (.pd-blk-rt-modal-*) or the Design panel modals.
 */
.pd-blk-rt-link-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.pd-blk-rt-link-modal-backdrop.pd-blk-rt-link-modal-visible {
    display: flex;
}
.pd-blk-rt-link-modal {
    width: 480px;
    max-width: 92vw;
    max-height: 90vh;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pd-blk-rt-link-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--at-color-border);
}
.pd-blk-rt-link-modal-title {
    color: var(--at-color-card-foreground);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-blk-rt-link-modal-title .fa { color: #89b4fa; }
.pd-blk-rt-link-modal-close {
    background: transparent;
    border: none;
    color: var(--at-color-card-foreground);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.15s;
}
.pd-blk-rt-link-modal-close:hover {
    color: var(--at-color-card-foreground);
    background: var(--at-color-card);
}
.pd-blk-rt-link-modal-body {
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pd-blk-rt-link-modal-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pd-blk-rt-link-modal-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.pd-blk-rt-link-modal-label {
    font-size: 11px;
    color: var(--at-color-card-foreground);
    font-weight: 600;
}
.pd-blk-rt-link-modal-label-req::after {
    content: ' *';
    color: var(--at-color-destructive-ink);
}
.pd-blk-rt-link-modal-label-opt {
    color: var(--at-color-card-foreground);
    font-weight: 400;
    font-size: 10px;
}
.pd-blk-rt-link-modal-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    padding: 9px 11px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}
.pd-blk-rt-link-modal-input:focus {
    border-color: #89b4fa;
    background: var(--at-color-card);
}
.pd-blk-rt-link-modal-input::placeholder {
    color: var(--at-color-card-foreground);
}
/* ── URL row with protocol dropdown ─────────────────────────────── */
/* v2.9.65: wrapper around the url-row + File-type Insert button so
   they sit side-by-side with a gap. Own namespace. */
.pd-blk-rt-link-modal-url-row-wrap {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}
.pd-blk-rt-link-modal-url-row-wrap .pd-blk-rt-link-modal-url-row {
    flex: 1 1 auto;
    min-width: 0;
}
.pd-blk-rt-link-modal-url-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    overflow: hidden;
    background: var(--at-color-card);
    transition: border-color 0.15s;
}
/* v2.9.65: File-type Insert button — same visual as the Image
   Block's source upload button (blue, dark icon) but owns its
   class so no shared styling. */
.pd-blk-rt-link-modal-file-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--at-color-primary, #89b4fa);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border, #89b4fa);
    border-radius: 5px;
    padding: 0 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    min-width: 42px;
}
.pd-blk-rt-link-modal-file-btn:hover,
.pd-blk-rt-link-modal-file-btn:focus {
    background: #74c7ec;
    border-color: #74c7ec;
    color: var(--at-color-card-foreground);
    outline: none;
}
.pd-blk-rt-link-modal-url-row:focus-within {
    border-color: #89b4fa;
}
.pd-blk-rt-link-modal-url-protocol {
    flex: 0 0 auto;
    background: var(--at-color-card);
    color: var(--at-color-primary);
    border: none;
    border-right: 1px solid var(--at-color-border);
    padding: 0 6px 0 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
}
.pd-blk-rt-link-modal-url-input {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    flex: 1 1 auto;
    min-width: 0;
}
.pd-blk-rt-link-modal-url-input:focus {
    border: none !important;
    background: transparent !important;
}
.pd-blk-rt-link-modal-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #6c7086 50%),
        linear-gradient(135deg, #6c7086 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 50%,
        calc(100% - 9px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
    cursor: pointer;
}
.pd-blk-rt-link-modal-check-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    cursor: pointer;
    user-select: none;
}
.pd-blk-rt-link-modal-check-row input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #89b4fa;
}
.pd-blk-rt-link-modal-check-row code {
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    color: var(--at-color-status-warning-ink);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 10px;
}
.pd-blk-rt-link-modal-check-hint {
    color: var(--at-color-card-foreground);
    font-size: 10px;
}
.pd-blk-rt-link-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--at-color-border);
    background: var(--at-color-card);
}
.pd-blk-rt-link-modal-btn {
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.pd-blk-rt-link-modal-btn:hover {
    background: var(--at-color-card);
    border-color: var(--at-color-border);
}
.pd-blk-rt-link-modal-btn-primary {
    background: #89b4fa;
    color: var(--at-color-card-foreground);
    border-color: #89b4fa;
}
.pd-blk-rt-link-modal-btn-primary:hover {
    background: #74c7ec;
    border-color: #74c7ec;
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-link-modal-btn .fa { margin-right: 5px; }

/* ── Insert Link modal — Link Type + Anchor picker (v2.9.62) ────
   Copied behaviour from the Link Block panel but every selector
   lives under the existing `pd-blk-rt-link-modal-*` namespace with
   dedicated -lt- / -anc- / -url-prefix suffixes. Grep-confirmed
   unique to this modal — no shared CSS. */
.pd-blk-rt-link-modal-lt-seg {
    display: flex;
    gap: 0;
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
}
.pd-blk-rt-link-modal-lt-btn {
    flex: 1;
    background: var(--at-color-card);
    border: none;
    border-right: 1px solid var(--at-color-border);
    color: var(--at-color-card-foreground);
    cursor: pointer;
    padding: 7px 4px;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.15s;
}
.pd-blk-rt-link-modal-lt-btn:last-child {
    border-right: none;
}
.pd-blk-rt-link-modal-lt-btn:hover,
.pd-blk-rt-link-modal-lt-btn-active {
    background: #89b4fa;
    color: var(--at-color-card-foreground);
}

/* Url prefix span — renders mailto: / tel: inline next to the
   URL input when Link Type requires a scheme prefix. */
.pd-blk-rt-link-modal-url-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-right: none;
    color: var(--at-color-card-foreground);
    font-size: 12px;
    font-family: monospace;
    border-radius: 5px 0 0 5px;
    white-space: nowrap;
}

/* Anchor picker — button + menu + items, all mirror the Link
   Block panel's look but with dedicated class suffixes. */
.pd-blk-rt-link-modal-anc-wrap {
    position: relative;
}
.pd-blk-rt-link-modal-anc-btn {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}
.pd-blk-rt-link-modal-anc-btn:hover,
.pd-blk-rt-link-modal-anc-btn:focus {
    background: var(--at-color-card);
    border-color: var(--at-color-border);
    outline: none;
}
.pd-blk-rt-link-modal-anc-btn[aria-expanded="true"] {
    border-color: #89b4fa;
}
.pd-blk-rt-link-modal-anc-btn-label {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.pd-blk-rt-link-modal-anc-btn-caret {
    flex: 0 0 auto;
    color: var(--at-color-card-foreground);
    font-size: 10px;
    transition: transform 0.15s;
}
.pd-blk-rt-link-modal-anc-btn[aria-expanded="true"] .pd-blk-rt-link-modal-anc-btn-caret {
    transform: rotate(180deg);
}
.pd-blk-rt-link-modal-anc-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.50);
    z-index: 10;
    padding: 4px;
}
.pd-blk-rt-link-modal-anc-item {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: transparent;
    color: var(--at-color-card-foreground);
    border: none;
    border-radius: 4px;
    padding: 7px 10px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background 0.1s;
}
.pd-blk-rt-link-modal-anc-item:hover,
.pd-blk-rt-link-modal-anc-item:focus {
    background: var(--at-color-card);
    outline: none;
}
.pd-blk-rt-link-modal-anc-item-label {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.pd-blk-rt-link-modal-anc-item-tag {
    flex: 0 0 auto;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}
.pd-blk-rt-link-modal-anc-empty {
    padding: 14px 12px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    line-height: 1.5;
    text-align: center;
}
.pd-blk-rt-link-modal-anc-hint {
    font-size: 11px;
    color: var(--at-color-card-foreground);
    margin-top: 6px;
    line-height: 1.4;
}

/* List Style Image field — text input + dedicated upload button that
 * opens GrapesJS's AssetManager modal. Fully namespaced; does NOT share
 * any classes with .pd-dsp-img-upload-btn or any Design panel image
 * field. */
.pd-blk-rt-img-field {
    display: flex;
    align-items: stretch;
    gap: 4px;
}
.pd-blk-rt-img-url {
    flex: 1;
    min-width: 0;
}
.pd-blk-rt-img-upload-btn {
    flex: 0 0 auto;
    width: 36px;
    background: var(--at-color-primary, #89b4fa);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border, #89b4fa);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    padding: 0;
}
.pd-blk-rt-img-upload-btn:hover {
    background: color-mix(in srgb, var(--at-color-primary, #89b4fa) 85%, var(--at-color-foreground, #cdd6f4));
    border-color: var(--at-color-primary, #89b4fa);
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-img-upload-btn:active {
    transform: scale(0.96);
}

/* Reset to Default — panel-wide reset button at the top of the body.
 * Visually mirrors the Typography panel's .pd-typ-reset-btn but uses a
 * dedicated class so it stays fully isolated. Sits above the Content
 * section and clears every block-level inline style + Pattern B rule
 * attached to the active Rich Text block. */
/* Colour comes from the shared Reset Button stylesheet (pd_reset_btn.css). */
.pd-blk-rt-reset-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 12px 16px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.pd-blk-rt-reset-btn .fa {
    margin-right: 6px;
}

/* Clear/reset action button (e.g. Clear List Styling) */
/* Colour comes from the shared Reset Button stylesheet (pd_reset_btn.css). */
.pd-blk-rt-clear-btn {
    width: 100%;
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 11px;
    cursor: pointer;
    margin-top: 4px;
}
.pd-blk-rt-clear-btn .fa {
    margin-right: 5px;
}
.pd-blk-rt-tab-row-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.pd-blk-rt-tab-hint {
    font-size: 11px;
    color: var(--at-color-card-foreground);
    line-height: 1.5;
    padding: 2px 0;
}

/* Automatic Behaviors info rows — descriptive prose, must stay legible */
.pd-blk-rt-info-row {
    font-size: 11px;
    line-height: 1.55;
    color: var(--at-color-card-foreground);
    padding: 2px 0;
}
.pd-blk-rt-info-row strong {
    color: var(--at-color-card-foreground);
    font-weight: 600;
}
.pd-blk-rt-info-row .fa {
    color: var(--at-color-primary);
    margin-right: 4px;
}
.pd-blk-rt-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
    align-items: center;
    padding: 4px 0 2px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-info-grid code {
    background: var(--at-color-card);
    color: var(--at-color-status-warning-ink);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 10px;
    text-align: center;
    min-width: 32px;
}
.pd-blk-rt-info-grid span {
    color: var(--at-color-card-foreground);
}

/* Stat rows for the Status & Metrics tab (Tab 12) */
.pd-blk-rt-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 11px;
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-stat .fa {
    font-size: 11px;
    opacity: 0.7;
    width: 14px;
    text-align: center;
}
.pd-blk-rt-stat-num {
    color: var(--at-color-card-foreground);
    font-weight: 600;
}
.pd-blk-rt-stat-label {
    color: var(--at-color-card-foreground);
}

/* Row 1 dropdowns — Format / Font Family / Font Size — share base style */
.pd-blk-rt-format,
.pd-blk-rt-fontfamily,
.pd-blk-rt-fontsize {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 8px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.pd-blk-rt-format { flex: 2 1 0; }
.pd-blk-rt-fontfamily { flex: 2 1 0; }
.pd-blk-rt-fontsize { flex: 1 1 0; }
.pd-blk-rt-format:focus,
.pd-blk-rt-fontfamily:focus,
.pd-blk-rt-fontsize:focus {
    outline: none;
    border-color: #89b4fa;
}

/* Drop Cap toggle — checkbox + label combo */
.pd-blk-rt-dropcap-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 4px;
    color: var(--at-color-card-foreground);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}
.pd-blk-rt-dropcap-label:hover {
    border-color: var(--at-color-border);
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-dropcap-label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    border: 1px solid #89b4fa;
    border-radius: 3px;
    background: var(--at-color-card);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.pd-blk-rt-dropcap-label input[type="checkbox"]:checked {
    background: #89b4fa;
    border-color: #89b4fa;
}
.pd-blk-rt-dropcap-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #1f2937;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* v2.8.82: Enable Background checkbox inside the Link tab state rows.
 * Reuses the Drop Cap checkbox chrome (blue border, Catppuccin blue
 * fill on :checked) but under its own namespace so the style can
 * diverge later if needed. Label is a flex row so the checkbox sits
 * inline with its text. */
.pd-blk-rt-link-bg-enable-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    margin: 6px 0 4px;
    cursor: pointer;
    user-select: none;
}
.pd-blk-rt-link-bg-enable-label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    border: 1px solid #89b4fa;
    border-radius: 3px;
    background: var(--at-color-card);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.pd-blk-rt-link-bg-enable-label input[type="checkbox"]:checked {
    background: #89b4fa;
    border-color: #89b4fa;
}
.pd-blk-rt-link-bg-enable-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #1f2937;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Color picker wrappers — text + highlight color buttons */
.pd-blk-rt-color-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}
.pd-blk-rt-color-wrap:hover {
    background: var(--at-color-card);
}
.pd-blk-rt-color-wrap input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.pd-blk-rt-color-wrap .fa {
    font-size: 11px;
    pointer-events: none;
    z-index: 1;
}

/* AI mode selector strip */
.pd-blk-rt-ai-modes {
    display: flex;
    gap: 4px;
    margin: 4px 0 6px;
}
.pd-blk-rt-ai-mode {
    flex: 1;
    padding: 4px 0;
    font-size: 11px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.12s;
}
.pd-blk-rt-ai-mode:hover {
    background: var(--at-color-card);
    border-color: var(--at-color-border);
}
.pd-blk-rt-ai-mode.pd-blk-rt-btn-on {
    background: rgba(137, 180, 250, 0.18);
    border-color: rgba(137, 180, 250, 0.5);
    color: var(--at-color-primary);
}
/* AI tone selector */
.pd-blk-rt-ai-tone-row {
    margin: 2px 0 6px;
}
.pd-blk-rt-ai-tone {
    width: 100%;
    height: 28px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    font-size: 11px;
    padding: 0 6px;
    margin-top: 4px;
    cursor: pointer;
}
.pd-blk-rt-ai-tone:focus {
    border-color: #89b4fa;
    outline: none;
}
/* v2.9.16: Generate button — fully self-contained, no shared base.
 * The earlier version also carried `.pd-blk-rt-btn` which defined a
 * fixed 2.3em × 2.3em square + `flex: 0 0 auto` *later* in the file,
 * winning on source order and stopping this button from stretching.
 * Now it owns every property it needs so no other tool's chrome can
 * ever leak in. Default state: full-width with a solid Catppuccin
 * blue border; click state: solid blue fill with dark text. */
.pd-blk-rt-btn-ai {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 34px;
    padding: 8px 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    color: var(--at-color-primary);
    border: 1px solid #89b4fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.pd-blk-rt-btn-ai .fa {
    font-size: 12px;
}
.pd-blk-rt-btn-ai:hover {
    background: rgba(137, 180, 250, 0.12);
    color: var(--at-color-primary);
    border-color: #89b4fa;
}
.pd-blk-rt-btn-ai:active,
.pd-blk-rt-btn-ai:focus {
    background: #89b4fa;
    color: var(--at-color-card-foreground);
    border-color: #89b4fa;
    outline: none;
}
/* Source editor textarea */
.pd-blk-rt-source {
    width: 100%;
    min-height: 180px;
    max-height: 400px;
    margin-top: 6px;
    background: var(--at-color-card);
    color: var(--at-color-status-success-ink);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    padding: 8px;
    resize: vertical;
    tab-size: 2;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.pd-blk-rt-source:focus {
    border-color: #89b4fa;
    outline: none;
}

/* Toolbar button row */
.pd-blk-rt-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}
.pd-blk-rt-btn {
    width: 2.3em;
    height: 2.3em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.12s;
    padding: 0;
    flex: 0 0 auto;
}
.pd-blk-rt-btn:hover {
    background: var(--at-color-card);
    border-color: var(--at-color-border);
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-btn:active {
    background: var(--at-color-card);
}
.pd-blk-rt-btn.pd-blk-rt-btn-on {
    background: rgba(137, 180, 250, 0.18);
    border-color: rgba(137, 180, 250, 0.5);
    color: var(--at-color-primary);
}
.pd-blk-rt-btn .fa {
    font-size: 1em;
}
.pd-blk-rt-sep {
    width: 1px;
    height: 18px;
    background: var(--at-color-card);
    margin: 0 4px;
}

/* The contenteditable editor area inside the Content section */
.pd-blk-rt-editor {
    min-height: 240px;
    max-height: 480px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid #89b4fa;
    border-radius: 4px;
    margin: 8px 12px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    outline: none;
    cursor: text;
}
.pd-blk-rt-editor:focus {
    border-color: #89b4fa;
    box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.15);
}
.pd-blk-rt-editor h1 { font-size: 22px; margin: 0 0 10px; font-weight: 700; }
.pd-blk-rt-editor h2 { font-size: 19px; margin: 0 0 10px; font-weight: 700; }
.pd-blk-rt-editor h3 { font-size: 17px; margin: 0 0 10px; font-weight: 600; }
.pd-blk-rt-editor h4 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
.pd-blk-rt-editor h5 { font-size: 14px; margin: 0 0 10px; font-weight: 600; }
.pd-blk-rt-editor h6 { font-size: 13px; margin: 0 0 10px; font-weight: 600; }
/* v2.8.79: heavier Bold rendering — browser default is 700, which can
 * look weak on modern UI fonts that ship a genuine 900 cut. Scoped to
 * the panel editor; the canvas + frontend get the same override via
 * editor.js's iframe injector and the frontend template. */
.pd-blk-rt-editor b, .pd-blk-rt-editor strong { font-weight: 900; }
/* v2.8.98: `.pd-rt-fs-hidden` rule removed. The hide-font-size-in-
 * panel approach was abandoned because Chrome's execCommand kept
 * stripping the wrapper spans during alignment / bold / etc. The
 * panel editor's existing max-height + overflow-y already handles
 * large font sizes gracefully by scrolling. */
.pd-blk-rt-editor p { margin: 0 0 10px; }
.pd-blk-rt-editor ul, .pd-blk-rt-editor ol { margin: 0 0 10px; padding-left: 24px; }
.pd-blk-rt-editor li { margin-bottom: 3px; }
.pd-blk-rt-editor blockquote {
    margin: 0 0 10px;
    padding: 4px 12px;
    border-left: 2px solid var(--at-color-border);
    color: var(--at-color-card-foreground);
    font-style: italic;
}
.pd-blk-rt-editor pre {
    margin: 0 0 10px;
    padding: 8px 10px;
    background: var(--at-color-card);
    border-radius: 3px;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 12px;
}
.pd-blk-rt-editor a {
    color: var(--at-color-primary);
    text-decoration: underline;
}

/* Style / Advanced section — route buttons */
.pd-blk-rt-route-hint {
    padding: 8px 12px 0;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    line-height: 1.5;
}
.pd-blk-rt-route-btn {
    display: block;
    width: calc(100% - 24px);
    margin: 10px 12px 12px;
    padding: 9px 12px;
    background: rgba(137, 180, 250, 0.08);
    color: var(--at-color-primary);
    border: 1px solid rgba(137, 180, 250, 0.25);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}
.pd-blk-rt-route-btn:hover {
    background: rgba(137, 180, 250, 0.16);
    border-color: rgba(137, 180, 250, 0.45);
}
.pd-blk-rt-route-btn .fa {
    margin-right: 6px;
}

/* ──────────────────────────────────────────────────────────────────────
 * v2.0.79 additions — status bar, inline modals, drop cap, special chars
 * All selectors namespaced pd-blk-rt-* (strict isolation).
 * ────────────────────────────────────────────────────────────────────── */

/* Inline modal panels (Find/Replace, Insert Image, Insert Table, Insert Embed)
   — appear inside the toolbar area as collapsible forms */
.pd-blk-rt-modal {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}
.pd-blk-rt-modal-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--at-color-card-foreground);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pd-blk-rt-modal-title .fa {
    font-size: 11px;
}
.pd-blk-rt-modal-close {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--at-color-card-foreground);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 11px;
}
.pd-blk-rt-modal-close:hover {
    color: var(--at-color-destructive-ink);
}
.pd-blk-rt-modal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.pd-blk-rt-modal-row label {
    flex: 0 0 60px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-modal-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 8px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    font-size: 11px;
    outline: none;
}
.pd-blk-rt-modal-input:focus {
    border-color: #89b4fa;
}
.pd-blk-rt-modal-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    cursor: pointer;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-row-tablehdr label.pd-blk-rt-modal-check-tablehdr {
    flex: 1 1 auto;
    white-space: nowrap;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-row-tablehdrbg label.pd-blk-rt-modal-label-tablehdrbg,
.pd-blk-rt-modal-row.pd-blk-rt-modal-row-tablehdrfg label.pd-blk-rt-modal-label-tablehdrfg {
    flex: 0 0 110px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    white-space: nowrap;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-row-tablehdrbg input.pd-blk-rt-modal-color-tablehdrbg,
.pd-blk-rt-modal-row.pd-blk-rt-modal-row-tablehdrfg input.pd-blk-rt-modal-color-tablehdrfg {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    padding: 2px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    cursor: pointer;
}

/* v2.6.4: Insert Image modal CSS removed — entire Media tab dropped. */

/* ── Horizontal Rule modal (dedicated, no shared selectors) ── */
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-thickness label.pd-blk-rt-modal-hr-label-thickness,
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-style label.pd-blk-rt-modal-hr-label-style,
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-color label.pd-blk-rt-modal-hr-label-color {
    flex: 0 0 70px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    white-space: nowrap;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-thickness input.pd-blk-rt-modal-hr-slider-thickness {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #89b4fa;
    cursor: pointer;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-thickness span.pd-blk-rt-modal-hr-val-thickness {
    flex: 0 0 32px;
    text-align: right;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    font-variant-numeric: tabular-nums;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-style select.pd-blk-rt-modal-hr-select-style {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 8px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}
.pd-blk-rt-modal-row.pd-blk-rt-modal-hr-row-color input.pd-blk-rt-modal-hr-color {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    padding: 0;
    background: var(--at-color-input, #1e1e2e);
    border: 1px solid var(--at-color-border, #313244);
    border-radius: 3px;
    cursor: pointer;
}
.pd-blk-rt-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
.pd-blk-rt-modal-btn {
    padding: 6px 14px;
    background: rgba(137, 180, 250, 0.12);
    color: var(--at-color-primary);
    border: 1px solid rgba(137, 180, 250, 0.35);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.pd-blk-rt-modal-btn:hover {
    background: rgba(137, 180, 250, 0.22);
    border-color: rgba(137, 180, 250, 0.6);
}

/* Special character popover — floating grid */
.pd-blk-rt-special-pop {
    position: fixed;
    z-index: 999999;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 6px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.50);
    max-width: 280px;
}
.pd-blk-rt-special-cell {
    width: 30px;
    height: 30px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-blk-rt-special-cell:hover {
    background: var(--at-color-card);
    border-color: #89b4fa;
}

/* v2.8.60: FA 4.7 icon popover — mirrors the special-char grid above
 * but wider (10 columns) and scrollable to fit ~105 icons. Dedicated
 * pd-blk-rt-icon-* namespace; no shared styling. */
.pd-blk-rt-icon-pop {
    position: fixed;
    z-index: 999999;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 6px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.50);
    max-width: 350px;
    max-height: 400px;
    overflow-y: auto;
}
.pd-blk-rt-icon-cell {
    width: 28px;
    height: 28px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-blk-rt-icon-cell:hover {
    background: var(--at-color-card);
    border-color: #89b4fa;
}

/* v2.8.61: hover affordance for inserted FA icons inside the panel
 * editor — signals the glyph is clickable (click selects it). Scoped
 * strictly to the Rich Text panel's contenteditable so icons elsewhere
 * on the page render untouched. */
#pd-blk-rt-editor i.fa {
    cursor: pointer;
}
#pd-blk-rt-editor i.fa:hover {
    outline: 1px dashed #89b4fa;
    outline-offset: 1px;
}
/* v2.8.63: blue background when a single icon is click-selected.
 * Mirrors the browser's native text-selection colours (Catppuccin
 * blue on the Rich Text panel's dark theme). Scoped to the panel
 * editor only — zero leakage to other FA icons elsewhere. */
#pd-blk-rt-editor i.fa.pd-blk-rt-icon-sel {
    background: #89b4fa;
    color: var(--at-color-card-foreground);
    border-radius: 2px;
    padding: 0 2px;
}

/* Drop Cap CSS — applied to the canvas wrapper when toggled on */
.pd-blk-rt.pd-blk-rt-dropcap > p:first-of-type::first-letter,
.pd-blk-rt.pd-blk-rt-dropcap > h1:first-of-type + p::first-letter,
.pd-blk-rt.pd-blk-rt-dropcap > h2:first-of-type + p::first-letter,
.pd-blk-rt.pd-blk-rt-dropcap > h3:first-of-type + p::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: 0.85;
    margin: 0.05em 0.1em 0 0;
    font-weight: 700;
    color: inherit;
}
/* v2.9.6: vendor `text` Text Block is itself the <p> (no .pd-blk-rt
 * wrapper, no nested <p>), so the selector above never matched. Drop
 * Cap applies directly to the block element's ::first-letter. Also
 * covers Heading Block (drop cap on a h1-h6 styled title).
 * v2.9.14: broadened to ANY element carrying the dedicated
 * `pd-blk-rt-dropcap` class so the Drop Cap tool works on Accordion
 * bodies, Tab bodies, Quote text, etc. — anywhere the Rich Text panel
 * can attach. The class is namespaced to this tool, nothing else
 * writes it, so broadening stays safe. */
.pd-blk-rt-dropcap::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: 0.85;
    margin: 0.05em 0.1em 0 0;
    font-weight: 700;
    color: inherit;
}
/* v2.9.9: establish a block formatting context on the paragraph so
 * the floated drop cap is contained regardless of how short the
 * paragraph's own text content is. Without this, a one-line block
 * lets the 3.5em cap overflow below the block's visible edge.
 * v2.9.14: also broadened to any dropcap'd element. */
.pd-blk-rt-dropcap {
    display: flow-root;
}

/* v2.6.4: Inserted-image select/resize overlay CSS removed — rich text
 * no longer contains inline <img> elements (handled by Image block). */

/* v2.6.15: Link tab padding four-wrap CSS (.pd-blk-rt-link-pad-*) and
 * Radius slider CSS (.pd-blk-rt-link-radius-*) REMOVED. The HTML that
 * rendered these controls was stripped from the Links tab along with
 * the entire "Add Background" workflow — padding and border-radius
 * are now owned exclusively by the Design panel. */

/* v2.6.35: Link Styles — state-aware inline controls (Base/Hover/Active/Focus).
 * Replaces the old hint that directed users to the Design panel.
 * Uses same visual language as the HR modal (bg #11111b, same text colors). */
.pd-blk-rt-link-styles {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 5px;
}
.pd-blk-rt-link-state-picker {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.pd-blk-rt-link-state-btn {
    flex: 1;
    padding: 5px 0;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    color: var(--at-color-card-foreground);
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.pd-blk-rt-link-state-btn:hover {
    color: var(--at-color-primary);
    border-color: #89b4fa;
}
.pd-blk-rt-link-state-btn.pd-blk-rt-link-state-btn-active {
    color: var(--at-color-card-foreground);
    background: #89b4fa;
    border-color: #89b4fa;
}
.pd-blk-rt-link-state-hint {
    font-size: 10px;
    color: var(--at-color-card-foreground);
    margin-bottom: 8px;
}
.pd-blk-rt-link-state-hint strong {
    color: var(--at-color-primary);
}
.pd-blk-rt-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.pd-blk-rt-link-label {
    flex: 0 0 70px;
    font-size: 11px;
    color: var(--at-color-card-foreground);
    white-space: nowrap;
}
.pd-blk-rt-link-color-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    padding: 2px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    cursor: pointer;
}
.pd-blk-rt-link-select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 8px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

/* Hide the "100%" alpha-val pill on the RT Link panel's Color +
 * Background rows only — the panel is narrow (≈243px), the thumb
 * position already conveys opacity, and the textual label was
 * pushing past the panel's right border. Other PDColorAlpha
 * consumers (Typography, Theme, etc.) keep their label. */
.pd-blk-rt-link-row .pd-ca-alpha-val { display: none; }

/* Decoration multi-select (Default / None / Underline / Overline /
 * Strikethrough). Dedicated .pd-blk-rt-link-decor-* namespace —
 * does NOT share with Theme's .pd-ts-decor-* or Button panel's
 * .pd-btn-pnl-decor-*. Custom-drawn checkboxes keep a #89b4fa
 * Catppuccin blue border in both states. 2-column grid. */
/* Stack label above grid so the grid gets the full row width.
 * Inline label + 1fr/1fr grid was clipping "Strikethrough" / "Overline"
 * past the panel's right border in narrow contexts. */
.pd-blk-rt-link-row-decor {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.pd-blk-rt-link-row-decor .pd-blk-rt-link-label { flex: 0 0 auto; }
.pd-blk-rt-link-decor-multi {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px 6px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 3px;
    padding: 6px 8px;
}
.pd-blk-rt-link-decor-chk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--at-color-card-foreground);
    font-size: 11px;
    user-select: none;
    padding: 1px 2px;
    border-radius: 3px;
}
.pd-blk-rt-link-decor-chk:hover { background: #313244; }
.pd-blk-rt-link-decor-chk-input {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    cursor: pointer;
    width: 13px;
    height: 13px;
    border: 1.5px solid #89b4fa;
    border-radius: 3px;
    background: transparent;
    position: relative;
    flex-shrink: 0;
}
.pd-blk-rt-link-decor-chk-input:checked { background: #89b4fa; }
.pd-blk-rt-link-decor-chk-input:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    width: 4px;
    height: 8px;
    border: solid var(--at-color-border);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.pd-blk-rt-link-decor-chk-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.3); }

/* v2.8.89: dedicated Link-tab Padding slider. Own namespace
 * (`pd-blk-rt-link-pad-*`) — no class sharing with any other slider.
 * Visual shape mirrors the Design panel's `.pd-dsp-slider` look the
 * user pointed to (native track with accent-color fill, blue thumb,
 * boxed value + unit suffix) but all classes are dedicated to this
 * tool so nothing else can inherit or drift these styles. */
.pd-blk-rt-link-pad-slider {
    flex: 1 1 auto;
    min-width: 0;
    height: 6px;
    cursor: pointer;
    accent-color: #89b4fa;
    background: var(--at-color-card);
    border-radius: 3px;
    -webkit-appearance: auto;
    appearance: auto;
}
.pd-blk-rt-link-pad-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--at-color-card-foreground);
    min-width: 28px;
    padding: 2px 6px;
    background: var(--at-color-card);
    border: 1px solid var(--at-color-border);
    border-radius: 4px;
    text-align: right;
}
.pd-blk-rt-link-pad-unit {
    font-size: 10px;
    color: var(--at-color-card-foreground);
    margin-left: 2px;
}

/* v2.8.91: "Connect All States" toggle in the Link tab's btn-strip.
 * Dedicated namespace `pd-blk-rt-link-sync-btn-*`; inherits the
 * common `.pd-blk-rt-btn` padding/hover from elsewhere in this file
 * but paints its own active state (Catppuccin blue) so users can see
 * at a glance whether states are linked. */
.pd-blk-rt-link-sync-btn-active {
    background: #89b4fa;
    color: var(--at-color-card-foreground);
    border-color: #89b4fa;
}
.pd-blk-rt-link-sync-btn-active:hover {
    background: var(--at-color-muted);
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-link-clear-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 5px 0;
    font-size: 10px;
    font-weight: 600;
    color: var(--at-color-destructive-foreground);
    background: var(--at-color-destructive);
    border: 1px solid var(--at-color-destructive);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s;
}
.pd-blk-rt-link-clear-btn:hover {
    background: var(--at-color-destructive);
    border-color: var(--at-color-destructive);
}

/* ──────────────────────────────────────────────────────────────────────
 * v2.6.15: Dedicated panel chrome — migrated off the shared pd-dsp-*
 * namespace. Previously the Rich Text panel reused the Design panel's
 * chrome classes (.pd-dsp-*, defined in editor.css:1074-1276). That
 * created an invisible coupling: any change to the Design panel's
 * chrome CSS would silently affect the Rich Text panel too.
 *
 * These rules were duplicated from editor.css:1074-1276 on 2026-04-09
 * and renamed to pd-blk-rt-pnl-* so the Rich Text panel can now evolve
 * its chrome independently of the Design panel.
 *
 * Intentional fork — do NOT try to keep these in sync with pd-dsp-*.
 * If the Rich Text panel's chrome ever needs to differ, change it here.
 * ────────────────────────────────────────────────────────────────────── */
.pd-blk-rt-pnl {
    position: fixed;
    top: 50px;
    right: -300px;
    width: 300px;
    height: calc(100vh - 50px);
    background: var(--at-color-card);
    border-left: 1px solid var(--at-color-border);
    z-index: 90;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
    overflow: hidden;
}
.pd-blk-rt-pnl-visible {
    right: 0;
}
.pd-blk-rt-pnl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--at-color-border);
    background: var(--at-color-card);
    flex-shrink: 0;
}
.pd-blk-rt-pnl-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-pnl-title .fa {
    color: var(--at-color-primary);
    margin-right: 6px;
}
.pd-blk-rt-pnl-close {
    background: none;
    border: none;
    color: var(--at-color-card-foreground);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
}
.pd-blk-rt-pnl-close:hover {
    color: var(--at-color-destructive-foreground);
    background: var(--at-color-destructive);
}
.pd-blk-rt-pnl-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.pd-blk-rt-pnl-body::-webkit-scrollbar { width: 5px; }
.pd-blk-rt-pnl-body::-webkit-scrollbar-track { background: #1e1e2e; }
.pd-blk-rt-pnl-body::-webkit-scrollbar-thumb { background: #45475a; border-radius: 3px; }

/* Component label — hidden locally (mirrors the global hide in
 * editor.css for pd-dsp-comp-label, but dedicated to this panel). */
.pd-blk-rt-pnl-comp-label,
.pd-blk-rt-pnl-comp-type {
    display: none !important;
}

/* Accordion sections */
.pd-blk-rt-pnl-section {
    border-bottom: 1px solid var(--at-color-border);
}
.pd-blk-rt-pnl-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--at-color-card-foreground);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.pd-blk-rt-pnl-section-header:hover {
    background: var(--at-color-card);
}
.pd-blk-rt-pnl-section-icon {
    color: var(--at-color-primary);
    width: 16px;
    text-align: center;
    font-size: 12px;
}
.pd-blk-rt-pnl-section-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--at-color-card-foreground);
    transition: transform 0.25s ease;
}
.pd-blk-rt-pnl-open > .pd-blk-rt-pnl-section-header .pd-blk-rt-pnl-section-arrow {
    transform: rotate(180deg);
}
.pd-blk-rt-pnl-section-body {
    padding: 4px 16px 16px;
}

/* ====================================================================
   Badge tool — v2.9.198
   --------------------------------------------------------------------
   Per-selection inline-span styling. Two CSS layers:
     A. Panel UI inside the Badge tab (hint, actions, pill row, etc.)
     B. The .pd-blk-rt-badge wrapper rendered in the editor + canvas +
        frontend (patterns / shapes / decoration overlays).
   Strict isolation: every selector below is namespaced
   .pd-blk-rt-badge[-*] and matches NOTHING else in this module.
   ==================================================================== */

/* A. Panel UI ------------------------------------------------------ */
.pd-blk-rt-badge-hint {
    margin: 4px 0 12px;
    padding: 8px 10px;
    background: rgba(137, 180, 250, 0.08);
    border: 1px solid rgba(137, 180, 250, 0.25);
    border-left: 3px solid #89b4fa;
    border-radius: 4px;
    color: var(--at-color-card-foreground);
    font-size: 11px;
    line-height: 1.5;
}
.pd-blk-rt-badge-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.pd-blk-rt-badge-remove {
    background: transparent;
    border: 1px solid var(--at-color-destructive);
    color: var(--at-color-destructive-ink);
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pd-blk-rt-badge-remove:hover {
    background: var(--at-color-destructive);
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-badge-remove .fa {
    margin-right: 4px;
}
.pd-blk-rt-badge-pattern-extra {
    margin: -4px 0 0;
    padding: 8px 0 0;
    border-top: 1px dashed rgba(137, 180, 250, 0.18);
}

/* B. Badge wrapper — rendered everywhere (editor / canvas / frontend) */
.pd-blk-rt-badge {
    display: inline-block;
    vertical-align: baseline;
    position: relative;
    line-height: 1.3;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* Patterns — keyed off data-rt-badge-pattern + the inline CSS variables
   --rtb-c1 (primary colour) / --rtb-c2 (secondary) / --rtb-dir (linear
   gradient angle, e.g. "to right" or "135deg"). The wrapper's inline
   background-color stays in place as a fallback if --rtb-c1 is missing. */
.pd-blk-rt-badge[data-rt-badge-pattern="linear"] {
    background-image: linear-gradient(
        var(--rtb-dir, to right),
        var(--rtb-c1, #89b4fa),
        var(--rtb-c2, #cba6f7)
    );
}
.pd-blk-rt-badge[data-rt-badge-pattern="radial"] {
    background-image: radial-gradient(
        circle at 30% 30%,
        var(--rtb-c1, #89b4fa),
        var(--rtb-c2, #1e1e2e)
    );
}
.pd-blk-rt-badge[data-rt-badge-pattern="stripes"] {
    background-image: repeating-linear-gradient(
        45deg,
        var(--rtb-c1, #89b4fa) 0 8px,
        var(--rtb-c2, #cba6f7) 8px 16px
    );
}
.pd-blk-rt-badge[data-rt-badge-pattern="dots"] {
    background-image: radial-gradient(
        var(--rtb-c2, #1e1e2e) 1.5px,
        transparent 1.5px
    );
    background-size: 8px 8px;
}
.pd-blk-rt-badge[data-rt-badge-pattern="checker"] {
    background-image:
        linear-gradient(45deg, var(--rtb-c2, #1e1e2e) 25%, transparent 25%),
        linear-gradient(-45deg, var(--rtb-c2, #1e1e2e) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--rtb-c2, #1e1e2e) 75%),
        linear-gradient(-45deg, transparent 75%, var(--rtb-c2, #1e1e2e) 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

/* Shapes — clip-path polygons. Note: clipping cuts the wrapper's
   visible bounds; padding still applies normally so the text stays
   centred. Decoration overlays (::before/::after) are also clipped. */
.pd-blk-rt-badge[data-rt-badge-shape="hexagon"] {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.pd-blk-rt-badge[data-rt-badge-shape="pentagon"] {
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
.pd-blk-rt-badge[data-rt-badge-shape="shield"] {
    clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 50% 100%, 0% 70%);
}
.pd-blk-rt-badge[data-rt-badge-shape="pennant-right"] {
    clip-path: polygon(0% 0%, 100% 0%, 90% 50%, 100% 100%, 0% 100%);
}
.pd-blk-rt-badge[data-rt-badge-shape="pennant-left"] {
    clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 10% 100%, 0% 50%);
}
.pd-blk-rt-badge[data-rt-badge-shape="ribbon"] {
    clip-path: polygon(0% 0%, 100% 0%, 95% 50%, 100% 100%, 0% 100%, 5% 50%);
}
.pd-blk-rt-badge[data-rt-badge-shape="diamond"] {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.pd-blk-rt-badge[data-rt-badge-shape="octagon"] {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}
.pd-blk-rt-badge[data-rt-badge-shape="parallelogram"] {
    clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%);
}
.pd-blk-rt-badge[data-rt-badge-shape="star"] {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Decoration overlays — pseudo-elements driven by data-rt-badge-deco.
   pointer-events:none keeps them from intercepting clicks; inherit
   border-radius matches the wrapper's curvature. */
.pd-blk-rt-badge[data-rt-badge-deco="top-band"]::before,
.pd-blk-rt-badge[data-rt-badge-deco="bottom-band"]::before,
.pd-blk-rt-badge[data-rt-badge-deco="inner-border"]::before,
.pd-blk-rt-badge[data-rt-badge-deco="sunburst"]::before,
.pd-blk-rt-badge[data-rt-badge-deco="corner-ribbon"]::before {
    content: '';
    position: absolute;
    pointer-events: none;
}
.pd-blk-rt-badge[data-rt-badge-deco="top-band"]::before {
    top: 0; left: 0; right: 0; height: 30%;
    background: rgba(255, 255, 255, 0.18); /* v3.7.17 — theme-agnostic overlay, no admin token */
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}
.pd-blk-rt-badge[data-rt-badge-deco="bottom-band"]::before {
    bottom: 0; left: 0; right: 0; height: 30%;
    background: rgba(255, 255, 255, 0.18); /* v3.7.17 — theme-agnostic overlay, no admin token */
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}
.pd-blk-rt-badge[data-rt-badge-deco="inner-border"]::before {
    inset: 3px;
    border: 1px solid currentColor;
    border-radius: inherit;
    opacity: 0.55;
}
.pd-blk-rt-badge[data-rt-badge-deco="sunburst"]::before {
    inset: 0;
    background-image: repeating-conic-gradient(
        from 0deg,
        rgba(255, 255, 255, 0.14) 0deg 12deg,
        transparent 12deg 24deg
    );
    border-radius: inherit;
}
.pd-blk-rt-badge[data-rt-badge-deco="corner-ribbon"]::before {
    top: 0; right: 0;
    width: 0; height: 0;
    border-top: 14px solid currentColor; /* v3.7.17 — follows text colour, no admin token */
    border-left: 14px solid transparent;
}
.pd-blk-rt-badge[data-rt-badge-deco="stars"]::after {
    content: '\2605 \2605 \2605';
    display: block;
    text-align: center;
    font-size: 0.6em;
    line-height: 1;
    margin-top: 3px;
    letter-spacing: 2px;
    opacity: 0.85;
}

/* ─── In-app spell-check (replaces Chrome's native squiggle) ───────
   Engine: nspell + en + en-GB. Wraps misspelled words in
   `<span class="pd-blk-rt-spell-err">` via pd_blk_rt_spell.js. Themed
   off the active admin-theme tokens via the same pattern every other
   PD popup follows (see .pd-img-pick-modal in pd_image_picker.css).
   No hex fallbacks — the popup root is registered in
   _editor_root_tokens.php so tokens always resolve. */
.pd-blk-rt-spell-err {
    text-decoration: underline wavy var(--at-color-destructive);
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
    -webkit-text-decoration: underline wavy var(--at-color-destructive);
}
.pd-blk-rt-spell-pop {
    position: fixed;
    z-index: 2147483647;
    min-width: 180px;
    max-width: 260px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    border: 1px solid var(--at-color-border);
    border-radius: 6px;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--at-color-foreground) 35%, transparent);
    padding: 6px 0;
    font: 13px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.pd-blk-rt-spell-pop-head {
    padding: 4px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--at-color-card-foreground);
    opacity: 0.65;
}
.pd-blk-rt-spell-pop-item,
.pd-blk-rt-spell-pop-action {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 12px;
    background: transparent;
    border: 0;
    color: var(--at-color-card-foreground);
    font: inherit;
    cursor: pointer;
}
.pd-blk-rt-spell-pop-item:hover,
.pd-blk-rt-spell-pop-action:hover {
    background: var(--at-color-secondary);
    color: var(--at-color-card-foreground);
}
.pd-blk-rt-spell-pop-item:focus-visible,
.pd-blk-rt-spell-pop-action:focus-visible {
    outline: 2px solid var(--at-color-primary);
    outline-offset: -2px;
}
.pd-blk-rt-spell-pop-empty {
    padding: 8px 12px;
    font-style: italic;
    color: var(--at-color-card-foreground);
    opacity: 0.65;
}
.pd-blk-rt-spell-pop-sep {
    margin: 4px 0;
    border-top: 1px solid var(--at-color-border);
}
.pd-blk-rt-spell-pop-action .fa {
    width: 14px;
    margin-right: 6px;
    color: var(--at-color-primary);
}

/* ─── Canvas-selection mirror overlay ──────────────────────────────
   Visual highlight rects painted over the panel preview when the
   canvas is in inline-RTE mode. We can't use the Selection API for
   this direction — addRange on a contenteditable steals focus from
   the iframe and breaks GrapesJS' on-canvas RTE. Instead we render
   translucent rects via Range.getClientRects() at viewport coords.
   pointer-events:none so the overlay never intercepts clicks. */
.pd-blk-rt-cnv-sel-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9100;
}
.pd-blk-rt-cnv-sel-hl {
    position: fixed;
    background: var(--at-color-primary);
    opacity: 0.30;
    border-radius: 1px;
    pointer-events: none;
}
