:root {
  --c-bg: #ffffff;
  --c-surface: #f7f9fa;
  --c-border: #d9e2e6;
  --c-text: #172b33;
  --c-text2: #52656d;
  --c-accent: #104a5a;
  --c-accent-h: #0b3946;
  --c-callout-bg: #eef6f8;
  --c-callout-b: #104a5a;
  --hf-orange: #ffa62b;
  --hf-orange-soft: #fff4df;
  --header-h: 64px;
  --sidebar-w: 292px;
  --radius: 10px;
}

body {
  background: #fff;
  color: var(--c-text);
}

header {
  height: var(--header-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 3px rgba(16, 74, 90, 0.08);
}

header .logo {
  gap: 14px;
  min-width: 0;
  color: var(--c-text);
}

header .logo img {
  display: block;
  width: 184px;
  height: auto;
  max-height: 38px;
  object-fit: contain;
}

header .logo .docs-label {
  border-left: 1px solid var(--c-border);
  padding-left: 14px;
  color: #47616b;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

.site-search {
  position: relative;
  width: min(460px, 42vw);
  margin-left: auto;
}

.print-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #b71c1c;
  border-radius: 20px;
  background: #c62828;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.print-button:hover,
.print-button:focus-visible {
  background: #a61f1f;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.2);
  outline: 0;
}

.print-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.print-letterhead {
  display: none;
}

.hp-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}

.hp-logo {
  margin: 0;
  text-align: center;
}

.hp-logo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e0c5c9;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(88, 0, 15, 0.18);
}

.hp-logo figcaption {
  margin-top: 8px;
  color: var(--c-text2);
  font-size: 0.74rem;
}

.client-must-read,
.client-must-read strong {
  color: #b71c1c !important;
  font-weight: 700 !important;
}

.acceptance-required {
  display: grid;
  gap: 6px;
  margin: 24px 0 32px;
  padding: 18px 20px;
  border: 1px solid #e4a5a5;
  border-left: 5px solid #b71c1c;
  border-radius: 10px;
  background: #fff5f5;
  color: #651515;
}

.acceptance-required strong {
  color: #b71c1c;
  font-size: 1.02rem;
}

.acceptance-section {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid #cbdadd;
  border-radius: 14px;
  background: #f8fbfc;
}

.acceptance-section h2 {
  margin-top: 0;
}

.acceptance-form,
.acceptance-fields {
  display: grid;
  gap: 16px;
}

.acceptance-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.acceptance-form label:not(.acceptance-check) {
  display: grid;
  gap: 7px;
  color: #173f4c;
  font-weight: 600;
}

.acceptance-form input[type="text"],
.acceptance-form input[type="email"] {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #aebfc4;
  border-radius: 7px;
  background: #fff;
  color: #172b33;
  font: inherit;
}

.acceptance-form input:focus-visible {
  outline: 3px solid rgba(14, 97, 115, 0.22);
  outline-offset: 1px;
  border-color: #0e6173;
}

.acceptance-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.acceptance-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #0e6173;
}

.acceptance-final {
  padding: 14px;
  border-radius: 9px;
  background: #eef5f6;
}

.acceptance-submit {
  justify-self: start;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: #b71c1c;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.acceptance-submit:hover {
  background: #951717;
}

.acceptance-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.acceptance-status {
  min-height: 1.4em;
  margin: 0;
  color: #0e6173;
  font-weight: 600;
}

.acceptance-note {
  margin: 0;
  color: #52656d;
  font-size: 0.84rem;
}

.site-search svg {
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: #60777f;
  transform: translateY(-50%);
  pointer-events: none;
}

