/* V23 W1 -- PbShell (NAV_POLICY_96). Colours come ONLY from pb-tokens.css (single source).
   Brand + nav are PHYSICALLY LEFT in HE/RTL and EN/LTR (V23_MASTER: "brand and bar left in both directions"). */
html[dir="rtl"] .pb-shell-header .pb-header-row { flex-direction: row-reverse; }
html[dir="rtl"] .pb-shell .pb-space-layout { direction: ltr; }
html[dir="rtl"] .pb-shell .pb-space-layout > * { direction: rtl; }
html[dir="rtl"] .pb-shell .pb-space-sidebar { border-inline-end: 0; border-inline-start: 1px solid var(--pb-divider); padding-inline-end: 0; padding-inline-start: 16px; }

/* focus: brand + contextual back + help only */
.pb-shell-focus { display: flex; align-items: center; gap: 16px; margin-inline-start: auto; min-width: 0; }
html[dir="rtl"] .pb-shell-focus { margin-inline-start: 0; margin-inline-end: auto; }
.pb-shell-focus a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--pb-touch-target, 48px); padding: 0 12px; border-radius: 10px; color: var(--pb-text-primary); font-weight: 600; text-decoration: none; }
.pb-shell-focus a:hover { background: var(--pb-surface-hover); }
.pb-shell-focus a:focus-visible { outline: 3px solid var(--pb-focus); outline-offset: 2px; }
.pb-shell-focus svg { width: 20px; height: 20px; }
.pb-shell-help { color: var(--pb-link) !important; }
.pb-shell--focus .pb-main { padding-bottom: 32px; }

/* workspace: wide work screens use the full container */
@media (min-width: 1200px) { .pb-shell--workspace .pb-main.pb-container { max-width: 1440px; } }

/* screen-state hooks (W2 feeds data-pb-state from the server ScreenState; _UiStates stays the renderer) */
[data-pb-state-region] { min-width: 0; }
[data-pb-state-region][data-pb-state="loading"] { cursor: progress; }
[data-pb-state-region][data-pb-state="loading"] [data-pb-state-content] { opacity: .55; pointer-events: none; }
[data-pb-state-region] [data-pb-state-slot] { display: none; }
[data-pb-state-region][data-pb-state="loading"] [data-pb-state-slot="loading"],
[data-pb-state-region][data-pb-state="empty"] [data-pb-state-slot="empty"],
[data-pb-state-region][data-pb-state="error"] [data-pb-state-slot="error"],
[data-pb-state-region][data-pb-state="stale"] [data-pb-state-slot="stale"],
[data-pb-state-region][data-pb-state="denied"] [data-pb-state-slot="denied"],
[data-pb-state-region][data-pb-state="success"] [data-pb-state-slot="success"] { display: block; }
html, body { overflow-x: clip; }

/* V23 integration -- browse catalog search: one labelled field in the header strip (all widths, tokens only) */
.pb-shell-searchbar { padding-block: 0 10px; }
.pb-shell-searchform { display: flex; align-items: center; gap: 6px; max-width: 640px; margin-inline: auto; min-width: 0; }
.pb-shell-searchform input[type="search"] { flex: 1 1 auto; min-width: 0; height: var(--pb-touch-target, 48px); padding: 0 14px; border: 1px solid var(--pb-divider); border-radius: 22px; background: var(--pb-surface); color: var(--pb-text-primary); font: inherit; }
.pb-shell-searchform input[type="search"]:focus-visible { outline: 3px solid var(--pb-focus); outline-offset: 2px; }
.pb-shell-searchform .pb-btn-icon { flex: 0 0 auto; min-width: var(--pb-touch-target, 48px); min-height: var(--pb-touch-target, 48px); }

/* V23 integration (nav QA): the calendar button INSIDE a date/time field takes keyboard focus but the field stopped
   matching :focus -> no visible ring. :focus-within keeps the ring while focus is anywhere in the field. */
input:is([type="date"], [type="datetime-local"], [type="time"], [type="month"]):focus-within { outline: 2px solid var(--pb-focus); outline-offset: 2px; box-shadow: 0 0 0 1px var(--pb-focus); }

/* V23 integration (nav QA, PBUI-054 EN tablet): a visually-hidden label inside a scrolled table kept its static position
   past the scroller (absolute boxes escape overflow:auto without a positioned ancestor) and widened the page by 15px.
   Anchor it at the start of its containing block: still 1px + clipped, never outside the page. */
.pb-visually-hidden, .pb-sr-only { inset-inline-start: 0; top: 0; }

/* ===== V30 R2 W1 -- sidebar (V32 tokens: 320 open / 80 collapsed; was 192/64), collapse control, drawer <1200, collapsed tooltips, footer brand =====
   SPEC V30_R2_SIMPLE_EXPERIENCE_HE section 1 + 11; V30_HOME_SIDEBAR_SCROLL V30-01/-02/-06/-09. Tokens only (pb-tokens.css:
   --pb-sidebar-expanded 320px / --pb-sidebar-collapsed 80px since V32). ONE threshold for both shells: fixed sidebar at >=1200,
   drawer at <=1199.98 (pb-v26-browse.css + w3-nav.css use the same numbers). Nothing hides overflow or disables zoom. */
