/* Copyright (c) 2026 ABUS Kransysteme GmbH */
/* ABUS Produkthandbuch — Web styles
   Derived from Produkthandbuch 2022.dotm. Wrap content in <article class="abus-doc">. */

/* ============================================================================
   SINGLE SOURCE OF TRUTH (consolidated 2026-08-24)
   ----------------------------------------------------------------------------
   This casing copy is the ONLY mobile abus-styles.css — served live AND fed to
   pandoc/preview by convert.ps1 (its mobile branch points here, like service).
   The former Programmordner copy (abus\mobile\abus-styles.css) was merged into
   this file (.abus-ref-note*, `.abus-doc p:has(+ .abus-table)`) and deleted.

   Remember: changes here reach the PUBLIC server only when the assets folder
   is re-uploaded (publish.ps1 -EmitAssets + webserver upload).
   ============================================================================ */


/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --abus-blue:          #005AAA;
  --abus-amber:         #FFB400;
  --abus-grey-shade:    #E6E6E6;
  --abus-grey-border:   #C0C0C0;
  --abus-text:          #000000;

  --abus-font: Arial, "Helvetica Neue", Helvetica, sans-serif;

  --abus-fs-scale: 1;          /* text-size control (A−/A/A+) multiplies the article type; 1 = normal */
  --abus-fs-base:  calc(1rem      * var(--abus-fs-scale));   /* 16px */
  --abus-fs-sm:    calc(0.9375rem * var(--abus-fs-scale));   /* 15px — Hinweis, captions, table cells */
  --abus-fs-lg:    calc(1.125rem  * var(--abus-fs-scale));   /* 18px — Ziel, safety body */
  --abus-fs-h1:    calc(2.5rem    * var(--abus-fs-scale));   /* 40px */
  --abus-fs-h2:    calc(1.5rem    * var(--abus-fs-scale));   /* 24px */
  --abus-fs-h3:    calc(1.25rem   * var(--abus-fs-scale));   /* 20px */
  --abus-fs-h4:    calc(1.125rem  * var(--abus-fs-scale));   /* 18px */

  --abus-space-xs: 0.25rem;
  --abus-space-sm: 0.5rem;
  --abus-space-md: 1rem;
  --abus-space-lg: 1.5rem;

  --abus-indent:   2rem;       /* replaces Word's 1cm (567 twips) */
  --abus-line-height: 1.3;   /* tightened from 1.5 like the Servicedoku (A. Kalcher, ABUControl-Feedback); ported 2026-09-14 */
}

/* Text-size control (A−/A/A+): scales the ARTICLE type only. <html data-textsize="…">
   is set by theme.js (and the inline <head> script, to avoid a reflow on load).
   Setting --abus-fs-scale on <html> cascades into the article; the chrome is
   untouched because ONLY .abus-doc rules consume the --abus-fs-* tokens. */
html[data-textsize="large"]  { --abus-fs-scale: 1.15; }
html[data-textsize="xlarge"] { --abus-fs-scale: 1.30; }


/* ============================================================
   Base typography  —  <article class="abus-doc">
   ============================================================ */
.abus-doc {
  font-family: var(--abus-font);
  font-size: var(--abus-fs-base);
  line-height: var(--abus-line-height);
  color: var(--abus-text);
  /* Size container for the @container rules below (2026-09-15): "narrow"
     means the ARTICLE column, not the viewport — an open 300 px sidebar or
     a half-screen window make the article phone-narrow long before the
     768 px viewport rules fire. The article is a plain block inside the
     Bootstrap .container, so its width comes from the layout and the
     containment cannot collapse it. Note: inline-size containment also
     makes the article the containing block for position:fixed descendants
     and a stacking context — popups, share window, tooltips and modals are
     all appended to <body>, so nothing inside depends on that. */
  container-type: inline-size;
  container-name: abus-doc;
}
/* The image popup (theme.js buildFigureView) clones a figure into
   <div class="mfp-figview__view abus-doc"> — an inline-block that must size
   to its content. With size containment it would be 0 px wide and the
   figure would hang off-centre to the right, so no containment there. */
.abus-doc.mfp-figview__view {
  container-type: normal;
}
/* Print: paper cannot scroll. Switch the container off so the narrow-article
   table rules below (scroll blocks, small type) never apply in print; tables
   fall back to the desktop auto layout and simply take the width they need. */
@media print {
  .abus-doc {
    container-type: normal;
  }
}

.abus-doc p {
  margin: var(--abus-space-sm) 0 0;
  line-height: var(--abus-line-height);   /* 1.3 — directly targets article paragraphs so the theme's
                                              generic `p` rule (stylesheet.css) can't override via cascade */
}

/* Blank-paragraph spacer: reproduces the vertical gap of the empty paragraphs
   the docx used between content. Height is set inline (∝ the blank count) by
   polish.ps1 pass 0c from the convert.ps1 sentinels. */
.abus-vspace { display: block; margin: 0; }

.abus-doc a {
  color: var(--abus-blue);
  text-decoration: underline;
}

/* All images keep their docx-recorded width via inline style; max-width:100%
   shrinks them when the container is narrower (mobile, narrow article). The
   convert pipeline strips the inline height so height:auto preserves the
   native aspect ratio when shrinking. */