.site-search input {
  width: 100%;
  height: 42px;
  padding: 0 42px;
  border: 1px solid #ccdadd;
  border-radius: 22px;
  outline: 0;
  background: #f5f8f9;
  color: var(--c-text);
  font: inherit;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-search input:focus {
  border-color: #3d7887;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 74, 90, 0.13);
}

.site-search kbd {
  position: absolute;
  right: 13px;
  top: 50%;
  padding: 1px 6px;
  border: 1px solid #cad7db;
  border-radius: 5px;
  background: #fff;
  color: #667c84;
  font: 0.75rem/1.4 "JetBrains Mono", monospace;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-results {
  position: absolute;
  z-index: 150;
  top: calc(100% + 9px);
  right: 0;
  width: min(560px, 88vw);
  max-height: min(520px, 70vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #cad9dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(13, 55, 67, 0.18);
}

.search-results[hidden] {
  display: none;
}

.search-results a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--c-text);
  text-decoration: none;
}

.search-results a:hover,
.search-results a.is-active {
  background: #edf4f6;
}

.search-topic {
  font-size: 0.9rem;
  font-weight: 600;
  color: #173f4c;
}

.search-page {
  font-size: 0.76rem;
  color: #647980;
}

.search-empty {
  margin: 0;
  padding: 13px 12px;
  font-size: 0.86rem;
}

.layout {
  background: linear-gradient(90deg, #fbfcfd 0, #fbfcfd var(--sidebar-w), #fff var(--sidebar-w));
}

.sidebar {
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  width: var(--sidebar-w);
  padding: 22px 16px 40px;
  background: #fbfcfd;
}

.sidebar a,
.sidebar details > summary {
  border-radius: 8px;
}

.sidebar a {
  padding: 7px 11px;
}

.sidebar a:hover,
.sidebar a:focus,
.sidebar details > summary:hover {
  background: #edf3f5;
  text-decoration: none;
}

.sidebar a.active {
  position: relative;
  background: #e4f0f3;
  color: #0b4655;
  font-weight: 600;
}

.sidebar a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 4px;
  background: var(--hf-orange);
}

.sidebar .nav-number {
  display: inline-block;
  min-width: 2.25em;
  margin-right: 0.3em;
  color: #6a7d84;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.sidebar a.active .nav-number,
.sidebar summary:has(a.active) > .nav-number {
  color: #0b4655;
}

.content {
  max-width: 1080px;
  padding: 46px 64px 96px;
}

h1 {
  color: #173a46;
  font-size: 2.15rem;
  letter-spacing: -0.025em;
}

h1::after {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 15px;
  border-radius: 8px;
  background: var(--hf-orange);
}

h2 {
  color: #173f4c;
  border-bottom-color: #dce5e8;
}

h3,
h4,
strong {
  color: #203b45;
}

a {
  color: #0e6173;
}

a:hover {
  color: #093f4c;
}

blockquote {
  border-left-color: var(--hf-orange);
  background: var(--hf-orange-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 166, 43, 0.18);
}

.table-wrap,
.table-scroll {
  border-color: #d7e1e5;
  box-shadow: 0 1px 2px rgba(16, 74, 90, 0.04);
}

th {
  background: #edf4f6;
  color: #173f4c;
}

tr:hover td {
  background: #fbfdfd;
}

.home-cards .card {
  background: #fff;
  border-color: #d7e1e5;
  border-top: 4px solid var(--hf-orange);
  box-shadow: 0 2px 8px rgba(16, 74, 90, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.home-cards .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(16, 74, 90, 0.12);
}

.document-meta span {
  background: #eef5f7;
  border-color: #d1e0e4;
  color: #315661;
}

code:not(pre code) {
  color: #a24c00;
  background: #fff7ea;
  border-color: #f4d8ae;
}

@media (max-width: 860px) {
  .hp-intro {
    grid-template-columns: 1fr;
  }

  .hp-logo {
    width: min(260px, 78vw);
    margin-inline: auto;
  }

  header {
    padding: 0 16px;
  }

  header .logo img {
    width: 128px;
  }

  header .logo .docs-label {
    display: none;
  }

  .site-search {
    flex: 1;
    width: auto;
    min-width: 120px;
  }

  .site-search kbd {
    display: none;
  }

  .site-search input {
    padding-right: 16px;
  }

  .layout {
    background: #fff;
  }

  .content {
    padding: 30px 20px 72px;
  }
}

@media (max-width: 560px) {
  header .logo {
    display: none;
  }

  .site-search input {
    height: 38px;
    font-size: 0.82rem;
  }

  .print-button {
    width: auto;
    min-width: 0;
    padding: 0 11px;
    font-size: 0.76rem;
  }

  .acceptance-section {
    padding: 18px;
  }

  .acceptance-fields {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4;
  margin: 16mm 16mm 18mm;
}

@media print {
  html {
    scroll-behavior: auto;
  }

  body {
    background: #fff;
    color: #172b33;
    font-size: 10pt;
    line-height: 1.5;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  header,
  .sidebar,
  .menu-overlay,
  .menu-btn,
  .search-results,
  .print-button {
    display: none !important;
  }

  .acceptance-form {
    break-inside: avoid-page;
  }

  .acceptance-submit,
  .acceptance-status,
  .acceptance-note {
    display: none !important;
  }

  .layout {
    display: block;
    min-height: 0;
    background: #fff;
  }

  .content {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .print-letterhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 12mm;
    padding: 0 0 5mm;
    border-bottom: 2px solid #104a5a;
  }

  .print-company {
    display: flex;
    align-items: center;
    gap: 11px;
  }

  .print-company img {
    display: block;
    width: 46mm;
    height: auto;
    max-height: 10mm;
    object-fit: contain;
  }

  .print-company span {
    padding-left: 11px;
    border-left: 1px solid #c8d5d9;
    color: #173f4c;
    font-size: 10pt;
    font-weight: 600;
  }

  .print-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: #52656d;
    font-size: 8.5pt;
  }

  .print-date strong {
    color: #173f4c;
    font-size: 8pt;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  h1 {
    font-size: 22pt;
  }

  h2 {
    margin-top: 8mm;
    font-size: 15pt;
  }

  h3 {
    margin-top: 6mm;
    font-size: 12pt;
  }

  h1,
  h2,
  h3,
  h4 {
    break-after: avoid-page;
  }

  h1::after {
    background: #ffa62b !important;
  }

  p,
  li,
  blockquote,
  table,
  pre,
  .card {
    orphans: 3;
    widows: 3;
  }

  pre,
  blockquote,
  .table-wrap,
  .table-scroll,
  .card,
  img,
  svg {
    break-inside: avoid-page;
  }

  .table-wrap,
  .table-scroll {
    overflow: visible;
    box-shadow: none;
  }

  table {
    font-size: 8.5pt;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid-page;
  }

  pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  a {
    color: #0e6173;
    text-decoration: none;
  }

  .heading-anchor {
    display: none;
  }

  .home-cards {
    display: block;
  }

  .home-cards .card {
    margin-bottom: 7mm;
    box-shadow: none;
  }
}
