/* Shared compact freshness control: same placement and surface on every portal page. */
html body .compact-source-status { position:relative; flex:0 0 40px; min-width:0; color:var(--portal-text, var(--text)); }
html body .compact-source-status[hidden] { display:none !important; }
html body .compact-source-status > summary { box-sizing:border-box; position:relative; display:flex; align-items:center; justify-content:center; width:40px; height:48px; min-height:48px; padding:8px; list-style:none; cursor:pointer; border:1px solid var(--portal-line, var(--border)); border-radius:6px; background:var(--portal-surface, var(--surface)); color:var(--portal-text, var(--text)); }
html body .compact-source-status > summary::-webkit-details-marker { display:none; }
html body .compact-source-status > summary::marker { content:''; }
html body .compact-source-status summary svg { width:22px; height:22px; flex:none; }
html body .compact-source-dot { position:absolute; width:7px; height:7px; right:4px; bottom:4px; border-radius:50%; background:var(--portal-muted, var(--muted)); }
html body .compact-source-status[data-status="current"] .compact-source-dot { background:var(--portal-accent, var(--accent)); }
html body .compact-source-status:is([data-status="updating"],[data-status="warning"]) .compact-source-dot { background:var(--portal-warning, var(--page-warning, #e1a21a)); }
html body .compact-source-status[data-status="error"] .compact-source-dot { background:var(--portal-danger, var(--page-danger, #b54742)); }
html body .compact-source-popup { box-sizing:border-box; position:absolute; z-index:70; right:0; top:calc(100% + 8px); width:min(340px, calc(100vw - 24px)); max-height:min(400px, 60dvh); overflow:auto; padding:16px; border:1px solid var(--portal-line, var(--border)); border-radius:6px; background:var(--portal-surface, var(--surface)); color:var(--portal-text, var(--text)); box-shadow:0 8px 24px #0002; font:13px/1.5 ui-sans-serif, system-ui, sans-serif; overflow-wrap:anywhere; }
html body .compact-source-popup #updated-at { display:flex !important; padding:4px 4px 4px 5px; min-height:0; overflow:visible; font-size:13px; }
html body .compact-source-popup .toolbar-updated-at-text { display:block; overflow:visible; -webkit-line-clamp:unset; }
html body .compact-source-details { margin:8px 0 0; font-size:12px; line-height:1.5; white-space:pre-line; overflow-wrap:anywhere; color:var(--portal-muted, var(--muted)); }
html body .compact-source-popup #updated-at.is-empty::before { background:var(--portal-muted); box-shadow:none; animation:none; }

/* Canonical portal header. Left: brand/menu. Right: workspace/data/messages/account.
   Only the space between the two groups grows; controls never use space-between. */
/* Shared brand scale: 11px × 1.3, aligned with the portal title on every page. */
html body :is(#app-shell .topbar, .portal-header) :is(.page-heading > .eyebrow, .portal-brand > small) {
 font:700 14.3px/19px Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 margin:0 0 5px; padding:0; text-indent:0; text-align:left;
 letter-spacing:.08em; text-transform:uppercase; color:#426c9a;
}
html body :is(#app-shell .topbar, .portal-header) :is(.page-heading > h1, .portal-brand > strong) {
 font:700 22px/27.5px Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 margin:0 0 6px; padding:0; text-indent:0; text-align:left;
 letter-spacing:-.035em; color:#102a4b;
}
html[data-theme="dark"] body :is(#app-shell .topbar, .portal-header) :is(.page-heading > .eyebrow, .portal-brand > small) {color:#a6bdd5;}
html[data-theme="dark"] body :is(#app-shell .topbar, .portal-header) :is(.page-heading > h1, .portal-brand > strong) {color:#f0f2f4;}
/* All shell pages place the canonical header at the same page edges. */
html body #app-shell:has(> .portal-standard-header) {padding-top:10px;padding-left:10px;padding-right:10px;}
html body :is(#app-shell .topbar, .portal-header).portal-standard-header {
 --portal-surface:#fff; --portal-text:#1f2d3d; --portal-muted:#6b7789;
 --portal-line:#e2e7ec; --portal-accent:#236458;
 background:#f4f6f8;
 display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-start;
 gap:10px; min-width:0; position:relative;
}
html[data-theme="dark"] body :is(#app-shell .topbar, .portal-header).portal-standard-header {
 --portal-surface:#20262d; --portal-text:#e7edf3; --portal-muted:#b1bfcd;
 --portal-line:#46515d; --portal-accent:#88ccbc;
 background:#17191b;
}
/* The standalone pages use the same brand geometry as the Summary header. */
html body .portal-header.portal-standard-header {
 padding:10px 10px 20px;
 font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
html body .portal-header.portal-standard-header .portal-brand { gap:0; }
html body #app-shell .portal-standard-header :is(.topbar-panel, .toolbar) { display:contents; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header > :is(.page-heading, .portal-brand) { flex:0 0 180px; min-width:0; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header :is(#table-mode-selector, [data-portal-navigation]) { flex:0 1 240px; width:240px; min-width:0; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header :is(.toolbar-actions, .portal-header-actions) {
 display:flex; flex:0 0 auto; flex-wrap:nowrap; align-items:center; justify-content:flex-start;
 gap:8px; width:auto; min-width:0; margin-left:auto; position:static;
}
html body :is(#app-shell .topbar, .portal-header).portal-standard-header [data-portal-workspace-switcher] { flex:0 0 210px; width:210px; min-width:0; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-navigation { flex-wrap:nowrap; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-navigation > .portal-navigation-button {
 flex:1 1 auto; min-width:0; width:100%; height:48px; min-height:48px; max-height:48px; padding:7px 12px;
}

html body :is(#app-shell .topbar, .portal-header).portal-standard-header [data-portal-global-slot="messages"] { flex:0 0 44px; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-messenger-button { width:44px; height:48px; }
html body .portal-workspace-label-short { display:none; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-workspace-label-full { display:inline; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .compact-source-status { flex:0 0 144px; position:relative; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .compact-source-status > summary { height:48px; min-height:48px; width:144px; gap:8px; justify-content:flex-start; padding:8px 12px; }
html body .compact-source-copy { display:block; min-width:0; text-align:left; }
html body .compact-source-copy strong { display:block; font:600 14px/1.25 system-ui,sans-serif; }
html body .compact-source-copy small { display:block; font:400 11px/1.25 system-ui,sans-serif; white-space:nowrap; }
html body :is(#app-shell .topbar, .portal-header).portal-standard-header .compact-source-status.has-refresh-action > summary { background:#236458; color:#fff; border-color:#236458; }
html body .portal-standard-header .compact-source-status.has-refresh-action > summary .compact-source-copy :is(strong,small) {color:inherit;}
html body .compact-source-warning { display:none; }
html body .compact-source-status:is([data-status="warning"],[data-status="error"]) .compact-source-warning { display:block; }
html body .compact-source-status:is([data-status="warning"],[data-status="error"]) .compact-source-icon { display:none; }
html body .compact-source-popup { left:0; right:auto; }
html body .compact-source-actions { margin-top:12px; }
html body .compact-source-actions:has(> [hidden]) { display:none; }
html body .compact-source-actions :is(#sync-button, [data-portal-sync]) { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:44px; padding:8px 12px; border:1px solid #236458; border-radius:6px; background:#236458; color:white; font:600 14px/1.25 system-ui,sans-serif; cursor:pointer; }
html body .compact-source-actions :is(#sync-button, [data-portal-sync]) svg { width:22px; height:22px; }
html body .compact-source-actions #sync-button-label { display:inline; }
html body #sync-button[hidden], html body [data-portal-sync][hidden] { display:none!important; }
html body .compact-source-status[data-status="updating"] > summary::after { content:''; position:absolute; bottom:0; left:0; width:100%; height:3px; background:var(--portal-warning, var(--page-warning, #e1a21a)); }
@media(max-width:1200px) {
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header > :is(.page-heading, .portal-brand) { flex-basis:165px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header :is(#table-mode-selector, [data-portal-navigation]) { flex-basis:210px; width:210px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header [data-portal-workspace-switcher] { flex-basis:180px; width:180px; }

 html body :is(#app-shell .topbar, .portal-header).portal-standard-header { gap:8px; }
}
@media(max-width:1000px) {
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header > :is(.page-heading, .portal-brand) { flex-basis:155px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header [data-portal-workspace-switcher] { flex-basis:150px; width:150px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .compact-source-status { flex-basis:44px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .compact-source-status > summary { width:44px; justify-content:center; padding:8px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .compact-source-copy { display:none; }
}
@media(max-width:780px) {
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header > :is(.page-heading, .portal-brand) { display:none; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-workspace-label-full { display:none; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-workspace-label-short { display:inline; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header,
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header :is(.toolbar-actions, .portal-header-actions) { gap:6px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-navigation > .portal-navigation-button { padding:6px 8px; gap:4px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-navigation-chevron { width:18px; height:18px; flex-basis:18px; }
}
@media(max-width:450px) {
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header,
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header :is(.toolbar-actions, .portal-header-actions) { gap:4px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header :is(#table-mode-selector, [data-portal-navigation]) { flex:1 1 0; width:0; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header [data-portal-workspace-switcher] { flex:0 0 96px; width:96px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-navigation > .portal-navigation-button { padding:5px 4px; gap:2px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-navigation-button strong { font-size:12px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-workspace-switcher .portal-navigation-button { position:relative; padding-right:14px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-workspace-switcher .portal-navigation-chevron { position:absolute; right:3px; bottom:10px; }
 html body :is(#app-shell .topbar, .portal-header).portal-standard-header .portal-workspace-switcher .portal-navigation-button small { overflow:visible; }
}