.abus-doc img {
  max-width: 100%;
  height: auto;
}

.abus-doc a:hover,
.abus-doc a:focus {
  text-decoration: none;
}


/* ============================================================
   Headings

   Top margin is consistent across heading levels so chapter
   breaks read uniformly throughout the doc. h1 and h2 (major
   chapter / section breaks) get double the spacing of h3–h6.
     --abus-chapter-gap:    base gap above h3–h6
     --abus-chapter-gap-lg: 2× base gap above h1, h2
   ============================================================ */
:root {
  --abus-chapter-gap:    calc(var(--abus-space-lg) * 3);
  --abus-chapter-gap-lg: calc(var(--abus-space-lg) * 6);
}

.abus-doc h1 {
  /* Scale down on narrow phones so a long uppercase word (e.g.
     "UNTERSCHIEDLICHE") can't grow wider than the viewport and force the whole
     page to scroll sideways; capped at the full 2.5rem on wide screens.
     break-word wraps any single word still too long for the line. */
  font-size: clamp(1.5rem, 6.5vw, var(--abus-fs-h1));
  font-weight: bold;
  color: var(--abus-blue);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: var(--abus-chapter-gap-lg) 0 var(--abus-space-md);
  overflow-wrap: break-word;
  word-break: break-word;
}

.abus-doc h2 {
  font-size: var(--abus-fs-h2);
  font-weight: bold;
  color: var(--abus-blue);
  text-transform: uppercase;
  border-top: 1px solid var(--abus-blue);
  border-bottom: 1px solid var(--abus-blue);
  padding: 0.4em 0;
  margin: var(--abus-chapter-gap-lg) 0 var(--abus-space-md);
  overflow-wrap: break-word;
  word-break: break-word;
}

.abus-doc h3 {
  font-size: var(--abus-fs-h3);
  font-weight: bold;
  color: var(--abus-text);
  text-transform: uppercase;
  border-bottom: 1px solid var(--abus-text);
  padding-bottom: 0.1em;
  margin: var(--abus-chapter-gap) 0 var(--abus-space-sm);
  overflow-wrap: break-word;
  word-break: break-word;
}

.abus-doc h4 {
  font-size: var(--abus-fs-h4);
  font-weight: bold;
  margin: var(--abus-chapter-gap) 0 var(--abus-space-sm);
}

.abus-doc h5 {
  font-size: 1.0625rem;
  font-weight: bold;
  font-style: italic;
  margin: var(--abus-chapter-gap) 0 var(--abus-space-sm);
}

.abus-doc h6 {
  font-size: 1rem;
  font-weight: bold;
  margin: var(--abus-chapter-gap) 0 var(--abus-space-sm);
}

/* Heading 3 with outline rule (Überschrift 3 mit Gliederung) — same as h3
   except the bottom rule is thicker, to distinguish it visually. */
.abus-doc h3.abus-h--outline {
  border-bottom-width: 3px;
}


/* ============================================================
   Cover title block (Produkthandbuch / Produkthandbuch Zeile 2 / Zeile 3)
   <header class="abus-cover">
     <p class="abus-cover__title">…</p>   — 26pt blue caps
     <p class="abus-cover__line2">…</p>   — 18pt blue, mixed case
     <p class="abus-cover__line3">…</p>   — 14pt black
   </header>
   ============================================================ */
.abus-cover {
  margin: var(--abus-space-lg) 0;
}

.abus-cover__title {
  /* "PRODUKTHANDBUCH" is one long word; on narrow phones a fixed 3rem
     overflows the viewport. Scale with the viewport (capped at 3rem on
     wide screens) and allow a break as a last resort. */
  font-size: clamp(1.75rem, 8vw, 3rem);
  font-weight: bold;
  color: var(--abus-blue);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.abus-cover__line2 {
  font-size: 2rem;
  color: var(--abus-blue);
  margin: var(--abus-space-sm) 0 0;
}

.abus-cover__line3 {
  font-size: 1.5rem;
  color: var(--abus-text);
  margin: var(--abus-space-sm) 0 0;
}


/* ============================================================
   Subtitle (Unterüberschrift) — used as a free-floating subtitle
   line below the cover title or a section opener.
   ============================================================ */
.abus-subtitle {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--abus-blue);
  text-transform: uppercase;
  margin: var(--abus-space-md) 0 var(--abus-space-sm);
}


/* ============================================================
   Goal / objective (Ziel) — <p class="abus-goal">
   ============================================================ */
.abus-goal {
  font-size: var(--abus-fs-lg);
  margin: var(--abus-space-md) 0 var(--abus-space-sm);
}


/* ============================================================
   At-a-glance heading (Auf einen Blick) — amber, slightly larger
   than body. Marks a summary section opener.
   <p class="abus-at-a-glance">…</p>
   ============================================================ */
.abus-at-a-glance {
  font-size: var(--abus-fs-lg);
  color: var(--abus-amber);
  margin: var(--abus-space-md) 0 var(--abus-space-sm);
}


