.pp-module-guide {
    --guide-bg: var(--pp-surface, #ffffff);
    --guide-bg-soft: var(--pp-surface-soft, #f7f9fc);
    --guide-bg-muted: var(--pp-surface-muted, #eef3f8);
    --guide-text: var(--pp-text, #172033);
    --guide-muted: var(--pp-text-muted, #64748b);
    --guide-border: var(--pp-border, #d8e1ec);
    --guide-accent: var(--pp-accent, #2563eb);
    --guide-accent-soft: var(--pp-accent-soft, #eaf2ff);
    --guide-success: var(--pp-success, #059669);
    color: var(--guide-text);
}

.pp-guide-trigger {
    align-items: center;
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--pp-accent-soft, #eaf2ff) 72%, var(--pp-surface, #fff)),
            var(--pp-surface, #fff)
        );
    border: 1px solid color-mix(in srgb, var(--pp-accent, #2563eb) 34%, var(--pp-border, #cbd5e1));
    border-radius: 999px;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--pp-accent, #2563eb) 10%, transparent);
    color: var(--pp-text, #172033);
    display: inline-flex;
    font-size: .78rem;
    font-weight: 750;
    gap: .34rem;
    line-height: 1;
    min-height: 1.9rem;
    overflow: hidden;
    padding: .22rem .58rem .22rem .28rem;
    position: relative;
    transition:
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        color .18s ease,
        transform .18s ease;
    white-space: nowrap;
}

.pp-guide-trigger i {
    align-items: center;
    background: var(--pp-accent, #2563eb);
    border-radius: 50%;
    color: var(--pp-on-accent, #fff);
    display: inline-flex;
    flex: 0 0 1.35rem;
    font-size: .76rem;
    height: 1.35rem;
    justify-content: center;
    position: relative;
    width: 1.35rem;
}

.pp-guide-trigger i::after {
    animation: pp-guide-beacon 3.2s ease-out infinite;
    border: 1px solid currentColor;
    border-radius: inherit;
    content: "";
    inset: -.18rem;
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.pp-guide-trigger:hover,
.pp-guide-trigger:focus-visible {
    background: var(--pp-accent-soft, #eaf2ff);
    border-color: var(--pp-accent, #2563eb);
    box-shadow: 0 5px 14px color-mix(in srgb, var(--pp-accent, #2563eb) 18%, transparent);
    color: var(--pp-accent, #2563eb);
    transform: translateY(-1px);
}

.pp-guide-trigger:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--pp-accent, #2563eb) 22%, transparent);
    outline-offset: 2px;
}

.pp-guide-trigger:active {
    box-shadow: 0 2px 7px color-mix(in srgb, var(--pp-accent, #2563eb) 12%, transparent);
    transform: translateY(0);
}

@keyframes pp-guide-beacon {
    0%,
    68% {
        opacity: 0;
        transform: scale(.78);
    }

    76% {
        opacity: .55;
    }

    94%,
    100% {
        opacity: 0;
        transform: scale(1.32);
    }
}

@media (max-width: 479.98px) {
    .pp-guide-trigger {
        gap: 0;
        padding: .26rem;
    }

    .pp-guide-trigger > span {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pp-guide-trigger,
    .pp-guide-trigger i::after {
        animation: none;
        transition: none;
    }
}

.pp-module-guide .modal-dialog {
    max-width: min(1160px, calc(100vw - 2rem));
}

.pp-module-guide .modal-content {
    background: var(--guide-bg);
    border: 1px solid var(--guide-border);
    border-radius: 1.1rem;
    box-shadow: var(--pp-shadow-xl, 0 24px 70px rgba(15, 23, 42, .28));
    color: var(--guide-text);
    /* Fixed-height flex column so the topic content owns the scroll and the
       footer stays pinned to the bottom regardless of the active topic. */
    display: flex;
    flex-direction: column;
    height: min(780px, calc(100vh - 3rem));
    max-height: calc(100vh - 3rem);
    overflow: hidden;
}

/* Header, search bar and footer are fixed bands; only the layout flexes. */
.pp-module-guide .modal-header,
.pp-module-guide .pp-guide-searchbar,
.pp-module-guide .pp-guide-footer {
    flex: 0 0 auto;
}

.pp-module-guide .modal-header {
    align-items: flex-start;
    background:
        radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--guide-accent) 22%, transparent), transparent 42%),
        linear-gradient(135deg, var(--guide-bg-soft), var(--guide-bg));
    border-bottom: 1px solid var(--guide-border);
    color: var(--guide-text);
    gap: 1rem;
    padding: 1.2rem 1.35rem;
}

.pp-guide-heading {
    align-items: center;
    display: flex;
    gap: .85rem;
    min-width: 0;
}

.pp-guide-heading-icon {
    align-items: center;
    background: var(--guide-accent-soft);
    border: 1px solid color-mix(in srgb, var(--guide-accent) 30%, var(--guide-border));
    border-radius: .85rem;
    color: var(--guide-accent);
    display: inline-flex;
    flex: 0 0 3rem;
    font-size: 1.25rem;
    height: 3rem;
    justify-content: center;
}

.pp-guide-kicker {
    color: var(--guide-accent);
    display: block;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.pp-module-guide .modal-title {
    color: var(--guide-text);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.pp-guide-subtitle {
    color: var(--guide-muted);
    font-size: .84rem;
    margin: .2rem 0 0;
}

.pp-guide-close {
    align-items: center;
    align-self: flex-start;
    appearance: none;
    background: var(--guide-bg-muted);
    border: 1px solid var(--guide-border);
    border-radius: .72rem;
    color: var(--guide-muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 2.6rem;
    font-size: 1.05rem;
    height: 2.6rem;
    justify-content: center;
    line-height: 1;
    margin: 0 0 0 auto;
    padding: 0;
    position: relative;
    transition:
        background-color .16s ease,
        border-color .16s ease,
        color .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
    width: 2.6rem;
}

.pp-guide-close:hover {
    background: var(--guide-accent-soft);
    border-color: color-mix(in srgb, var(--guide-accent) 55%, var(--guide-border));
    color: var(--guide-accent);
    transform: translateY(-1px);
}

.pp-guide-close:focus-visible {
    border-color: var(--guide-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-accent) 20%, transparent);
    color: var(--guide-accent);
    outline: 0;
}

.pp-guide-close:active {
    transform: translateY(0);
}

.pp-guide-close i {
    display: block;
    line-height: 1;
    pointer-events: none;
}

.pp-guide-searchbar {
    align-items: center;
    background: var(--guide-bg);
    border-bottom: 1px solid var(--guide-border);
    display: flex;
    gap: .75rem;
    padding: .85rem 1.35rem;
}

.pp-guide-searchbox {
    align-items: center;
    background: var(--guide-bg-soft);
    border: 1px solid var(--guide-border);
    border-radius: .7rem;
    display: flex;
    flex: 1;
    min-width: 0;
    padding: 0 .75rem;
}

.pp-guide-searchbox:focus-within {
    border-color: var(--guide-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-accent) 15%, transparent);
}

.pp-guide-searchbox i {
    color: var(--guide-muted);
}

.pp-guide-searchbox input {
    background: transparent;
    border: 0;
    color: var(--guide-text);
    flex: 1;
    min-height: 2.45rem;
    min-width: 0;
    outline: 0;
    padding: .45rem .6rem;
}

.pp-guide-searchbox input::placeholder {
    color: var(--guide-muted);
}

.pp-guide-shortcut {
    background: var(--guide-bg-muted);
    border: 1px solid var(--guide-border);
    border-radius: .4rem;
    color: var(--guide-muted);
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .4rem;
}

.pp-guide-layout {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.pp-guide-nav {
    background: var(--guide-bg-soft);
    border-right: 1px solid var(--guide-border);
    padding: .9rem;
}

.pp-guide-nav-label {
    color: var(--guide-muted);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .09em;
    margin: .2rem .45rem .55rem;
    text-transform: uppercase;
}

.pp-guide-topic {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: .65rem;
    color: var(--guide-muted);
    display: flex;
    font-size: .83rem;
    font-weight: 700;
    gap: .6rem;
    margin-bottom: .25rem;
    padding: .6rem .7rem;
    text-align: left;
    width: 100%;
}

.pp-guide-topic i {
    color: var(--guide-accent);
    font-size: 1rem;
    width: 1.15rem;
}

.pp-guide-topic:hover {
    background: var(--guide-bg-muted);
    color: var(--guide-text);
}

.pp-guide-topic.active {
    background: var(--guide-accent-soft);
    border-color: color-mix(in srgb, var(--guide-accent) 35%, var(--guide-border));
    color: var(--guide-accent);
}

.pp-guide-topic[hidden] {
    display: none;
}

.pp-guide-content {
    background: var(--guide-bg);
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 1.25rem 1.4rem 1.7rem;
}

.pp-guide-panel {
    display: none;
    margin: 0 auto;
    max-width: 820px;
}

.pp-guide-panel.active {
    display: block;
}

.pp-guide-panel h3 {
    color: var(--guide-text);
    font-size: 1.18rem;
    font-weight: 800;
    margin: 0 0 .35rem;
}

.pp-guide-panel > p {
    color: var(--guide-muted);
    font-size: .9rem;
}

.pp-guide-hero {
    border-bottom: 1px solid var(--guide-border);
    margin-bottom: 1rem;
    padding-bottom: .9rem;
}

.pp-guide-hero p,
.pp-guide-panel > h4,
.pp-guide-panel > p,
.pp-guide-list {
    color: var(--guide-muted);
    font-size: .86rem;
    line-height: 1.6;
}

.pp-guide-panel > h4 {
    color: var(--guide-text);
    font-size: .92rem;
    font-weight: 800;
    margin: 1.15rem 0 .45rem;
}

.pp-guide-levels {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .65rem 0 1rem;
}

.pp-guide-level {
    background: var(--guide-bg-muted);
    border: 1px solid var(--guide-border);
    border-radius: 999px;
    color: var(--guide-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    padding: .28rem .55rem;
    text-transform: uppercase;
}

.pp-guide-level.basic { color: var(--guide-success); }
.pp-guide-level.advanced { color: var(--guide-accent); }

.pp-guide-step {
    align-items: center;
    background: var(--guide-accent-soft);
    border: 1px solid color-mix(in srgb, var(--guide-accent) 30%, var(--guide-border));
    border-radius: 999px;
    color: var(--guide-accent);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 900;
    height: 1.65rem;
    justify-content: center;
    margin-bottom: .55rem;
    width: 1.65rem;
}

.pp-guide-callout,
.pp-guide-card {
    background: var(--guide-bg-soft);
    border: 1px solid var(--guide-border);
    border-radius: .8rem;
    margin-top: .85rem;
    padding: .9rem 1rem;
}

.pp-guide-callout {
    align-items: flex-start;
    border-left: 4px solid var(--guide-accent);
    display: flex;
    gap: .65rem;
}

.pp-guide-callout > i { color: var(--guide-accent); font-size: 1rem; margin-top: .12rem; }
.pp-guide-callout.warning { border-left-color: var(--pp-warning, #d97706); }
.pp-guide-callout.warning > i { color: var(--pp-warning, #d97706); }

.pp-guide-callout strong,
.pp-guide-card h4 {
    color: var(--guide-text);
    font-size: .88rem;
    font-weight: 800;
}

.pp-guide-card h4 {
    align-items: center;
    display: flex;
    gap: .45rem;
    margin: 0 0 .55rem;
}

.pp-guide-card h4 i {
    color: var(--guide-accent);
}

.pp-guide-card p,
.pp-guide-card li,
.pp-guide-callout {
    color: var(--guide-muted);
    font-size: .84rem;
    line-height: 1.55;
}

.pp-guide-card ul,
.pp-guide-card ol {
    margin: .35rem 0 0;
    padding-left: 1.15rem;
}

.pp-guide-card li + li {
    margin-top: .3rem;
}

.pp-guide-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pp-guide-grid .pp-guide-card {
    margin-top: 0;
}

.pp-guide-table-wrap {
    border: 1px solid var(--guide-border);
    border-radius: .8rem;
    margin-top: .85rem;
    overflow: auto;
}

.pp-guide-table {
    border-collapse: collapse;
    color: var(--guide-text);
    font-size: .8rem;
    width: 100%;
}

.pp-guide-table th {
    background: var(--guide-bg-muted);
    color: var(--guide-text);
    font-weight: 800;
    text-align: left;
}

.pp-guide-table th,
.pp-guide-table td {
    border-bottom: 1px solid var(--guide-border);
    padding: .62rem .72rem;
    vertical-align: top;
}

.pp-guide-table tbody tr:last-child td { border-bottom: 0; }
.pp-guide-table td { color: var(--guide-muted); }
.pp-guide-table td:first-child { color: var(--guide-text); font-weight: 700; }

.pp-guide-list {
    margin: .45rem 0 .8rem;
    padding-left: 1.2rem;
}

.pp-guide-list li + li { margin-top: .35rem; }
.pp-guide-list.numbered { padding-left: 1.35rem; }

.pp-guide-checklist {
    display: grid;
    gap: .5rem;
    margin-top: .85rem;
}

.pp-guide-checklist label {
    align-items: flex-start;
    background: var(--guide-bg-soft);
    border: 1px solid var(--guide-border);
    border-radius: .65rem;
    color: var(--guide-muted);
    display: flex;
    font-size: .83rem;
    gap: .55rem;
    line-height: 1.45;
    padding: .62rem .72rem;
}

.pp-guide-checklist input {
    accent-color: var(--guide-accent);
    margin-top: .18rem;
}

.pp-guide-do-dont {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: .85rem;
}

.pp-guide-do-dont > div {
    background: var(--guide-bg-soft);
    border: 1px solid var(--guide-border);
    border-radius: .75rem;
    padding: .8rem .9rem;
}

.pp-guide-do-dont .do { border-top: 3px solid var(--guide-success); }
.pp-guide-do-dont .dont { border-top: 3px solid var(--pp-danger, #dc2626); }

.pp-guide-code {
    background: var(--pp-code-bg, #101827);
    border: 1px solid var(--guide-border);
    border-radius: .65rem;
    color: var(--pp-code-text, #dbeafe);
    display: block;
    font-family: var(--bs-font-monospace, monospace);
    font-size: .78rem;
    margin-top: .55rem;
    overflow: auto;
    padding: .7rem .8rem;
    white-space: pre-wrap;
}

.pp-guide-empty {
    color: var(--guide-muted);
    display: none;
    padding: 2rem 1rem;
    text-align: center;
}

.pp-guide-empty.show {
    display: block;
}

.pp-guide-footer {
    align-items: center;
    background: var(--guide-bg-soft);
    border-top: 1px solid var(--guide-border);
    color: var(--guide-muted);
    display: flex;
    font-size: .75rem;
    justify-content: space-between;
    padding: .65rem 1.35rem;
}

@media (max-width: 767.98px) {
    .pp-module-guide .modal-dialog {
        margin: .5rem;
        max-width: calc(100vw - 1rem);
    }

    .pp-module-guide .modal-content {
        height: calc(100vh - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .pp-guide-layout {
        display: block;
        overflow-y: auto;
    }

    .pp-guide-content {
        overflow: visible;
    }

    .pp-guide-nav {
        border-bottom: 1px solid var(--guide-border);
        border-right: 0;
        display: flex;
        gap: .35rem;
        overflow-x: auto;
        padding: .65rem;
    }

    .pp-guide-nav-label {
        display: none;
    }

    .pp-guide-topic {
        flex: 0 0 auto;
        margin: 0;
        width: auto;
    }

    .pp-guide-content {
        padding: 1rem;
    }

    .pp-guide-grid,
    .pp-guide-do-dont {
        grid-template-columns: 1fr;
    }

    .pp-guide-shortcut,
    .pp-guide-footer span:last-child {
        display: none;
    }
}

/* Legacy module Guides
   Tables, Events, Custom Files, Output, Finished and Deploy predate the
   Bootstrap guide shell. This adapter gives them the same token-driven
   presentation without changing their markup, state, or event handlers. */
button.pp-guide-trigger.pp-guide-trigger {
    align-items: center !important;
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--pp-accent-soft, #eaf2ff) 72%, var(--pp-surface, #fff)),
            var(--pp-surface, #fff)
        ) !important;
    border: 1px solid color-mix(in srgb, var(--pp-accent, #2563eb) 34%, var(--pp-border, #cbd5e1)) !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--pp-accent, #2563eb) 10%, transparent) !important;
    color: var(--pp-text, #172033) !important;
    display: inline-flex !important;
    font-size: .78rem !important;
    font-weight: 750 !important;
    gap: .34rem !important;
    line-height: 1 !important;
    min-height: 1.9rem !important;
    padding: .22rem .58rem .22rem .28rem !important;
    white-space: nowrap !important;
}

button.pp-guide-trigger.pp-guide-trigger:hover,
button.pp-guide-trigger.pp-guide-trigger:focus-visible {
    background: var(--pp-accent-soft, #eaf2ff) !important;
    border-color: var(--pp-accent, #2563eb) !important;
    color: var(--pp-accent, #2563eb) !important;
}

button.pp-guide-trigger.pp-guide-trigger > i {
    background: var(--pp-accent, #2563eb) !important;
    color: var(--pp-on-accent, #fff) !important;
    margin: 0 !important;
}

.pp-legacy-guide {
    --guide-bg: var(--pp-surface, #ffffff);
    --guide-bg-soft: var(--pp-surface-soft, #f7f9fc);
    --guide-bg-muted: var(--pp-surface-muted, #eef3f8);
    --guide-text: var(--pp-text, #172033);
    --guide-muted: var(--pp-text-muted, #64748b);
    --guide-border: var(--pp-border, #d8e1ec);
    --guide-accent: var(--pp-accent, #2563eb);
    --guide-accent-soft: var(--pp-accent-soft, #eaf2ff);
    --guide-success: var(--pp-success, #059669);
    background: var(--guide-bg) !important;
    border: 1px solid var(--guide-border) !important;
    box-shadow: var(--pp-shadow-xl, 0 28px 80px rgba(15, 23, 42, .28)) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-head, .evh-head, .cfh-head, .obh-head, .finh-head, .deph-head
) {
    background:
        radial-gradient(
            circle at 90% 0%,
            color-mix(in srgb, var(--guide-accent) 20%, transparent),
            transparent 42%
        ),
        linear-gradient(135deg, var(--guide-bg-soft), var(--guide-bg)) !important;
    border-bottom: 1px solid var(--guide-border) !important;
    color: var(--guide-text) !important;
    min-height: 5.15rem;
    padding: 1rem 1.25rem !important;
}

.pp-legacy-guide :is(
    .tgh-badge, .evh-badge, .cfh-badge, .obh-badge, .finh-badge, .deph-badge
) {
    background: var(--guide-accent-soft) !important;
    border: 1px solid color-mix(in srgb, var(--guide-accent) 30%, var(--guide-border)) !important;
    color: var(--guide-accent) !important;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--guide-accent) 12%, transparent);
}

.pp-legacy-guide :is(
    .tgh-head, .evh-head, .cfh-head, .obh-head, .finh-head, .deph-head
) h2 {
    color: var(--guide-text) !important;
    font-size: clamp(1.08rem, 2vw, 1.35rem) !important;
    letter-spacing: -.025em;
    line-height: 1.18 !important;
    margin: 0 0 .2rem !important;
}

.pp-legacy-guide :is(
    .tgh-head, .evh-head, .cfh-head, .obh-head, .finh-head, .deph-head
) p {
    color: var(--guide-muted) !important;
    line-height: 1.35;
    margin: 0 !important;
}

.pp-legacy-guide :is(
    .tgh-close, .evh-close, .cfh-close, .obh-close, .finh-close, .deph-close
) {
    align-items: center !important;
    align-self: flex-start;
    background: var(--guide-bg) !important;
    border: 1px solid var(--guide-border) !important;
    border-radius: .7rem !important;
    color: var(--guide-muted) !important;
    display: inline-flex !important;
    flex: 0 0 2.25rem;
    height: 2.25rem !important;
    justify-content: center !important;
    margin-left: auto !important;
    padding: 0 !important;
    transition: border-color .16s ease, color .16s ease, transform .16s ease !important;
    width: 2.25rem !important;
}

.pp-legacy-guide :is(
    .tgh-close, .evh-close, .cfh-close, .obh-close, .finh-close, .deph-close
) i {
    font-size: .92rem;
    line-height: 1;
}

.pp-legacy-guide :is(
    .tgh-close, .evh-close, .cfh-close, .obh-close, .finh-close, .deph-close
):is(:hover, :focus-visible) {
    border-color: var(--guide-accent) !important;
    color: var(--guide-accent) !important;
    outline: 3px solid color-mix(in srgb, var(--guide-accent) 18%, transparent);
    outline-offset: 1px;
    transform: rotate(3deg);
}

.pp-legacy-guide :is(
    .tgh-body, .evh-body, .cfh-body, .obh-body, .finh-body, .deph-body
) {
    background: var(--guide-bg) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-toc, .evh-toc, .cfh-toc, .obh-toc, .finh-toc, .deph-toc
) {
    background: var(--guide-bg-soft) !important;
    border-color: var(--guide-border) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-toc-group, .evh-toc-group, .cfh-toc-group, .obh-toc-group, .finh-toc-group, .deph-toc-group
) {
    color: var(--guide-muted) !important;
}

.pp-legacy-guide :is(
    .tgh-toc, .evh-toc, .cfh-toc, .obh-toc, .finh-toc, .deph-toc
) a {
    border-color: transparent !important;
    color: var(--guide-muted) !important;
}

.pp-legacy-guide :is(
    .tgh-toc, .evh-toc, .cfh-toc, .obh-toc, .finh-toc, .deph-toc
) a i {
    color: var(--guide-accent) !important;
}

.pp-legacy-guide :is(
    .tgh-toc, .evh-toc, .cfh-toc, .obh-toc, .finh-toc, .deph-toc
) a:is(:hover, .active) {
    background: var(--guide-accent-soft) !important;
    border-color: color-mix(in srgb, var(--guide-accent) 22%, var(--guide-border)) !important;
    color: var(--guide-accent) !important;
}

.pp-legacy-guide :is(
    .tgh-content, .evh-content, .cfh-content, .obh-content, .finh-content, .deph-content
) {
    background: var(--guide-bg) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-content, .evh-content, .cfh-content, .obh-content, .finh-content, .deph-content
) :is(h3, h4, h5, strong, b) {
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-content, .evh-content, .cfh-content, .obh-content, .finh-content, .deph-content
) :is(p, li, td) {
    color: var(--guide-muted) !important;
}

.pp-legacy-guide :is(
    .tgh-content, .evh-content, .cfh-content, .obh-content, .finh-content, .deph-content
) :is(code, .num) {
    background: var(--guide-accent-soft) !important;
    color: var(--guide-accent) !important;
}

.pp-legacy-guide :is(
    .tgh-card, .evh-card
) {
    background: var(--guide-bg-soft) !important;
    border-color: var(--guide-border) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(.tgh-card, .evh-card) .ic {
    background: var(--guide-accent-soft) !important;
    color: var(--guide-accent) !important;
}

.pp-legacy-guide :is(
    .tgh-table, .evh-table, .cfh-table, .obh-table, .finh-table, .deph-table
) {
    border-color: var(--guide-border) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-table, .evh-table, .cfh-table, .obh-table, .finh-table, .deph-table
) :is(th, td) {
    background: var(--guide-bg) !important;
    border-color: var(--guide-border) !important;
}

.pp-legacy-guide :is(
    .tgh-table, .evh-table, .cfh-table, .obh-table, .finh-table, .deph-table
) th {
    background: var(--guide-bg-soft) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-callout, .evh-callout, .cfh-callout, .obh-callout, .finh-callout, .deph-callout
) {
    background: color-mix(in srgb, var(--guide-accent-soft) 76%, var(--guide-bg)) !important;
    border-color: color-mix(in srgb, var(--guide-accent) 28%, var(--guide-border)) !important;
    color: var(--guide-text) !important;
}

.pp-legacy-guide :is(
    .tgh-callout, .evh-callout, .cfh-callout, .obh-callout, .finh-callout, .deph-callout
) > i {
    color: var(--guide-accent) !important;
}

.pp-legacy-guide :is(
    .tgh-foot, .evh-foot, .cfh-foot, .obh-foot, .finh-foot, .deph-foot
) {
    background: var(--guide-bg-soft) !important;
    border-color: var(--guide-border) !important;
    color: var(--guide-muted) !important;
}

@media (max-width: 767.98px) {
    .pp-legacy-guide :is(
        .tgh-head, .evh-head, .cfh-head, .obh-head, .finh-head, .deph-head
    ) {
        gap: .7rem !important;
        padding: .85rem !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Diagrams (reusable across module guides). Everything is token-driven so it
   flips cleanly between light and dark; SVGs use currentColor + the guide
   accent so no colour is ever hard-locked to one theme.
   ───────────────────────────────────────────────────────────────────────── */
.pp-guide-diagram {
    margin: 1rem 0 1.15rem;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid var(--guide-border);
    border-radius: 14px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--guide-accent-soft) 34%, var(--guide-bg)), var(--guide-bg));
    overflow-x: auto;
}
.pp-guide-diagram > figcaption {
    margin-top: .75rem;
    font-size: .8rem;
    color: var(--guide-muted);
    text-align: center;
    line-height: 1.45;
}
.pp-guide-diagram svg { display: block; width: 100%; height: auto; max-width: 100%; color: var(--guide-accent); }

/* Horizontal flow of steps → wraps on small screens */
.pp-guide-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .5rem;
    justify-content: center;
}
.pp-guide-flow-node {
    flex: 1 1 130px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: .28rem;
    padding: .7rem .75rem;
    border: 1px solid color-mix(in srgb, var(--guide-accent) 30%, var(--guide-border));
    border-radius: 11px;
    background: var(--guide-bg);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--guide-accent) 8%, transparent);
}
.pp-guide-flow-node .pp-fn-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem; height: 1.9rem;
    border-radius: 9px;
    background: var(--guide-accent-soft);
    color: var(--guide-accent);
    font-size: 1rem;
}
.pp-guide-flow-node .pp-fn-title { font-weight: 700; font-size: .82rem; color: var(--guide-text); }
.pp-guide-flow-node .pp-fn-sub { font-size: .74rem; color: var(--guide-muted); line-height: 1.35; }
.pp-guide-flow-arrow {
    display: flex;
    align-items: center;
    color: var(--guide-accent);
    font-size: 1.1rem;
    opacity: .7;
}
@media (max-width: 640px) {
    .pp-guide-flow-arrow { transform: rotate(90deg); }
    .pp-guide-flow { flex-direction: column; align-items: stretch; }
    .pp-guide-flow-arrow { justify-content: center; }
}

/* Two-column mapping: a source thing → the SQL it produces */
.pp-guide-map { display: flex; flex-direction: column; gap: .4rem; margin: .25rem 0; }
.pp-guide-map-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1.2fr);
    align-items: center;
    gap: .55rem;
}
.pp-guide-map-src, .pp-guide-map-dst {
    padding: .42rem .6rem;
    border-radius: 9px;
    font-size: .8rem;
    border: 1px solid var(--guide-border);
    background: var(--guide-bg);
    color: var(--guide-text);
}
.pp-guide-map-src { font-weight: 600; }
.pp-guide-map-dst { font-family: var(--bs-font-monospace, ui-monospace, monospace); background: var(--guide-bg-soft); color: var(--guide-accent); }
.pp-guide-map-arrow { color: var(--guide-accent); opacity: .75; font-size: .95rem; }
.pp-guide-map-row .pp-guide-map-clause {
    font-family: var(--bs-font-monospace, ui-monospace, monospace);
    font-size: .72rem; font-weight: 700; letter-spacing: .03em;
    color: var(--guide-muted);
}
@media (max-width: 520px) {
    .pp-guide-map-row { grid-template-columns: 1fr; }
    .pp-guide-map-arrow { transform: rotate(90deg); justify-self: start; }
}
