/* ===========================================================================
   Service plan pages: the header grouped by job, the ready check, the settings
   sheet — and HbMenuButton, which any page may use.

   Colours come from the portal tokens (portal.css: --hb-fg, --hb-muted,
   --hb-card-bg, --hb-border, --hb-hover, --hb-accent), so light and dark both
   follow the theme toggle. Warning and good are the only fixed hues, and both
   are mixed against the surface so they read on either.
   =========================================================================== */

:root {
    --pb-warn: #a8420a;
    --pb-ok: #0e700e;
    --pb-live: #c50f1f;
}
[data-theme="dark"] {
    --pb-warn: #f4a46d;
    --pb-ok: #6ccb5f;
    --pb-live: #ff7782;
}

/* ---- HbMenuButton ---------------------------------------------------------- */

.hbm { position: relative; display: inline-flex; }
.hbm-caret { font-size: .65em; margin-left: 6px; opacity: .7; }
.hbm-scrim { position: fixed; inset: 0; z-index: 1300; background: transparent; }
.hbm-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 1301;
    min-width: 260px; max-width: min(420px, calc(100vw - 32px));
    background: var(--hb-card-bg); color: var(--hb-fg);
    border: 1px solid var(--hb-border); border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.1);
    padding: 6px; display: flex; flex-direction: column; gap: 1px;
}
.hbm-pop.hbm-right { left: auto; right: 0; }
.hbm-item {
    display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start;
    width: 100%; text-align: left; padding: 8px 9px; border: 0; border-radius: 5px;
    background: transparent; color: var(--hb-fg); font: inherit; font-size: .88rem; cursor: pointer;
}
.hbm-item:hover, .hbm-item:focus-visible { background: var(--hb-hover); outline: none; }
.hbm-item:focus-visible { box-shadow: inset 0 0 0 2px var(--hb-accent); }
.hbm-item[disabled] { opacity: .5; cursor: default; }
.hbm-ico { margin-top: 3px; text-align: center; color: var(--hb-muted); }
.hbm-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.hbm-text small { color: var(--hb-muted); font-size: .76rem; }
.hbm-danger, .hbm-danger .hbm-ico { color: var(--pb-live); }
.hbm-sep { height: 1px; background: var(--hb-border); margin: 4px 2px; }
.hbm-cap {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--hb-muted); padding: 4px 9px 6px;
}
.hbm-status { border-radius: 6px; padding: 8px 10px; margin-bottom: 4px; font-size: .85rem; line-height: 1.35; }
.hbm-status small { display: block; color: var(--hb-fg); opacity: .8; font-size: .76rem; margin-top: 2px; }
.hbm-status.ok { background: color-mix(in srgb, var(--pb-ok) 12%, transparent); color: var(--pb-ok); }
.hbm-status.warn { background: color-mix(in srgb, var(--pb-warn) 13%, transparent); color: var(--pb-warn); }
.hbm-status.plain { background: var(--hb-hover); color: var(--hb-fg); }
.hbm-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; font-size: .88rem; }
.hbm-row > span { flex: 1 1 auto; }

/* ---- The plan header -------------------------------------------------------- */

.pb-head {
    background: var(--hb-card-bg); border: 1px solid var(--hb-border); border-radius: 8px;
    padding: 12px 14px 0; margin-bottom: 14px;
}
.pb-head-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pb-titles { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pb-title-input.e-input-group, .pb-title-input .e-input-group { border-color: transparent !important; background: transparent !important; }
.pb-title-input input.e-input, .pb-title-input .e-input { font-size: 1.35rem !important; font-weight: 600 !important; padding-left: 4px !important; }
.pb-title-input.e-input-group:hover, .pb-title-input.e-input-focus { border-color: var(--hb-border) !important; }
.pb-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--hb-muted); }
.pb-when .pb-date { width: 150px; }
.pb-when .pb-time { width: 112px; }
.pb-summary { min-width: 0; }
.pb-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.pb-save-note { font-size: .74rem; color: var(--hb-muted); display: block; text-align: right; margin-top: 2px; }
.pb-tabs { display: flex; gap: 2px; margin: 10px -14px 0; padding: 0 14px; border-top: 1px solid var(--hb-border); }
.pb-tab {
    border: 0; background: transparent; color: var(--hb-muted); font: inherit; font-weight: 600; font-size: .88rem;
    padding: 9px 12px 8px; border-bottom: 2px solid transparent; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.pb-tab.on { color: var(--hb-fg); border-bottom-color: var(--hb-accent); }
.pb-tab small { font-weight: 400; }
.pb-tab:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: -2px; }

