/* ESP32 Lernportal – Design nach der Prezi „ESP32 Developement Board“
   Dunkler Platinen-Hintergrund, Work Sans, Sechsecke in Lachs (#FFAB92) und Hellgrau (#E6E6E6),
   Folien als helle Karten. Die Übungs-Engine (app.js) nutzt die Variablen unten. */
:root {
  --salmon: #ffab92;
  --orange: #ff7a52;
  --orange-dark: #e85336;
  --dark: #2c2c2e;
  --light: #e6e6e6;
  --lemon: #fafa78;
  --green: #2d9146;
  --night: #121a33;

  /* von app.js genutzt */
  --bg: #121a33;
  --card: #ffffff;
  --navy: #2c2c2e;
  --blue: #ff7a52;
  --blue-dark: #e85336;
  --teal: #646569;
  --red: #c0392b;
  --yellow: #fafa78;
  --text: #2c2c2e;
  --muted: #646569;
  --ok: #d4f5e0;
  --bad: #fbd6dc;
  --radius: 14px;
  --link: #d0451f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--light);
  line-height: 1.55;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(16, 24, 52, .86), rgba(16, 24, 52, .9)),
    url("https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1920&q=70"),
    url("img/bg-fallback.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3 { font-weight: 800; line-height: 1.12; margin: .3em 0 .45em; letter-spacing: .2px; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); }
h3 { font-size: 1.2rem; }
a { color: var(--salmon); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 22, 38, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topbar .inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.brand::before {
  content: ""; width: 20px; height: 23px; background: var(--salmon);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.brand span { font-weight: 400; opacity: .75; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 6px; }
.topbar nav a {
  color: var(--light); text-decoration: none; padding: 6px 12px; border-radius: 999px;
  font-size: .92rem; font-weight: 600; background: rgba(255, 255, 255, .07);
}
.topbar nav a:hover { background: rgba(255, 171, 146, .25); }
.topbar nav a.active { background: var(--salmon); color: var(--dark); }
.topbar nav a.fortschritt { border: 1px solid rgba(255, 171, 146, .6); }

main { max-width: 1200px; margin: 0 auto; padding: 28px 16px 80px; }

/* Zoom-Effekt beim Laden wie in Prezi */
@keyframes zoomIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
main > * { animation: zoomIn .55s cubic-bezier(.2, .8, .2, 1) both; }
main > *:nth-child(2) { animation-delay: .08s; }
main > *:nth-child(3) { animation-delay: .16s; }
main > *:nth-child(n+4) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) { main > * { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Sechsecke ---------- */
.hex {
  --size: 170px;
  width: var(--size); height: calc(var(--size) * 1.1547);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: rgba(255, 171, 146, .88);
  color: var(--dark);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 800; font-size: calc(var(--size) * .11); line-height: 1.15;
  padding: 0 calc(var(--size) * .12);
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, filter .2s ease;
  flex: 0 0 auto;
}
.hex.light { background: rgba(230, 230, 230, .9); }
.hex.lemon { background: rgba(250, 250, 120, .9); }
.hex.dim { background: rgba(255, 255, 255, .12); color: var(--light); }
a.hex:hover, a.hex:focus-visible { transform: scale(1.07); filter: brightness(1.06); }
a.hex:focus-visible { outline: none; filter: drop-shadow(0 0 0 #fff) brightness(1.15); }

/* ---------- Startseite (Prezi-Übersicht) ---------- */
.overview {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center;
  min-height: calc(100vh - 140px);
}
.title-block { position: relative; }
.title-row { display: flex; align-items: flex-start; gap: 18px; }
.title-row h1 { font-size: clamp(3.4rem, 10vw, 7.5rem); margin: 0; color: var(--light); letter-spacing: 2px; line-height: .95; }
.title-row .subtitle { font-size: clamp(1.3rem, 2.6vw, 2.1rem); font-weight: 400; color: rgba(230, 230, 230, .75); line-height: 1.15; margin-top: .4em; }
.board-circle {
  width: min(440px, 80vw); aspect-ratio: 1; border-radius: 50%;
  background: rgba(44, 44, 46, .55); margin: 26px 0 0 -10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.board-circle img { width: 92%; height: auto; transform: rotate(-8deg); }
.intro-text { max-width: 520px; color: rgba(230, 230, 230, .85); margin: 18px 0 0; }

.honeycomb { --h: 165px; display: flex; justify-content: center; gap: 10px; }
.honeycomb .col { display: flex; flex-direction: column; gap: 12px; }
.honeycomb .col.shifted { margin-top: calc(var(--h) * 1.1547 / 2 + 6px); }
.honeycomb .hex { --size: var(--h); }
@media (max-width: 520px) { .honeycomb { --h: 128px; } }

@media (max-width: 900px) {
  .overview { grid-template-columns: 1fr; min-height: 0; }
  .board-circle { margin: 20px auto 0; }
}

/* ---------- Themenseiten ---------- */
.topic-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 10px; }
.topic-head .hex { --size: 200px; }
.topic-head .lead { flex: 1 1 320px; font-size: 1.08rem; color: rgba(230, 230, 230, .9); }
.topic-head .lead p { margin: 0 0 .7em; }

.subnav { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 8px; }
.subnav .hex { --size: 118px; }

.section-title { display: flex; align-items: center; gap: 14px; margin: 46px 0 14px; scroll-margin-top: 80px; }
.section-title .hex { --size: 70px; font-size: .9rem; }
.section-title h2 { margin: 0; color: #fff; }
section { scroll-margin-top: 80px; }

/* Folien (Prezi-Seiten) */
.slide {
  background: #fff; color: var(--dark); border-radius: 6px;
  padding: clamp(18px, 3vw, 36px); margin: 16px 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.slide h3 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); margin-top: 0; padding-bottom: 10px; border-bottom: 4px solid var(--orange); display: inline-block; }
.slide img { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.slide figure { margin: 0; }
.slide figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.slide a { color: var(--link); word-break: break-word; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; align-items: start; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; }
.steps > li::before {
  content: counter(s) "."; font-weight: 800; font-size: 1.5rem; color: var(--orange); line-height: 1.2;
}
.steps > li[value]::before { content: attr(value) "."; }
.pfeil-liste { list-style: none; padding: 0; margin: 0; }
.pfeil-liste li { margin: 0 0 10px; padding-left: 22px; position: relative; }
.pfeil-liste li::before { content: "»"; position: absolute; left: 0; color: var(--orange); font-weight: 800; }
.hinweis { background: #fff4ef; border-left: 5px solid var(--orange); padding: 10px 14px; border-radius: 4px; font-size: .95rem; }
.label { display: inline-block; font-weight: 800; letter-spacing: 1px; color: var(--dark); background: var(--salmon); padding: 3px 12px; border-radius: 4px; }
.textbox { color: rgba(230, 230, 230, .9); max-width: 780px; }

/* Stapel (Prezi-Stack) mit Blättern */
.stack { position: relative; margin: 18px 0 30px; }
.stack-track { position: relative; }
.stack .slide { margin: 0; }
.stack.js .slide { display: none; }
.stack.js .slide.current { display: block; animation: zoomIn .35s ease both; }
.stack.js::before, .stack.js::after {
  content: ""; position: absolute; left: 14px; right: 14px; top: 10px; bottom: -10px;
  background: rgba(255, 255, 255, .5); border-radius: 6px; z-index: -1;
}
.stack.js::after { left: 28px; right: 28px; bottom: -20px; background: rgba(255, 255, 255, .25); }
.stack-ctrl { display: none; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.stack.js .stack-ctrl { display: flex; }
.stack-ctrl button { background: var(--salmon); color: var(--dark); border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.stack-ctrl button:hover { background: var(--orange); color: #fff; }
.stack-ctrl .dots { display: flex; gap: 6px; }
.stack-ctrl .dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.stack-ctrl .dots button[aria-current="true"] { background: var(--salmon); }
.stack-ctrl .count { color: var(--light); font-variant-numeric: tabular-nums; min-width: 4em; text-align: center; }

/* Befehls-Tabelle (Code | Erklärung) */
.cmd-table { width: 100%; border-collapse: collapse; display: table; }
.cmd-table td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
.cmd-table td:first-child { width: 52%; }
.cmd-table code { background: #f3f3f3; color: #b23a14; padding: 2px 6px; border-radius: 4px; }

/* Bilder zum Vergrößern */
img.zoom { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 28, .92);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; }

/* ---------- Karten, Kacheln, Tabellen (auch für Übungen) ---------- */
.card {
  background: var(--card); color: var(--text); border-radius: 6px;
  padding: 22px; margin: 18px 0; box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}
.card.accent { border-left: 6px solid var(--orange); }
.card.warn { border-left: 6px solid var(--lemon); background: #fffde8; box-shadow: none; }
.card.good { border-left: 6px solid var(--green); }
.card a { color: var(--link); }
.muted { color: var(--muted); }

.hero {
  background: rgba(44, 44, 46, .7); color: #fff; border-radius: 6px;
  padding: 30px 28px; margin-bottom: 24px; border-left: 8px solid var(--salmon);
}
.hero h1 { color: #fff; margin-top: 0; }
.hero p { max-width: 720px; margin: 0; opacity: .95; }
.hero .tag {
  display: inline-block; background: var(--salmon); color: var(--dark);
  font-weight: 800; padding: 4px 12px; border-radius: 4px; margin-bottom: 12px; font-size: .9rem;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 20px 0 30px; }
.tile {
  background: var(--orange); color: #fff; border-radius: 6px; padding: 20px 18px; text-decoration: none;
  min-height: 110px; display: flex; flex-direction: column; justify-content: space-between;
}
.tile .big { font-weight: 800; font-size: 1.35rem; }

code, pre, kbd { font-family: "Fira Code", Consolas, "Courier New", monospace; font-size: .92rem; }
pre { background: #1e1f24; color: #f3e9e4; padding: 12px 14px; border-radius: 6px; overflow-x: auto; margin: 10px 0; }
:not(pre) > code { background: rgba(255, 122, 82, .12); padding: 1px 6px; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; display: block; overflow-x: auto; }
th, td { padding: 9px 10px; border-bottom: 1px solid rgba(100, 101, 105, .25); text-align: left; vertical-align: top; }
th { background: rgba(255, 171, 146, .35); font-weight: 700; }
.vergleich { display: table; }
.vergleich th, .vergleich td { text-align: center; }
.vergleich th:first-child, .vergleich td:first-child { text-align: left; font-weight: 700; }

.pins { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.pins li { background: var(--dark); color: #fff; border-radius: 4px; padding: 2px 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pins li.warn { background: var(--orange); }

/* ---------- Buttons und Eingaben ---------- */
button, .btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 9px 16px;
  background: var(--orange); color: #fff; font-weight: 700; transition: background .15s ease, transform .05s ease;
}
button:hover { background: var(--orange-dark); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--teal); }
button.ghost { background: transparent; color: var(--text); border: 2px solid var(--orange); }
button.small { padding: 4px 10px; font-size: .9rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
input[type="text"], input[type="number"], select {
  font: inherit; padding: 8px 10px; border-radius: 6px; border: 2px solid rgba(255, 122, 82, .4);
  background: #fff; color: var(--text); max-width: 100%;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; }

.feedback { font-weight: 700; margin-top: 10px; min-height: 1.5em; }
.feedback.ok { color: var(--green); }
.feedback.bad { color: var(--red); }

/* Quiz */
.quiz-q { font-size: 1.15rem; font-weight: 600; margin: 8px 0 14px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opts button { background: #fff; color: var(--text); border: 2px solid rgba(255, 122, 82, .3); text-align: left; }
.quiz-opts button:hover:not(:disabled) { border-color: var(--orange); background: rgba(255, 122, 82, .08); }
.quiz-opts button.right { background: var(--ok); border-color: var(--green); }
.quiz-opts button.wrong { background: var(--bad); border-color: var(--red); }
.progress { height: 10px; background: rgba(100, 101, 105, .25); border-radius: 999px; overflow: hidden; margin: 10px 0 18px; }
.progress > div { height: 100%; background: var(--green); width: 0; transition: width .3s ease; }

/* Zuordnen */
.match-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(100, 101, 105, .35); }
.match-row .match-label { font-weight: 600; }
.match-row select { width: 100%; }
.match-row .mark { font-size: 1.3rem; min-width: 1.4em; text-align: center; }
@media (max-width: 560px) { .match-row { grid-template-columns: 1fr; } }

/* Reihenfolge */
.order-list { list-style: none; padding: 0; margin: 10px 0; }
.order-list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid rgba(255, 122, 82, .25); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; }
.order-list li.dragging { opacity: .5; }
.order-list li.over { border-color: var(--orange); border-style: dashed; }
.order-list .num { font-weight: 800; min-width: 1.8em; text-align: center; background: var(--orange); color: #fff; border-radius: 6px; padding: 2px 6px; }
.order-list .txt { flex: 1; }
.order-list .ok { background: var(--ok); }
.order-list .bad { background: var(--bad); }
.order-list .move { display: flex; gap: 4px; }

/* Kreuzworträtsel */
.cw-wrap { overflow-x: auto; }
.cw { border-collapse: collapse; display: table; margin: 10px auto 16px; width: auto; }
.cw td { padding: 0; border: 1px solid #8e939c; position: relative; width: 44px; height: 44px; background: #fff; }
.cw td.block { background: var(--dark); border-color: var(--dark); }
.cw td input { width: 100%; height: 100%; border: 0; text-align: center; font-weight: 700; font-size: 1.25rem; text-transform: uppercase; background: transparent; color: var(--text); padding: 0; }
.cw td .n { position: absolute; top: 1px; left: 3px; font-size: .6rem; color: var(--muted); pointer-events: none; }
.cw td.good input { background: var(--ok); }
.cw td.bad input { background: var(--bad); }
.clues { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.clues ol { padding-left: 20px; margin: 6px 0; }
.clues li { margin-bottom: 6px; }
@media (max-width: 640px) { .clues { grid-template-columns: 1fr; } }

/* Terminal */
.term { background: #1e1f24; color: #f3e9e4; border: 2px solid var(--orange); border-radius: 8px; padding: 14px; font-family: "Fira Code", Consolas, monospace; font-size: .92rem; min-height: 240px; max-height: 380px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.term .prompt { color: var(--salmon); font-weight: 600; }
.term .err { color: #ff9aa9; }
.term-input-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.term-input-row input { flex: 1 1 160px; min-width: 0; font-family: "Fira Code", Consolas, monospace; background: #1e1f24; color: #f3e9e4; border: 2px solid var(--orange); color-scheme: dark; }
.task-list { list-style: none; padding: 0; }
.task-list li { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; background: rgba(255, 122, 82, .08); display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.task-list li.done { background: var(--ok); }
.task-list li.current { box-shadow: 0 0 0 3px var(--orange); }
.task-list .status { font-weight: 700; }

.pycode { display: block; width: 100%; resize: vertical; min-height: 130px; font-family: "Fira Code", Consolas, monospace; font-size: .92rem; background: #1e1f24; color: #f3e9e4; border: 2px solid var(--orange); border-radius: 8px; padding: 12px; }
.pyout { min-height: 60px; max-height: 220px; margin: 0 0 12px; }
.grade-result { font-weight: 800; font-size: 2rem; margin: 10px 0 0; }
.sb-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed rgba(100, 101, 105, .3); }
.pill { display: inline-block; background: var(--lemon); color: var(--dark); border-radius: 4px; padding: 1px 8px; font-weight: 700; font-size: .85rem; vertical-align: middle; }

/* Seitenmenü auf Übungsseiten */
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; max-width: 1400px; margin: 0 auto; align-items: start; }
.layout main { max-width: none; margin: 0; min-width: 0; }
.toc { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; margin: 28px 0 0 12px; padding: 12px 8px; background: rgba(44, 44, 46, .85); border-radius: 6px; font-size: .84rem; }
.toc h4 { margin: 0 0 6px 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--salmon); }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 5px 6px; border-radius: 6px; color: var(--light); text-decoration: none; line-height: 1.25; }
.toc a:hover { background: rgba(255, 171, 146, .18); }
.toc a.active { background: var(--salmon); color: var(--dark); font-weight: 700; }
.toc .pts { white-space: nowrap; opacity: .8; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; margin: 16px 12px 0; }
  .toc ul { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .toc a { white-space: nowrap; }
}

.footer-note { color: rgba(230, 230, 230, .6); font-size: .9rem; margin-top: 48px; text-align: center; }
.footer-note a { color: var(--salmon); }

@media (max-width: 600px) {
  main { padding: 18px 16px 60px; }
  .card, .slide { padding: 16px; }
  .topic-head .hex { --size: 150px; }
  .subnav .hex { --size: 96px; }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .stack-ctrl { display: none; }
  .stack.js .slide { display: block; }
}

/* ---------- Themenseiten: Seitenmenü + immer nur eine Ansicht ---------- */
.topic-layout {
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px;
  max-width: 1280px; margin: 0 auto; padding: 28px 16px 60px; align-items: start;
}
.topic-layout main.views { max-width: none; margin: 0; padding: 0; min-width: 0; }
.submenu {
  position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto;
  background: rgba(30, 32, 40, .88); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px; padding: 18px 14px;
}
.sm-title { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; color: #fff; margin: 0 4px 14px; }
.sm-title .hex { --size: 34px; padding: 0; }
.sm-toggle { display: none; }
.sm-group { margin: 0 0 10px; }
.sm-head {
  display: flex; align-items: center; gap: 8px; margin: 12px 6px 4px;
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--salmon);
}
.sm-head .dot { width: 12px; height: 14px; background: var(--salmon); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.sm-head .dot.light { background: var(--light); }
.sm-head .dot.dim { background: rgba(255, 255, 255, .35); }
.sm-head .dot.lemon { background: var(--lemon); }
.submenu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.submenu li a {
  display: block; padding: 8px 12px 8px 26px; border-radius: 8px; color: var(--light);
  text-decoration: none; font-size: .95rem; line-height: 1.3; position: relative;
}
.submenu li a::before { content: ""; position: absolute; left: 12px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.submenu li a:hover { background: rgba(255, 171, 146, .15); }
.submenu li a[aria-current="page"] { background: var(--salmon); color: var(--dark); font-weight: 700; }
.submenu li a[aria-current="page"]::before { background: var(--dark); }

.view { display: none; margin: 0; min-height: 360px; }
.view.current { display: block; animation: zoomIn .35s cubic-bezier(.2, .8, .2, 1) both; }
.no-js .view { display: block; margin-bottom: 20px; }
.crumb { margin: 0 0 4px; font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); }
.view h4 { margin: 22px 0 8px; font-size: 1.05rem; }
.view .subnav .hex { --size: 110px; }
.view-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.view-nav a {
  background: var(--salmon); color: var(--dark); font-weight: 700; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.view-nav a:hover { background: var(--orange); color: #fff; }
.view-nav a[hidden] { display: inline-block; visibility: hidden; }
.view-nav .pos { color: rgba(230, 230, 230, .7); font-variant-numeric: tabular-nums; }
.aufgabe { background: #fff8e0; border-left: 5px solid #e3c000; border-radius: 6px; padding: 12px 16px; margin: 14px 0; }
.aufgabe .label { background: var(--lemon); margin-bottom: 6px; }
a.btn { display: inline-block; text-decoration: none; color: #fff; }
.view .cols img, .view > img { margin-top: 6px; }

@media (max-width: 860px) {
  .topic-layout { grid-template-columns: 1fr; gap: 14px; padding-top: 16px; }
  .submenu { position: static; max-height: none; padding: 12px; }
  .sm-title { margin-bottom: 8px; }
  .sm-toggle { display: block; width: 100%; background: rgba(255, 255, 255, .1); color: #fff; text-align: left; }
  .sm-toggle::after { content: " ▾"; }
  .submenu.closed .sm-nav { display: none; }
}
.slide a.hex { color: var(--dark); }
.slide a.hex.dim { background: #646569; color: #fff; }
/* lange Befehle und Adressen am Handy umbrechen */
.view :not(pre) > code { overflow-wrap: anywhere; }
.steps > li > div { min-width: 0; }
.view img { max-width: 100%; height: auto; }
@media (max-width: 600px) {
  .cmd-table, .cmd-table tbody, .cmd-table tr, .cmd-table td { display: block; width: 100% !important; }
  .cmd-table td:first-child { border-bottom: 0; padding-bottom: 2px; }
  .cmd-table tr { border-bottom: 1px solid #eee; padding: 4px 0; }
}
/* Checks mit Punkten in jeder Übung */
.check-box { margin: 26px 0 0; padding: 18px; border: 2px solid var(--salmon); border-radius: 10px; background: #fffaf7; }
.check-box h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-box .card { background: #fff; }
.check-box label { display: block; }
#scoreboard .grade-result { font-size: 1.5rem; }
/* Punkte im Seitenmenü */
.submenu li a[data-key], .submenu li a[data-total] { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.submenu .pts { font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: .7; }
.submenu .pts.part { color: var(--lemon); opacity: 1; }
.submenu .pts.full { color: #7be39a; opacity: 1; }
.submenu .pts.full::before { content: "✔ "; }
.submenu li a[aria-current="page"] .pts { color: var(--dark); opacity: .85; }
/* Lösung mit Kopieren-Button */
.loesung { margin: 22px 0 0; border: 2px dashed #8e939c; border-radius: 10px; padding: 0 16px; }
.loesung > summary {
  cursor: pointer; list-style: none; display: inline-block; margin: 14px 0; padding: 9px 18px;
  background: var(--dark); color: #fff; border-radius: 999px; font-weight: 700;
}
.loesung > summary::-webkit-details-marker { display: none; }
.loesung > summary::before { content: "▸ "; }
.loesung[open] > summary::before { content: "▾ "; }
.loesung[open] > summary { background: var(--orange); }
.loesung[open] { padding-bottom: 6px; }
.loesung[open] > summary::after { content: ""; }
.code-wrap { position: relative; }
.copy-btn { position: absolute; top: 8px; right: 8px; padding: 6px 12px; font-size: .85rem; background: var(--salmon); color: var(--dark); }
.copy-btn:hover { background: var(--orange); color: #fff; }
.copy-btn.done { background: #7be39a; color: var(--dark); }
.code-wrap pre { padding-top: 44px; }

/* Meine Punkte: kein Drucken-Button */
.views .sb-print { display: none; }

/* ---------- HTML Builder ---------- */
.anleitung > summary { cursor: pointer; list-style: none; }
.anleitung > summary::-webkit-details-marker { display: none; }
.anleitung > summary h3::after { content: " ▾"; font-size: .8em; color: var(--orange); }
.anleitung:not([open]) > summary h3::after { content: " ▸"; }
.b-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.b-grid .slide { margin: 16px 0; }
.b-rechts { position: sticky; top: 70px; }
.b-einst { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.b-feld { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.b-feld input[type="text"], .b-feld input[type="number"], .b-feld select { width: 100%; }
.b-feld input[type="color"] { width: 100%; height: 40px; padding: 2px; border: 2px solid rgba(255, 122, 82, .4); border-radius: 6px; background: #fff; cursor: pointer; }
.b-check { flex-direction: row; align-items: center; gap: 8px; grid-column: 1 / -1; color: var(--text); font-size: 1rem; }
.b-check input { width: 20px; height: 20px; }
.b-palette { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.b-palette button { background: var(--dark); }
.b-palette button:hover { background: var(--orange); }
.b-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.b-el { border: 2px solid #e4e4e4; border-radius: 10px; background: #fafafa; padding: 10px 12px; }
.b-el.zieht { opacity: .45; }
.b-el.ueber { border-color: var(--orange); border-style: dashed; }
.b-el-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.b-griff { cursor: grab; font-size: 1.3rem; color: #8e939c; user-select: none; }
.b-el-knoepfe { margin-left: auto; display: flex; gap: 4px; }
.b-el-knoepfe button { padding: 2px 9px; }
.b-el-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 12px; }
.b-handy { border: 10px solid var(--dark); border-radius: 26px; overflow: hidden; background: #fff; max-width: 380px; margin: 0 auto; }
.b-handy iframe { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
.builder .code-wrap pre { max-height: 460px; }
@media (max-width: 900px) {
  .b-grid { grid-template-columns: 1fr; }
  .b-rechts { position: static; }
}
