/* Werkbank des Diamantlabors (14.11.2026). Systemschrift, Glasflächen, hell und dunkel, Container Queries, Faltgeräte. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --fg: #1d1d1f; --leise: #6e6e73; --leiser: #a1a1a6;
  --karte: rgba(255, 255, 255, 0.72); --karte-fest: #ffffff; --haar: rgba(0, 0, 0, 0.08); --licht: rgba(255, 255, 255, 0.9);
  --akzent: #0071e3; --akzent-auf: #ffffff; --gut: #1a8f4c; --warn: #b26a00; --rot: #e0352b; --gruen-strahl: #2fb344;
  --tisch: #e9e9ee; --loch: rgba(0, 0, 0, 0.13); --metall-1: #f4f5f7; --metall-2: #b9bcc4; --dunkel-1: #4a4d55; --dunkel-2: #23252a;
  --glas-1: rgba(160, 205, 255, 0.55); --glas-2: rgba(255, 255, 255, 0.85); --kupfer: #c9772f; --platine: #2f7d57; --stein: #ffd5dc;
  --spur: #0a8f5a; --raster: rgba(0, 0, 0, 0.1); --schirm: #fbfbfd; --glut: 0.5;
  --feder: cubic-bezier(0.22, 1, 0.36, 1); --r-gross: 24px; --r-mittel: 16px; --r-klein: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-thema="hell"]) {
  --bg: #000000; --fg: #f5f5f7; --leise: #a1a1a6; --leiser: #6e6e73; --karte: rgba(28, 28, 30, 0.72); --karte-fest: #1c1c1e; --haar: rgba(255, 255, 255, 0.12); --licht: rgba(255, 255, 255, 0.16);
  --akzent: #2997ff; --akzent-auf: #000000; --gut: #30d158; --warn: #ffb340; --rot: #ff453a; --gruen-strahl: #32d74b;
  --tisch: #1a1a1d; --loch: rgba(255, 255, 255, 0.14); --metall-1: #8d9099; --metall-2: #3d4047; --dunkel-1: #3a3c42; --dunkel-2: #111214;
  --glas-1: rgba(120, 170, 235, 0.4); --glas-2: rgba(255, 255, 255, 0.35); --kupfer: #d98a45; --platine: #2a6e4d; --stein: #ffb3c0;
  --spur: #32d74b; --raster: rgba(255, 255, 255, 0.12); --schirm: #0b0f0d;
} }
:root[data-thema="dunkel"] {
  --bg: #000000; --fg: #f5f5f7; --leise: #a1a1a6; --leiser: #6e6e73; --karte: rgba(28, 28, 30, 0.72); --karte-fest: #1c1c1e; --haar: rgba(255, 255, 255, 0.12); --licht: rgba(255, 255, 255, 0.16);
  --akzent: #2997ff; --akzent-auf: #000000; --gut: #30d158; --warn: #ffb340; --rot: #ff453a; --gruen-strahl: #32d74b;
  --tisch: #1a1a1d; --loch: rgba(255, 255, 255, 0.14); --metall-1: #8d9099; --metall-2: #3d4047; --dunkel-1: #3a3c42; --dunkel-2: #111214;
  --glas-1: rgba(120, 170, 235, 0.4); --glas-2: rgba(255, 255, 255, 0.35); --kupfer: #d98a45; --platine: #2a6e4d; --stein: #ffb3c0;
  --spur: #32d74b; --raster: rgba(255, 255, 255, 0.12); --schirm: #0b0f0d;
}
:root[data-schrift="gross"] { font-size: 150%; }
* { box-sizing: border-box; }
html { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--fg); min-height: 100dvh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60rem 36rem at 38% 34%, color-mix(in srgb, var(--rot) calc(var(--glut) * 22%), transparent), transparent 70%); transition: background 0.5s var(--feder); }
button { font: inherit; color: inherit; cursor: pointer; }
.rahmen { position: relative; z-index: 1; container-type: inline-size; container-name: rahmen; max-width: 1400px; margin: 0 auto; padding: clamp(0.75rem, 2.2cqi, 1.75rem); padding-bottom: 6.5rem; transition: max-width 0.45s var(--feder); }
body[data-ansicht="kompakt"] .rahmen { max-width: 390px; outline: 1px solid var(--haar); border-radius: 32px; }
body[data-ansicht="faltbar"] .rahmen { max-width: 800px; outline: 1px solid var(--haar); border-radius: 28px; }
body[data-ansicht="faltbar"] .rahmen::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: repeating-linear-gradient(var(--leiser) 0 6px, transparent 6px 12px); pointer-events: none; }

.kopf { display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; margin-bottom: clamp(0.75rem, 2cqi, 1.25rem); }
.marke { font-size: clamp(1.25rem, 1rem + 1.4cqi, 1.9rem); font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.6rem; }
.marke .glimmer { width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--rot); opacity: calc(0.35 + var(--glut) * 0.65); box-shadow: 0 0 calc(var(--glut) * 1.1rem) var(--rot); transition: all 0.4s var(--feder); }
.privat { font-size: 0.72rem; font-weight: 500; color: var(--leise); border: 1px solid var(--haar); border-radius: 99px; padding: 0.15rem 0.6rem; letter-spacing: 0; }
.versuche { display: flex; gap: 0.4rem; margin-left: auto; flex-wrap: wrap; }
/* Auftakt: beim ersten Besuch Überschrift, zwei Sätze und Startknopf; danach nur noch eine Zeile unter „Werkbank“ */
.auftakt { flex-basis: 100%; min-width: 0; margin: 0.4rem 0 0.2rem; }
.auftakt h1 { font-size: clamp(1.75rem, 1.15rem + 3.2cqi, 3.1rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.07; margin: 0 0 0.55rem; max-width: 18ch; overflow-wrap: anywhere; }
.auftakt p { font-size: clamp(0.95rem, 0.88rem + 0.4cqi, 1.12rem); color: var(--leise); line-height: 1.45; max-width: 58ch; margin: 0 0 0.95rem; overflow-wrap: anywhere; }
.auftakt .haupt { font-size: 1rem; padding: 0.72rem 1.35rem; }
body[data-auftakt="kurz"] .kopf { row-gap: 0.2rem; }
body[data-auftakt="kurz"] .auftakt { margin: 0; }
body[data-auftakt="kurz"] .auftakt h1 { font-size: 0.92rem; font-weight: 500; letter-spacing: 0; line-height: 1.3; color: var(--leise); margin: 0; max-width: none; }
body[data-auftakt="kurz"] .auftakt p, body[data-auftakt="kurz"] .auftakt .haupt { display: none; }
/* Der Schalter für die Magnete leuchtet nach dem Start einmal auf, damit das Auge ihn findet */
@keyframes hinweisen { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--akzent) 55%, transparent); } 60% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--akzent) 0%, transparent); } 100% { box-shadow: none; } }
#dauer-magnet.hinweisen .wahl { animation: hinweisen 0.9s var(--feder) 0.1s 2; border-radius: 99px; }
@media (prefers-reduced-motion: reduce) { #dauer-magnet.hinweisen .wahl { animation: none; outline: 2px solid var(--akzent); outline-offset: 3px; } }
.pillenknopf { border: 1px solid var(--haar); background: var(--karte); border-radius: 99px; padding: 0.45rem 0.9rem; font-size: 0.86rem; color: var(--leise); transition: transform 0.2s var(--feder), background 0.2s; backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.pillenknopf:hover { transform: scale(1.03); color: var(--fg); }
.pillenknopf:active { transform: scale(0.97); }
.pillenknopf[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: transparent; }
.pillenknopf small { opacity: 0.6; margin-left: 0.35rem; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 8px; }

.bank { display: grid; gap: clamp(0.75rem, 1.6cqi, 1.25rem); grid-template-columns: minmax(0, 1fr); }
@container rahmen (min-width: 900px) { .bank { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; } }
body[data-ansicht="faltbar"] .bank { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 2rem; }
@media (horizontal-viewport-segments: 2) { .bank { grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0); column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); } .rahmen { max-width: none; padding-inline: 0; } }
.karte { background: var(--karte); border: 1px solid var(--haar); border-top-color: var(--licht); border-left-color: var(--licht); border-radius: var(--r-gross); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); padding: clamp(0.9rem, 1.8cqi, 1.35rem); min-width: 0; }
.geraete { display: grid; gap: clamp(0.75rem, 1.6cqi, 1.25rem); min-width: 0; }
.kartenkopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.6rem; }
.kartenkopf h2 { font-size: 1.02rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.kartenkopf span { font-size: 0.8rem; color: var(--leise); }
.aufgabe { font-size: clamp(1.02rem, 0.9rem + 0.7cqi, 1.3rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 0.3rem; max-width: 34ch; overflow-wrap: anywhere; }
.unter { font-size: 0.9rem; color: var(--leise); margin: 0 0 0.8rem; max-width: 60ch; line-height: 1.45; overflow-wrap: anywhere; }

.buehne { position: relative; border-radius: var(--r-mittel); overflow: hidden; background: var(--tisch); border: 1px solid var(--haar); touch-action: pan-y; }
.buehne.drei { background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--karte-fest) 92%, var(--fg)), color-mix(in srgb, var(--bg) 88%, var(--fg))); }
.buehne canvas { display: block; cursor: grab; outline-offset: -3px; }
.buehne canvas:active { cursor: grabbing; }
.marken { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.marken span { position: absolute; left: 0; top: 0; font-size: 0.7rem; font-weight: 500; color: var(--fg); background: var(--karte); border: 1px solid var(--haar); border-radius: 99px; padding: 0.08rem 0.5rem; white-space: nowrap; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); will-change: transform; }
.buehne svg { display: block; width: 100%; height: auto; }
.teil { cursor: pointer; transition: transform 0.25s var(--feder), filter 0.25s; transform-box: fill-box; transform-origin: center; outline: none; }
.teil:hover, .teil:focus-visible { filter: brightness(1.08) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)); }
.teil:focus-visible .umriss { stroke: var(--akzent); stroke-width: 1.2; }
.teil.gewaehlt .umriss { stroke: var(--akzent); stroke-width: 1.2; }
.magnet { cursor: ew-resize; }
.schild { font-size: 4.2px; fill: var(--leise); font-weight: 500; pointer-events: none; }
.schild.hell { fill: var(--fg); }
.glut { transition: opacity 0.35s var(--feder), r 0.35s var(--feder); }
.rast { fill: none; stroke: var(--gut); stroke-width: 0.8; opacity: 0; }
.rast.an { animation: rast 0.6s var(--feder); }
@keyframes rast { 0% { opacity: 0.9; r: 5; } 100% { opacity: 0; r: 26; } }
.tischfuss { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; margin-top: 0.7rem; font-size: 0.8rem; color: var(--leise); }
.tischfuss .rechts { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.still { border: 1px solid var(--haar); background: transparent; border-radius: 99px; padding: 0.4rem 0.85rem; font-size: 0.84rem; transition: transform 0.2s var(--feder), background 0.2s; }
.still:hover { background: var(--haar); transform: scale(1.03); }
.still:active { transform: scale(0.97); }
.still[hidden] { display: none; }
.still[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: transparent; }
.haupt { border: 0; background: var(--akzent); color: var(--akzent-auf); border-radius: 99px; padding: 0.6rem 1.25rem; font-size: 0.95rem; font-weight: 600; transition: transform 0.2s var(--feder), opacity 0.2s; }
.haupt:hover { transform: scale(1.04); }
.haupt:active { transform: scale(0.96); }
.haupt[aria-busy="true"] { opacity: 0.6; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr)); gap: 0.5rem; margin-top: 0.7rem; }
.kachel { background: color-mix(in srgb, var(--fg) 5%, transparent); border-radius: var(--r-klein); padding: 0.55rem 0.7rem; min-width: 0; }
.kachel .name { font-size: 0.74rem; color: var(--leise); display: flex; align-items: center; gap: 0.35rem; overflow-wrap: anywhere; }
.kachel .zahl { font-size: clamp(1.05rem, 0.95rem + 0.5cqi, 1.35rem); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kachel .zahl small { font-size: 0.62em; font-weight: 500; color: var(--leise); margin-left: 0.2em; }
.beleg { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; display: inline-block; background: var(--leiser); }
.beleg.belegt { background: var(--gut); } .beleg.geeicht { background: var(--akzent); } .beleg.naeherung { background: var(--warn); } .beleg.schaetzung { background: var(--leiser); }
.legende { display: flex; gap: 0.3rem 0.9rem; flex-wrap: wrap; font-size: 0.74rem; color: var(--leise); margin-top: 0.7rem; }
.legende span { display: inline-flex; align-items: center; gap: 0.3rem; }
.hinweis { margin-top: 0.7rem; border-radius: var(--r-klein); padding: 0.6rem 0.8rem; font-size: 0.86rem; line-height: 1.4; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--fg); overflow-wrap: anywhere; }
.erfolg { background: color-mix(in srgb, var(--gut) 16%, transparent); }
.simulation { border: 1px dashed var(--haar); border-radius: var(--r-klein); padding: 0.6rem 0.75rem 0.75rem; margin-top: 0.7rem; }
.simulation > p { margin: 0; font-size: 0.76rem; color: var(--leise); }