.pb-v30-toggle { display: none; width: var(--pb-touch-target, 48px); height: var(--pb-touch-target, 48px); min-width: var(--pb-touch-target, 48px); min-height: var(--pb-touch-target, 48px); padding: 0; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid var(--pb-divider); border-radius: var(--pb-radius-control, 10px); background: var(--pb-surface); color: var(--pb-text-primary); cursor: pointer; }
.pb-v30-toggle svg { width: 20px; height: 20px; }
.pb-v30-toggle:hover { background: var(--pb-surface-hover); }
.pb-v30-toggle:focus-visible { outline: 3px solid var(--pb-focus); outline-offset: 2px; }
/* creator / printer areas first, in both languages */
.pb-v30-areas { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--pb-divider); }
.pb-v30-area { display: flex; align-items: center; gap: 10px; min-height: var(--pb-touch-target, 48px); padding: 0 12px; border-radius: var(--pb-radius-control, 10px); color: var(--pb-text-primary); font-weight: 650; text-decoration: none; }
.pb-v30-area svg { width: 20px; height: 20px; flex: 0 0 auto; }
.pb-v30-area:hover { background: var(--pb-surface-hover); }
.pb-v30-area:focus-visible { outline: 3px solid var(--pb-focus); outline-offset: 2px; }
.pb-v30-area[aria-current="page"] { background: var(--pb-surface-selected); }
/* every sidebar entry: icon + label, 48px touch target (space links were 44) */
.pb-space-link, .pb-space-aux { display: flex; align-items: center; gap: 10px; min-height: var(--pb-touch-target, 48px); }
.pb-space-link svg, .pb-space-aux svg { width: 20px; height: 20px; flex: 0 0 auto; }
.pb-space-toggle, .pb-browse-toggle { min-height: var(--pb-touch-target, 48px); }
/* the collapsed-state tooltip (pb-v30-shell.js): hover AND keyboard focus, Escape hides */
.pb-v30-tip { position: fixed; z-index: 1300; max-width: 240px; padding: 6px 10px; border-radius: var(--pb-radius-control, 10px); background: var(--pb-text-primary); color: var(--pb-surface); font-size: .875rem; line-height: 1.4; transform: translateY(-50%); pointer-events: none; }
.pb-v30-tip[hidden] { display: none; }
main[tabindex="-1"]:focus { outline: none; }
@media (min-width: 1200px) {
    .pb-v30-toggle { display: inline-flex; }
    .pb-shell--focus .pb-v30-toggle { display: none; }
    html[data-pb-sidebar="collapsed"] .pb-space-layout, html[data-pb-sidebar="collapsed"] .pb-browse-layout { grid-template-columns: var(--pb-sidebar-collapsed, 80px) minmax(0, 1fr); }
    html[data-pb-sidebar="collapsed"] .pb-space-sidebar, html[data-pb-sidebar="collapsed"] .pb-browse-sidebar { padding-inline: 0 8px; }
    html[dir="rtl"][data-pb-sidebar="collapsed"] .pb-space-sidebar { padding-inline: 8px 0; }
    html[data-pb-sidebar="collapsed"] .pb-space-title, html[data-pb-sidebar="collapsed"] .pb-space-footer, html[data-pb-sidebar="collapsed"] .pb-space-more,
    html[data-pb-sidebar="collapsed"] .pb-browse-title, html[data-pb-sidebar="collapsed"] .pb-browse-subtitle,
    html[data-pb-sidebar="collapsed"] .pb-space-link span, html[data-pb-sidebar="collapsed"] .pb-space-aux span,
    html[data-pb-sidebar="collapsed"] .pb-browse-link span, html[data-pb-sidebar="collapsed"] .pb-v30-area span { display: none; }
    html[data-pb-sidebar="collapsed"] .pb-space-link, html[data-pb-sidebar="collapsed"] .pb-space-aux,
    html[data-pb-sidebar="collapsed"] .pb-browse-link, html[data-pb-sidebar="collapsed"] .pb-v30-area { justify-content: center; padding: 0; width: var(--pb-touch-target, 48px); height: var(--pb-touch-target, 48px); margin-inline: auto; }
    html[data-pb-sidebar="collapsed"] .pb-space-link svg, html[data-pb-sidebar="collapsed"] .pb-space-aux svg,
    html[data-pb-sidebar="collapsed"] .pb-browse-link svg, html[data-pb-sidebar="collapsed"] .pb-v30-area svg { width: 22px; height: 22px; }
    html[data-pb-sidebar="collapsed"] .pb-space-link-active { border-inline-end: 0; border-inline-start: 0; }
}
@media (max-width: 1199.98px) {
    .pb-v30-toggle { display: none; }
    .pb-v30-tip { display: none; }
}
/* I1 (V30-06): the footer brand = the header's original asset, 28px desktop / 24px mobile, never mirrored or tinted */
.pb-brand--footer .pb-brand__mark { width: 28px; height: 28px; transform: none !important; filter: none !important; }
.pb-footer-rights { unicode-bidi: isolate; }
@media (max-width: 767.98px) {
    .pb-brand--footer .pb-brand__mark { width: 24px; height: 24px; }
}