/* Overseers as faces. */
.pb-faces { display: inline-flex; align-items: center; border: 0; background: transparent; padding: 2px 4px; cursor: pointer; border-radius: 99px; }
.pb-faces:hover { background: var(--hb-hover); }
.pb-face {
    width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
    font-size: .64rem; font-weight: 700; color: #fff; background: var(--hb-accent);
    border: 2px solid var(--hb-card-bg); object-fit: cover;
}
.pb-face + .pb-face { margin-left: -8px; }
.pb-face-add { background: var(--hb-hover); color: var(--hb-muted); }

/* The ready check's button. */
.pb-ready.e-btn { font-weight: 600; }
.pb-ready-warn.e-btn, .pb-ready-warn.e-btn:hover, .pb-ready-warn.e-btn:focus {
    border-color: var(--pb-warn) !important; color: var(--pb-warn) !important;
    background: color-mix(in srgb, var(--pb-warn) 10%, transparent) !important;
}
.pb-ready-ok.e-btn, .pb-ready-ok.e-btn:hover, .pb-ready-ok.e-btn:focus {
    border-color: color-mix(in srgb, var(--pb-ok) 50%, transparent) !important; color: var(--pb-ok) !important;
    background: transparent !important;
}
.pb-pill {
    display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 99px;
    font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.pb-pill.warn { background: color-mix(in srgb, var(--pb-warn) 14%, transparent); color: var(--pb-warn); }
.pb-pill.ok { background: color-mix(in srgb, var(--pb-ok) 13%, transparent); color: var(--pb-ok); }
.pb-pill.plain { background: var(--hb-hover); color: var(--hb-muted); }
.pb-pill.live { background: color-mix(in srgb, var(--pb-live) 12%, transparent); color: var(--pb-live); }
.pb-pill.live .live-dot { background: currentColor; }

/* ---- The ready check -------------------------------------------------------- */

.pb-checks { display: flex; flex-direction: column; }
.pb-check { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 9px 8px; border-bottom: 1px solid var(--hb-border); }
.pb-check:last-of-type { border-bottom: 0; }
.pb-check > i { margin-top: 3px; color: var(--pb-warn); text-align: center; }
.pb-check.info > i { color: var(--hb-accent); }
.pb-check p { margin: 0; font-size: .86rem; line-height: 1.4; }
.pb-check .pb-fix { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pb-passed { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; margin: 4px -6px -6px; border-radius: 0 0 8px 8px; background: var(--hb-hover); font-size: .8rem; color: var(--hb-muted); }
.pb-passed span { display: flex; gap: 8px; align-items: center; }
.pb-passed i { color: var(--pb-ok); }

/* A segment the ready check pointed at, for a moment. */
.plan-flash > td, .plan-flash { animation: pbflash 2.2s ease-out; }
@keyframes pbflash { 0%, 40% { background: color-mix(in srgb, var(--hb-accent) 22%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .plan-flash > td, .plan-flash { animation: none; outline: 2px solid var(--hb-accent); } }

/* ---- The settings sheet ----------------------------------------------------- */

.pb-sheet.e-dialog { border-radius: 0 !important; max-height: 100vh !important; height: 100vh !important; }
.pb-sheet.e-dialog .e-dlg-content { padding: 0 !important; }
.pb-group { border-bottom: 1px solid var(--hb-border); }
.pb-group-head {
    width: 100%; border: 0; background: transparent; color: var(--hb-fg); font: inherit; text-align: left; cursor: pointer;
    display: grid; grid-template-columns: 20px 1fr 14px; gap: 10px; padding: 14px 18px; align-items: start;
}
.pb-group-head:hover { background: var(--hb-hover); }
.pb-group-head:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: -2px; }
.pb-group-head > i:first-child { color: var(--hb-muted); margin-top: 3px; text-align: center; }
.pb-group-head b { display: block; font-size: .92rem; }
.pb-group-head small { display: block; color: var(--hb-muted); font-size: .82rem; line-height: 1.4; margin-top: 2px; }
.pb-group-head .pb-chev { color: var(--hb-muted); margin-top: 4px; transition: transform .15s; }
.pb-group.open .pb-chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .pb-group-head .pb-chev { transition: none; } }
.pb-group-body { padding: 0 18px 16px 48px; display: flex; flex-direction: column; gap: 10px; font-size: .88rem; }
.pb-line { display: flex; align-items: center; gap: 10px; }
.pb-line > span { flex: 1 1 auto; min-width: 0; }
.pb-line small { color: var(--hb-muted); }
.pb-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pb-presets .e-btn { border-radius: 0; margin: 0 !important; }
.pb-presets .e-btn:first-child { border-radius: 4px 0 0 4px; }
.pb-presets .e-btn:last-child { border-radius: 0 4px 4px 0; }
.pb-sees { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: .82rem; }
.pb-sees span { display: flex; gap: 6px; align-items: baseline; }
.pb-sees .y i { color: var(--pb-ok); }
.pb-sees .n { color: var(--hb-muted); }
.pb-link-btn { border: 0; background: transparent; color: var(--hb-accent); font: inherit; font-weight: 600; font-size: .82rem; padding: 0; cursor: pointer; text-align: left; }
.pb-link-btn:hover { text-decoration: underline; }

/* ---- The plans list: upcoming services as cards --------------------------- */

.pcards { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pcard { display: flex; align-items: center; gap: 6px; background: var(--hb-card-bg); border: 1px solid var(--hb-border); border-radius: 8px; padding-right: 8px; }
.pcard:hover { border-color: color-mix(in srgb, var(--hb-accent) 45%, var(--hb-border)); }
.pcard.is-live { border-color: var(--pb-live); }
.pcard.is-next { box-shadow: inset 3px 0 0 var(--hb-accent); }
.pcard-open {
    flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 130px; gap: 16px; align-items: center;
    border: 0; background: transparent; color: var(--hb-fg); font: inherit; text-align: left; cursor: pointer; padding: 12px 6px 12px 14px; border-radius: 8px;
}
.pcard-open:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: -2px; }
.pcard-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; border-right: 1px solid var(--hb-border); padding-right: 12px; }
.pcard-date small { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--hb-muted); }
.pcard-date b { font-size: 1.45rem; }
.pcard-date span { font-size: .72rem; color: var(--hb-muted); }
.pcard-date .tm { font-variant-numeric: tabular-nums; color: var(--hb-fg); font-weight: 600; margin-top: 2px; }
.pcard-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pcard-title { font-weight: 600; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard-strip { display: flex; height: 10px; border-radius: 3px; overflow: hidden; gap: 2px; max-width: 520px; }
.pcard-strip > span { display: block; height: 100%; }
.pcard-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--hb-muted); }
.pcard-state { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.pcards .live-dot, .pl-livebanner .live-dot, .pb-acts .live-dot, .pb-tab .live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.pcard-people { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--hb-muted); }
.pb-faces-static { display: inline-flex; }
.pl-tabs { margin: 12px 0 0; padding: 0; border-top: 0; border-bottom: 1px solid var(--hb-border); }
.pl-livebanner {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin: 8px 0; border-radius: 8px;
    background: color-mix(in srgb, var(--pb-live) 9%, transparent); border: 1px solid color-mix(in srgb, var(--pb-live) 30%, transparent);
}
.pl-livebanner .txt { flex: 1 1 240px; min-width: 0; font-size: .9rem; }
.pl-livebanner .txt b { color: var(--pb-live); }
@media (max-width: 991.98px) {
    .pcard-open { grid-template-columns: 54px minmax(0, 1fr); }
    .pcard-state { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .pcard-people { grid-column: 2; flex-direction: row; align-items: center; }
}

/* ---- Run ------------------------------------------------------------------ */

.pb-run { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pb-run-now, .pb-run-list { background: var(--hb-card-bg); border: 1px solid var(--hb-border); border-radius: 8px; }
.pb-run-now { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pb-run-status { display: flex; gap: 6px; flex-wrap: wrap; }
.pb-run-title { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.pb-run-who { display: flex; align-items: center; gap: 8px; color: var(--hb-muted); }
.pb-run-who .seg-stripe { width: 6px; height: 20px; border-radius: 2px; display: inline-block; }
.pb-run-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--hb-muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.pb-run-ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.pb-run-ctl .e-btn { height: 44px; font-size: 1rem; padding: 0 18px; }
.pb-run-ctl .pb-run-next { flex: 1 1 220px; }
.pb-run-src { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 6px; background: var(--hb-hover); font-size: .86rem; }
.pb-run-src > span { flex: 1 1 auto; min-width: 0; }
.pb-run-src > i { color: var(--hb-accent); }
.pb-run-eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--hb-muted); }
.pb-run-end { margin-left: auto; }
.pb-run-nextbox { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-top: 1px solid var(--hb-border); padding-top: 12px; }
.pb-run-nextbox .seg-stripe { width: 6px; height: 30px; border-radius: 3px; display: block; }
.pb-run-nextbox small { display: block; color: var(--hb-muted); font-size: .8rem; }
.pb-run-nextbox .mins { color: var(--hb-muted); font-variant-numeric: tabular-nums; font-size: .86rem; }
.pb-run-sees { padding: 9px 12px; border-top: 1px solid var(--hb-border); color: var(--hb-muted); font-size: .8rem; }
.pb-run-row .tm .late { color: var(--pb-warn); font-weight: 600; }
.pb-run-head, .pb-run-row { display: grid; grid-template-columns: 6px minmax(0, 1fr) 56px 64px 34px; gap: 10px; align-items: center; padding: 6px 12px; }
.pb-run-head { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--hb-muted); border-bottom: 1px solid var(--hb-border); padding-top: 10px; }
.pb-run-head span:nth-child(3), .pb-run-head span:nth-child(4) { text-align: right; }
.pb-run-row .seg-stripe { width: 6px; height: 26px; border-radius: 3px; display: block; }
.pb-run-row .nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; font-weight: 500; }
.pb-run-row .nm small { color: var(--hb-muted); font-size: .76rem; font-weight: 400; }
.pb-run-row .tm { text-align: right; font-variant-numeric: tabular-nums; font-size: .86rem; }
.pb-run-row .tm.now { color: var(--hb-muted); }
.pb-run-row.done { color: var(--hb-muted); }
.pb-run-row.done .seg-stripe { opacity: .4; }
.pb-run-row.done .tm.now i { color: var(--pb-ok); }
.pb-run-row.now { background: color-mix(in srgb, var(--pb-live) 10%, transparent); }
.pb-run-row.now .nm { color: var(--pb-live); font-weight: 700; }
.pb-run-row.now .tm.now { color: var(--pb-live); font-weight: 700; }
.pb-run-row.end { color: var(--hb-muted); }
@media (max-width: 991.98px) { .pb-run { grid-template-columns: minmax(0, 1fr); } }

