/* ============================================================================
 * playbooks-ui.css — Settings → Playbooks, and the primitives the Directory
 * shares with it.
 *
 * Every colour is a token (--accent, --text-color, --border-color, …) so the
 * panel tracks whatever theme the user has chosen rather than pinning a palette.
 * Motion is short and respects prefers-reduced-motion.
 *
 * The `pbk-*` primitives near the top (buttons, switches, menus, the viewer, the
 * markdown typography) are used by directory-ui.css too. They live here because
 * this is the file that loads first, and duplicating a button in two stylesheets
 * is how two surfaces of one feature start to look like two features.
 * ========================================================================== */

/* ── motion ─────────────────────────────────────────────────────────────── */
@keyframes pbkIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pbkFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pbkSpin { to { transform: rotate(360deg); } }

.pbk-page { animation: pbkIn 0.26s var(--ui-ease, ease); }

/* Screen-reader-only text (column headers that are visually redundant). */
.pbk-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   SHARED PRIMITIVES
   ══════════════════════════════════════════════════════════════════════════ */

/* ── buttons ──────────────────────────────────────────────────────────────
 * GUARD RULE, and why it is here.
 *   These controls live inside the shared Tools/Settings modal, whose stylesheet
 *   carries a legacy `.data-window .content button:not(…)` rule that sets
 *   `width: 100px`, a navy background and white text. It outranks every rule
 *   below on specificity, so Playbooks rendered as a column of identical blue
 *   boxes: menu labels wrapped onto three lines and overflowed the panel, and the
 *   info / overflow / view-mode icon buttons were stretched into rectangles.
 *
 *   That rule now exempts the `pbk-*` namespace, which is the real fix. This
 *   block is the belt to that braces: `width: auto` is the property whose loss
 *   breaks layout rather than just colour, so it is asserted explicitly and this
 *   component stops depending on a `:not()` list in another file staying correct.
 *   Nothing here uses !important — it only has to survive an equal-specificity
 *   accident, not win an argument. */
.pbk-btn,
.pbk-icon-btn,
.pbk-back,
.pbk-mode,
.pbk-menu-item,
.pbk-info,
.pbk-filepick,
.pbk-seemore {
    width: auto;
    min-width: 0;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}

.pbk-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
    border-radius: 9px;
    background: var(--secondary-color, rgba(255, 255, 255, 0.04));
    color: var(--text-color);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.16s var(--ui-ease, ease), border-color 0.16s var(--ui-ease, ease),
                transform 0.1s ease, filter 0.16s ease;
}
/* Border AND surface on hover. Moving only the border made these feel dead —
   the change was too small to register as feedback at this size. */
.pbk-btn:hover:not(:disabled) {
    border-color: var(--accent-ring, rgba(183, 121, 92, 0.4));
    background: var(--secondary-hover-color, rgba(255, 255, 255, 0.07));
}
.pbk-btn:focus-visible {
    outline: none;
    border-color: var(--accent, #b7795c);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(183, 121, 92, 0.16));
}
.pbk-btn:active:not(:disabled) { transform: scale(0.975); }
.pbk-btn:disabled { opacity: 0.55; cursor: default; }
.pbk-btn.primary {
    background: var(--accent, #b7795c);
    border-color: transparent;
    color: var(--accent-contrast, #fff);
}
.pbk-btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.pbk-btn.ghost { background: transparent; }
.pbk-btn.ghost:hover:not(:disabled) { background: var(--hover-bg, rgba(255, 255, 255, 0.05)); }
.pbk-btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; }
.pbk-btn.busy { pointer-events: none; }

.pbk-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--subheading-color, #8a8a8a);
    cursor: pointer;
    transition: background 0.16s var(--ui-ease, ease), color 0.16s var(--ui-ease, ease);
}
.pbk-icon-btn:hover { background: var(--hover-bg, rgba(255, 255, 255, 0.06)); color: var(--text-color); }
.pbk-icon-btn .material-symbols-rounded { font-size: 20px; }
.pbk-icon-btn.small { width: 28px; height: 28px; }
.pbk-icon-btn.small .material-symbols-rounded { font-size: 17px; }

.pbk-caret { font-size: 18px !important; opacity: 0.7; margin-left: -2px; }

/* ── on/off switch ──────────────────────────────────────────────────────── */
.pbk-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.pbk-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pbk-switch span {
    position: absolute; inset: 0;
    border-radius: 999px;
    background: var(--border-color, rgba(255, 255, 255, 0.18));
    transition: background 0.2s var(--ui-ease, ease);
    pointer-events: none;
}
.pbk-switch span::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s var(--ui-ease, ease);
}
.pbk-switch input:checked + span { background: var(--accent, #b7795c); }
.pbk-switch input:checked + span::after { transform: translateX(18px); }
.pbk-switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft, rgba(183, 121, 92, 0.3)); }