.schirm { background: var(--schirm); border-radius: var(--r-mittel); border: 1px solid var(--haar); overflow: hidden; }
.schirm svg { display: block; width: 100%; height: auto; }
.schirm .raster { stroke: var(--raster); stroke-width: 1; }
.schirm .spur { fill: none; stroke: var(--spur); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.schirm .marke-linie { stroke: var(--leiser); stroke-width: 1; stroke-dasharray: 3 4; }
.schirm text { fill: var(--leise); font-size: 11px; font-variant-numeric: tabular-nums; }
.schirm .leer { fill: var(--leise); font-size: 14px; }
.regler { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.4rem 0.75rem; margin-top: 0.8rem; font-size: 0.86rem; }
.regler label { color: var(--leise); }
.regler output { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 4.5rem; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--akzent); height: 1.6rem; cursor: pointer; }
.wahl { display: inline-flex; border: 1px solid var(--haar); border-radius: 99px; padding: 2px; }
.wahl button { border: 0; background: transparent; border-radius: 99px; padding: 0.3rem 0.75rem; font-size: 0.82rem; color: var(--leise); transition: background 0.2s; }
.wahl button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.8rem; }
.veraltet { opacity: 0.45; transition: opacity 0.3s; }
.zeile[hidden] { display: none; }
.schirm .band { fill: var(--spur); opacity: 0.2; stroke: none; }
#oszi-meldung .klein { margin-top: 0.5rem; }