/* ---- One segment at a time: the list and the panel ------------------------ */

.pb-split { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; margin-top: 10px; }
.pb-list { min-width: 0; display: flex; flex-direction: column; }
.pb-insert { position: relative; height: 10px; }
.pb-segs-head { padding-top: 8px; }
/* Every row is its own grid, so the icons get a fixed width: left "auto", a row's name moved with how many icons it had. */
.pb-seg {
    display: grid; grid-template-columns: 12px 44px 6px minmax(0, 1fr) minmax(0, 170px) 124px 54px; gap: 10px; align-items: center;
    padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; color: var(--hb-fg);
}
.pb-seg:hover { background: var(--hb-hover); }
.pb-seg:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
.pb-seg.sel { background: var(--hb-active-bg); border-color: var(--hb-accent); }
.pb-seg.is-live { box-shadow: inset 3px 0 0 var(--hb-accent); }
.pb-seg .t { color: var(--hb-muted); font-variant-numeric: tabular-nums; font-size: .88rem; display: flex; flex-direction: column; gap: 2px; }
.pb-seg .seg-stripe { width: 6px; height: 32px; border-radius: 3px; display: block; }
.pb-seg .ttl { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pb-seg .ttl b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-seg .ttl small { color: var(--hb-muted); font-size: .76rem; }
.pb-seg .who-inline { display: none; }
.pb-seg .who { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-seg .who.none { color: var(--pb-warn); font-style: italic; }
.pb-seg .gl { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 9px; align-items: center; color: var(--hb-accent); font-size: .8rem; }
.pb-seg .gl span { display: inline-flex; gap: 2px; align-items: center; font-weight: 700; font-size: .72rem; }
.pb-seg .gl .w { color: var(--pb-warn); }
.pb-seg .mins { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pb-seg .mins small { font-weight: 400; color: var(--hb-muted); }
.pb-seg-end { display: grid; grid-template-columns: 12px 44px 1fr; gap: 10px; padding: 2px 10px 6px; color: var(--hb-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pb-kbd-hint { padding: 2px 10px 8px; font-size: .74rem; color: var(--hb-muted); }
.pb-kbd-hint kbd { font: inherit; font-size: .68rem; border: 1px solid var(--hb-border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; margin: 0 1px; background: var(--hb-card-bg); color: var(--hb-fg); }
@media (hover: none) { .pb-kbd-hint { display: none; } }

/* Drag to reorder (js/plan-builder.js). The handle takes the gesture, so a finger drags it rather than scrolling the page. */
[data-sort-handle] { cursor: grab; touch-action: none; color: var(--hb-muted); opacity: .55; display: inline-flex; justify-content: center; font-size: .78rem; }
[data-sort-row]:hover [data-sort-handle], [data-sort-handle]:focus { opacity: 1; }
.hbs-drag { position: relative; z-index: 5; background: var(--hb-card-bg) !important; box-shadow: 0 6px 18px rgba(0,0,0,.22); opacity: .96; }
.hbs-drag [data-sort-handle] { cursor: grabbing; }
.hbs-before { box-shadow: inset 0 2px 0 var(--hb-accent); }
.hbs-after { box-shadow: inset 0 -2px 0 var(--hb-accent); }
@media (prefers-reduced-motion: no-preference) { [data-sort-row] { transition: box-shadow .1s; } }

/* On screen: one ordered list; the first row is the one the live highlight follows. */
.pb-att { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pb-att-row { display: grid; grid-template-columns: 12px 16px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 6px 5px 8px; border: 1px solid var(--hb-border); border-radius: 6px; background: var(--hb-card-bg); }
.pb-att-row.empty { border-style: dashed; }
.pb-att-ki { color: var(--hb-muted); text-align: center; font-size: .82rem; }
.pb-att-main { border: 0; background: transparent; color: var(--hb-fg); font: inherit; text-align: left; cursor: pointer; padding: 0; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pb-att-main b { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-att-main small { color: var(--hb-muted); font-size: .76rem; }
.pb-att-main small.w { color: var(--pb-warn); }
.pb-att-main small.w i { margin-right: 4px; }
.pb-att-main:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 2px; border-radius: 3px; }
.pb-att-first { font-size: .68rem; font-weight: 700; color: var(--hb-accent); white-space: nowrap; }
.pb-att-edit { padding: 8px 8px 10px 36px; border: 1px solid var(--hb-border); border-top: 0; border-radius: 0 0 6px 6px; margin-top: -5px; display: flex; flex-direction: column; gap: 8px; }
.pb-att-updown { display: flex; gap: 4px; }
.hbm-warnline { color: var(--pb-warn); }
.hbm-warnline .hbm-ico { color: var(--pb-warn); margin-top: 0; }
.pb-chip-av { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .56rem; font-weight: 700; color: #fff; background: var(--hb-accent); margin-right: 5px; }
.pb-chip.on.e-btn { border-color: var(--hb-accent); background: var(--hb-active-bg); }

.pb-panel {
    position: sticky; top: calc(var(--hb-appbar-h, 56px) + 12px);
    max-height: calc(100vh - var(--hb-appbar-h, 56px) - 24px); overflow-y: auto;
    border: 1px solid var(--hb-border); border-radius: 8px; background: var(--hb-card-bg);
}
.pb-panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--hb-border); position: sticky; top: 0; background: var(--hb-card-bg); z-index: 2; }
.pb-panel-h .seg-stripe { width: 6px; height: 38px; border-radius: 3px; display: block; flex: none; }
.pb-panel-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.3; }
.pb-panel-title b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-panel-title small { color: var(--hb-muted); font-size: .78rem; }
.pb-panel-btns { display: flex; gap: 4px; flex: none; }
.pb-psec { padding: 12px 14px; border-bottom: 1px solid var(--hb-border); display: flex; flex-direction: column; gap: 8px; }
.pb-psec:last-child { border-bottom: 0; }
.pb-psec h5 {
    margin: 0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--hb-muted);
    display: flex; align-items: center; gap: 8px;
}
.pb-h-act { margin-left: auto; text-transform: none; letter-spacing: 0; }
.pb-lbl { display: block; font-size: .74rem; font-weight: 600; color: var(--hb-muted); margin-bottom: 3px; }
.pb-basics { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; }
.pb-basics .pb-span2 { grid-column: 1 / -1; }
.pb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pb-chip.e-btn { border-radius: 99px; font-weight: 500; }
.pb-chip.e-btn small { color: var(--hb-muted); margin-left: 4px; }
.pb-note { background: var(--hb-hover); border: 1px solid var(--hb-border); border-radius: 6px; padding: 8px 10px; font-size: .86rem; max-height: 160px; overflow: auto; }
.pb-note p:last-child { margin-bottom: 0; }
.pb-note.team { border-left: 3px solid var(--hb-accent); }
.pb-note.team > small { display: block; font-weight: 700; color: var(--hb-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.pb-files { font-size: .8rem; color: var(--hb-muted); margin-top: 4px; }
.pb-rule { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.pb-rule > i { margin-top: 3px; color: var(--hb-muted); text-align: center; }
.pb-rule.on > i { color: var(--hb-accent); }
.pb-rule b { display: block; font-weight: 600; font-size: .88rem; }
.pb-rule small { color: var(--hb-muted); font-size: .78rem; }
/* The pickers moved in from the old second row: one column inside the panel. */
.pb-panel .plan-links { flex-direction: column; align-items: stretch; gap: 10px; }
.pb-panel .plan-link-field { min-width: 0; flex: 1 1 auto; }

@media (max-width: 1299.98px) { .pb-split { grid-template-columns: minmax(0, 1fr) 380px; } .pb-seg { grid-template-columns: 12px 44px 6px minmax(0, 1fr) 124px 50px; } .pb-seg .who { display: none; } .pb-seg .who-inline { display: inline; } }
@media (max-width: 991.98px) {
    .pb-split { grid-template-columns: minmax(0, 1fr); }
    .pb-panel { position: static; max-height: none; }
}

@media (max-width: 767.98px) {
    .pb-acts { justify-content: flex-start; margin-left: 0; }
    .pb-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pb-presets .e-btn { border-radius: 4px !important; }
    .pb-sees { grid-template-columns: 1fr; }
}
