/* =========================================================================
   PB7: playbook dialog on record pages, copied from the 27 Nov design
   (assetsUI/playbooks-modal-assets-27-nov-2026/assets/css/components/record-playbook.css).
   Changes from the design file:
   - .pbw z-index 1100 (design 1310): above the docked composer (.acx 1040), under the app's
     popovers (AnchoredPopover 1200), so the editors' More / Link / Snippet menus open on top.
   - The sidebar card rules target the app's .rp-playbook rows (design: .rt-pb[data-rt-pb]).
   - A few app-only states at the end (loading / error, media blocks).
   ========================================================================= */
.pbw {
    --pbw-ink: #33475b;
    --pbw-blue: var(--brand, #2456e6);
    --pbw-line: #cbd6e2;
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1100;
    width: min(1240px, calc(100vw - 48px));
    height: min(860px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 24px 56px rgba(16, 24, 40, .24), 0 4px 12px rgba(16, 24, 40, .1);
    overflow: hidden;
    opacity: 0;
    transition: opacity .16s ease;
    color: var(--pbw-ink);
    font-size: 14px;
}
.pbw.is-open { opacity: 1; }
.pbw.pw-dragging { transition: none; }

/* ---- header ---- */
.pbw__head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 4px 12px 4px 10px;
    background: #666;
    color: #fff;
    flex: none;
}
.pbw__title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 0 6px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
}
.pbw__title, .pbw__title strong, .pbw__title span { color: #fff; }
.pbw__title strong { font-weight: 700; flex: none; }
.pbw__title span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.pbw__hbtn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.pbw__hbtn svg { width: 18px; height: 18px; }
.pbw__hbtn:hover { background: rgba(255, 255, 255, .16); }
.pbw__hbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.pbw__collapse svg { transition: transform .15s ease; }

/* minimized: collapse to the header bar, in place (still draggable) */
.pbw.is-min {
    height: auto !important;
    max-height: none !important;
}
.pbw.is-min .pbw__body, .pbw.is-min .pbw__foot, .pbw.is-min .pbw__grip { display: none; }
.pbw.is-min .pbw__collapse svg { transform: rotate(-90deg); }
.pbw.is-min .pbw__head { border-radius: var(--radius-lg, 12px); }

/* ---- body ---- */
.pbw__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 32%) 1fr; }
.pbw__nav {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 0 0 24px;
    background: #f5f8fa;
    border-right: 2px solid var(--pbw-ink);
}
.pbw__nav h3 {
    flex: none;
    margin: 0 28px 0 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--pbw-line);
    font-size: 20px;
    font-weight: 500;
    color: var(--pbw-ink);
}
.pbw__navlist { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 16px 16px 20px 0; }
.pbw__navlist li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 6px;
    margin: 0 -6px;
    border-radius: 4px;
    color: var(--pbw-blue);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.pbw__navlist li a:hover .pbw-nav__t { text-decoration: underline; }
