:root {
  --header-bg: #494f53;
  --header-text: #f0f0f0;
  --heading-1: #375db0;
  --heading-2: #4f87fd;
  --link: #215ba5;
  --text: #000;
  --muted: #666;
  --border: #ddd;
  --bg: #fff;
  --sidebar-bg: #f3f3f3;
  --canvas-bg: #494f53;
  --frame-blue: #80acd2;
  --card-radius: 3px;
  --sidebar-width: 280px;
  --font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 11pt;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: var(--link); text-decoration: none; border-bottom: 1px transparent solid; }
a:hover { border-bottom-color: currentColor; }

.site-header {
  flex: 0 0 auto;
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--header-text);
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: bold;
}
.site-header__brand img { display: block; }
.site-header__brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-flag {
  display: block;
  line-height: 0;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  opacity: 0.6;
}
.lang-flag img { display: block; border-radius: 2px; }
.lang-flag:hover { opacity: 0.9; border-bottom-color: transparent; }
.lang-flag.is-current {
  opacity: 1;
  border-color: var(--header-text);
}

.site-search {
  display: flex;
  flex: 0 1 320px;
  min-width: 200px;
  margin: 0;
}
.site-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 4px 0 0 4px;
  font-size: 0.9rem;
  font-family: var(--font);
}
.site-search__button {
  flex: 0 0 auto;
  padding: 0.4rem 0.9rem;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0 4px 4px 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}
.site-search__button:hover { background: var(--sidebar-bg); }

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0.5rem 0.5rem 0.5rem 0;
  background: var(--canvas-bg);
}

.sidebar {
  flex: 0 0 var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
  box-shadow: inset 0 1px 3px 0 #ccc;
  height: 100%;
  overflow: hidden;
  font-size: 0.9rem;
}
.sidebar__tabs {
  flex: 0 0 auto;
  display: flex;
}
.sidebar__tab {
  flex: 1 1 50%;
  padding: 0.6rem 0.5rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}
.sidebar__tab.is-active {
  background: #fff;
  color: var(--link);
  border-bottom: 2px solid var(--link);
}
.sidebar__panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
}
.sidebar__panel[hidden] { display: none; }

.sidebar__heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.toc-list { list-style: none; margin: 0; padding-left: 1rem; }
.sidebar__panel > .toc-list { padding-left: 0; }
.toc-list summary { cursor: pointer; }
.toc-link { color: var(--link); }
.toc-link:hover { text-decoration: underline; }
.toc-link.current { font-weight: bold; color: var(--heading-1); }
.toc-numbering { color: var(--muted); font-weight: normal; }

.sidebar__search-results { list-style: none; margin: 0; padding: 0; }
.sidebar__search-results li a {
  display: block;
  padding: 0.5rem 0.25rem;
  color: inherit;
  border-bottom: 1px solid var(--border);
}
.sidebar__search-results li a:hover .sidebar__search-results__title { text-decoration: underline; }
.sidebar__search-results__title { display: block; color: var(--link); font-size: 0.9rem; }
.sidebar__search-results__snippet {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  line-height: 1.35;
}
.sidebar__search-results__empty { color: var(--muted); font-size: 0.85rem; }

mark.search-hit {
  background: #ffe066;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.splitter {
  flex: 0 0 10px;
  position: relative;
  cursor: col-resize;
  touch-action: none;
}
.splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.splitter:hover::after,
.splitter.is-dragging::after {
  background: rgba(255, 255, 255, 0.6);
}

.content-frame {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--frame-blue);
  border-radius: var(--card-radius);
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.5);
  padding: 0.75rem 0.75rem 1rem;
}

.breadcrumbs {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.breadcrumbs .crumb { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.5); }
.breadcrumbs .crumb.current { font-weight: bold; }
.crumb-sep { margin: 0 0.35rem; color: rgba(255, 255, 255, 0.75); }

.page-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
}
.page-controls__link { font-size: 0.9rem; color: #fff; border-bottom-color: rgba(255, 255, 255, 0.5); }
.page-controls__next { margin-left: auto; }
.page-controls__print {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.page-controls__print:hover { background: rgba(255, 255, 255, 0.15); }

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: inset 0 1px 3px 0 #ccc;
  padding: 1.25rem 1.5rem 2rem;
}

.article img { max-width: 100%; height: auto; }
.article table { border-collapse: collapse; max-width: 100%; }
.article h1 {
  font-family: var(--font);
  font-size: 20pt;
  color: var(--heading-1);
  font-weight: bold;
  margin: 0 0 0.6em;
}
.article h2 {
  font-family: var(--font);
  font-size: 14pt;
  color: var(--heading-2);
  font-weight: bold;
  margin: 1em 0 0.4em;
}
.article pre {
  font-family: "Courier New", monospace;
  background: var(--sidebar-bg);
  padding: 0.75rem;
  overflow-x: auto;
}
.article table.two-col td { vertical-align: top; padding: 0.5rem; }
.article table.ribbon-elements td { vertical-align: middle; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }

.home-cover {
  max-width: 500px;
  margin: 2rem auto;
  text-align: center;
}
.home-cover img { margin: 0 auto; }
.home-cover hr {
  width: 50%;
  margin: 1.5rem auto;
  border: none;
  border-top: 1px solid #808080;
}

.back-to-top {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--link);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.back-to-top.is-visible { display: flex; }
.back-to-top:hover { background: var(--heading-1); }

.site-footer {
  flex: 0 0 auto;
  text-align: center;
  padding: 1rem;
  font-size: 8pt;
  color: var(--header-text);
  background: var(--header-bg);
}

@media (max-width: 800px) {
  html, body { height: auto; overflow: visible; }
  body { display: block; }
  .layout { flex-direction: column; height: auto; padding: 0.5rem; }
  .splitter { display: none; }
  .sidebar { flex-basis: auto; width: 100%; height: auto; overflow: visible; border-radius: var(--card-radius); }
  .sidebar__panel { overflow-y: visible; }
  .content-frame { height: auto; overflow: visible; }
  .content { overflow-y: visible; }
}

@media print {
  html, body { height: auto; overflow: visible; }
  .site-header, .sidebar, .splitter, .breadcrumbs, .page-controls, .back-to-top, .site-footer, .site-search {
    display: none !important;
  }
  .layout, .content-frame, .content { display: block; height: auto; overflow: visible; padding: 0; margin: 0; background: none; box-shadow: none; }
  a[href]::after { content: none !important; }
}