/* ============================================================
   Vorlesen — Hervorhebung des gesprochenen Satzes (speech.js; Servicedoku
   2026-08-18, Mobile 2026-09-14)
   Zwei Ebenen, damit man den Faden nicht verliert: der aktuelle ABSATZ wird
   dezent unterlegt, der gerade gesprochene SATZ deutlich. Bewusst KEIN
   Textfarben-Wechsel: die Handbuchtexte tragen selbst Farbbedeutung
   (Quellenangabe/Textfarbe), die hier nicht überschrieben werden darf.
   Die Marker setzt/entfernt speech.js; nach dem Vorlesen ist der Absatz
   wieder exakt der ursprüngliche HTML-Stand.
   ============================================================ */
.dq-speak-block {
  background: rgba(0, 90, 170, 0.06);
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgba(0, 90, 170, 0.06);
}
.dq-speak-hl {
  background: rgba(255, 180, 0, 0.38);   /* --abus-amber, transparent */
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 180, 0, 0.5);
}
/* Waehrend des Vorlesens ist ein Klick in den Text ein Sprungbefehl
   ("hier weiterlesen") — der Zeiger sagt das an. */
body.dq-speak-on .docs-page p,
body.dq-speak-on .docs-page li,
body.dq-speak-on .docs-page h2,
body.dq-speak-on .docs-page h3,
body.dq-speak-on .docs-page tr { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .dq-speak-block, .dq-speak-hl { box-shadow: none; }
}


/* ============================================================
   Chapter tiles on the Start page (Mobile PHBs, 2026-09-14, FH)
   theme.js builds one tile per top-level chapter of the manual (Allgemein,
   Bedienen, Montieren und anschließen, Prüfen, Instand halten — whichever the
   product has) and places the grid in "Start" ABOVE "Auf einen Blick":
     <div class="abus-tiles abus-tiles--chapters">
       <a class="abus-tile" href="#allgemein">
         <span class="abus-tile__title">Allgemein</span>
         <span class="abus-tile__subtitle">Betrifft jeden, der mit dem Kran …</span>
       </a>
       …
     </div>
   Same look as the Servicedoku role tiles (dark blue --abus-tile-bg = the
   docx tile fill #00467B, white centred text).
   ============================================================ */
:root {
  --abus-tile-bg: #00467B;
}

.abus-doc .abus-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--abus-space-md);
  margin: var(--abus-space-md) 0;
}

.abus-doc a.abus-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: #FFFFFF;
  background-color: var(--abus-tile-bg);
  padding: var(--abus-space-lg) var(--abus-space-md);
  min-height: 8rem;
  border-radius: 4px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.abus-doc a.abus-tile:hover,
.abus-doc a.abus-tile:focus {
  filter: brightness(1.15);
  transform: translateY(-1px);
  text-decoration: none;
}

.abus-tile__title {
  font-size: var(--abus-fs-lg);
  font-weight: bold;
  margin-bottom: var(--abus-space-xs);
}

.abus-tile__subtitle {
  font-size: var(--abus-fs-sm);
  opacity: 0.85;
}


/* ============================================================
   Indented paragraph (Einrück) — <p class="abus-indent">
   ============================================================ */
.abus-indent {
  padding-left: var(--abus-indent);
}


/* ============================================================
   Instruction list (Anweisung) — <ol class="abus-instruction">
   Result list   (Resultat)    — <ul class="abus-result">
   Shared alignment: marker right-edges line up, text starts at the same column.
   Word: Anweisung uses a picture bullet (image1.png, arrow); Resultat uses ●.
   ============================================================ */
.abus-instruction,
.abus-result {
  list-style: none;
  padding-left: 0;
  margin: var(--abus-space-sm) 0;
}

.abus-instruction > li,
.abus-result > li {
  position: relative;
  padding-left: var(--abus-indent);
}

.abus-instruction > li { margin-bottom: var(--abus-space-sm); }
.abus-result > li      { margin-bottom: var(--abus-space-xs); }

.abus-instruction > li::before,
.abus-result > li::before {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--abus-indent) - 0.5rem);
  text-align: right;
  color: var(--abus-text);
}

.abus-instruction > li::before {
  content: "➔";
  font-weight: bold;
}

.abus-result > li::before {
  content: "●";
}


/* ============================================================
   Bullet list (Aufzählung) — <ul class="abus-bullet">
   Word marker: ─ (long horizontal line). Nests with the same marker.
   ============================================================ */
.abus-bullet {
  list-style-type: "–  ";
  padding-left: var(--abus-indent);
  margin: var(--abus-space-sm) 0;
}

.abus-bullet > li {
  margin-bottom: var(--abus-space-xs);
}

.abus-bullet .abus-bullet {
  margin: var(--abus-space-xs) 0;
}

/* ============================================================
   Behind-text watermark — a Word "behind text" floating graphic (e.g. the
   warning triangle the template places BEHIND a safety instruction list).
   convert.ps1 tags these (behindDoc) and polish.ps1 lifts the flattened inline
   <img> onto the containing block as .abus-watermark; the background-image url() is supplied by a small per-list
   inline <style> (so it resolves against the page, not /_assets/css/). Rendered
   as a faint, non-interactive layer
   behind the text (mirrors the print layout) so the content stays legible.
   ============================================================ */
