/* Shared DatuMeter shell. Keep header geometry identical across public and reporting pages. */

/* Reserve the scrollbar width on every page so the centered shell does not shift horizontally. */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
body {
  width: 100%;
}
:root {
  --dm-shell-width: 1240px;
  --dm-shell-gutter: 28px;
  --dm-header-height: 76px;
  --dm-logo-width: 245px;
  --dm-header-line: #e5edf6;
  --dm-header-shadow: 0 2px 12px rgba(8, 36, 82, .05);
}
.site-header {
  position: relative;
  top: auto;
  z-index: 20;
  width: 100%;
  height: auto !important;
  min-height: var(--dm-header-height) !important;
  display: flex !important;
  align-items: center !important;
  background: #fff !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--dm-header-line) !important;
  box-shadow: var(--dm-header-shadow) !important;
  backdrop-filter: none !important;
}
.site-header-inner,
.header-inner {
  width: min(var(--dm-shell-width), calc(100% - (var(--dm-shell-gutter) * 2))) !important;
  max-width: var(--dm-shell-width) !important;
  min-height: var(--dm-header-height) !important;
  margin: 0 auto !important;
  padding: 10px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 28px !important;
}
.site-header .brand,
.site-header > .site-header-inner > a:first-child,
.site-header > .header-inner > a:first-child {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  min-width: 0;
}
.site-header .site-logo,
.site-header .brand img {
  display: block !important;
  width: var(--dm-logo-width) !important;
  max-width: var(--dm-logo-width) !important;
  height: auto !important;
  max-height: 56px !important;
  object-fit: contain !important;
  object-position: left center !important;
  filter: none !important;
  background: transparent !important;
}
.header-actions,
.site-nav { align-items: center !important; }
.header-link { min-height: 38px; }
@media (max-width: 760px) {
  :root {
    --dm-shell-gutter: 18px;
    --dm-header-height: 68px;
    --dm-logo-width: 210px;
  }
  .site-header-inner,
  .header-inner {
    gap: 12px !important;
    padding: 8px 0 !important;
  }
  .site-header .site-logo,
  .site-header .brand img {
    max-width: min(var(--dm-logo-width), 54vw) !important;
    max-height: 48px !important;
  }
}
@media print {
  .skip-link { display: none !important; }
  /*
   * Report pages provide their own compact print-only header. The shared
   * website shell must be removed from print/PDF output so the logo is not
   * duplicated and the report content begins at the correct position.
   */
  .site-header {
    display: none !important;
  }

  .site-header-inner,
  .header-inner {
    width: 100% !important;
    max-width: none !important;
  }
}

/* Phase 2 shared application shell */
.header-actions,
.site-nav,
.nav {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
.header-link,
.site-nav a,
.nav a {
  white-space: nowrap;
}
.portal-footer,
.editor-footer,
.footer {
  width: min(var(--dm-shell-width), calc(100% - (var(--dm-shell-gutter) * 2))) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  color: #5b6f91;
  font-size: 12px;
  text-align: center;
}
.dm-table-scroll,
.table-shell,
.editor-table-wrap {
  max-width: 100%;
  overflow-x: auto !important;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
body.dm-modal-open { overflow: hidden !important; }
.dm-modal[hidden] { display: none !important; }
.dm-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 24, 60, .72);
}
.dm-modal-dialog {
  width: min(900px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #c7d8eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 20, 60, .36);
}
.dm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid #dbe5f1;
}
.dm-modal-head h2 { margin: 0 0 4px; }
.dm-modal-head p { margin: 0; color: #5b6f91; font-size: 13px; }
.dm-modal-body { min-height: 0; overflow: auto; padding: 22px; }
.dm-modal-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid #c7d8eb;
  border-radius: 9px;
  background: #fff;
  color: #425b7b;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 760px) {
  .site-header-inner,
  .header-inner,
  .top-inner {
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
  }
  .header-right {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .header-copy { display: none !important; }
  .header-actions,
  .site-nav,
  .nav {
    gap: 7px !important;
  }
  .header-link,
  .site-nav a,
  .nav a {
    min-height: 36px !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
  .dm-modal { padding: 8px; }
  .dm-modal-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .dm-modal-head, .dm-modal-body { padding: 16px; }
}

/* Phase 7 accessibility and interaction hardening */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(20, 125, 245, .4);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.inline-pdf-form{display:inline-flex;margin:0}.inline-pdf-form button{font:inherit}


/* Post-audit Phase 4: accessibility hardening */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  color: #07275f;
  border: 2px solid #147df5;
  box-shadow: 0 8px 24px rgba(7, 39, 95, .22);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
[aria-busy="true"] { cursor: progress; }
