/* VI-BAL manual m005. Original navigation shell; unboxed reading text. */
:root {
  color-scheme: dark;
  --bg: #000;
  --text: #c5c5bf;
  --heading: #e1e1db;
  --muted: #b2b2ad;
  --quiet: #93938b;
  --line: #2c2c2c;
  --accent: #f1b73c;
  --brand: #f1b73c;
  --accent-surface: #1a160e;
  --hover: #141414;
  --control-bg: #101010;
  --control-line: #3a3a34;
  --menu-bg: #0b0b0a;
  --button-active-bg: #f1b73c;
  --button-active-text: #000;
  --header: 76px;
  --max: 1160px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ee;
  --text: #1b1b19;
  --heading: #11110f;
  --muted: #51514b;
  --quiet: #62625b;
  --line: #d9d6ce;
  --accent: #78540a;
  --brand: #332c1c;
  --accent-surface: #eae0ca;
  --hover: #eae7df;
  --control-bg: #efede6;
  --control-line: #c9c5b9;
  --menu-bg: #f5f3ee;
  --button-active-bg: #f1b73c;
  --button-active-text: #16140e;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 17px; line-height: 1.72; -webkit-font-smoothing: antialiased;
}
html[data-language="ru"] [data-lang="en"],
html[data-language="en"] [data-lang="ru"], [hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .19em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
::selection { color: #111; background: #f1b73c; }
img { max-width: 100%; height: auto; }
.skip-link { position: fixed; left: 20px; top: -120px; z-index: 100; padding: 12px 18px; background: var(--button-active-bg); color: #000; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { height: var(--header); position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { width: min(calc(100% - 64px), var(--max)); height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; flex-shrink: 0; }
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; }
.brand-word { font-size: 26px; letter-spacing: -.8px; font-weight: 850; line-height: 1; }
.header-name { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 18px; margin-left: 8px; font-weight: 400; letter-spacing: 0; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.site-link { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.site-link:hover { color: var(--heading); }
.theme-toggle { height: 39px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--control-bg); color: var(--muted); font-size: 13px; line-height: 1.3; padding: 0 11px; }
.theme-toggle:hover { background: var(--hover); color: var(--heading); }
.theme-action-light, .theme-action-dark { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.theme-toggle svg { flex-shrink: 0; }
html[data-theme="dark"] .theme-action-dark,
html[data-theme="light"] .theme-action-light { display: none !important; }
.lang-switch { display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--control-bg); }
.lang-switch button { border: 0; background: transparent; font-size: 12px; font-weight: 700; letter-spacing: .05em; line-height: 1.3; padding: 7px 9px; border-radius: 4px; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--button-active-bg); color: var(--button-active-text); }
.lang-switch button:hover:not([aria-pressed="true"]) { background: var(--hover); color: var(--heading); }
.mobile-nav-toggle { display: none; }
.layout { width: min(calc(100% - 64px), var(--max)); margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 64px; align-items: start; }
.sidebar { position: sticky; top: var(--header); padding: 32px 14px 30px 0; border-right: 1px solid var(--line); max-height: calc(100vh - var(--header)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; }
.sidebar-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--quiet); margin: 0 0 12px 12px; }
.nav-group + .nav-group { margin-top: 22px; }
.chapter-link { display: flex; align-items: baseline; gap: 10px; position: relative; padding: 9px 9px 9px 12px; text-decoration: none; color: var(--text); font-size: 14px; line-height: 1.4; border-radius: 6px; margin: 2px 0; }
.nav-number { color: var(--quiet); font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .03em; min-width: 16px; font-weight: 500; }
.chapter-link:hover { background: var(--hover); color: var(--heading); }
.chapter-link[aria-current="page"] { color: var(--accent); background: var(--accent-surface); font-weight: 600; }
.chapter-link[aria-current="page"]::before { content: ""; position: absolute; width: 2px; border-radius: 2px; background: var(--accent); top: 10px; bottom: 10px; left: 0; }
.chapter-link[aria-current="page"] .nav-number { color: var(--accent); }
.section-links { padding: 6px 0 8px 28px; list-style: none; margin: 0; }
.section-links a { font-size: 12px; line-height: 1.45; color: var(--muted); text-decoration: none; display: block; padding: 5px 7px; border-left: 1px solid var(--line); }
.section-links a:hover { color: var(--heading); }
.section-links a.active { color: var(--accent); border-left-color: var(--accent); }
.nav-footer { margin: 28px 0 0 12px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 11px; line-height: 1.7; }
.main { min-width: 0; max-width: 790px; padding: 36px 0 56px; }
h1 { color: var(--heading); font-size: clamp(35px, 3.4vw, 48px); letter-spacing: -.04em; line-height: 1.12; font-weight: 750; margin: 0 0 18px; overflow-wrap: anywhere; }
.page-description { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; max-width: 690px; }
.page-header { margin-bottom: 38px; }
/* The reading pane is continuous text: no cards, shaded notes or section boxes. */
.guide-section { margin-bottom: 40px; scroll-margin-top: calc(var(--header) + 28px); }
#main { scroll-margin-top: calc(var(--header) + 28px); }
.section-heading { display: flex; align-items: baseline; gap: 12px; color: var(--heading); font-size: 25px; letter-spacing: -.023em; line-height: 1.3; font-weight: 650; margin: 0 0 19px; overflow-wrap: break-word; }
.section-index { font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; flex-shrink: 0; }
.guide-section p, .home-intro p { color: var(--text); margin: 0 0 17px; font-size: 17px; line-height: 1.72; overflow-wrap: break-word; }
.guide-section p:last-child, .home-intro p:last-child { margin-bottom: 0; }
strong { font-weight: 650; color: inherit; }
.chapter-pager { display: flex; align-items: baseline; justify-content: space-between; gap: 28px; margin-top: 44px; padding-top: 22px; }
.pager-link { max-width: 48%; font-size: 14px; line-height: 1.5; text-decoration: none; overflow-wrap: break-word; }
.pager-link:hover { text-decoration: underline; }
.pager-next { margin-left: auto; text-align: right; }
.noscript { padding: 16px 24px; }
@media (max-width: 1100px) and (min-width: 801px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 38px; }
  .header-name { padding-left: 14px; margin-left: 4px; }
  .header-actions { gap: 14px; }
}
@media (max-width: 1000px) { .site-link { display: none; } }
@media (max-width: 800px) {
  :root { --header: 65px; }
  .header-inner { width: calc(100% - 36px); gap: 10px; }
  .brand { gap: 6px; }
  .brand img { width: 35px; height: 35px; }
  .brand-word { font-size: 23px; }
  .header-name { display: none; }
  .header-actions { gap: 10px; }
  .theme-toggle { font-size: 12px; padding: 0 9px; }
  .lang-switch { padding: 3px; gap: 1px; }
  .lang-switch button { padding: 7px 8px; font-size: 11px; }
  .layout { display: block; width: calc(100% - 40px); }
  .mobile-nav-toggle { display: flex; align-items: center; justify-content: space-between; position: sticky; top: var(--header); z-index: 35; background: var(--menu-bg); width: 100%; height: 47px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 20px; color: var(--text); font-size: 13px; line-height: 1.5; }
  .menu-indicator { color: var(--accent); font-size: 16px; line-height: 1; }
  .mobile-nav-toggle[aria-expanded="true"] .menu-indicator { transform: rotate(180deg); }
  .sidebar { display: none; position: fixed; top: calc(var(--header) + 47px); left: 0; right: 0; max-height: calc(100vh - var(--header) - 47px); max-height: calc(100dvh - var(--header) - 47px); z-index: 34; padding: 20px 26px 30px; background: var(--menu-bg); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar.open { display: block; }
  .chapter-link { font-size: 15px; padding-top: 10px; padding-bottom: 10px; }
  .section-links a { font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
  .nav-footer { margin-top: 20px; }
  .main { max-width: 720px; margin: 0 auto; padding-top: 27px; }
  h1 { font-size: 36px; letter-spacing: -.035em; }
  .page-description { font-size: 16px; }
  .page-header { margin-bottom: 30px; }
  .guide-section { margin-bottom: 34px; }
  .guide-section, #main { scroll-margin-top: calc(var(--header) + 68px); }
  .section-heading { font-size: 22px; gap: 10px; margin-bottom: 17px; }
  .section-index { font-size: 11px; }
  .guide-section p, .home-intro p { font-size: 16px; line-height: 1.72; }
  .chapter-pager { gap: 18px; margin-top: 32px; }
  .pager-link { font-size: 13px; }
}
@media (max-width: 480px) {
  .layout { width: calc(100% - 36px); }
  .header-inner { width: calc(100% - 28px); }
  .header-actions { gap: 7px; }
  .brand img { width: 32px; height: 32px; }
  .brand-word { font-size: 22px; }
  .lang-switch button { padding: 7px 6px; }
  h1 { font-size: 34px; }
}
@media (max-width: 350px) {
  .header-inner { width: calc(100% - 20px); gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .brand-word { font-size: 20px; }
  .brand { gap: 4px; }
  .theme-toggle { padding: 0 7px; font-size: 11px; }
  .theme-action-light, .theme-action-dark { gap: 5px; }
  .theme-toggle svg { width: 15px; height: 15px; }
  .header-actions { gap: 6px; }
  .lang-switch button { padding: 7px 5px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  :root, :root[data-theme="light"] { color-scheme: light; --bg: #fff; --text: #000; --heading: #000; --muted: #222; --accent: #30250f; }
  .site-header, .sidebar, .mobile-nav-toggle, .chapter-pager, .skip-link, .noscript { display: none !important; }
  .layout { display: block; margin: 0; padding: 0; width: 100%; max-width: none; }
  .main { max-width: none; padding: 0; }
  body, .guide-section p, .home-intro p { font-size: 12pt; }
  h1 { font-size: 24pt; }
  .section-heading { font-size: 16pt; break-after: avoid; }
  p { orphans: 3; widows: 3; }
}