.abus-watermark {
  position: relative;
}
.abus-watermark::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0.25rem;
  width: 12rem;
  height: 10.5rem;          /* ~ the docx mark's 2.39in x 2.1in aspect ratio */
  background-repeat: no-repeat;
  background-position: top left;
  background-size: contain;
  filter: grayscale(1);  /* colourless — black & white only, no yellow */
  opacity: 0.1;             /* faint — a backdrop, not a focal image */
  pointer-events: none;
  z-index: 0;
}
.abus-watermark > li {       /* keep list text above the watermark layer */
  position: relative;
  z-index: 1;
}

/* Leading warning pictogram inside a text block. The ABUS safety symbols
   (WMF->PNG: warning triangle, electrical hazard, suspended load) are recorded
   in the docx at a large layout width (~2.4in) but are icons on the web. When
   one opens a list item or paragraph (followed by text), cap it to icon size
   and float it so the text wraps alongside. Standalone photos live in <figure>
   (never a bare leading <img> before text), so they are unaffected. */
.abus-doc li > img:first-child,
.abus-doc p > img:first-child:not(:only-child) {
  float: left;
  max-width: 2.75rem;
  height: auto;
  margin: 0.1rem 0.7rem 0.2rem 0;
}
.abus-doc .abus-bullet > li:has(> img:first-child) {
  display: flow-root;   /* contain the floated icon within the list item */
  list-style: none;     /* the pictogram stands in for the – marker */
}


/* ============================================================
   Note callout (Hinweis) — bold amber text, no box
   <p class="abus-note">…</p>
   ============================================================ */
.abus-note {
  font-size: var(--abus-fs-sm);
  font-weight: bold;
  color: var(--abus-amber);
  margin: var(--abus-space-md) 0;
}


/* ============================================================
   Cross-reference note (pictogram + text) — authored in Word as a
   borderless 2-column table: a narrow column with a small "see other
   manual" pictogram, beside reference text (one row per reference).
   polish.ps1 rewrites that table into this box. The pictogram floats at
   the left; the text stays left-aligned (the raw <table> otherwise
   rendered its first row as a bold, centered <th>).
   <aside class="abus-ref-note"><img class="abus-ref-note__icon" …>
     <div class="abus-ref-note__body"><p>…</p></div></aside>
   ============================================================ */
.abus-ref-note {
  display: flex;
  align-items: flex-start;
  gap: var(--abus-space-md);
  background-color: var(--abus-grey-shade);
  padding: var(--abus-space-sm) var(--abus-space-md);
  margin: var(--abus-space-md) 0;
}
.abus-ref-note__icon {
  flex: 0 0 auto;
  width: 1.75em;
  height: auto;
  margin-top: 0.15em;
}
.abus-ref-note__body {
  margin: 0;
  font-size: var(--abus-fs-sm);
}
.abus-ref-note__body > :first-child { margin-top: 0; }
.abus-ref-note__body > :last-child  { margin-bottom: 0; }


/* ============================================================
   Safety callout (Sicherheit) — grey-shaded boxed warning
   <aside class="abus-safety">
     <p class="abus-safety__signal">Warnung</p>
     <p class="abus-safety__body">…</p>
   </aside>
   ============================================================ */
.abus-safety {
  background-color: var(--abus-grey-shade);
  border: 1px solid var(--abus-text);
  padding: 0.75rem 1rem;
  margin: var(--abus-space-md) 0;
  font-size: var(--abus-fs-lg);
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 1rem;
  align-items: start;
}

.abus-safety::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  width: 2.5rem;
  height: 2.5rem;
  /* Rueckfall ohne @icon (2026-09-08): das allgemeine Warnzeichen in ISO-Gelb wie
     die Bibliotheks-Piktogramme (_Bausteine\media\pikto-*), nicht mehr der
     schwarze Umriss - ein fehlendes Icon sieht damit nie "falsch" aus. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M32 4 L62 58 L2 58 Z' fill='%23f7c600' stroke='%231a1a1a' stroke-width='4' stroke-linejoin='round'/><rect x='29.2' y='20' width='5.6' height='22' rx='1.5' fill='%231a1a1a'/><circle cx='32' cy='49.5' r='3.6' fill='%231a1a1a'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 0.35rem;
  align-self: start;
}

.abus-safety > * {
  grid-column: 2;
}

/* When a real warning pictogram was captured from the docx (WMF->PNG), show it
   in the icon column and hide the generic CSS triangle, so each danger type
   displays its specific symbol (electrical hazard, suspended load, …) instead
   of one uniform placeholder. */
.abus-safety > .abus-safety__icon {
  grid-column: 1;
  grid-row: 1;
  width: 2.5rem;
  height: auto;
  margin-top: 0.35rem;
  align-self: start;
}
.abus-safety--has-icon::before {
  display: none;
}

.abus-safety__signal {
  text-transform: uppercase;  /* match the docx all-caps Sicherheit Titel display */
  font-weight: bold;
  font-style: italic;
  margin: 0 0 var(--abus-space-sm) 0;
}

.abus-safety__body {
  margin: 0;
}

/* Picture row of a safety box (2026-09-24). The ABUS template puts a hazard photo
   (~4.2 cm) and one or more 2 cm prohibition/mandatory signs BETWEEN the signal
   line and the text, in two table cells: photo left, signs stacked right. The Lua
   transform rebuilds that row as .abus-safety__pics with one .abus-safety__pic-cell
   per Word cell and one .abus-safety__pic-line per picture paragraph. The pictures
   keep their docx sizes (inline width:…in, like Word). When the row is wider than
   the box (phones) the cells shrink together and the pictures follow via max-width.
   Plain pictures — no popup, no float (the leading-pictogram rule above targets
   p > img and never reaches these divs). */
