/* "Toon stappen": animated walk-through (steps.js). Everything is scoped under .steps-view. */
.steps-view {
  --st-ink: #1c2330; --st-muted: #6b7482; --st-line: #e3e6ea; --st-red: #6aaf70;
  --st-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; color: #e8ecf2;
  background: radial-gradient(120% 90% at 50% 0%, #20402f 0%, #173229 45%, #0c1a14 100%);
  opacity: 0; transition: opacity .35s ease, transform .45s cubic-bezier(.3,.7,.2,1); transform: scale(1.01);
  user-select: none; -webkit-user-select: none;
}
.steps-view.open { opacity: 1; transform: none; }
.steps-view.closing { opacity: 0; transform: scale(.985); }

/* bar: document name · chapter tabs · controls */
.st-bar { flex: none; height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(10,14,20,.35); }
.st-doc { font-size: 13px; color: rgba(232,236,242,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; align-items: center; gap: 10px; }
.st-doc b { color: #fff; font-weight: 600; background: var(--st-red); border-radius: 6px; padding: 3px 8px; font-size: 12px; letter-spacing: .02em; flex: none; }
.st-tabs { display: flex; gap: 4px; }
.st-tab { position: relative; appearance: none; border: 0; background: transparent; color: rgba(232,236,242,.55); font: inherit; font-size: 13.5px; padding: 9px 14px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; overflow: hidden; transition: color .2s, background .2s; }
.st-tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.st-tab .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; border: 1px solid rgba(255,255,255,.25); transition: all .2s; }
.st-tab.on { color: #fff; }
.st-tab.on .n { background: var(--st-red); border-color: var(--st-red); }
.st-tab.done .n { border-color: rgba(255,255,255,.5); color: #fff; }
.st-tab .prog { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; opacity: 0; transition: opacity .2s; }
.st-tab.on .prog { opacity: 1; }
.st-tab .prog i { position: absolute; inset: 0; background: #8cc891; transform-origin: left; transform: scaleX(0); }
.st-tab.last { color: rgba(232,236,242,.7); }
.st-sep { width: 1px; height: 20px; background: rgba(255,255,255,.12); align-self: center; margin: 0 6px; }
.st-ctl { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.st-btn { appearance: none; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #e8ecf2; font: inherit; font-size: 13px; height: 32px; min-width: 32px; padding: 0 10px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; transition: all .15s; }
.st-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.st-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.st-btn.close { font-size: 19px; line-height: 1; margin-left: 6px; }

/* stage: absolutely positioned panels (poses set by steps.js), link layer, WebGL layer on top */
.st-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.st-el { position: absolute; left: 0; top: 0; will-change: transform, opacity; backface-visibility: hidden;
  transition: transform .8s cubic-bezier(.65,.05,.25,1), opacity .7s ease; }
.st-el.no-anim, .st-el.no-anim * { transition: none !important; }
.st-gl, .st-links { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.st-gl { z-index: 4; width: 100%; height: 100%; }
.st-links { overflow: visible; }
.st-links path { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.st-links circle { stroke: #fff; stroke-width: 1.5; }
.st-loading { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; color: rgba(232,236,242,.6); font-size: 14px; letter-spacing: .02em; }
.st-loading::before { content: ""; width: 22px; height: 22px; margin-bottom: 56px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: #8cc891; animation: st-spin .9s linear infinite; grid-area: 1 / 1; }
@keyframes st-spin { to { transform: rotate(360deg); } }

/* document page (a stack of sheets, one visible; a sheet turns away like a book page) */
.st-page { perspective: 2200px; }
.st-sheet { position: absolute; inset: 0; background: #fff; border-radius: 2px; box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.25); transform-origin: left center; backface-visibility: hidden; }
.st-sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.st-sheet.flip { z-index: 3; animation: st-flip .4s cubic-bezier(.55,.05,.35,1) forwards; }
@keyframes st-flip { 0% { transform: rotateY(0); } 100% { transform: rotateY(-96deg) translateX(-2%); opacity: .2; box-shadow: 0 24px 60px rgba(0,0,0,0); } }
.st-pno { position: absolute; right: 8px; bottom: -26px; font-size: 12px; color: rgba(232,236,242,.5); font-variant-numeric: tabular-nums; }
.st-beam { position: absolute; left: -6px; right: -6px; height: 0; pointer-events: none; z-index: 4; opacity: 0; }
.st-beam::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(to bottom, rgba(106,175,112,0), rgba(106,175,112,.13)); }
.st-beam::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; border-radius: 2px; background: #6aaf70; box-shadow: 0 0 10px 2px rgba(140,200,145,.75), 0 0 28px 6px rgba(106,175,112,.35); }

/* shared panel chrome */
.st-panel { background: #fff; color: var(--st-ink); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.4); display: flex; flex-direction: column; overflow: hidden; border-top: 3px solid #6aaf70; }
.st-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--st-line); font-size: 13px; white-space: nowrap; }
.st-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st-red); flex: none; }
.st-head b { font-weight: 600; }
.st-head .sub { color: var(--st-muted); overflow: hidden; text-overflow: ellipsis; }
.st-head .count { margin-left: auto; color: var(--st-muted); font-family: var(--st-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.st-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; position: relative;
  scrollbar-width: thin; scrollbar-color: rgba(28,35,48,.22) transparent; }
.st-scroll::-webkit-scrollbar { width: 8px; }
.st-scroll::-webkit-scrollbar-thumb { background: rgba(28,35,48,.2); border-radius: 4px; }

/* OCR text panel: a monospaced grid, one div per layout line; cell size in CSS vars (--cw, --rh) */
.st-text { position: relative; padding: 14px 18px 40px; font-family: var(--st-mono); font-size: var(--fs); line-height: var(--rh); }
.st-text .ln { height: var(--rh); white-space: pre; color: transparent; transition: color .55s ease; }
.st-text.revealed .ln { color: var(--st-ink); }
.st-text .ln.sep { display: flex; align-items: center; gap: 10px; font-family: inherit; }
.st-text .ln.sep::before, .st-text .ln.sep::after { content: ""; flex: 1; border-top: 1px dashed transparent; transition: border-color .55s; }
.st-text.revealed .ln.sep { color: #9aa3af; }
.st-text.revealed .ln.sep::before, .st-text.revealed .ln.sep::after { border-color: #cfd5dd; }
.st-boxes { position: absolute; left: 18px; top: 14px; right: 0; bottom: 0; pointer-events: none; }
.st-box { position: absolute; border: 1.5px solid var(--c); border-radius: 3px; background: color-mix(in srgb, var(--c) 9%, transparent); opacity: 0; transform: scale(1.08); transition: opacity .3s ease, transform .4s cubic-bezier(.3,1.4,.5,1), background .3s; }
.st-box.line { border-width: 1.5px; background: color-mix(in srgb, var(--c) 5%, transparent); }
.st-box.part { border-width: 1px; border-radius: 2px; background: color-mix(in srgb, var(--c) 12%, transparent); }
.st-box.on { opacity: 1; transform: none; }
.st-box.hot { background: color-mix(in srgb, var(--c) 20%, transparent); }
.st-pill { position: absolute; left: -1.5px; bottom: calc(100% + 2px); background: var(--c); color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; font-size: 10.5px; font-weight: 600; line-height: 1; padding: 3px 6px 3px; border-radius: 4px; white-space: nowrap; opacity: 0; transform: translateY(3px); transition: opacity .25s, transform .3s; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.st-box.pill-on .st-pill { opacity: 1; transform: none; }

/* extraction card */
.st-card .st-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.st-card .tag { font-size: 11.5px; color: #173229; background: #edf5ee; border-radius: 10px; padding: 2px 8px; }
.st-cbody { padding: 12px 16px 24px; }
.c-sec + .c-sec { margin-top: 14px; }
.c-sec h4 { margin: 0 0 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--st-muted); display: flex; gap: 6px; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.c-f { position: relative; min-width: 0; padding: 3px 18px 4px 9px; border-left: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 0 5px 5px 0; transition: background .3s, border-color .3s; }
.c-f.wide { grid-column: span 2; }
.c-l { display: block; font-size: 10.5px; font-weight: 600; color: var(--c); opacity: .55; transition: opacity .3s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-v { display: block; font-size: 12.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.35em; }
.c-v .rest, .c-chip b .rest { color: transparent; }
.c-f.filled { border-left-color: var(--c); }
.c-f.filled .c-l { opacity: 1; }
.c-f.active, .c-line.active, .c-chip.active, .c-more.active { background: color-mix(in srgb, var(--c) 11%, transparent); }
.c-line { position: relative; padding: 5px 8px 6px 9px; border-left: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 0 6px 6px 0; margin-bottom: 5px; transition: background .3s, border-color .3s; }
.c-line.filled { border-left-color: var(--c); }
.c-lhead { position: relative; display: flex; gap: 8px; align-items: baseline; min-width: 0; padding-right: 16px; }
.c-pos { flex: none; font-weight: 700; font-size: 12.5px; color: var(--c); min-width: 14px; }
.c-raw { font-size: 11.5px; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.c-chips { display: flex; flex-wrap: wrap; gap: 4px 4px; margin-top: 4px; }
.c-chip { position: relative; font-size: 11.5px; line-height: 1.3; border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); border-radius: 5px; padding: 1px 6px; opacity: .45; transition: opacity .3s, background .3s, border-color .3s; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.c-chip.filled { opacity: 1; border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.c-chip i { font-style: normal; font-weight: 600; font-size: 10px; color: var(--c); margin-right: 4px; }
.c-chip b { font-weight: 500; }
.c-more { font-size: 12px; color: var(--st-muted); padding: 5px 9px; border-left: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 0 6px 6px 0; opacity: .5; transition: opacity .3s, background .3s, border-color .3s; }
.c-more.filled { opacity: 1; border-left-color: var(--c); }

@media (max-width: 1150px) { .st-doc span { display: none; } .st-tab { padding: 9px 9px; } }

/* chapter 3 "Artikelmatch": the order line (left) and the MARA article field (right; tiles drawn by WebGL) */
.m-body { padding: 12px 16px 24px; }
.m-sec + .m-sec { margin-top: 16px; }
.m-sec h4 { margin: 0 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--st-muted); }
.m-src { position: relative; padding: 26px 12px 10px; background: #f6f7f9; border: 1px solid var(--st-line); border-radius: 8px; font-family: var(--st-mono); font-size: var(--fs); line-height: var(--rh); overflow: hidden; }
.m-src .ln { height: var(--rh); white-space: pre; color: var(--st-ink); }
.m-src .st-boxes { left: 12px; top: 26px; }
.m-raw { font-size: 13px; line-height: 1.45; padding: 10px 12px; background: #f6f7f9; border-radius: 8px; }
.m-chips { margin-top: 0; gap: 5px; }
.m-chips .c-chip { font-size: 12.5px; padding: 2px 7px; transition: opacity .3s, background .3s, border-color .3s, box-shadow .3s, transform .3s; }
.m-chips .c-chip.active { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); transform: translateY(-1px); }
.m-fun { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.m-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 5px 9px; border-radius: 6px; opacity: 0; transform: translateX(-6px); transition: opacity .35s, transform .35s, background .3s; }
.m-row.on { opacity: .55; transform: none; }
.m-row.on.done, .m-row.cur { opacity: 1; }
.m-row.cur { background: color-mix(in srgb, var(--c) 11%, transparent); }
.m-row .d { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; align-self: center; }
.m-row .lb { font-weight: 600; color: var(--c); flex: none; }
.m-row .v { color: var(--st-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row .n { margin-left: auto; font-family: var(--st-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--st-muted); }
.m-row.cur .n { color: var(--st-ink); font-weight: 600; }
.m-res { opacity: 0; transition: opacity .1s; }
.m-res.on { opacity: 1; }
.m-res > :not(.m-slot) { opacity: 0; transform: translateY(4px); transition: opacity .45s .15s, transform .45s .15s; }
.m-res.on > * { opacity: 1; transform: none; }
.m-res.on > h4 { color: #15803d; }
.m-slot { aspect-ratio: 5 / 1; max-width: 360px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 5%; background: color-mix(in srgb, #16A34A 8%, #fff); border: 1.5px solid #16A34A; border-radius: 7px; box-shadow: 0 0 0 4px rgba(22,163,74,.12); container-type: inline-size; }
.m-slot b { font-size: 6.2cqw; color: var(--st-red); line-height: 1.1; }
.m-slot span { font-family: var(--st-mono); font-size: 4.4cqw; color: var(--st-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-conf { display: inline-block; margin-top: 8px; font-size: 11.5px; font-weight: 600; color: #15803d; background: #e8f6ee; border-radius: 10px; padding: 2px 9px; }
.m-why { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: #3d4654; }
.st-mara .m-filters { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--st-line); min-height: 20px; }
.m-pill { font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--st-ink); background: #fff; opacity: 0; transform: scale(.85); transition: opacity .3s, transform .35s cubic-bezier(.3,1.5,.5,1), background .3s, box-shadow .3s; white-space: nowrap; }
.m-pill i { font-style: normal; font-weight: 600; color: var(--c); margin-right: 5px; }
.m-pill.on { opacity: 1; transform: none; }
.m-pill.cur { background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }
.st-mara .m-field { flex: 1; min-height: 0; background: #f2f4f7; background-image: radial-gradient(rgba(28,35,48,.07) 1px, transparent 1px); background-size: 14px 14px; }
