:root {
  color-scheme: light dark;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #eaf0f4;
  --ink: #16212a;
  --muted: #60717e;
  --line: #d8e1e7;
  --accent: #168fbd;
  --accent-strong: #086f9a;
  --warning: #b76313;
  --danger: #bf3546;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 18px);
}

body {
  min-width: 280px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  flex: 0 0 42px;
  border-radius: 8px;
}

.brand span {
  min-width: 0;
  display: grid;
  line-height: 1.2;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.language-switch {
  position: relative;
  display: block;
}

.language-switch select {
  width: min(210px, 42vw);
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  color-scheme: light dark;
}

.language-switch select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  align-items: end;
  gap: 44px;
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.16;
}

.intro-copy > p:last-child {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.search-box {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(25, 47, 62, 0.06);
}

.search-box span {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-box span::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  content: "";
  transform: rotate(45deg);
  border-radius: 2px;
  background: var(--muted);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.contents-toggle {
  display: none;
}

.manual-layout {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  padding: 34px 0 60px;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  display: grid;
  gap: 3px;
}

.toc > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.toc a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  text-decoration: none;
}

.toc a span {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  font-size: 11px;
  font-weight: 750;
}

.toc a:hover,
.toc a.active {
  background: var(--surface-2);
  color: var(--ink);
}

.toc a.active span {
  color: var(--accent-strong);
}

.manual-content {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.manual-section {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 20px;
  padding: 36px 0 42px;
  border-bottom: 1px solid var(--line);
}

.section-number {
  padding-top: 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.manual-section h2 {
  margin: 0 0 18px;
  font-size: 25px;
  line-height: 1.25;
}

.manual-section h3 {
  margin: 25px 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.manual-section p,
.manual-section li,
.manual-section dd {
  color: var(--muted);
  font-size: 15px;
}

.manual-section p {
  margin: 0 0 14px;
}

.manual-section ul,
.manual-section ol {
  margin: 10px 0 18px;
  padding-left: 22px;
}

.manual-section li + li {
  margin-top: 7px;
}

.manual-section strong,
.manual-section dt {
  color: var(--ink);
}

.callout {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  margin: 22px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--muted);
  font-size: 14px;
}

.callout.warning {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}

html[dir="rtl"] .manual-section ul,
html[dir="rtl"] .manual-section ol {
  padding-right: 22px;
  padding-left: 0;
}

html[dir="rtl"] .callout {
  border-right: 3px solid var(--accent);
  border-left: 0;
  border-radius: 6px 0 0 6px;
}

html[dir="rtl"] .callout.warning {
  border-right-color: var(--warning);
}

html[dir="rtl"] .language-switch select {
  padding-right: 12px;
  padding-left: 34px;
}

dl {
  margin: 0;
}

dt {
  margin-top: 18px;
  font-weight: 750;
}

dd {
  margin: 3px 0 0;
}

.support-line {
  margin-top: 28px !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.support-line a,
footer a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.no-results {
  margin: 36px 0;
  color: var(--muted);
  text-align: center;
}

footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer span {
  margin-right: auto;
  color: var(--ink);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  :root {
    --header-height: 64px;
  }

  .topbar {
    padding: 0 16px;
  }

  main,
  footer {
    width: min(100% - 28px, 700px);
  }

  .intro-band {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 26px;
  }

  h1 {
    font-size: 30px;
  }

  .contents-toggle {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 16px 0 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
  }

  .manual-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 14px;
  }

  .toc {
    position: static;
    display: none;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  body.toc-open .manual-language:not([hidden]) .toc {
    display: grid;
  }

  .toc > p {
    grid-column: 1 / -1;
    padding: 0 8px;
  }

  .manual-section {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 30px 0 34px;
  }

  .manual-section h2 {
    font-size: 22px;
  }

  .callout {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .brand small {
    display: none;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .language-switch {
    max-width: 46vw;
  }

  .language-switch select {
    width: 100%;
  }

  .toc {
    grid-template-columns: 1fr;
  }

  .manual-section {
    grid-template-columns: 1fr;
  }

  .section-number {
    padding: 0;
  }

  footer {
    flex-wrap: wrap;
    padding: 20px 0;
  }

  footer span {
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1317;
    --surface: #141c21;
    --surface-2: #1d282f;
    --ink: #f0f5f7;
    --muted: #a7b5be;
    --line: #29373f;
    --accent: #58c4e9;
    --accent-strong: #75d2f2;
    --warning: #f0ad61;
    --danger: #ff7182;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