.abus-safety__pics {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0 0 0.75rem 0;
  max-width: 100%;
}
.abus-safety__pic-cell {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.abus-safety__pic-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 100%;
}
.abus-safety__pic-line > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* Un-boxed safety scheme (Sicherheit Titel + Sicherheit Text) —
   add `.abus-safety--inline` to the same markup to drop border + grey fill.
   Signal word becomes bold UPPERCASE (not bold italic). No warning icon. */
.abus-safety--inline {
  display: block;
  background-color: transparent;
  border: none;
  padding: 0;
  font-size: var(--abus-fs-base);
}

.abus-safety--inline::before {
  display: none;
}

.abus-safety--inline .abus-safety__signal {
  font-style: normal;
  text-transform: uppercase;
}


/* ============================================================
   Inline safety hint (Sicherheitshinweis) — bold paragraph, no box.
   <p class="abus-safety-hint">…</p>
   ============================================================ */
.abus-safety-hint {
  font-weight: bold;
  margin: var(--abus-space-sm) 0;
}


/* ============================================================
   Option callout (Option) — collapsible/expandable.
   <details class="abus-option" open>
     <summary class="abus-option__condition">Nur bei …</summary>
     <div class="abus-option__body">…</div>
   </details>
   Summary: bold UPPERCASE in a solid-grey bar with a chevron that flips.
   Body: dashed amber border on left, right, and bottom (flush with summary).
   Word's OptionAnfang/Mitte/Ende split (multi-page) collapses to one block.
   ============================================================ */
.abus-option {
  margin: var(--abus-space-md) 0;
}

.abus-option > .abus-option__condition {
  text-transform: uppercase;  /* match the docx all-caps display of the Optionsbedingung */
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--abus-text);
  padding: 0.6rem 1rem;
  margin: 0;
  font-style: italic;
  font-weight: bold;
  cursor: pointer;
}

.abus-option > .abus-option__condition::-webkit-details-marker {
  display: none;
}

.abus-option > .abus-option__condition::before {
  content: "";
  flex-shrink: 0;
  width: 0.9em;
  height: 0.9em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><polyline points='3 6 8 11 13 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s ease;
}

.abus-option[open] > .abus-option__condition::before {
  transform: rotate(180deg);
}

.abus-option > .abus-option__body {
  border-left: 2px dashed var(--abus-amber);
  border-right: 2px dashed var(--abus-amber);
  border-bottom: 2px dashed var(--abus-amber);
  padding: var(--abus-space-md);
}
/* A box that starts with a heading (elk "Kranposition prüfen"): the heading's
   chapter gap (h3 4.5 rem, h2 9 rem) must not open a hole under the condition
   bar — Word has a single empty line there. The body padding alone is that
   line (2026-09-15; same pattern as .abus-ref-note__body). */
.abus-option > .abus-option__body > :first-child {
  margin-top: 0;
}


/* ============================================================
   Figure (Bild + Bildbeschriftung) — grey-bordered, indented
   <figure class="abus-figure">
     <img src="…" alt="…">
     <figcaption>…</figcaption>
   </figure>
   Add .abus-figure--flush to remove the left indent (Bild normal).
   ============================================================ */
/* Fixed-width box: every standalone single-image figure renders at the same
   outer size regardless of the image's docx-recorded width. Smaller images
   stay at their native size left-aligned inside the box; wider images scale
   down via max-width:100% on .abus-figure > img. */
.abus-figure {
  border: 1px solid var(--abus-grey-border);
  padding: var(--abus-space-sm);
  /* Links eingerückt (Formatvorlage "Beschriftung Einrück"); --flush hebt das
     auf ("Bildbeschriftung" = Bild normal). Servicedoku-Fix 2026-08-19, hier
     2026-09-14 übernommen: das margin-Kurzschreiben "md 0" nullte die
     Einrückung, die --flush laut eigenem Kommentar entfernen soll. */
  margin: var(--abus-space-md) 0 var(--abus-space-md) var(--abus-indent);
  font-size: var(--abus-fs-sm);
  width: 370px;
  max-width: 100%;
}

.abus-figure--flush {
  margin-left: 0;
}

.abus-figure > img {
  max-width: 100%;
  height: auto;
  display: block;
  /* Image sits centered horizontally inside the fixed-width box. */
  margin-left: auto;
  margin-right: auto;
}

.abus-figure > figcaption {
  margin-top: var(--abus-space-sm);
  /* margin-left/right: auto centers the figcaption under the image when the
     Lua filter has set an inline width = image-width (so text-align:left/right
     anchors to the image's edges, not the wider figure box). */
  margin-left: auto;
  margin-right: auto;
  font-size: var(--abus-fs-sm);
  /* Bildbeschriftung is italic in the docx style — match it on figcaptions
     too. Top captions (.abus-figure__top) already get italic from their own
     rule below. text-align is set per-caption from the docx's <w:jc> via
     inline style on the figcaption / cap-item, so no default needed here. */
  font-style: italic;
}

