:root {
  --accent: #1f3a8a;
  --ink: #172033;
  --muted: #596579;
  --line: #e1e6ee;
  --paper: #fff;
  --bg: #f7f8fb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
button:hover,
.button:hover {
  background: #edf1fa;
  text-decoration: none;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.primary:hover {
  background: #172d70;
  color: white;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #b47d08;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7cfdb;
  border-radius: 7px;
  background: white;
  padding: 11px 13px;
  color: var(--ink);
}
textarea {
  font:
    14px/1.6 ui-monospace,
    Consolas,
    monospace;
  resize: vertical;
}
label {
  display: block;
  font-weight: 600;
}
label input,
label select,
label textarea {
  margin-top: 6px;
}
form > label,
form > .form-grid {
  margin: 18px 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.2;
  letter-spacing: -1.2px;
  margin-bottom: 18px;
}
h2 {
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 19px;
  line-height: 1.4;
}
p {
  margin-bottom: 18px;
}
main {
  max-width: 1184px;
  margin: auto;
  padding: 36px 32px 72px;
  min-height: calc(100vh - 180px);
}
.site-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 15px max(24px, calc((100vw - 1120px) / 2));
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  line-height: 1.2;
  color: var(--ink);
  font-size: 20px;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.6px;
}
.logo {
  background: var(--accent);
  color: white;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 26px;
}
.header-search {
  position: relative;
  margin-left: auto;
  max-width: 370px;
  flex: 1;
}
.header-search input {
  background: var(--bg);
  font-size: 14px;
}
.admin-link {
  font-size: 14px;
  color: var(--muted);
}
.quick-results {
  position: absolute;
  top: 100%;
  margin-top: 5px;
  width: 100%;
  background: white;
  box-shadow: 0 8px 30px #17203320;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.quick-results a {
  display: block;
  padding: 9px;
  font-size: 14px;
}
.quick-results small {
  display: block;
  color: var(--muted);
}
.hero {
  padding: 35px 0 49px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.7px;
  font-weight: 750;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  letter-spacing: -2px;
}
.hero > p:not(.eyebrow) {
  font-size: 18px;
  color: var(--muted);
}
.hero-search {
  display: flex;
  max-width: 620px;
  gap: 10px;
  margin: 25px 0 0;
}
.hero-search input {
  min-width: 0;
  padding: 14px 16px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading > span {
  font-size: 13px;
  color: var(--muted);
}
.department-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.department-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.department-card:hover {
  box-shadow: 0 5px 20px #1720330a;
  transform: translateY(-2px);
  text-decoration: none;
  border-color: #b8c4e1;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 8px;
}
.dept-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eef1fb;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 25px;
}
.badge {
  background: #f0f2f5;
  color: #5c6676;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.active {
  background: #edf2ff;
  color: var(--accent);
}
.department-card h3 {
  margin-bottom: 13px;
}
.counts {
  display: flex;
  gap: 5px 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 12px;
  color: var(--accent);
  margin-top: auto;
  font-weight: 600;
}
.recent {
  margin-top: 38px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.doc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.doc-row:last-child {
  border-bottom: 0;
}
.doc-row:hover {
  background: #fafbfe;
  text-decoration: none;
}
.doc-row strong {
  font-size: 17px;
  color: var(--accent);
}
.doc-row p {
  font-size: 14px;
  color: var(--muted);
  margin: 7px 0;
}
.arrow {
  color: var(--accent);
  font-size: 22px;
}
.meta {
  display: flex;
  gap: 0;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.meta > span + span:before {
  content: "·";
  padding: 0 10px;
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12px;
  margin-bottom: 32px;
  color: var(--muted);
}
.page-heading {
  margin: 30px 0 38px;
}
.page-heading p:not(.eyebrow) {
  color: var(--muted);
}
.department-section {
  margin: 34px 0;
}
.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}
.empty > span {
  font-size: 30px;
  color: #8e9bb0;
}
.empty h3 {
  color: var(--ink);
  margin: 10px 0;
}
.empty p {
  font-size: 14px;
  margin-bottom: 0;
}
.empty .button {
  margin-top: 20px;
}
.doc-heading {
  max-width: 850px;
  margin: 0 0 30px;
}
.doc-heading h1 {
  font-size: clamp(28px, 4vw, 42px);
}
.doc-heading .meta {
  font-size: 14px;
}
.doc-heading > a {
  font-size: 13px;
  display: inline-block;
  margin-top: 12px;
}
.notice {
  background: #fff7e1;
  border: 1px solid #efd899;
  color: #79510b;
  border-radius: 9px;
  padding: 15px 18px;
  font-size: 14px;
  margin: 22px 0;
}
.notice a {
  color: #79510b;
  font-weight: 650;
  margin-left: 8px;
  text-decoration: underline;
}
.confirm {
  background: #fff0b8;
  color: #744600;
  border: 1px solid #e8cb73;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
  white-space: nowrap;
  font-weight: 700;
  box-decoration-break: clone;
}
.reading-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 25px 0;
  gap: 10px;
}
.view-tabs {
  background: #e9edf5;
  padding: 4px;
  border-radius: 9px;
  display: flex;
  gap: 3px;
}
.view-tabs button {
  border: 0;
  background: transparent;
  font-size: 14px;
  padding: 8px 16px;
  min-height: 40px;
  color: var(--muted);
}
.view-tabs button[aria-pressed="true"] {
  background: white;
  color: var(--accent);
  box-shadow: 0 1px 4px #0001;
}
.reading-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 110px;
  font-size: 12px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.toc details {
  border-left: 1px solid var(--line);
  padding: 0 15px;
}
.toc summary {
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding-bottom: 12px;
}
.toc a {
  display: block;
  color: var(--muted);
  padding: 6px 0;
  line-height: 1.45;
}
.toc .level-3 {
  padding-left: 12px;
  font-size: 11px;
}
.prose {
  min-width: 0;
  max-width: 72ch;
  overflow-wrap: anywhere;
}
.prose p {
  margin: 0 0 22px;
}
.prose h1 {
  font-size: 29px;
  margin: 0 0 24px;
}
.prose h2 {
  margin: 40px 0 18px;
  font-size: 24px;
}
.prose h3 {
  margin: 30px 0 14px;
  font-size: 19px;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose li {
  padding-left: 3px;
  margin: 8px 0;
}
.prose ul,
.prose ol {
  padding-left: 25px;
  margin-bottom: 22px;
}
.prose li > ul,
.prose li > ol {
  margin-bottom: 12px;
}
.prose blockquote {
  margin: 20px 0;
  padding: 15px 20px;
  border-left: 3px solid #b3bfe3;
  background: #eef1f8;
  color: #46536b;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}
.prose .sop-figure {
  margin: 24px 0;
}
.prose img.sop-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.prose .sop-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: #46536b;
}
code {
  background: #ebedf3;
  border-radius: 4px;
  padding: 2px 5px;
  font:
    0.88em ui-monospace,
    Consolas,
    monospace;
}
pre {
  padding: 20px;
  background: #192338;
  color: #f0f3fa;
  border-radius: 8px;
  overflow: auto;
  white-space: pre;
}
pre code {
  padding: 0;
  background: none;
}
.table-scroll {
  overflow: auto;
  margin: 24px 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: white;
  min-width: 420px;
}
td,
th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: #eef1f7;
  font-weight: 650;
}
tr:last-child td {
  border-bottom: 0;
}
td {
  min-width: 160px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 34px 0;
}
[id] {
  scroll-margin-top: 110px;
}
.progress-panel {
  position: sticky;
  top: 90px;
  z-index: 5;
  background: white;
  border: 1px solid var(--line);
  padding: 18px 22px;
  border-radius: 10px;
  margin-bottom: 28px;
  box-shadow: 0 4px 12px #17203308;
}
.progress-panel > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.progress-panel p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}
#steps-view {
  max-width: 800px;
  margin: auto;
}
#steps-view h2 {
  font-size: 21px;
  margin: 32px 0 15px;
}
.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: 12px 0;
  cursor: pointer;
  font-weight: 400;
}
.step input {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  accent-color: var(--accent);
  margin: 3px 0 0;
}
.step-number {
  display: block;
  font-size: 11px;
  color: var(--accent);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 5px;
}
.step-content {
  display: block;
  overflow-wrap: anywhere;
}
.step-content ul,
.step-content ol {
  padding-left: 20px;
}
.step.complete {
  background: #edf2fb;
  border-color: #bac8e8;
}
.step.complete .step-number {
  color: var(--muted);
}
.search-result {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.search-result:last-child {
  border-bottom: 0;
}
.search-result h2 {
  font-size: 21px;
  margin-bottom: 10px;
}
.search-result > p:not(.eyebrow) {
  font-size: 14px;
  color: var(--muted);
}
mark {
  background: #fff0b8;
}
.login {
  max-width: 460px;
  margin: 50px auto;
  padding: 35px;
}
.login h1 {
  font-size: 33px;
}
.login > p:not(.eyebrow) {
  color: var(--muted);
}
.login button {
  width: 100%;
}
.admin-row {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.admin-row p {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}
.admin-row + .admin-row:last-child {
  border-bottom: 0;
}
.admin-row + form {
  margin-top: 20px;
}
form[action="/admin/logout"] {
  margin-top: 24px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.preview {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 850px;
  overflow: auto;
}
.preview > h2 {
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.actions {
  display: flex;
  gap: 12px;
  margin: 25px 0;
}
.danger {
  color: #a12b31;
  border-color: #e3b4b7;
  margin: 12px 12px 12px 0;
}
small {
  color: var(--muted);
}
footer {
  max-width: 1120px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1000px) {
  .department-card:nth-child(4),
  .department-card:nth-child(5) {
    min-height: 240px;
  }
}
@media (max-width: 850px) {
  .department-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .reading-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 22px;
  }
  .site-header {
    gap: 20px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  footer {
    margin: 0 24px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 24px 18px 48px;
  }
  .site-header {
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 17px;
  }
  .logo {
    font-size: 21px;
    padding: 5px 11px;
  }
  .brand small {
    font-size: 10px;
  }
  .admin-link {
    margin-left: auto;
    font-size: 12px;
  }
  .header-search {
    order: 3;
    max-width: none;
    flex-basis: 100%;
    margin: 0;
  }
  .header-search input {
    padding: 8px 12px;
    min-height: 38px;
  }
  .hero {
    padding: 23px 0 30px;
    margin-bottom: 26px;
  }
  .hero h1 {
    font-size: 43px;
  }
  .hero > p:not(.eyebrow) {
    font-size: 16px;
  }
  .hero-search {
    gap: 7px;
  }
  .hero-search input {
    font-size: 14px;
    padding: 12px;
  }
  .hero-search button {
    padding: 10px 13px;
    font-size: 14px;
  }
  .department-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .department-card {
    padding: 20px;
  }
  .card-top {
    margin-bottom: 16px;
  }
  .department-card h3 {
    margin-bottom: 10px;
  }
  .counts {
    margin-bottom: 18px;
  }
  .section-heading {
    gap: 12px;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .section-heading > span {
    font-size: 11px;
    white-space: nowrap;
  }
  .doc-row {
    padding: 19px;
  }
  .doc-row strong {
    font-size: 16px;
  }
  .doc-row p {
    font-size: 13px;
  }
  .meta {
    font-size: 11px;
  }
  .reading-layout {
    display: block;
  }
  .toc {
    position: static;
    max-height: none;
    margin: 0 0 27px;
    background: #eef1f7;
    padding: 13px;
    border-radius: 8px;
  }
  .toc details {
    border: 0;
    padding: 0;
  }
  .toc summary {
    padding: 0;
  }
  .toc nav {
    margin-top: 12px;
  }
  .prose {
    font-size: 16px;
  }
  .prose h1 {
    font-size: 25px;
  }
  .prose h2 {
    font-size: 22px;
  }
  .reading-tools button {
    font-size: 12px;
    padding: 8px 12px;
  }
  .view-tabs button {
    padding: 8px 10px;
  }
  .notice {
    font-size: 13px;
  }
  .notice a {
    display: block;
    margin: 5px 0 0;
  }
  .doc-heading .meta {
    font-size: 12px;
  }
  .breadcrumbs {
    margin-bottom: 24px;
    font-size: 11px;
  }
  .progress-panel {
    top: 117px;
    padding: 14px;
  }
  .step {
    padding: 17px 14px;
    gap: 12px;
  }
  .step-content {
    font-size: 15px;
  }
  .progress-panel strong {
    font-size: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .login {
    padding: 25px;
    margin: 20px auto;
  }
  .admin-row {
    padding: 18px;
    align-items: flex-start;
  }
  .admin-row p {
    font-size: 11px;
  }
  .section-heading:has(h1) {
    flex-wrap: wrap;
  }
  .desktop {
    display: none;
  }
  footer {
    margin: 0 18px;
    font-size: 10px;
    gap: 15px;
  }
  [id] {
    scroll-margin-top: 145px;
  }
}
@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }
  .site-header,
  footer,
  .reading-tools,
  .toc,
  .breadcrumbs,
  .doc-heading > a,
  #steps-view {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .document {
    width: 100%;
  }
  .reading-layout,
  #read-view {
    display: block !important;
  }
  .prose {
    max-width: none;
  }
  .doc-heading h1 {
    font-size: 24pt;
  }
  .prose h1 {
    font-size: 20pt;
  }
  .prose h2 {
    break-after: avoid;
  }
  table {
    min-width: 0;
  }
  .table-scroll {
    overflow: visible;
  }
  pre {
    white-space: pre-wrap;
  }
  a {
    color: black;
    text-decoration: underline;
  }
  .notice,
  .confirm {
    background: #fff0b8 !important;
    print-color-adjust: exact;
  }
  .doc-heading {
    margin-bottom: 20px;
  }
  .meta {
    color: #444;
  }
  tr {
    break-inside: avoid;
  }
}
.confirmation-reference {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 14px;
}
.confirmation-reference > p {
  margin: 18px 0;
  overflow-wrap: anywhere;
}

.mermaid-block {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.mermaid-diagram svg {
  max-width: none !important;
}
.workflow-card,
.subsection-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.workflow-link {
  font-weight: 600;
}
@media (max-width: 700px) {
  .site-header {
    flex-wrap: wrap;
  }
}

.staff-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.staff-nav form {
  margin: 0;
}
.staff-panel {
  padding: 20px;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.department-badge {
  background: #e4eafa;
  color: #1f3a8a;
  font-weight: 700;
}
.badge.solved {
  background: #dcfce7;
  color: #166534;
}
.badge.unsolved {
  background: #fef3c7;
  color: #92400e;
}
.feedback-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.timeline {
  padding-left: 24px;
}
.timeline li {
  border-left: 2px solid var(--line);
  padding: 8px 16px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.videos {
  margin-top: 2rem;
  scroll-margin-top: 1rem;
}
.video-card {
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}
.video-card video {
  display: block;
  width: 100%;
  max-height: 75vh;
  background: #111;
  margin: 1rem 0;
}
.video-upload {
  max-width: 48rem;
}
.upload-progress {
  width: 100%;
}