/* ── dropdown menus ────────────────────────────────────────────────────── */
.pbk-menu-wrap { position: relative; display: inline-flex; }
.pbk-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    background: var(--primary-color, #1b1b1e);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
    animation: pbkFade 0.14s var(--ui-ease, ease);
}
.pbk-menu.right { left: auto; right: 0; }
.pbk-menu.wide { min-width: 280px; max-height: 320px; overflow-y: auto; }
.pbk-menu[hidden] { display: none; }
.pbk-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.13s ease;
}
.pbk-menu-item:hover { background: var(--hover-bg, rgba(255, 255, 255, 0.07)); }
.pbk-menu-item .material-symbols-rounded { font-size: 18px; opacity: 0.75; flex: 0 0 auto; }
.pbk-menu-item.danger { color: #e5484d; }
.pbk-menu-item.danger .material-symbols-rounded { opacity: 0.9; }
.pbk-menu-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbk-menu-item-meta { font-size: 11px; color: var(--subheading-color, #8a8a8a); flex: 0 0 auto; }
.pbk-menu-check { color: var(--accent, #b7795c); }
.pbk-menu-note {
    padding: 7px 10px 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--subheading-color, #8a8a8a);
}

/* ── loading + empty states ─────────────────────────────────────────────── */
.pbk-loading {
    padding: 40px 0;
    text-align: center;
    font-size: 13px;
    color: var(--subheading-color, #8a8a8a);
}

/* Row-shaped skeleton for the list. The plates themselves are the directory's
   .dir-skel-* primitives (directory-ui.css) — this only lays them out as a table
   row, so the two surfaces cannot drift into two different shimmer styles.
   Metrics match .pbk-row: 12px vertical padding, an icon, text, a switch. */
.pbk-skel { display: flex; flex-direction: column; }
.pbk-skel-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 10px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}
.pbk-skel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pbk-skel-text .dir-skel-line.title { width: 34%; }
.pbk-empty {
    padding: 52px 24px;
    text-align: center;
    animation: pbkIn 0.26s var(--ui-ease, ease);
}
.pbk-empty > .material-symbols-rounded {
    font-size: 40px;
    color: var(--accent, #b7795c);
    opacity: 0.75;
}
.pbk-empty h4 { margin: 12px 0 6px; font-size: 16px; font-weight: 600; color: var(--text-color); }
.pbk-empty p {
    margin: 0 auto;
    max-width: 440px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--subheading-color, #8a8a8a);
}
.pbk-empty.small { padding: 32px 18px; }
.pbk-empty-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.pbk-warn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 13px;
    margin: 0 0 16px;
    border: 1px solid rgba(217, 119, 6, 0.32);
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.09);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-color);
}
.pbk-warn .material-symbols-rounded { font-size: 19px; color: #d97706; flex: 0 0 auto; }

/* ══════════════════════════════════════════════════════════════════════════
   LIST VIEW
   ══════════════════════════════════════════════════════════════════════════ */

.pbk-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    /* The table used to start 4px under the heading, which read as one crowded
       block rather than a header and its contents. */
    margin-bottom: 14px;
}
.pbk-topbar-title { flex: 1; font-size: 17px; font-weight: 600; color: var(--text-color); }
.pbk-topbar-actions {
    display: flex;
    align-items: center;
    /* Tighter than the row gap on purpose: these three controls are one cluster,
       and spacing them like separate sections makes the row look unresolved. */
    gap: 6px;
    flex: 0 0 auto;
}
/* Settings → Tools provides the heading; keep the controls aligned when this
   component intentionally omits its duplicate heading. */
.pbk-page-embedded .pbk-topbar-actions { margin-left: auto; }

.pbk-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 6px 0 12px;
    margin: 12px 0 4px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 11px;
    background: var(--secondary-color, rgba(255, 255, 255, 0.03));
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    animation: pbkFade 0.16s ease;
}
.pbk-searchbar[hidden] { display: none; }
.pbk-searchbar:focus-within {
    border-color: var(--accent, #b7795c);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(183, 121, 92, 0.16));
}
.pbk-searchbar > .material-symbols-rounded { font-size: 19px; color: var(--subheading-color, #8a8a8a); }
.pbk-searchbar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-color);
    font: inherit;
    font-size: 13.5px;
}

.pbk-table { width: 100%; border-collapse: collapse; margin-top: 2px; }
.pbk-table thead th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--subheading-color, #8a8a8a);
    text-align: left;
    white-space: nowrap;
}
.pbk-col-date, .pbk-col-author { width: 116px; }
.pbk-col-state { width: 52px; text-align: right; }

.pbk-row {
    cursor: pointer;
    transition: background 0.14s var(--ui-ease, ease);
}
.pbk-row:hover { background: var(--hover-bg, rgba(255, 255, 255, 0.035)); }
.pbk-row:focus-visible {
    outline: 2px solid var(--accent, #b7795c);
    outline-offset: -2px;
}
.pbk-row > td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    font-size: 13px;
    color: var(--subheading-color, #8a8a8a);
    vertical-align: middle;
}
.pbk-row.is-off .pbk-row-title,
.pbk-row.is-off .pbk-row-ico { opacity: 0.55; }

.pbk-row-name { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.pbk-row-ico {
    font-size: 20px;
    color: var(--accent, #b7795c);
    margin-top: 1px;
    flex: 0 0 auto;
}
.pbk-row-text { min-width: 0; }
.pbk-row-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}
.pbk-row-desc {
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--subheading-color, #8a8a8a);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.pbk-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--accent-soft, rgba(183, 121, 92, 0.16));
    color: var(--accent, #b7795c);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.pbk-badge.subtle {
    background: rgba(128, 128, 128, 0.14);
    color: var(--subheading-color, #8a8a8a);
}
.pbk-badge.off {
    background: rgba(128, 128, 128, 0.14);
    color: var(--subheading-color, #8a8a8a);
}

/* ══════════════════════════════════════════════════════════════════════════
   DETAIL VIEW
   ══════════════════════════════════════════════════════════════════════════ */

.pbk-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px 5px 5px;
    margin-bottom: 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--subheading-color, #8a8a8a);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pbk-back:hover { background: var(--hover-bg, rgba(255, 255, 255, 0.06)); color: var(--text-color); }
.pbk-back .material-symbols-rounded { font-size: 19px; }

.pbk-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}
.pbk-detail-titles { flex: 1; min-width: 0; }
.pbk-detail-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 19px;
    font-weight: 600;
    color: var(--text-color);
}
.pbk-info {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--subheading-color, #8a8a8a);
    cursor: pointer;
    transition: color 0.15s ease;
}
.pbk-info:hover { color: var(--text-color); }
.pbk-info .material-symbols-rounded { font-size: 17px; }
.pbk-detail-by { margin-top: 3px; font-size: 12.5px; color: var(--subheading-color, #8a8a8a); }
.pbk-detail-controls { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* Info popover: the trigger + full description, so "how does this fire" is
   answerable without leaving the page. */
.pbk-tip {
    position: absolute;
    top: 32px; left: 0;
    z-index: 30;
    max-width: 360px;
    padding: 13px 15px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    background: var(--primary-color, #1b1b1e);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    animation: pbkFade 0.14s ease;
}
.pbk-tip[hidden] { display: none; }
.pbk-tip-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--subheading-color, #8a8a8a);
    margin-bottom: 3px;
}
.pbk-tip-value { font-size: 13px; line-height: 1.55; color: var(--text-color); }
.pbk-tip-value + .pbk-tip-label { margin-top: 12px; }

.pbk-detail-desc {
    position: relative;
    margin: 14px 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--subheading-color, #8a8a8a);
}
.pbk-detail-desc.clamped [data-el="desc-text"] {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pbk-seemore {
    border: none;
    background: transparent;
    padding: 0 0 0 4px;
    color: var(--accent, #b7795c);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.pbk-seemore[hidden] { display: none; }

/* ── file viewer ────────────────────────────────────────────────────────── */
.pbk-viewer {
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 14px;
    background: var(--secondary-color, rgba(255, 255, 255, 0.02));
    overflow: hidden;
}
.pbk-viewer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.pbk-filepick {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 260px;
    height: 30px;
    padding: 0 8px 0 11px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
    border-radius: 8px;
    background: var(--primary-color, rgba(0, 0, 0, 0.2));
    color: var(--text-color);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.pbk-filepick:hover { border-color: var(--accent-ring, rgba(183, 121, 92, 0.4)); }
.pbk-filepick > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbk-viewer-count { flex: 1; font-size: 12px; color: var(--subheading-color, #8a8a8a); }

.pbk-viewer-modes {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 9px;
    background: var(--primary-color, rgba(0, 0, 0, 0.22));
}
.pbk-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 26px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--subheading-color, #8a8a8a);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pbk-mode:hover { color: var(--text-color); }
.pbk-mode.is-on { background: var(--hover-bg, rgba(255, 255, 255, 0.09)); color: var(--text-color); }
.pbk-mode .material-symbols-rounded { font-size: 17px; }

.pbk-viewer-body {
    max-height: min(52vh, 520px);
    overflow-y: auto;
    padding: 4px 18px 18px;
}

/* ── rendered markdown ──────────────────────────────────────────────────── */
.pbk-md { font-size: 13.5px; line-height: 1.68; color: var(--text-color); }
.pbk-md > *:first-child { margin-top: 14px; }
.pbk-md h1, .pbk-md h2, .pbk-md h3, .pbk-md h4 {
    margin: 24px 0 8px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}
.pbk-md h1 { font-size: 19px; }
.pbk-md h2 { font-size: 16px; }
.pbk-md h3 { font-size: 14.5px; }
.pbk-md h4 { font-size: 13.5px; color: var(--subheading-color, #8a8a8a); }
.pbk-md p { margin: 0 0 12px; }
.pbk-md ul, .pbk-md ol { margin: 0 0 12px; padding-left: 22px; }
.pbk-md li { margin: 4px 0; }
.pbk-md li > ul, .pbk-md li > ol { margin: 4px 0; }
.pbk-md a { color: var(--accent, #b7795c); text-decoration: none; }
.pbk-md a:hover { text-decoration: underline; }
.pbk-md strong { font-weight: 600; color: var(--text-color); }
.pbk-md hr { border: 0; border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)); margin: 20px 0; }
.pbk-md blockquote {
    margin: 0 0 12px;
    padding: 2px 0 2px 14px;
    border-left: 2px solid var(--accent-ring, rgba(183, 121, 92, 0.4));
    color: var(--subheading-color, #8a8a8a);
}
.pbk-md code {
    padding: 1.5px 5px;
    border-radius: 5px;
    background: var(--highlight-background, rgba(255, 255, 255, 0.07));
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
}
.pbk-md table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 14px;
    font-size: 12.5px;
}
.pbk-md th, .pbk-md td {
    padding: 7px 10px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.09));
    text-align: left;
}
.pbk-md th { background: var(--highlight-background, rgba(255, 255, 255, 0.04)); font-weight: 600; }

/* ── code blocks (rendered fences and raw source) ──────────────────────── */
.pbk-code, .pbk-raw {
    margin: 0 0 14px;
    padding: 13px 15px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    background: var(--highlight-background, rgba(0, 0, 0, 0.28));
    overflow-x: auto;
}
.pbk-code code, .pbk-raw code {
    padding: 0;
    background: none;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.62;
    white-space: pre;
}
.pbk-raw { margin: 14px 0 0; max-width: 100%; }

/* ══════════════════════════════════════════════════════════════════════════
   EDITOR
   ══════════════════════════════════════════════════════════════════════════ */

.pbk-editor-head h3 { margin: 0 0 5px; font-size: 17px; font-weight: 600; color: var(--text-color); }
.pbk-editor-head p {
    margin: 0 0 20px;
    max-width: 620px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--subheading-color, #8a8a8a);
}

.pbk-form { display: flex; flex-direction: column; gap: 16px; }
.pbk-field { display: flex; flex-direction: column; gap: 6px; }
.pbk-field-label { font-size: 12.5px; font-weight: 600; color: var(--text-color); }
.pbk-optional {
    font-weight: 400;
    font-size: 11.5px;
    color: var(--subheading-color, #8a8a8a);
    margin-left: 4px;
}
.pbk-field input[type="text"],
.pbk-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 10px;
    background: var(--secondary-color, rgba(255, 255, 255, 0.03));
    color: var(--text-color);
    font: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.pbk-field input[type="text"]:focus,
.pbk-field textarea:focus {
    border-color: var(--accent, #b7795c);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(183, 121, 92, 0.16));
}
.pbk-field textarea { resize: vertical; min-height: 74px; }
.pbk-field textarea[name="instructions"] {
    min-height: 300px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}
.pbk-field-hint { font-size: 11.5px; line-height: 1.5; color: var(--subheading-color, #8a8a8a); }
.pbk-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════════════════
   QUICK WINDOW (opened from the composer "+" menu)
   ══════════════════════════════════════════════════════════════════════════ */

.pbk-quick-overlay {
    position: fixed;
    inset: 0;
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(3px);
    animation: pbkFade 0.18s var(--ui-ease, ease);
}
.pbk-quick-card {
    width: min(860px, 100%);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    background: var(--primary-color, #17171a);
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.pbk-quick-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.pbk-quick-head > .material-symbols-rounded { font-size: 23px; color: var(--accent, #b7795c); }
.pbk-quick-titles { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pbk-quick-titles strong { font-size: 15px; color: var(--text-color); }
.pbk-quick-titles span { font-size: 12px; color: var(--subheading-color, #8a8a8a); }
.pbk-quick-body { padding: 16px 18px 20px; overflow-y: auto; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
    .pbk-topbar { flex-wrap: wrap; }
    .pbk-topbar-title { flex: 1 0 100%; margin-bottom: 4px; }
    /* Date and author are context, not the point. On a narrow screen the name and
       the switch are what matter, so the rest steps aside rather than squeezing
       the description into two words. */
    .pbk-col-date, .pbk-col-author { display: none; }
    .pbk-viewer-body { max-height: 58vh; padding: 4px 13px 14px; }
    .pbk-filepick { max-width: 150px; }
    .pbk-detail-head { flex-wrap: wrap; }
    .pbk-field textarea[name="instructions"] { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
    .pbk-page, .pbk-empty, .pbk-menu, .pbk-tip, .pbk-quick-overlay, .pbk-searchbar { animation: none; }
    .pbk-btn, .pbk-row, .pbk-switch span, .pbk-switch span::after, .pbk-icon-btn { transition: none; }
}
