/* Make room for document comparison without changing the business workflow. */
#sidebar-toggle[hidden] { display:none; }
#sidebar-toggle { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:9px; flex-shrink:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
#sidebar-toggle:hover { border:0; background:transparent; box-shadow:none; color:#0b1b30; }
#sidebar-toggle svg { display:block; flex-shrink:0; }
#sidebar-toggle[aria-expanded=true] .sidebar-icon-expand,
#sidebar-toggle[aria-expanded=false] .sidebar-icon-collapse { display:none; }
#sidebar-toggle:focus-visible { outline:3px solid #54769f; outline-offset:3px; }
.shell > div { min-width:0; }
.shell > div > header { position:sticky; top:0; z-index:20; }
html { scroll-padding-top:calc(var(--app-header-height, 84px) + 16px); }
#workspace-sidebar .nav, .mobile-menu .menu-panel a { display:flex; align-items:center; gap:10px; }
.menu-icon { display:block; flex:none; }
@media(max-width:1179px) { #sidebar-toggle { display:none; } }
@media(min-width:1180px) {
  .shell.sidebar-collapsed { grid-template-columns:76px minmax(0,1fr); }
  .sidebar-collapsed > #workspace-sidebar { padding:30px 10px; }
  .sidebar-collapsed #workspace-sidebar .brand { justify-content:center; padding-bottom:20px; margin-bottom:20px; }
  .sidebar-collapsed #workspace-sidebar .brand-name,
  .sidebar-collapsed #workspace-sidebar .navlabel,
  .sidebar-collapsed #workspace-sidebar .nav-text,
  .sidebar-collapsed #workspace-sidebar .asidebottom { display:none; }
  .sidebar-collapsed #workspace-sidebar .nav { justify-content:center; min-height:48px; padding:12px; margin:6px 0; }
  .shell header { flex-wrap:wrap; gap:10px; height:auto; min-height:75px; padding-top:12px; padding-bottom:12px; }
  .shell:has(#workspace-sidebar) header { padding-left:35px; }
  #sidebar-toggle { position:absolute; left:0; top:50%; transform:translate(-50%,-50%); z-index:2; }
  .shell header .crumb { flex:1; min-width:160px; }
}
#review-source-dialog { width:min(1240px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); }
#review-source-dialog .source-dialog-body { padding:16px 20px; }
.source-comparison { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(280px,1fr); gap:20px; align-items:start; }
.source-comparison > section { min-width:0; }
.source-comparison h3 { margin:0 0 12px; color:var(--navy); font-size:16px; }
.source-editor { background:#f6f3ed; border:1px solid var(--line); border-radius:10px; padding:16px; }
.source-value-caption { font-size:13px; font-weight:600; color:var(--muted); margin:0 0 6px; }
.source-saved-value { white-space:pre-wrap; overflow-wrap:anywhere; font-size:26px; line-height:1.65; margin:0 0 16px; padding:10px 12px; background:#fffefa; border-radius:6px; }
.source-editor label { display:block; margin-bottom:6px; font-weight:600; }
.source-editor input, .source-editor textarea { width:100%; box-sizing:border-box; }
#source-value-input { font-size:26px; line-height:1.65; padding:10px 12px; border:2px solid #b69a60; background:#fff; }
#source-value-input:disabled { color:var(--ink); background:#eeede8; opacity:1; }
#source-edit-status { font-size:13px; line-height:1.7; }
.source-editor .select-widget { max-width:100%; width:100%; }
.source-editor .source-editor-reasons[hidden], #source-page-number-link[hidden], #source-save[hidden] { display:none; }
.source-editor .actions { margin-top:14px; }
#review-source-dialog #source-preview { max-height:55vh; }
#review-source-dialog .source-dialog-head { position:sticky; top:0; background:#fffefa; z-index:2; }
@media(max-width:800px) {
  .source-comparison { grid-template-columns:minmax(0,1fr); gap:16px; }
  #review-source-dialog .source-dialog-body { padding:14px; }
  #review-source-dialog #source-preview { max-height:32vh; }
  .source-saved-value, #source-value-input { font-size:24px; }
}

/* Keep enlarged original-comparison text inside a single-line control. */
input#source-value-input { height:var(--button-height,36px); min-height:var(--button-height,36px); padding:2px 12px; font-size:24px; line-height:1.1; }

/* Environment banner: shown on every screen except production, to every role.
   It is sticky above the header so it cannot be scrolled out of sight, and the
   header and sidebar offset by its height so nothing hides behind it. */
.environment-banner { position:sticky; top:0; z-index:30; padding:6px 20px; text-align:center;
  font-size:13px; font-weight:700; letter-spacing:.4px; color:#fff; }
.environment-banner.environment-staging { background:#17436b; }
.environment-banner.environment-development { background:#8a6416; }
body { --environment-banner-height:0px; }
body.has-environment-banner { --environment-banner-height:33px; }
.has-environment-banner aside { top:var(--environment-banner-height); height:calc(100vh - var(--environment-banner-height)); }
.has-environment-banner .shell > div > header { top:var(--environment-banner-height); }
/* The header pill is empty on most screens now. */
.demo:empty { display:none; }

/* Sidebar footer: who is signed in, then a build line only support needs. */
.asidebottom-identity { display:flex; flex-direction:column; gap:2px; margin:0; min-width:0; }
.asidebottom-name { font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.asidebottom-role { font-size:12px; color:#b6c3d6; }
.asidebottom-build { margin:10px 0 0; font-size:11px; color:#8e9cb5; letter-spacing:.3px; }