dialog.blatt { border: 1px solid var(--haar); border-top-color: var(--licht); border-radius: var(--r-gross); background: var(--karte); color: var(--fg); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  padding: 1.25rem 1.35rem 1.4rem; width: min(30rem, calc(100vw - 1.5rem)); max-height: min(44rem, calc(100dvh - 1.5rem)); overflow: auto; view-transition-name: blatt; }
dialog.blatt::backdrop { background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.blatt[open] { animation: auf 0.32s var(--feder); }
@keyframes auf { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@media (max-width: 560px) { dialog.blatt { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--r-gross) var(--r-gross) 0 0; padding-bottom: calc(1.4rem + env(safe-area-inset-bottom)); } }
.blatt h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 2.2rem 0.15rem 0; overflow-wrap: anywhere; }
.blatt .art { font-size: 0.82rem; color: var(--leise); margin: 0 0 0.8rem; }
.blatt .zu { position: absolute; top: 0.9rem; right: 0.9rem; width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--haar); font-size: 1rem; line-height: 1; }
.werte { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.1rem; }
.werte li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.55rem; align-items: baseline; padding: 0.42rem 0; border-top: 1px solid var(--haar); font-size: 0.9rem; }
.werte li .q { grid-column: 2 / 4; font-size: 0.74rem; color: var(--leise); overflow-wrap: anywhere; }
.werte li b { font-weight: 600; font-variant-numeric: tabular-nums; }
.blatt h3 { font-size: 0.78rem; font-weight: 600; color: var(--leise); text-transform: none; margin: 1.1rem 0 0.4rem; }
.tausch { display: grid; gap: 0.4rem; }
.tausch button { text-align: left; border: 1px solid var(--haar); background: transparent; border-radius: var(--r-klein); padding: 0.55rem 0.75rem; font-size: 0.88rem; display: flex; justify-content: space-between; gap: 0.75rem; transition: background 0.2s, transform 0.2s var(--feder); overflow-wrap: anywhere; }
.tausch button:hover { background: var(--haar); transform: scale(1.01); }
.tausch button[aria-pressed="true"] { border-color: var(--akzent); }
.tausch button span:last-child { color: var(--leise); white-space: nowrap; }
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.9rem; }
.schalter input { appearance: none; -webkit-appearance: none; flex: none; width: 3.1rem; height: 1.85rem; border-radius: 99px; background: color-mix(in srgb, var(--fg) 18%, transparent); position: relative; cursor: pointer; transition: background 0.25s var(--feder); margin: 0; }
.schalter input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.85rem - 4px); height: calc(1.85rem - 4px); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.28s var(--feder); }
.schalter input:checked { background: var(--gut); }
.schalter input:checked::after { transform: translateX(1.25rem); }
details.weg { margin-top: 0.8rem; font-size: 0.84rem; }
details.weg summary { cursor: pointer; color: var(--leise); padding: 0.3rem 0; }
details.weg ol { margin: 0.4rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.5rem; }
details.weg li { line-height: 1.4; overflow-wrap: anywhere; }
details.weg li small { display: block; color: var(--leise); }

