:root {
  --navy: #1f2a4f;
  --navy-2: #303a5c;
  --red: #e50941;
  --cyan: #5dcae2;
  --green: #6aa84f;
  --black: #000000;
  --cyan-pale: #edf9fc;
  --red-pale: #fff1f4;
  --green-pale: #f1f7ee;
  --paper: #ffffff;
  --bg: #f4f6f8;
  --line: #d9dee7;
  --muted: #59647e;
  --text: #20263a;
  --shadow: 0 12px 34px rgba(31, 42, 79, 0.1);
  --radius: 18px;
  --sidebar: 310px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
body.large-text { font-size: 18px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--navy); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.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;
  z-index: 100;
  top: 8px;
  left: 12px;
  transform: translateY(-150%);
  background: var(--red);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
}
.skip-link:focus { transform: none; }
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(260px, 760px) auto;
  gap: 24px;
  align-items: center;
  min-height: 84px;
  padding: 12px 26px;
  background: white;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 22px rgba(31,42,79,0.08);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 270px;
  color: var(--navy);
  text-decoration: none;
}
.brand-logo { display: block; width: 178px; height: auto; }
.brand-library {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.16;
  text-transform: uppercase;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.search-box svg {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--navy-2);
  stroke-width: 2;
  stroke-linecap: round;
}
.search-box input {
  width: 100%;
  min-height: 50px;
  padding: 11px 62px 11px 48px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
  color: var(--navy);
  box-shadow: none;
}
.search-box input::placeholder { color: #667085; }
.search-box input:focus { border-color: var(--cyan); background: white; outline: none; box-shadow: 0 0 0 4px rgba(93,202,226,0.18); }
.search-box kbd {
  position: absolute;
  right: 11px;
  padding: 2px 7px;
  color: var(--muted);
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  border-bottom-width: 2px;
  border-radius: 6px;
  font-size: 0.72rem;
}
.text-button, .icon-button { border: 0; cursor: pointer; }
.text-button {
  min-width: 48px;
  min-height: 44px;
  border: 1px solid var(--navy);
  border-radius: 11px;
  background: var(--navy);
  color: white;
  font-weight: 700;
}
.text-button span { font-size: 1.2em; margin-left: 2px; }
.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 10px;
  background: var(--navy);
}
.menu-button span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: white;
}
.status-strip {
  position: sticky;
  z-index: 35;
  top: 84px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 28px;
  background: var(--cyan);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
}
.status-strip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - 116px);
}
.sidebar {
  position: sticky;
  top: 116px;
  align-self: start;
  height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 20px 16px 26px;
  background: white;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 10px 12px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.close-button {
  display: none;
  background: transparent;
  color: var(--navy);
  font-size: 1.8rem;
}
.nav-home, .nav-category summary, .nav-link {
  border-radius: 10px;
  color: var(--navy);
  text-decoration: none;
}
.nav-home {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  font-weight: 800;
}
.nav-home:hover, .nav-home.active { background: var(--cyan-pale); }
.nav-category { margin-top: 7px; }
.nav-category summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.91rem;
  font-weight: 800;
  list-style: none;
}
.nav-category summary::-webkit-details-marker { display: none; }
.nav-category summary::after { content: "+"; color: var(--muted); font-size: 1.15rem; }
.nav-category[open] summary::after { content: "−"; }
.nav-category summary:hover { background: #f5f7fa; }
.nav-category-count { color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.nav-list { display: grid; gap: 2px; padding: 2px 0 6px 12px; }
.nav-link {
  display: block;
  padding: 7px 10px;
  color: var(--navy-2);
  font-size: 0.82rem;
  line-height: 1.32;
}
.nav-link.sop { padding-left: 22px; color: #59647e; }
.nav-link.sop::before { content: "↳ "; color: var(--red); }
.nav-link:hover, .nav-link.active { background: var(--cyan-pale); color: var(--navy); }
.nav-link.active { font-weight: 800; box-shadow: inset 3px 0 var(--red); }
.sidebar-note {
  margin: 22px 8px 4px;
  padding: 15px;
  border-radius: 13px;
  border-left: 4px solid var(--green);
  background: var(--green-pale);
  color: var(--navy-2);
  font-size: 0.78rem;
}
.sidebar-note p { margin: 4px 0 8px; }
.sidebar-note a { font-weight: 800; }
main {
  min-width: 0;
  padding: clamp(24px, 4vw, 58px);
}
#view { max-width: 1240px; margin: 0 auto; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero {
  overflow: hidden;
  position: relative;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 24px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: 42px;
  width: 210px;
  height: 26px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 48px 0 var(--red), 0 96px 0 rgba(255,255,255,0.96);
  opacity: 0.92;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--cyan); }
.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero h1 span { color: var(--cyan); }
.hero p {
  max-width: 680px;
  margin: 22px 0 0;
  color: #e8ecf4;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.hero-stats span {
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.8rem;
  font-weight: 700;
}
.section { margin-top: 42px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; color: var(--navy); font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-head p { margin: 0; color: var(--muted); }
.quick-grid, .category-grid, .result-grid, .related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.quick-card, .category-card, .result-card, .related-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(31,42,79,0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.quick-card:hover, .category-card:hover, .result-card:hover, .related-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: var(--shadow);
}
.quick-card { padding: 22px; }
.quick-card small, .result-card small { color: var(--red); font-weight: 800; }
.quick-card strong { margin-top: 8px; color: var(--navy); font-size: 1.06rem; line-height: 1.28; }
.quick-card span { margin-top: 12px; color: var(--muted); font-size: 0.84rem; }
.category-card {
  min-height: 220px;
  padding: 24px;
  border-top: 7px solid var(--cyan);
}
.category-card:nth-child(2) { border-top-color: var(--red); }
.category-card:nth-child(3) { border-top-color: var(--green); }
.category-card:nth-child(4) { border-top-color: var(--navy); }
.category-card:nth-child(5) { border-top-color: var(--black); }
.category-card .number { color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.category-card h3 { margin: 12px 0 8px; color: var(--navy); font-size: 1.23rem; line-height: 1.25; }
.category-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.category-card .count { margin-top: auto; padding-top: 18px; color: var(--navy); font-size: 0.82rem; font-weight: 800; }
.guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}
.guide article { padding: 24px; background: white; }
.guide b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: white; }
.guide h3 { margin: 13px 0 6px; color: var(--navy); font-size: 1rem; }
.guide p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
}
.breadcrumbs a { color: var(--navy-2); font-weight: 700; text-decoration: none; }
.breadcrumbs span::before { content: "/"; margin-right: 8px; color: #a3aab8; }
.doc-header {
  padding: clamp(24px, 4vw, 42px);
  border-radius: 22px 22px 0 0;
  background: var(--navy);
  color: white;
}
.doc-header .eyebrow { color: var(--cyan); }
.doc-header h1 { max-width: 900px; margin: 0; font-size: clamp(2rem, 4.5vw, 3.7rem); line-height: 1.05; letter-spacing: -0.035em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 0.76rem;
  font-weight: 700;
}
.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-top: 0;
  background: white;
}
.tool-button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}
.tool-button:hover { background: var(--cyan-pale); border-color: var(--cyan); }
.tool-button.favourite.active { background: var(--green-pale); border-color: var(--green); }
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 26px;
  align-items: start;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: white;
  box-shadow: var(--shadow);
}
.doc-body { min-width: 0; max-width: 820px; }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2, .doc-body h3, .doc-body h4 {
  scroll-margin-top: 130px;
  color: var(--navy);
  line-height: 1.25;
}
.doc-body h2 { margin: 38px 0 12px; padding-top: 4px; font-size: 1.42rem; }
.doc-body h3 { margin: 30px 0 10px; font-size: 1.18rem; }
.doc-body h4 { margin: 24px 0 8px; font-size: 1rem; }
.doc-body p { margin: 0 0 15px; }
.doc-body ul { margin: 0 0 18px; padding-left: 1.3em; }
.doc-body li { margin: 0 0 8px; padding-left: 4px; }
.doc-body li::marker { color: var(--red); }
.doc-body a { color: var(--navy); font-weight: 700; overflow-wrap: anywhere; text-decoration-color: var(--cyan); text-decoration-thickness: 2px; }
.doc-note {
  margin: 0 0 24px;
  padding: 14px 16px;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--green-pale);
  color: var(--navy-2);
  font-size: 0.88rem;
}
.table-wrap {
  overflow-x: auto;
  margin: 20px 0 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; line-height: 1.4; }
