/* Shared application shell, local pages and progressive disclosure. */
[hidden] { display:none !important; }
:root { --ux-navy:#12354b; --ux-focus:#0060a0; --ux-header-offset:190px; }
body { background:var(--bg); }
button, .btn, input:not([type=checkbox]):not([type=radio]), select { min-height:44px; }
button, .btn { line-height:1.3; }
button.primary, .btn.primary { background:var(--primary); border-color:var(--primary); }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline:3px solid var(--ux-focus); outline-offset:3px; }
input[type=checkbox], input[type=radio] { accent-color:var(--primary); }
.auditIcon { flex:0 0 auto; vertical-align:middle; }
.skipLink { position:fixed; top:8px; left:12px; z-index:10000; padding:12px 18px; border-radius:8px; background:var(--ux-navy); color:#fff; transform:translateY(-160%); }
.skipLink:focus { transform:translateY(0); }
.topbar { background:#fff; backdrop-filter:none; }
.topbar-inner { flex-wrap:wrap; max-width:1380px; }
.topbarBrandSub { max-width:none; white-space:normal; overflow:visible; }
.topbarBrandTitle { font-size:18px; color:var(--ux-navy); }
.topActionGroup { box-shadow:none; background:transparent; border:0; padding:0; }
.topActionGroup--context { max-width:100%; }
.topActionGroup--session { align-items:center; }
.topbarMenu__panel { max-width:min(360px,calc(100vw - 28px)); max-height:min(70dvh,600px); overflow-y:auto; }
.topbarMenu__summary { gap:8px; }
.appNav { width:100%; display:flex; align-items:center; gap:6px; border-top:1px solid var(--border); padding-top:9px; flex-wrap:wrap; }
.appNav__link { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:8px 12px; border-radius:9px; font-size:13px; font-weight:700; color:var(--muted); }
.appNav__link:hover { background:var(--surface2); color:var(--text); }
.appNav__link[aria-current=page] { color:var(--primary); background:#eaf3f9; }
.appNav__mode { margin-left:auto; font-size:12px; color:var(--muted); }
.wrap { max-width:1380px; }
#main-content { scroll-margin-top:var(--ux-header-offset); }
.uxDisclosure { border:1px solid var(--border); border-radius:12px; background:var(--surface); min-width:0; }
.uxDisclosure__summary { min-height:52px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; list-style:none; }
.uxDisclosure__summary::-webkit-details-marker { display:none; }
.uxDisclosure[open] > .uxDisclosure__summary { margin-bottom:0; border-bottom:1px solid var(--border); }
.uxDisclosure__label { display:grid; gap:5px; min-width:0; overflow-wrap:break-word; }
.uxDisclosure__hint { font-size:12px; font-weight:400; color:var(--muted); line-height:1.5; }
.uxDisclosure__summary > .auditIcon { transition:transform .15s; }
.uxDisclosure[open] > .uxDisclosure__summary > .auditIcon { transform:rotate(180deg); }
.uxDisclosure__content { padding:16px; min-width:0; }
.uxDisclosure__content > :first-child { margin-top:0; }
.sectionWorkspace { display:grid; grid-template-columns:224px minmax(0,1fr); gap:24px; align-items:start; }
.sectionWorkspace__sidebar { position:sticky; top:var(--ux-header-offset); min-width:0; max-height:calc(100dvh - var(--ux-header-offset) - 16px); overflow-y:auto; }
.sectionWorkspace__navTitle { padding:4px 12px 12px; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.sectionWorkspace__nav { display:grid; gap:4px; }
.sectionWorkspace__link { width:100%; justify-content:flex-start; background:transparent; border-color:transparent; text-align:left; padding:12px; font-size:13px; border-radius:10px; color:var(--muted); }
.sectionWorkspace__linkLabel { flex:1; }
.sectionWorkspace__link:hover { background:var(--surface2); color:var(--text); }
.sectionWorkspace__link[aria-current=page] { background:#eaf3f9; border-color:#c8deed; color:var(--primary); }
.sectionWorkspace__badge { border-radius:6px; padding:2px 6px; font-size:11px; background:var(--surface); color:var(--text); }
.sectionWorkspace__mobileNav { display:none; }
.sectionWorkspace__body, .sectionWorkspace__pages, .sectionWorkspace__page { min-width:0; }
.sectionWorkspace__page { display:grid; gap:16px; scroll-margin-top:var(--ux-header-offset); }
.sectionWorkspace__intro { padding:2px 0 0; }
.sectionWorkspace__heading { display:flex; align-items:center; gap:10px; font-size:24px; line-height:1.3; color:var(--ux-navy); margin:0; }
.sectionWorkspace__heading:focus { outline:0; }
.sectionWorkspace__intro p { font-size:14px; line-height:1.6; max-width:80ch; margin:8px 0 0; }
.sectionWorkspace__pager { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid var(--border); margin-top:24px; padding-top:16px; }
.sectionWorkspace__page [id] { scroll-margin-top:var(--ux-header-offset); }
.homeWorkspace { display:grid; gap:20px; }
.homeWorkspace__heading { margin:0; font-size:26px; color:var(--ux-navy); }
.homeWorkspace__intro { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.homeWorkspace__tools { display:grid; grid-template-columns:minmax(160px,1fr) minmax(150px,220px); gap:12px; margin:16px 0; }
.homeWorkspace__field { display:grid; gap:6px; font-size:12px; font-weight:700; color:var(--muted); }
.homeWorkspace__audits { display:grid; gap:12px; }
.homeAuditItem { align-items:flex-start; }
.homeAuditItem > :first-child { flex:1 1 360px; min-width:0; }
.homeAuditItem .h3 { overflow-wrap:break-word; }
.homeAuditItem__actions { flex:0 1 400px; justify-content:flex-end; }
.homeAuditItem__actions > .topbarMenu { max-width:100%; }
.homeWorkspace__empty { padding:20px; text-align:center; color:var(--muted); }
@media(max-width:1100px) {
  .topbarBrand { flex-basis:100%; }
  .topActions { flex-basis:100%; justify-content:flex-start; align-items:center; }
  .sectionWorkspace { grid-template-columns:196px minmax(0,1fr); gap:16px; }
}
@media(max-width:920px) {
  :root { --ux-header-offset:20px; }
  /* On field devices, long criterion context must not consume the viewport. */
  .topbar { position:relative; }
  .topbar-inner { gap:10px; }
  .topbarBrand { flex:1 1 100%; }
  .topActions { gap:10px; }
  .topActionGroup { width:auto; }
  .topActionGroup--context { width:100%; }
  .topActionGroup--session { margin-left:auto; }
  .topbarUserBadge { max-width:200px; }
  .appNav__mode { display:none; }
  .sectionWorkspace { grid-template-columns:minmax(0,1fr); gap:18px; }
  .sectionWorkspace { --ux-header-offset:112px; }
  .sectionWorkspace__sidebar { position:sticky; top:0; z-index:15; background:var(--bg); padding:8px 0 12px; border-bottom:1px solid var(--border); max-height:none; overflow:visible; }
  .sectionWorkspace__nav, .sectionWorkspace__navTitle { display:none; }
  .sectionWorkspace__mobileNav { display:grid; gap:8px; font-size:12px; color:var(--muted); font-weight:700; }
  .sectionWorkspace__select { background:var(--surface); color:var(--text); font-weight:700; }
  .sectionWorkspace__heading { font-size:22px; }
}
@media(max-width:600px) {
  .wrap { padding:16px 12px 28px; }
  .topbar-inner { padding:12px; }
  .brandLogo { width:36px; height:36px; border-radius:8px; padding:4px; }
  .topbarBrand { gap:9px; }
  .topbarBrandTitle { font-size:16px; }
  .topbarBrandSub { font-size:12px; }
  .topbarUserBadge { max-width:150px; }
  .topActionGroup--session { flex:1; justify-content:flex-end; }
  .topbarSelect { min-width:65px; flex-basis:65px; }
  .appNav { gap:2px; }
  .appNav__link { padding:8px; font-size:12px; }
  .appNav--context { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  .appNav--context .appNav__link { justify-content:center; flex-direction:column; gap:5px; font-size:11px; text-align:center; line-height:1.3; }
  .topbarMenu__panel .topbarUserBadge { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
  .homeWorkspace__tools { grid-template-columns:minmax(0,1fr); }
  .homeAuditItem__actions { flex:1 1 100%; justify-content:flex-start; }
  .uxDisclosure__summary, .uxDisclosure__content { padding:12px; }
  .sectionWorkspace__pager { gap:8px; }
  .sectionWorkspace__pager button { font-size:12px; padding:9px; }
  .topbarMenu__panel { position:fixed; left:12px; right:12px; bottom:12px; top:auto; width:auto; min-width:0; max-width:none; }
}
@media(prefers-reduced-motion:reduce) { .uxDisclosure__summary > .auditIcon { transition:none; } }
@media print {
  .skipLink, .appNav, .sectionWorkspace__sidebar, .sectionWorkspace__pager { display:none; }
  .sectionWorkspace { display:block; }
}