.pbw__navlist li a:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(36, 86, 230, .22)); }
.pbw__navlist li a.is-current { background: var(--brand-soft, #edf2ff); }
.pbw-nav__sec a { margin-top: 8px !important; }
.pbw-nav__sec:first-child a { margin-top: 0 !important; }
.pbw-nav__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbw-nav__s { display: inline-flex; flex: none; }
.pbw-ic { width: 18px; height: 18px; }
.pbw-ic--warn { color: #d93a3a; }
.pbw-ic--q { width: 22px; height: 22px; color: var(--pbw-ink); }

/* tooltip */
.pbw-tip {
    position: fixed;
    z-index: 5;
    max-width: 320px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #1f1f1f;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
.pbw-tip::after {
    content: '';
    position: absolute;
    left: var(--arrow-x, 50%);
    top: 100%;
    margin-left: -8px;
    border: 8px solid transparent;
    border-top-color: #1f1f1f;
}
.pbw-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #1f1f1f; }

.pbw__content { min-height: 0; overflow-y: auto; padding: 20px 32px 48px; scroll-padding-top: 16px; }
.pbw-intro { margin: 0 0 8px; font-size: 14.5px; line-height: 1.65; }
.pbw-sec { margin: 26px 0 8px; font-size: 26px; font-weight: 400; line-height: 1.2; color: var(--pbw-ink); }

/* ---- question ---- */
.pbw-q { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 20px 0 24px 24px; }
.pbw-q__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #2d3e50; color: #fff; }
.pbw-q__icon svg { width: 22px; height: 22px; }
.pbw-q__main { min-width: 0; }
.pbw-q__label { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 10px; font-size: 15.5px; font-weight: 600; line-height: 1.4; color: var(--pbw-ink); }
.pbw-req { flex: none; font-weight: 300; font-size: 18px; line-height: 1; }
.pbw-q__sub { margin: 0 0 10px; font-weight: 600; font-size: 14px; }
.pbw-q__cur { margin: 0 0 12px; font-size: 14px; }
.pbw-q__cur[hidden] { display: none; }
.pbw-q__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-left: 16px; }
.pbw-q__field { flex: 1 1 320px; min-width: 0; }
.pbw-q__notes { margin-top: 14px; }

/* record picker: "AdMedia (Primary) ▾" */
.pbw-target {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--pbw-ink);
    cursor: pointer;
}
.pbw-target:hover { background: #eaf0f6; }
.pbw-target:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(36, 86, 230, .22)); }
.pbw-target__n { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbw-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eaf0f6; font-size: 12px; font-weight: 600; color: var(--pbw-ink); }
.pbw-caret { width: 14px; height: 14px; flex: none; }

/* value fields */
.pbw-dd, .pbw-input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--pbw-ink);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface, #fff);
    font: inherit;
    font-size: 14px;
    color: var(--pbw-ink);
    box-sizing: border-box;
}
.pbw-dd { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.pbw-dd__v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbw-dd .pbw-caret { width: 14px; height: 14px; }
.pbw-dd:focus, .pbw-input:focus, .pbw-dd[aria-expanded="true"] { outline: none; border-color: var(--pbw-blue); box-shadow: 0 0 0 3px rgba(36, 86, 230, .18); }
.pbw-input[type="number"] { -moz-appearance: textfield; }

.pbw-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 22px; }
.pbw-opt { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.pbw-opt input { width: 16px; height: 16px; accent-color: var(--pbw-blue); margin: 0; }

.pbw-file { display: flex; flex-direction: column; gap: 8px; }
.pbw-file__btn { position: relative; display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 10px 16px; border: 1.5px dashed var(--pbw-line); border-radius: 6px; font-weight: 600; cursor: pointer; }
.pbw-file__btn svg { width: 18px; height: 18px; }
.pbw-file__btn:hover { background: #f5f8fa; }
.pbw-file__btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pbw-file__btn:focus-within { box-shadow: var(--focus-ring, 0 0 0 3px rgba(36, 86, 230, .22)); }
.pbw-file__list { margin: 0; padding-left: 18px; }

.pbw-err { margin: 8px 0 0; color: #c0272d; font-weight: 600; font-size: 13.5px; }
.pbw-q__row ~ .pbw-err { padding-left: 16px; }

/* ---- rich-text editor ---- */
.pbw-rte { border: 1px solid var(--pbw-line); border-radius: var(--radius-lg, 12px); background: var(--surface, #fff); cursor: text; }
.pbw-rte:focus-within { border-color: var(--pbw-blue); box-shadow: 0 0 0 3px rgba(36, 86, 230, .14); }
.pbw-rte__area { min-height: 44px; max-height: 360px; overflow-y: auto; padding: 12px 16px 2px; font-size: 14px; line-height: 1.55; outline: none; color: var(--pbw-ink); }
.pbw-rte__area.is-empty::before { content: attr(data-placeholder); color: #99acc2; pointer-events: none; }
.pbw-rte__area blockquote { margin: 6px 0; padding-left: 12px; border-left: 3px solid var(--pbw-line); color: #516f90; }
.pbw-rte__area a { color: var(--pbw-blue); }
/* the app's base CSS removes list markers: bring them back inside the editor */
.pbw-rte__area ul, .pbw-rte__area ol { margin: 4px 0; padding-left: 24px; }
.pbw-rte__area ul { list-style: disc outside; }
.pbw-rte__area ol { list-style: decimal outside; }
.pbw-rte__area ul ul { list-style-type: circle; }
.pbw-rte__area li { display: list-item; list-style: inherit; }
.pbw-rte__area blockquote { margin: 6px 0 6px 4px !important; }
.pbw-rte__area p { margin: 0; }
.pbw-rte__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 10px 8px; cursor: default; }
.pbw-rte__bar button, .pbw-more button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    font: inherit;
    font-size: 15px;
    color: var(--pbw-ink);
    cursor: pointer;
}
.pbw-rte__bar button svg, .pbw-more button svg { width: 16px; height: 16px; }
.pbw-rte__bar button .pbw-caret, .pbw-more button .pbw-caret { width: 11px; height: 11px; }
.pbw-rte__bar button:hover, .pbw-more button:hover { background: #eaf0f6; }
.pbw-rte__bar button:focus-visible, .pbw-more button:focus-visible { outline: none; border-color: var(--pbw-blue); box-shadow: 0 0 0 2px rgba(36, 86, 230, .25); }
.pbw-rte__bar button.is-on { background: var(--brand-soft, #edf2ff); }
.pbw-rte__bar .pbw-rte__more { font-size: 14px; font-weight: 600; }
.pbw-rte__bar .pbw-rte__more[aria-expanded="true"] { border-color: var(--pbw-blue); }
.pbw-rte__sep { width: 1px; height: 22px; margin: 0 4px; background: var(--pbw-line); }

/* ---- floating popovers (dropdowns, menus, More, link) ---- */
.pbw-float {
    position: fixed;
    z-index: 6;
    min-width: 180px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border: 1px solid var(--pbw-line);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(45, 62, 80, .2);
    color: var(--pbw-ink);
}
.pbw-float__search { position: relative; flex: none; padding: 12px; background: #f5f8fa; border-bottom: 1px solid #eaf0f6; border-radius: 6px 6px 0 0; }
.pbw-float__search input { width: 100%; height: 36px; padding: 0 38px 0 14px; border: 1.5px solid var(--pbw-blue); border-radius: 999px; font: inherit; font-size: 14px; color: var(--pbw-ink); box-sizing: border-box; outline: none; }
.pbw-float__search svg { position: absolute; right: 24px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--pbw-ink); pointer-events: none; }
.pbw-float__list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 6px 0; }
.pbw-float__list li { display: flex; align-items: center; gap: 12px; min-height: 20px; padding: 8px 14px; font-size: 14px; cursor: pointer; outline: none; }
.pbw-float__list li.is-active, .pbw-float__list li:focus { background: #eaf0f6; }
.pbw-float__list li[aria-selected="true"] { font-weight: 600; }
.pbw-float__list li[hidden] { display: none; }
.pbw-float--target { min-width: 240px; background: #f5f8fa; }
.pbw-float--target .pbw-float__list li { justify-content: space-between; }
.pbw-float--target .pbw-pill { background: transparent; padding: 0; font-weight: 700; }
.pbw-float__menu { overflow-y: auto; padding: 6px; }
.pbw-float__menu button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 7px 12px; font-size: 14px !important; border: 0; border-radius: 4px; background: none; font: inherit; color: var(--pbw-ink); text-align: left; white-space: nowrap; cursor: pointer; }
.pbw-float__menu button:hover, .pbw-float__menu button:focus-visible { background: #eaf0f6; outline: none; }
.pbw-float__menu button[aria-checked="true"] { font-weight: 700; color: var(--pbw-blue); }

.pbw-float.has-arrow { border-radius: 12px; }
.pbw-float--more { border-radius: 16px !important; padding: 8px 12px !important; }
.pbw-float.has-arrow::after, .pbw-float.has-arrow::before {
    content: '';
    position: absolute;
    left: var(--arrow-x, 24px);
    margin-left: -11px;
    border: 11px solid transparent;
}
.pbw-float.has-arrow.is-up::before { top: 100%; border-top-color: var(--pbw-line); }
.pbw-float.has-arrow.is-up::after { top: calc(100% - 1px); border-top-color: var(--surface, #fff); }
.pbw-float.has-arrow:not(.is-up)::before { bottom: 100%; border-bottom-color: var(--pbw-line); }
.pbw-float.has-arrow:not(.is-up)::after { bottom: calc(100% - 1px); border-bottom-color: var(--surface, #fff); }
.pbw-float--more { padding: 10px 14px; max-height: none; }
.pbw-more { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.pbw-more__dd { font-weight: 600; font-size: 14px !important; }
.pbw-more__sub { display: flex; flex-wrap: wrap; gap: 2px; max-width: 440px; max-height: 240px; overflow-y: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eaf0f6; }
.pbw-more__sub[hidden] { display: none; }
.pbw-more__sub > button { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: 15px; color: var(--pbw-ink); text-align: left; cursor: pointer; }
.pbw-more__sub > button:hover, .pbw-more__sub > button:focus-visible { background: #eaf0f6; outline: none; }
/* ---- footer ---- */
.pbw__foot {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 10px 24px;
    border-top: 1px solid var(--pbw-line);
    background: var(--surface, #fff);
}
.pbw-log {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 16px 0 20px;
    border: 0;
    border-radius: 999px;
    background: #eaf0f6;
    color: #7c98b6;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.pbw-log .pbw-caret { width: 13px; height: 13px; }
.pbw-log.is-ready { background: var(--pbw-blue); color: #fff; }
.pbw-log.is-ready:hover { background: var(--brand-hover, #1c46c4); }
.pbw-log:focus-visible, .pbw-link:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(36, 86, 230, .22)); }
.pbw-follow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; }
.pbw-task { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.pbw-task input { width: 16px; height: 16px; accent-color: var(--pbw-ink); margin: 0; }
.pbw-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 0; border-radius: 4px; background: none; font: inherit; font-weight: 700; color: var(--pbw-ink); cursor: pointer; }
.pbw-link:hover { background: #eaf0f6; }
.pbw-saved { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.pbw-saved svg { width: 16px; height: 16px; color: var(--pbw-blue); }

/* resize grip */
.pbw__grip { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none;
    background: linear-gradient(135deg, transparent 50%, #99acc2 50%, #99acc2 57%, transparent 57%, transparent 72%, #99acc2 72%, #99acc2 79%, transparent 79%); }
.pbw.pw-max .pbw__grip { display: none; }

/* sidebar Playbooks card (record-tabs.js markup, decorated by record-playbook.js) */
.rp-playbook {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    text-align: left;
    overflow: hidden;
}
.rp-playbook strong { font-size: 15px; font-weight: 700; color: var(--brand, #2456e6); }
.rp-playbook .rt-pb__meta { font-size: 13.5px; color: var(--text-muted, #475467); }
.rp-playbook.rt-pb--recent { padding-top: 34px; }
.rp-playbook[hidden] { display: none; }
.rp-playbook .rt-pb__recent {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 8px;
    border-radius: 0 0 0 10px;
    background: var(--brand, #2456e6);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
}
.rt-pb__ric { width: 13px; height: 13px; flex: none; }
.rt-pb__all {
    display: inline-block;
    margin: 2px 0 4px;
    padding: 2px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand, #2456e6);
    cursor: pointer;
}
.rt-pb__all:hover { text-decoration: underline; }
.rt-pb__all:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(36, 86, 230, .22)); border-radius: 4px; }
.rt-pb__all[hidden] { display: none; }

/* ---- small screens ---- */
@media (max-width: 960px) {
    .pbw__body { grid-template-columns: 1fr; }
    .pbw__nav { display: none; }
    .pbw__content { padding: 20px 20px 32px; }
    .pbw-q { grid-template-columns: 1fr; padding-left: 0; gap: 10px; }
    .pbw-q__icon { display: none; }
    .pbw-q__row { padding-left: 0; }
    .pbw-q__row ~ .pbw-err { padding-left: 0; }
    .pbw-sec { font-size: 26px; }
}
@media (max-width: 767px) {
    .pbw { top: 8px !important; left: 8px !important; right: 8px; width: auto !important; height: calc(100vh - 16px) !important; }
    .pbw__foot { padding: 12px 16px; }
    .pbw-saved { margin-left: 0; }
    .pbw__grip { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pbw { transition: none; } }

/* ---- More bubble: second-level panels ---- */
.pbw-more__fc { position: relative; display: inline-flex; }
.pbw-more__fc svg rect { fill: var(--fc, currentColor); }
.pbw-more .pbw-more__caret { min-width: 20px; padding: 0 2px; }
.pbw-float--sub { z-index: 7; border-radius: 10px; max-height: 340px; }
.pbw-float--sub .pbw-float__menu { padding: 6px; }
.pbw-float--sub .pbw-float__menu button { flex-direction: row; align-items: center; gap: 10px; }
.pbw-float--sub .pbw-float__menu button svg { width: 16px; height: 16px; flex: none; }
.pbw-float--sub .pbw-float__menu button[aria-checked="true"] { background: var(--brand-soft, #edf2ff); }
.pbw-float--icons .pbw-float__menu button[aria-checked="true"] { color: var(--pbw-blue); }
.pbw-float--size { min-width: 90px; }
.pbw-float--font { min-width: 200px; }

/* colour picker: Simple / Advanced */
.pbw-float--cp { padding: 0; border-radius: 14px; overflow: hidden; max-height: none; }
.pbw-cp { width: 320px; }
.pbw-cp__tabs { display: grid; grid-template-columns: 1fr 1fr; }
.pbw-cp__tabs button { height: 42px; border: 0; border-bottom: 1px solid var(--pbw-line); background: #f5f8fa; font: inherit; font-size: 14px; color: var(--pbw-ink); cursor: pointer; }
.pbw-cp__tabs button + button { border-left: 1px solid var(--pbw-line); }
.pbw-cp__tabs button[aria-selected="true"] { background: var(--surface, #fff); border-bottom-color: transparent; font-weight: 600; }
.pbw-cp__tabs button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--pbw-blue); }
.pbw-cp__pane { padding: 14px 14px 4px; }
.pbw-cp__pane[hidden] { display: none; }
.pbw-sw { display: grid; grid-template-columns: repeat(9, 24px); gap: 6px; justify-content: center; }
.pbw-sw__c { width: 24px; height: 24px; padding: 0; border: 1px solid rgba(0, 0, 0, .14); border-radius: 5px; cursor: pointer; }
.pbw-sw__c:hover { transform: scale(1.08); }
.pbw-sw__c[aria-pressed="true"], .pbw-sw__c:focus-visible { outline: 2px solid var(--pbw-blue); outline-offset: 2px; }
.pbw-cp__reset { display: block; width: calc(100% - 28px); margin: 12px 14px 14px; height: 36px; padding: 0 14px; border: 1px solid #99acc2; border-radius: var(--radius-sm, 8px); background: var(--surface, #fff); font: inherit; font-size: 14px; color: var(--pbw-ink); text-align: left; cursor: pointer; }
.pbw-cp__reset:hover { background: #f5f8fa; }
.pbw-cp__reset:focus-visible, .pbw-cp__apply:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(36, 86, 230, .25); }


/* Advanced colour: saturation/brightness square, hue slider, preview, R G B # */
.pbw-cpa { display: grid; grid-template-columns: 172px 1fr; grid-template-rows: auto auto; gap: 12px 16px; align-items: center; }
.pbw-cpa__sv {
    position: relative;
    width: 172px;
    height: 172px;
    border-radius: 6px;
    background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, var(--hue, red));
    cursor: crosshair;
    touch-action: none;
}
.pbw-cpa__dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.pbw-cpa__fields { display: flex; flex-direction: column; gap: 8px; align-self: start; }
.pbw-cpa__fields label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.pbw-cpa__fields label span { width: 12px; }
.pbw-cpa__fields input { width: 100%; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--pbw-ink); border-radius: var(--radius-sm, 8px); font: inherit; font-size: 14px; color: var(--pbw-ink); box-sizing: border-box; }
.pbw-cpa__fields input:focus { outline: none; border-color: var(--pbw-blue); box-shadow: 0 0 0 3px rgba(36, 86, 230, .18); }
.pbw-cpa__fields input.is-bad { border-color: #c0272d; }
.pbw-cpa__hue {
    position: relative;
    width: 172px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    cursor: pointer;
    touch-action: none;
}
.pbw-cpa__thumb { position: absolute; top: -2px; bottom: -2px; width: 8px; margin-left: -4px; border: 1px solid #7c98b6; border-radius: 3px; background: #fff; pointer-events: none; }
.pbw-cpa__prev { width: 36px; height: 36px; border: 1px solid var(--pbw-line); border-radius: 6px; }
.pbw-cpa__sv:focus-visible, .pbw-cpa__hue:focus-visible { outline: 2px solid var(--pbw-blue); outline-offset: 2px; }

/* pill buttons built on the app's .btn-crm */
.pbw .pbw-pillbtn { height: 32px; padding: 0 16px; border-radius: 999px; font-size: 14px; gap: 6px; text-decoration: none; }
.pbw .btn-crm--sm.pbw-pillbtn:not(.btn-crm--primary) { border-color: #7c98b6; color: var(--pbw-ink); }
.pbw .pbw-pillbtn[disabled] { opacity: .5; }

/* Create link */
.pbw-float--form { padding: 18px 20px; width: 330px; border-radius: 14px; max-height: none; }
.pbw-linkf { display: flex; flex-direction: column; }
.pbw-linkf__title { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--pbw-ink); }
.pbw-linkf > label:not(.pbw-linkf__chk) { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.pbw-linkf__in { height: 38px; margin-bottom: 14px; padding: 0 12px; border: 1px solid var(--pbw-ink); border-radius: var(--radius-sm, 8px); font: inherit; font-size: 14px; color: var(--pbw-ink); }
.pbw-linkf__in:focus { outline: none; border-color: var(--pbw-blue); box-shadow: 0 0 0 3px rgba(36, 86, 230, .18); }
.pbw-linkf__in[aria-invalid="true"] { border-color: #c0272d; }
.pbw-linkf__err { margin: -8px 0 12px; color: #c0272d; font-size: 13px; font-weight: 600; }
.pbw-linkf__chk { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; cursor: pointer; }
.pbw-linkf__chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--pbw-blue); }
.pbw-linkf__acts { display: flex; align-items: center; gap: 8px; }
.pbw-linkf__rm { margin-left: auto; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: #c0272d; cursor: pointer; }
.pbw-linkf__rm:hover { text-decoration: underline; }

/* snippets */
.pbw-float--snip { width: 400px; max-width: calc(100vw - 16px); height: 360px; max-height: none; border-radius: 14px; overflow: visible; }
.pbw-snip { display: flex; flex-direction: column; height: 100%; min-height: 0; border-radius: 14px; overflow: hidden; }
.pbw-snip__head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 14px; }
.pbw-snip__back { display: inline-grid; place-items: center; width: 28px; height: 26px; padding: 0 4px 0 0; border: 0; border-right: 1px solid var(--pbw-ink); border-radius: 0; background: none; color: var(--pbw-ink); cursor: pointer; }
.pbw-snip__back svg { width: 16px; height: 16px; }
.pbw-snip__back:focus-visible { outline: 2px solid var(--pbw-blue); }
.pbw-snip__title { flex: 1; margin-left: 4px; font-weight: 700; font-size: 15px; }
.pbw-ext { width: 13px; height: 13px; }
.pbw-snip .pbw-float__search { border-radius: 0; background: #eef1f4; }
.pbw-snip__list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.pbw-snip__list li { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px 10px 24px; cursor: pointer; outline: none; }
.pbw-snip__list li strong { font-size: 14px; font-weight: 600; color: var(--text, #101828); }
.pbw-snip__list li span { font-size: 13px; color: #6b7a8c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbw-snip__list li.is-active { background: #f0f2f5; }
.pbw-snip__list li[hidden] { display: none; }
.pbw-snip__empty { margin: 0; padding: 20px; color: #6b7a8c; font-size: 14px; text-align: center; }

/* More bubble: pressed states, list split button, icon-only menus */
.pbw-more button[aria-pressed="true"] { background: #cbd6e2; border-color: #7c98b6; }
.pbw-more__split { display: inline-flex; align-items: center; }
.pbw-more__split > button:first-child { border-radius: 4px 0 0 4px; }
.pbw-more__split > button:first-child[aria-pressed="true"] + .pbw-more__caret { border-color: #7c98b6; border-left-color: transparent; border-radius: 0 4px 4px 0; }
.pbw-more [data-more-ic] { display: inline-flex; }
.pbw-float--iconmenu { min-width: 0; width: 56px; border-radius: 14px; padding: 8px 0; }
.pbw-iconmenu { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 !important; }
.pbw-iconmenu button { justify-content: center; align-items: center !important; flex-direction: row !important; width: 40px !important; height: 36px; padding: 0 !important; border-radius: 6px; }
.pbw-iconmenu button svg { width: 18px; height: 18px; }
.pbw-float--sub .pbw-iconmenu button[aria-checked="true"] { background: #cbd6e2; color: var(--pbw-ink); }

/* ---- app-only (PB7) ---- */
button.rp-playbook { width: 100%; border: 1px solid var(--border); background: none; font: inherit; cursor: pointer; }
.rp-playbook .rt-pb__recent { color: #fff; }
.pbw__state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px; }
.pbw__state p { margin: 0; }
.pbw-h4 { margin: 16px 0 8px; font-size: 16px; font-weight: 600; color: var(--pbw-ink); }
.pbw-media { display: block; max-width: 100%; margin: 12px 0; border-radius: 8px; }
.pbw-media--frame { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.pbw-chip { display: inline-block; margin: 8px 0; padding: 6px 12px; border: 1px solid var(--pbw-line); border-radius: 999px; font-weight: 600; }
.pbw-log[disabled] { opacity: .6; cursor: not-allowed; }