th, td { min-width: 150px; padding: 11px 12px; vertical-align: top; text-align: left; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: var(--cyan-pale); color: var(--navy); }
tr:nth-child(even) td { background: #fafafa; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }
.page-toc {
  position: sticky;
  top: 132px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 13px;
  background: var(--cyan-pale);
  color: var(--navy);
  font-size: 0.78rem;
}
.page-toc strong { display: block; margin-bottom: 8px; }
.page-toc a { display: block; padding: 5px 0; color: var(--navy-2); line-height: 1.3; text-decoration: none; }
.page-toc a:hover { color: var(--red); text-decoration: underline; }
.related { margin-top: 30px; }
.related h2 { color: var(--navy); }
.related-card { padding: 17px; }
.related-card small { color: var(--red); font-weight: 800; }
.related-card strong { margin-top: 5px; color: var(--navy); line-height: 1.3; }
.search-header, .category-header {
  margin-bottom: 24px;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow);
}
.search-header h1, .category-header h1 { margin: 0; color: var(--navy); font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; }
.search-header p, .category-header p { margin: 12px 0 0; color: var(--muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 24px; }
.filter-button {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}
.filter-button.active, .filter-button:hover { background: var(--navy); color: white; border-color: var(--navy); }
.result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-card { padding: 21px; }
.result-card h2 { margin: 7px 0 9px; color: var(--navy); font-size: 1.08rem; line-height: 1.28; }
.result-card p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.result-card .result-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); color: #59647e; font-size: 0.72rem; font-weight: 700; }
mark { padding: 0 2px; border-radius: 3px; background: #c8f0f8; color: inherit; }
.empty-state {
  padding: 42px;
  border: 1px dashed #b8c0cf;
  border-radius: var(--radius);
  background: white;
  text-align: center;
}
.empty-state h2 { margin: 0; color: var(--navy); }
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: 340px;
  padding: 12px 16px;
  border-radius: 11px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  font-weight: 700;
}
.scrim { display: none; }
.scrim[hidden] { display: none !important; }
@media (max-width: 1050px) {
  :root { --sidebar: 280px; }
  .hero::after { display: none; }
  .quick-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .page-toc { position: static; max-height: none; order: -1; }
  .page-toc .toc-links { columns: 2; column-gap: 24px; }
}
@media (max-width: 820px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "menu brand text" "search search search";
    gap: 10px;
    padding: 10px 12px 12px;
  }
  .menu-button { display: block; grid-area: menu; }
  .brand { grid-area: brand; min-width: 0; }
  .brand-logo { width: 145px; }
  .brand-library { display: none; }
  .search-box { grid-area: search; }
  .text-button { grid-area: text; }
  .search-box kbd { display: none; }
  .search-box input { min-height: 44px; padding-right: 14px; }
  .status-strip { position: static; top: auto; padding-inline: 14px; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    z-index: 70;
    top: 0;
    left: 0;
    width: min(90vw, 360px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 50px rgba(0,0,0,0.22);
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { transform: translateX(0); }
  .close-button { display: block; }
  .scrim { position: fixed; z-index: 65; inset: 0; display: block; background: rgba(15,23,42,0.52); }
  main { padding: 24px 16px 44px; }
  .result-grid, .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  body.large-text { font-size: 17px; }
  .brand-logo { width: 122px; }
  .text-button { min-width: 42px; }
  .status-strip span:last-child { display: none; }
  .hero { padding: 30px 23px; border-radius: 18px; }
  .hero h1 { font-size: 2.55rem; }
  .quick-grid, .category-grid { grid-template-columns: 1fr; }
  .guide { grid-template-columns: 1fr; }
  .doc-header { border-radius: 18px 18px 0 0; }
  .doc-header h1 { font-size: 2.15rem; overflow-wrap: anywhere; }
  .doc-toolbar { overflow-x: visible; flex-wrap: wrap; }
  .tool-button { flex: 1 1 calc(50% - 4px); text-align: center; white-space: normal; }
  .doc-layout { padding: 22px 18px; border-radius: 0 0 18px 18px; }
  .page-toc .toc-links { columns: 1; }
  .search-header, .category-header { padding: 25px 21px; border-radius: 18px; }
}
@media print {
  .topbar, .status-strip, .sidebar, .doc-toolbar, .page-toc, .related, .breadcrumbs { display: none !important; }
  .app-shell { display: block; }
  main { padding: 0; }
  .doc-header { background: white; color: var(--navy); padding: 0 0 18px; }
  .doc-header .eyebrow { color: var(--red); }
  .chip { color: var(--navy); border-color: var(--line); }
  .doc-layout { display: block; padding: 0; border: 0; box-shadow: none; }
  a { color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