/* Sized sub-captions (top caption or column-split caption) carry an inline
   `width: <image>` from the Lua filter. Inside the wider .abus-figure box,
   center them so they sit under the centered image; text inside the top
   caption also centers so single-line labels match the layout.
   Selector includes .abus-doc to beat the .abus-doc .abus-figure__top rule
   below (which sets `margin: 0 0 X 0` from the .figure-grid era and would
   otherwise win on source order at equal specificity). */
.abus-doc .abus-figure .abus-figure__top,
.abus-doc .abus-figure .abus-figure__cap-split {
  margin-left: auto;
  margin-right: auto;
}

.abus-doc .abus-figure .abus-figure__top {
  text-align: center;
}

/* Standalone caption (Bildbeschriftung / Beschriftung Einrück) —
   for captions outside a <figure>. Use --indent for the 1cm left-indent variant. */
.abus-caption {
  font-style: italic;
  font-size: var(--abus-fs-sm);
  margin: 0 0 var(--abus-space-sm);
}

.abus-caption--indent {
  padding-left: var(--abus-indent);
}


/* ============================================================
   Table of contents (Inhaltsverzeichnis / Auf einen Blick)
   <nav class="abus-toc">
     <ul>
       <li><a href="#chapter">Chapter</a> <span class="page">7</span>
         <ul>
           <li><a href="#section">Section</a> <span class="page">8</span></li>
         </ul>
       </li>
     </ul>
   </nav>
   ============================================================ */
.abus-doc nav.abus-toc {
  background: #fafafa;
  padding: 1rem 1.5rem;
  margin: var(--abus-space-md) 0 var(--abus-space-lg);
  border-left: 3px solid var(--abus-blue);
}

.abus-doc nav.abus-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.abus-doc nav.abus-toc > ul > li {
  font-weight: bold;
  margin: 0.4rem 0 0.2rem;
}

.abus-doc nav.abus-toc > ul > li > ul > li {
  font-weight: normal;
  padding-left: 1.5rem;
  margin: 0.1rem 0;
}

.abus-doc nav.abus-toc a {
  text-decoration: none;
}

.abus-doc nav.abus-toc a:hover,
.abus-doc nav.abus-toc a:focus {
  text-decoration: underline;
}

.abus-doc nav.abus-toc .page {
  float: right;
  color: #666;
}


/* ============================================================
   Figure grid — multi-image side-by-side layout (from Word
   layout tables that group multiple Bildbeschriftung cells).
   <div class="figure-grid">
     <figure><img src="…"><figcaption>…</figcaption></figure>
     <figure><img src="…"><figcaption>…</figcaption></figure>
   </div>
   ============================================================ */
/* Flex (not grid) so each figure stays at its docx-recorded width instead of
   stretching to fill 1fr tracks. Wide viewports were spreading 3 small
   figures across the whole article column; flex with flex-wrap keeps them
   tightly packed at their natural widths, like the docx table they came
   from, and wraps the row when more figures don't fit.

   gap is 0 because each figure has its own 1px border; the negative right/
   bottom margins on the figures themselves overlap adjacent borders so the
   visible line between cells is 1px (Word's border-collapse behaviour). */
.abus-doc .figure-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: var(--abus-space-md) 0;
}

/* Mehrbild-Raster aus einer in Word eingerückten Bildtabelle ("Bild Einrück",
   tblInd 1 cm). Der Einzug kommt seit 2026-09-15 aus convert.ps1
   (Set-FigureIndentTags) über den Lua-Filter; Einzelbilder tragen dafür
   .abus-figure OHNE --flush. */
.abus-doc .figure-grid--indent {
  margin-left: var(--abus-indent);
}

.abus-doc .figure-grid figure {
  /* Shrink-wrap to the image width so a flex-laid-out figcaption (e.g.
     Bauart's "HT D | HT S" two-column labels) aligns with the image edges
     instead of the grid-cell edges. Left-aligned inside the cell so figures
     line up with the body text. Grey border + padding matches the standalone
     .abus-figure style.
     Negative right/bottom margins overlap adjacent figures' borders so the
     visible inter-cell line is 1px, not 2px. */
  margin: 0 -1px -1px 0;
  width: fit-content;
  border: 1px solid var(--abus-grey-border);
  padding: var(--abus-space-sm);
}

.abus-doc .figure-grid figcaption {
  text-align: left;
  font-style: italic;
  font-size: var(--abus-fs-sm);
  margin-top: var(--abus-space-sm);
}

/* Top caption (Word caption row that appears ABOVE the image in the docx).
   Same styling as <figcaption>, but spaced beneath itself instead of above.
   Selector is unscoped so it also applies inside .abus-figure (single-image
   grids are unwrapped into .abus-figure for the uniform box width). */
.abus-doc .abus-figure__top {
  text-align: left;
  font-style: italic;
  font-size: var(--abus-fs-sm);
  margin: 0 0 var(--abus-space-sm) 0;
}

/* When the caption cell doesn't span the whole image (Word puts each label
   in its own column, e.g. Bauart: "HT D / Direktsteuerung" left, "HT S /
   Schützsteuerung" right; or "Schmelzeinsatz" labelling only cols 2-3 of a
   3-col fuse image), the Lua filter emits the caption inside a CSS grid
   whose `grid-template-columns` (inline) replicates the docx column widths
   as fr units, and each <span> carries an inline `grid-column: X / span Y`
   matching its docx column range. Captions that already cover the full
   image width are emitted as plain text without this wrapper. */