.unten { position: fixed; left: 50%; bottom: calc(0.7rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; display: none; gap: 0.2rem; padding: 0.3rem; border-radius: 99px; background: var(--karte); border: 1px solid var(--haar); border-top-color: var(--licht); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.unten button { border: 0; background: transparent; border-radius: 99px; padding: 0.55rem 1.05rem; font-size: 0.86rem; }
.unten button:hover { background: var(--haar); }
@media (max-width: 899px) { .unten { display: flex; } body .pille { bottom: calc(4.4rem + env(safe-area-inset-bottom)); } }
body[data-ansicht="kompakt"] .unten, body[data-ansicht="faltbar"] .unten { display: flex; }
body[data-ansicht="kompakt"] .pille, body[data-ansicht="faltbar"] .pille { bottom: calc(4.4rem + env(safe-area-inset-bottom)); }
body[data-ansicht="kompakt"] .unten { max-width: 366px; }

.pille { position: fixed; right: 0.8rem; bottom: calc(0.8rem + env(safe-area-inset-bottom)); z-index: 9; font-size: 0.74rem; background: var(--karte); border: 1px solid var(--haar); border-radius: 18px; padding: 0.45rem 0.55rem; backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); display: grid; gap: 0.35rem; max-width: calc(100vw - 1.6rem); }
.pille[data-zu="true"] .reihe { display: none; }
.pille .reihe { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.pille .reihe > span { color: var(--leise); min-width: 3.6rem; }
.pille button { border: 1px solid var(--haar); background: transparent; border-radius: 99px; padding: 0.2rem 0.55rem; font-size: 0.72rem; }
.pille button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: transparent; }
.pille .griff { border: 0; font-weight: 600; text-align: right; padding: 0.1rem 0.3rem; }
.meldung { position: fixed; left: 50%; top: 1rem; transform: translate(-50%, -150%); z-index: 20; background: var(--fg); color: var(--bg); border-radius: 99px; padding: 0.55rem 1.1rem; font-size: 0.88rem; transition: transform 0.35s var(--feder); max-width: calc(100vw - 2rem); }
.meldung.an { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* Blick-Knöpfe im 3D-Tisch */
.blicke { position: absolute; left: 0.6rem; bottom: 0.6rem; display: flex; gap: 0.3rem; flex-wrap: wrap; max-width: calc(100% - 1.2rem); }
.blicke button { border: 1px solid var(--haar); border-top-color: var(--licht); background: var(--karte); color: var(--fg); border-radius: 99px; padding: 0.28rem 0.7rem; font-size: 0.74rem; backdrop-filter: blur(14px) saturate(180%); -webkit-backdrop-filter: blur(14px) saturate(180%); transition: transform 0.2s var(--feder), background 0.2s; }
.blicke button:hover { transform: scale(1.05); }
.blicke button:active { transform: scale(0.95); }

/* Oszilloskop als Gerät: dunkles Gehäuse, Schirm mit nachleuchtender Spur, in beiden Themen gleich */
.gehaeuse { background: linear-gradient(#30323a, #17181c); border-radius: 20px; padding: 0.7rem 0.7rem 0.55rem; border: 1px solid rgba(255, 255, 255, 0.1); border-bottom-color: rgba(0, 0, 0, 0.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 30px -14px rgba(0, 0, 0, 0.55); }
.gehaeuse .schirm { --spur: #5dffa1; --raster: rgba(120, 255, 175, 0.14); --leise: rgba(190, 255, 215, 0.72); --leiser: rgba(190, 255, 215, 0.45); background: radial-gradient(120% 100% at 50% 40%, #0c1a13, #050a07); border: 1px solid #000; border-radius: 10px; box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.9); }
.gehaeuse .schirm .spur { filter: drop-shadow(0 0 2.5px rgba(93, 255, 161, 0.9)) drop-shadow(0 0 8px rgba(93, 255, 161, 0.35)); }
.blende { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.25rem 0; font-size: 0.72rem; color: rgba(255, 255, 255, 0.62); letter-spacing: 0.02em; }
.blende .rechts { margin-left: auto; font-variant-numeric: tabular-nums; }
.lampe { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #30d158; box-shadow: 0 0 6px #30d158; }
.lampe.misst { background: #ffb340; box-shadow: 0 0 8px #ffb340; animation: blink 0.5s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Bauplan: Stufenleiste, Stufenkarte, Werkzeug, Blätter (Schritt A, 14.11.2026) */
.bauplan { margin-bottom: clamp(0.75rem, 1.6cqi, 1.25rem); container-type: inline-size; container-name: bauplan; }
.stufenleiste { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr)); gap: 0.45rem; }
.stufe { text-align: left; border: 1px solid var(--haar); border-top-color: var(--licht); background: color-mix(in srgb, var(--fg) 4%, transparent); border-radius: var(--r-mittel); padding: 0.55rem 0.75rem; display: grid; gap: 0.1rem; min-width: 0; transition: transform 0.2s var(--feder), background 0.2s, border-color 0.2s; }
.stufe:hover { transform: scale(1.02); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.stufe:active { transform: scale(0.98); }
.stufe[aria-current="step"] { border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); background: color-mix(in srgb, var(--akzent) 9%, transparent); }
.stufe .nr { font-size: 0.72rem; color: var(--leise); display: flex; align-items: center; gap: 0.35rem; overflow-wrap: anywhere; }
.stufe .nr i { width: 0.45rem; height: 0.45rem; border-radius: 50%; flex: none; background: var(--warn); }
.stufe .nr i.gut { background: var(--gut); }
.stufe .kurz { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stufenkarte { display: grid; gap: 0.2rem 1.5rem; grid-template-columns: minmax(0, 1fr); margin-top: 0.9rem; }
@container bauplan (min-width: 780px) { .stufenkarte { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.stufenkarte h2 { font-size: clamp(1.1rem, 0.95rem + 0.8cqi, 1.45rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 0.3rem; overflow-wrap: anywhere; }
.stufenkarte .unter { margin-bottom: 0.2rem; }
.kachel.knopf { border: 0; text-align: left; font: inherit; color: inherit; display: block; width: 100%; transition: transform 0.2s var(--feder), background 0.2s; }
.kachel.knopf:hover { transform: scale(1.02); background: color-mix(in srgb, var(--fg) 9%, transparent); }
.kachel.knopf:active { transform: scale(0.98); }
.kachel .woher { font-size: 0.7rem; color: var(--akzent); margin-top: 0.15rem; }
.etikett { font-size: 0.74rem; font-weight: 600; color: var(--leise); margin: 0.2rem 0 0.4rem; }
.marken-reihe { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.marke-knopf { border: 1px solid var(--haar); background: color-mix(in srgb, var(--warn) 13%, transparent); border-radius: 99px; padding: 0.32rem 0.7rem; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2rem; transition: transform 0.2s var(--feder), background 0.25s; overflow-wrap: anywhere; text-align: left; }
.marke-knopf::before { content: "+"; font-weight: 600; color: var(--warn); }
.marke-knopf[aria-pressed="true"] { background: color-mix(in srgb, var(--gut) 15%, transparent); }
.marke-knopf[aria-pressed="true"]::before { content: "✓"; color: var(--gut); }
.marke-knopf.kann { background: transparent; border-style: dashed; }
.marke-knopf:hover { transform: scale(1.04); }
.marke-knopf:active { transform: scale(0.95); }
.baubar { font-size: 0.84rem; margin: 0.55rem 0 0; line-height: 1.4; overflow-wrap: anywhere; }
/* Stand der Stufe: was gemessen ist und was als Nächstes ansteht, direkt unter dem Titel */
.standzeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.6rem; margin: 0.15rem 0 0.55rem; font-size: 0.84rem; line-height: 1.4; }
.standzeile .gemessen { padding: 0.12rem 0.55rem; border-radius: 99px; background: var(--karte); border: 1px solid var(--haar); color: var(--leise); white-space: nowrap; }
.standzeile .als-naechstes { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.standzeile .soll { color: var(--leise); }
/* Werkzeug eingeklappt: oben nur die Zählung, darunter die Knöpfe */
details.werkzeugliste { margin: 0.2rem 0 0.5rem; }
details.werkzeugliste summary { cursor: pointer; font-size: 0.86rem; padding: 0.35rem 0; list-style-position: inside; }
details.werkzeugliste summary .fehlt { color: var(--warn); } details.werkzeugliste summary .gut { color: var(--gut); }
details.werkzeugliste[open] summary { margin-bottom: 0.4rem; }
details.werkzeugliste .etikett { margin: 0.6rem 0 0.35rem; }
/* Prüfwerte: auf breiten Bildschirmen immer offen und ohne Kopfzeile, auf schmalen eine Zeile zum Aufklappen */
details.pruefliste > summary { cursor: pointer; font-size: 0.86rem; padding: 0.35rem 0; color: var(--fg); overflow-wrap: anywhere; }
details.pruefliste > summary span { color: var(--leise); }
details.pruefliste[open] > summary { margin-bottom: 0.3rem; }
@media (min-width: 701px) { details.pruefliste > summary { display: none; } }
.baubar.gut { color: var(--gut); } .baubar.fehlt { color: var(--warn); }
.klein { font-size: 0.8rem; color: var(--leise); line-height: 1.45; margin: 0.6rem 0 0; overflow-wrap: anywhere; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
/* Schmal: Die Werkzeug-Marken stehen nur im Werkzeugkasten, in der Karte bleibt der eine Satz dazu. */
@container bauplan (max-width: 779px) { .stufenkarte .marken-reihe, .stufenkarte .etikett { display: none; } .stufenkarte .baubar { margin-top: 0.8rem; } }
.leerstand { padding: 0.4rem 0; }
/* Kaufteile mit Bezugsquellen */
.kaufteil { border-top: 1px solid var(--haar); padding: 0.85rem 0 0.2rem; }
.kaufteil:first-of-type { margin-top: 0.8rem; }
.kaufteil.vorhanden { opacity: 0.6; }
.kaufteil.vorhanden b { text-decoration: line-through; }
.kaufkopf { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.95rem; line-height: 1.35; overflow-wrap: anywhere; }
.kaufkopf b { font-weight: 600; min-width: 0; }
.kaufteil .klein { margin: 0.25rem 0 0; }
.kaufwozu { font-size: 0.9rem; line-height: 1.45; margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.kaufteil .knoepfe { margin-top: 0.55rem; }
a.still { text-decoration: none; color: inherit; display: inline-flex; align-items: baseline; gap: 0.4rem; }
a.still.link { border-color: color-mix(in srgb, var(--akzent) 45%, var(--haar)); }
a.still.link::after { content: "↗"; color: var(--akzent); font-size: 0.8em; }
a.still small { color: var(--leise); font-size: 0.72rem; }
.doku a { color: var(--akzent); overflow-wrap: anywhere; }
dialog.blatt.breit { width: min(46rem, calc(100vw - 1.5rem)); }
@media (max-width: 560px) { dialog.blatt.breit { width: 100vw; } }
.blatt ul.punkte, .blatt ol.wegliste { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.45rem; font-size: 0.9rem; line-height: 1.45; }
.blatt ul.punkte li, .blatt ol.wegliste li { overflow-wrap: anywhere; }
.blatt ol.wegliste li .beleg { margin-right: 0.4rem; }
.blatt ol.wegliste li small { display: block; color: var(--leise); font-size: 0.74rem; }
.blatt .grosszahl { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 0.1rem 0 0.2rem; overflow-wrap: anywhere; }
.blatt .grosszahl small { font-size: 0.5em; font-weight: 500; color: var(--leise); margin-left: 0.25em; }
.blatt code, .stufenkarte code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; background: color-mix(in srgb, var(--fg) 7%, transparent); border-radius: 5px; padding: 0.05em 0.3em; overflow-wrap: anywhere; }
.blatt details.mehr { margin-top: 0.9rem; border-top: 1px solid var(--haar); padding-top: 0.5rem; }
.blatt details.mehr summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; padding: 0.3rem 0; }
.blatt details.mehr h4 { font-size: 0.86rem; margin: 0.9rem 0 0.35rem; }
.doku { font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.doku h3 { font-size: 1.02rem; color: var(--fg); margin: 1.2rem 0 0.4rem; }
.doku h4 { font-size: 0.9rem; margin: 1rem 0 0.3rem; }
.doku p { margin: 0.5rem 0; }
.doku ul, .doku ol { margin: 0.4rem 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.doku pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.78rem; line-height: 1.5; background: color-mix(in srgb, var(--fg) 6%, transparent); border-radius: var(--r-klein); padding: 0.7rem 0.8rem; margin: 0.5rem 0; }
.doku pre code { background: none; padding: 0; font-size: inherit; }
.doku img { display: block; width: 100%; height: auto; border-radius: var(--r-klein); border: 1px solid var(--haar); }
.tausch a { text-decoration: none; color: inherit; border: 1px solid var(--haar); border-radius: var(--r-klein); padding: 0.55rem 0.75rem; font-size: 0.88rem; display: flex; justify-content: space-between; gap: 0.75rem; overflow-wrap: anywhere; transition: background 0.2s, transform 0.2s var(--feder); }
.tausch a:hover { background: var(--haar); transform: scale(1.01); }
.tausch a span:last-child { color: var(--leise); white-space: nowrap; }
.stufenkarte.frisch { animation: stufe-auf 0.28s var(--feder); }
@keyframes stufe-auf { from { opacity: 0; transform: translateY(8px); } }

/* Schritt B: ein Druckteil allein auf dem Druckbett */
.teilschau { border-radius: var(--r-mittel); overflow: hidden; border: 1px solid var(--haar); background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--karte-fest) 92%, var(--fg)), color-mix(in srgb, var(--bg) 88%, var(--fg))); min-height: 190px; display: grid; }
.teilschau canvas { display: block; }
.teilschau .klein { margin: auto; }

/* Vollbild und Zerlegen am 3D-Tisch (14.11.2026) */
.zerleger { position: absolute; left: 50%; top: 0.6rem; transform: translateX(-50%); display: grid; grid-template-columns: auto minmax(5rem, 16rem) auto; align-items: center; gap: 0.1rem 0.6rem; padding: 0.4rem 0.9rem; max-width: calc(100% - 1.2rem); box-sizing: border-box;
  border-radius: 18px; background: var(--karte); border: 1px solid var(--haar); border-top-color: var(--licht); border-left-color: var(--licht); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); font-size: 0.74rem; color: var(--leise); }
.zerleger[hidden] { display: none; }
.zerleger input { width: 100%; min-width: 0; min-height: 1.7rem; margin: 0; accent-color: var(--akzent); cursor: ew-resize; }
.zerleger small { grid-column: 1 / -1; text-align: center; color: var(--fg); font-weight: 500; font-size: 0.74rem; }
.vollleiste { display: none; }
.teilname { position: absolute; left: 50%; top: 5rem; transform: translate(-50%, -0.4rem); opacity: 0; pointer-events: none; white-space: nowrap; max-width: calc(100% - 1.2rem); overflow: hidden; text-overflow: ellipsis; box-sizing: border-box;
  padding: 0.3rem 0.85rem; border-radius: 99px; background: var(--fg); color: var(--bg); font-size: 0.82rem; font-weight: 600; transition: opacity 0.2s, transform 0.25s var(--feder); }
.teilname.an { opacity: 1; transform: translate(-50%, 0); }
.buehne.zerlegt .marken, .buehne.voll .marken { display: none; }
html.voll-an { overflow: hidden; }
.buehne.voll { position: fixed; inset: 0; z-index: 50; width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; color: var(--fg); }
.buehne.voll:fullscreen { width: 100%; height: 100%; }
.buehne.voll .zerleger { top: calc(0.8rem + env(safe-area-inset-top)); }
.buehne.voll .teilname { top: calc(5.2rem + env(safe-area-inset-top)); }
.buehne.voll .vollleiste { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem; flex-wrap: wrap; position: absolute; left: calc(0.7rem + env(safe-area-inset-left)); right: calc(0.7rem + env(safe-area-inset-right)); bottom: calc(0.7rem + env(safe-area-inset-bottom));
  padding: 0.4rem; border-radius: 22px; background: var(--karte); border: 1px solid var(--haar); border-top-color: var(--licht); border-left-color: var(--licht); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.vollleiste .links, .vollleiste .rechts { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.vollleiste .rechts { margin-left: auto; }
.vollleiste .blicke { position: static; max-width: none; }
.vollleiste .still { font-size: 0.8rem; padding: 0.32rem 0.8rem; }

/* Stufe 2: das Qubit als Pfeil in einer Kugel (Bloch-Kugel). Der Pfeil wird kürzer, wenn die Fehlstellen auseinanderlaufen. */
.qubit { display: flex; gap: 1rem; align-items: center; margin: 0.6rem 0 0.2rem; padding: 0.7rem 0.9rem; border-radius: var(--r-mittel); background: var(--karte); border: 1px solid var(--haar); }
.qubit .kugel { flex: 0 0 auto; width: clamp(108px, 30%, 150px); }
.qubit .kugel svg { display: block; width: 100%; height: auto; overflow: visible; }
.qubit .kugeltext { min-width: 0; }
.qubit .kugeltext p { margin: 0.25rem 0 0; overflow-wrap: anywhere; }
.kugel .huelle { fill: none; stroke: var(--leiser); stroke-width: 1; }
.kugel .gleicher { fill: none; stroke: var(--leiser); stroke-width: 0.8; stroke-dasharray: 3 3; }
.kugel .achse { stroke: var(--leiser); stroke-width: 0.6; }
.kugel .schatten { fill: var(--akzent); opacity: 0.08; }
.kugel .pfeil { stroke: var(--akzent); stroke-width: 3; stroke-linecap: round; transition: all 0.18s var(--feder); }
.kugel .spitze { fill: var(--akzent); transition: all 0.18s var(--feder); }
.kugel .lot { stroke: var(--akzent); stroke-width: 0.8; stroke-dasharray: 2 2; opacity: 0.6; }
.kugel text { fill: var(--leise); font-size: 11px; }
.schirm .zeitmarke { stroke: var(--akzent); stroke-width: 1.5; opacity: 0.85; }
.schirm .punkt { fill: var(--spur); }
@media (prefers-reduced-motion: reduce) { .kugel .pfeil, .kugel .spitze { transition: none; } }
@container (max-width: 380px) { .qubit { flex-direction: column; align-items: flex-start; } }
/* Ausgeblendete Teile des Oszilloskops: display aus den Regeln oben darf hidden nicht überstimmen */
.qubit[hidden], .regler[hidden], .zeile[hidden] { display: none; }
/* Stufe 3: zwei Qubits. Vier Felder für die Zustände, die Linie über die Ecke zeigt, wie fest sie verbunden sind. */
.schirm .vergleich { fill: none; stroke: var(--spur); stroke-width: 1.3; stroke-dasharray: 5 4; opacity: 0.55; }
.paar .rahmen { fill: none; stroke: var(--leiser); stroke-width: 0.8; }
.paar .feld { fill: var(--akzent); opacity: 0.8; transition: all 0.2s var(--feder); }
.paar .verbindung { stroke: var(--akzent); stroke-linecap: round; opacity: 0.45; transition: stroke-width 0.2s var(--feder); }
.paar text { fill: var(--leise); font-size: 9px; }
.paar text.wert { fill: var(--fg); font-size: 10px; font-weight: 600; }
/* Zwei Qubits brauchen mehr Platz als die Kugel: Bild oben, Text darunter */
.qubit.zwei { flex-direction: column; align-items: stretch; }
.qubit.zwei .kugel { width: min(100%, 230px); align-self: center; }
.klein-wahl { margin-top: 0.6rem; flex-wrap: wrap; }
.klein-wahl button { font-size: 0.78rem; padding: 0.25rem 0.6rem; }
.wahl[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .paar .feld, .paar .verbindung { transition: none; } }
