/* Top application menu bar. Native navigation links and disclosure controls. */
/* Companion sidebar: the compact rail keeps every destination accessible. */
.rail-workspace { margin-top:24px; border:1px solid var(--pv-border); border-radius:16px; background:var(--pv-surface); }
.rail-header { display:flex; align-items:center; gap:16px; min-height:72px; padding:12px; border-bottom:1px solid var(--pv-border); }
.rail-header img { width:80px; height:auto; }
.rail-header > span { margin-left:auto; font-size:12px; }
.rail-toggle { flex:none; width:44px; height:44px; border:1px solid var(--pv-control); background:var(--pv-muted); color:var(--pv-heading); border-radius:50%; }
.rail-body { display:grid; grid-template-columns:var(--pv-sidebar-width) minmax(0,1fr); }
.rail-workspace[data-collapsed="true"] .rail-body { grid-template-columns:var(--pv-sidebar-collapsed-width) minmax(0,1fr); }
.rail-navigation { display:flex; flex-direction:column; gap:8px; padding:12px; border-right:1px solid var(--pv-border); }
.rail-navigation a { position:relative; display:flex; align-items:center; gap:12px; min-height:44px; padding:12px; color:var(--pv-text); border-radius:12px; text-decoration:none; }
.rail-navigation a > svg { flex:none; }
.rail-navigation a:hover { background:var(--pv-muted); }
.rail-navigation a[aria-current="page"] { background:var(--pv-selection-bg); color:var(--pv-selection-fg); box-shadow:inset 3px 0 var(--pv-red); }
.rail-label { overflow-wrap:anywhere; }
.rail-workspace[data-collapsed="true"] .rail-label { display:none; }
.rail-workspace[data-collapsed="true"] .rail-navigation a { justify-content:center; padding:12px 0; }
.rail-tooltip { display:none; position:absolute; z-index:5; left:100%; top:50%; transform:translateY(-50%); padding:8px 12px; width:max-content; max-width:min(180px,calc(100vw - 176px)); background:var(--pv-raised); color:var(--pv-text); border:1px solid var(--pv-border-strong); border-radius:8px; box-shadow:0 4px 12px rgb(36 18 25 / 12%); font-size:12px; line-height:18px; overflow-wrap:anywhere; }
.rail-workspace[data-collapsed="true"] .rail-navigation a:not([data-tooltip-dismissed]):is(:hover,:focus-visible) .rail-tooltip { display:block; }
.rail-content { min-width:0; padding:32px; background:var(--pv-canvas); border-radius:0 0 16px 0; }
.rail-content h4 { margin:8px 0; font-size:24px; line-height:32px; color:var(--pv-heading); }
.rail-document { display:flex; align-items:center; gap:16px; flex-wrap:wrap; padding:20px; margin-top:20px; border:1px solid var(--pv-border); border-radius:12px; background:var(--pv-surface); }
.rail-document .tile-icon { flex:none; margin:0; }
.rail-document > div { flex:1; min-width:0; overflow-wrap:anywhere; }
.rail-document p,.rail-note { font-size:12px; line-height:18px; }
.rail-document p { margin-top:4px; }
.rail-note { margin-top:24px; }
@media(max-width:640px) {
 .rail-header > span { display:none; }
 .rail-content { padding:20px 12px; }
 .rail-content h4 { font-size:20px; line-height:28px; overflow-wrap:anywhere; }
 .rail-document { padding:12px; gap:12px; }
 .rail-document > div { flex-basis:100%; }
 .rail-body { grid-template-columns:minmax(0,1fr); }
 .rail-workspace[data-collapsed="false"] .rail-navigation { width:min(100%,var(--pv-sidebar-width)); border-right:0; }
 .rail-workspace[data-collapsed="false"] .rail-content { border-top:1px solid var(--pv-border); border-radius:0 0 16px 16px; }
}
.top-menu-shell { border:1px solid var(--pv-border); border-radius:16px; background:var(--pv-surface); min-width:0; }
.top-menu-header { display:flex; align-items:center; flex-wrap:wrap; gap:16px; padding:16px 20px; border-bottom:1px solid var(--pv-border); }
.top-menu-header .brand { padding:0; flex:none; }
.top-menu-header .brand img { width:96px; }
.top-menu-workspace { display:grid; gap:2px; min-width:0; flex:1; }
.top-menu-workspace strong { font-size:14px; line-height:20px; font-weight:600; overflow-wrap:anywhere; }
.top-menu-workspace small { color:var(--pv-secondary); font-size:12px; line-height:18px; }
.top-menu-header .button { min-height:40px; }
.top-menu-mobile-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; }
.top-menu-mobile-row > span { color:var(--pv-secondary); font-size:12px; }
.top-menu-nav { padding:10px 12px; }
.top-menu-items { display:flex; align-items:flex-start; flex-wrap:wrap; gap:8px; padding:0; margin:0; list-style:none; }
.top-menu-items > li { min-width:0; }
.top-menu-link,.top-menu-disclosure > summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:10px 16px; border:1px solid transparent; border-radius:10px; color:var(--pv-text); font-size:14px; font-weight:500; line-height:20px; text-decoration:none; cursor:pointer; list-style:none; }
.top-menu-disclosure > summary::-webkit-details-marker { display:none; }
.top-menu-link:hover,.top-menu-disclosure > summary:hover { color:var(--pv-heading); background:var(--pv-muted); text-decoration:none; }
.top-menu-link[aria-current=page] { color:var(--pv-selection-fg); background:var(--pv-selection-bg); box-shadow:inset 0 -2px 0 var(--pv-red); font-weight:600; }
.top-menu-disclosure[open] > summary { color:var(--pv-heading); background:var(--pv-brand-soft); }
.top-menu-disclosure { position:relative; min-width:0; }
.top-menu-chevron { width:16px; height:16px; margin-left:auto; transition:transform .15s; }
.top-menu-disclosure[open] .top-menu-chevron { transform:rotate(180deg); }
.top-menu-dropdown { position:absolute; top:calc(100% + 8px); left:0; z-index:45; width:260px; max-width:calc(100vw - 48px); padding:8px; border:1px solid var(--pv-border); border-radius:14px; background:var(--pv-surface); box-shadow:0 12px 32px #0002; }
.top-menu-dropdown a,.top-menu-dropdown button { display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:10px 12px; border:0; border-radius:8px; color:var(--pv-text); background:transparent; text-align:left; text-decoration:none; font-weight:400; }
.top-menu-dropdown a:hover,.top-menu-dropdown button:not(:disabled):hover { background:var(--pv-muted); color:var(--pv-heading); text-decoration:none; }
.top-menu-dropdown button:disabled { color:var(--pv-secondary); background:var(--pv-muted); cursor:not-allowed; }
.top-menu-dropdown small { margin-left:auto; font-size:11px; white-space:nowrap; }
.top-menu-dropdown hr { margin:8px 4px; }
.top-menu-context { padding:24px; border-top:1px solid var(--pv-border); display:grid; gap:12px; }
.top-menu-context .row { margin-top:8px; }
.top-menu-context h3 { font-size:20px; line-height:28px; }
.top-menu-note { margin-top:20px; }
@media(max-width:760px) {
 .top-menu-header { gap:12px; padding:16px; }
 .top-menu-header > .button { width:100%; justify-content:flex-start; }
 .top-menu-nav { padding:0 12px 12px; }
 .top-menu-items { flex-direction:column; align-items:stretch; }
 .top-menu-link,.top-menu-disclosure > summary { width:100%; }
 .top-menu-dropdown { position:static; margin-top:8px; width:100%; max-width:none; box-shadow:none; }
 .top-menu-context { padding:20px; }
}
@media(prefers-reduced-motion:reduce) { .top-menu-chevron { transition:none; } }

/* Grouped catalogue navigation replaces the flat left sidebar. */
.grouped-catalog .catalog-workspace { margin-left:0; }
.grouped-catalog .catalog-header { position:sticky; top:0; z-index:50; background:var(--pv-surface); border-bottom:1px solid var(--pv-border); }
.grouped-catalog .topbar { position:static; border-bottom:0; max-width:1600px; margin:auto; }
.grouped-catalog .topbar .brand { padding:0; }
.grouped-catalog .topbar .brand img { width:96px; }
.grouped-catalog .topbar-identity { display:flex; align-items:center; gap:16px; min-width:0; }
.grouped-catalog .catalog-title { display:grid; gap:2px; }
.grouped-catalog .catalog-title strong { font-size:14px; line-height:20px; }
.grouped-catalog .catalog-title small { color:var(--pv-secondary); font-size:11px; line-height:16px; }
.catalog-navigation { max-width:1600px; margin:auto; padding:0 28px 12px; }
.catalog-groups { display:flex; align-items:flex-start; flex-wrap:wrap; gap:8px; }
.catalog-group { position:relative; min-width:0; }
.catalog-group > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:42px; padding:10px 14px; border-radius:10px; list-style:none; cursor:pointer; color:var(--pv-secondary); font-size:13px; line-height:20px; font-weight:500; }
.catalog-group > summary::-webkit-details-marker { display:none; }
.catalog-group > summary:hover { background:var(--pv-muted); }
.catalog-group[open] > summary,.catalog-group[data-current] > summary { background:var(--pv-selection-bg); color:var(--pv-selection-fg); }
.catalog-group[data-current] > summary { box-shadow:inset 0 -2px 0 var(--pv-red); }
.catalog-group > summary svg { width:14px; height:14px; }
.catalog-group[open] > summary svg { transform:rotate(180deg); }
.catalog-group-links { position:absolute; top:calc(100% + 8px); left:0; width:300px; max-width:calc(100vw - 48px); max-height:min(440px,calc(100dvh - 180px)); overflow:auto; padding:8px; border:1px solid var(--pv-border); border-radius:14px; background:var(--pv-surface); box-shadow:0 12px 32px #0002; }
.catalog-group:nth-last-child(-n+2) .catalog-group-links { left:auto; right:0; }
.catalog-group-links a { display:block; min-height:44px; padding:10px 12px; border-radius:8px; color:var(--pv-text); text-decoration:none; font-size:13px; line-height:20px; overflow-wrap:anywhere; }
.catalog-group-links a:hover { background:var(--pv-muted); text-decoration:none; }
.catalog-group-links a[aria-current] { background:var(--pv-selection-bg); color:var(--pv-selection-fg); font-weight:600; box-shadow:inset 3px 0 var(--pv-red); }
.catalog-nav-footer { margin:8px 14px 0; display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; color:var(--pv-secondary); font-size:11px; line-height:18px; }
.catalog-nav-footer span:last-child { margin-left:auto; }
.grouped-catalog #main { max-width:1600px; }
html:has(.grouped-catalog) { scroll-padding-top:180px; }
@media(max-width:900px) {
 .grouped-catalog .catalog-header { max-height:85dvh; overflow:auto; }
 .grouped-catalog .topbar { padding:12px 16px; gap:12px; flex-wrap:wrap; }
 .grouped-catalog .topbar-identity { flex:1 1 auto; gap:12px; }
 .grouped-catalog .header-actions { flex:1 1 100%; }
 .grouped-catalog .catalog-search { flex:1; width:auto; }
 .grouped-catalog .catalog-title strong { display:block; }
 .catalog-navigation { padding:0 12px 12px; }
 .catalog-groups { display:grid; grid-template-columns:minmax(0,1fr); }
 .catalog-group-links { position:static; width:100%; max-width:none; max-height:280px; margin-top:6px; box-shadow:none; }
 .catalog-group > summary { min-height:44px; }
 .catalog-nav-footer span:last-child { margin-left:0; }
}
@media print { .grouped-catalog .catalog-header { display:none!important; } }

/* Compact alternative: identity and page destinations share the top row. */
.top-menu-variant-heading { margin:24px 0 12px; font-size:16px; line-height:24px; }
.top-menu-inline .top-menu-header { flex-wrap:nowrap; gap:12px; border-bottom:0; }
.top-menu-inline .top-menu-workspace { flex:0 1 200px; }
.top-menu-inline .top-menu-nav { margin-left:auto; padding:0; }
.top-menu-inline .top-menu-items { flex-wrap:nowrap; gap:4px; }
.top-menu-inline .top-menu-link,.top-menu-inline .top-menu-disclosure > summary { padding:10px 12px; white-space:nowrap; }
.top-menu-inline .top-menu-search { width:40px; height:40px; min-width:40px; padding:10px; }
.top-menu-inline .top-menu-items > li:last-child .top-menu-dropdown { left:auto; right:0; }
@media(max-width:1100px) {
 .top-menu-inline .top-menu-header { flex-wrap:wrap; }
 .top-menu-inline .top-menu-workspace { flex:1; }
 .top-menu-inline .top-menu-mobile-row { padding:0; margin-left:auto; }
 .top-menu-inline .top-menu-mobile-row > span { display:none; }
 .top-menu-inline .top-menu-nav { flex:1 1 100%; order:2; }
 .top-menu-inline .top-menu-items { flex-direction:column; align-items:stretch; }
 .top-menu-inline .top-menu-link,.top-menu-inline .top-menu-disclosure > summary { width:100%; white-space:normal; }
 .top-menu-inline .top-menu-dropdown { position:static; margin-top:8px; width:100%; max-width:none; box-shadow:none; }
 .top-menu-inline .top-menu-search { width:40px; justify-content:center; }
}
@media(max-width:440px) {
 .top-menu-inline .top-menu-header .brand img { width:80px; }
 .top-menu-inline .nav-divider { display:none; }
 .top-menu-inline .top-menu-workspace { flex-basis:calc(100% - 104px); }
}

/* Keep catalogue totals beside component search, without a metadata footer. */
.catalog-match-count { color:var(--pv-secondary); font-size:12px; line-height:18px; white-space:nowrap; flex-shrink:0; }
@media(max-width:640px) {
 .grouped-catalog .header-actions { flex-wrap:wrap; }
 .catalog-match-count { flex-basis:100%; text-align:left; }
}

/* Leading menu variant keeps page destinations beside the workspace identity. */
.top-menu-leading .top-menu-nav { margin-left:0; }
.top-menu-account-actions { display:flex; align-items:center; gap:12px; margin-left:auto; min-width:0; }
.top-menu-account > summary { min-height:44px; padding:4px 8px !important; }
.top-menu-account .avatar { width:32px; height:32px; flex:0 0 32px; font-size:12px; }
.top-menu-account .top-menu-dropdown { left:auto; right:0; }
.top-menu-account-info { display:grid; gap:4px; padding:10px 12px; }
.top-menu-account-info small { margin:0; white-space:normal; color:var(--pv-secondary); }
.top-menu-profile-details { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; margin-bottom:24px; }
.top-menu-profile-details dt { color:var(--pv-secondary); }
.top-menu-profile-details dd { margin:0; overflow-wrap:anywhere; }
.top-menu-dialog-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:24px; }
.top-menu-session-status:not(:empty) { padding:0 24px 20px; color:var(--pv-secondary); }
@media(max-width:1200px) {
 .top-menu-leading .top-menu-header { flex-wrap:wrap; }
 .top-menu-leading .top-menu-workspace { flex:1; }
 .top-menu-leading .top-menu-mobile-row { padding:0; margin-left:auto; }
 .top-menu-leading .top-menu-mobile-row > span { display:none; }
 .top-menu-leading .top-menu-nav { flex:1 1 100%; order:2; }
 .top-menu-leading .top-menu-items { flex-direction:column; align-items:stretch; }
 .top-menu-leading .top-menu-link,.top-menu-leading .top-menu-disclosure > summary { width:100%; white-space:normal; }
 .top-menu-leading .top-menu-dropdown { position:static; width:100%; max-width:none; margin-top:8px; box-shadow:none; }
 .top-menu-leading .top-menu-account .top-menu-dropdown { position:absolute; width:260px; max-width:calc(100vw - 64px); box-shadow:0 12px 32px #0002; }
 .top-menu-account-actions { margin-left:0; }
}
@media(max-width:640px) {
 .top-menu-leading .top-menu-workspace { flex-basis:calc(100% - 132px); }
 .top-menu-leading .nav-divider { display:none; }
 .top-menu-leading .top-menu-mobile-row { margin-left:0; }
 .top-menu-account-actions { margin-left:auto; }
 .top-menu-account-name { display:none; }
}

.sidebar-disclosure > summary { display:flex; align-items:center; gap:10px; min-height:44px; padding:12px 14px; border-radius:12px; cursor:pointer; list-style:none; color:var(--pv-text); }
.sidebar-disclosure > summary::-webkit-details-marker { display:none; }
.sidebar-disclosure > summary:hover { background:var(--pv-muted); }
.sidebar-disclosure:has([aria-current=page]) > summary { color:var(--pv-heading); font-weight:600; }
.sidebar-chevron { width:16px; height:16px; margin-left:auto; transition:transform .15s; }
.sidebar-disclosure[open] .sidebar-chevron { transform:rotate(180deg); }
.sidebar-submenu { display:grid; gap:8px; margin:8px 0 0 24px; padding-left:12px; border-left:1px solid var(--pv-border); }
.sidebar-submenu a { min-height:44px; overflow-wrap:anywhere; }
@media(prefers-reduced-motion:reduce) { .sidebar-chevron { transition:none; } }

/* Component search suggests destinations without filtering the catalogue. */
.catalog-search-container { position:relative; width:260px; min-width:0; }
.grouped-catalog .catalog-search-container .catalog-search { width:100%; }
.catalog-search-results { position:absolute; top:calc(100% + 8px); right:0; z-index:60; width:360px; max-width:calc(100vw - 32px); max-height:340px; overflow:auto; padding:6px; border:1px solid var(--pv-border); border-radius:14px; background:var(--pv-surface); box-shadow:0 12px 32px #0002; }
.catalog-search-results ul { list-style:none; padding:0; margin:0; }
.catalog-search-results [role=option] { display:grid; gap:4px; min-height:48px; padding:10px 12px; border-radius:8px; cursor:pointer; color:var(--pv-text); font-size:14px; line-height:20px; }
.catalog-search-results [role=option] small { color:var(--pv-secondary); font-size:12px; line-height:18px; }
.catalog-search-results [role=option]:hover,.catalog-search-results [aria-selected=true] { background:var(--pv-selection-bg); color:var(--pv-selection-fg); }
.catalog-search-empty { padding:14px; color:var(--pv-secondary); font-size:14px; }
@media(max-width:900px) {
 .catalog-search-container { flex:1; width:auto; }
 .catalog-search-results { position:static; width:100%; max-width:100%; max-height:240px; margin-top:8px; }
 .grouped-catalog .header-actions { align-items:flex-start; }
}

/* Main catalogue: identity and leading group menus on one row, account actions right. */
.grouped-catalog .topbar { max-width:none; gap:20px; padding:16px 24px; flex-wrap:nowrap; position:relative; }
.grouped-catalog .topbar-identity { flex:0 0 auto; gap:12px; }
.grouped-catalog .catalog-title small { display:none; }
.grouped-catalog .catalog-navigation { margin:0; padding:0; flex:0 1 auto; }
.grouped-catalog .catalog-groups { flex-wrap:nowrap; gap:4px; }
.grouped-catalog .catalog-group > summary { padding:10px; white-space:nowrap; min-height:44px; }
.grouped-catalog .header-actions { flex:0 0 auto; margin-left:auto; flex-wrap:nowrap; align-items:center; gap:8px; }
.grouped-catalog .catalog-header .top-menu-account > summary { border-radius:999px; }
.grouped-catalog .catalog-header .top-menu-account .top-menu-dropdown { position:absolute; width:260px; max-width:calc(100vw - 32px); }
#catalog-search-panel { position:absolute; top:calc(100% + 8px); right:24px; width:620px; max-width:calc(100vw - 32px); padding:16px; border:1px solid var(--pv-border); border-radius:16px; background:var(--pv-surface); box-shadow:0 12px 32px #0002; display:flex; align-items:center; gap:16px; }
#catalog-search-panel .catalog-search-container { flex:1; width:auto; }
#catalog-search-panel .catalog-search-results { position:static; width:100%; max-width:none; max-height:280px; margin-top:8px; box-shadow:none; border:0; padding:0; }
#catalog-search-panel:has(.catalog-search-results:not([hidden])) { align-items:flex-start; }
html:has(.grouped-catalog) { scroll-padding-top:112px; }
@media(max-width:1279px) {
 .grouped-catalog .catalog-header { max-height:85dvh; overflow:auto; }
 .grouped-catalog .topbar { flex-wrap:wrap; padding:12px 16px; gap:12px; }
 .grouped-catalog .mobile-toggle { display:inline-flex!important; }
 .grouped-catalog .catalog-navigation { flex:1 1 100%; order:3; }
 .grouped-catalog .catalog-groups { display:grid; grid-template-columns:minmax(0,1fr); }
 .grouped-catalog .catalog-group-links { position:static; width:100%; max-width:none; max-height:280px; margin-top:6px; box-shadow:none; }
 .grouped-catalog .catalog-group > summary { white-space:normal; }
 .grouped-catalog .header-actions { display:contents; }
 .grouped-catalog #catalog-search-toggle { margin-left:auto; }
 #catalog-search-panel { position:static; order:2; width:100%; max-width:none; box-shadow:none; }
 .grouped-catalog .catalog-header .top-menu-account .top-menu-dropdown { position:fixed; right:16px; top:76px; }
}
@media(max-width:640px) {
 .grouped-catalog .catalog-title,.grouped-catalog .topbar-identity > .nav-divider { display:none; }
 .grouped-catalog .topbar .brand img { width:80px; }
 .grouped-catalog .topbar-identity { gap:8px; }
 .grouped-catalog .topbar { gap:8px; }
 #catalog-search-panel { flex-wrap:wrap; gap:8px; padding:12px; }
 #catalog-search-panel .catalog-match-count { flex-basis:100%; }
 #catalog-search-panel .catalog-search-container { flex-basis:100%; }
}


/* Result metadata follows the field, aligned with the results below. */
#catalog-search-panel { width:480px; }
#catalog-search-panel .catalog-match-count { display:block; margin:10px 12px 0; text-align:left; white-space:normal; }
#catalog-search-panel .catalog-search-results { margin-top:6px; }
@media(max-width:1279px) { #catalog-search-panel { width:100%; } }

/* Optional branded sidebar, with colors independent of the surrounding theme. */
.sidebar-burgundy { padding:16px; border-radius:14px; background:var(--pv-burgundy); color:var(--pv-sidebar-on-brand); }
.sidebar-burgundy a,.sidebar-burgundy .sidebar-disclosure > summary { color:var(--pv-sidebar-on-brand); }
.sidebar-burgundy a:hover,.sidebar-burgundy .sidebar-disclosure > summary:hover { background:var(--pv-sidebar-brand-hover); color:var(--pv-white); }
.sidebar-burgundy .sidebar-disclosure:has([aria-current=page]) > summary { color:var(--pv-white); }
.sidebar-burgundy .sidebar-submenu { border-color:var(--pv-sidebar-brand-border); }
.sidebar-burgundy a.selected,.sidebar-burgundy a[aria-current=page] { color:var(--pv-white); background:var(--pv-sidebar-brand-hover); box-shadow:inset 3px 0 var(--pv-sidebar-brand-indicator); }
.sidebar-burgundy :focus-visible { outline-color:var(--pv-sidebar-brand-indicator); }