.abus-doc .abus-figure__cap-split {
  display: grid;
  gap: var(--abus-space-sm);
  /* Inline `width: <image>` from the Lua filter pins this to the image. Cap
     here so narrow viewports (where the image shrinks via max-width:100%)
     don't leave the caption overflowing the figure body. */
  max-width: 100%;
}
.abus-doc .abus-figure__cap-item {
  text-align: center;
  /* min-width: 0 lets the grid column respect its declared percentage instead
     of growing to fit the longest single word. With default white-space and
     overflow-wrap, multi-word labels wrap at spaces when their column is too
     narrow (matching Word's auto-wrap behavior for narrow caption columns).
     Single long words like "Spannelement" never break — they overflow into
     the figure box's side slack instead. */
  min-width: 0;
}

.abus-doc .figure-grid img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

/* Nummern rundum (Gerätebeschreibung, 2026-08-26): Positionsnummern LINKS/RECHTS
   neben dem Bild. .abus-figure__mid ist ein inline-block-Rahmen um das Bild; die
   Nummern sitzen absolut daran (top in % der Bildhöhe) und ragen in den seitlichen
   Rand, den margin-left/right freihalten (Breite per --abus-side-l/-r aus der
   Quelle, sonst 1.6em). Bewusst kein Flex/Grid: so rendert es auch WeasyPrint. */
.abus-doc .abus-figure__mid { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
.abus-doc .abus-figure__mid--links { margin-left: var(--abus-side-l, 1.6em); }
.abus-doc .abus-figure__mid--rechts { margin-right: var(--abus-side-r, 1.6em); }
.abus-doc .abus-figure__mid > img { display: block; max-width: 100%; height: auto; }
.abus-doc .abus-figure__side {
  position: absolute; margin-top: -0.55em; line-height: 1.1;
  font-style: italic; font-size: var(--abus-fs-sm); white-space: nowrap;
}
.abus-doc .abus-figure__side--links { right: 100%; padding-right: 0.45em; text-align: right; }
.abus-doc .abus-figure__side--rechts { left: 100%; padding-left: 0.45em; text-align: left; }

/* On phones the connected figure boxes stack vertically; each otherwise keeps
   its own docx-recorded inch width, so the stacked boxes end at different
   widths and their borders don't line up. Give them a uniform full width and
   centre the image + caption inside. */
@media (max-width: 768px) {
  .abus-doc .figure-grid figure {
    width: 100% !important;   /* beat the inline per-image inch width */
  }
  .abus-doc .figure-grid img,
  .abus-doc .figure-grid figcaption {
    margin-left: auto;
    margin-right: auto;
  }
}


/* ============================================================
   Missing image placeholder — for figures whose source image
   was linked externally and isn't available in the output.
   <span class="img-missing">[Bild: Beschreibung]</span>
   ============================================================ */
.abus-doc .img-missing {
  display: block;
  background: #fafafa;
  border: 1px dashed var(--abus-grey-border);
  padding: 1.5rem;
  text-align: center;
  color: #888;
  font-size: var(--abus-fs-sm);
  font-style: italic;
}


/* ============================================================
   Data table (Tabelle Daten) — blue horizontal rules with column-
   separator gaps, no vertical borders. Matches the Word "Tabelle
   Daten" style in Produkthandbuch 2022.dotm: insideV is rendered as
   white (sz=24) which Word draws as a whitespace gap between
   columns; we mirror that with `border-collapse: separate` plus
   `border-spacing` instead of vertical CSS borders. Every rule is
   the same 1pt weight (no thicker header rule).
   <table class="abus-table">
     <thead><tr><th>…</th></tr></thead>
     <tbody><tr><td>…</td></tr></tbody>
   </table>
   ============================================================ */
.abus-table {
  border-collapse: separate;
  border-spacing: 0.33rem 0;
  width: 100%;
  /* Auto layout (2026-09-15, was fixed): the Word-derived inline width
     (e.g. style="width:39%") and the colgroup percentages are now a
     MINIMUM/proportion hint, not a cage. Columns grow to fit their words,
     the table grows up to the article width, and words are broken only as
     a last resort (overflow-wrap: anywhere on the cells, below). With
     fixed layout a 4-column table at 39 % of a narrow article (open
     sidebar, tablet, half-screen window — above the 768 px phone rule)
     chopped "Werkstoff" → "Werkst|off", "Größe" → "Größ|e". The old fixed
     layout's purpose — long words like "Elektromagnetische" must not push
     the table past a phone screen — is kept by `anywhere`: it counts as a
     break opportunity for the table's minimum width, so the table can
     always shrink to max-width: 100 %. */
  table-layout: auto;
  max-width: 100%;
  margin: var(--abus-space-md) 0;
  font-size: var(--abus-fs-sm);
}

/* Full text width on screen (FH's boss, 2026-09-24): pandoc writes the Word table
   width as a share of the PAGE text width, and the manuals are set in two Word
   columns — a table that fills one Word column arrives as style="width:45%" and
   showed at 45 % of the single-column web article. The inline style beats the
   plain width: 100% above, so this rule takes it back with !important; the
   colgroup percentages scale with it (polish.ps1 6d normalises them to sum 100
   for new conversions). Screen only: print/PDF keep the Word width, as before.
   The narrow-article rules below (fit-content scroll block) still win there —
   they come later with the same importance. */
@media screen {
  .abus-table {
    width: 100% !important;
  }
}

.abus-table th,
.abus-table td {
  padding: 0.4rem 0;
  text-align: left;
  vertical-align: top;
  border: none;
  border-top: 1px solid var(--abus-blue);
  font-weight: normal;
  /* break-word does NOT count as a break opportunity for the column's
     min-content width, so auto layout must give every column at least its
     longest word — a word that fits the article is never split; the table
     grows instead. (`anywhere` would shrink min-content to one character
     and let the layout keep the narrow colgroup share → "Schm|ierun|g".)
     No word-break: break-word any more (it split words at will). */
  overflow-wrap: break-word;
}

.abus-table thead th {
  font-weight: normal;
  background-color: transparent;
}

.abus-table tr:last-child > th,
.abus-table tr:last-child > td {
  border-bottom: 1px solid var(--abus-blue);
}

/* On phones, ignore the narrow Word-derived table width (e.g.
   style="width:44%") and let the table span the full page width. The
   colgroup percentages stay relative to the table, so the columns just
   scale up proportionally to fill it. Wider screens keep the original
   document proportions. */
/* Narrow-ARTICLE rules (container query, 2026-09-15 — replaced the 768 px
   viewport rule; .abus-doc is the query container, see its declaration).

   ≤ 800 px article (640 until the elk switch-position matrix, whose longest
   words need ≈ 760 px, was found overhanging at 646–746 px): never split
   words, scroll instead. The table element
   becomes a full-width scroll container; its colgroup/thead/tbody form an
   anonymous table inside (CSS 2.1 §17.2.1), which is sized to its content:
   as wide as its longest words need (break-word keeps that honest), at most
   the article — and when even the longest words do not fit (12-column speed
   tables, long article codes) the table scrolls sideways instead of
   chopping "Größe" or "3000". The Word colgroup percentages are dropped so
   the width is shared by content, not by the print layout. border-collapse/
   spacing are inherited by the anonymous table, so the look is unchanged; a
   table with little content is only as wide as its content (as in Word).

   ≤ 480 px article (phone, or tablet with open sidebar): one type step-down
   (15 → 13 px) with tighter spacing, so borderline tables fit without a
   scrollbar. Genuinely wide tables still scroll — no width rule can fit a
   12-column landscape table into 330 px without splitting words. */
@container abus-doc (max-width: 800px) {
  .abus-table {
    /* fit-content (not 100 %): the block shrinks to the anonymous table
       inside it, so borders/backgrounds on the block end at the table lines
       (Servicedoku tint). max-width keeps it at the article width when the
       table is wider → overflow-x scrolls. !important beats pandoc's inline
       style="width: N%". */
    width: fit-content !important;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .abus-table col {
    width: auto !important;   /* beat pandoc's inline <col style="width: N%"> */
  }
}
@container abus-doc (max-width: 480px) {
  .abus-table {
    font-size: calc(var(--abus-fs-sm) * 0.87);
    border-spacing: 0.25rem 0;
  }
  .abus-table th,
  .abus-table td {
    padding: 0.3rem 0;
  }
}
/* Fallback for browsers without container queries (before 2023): the former
   viewport rule with the same scroll behaviour, no step-down. */
@supports not (container-type: inline-size) {
  @media (max-width: 768px) {
    .abus-table {
      width: fit-content !important;
      max-width: 100%;
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .abus-table col {
      width: auto !important;
    }
  }
}


/* A short paragraph that introduces a data table (e.g. "Maße und
   Gewichte:") is that table's heading in the Word source. Bind it to the
   table that follows — a generous gap above (separating it from the
   preceding table or body text) and only a hairline gap below — so a run
   of consecutive data tables reads as several distinct tables, each under
   its own heading, instead of one continuous grid. This mirrors the blank
   paragraph Word leaves between the sub-tables. */
.abus-doc p:has(+ .abus-table) {
  margin-top: var(--abus-space-lg);
  margin-bottom: var(--abus-space-xs);
}
.abus-doc p:has(+ .abus-table) + .abus-table {
  margin-top: var(--abus-space-xs);
}


/* ============================================================
   Error table (Fehlertabelle) — blue header rules, no side borders
   <table class="abus-table abus-table--error">…
   ============================================================ */
.abus-table--error th,
.abus-table--error td {
  border: none;
  padding: 0.5rem 0.75rem;
}

.abus-table--error thead th {
  background-color: transparent;
  border-top: 3px solid var(--abus-blue);
  border-bottom: 3px solid var(--abus-blue);
}

.abus-table--error tbody tr:nth-child(even) {
  background-color: transparent;
}

.abus-table--error tbody tr:nth-child(odd) {
  background-color: #FFFFFF;
}


/* ============================================================
   Damage table (Schaden) — same base as data table, kept distinct
   <table class="abus-table abus-table--damage">…
   ============================================================ */
.abus-table--damage thead th {
  background-color: var(--abus-blue);
  color: #FFFFFF;
}
