/* Course area, login page and notices of "ورشة بمدينتي" (dark night-blue look).
   Shared design values with the sales page: see the custom properties below. */

/* Alexandria, variable weight, SIL Open Font License (assets/fonts/OFL-Alexandria.txt) */
@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/alexandria-var.woff2") format("woff2");
}

:root {
  --bg: #0b0b22;
  --bg-2: #101029;
  --flaeche: #15143a;
  --flaeche-hell: #1c1b44;
  --text: #fff7ea;
  --gedaempft: #b3aecb;
  --leise: #827da1;

  --gold: #ffc44d;
  --orange: #ff7d3f;
  --akzent: linear-gradient(to left, var(--gold), var(--orange)); /* RTL: gold where reading starts */
  --blau-hell: #a8ecff;
  --blau: #49bfff;
  --knopf-text: #04203a;
  --mint: #6ef0c4;

  --linie: rgba(205, 195, 255, .14);
  --linie-stark: rgba(205, 195, 255, .24);
  --glas: rgba(255, 255, 255, .045);
  --glas-hover: rgba(255, 255, 255, .08);

  --r-knopf: 11px;
  --r-karte: 18px;
  --r-karte-klein: 16px;
  --schatten: 0 18px 50px -20px rgba(0, 0, 0, .6);

  --schrift: "Alexandria", "Segoe UI", Tahoma, system-ui, sans-serif;
  --rand: 24px;
  --breite: 1360px;
  --liste: 372px; /* lesson list next to the player */
  --daumen: 112px; /* thumbnail width in the lesson list */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body.kb {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
:where(.kb) img { max-width: 100%; display: block; }
:where(.kb) p { margin: 0; }
:where(.kb) :is(h1, h2, h3, h4) { margin: 0; line-height: 1.3; }
:where(.kb) a { color: inherit; }
:where(.kb) :is(button, select, input) { font: inherit; color: inherit; }
:where(.kb) :is(ol, ul) { margin: 0; padding: 0; list-style: none; }
.kb :focus-visible {
  outline: 2px solid var(--blau-hell);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Headings (and file cards) with tabindex="-1" get focus only from the script, so screen readers
   announce the new tab. They are not controls: no ring. Must come after .kb :focus-visible and be
   more specific (0,3,0 against 0,2,0), else Chrome draws the ring after a page load. */
.kb [tabindex="-1"]:focus, .kb [tabindex="-1"]:focus-visible { outline: none; }

/* Soft violet glow in the top corner (visual right = start side in RTL) */
.kb-schein, body.kb--mitte::before {
  content: "";
  position: fixed;
  inset: 0 0 auto auto;
  width: min(900px, 90vw);
  height: 620px;
  background:
    radial-gradient(closest-side, rgba(126, 87, 255, .22), transparent),
    radial-gradient(60% 50% at 70% 30%, rgba(73, 191, 255, .06), transparent);
  transform: translate(25%, -35%);
  pointer-events: none;
  z-index: 0;
}

.kb-sprung {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: var(--r-knopf);
  background: var(--blau-hell);
  color: var(--knopf-text);
  font-weight: 700;
  text-decoration: none;
}
.kb-sprung:focus { top: 12px; }

.kb-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.kb-kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 34, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linie);
}
.kb-kopf__innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 10px var(--rand);
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}
.kb-marke {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}
.kb-zeichen { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 4px 14px rgba(255, 140, 60, .35)); }

.kb-reiter {
  display: flex;
  gap: 4px;
  margin-inline-start: 10px;
}
.kb-reiter__link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--gedaempft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.kb-reiter__link:hover { color: var(--text); background: var(--glas); }
.kb-reiter__link.ist-aktiv { color: var(--text); background: var(--flaeche-hell); box-shadow: inset 0 0 0 1px var(--linie); }

.kb-konto-pille {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 5px 12px 5px 5px;
  padding-inline: 5px 12px;
  border: 1px solid var(--linie-stark);
  border-radius: 12px;
  background: var(--glas);
  font-size: 13px;
  color: var(--gedaempft);
}
.kb-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blau-hell), #6b7bff);
  color: var(--knopf-text);
  font-weight: 800;
  font-size: 14px;
}
.kb-konto-pille__mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }

.kb-noscript { max-width: var(--breite); margin: 16px auto; padding: 0 var(--rand); color: var(--gold); }

/* ---------- Layout ---------- */
.kb-inhalt {
  position: relative;
  z-index: 1;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 30px var(--rand) 40px;
}
.kb-fuss {
  position: relative;
  z-index: 1;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 18px var(--rand) 36px;
  color: var(--leise);
  font-size: 13px;
  border-top: 1px solid var(--linie);
}

.kb-vorzeile {
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px !important;
}
.kb-h1 {
  font-size: clamp(27px, 3.6vw, 42px);
  font-weight: 800;
  line-height: 1.35;
}
.kb-h1--gross { font-size: clamp(32px, 5vw, 58px); line-height: 1.25; }
/* Gradient-filled text. background-clip:text only paints inside the element's box, and Arabic
   dots and marks (ي، ج، ـّ) reach above and below the tight line box. Extra padding makes the painted
   area larger; the negative margin gives the space back, so the layout stays the same (same fix as
   .gold in styles.css). Every gradient text in this file must be listed here. */
.kb-h1 em, .kb-plakat__titel em, .kb-einzelkarte__titel em {
  padding-block: .14em .34em;
  margin-block: -.14em -.34em;
}
.kb-h1 em, .kb-plakat__titel em {
  font-style: normal;
  background: var(--akzent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.kb-unterzeile { color: var(--gedaempft); margin-top: 10px; max-width: 62ch; }
.kb-klein { color: var(--leise); font-size: 12.5px; font-weight: 600; }

.kb-karte {
  background: linear-gradient(180deg, rgba(28, 27, 68, .78), rgba(21, 20, 58, .78));
  border: 1px solid var(--linie-stark);
  border-radius: var(--r-karte);
  box-shadow: var(--schatten);
}

/* ---------- Pills ---------- */
.kb-pille {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.7;
}
.kb-pille--mint { background: rgba(110, 240, 196, .14); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(110, 240, 196, .38); }
.kb-pille--gold { background: rgba(255, 196, 77, .12); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 196, 77, .5); }
.kb-pille--rand { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 196, 77, .55); background: transparent; }

/* ---------- Buttons ---------- */
.kb-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--r-knopf);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.kb-knopf:active { transform: translateY(1px); }
.kb-knopf--haupt {
  background: linear-gradient(180deg, var(--blau-hell), var(--blau));
  color: var(--knopf-text);
  box-shadow: 0 10px 30px -10px rgba(73, 191, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.kb-knopf--haupt:hover { box-shadow: 0 12px 34px -8px rgba(73, 191, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .5); }
.kb-knopf--glas { background: var(--glas); border-color: var(--linie-stark); color: var(--text); }
.kb-knopf--glas:hover { background: var(--glas-hover); border-color: rgba(205, 195, 255, .34); }
.kb-knopf--gold {
  background: rgba(255, 196, 77, .08);
  border-color: rgba(255, 196, 77, .6);
  color: var(--gold);
}
.kb-knopf--gold:hover { background: linear-gradient(to left, var(--gold), #ffa64a); color: #2a1600; border-color: transparent; }
.kb-knopf--aus { background: transparent; border-color: var(--linie); color: var(--leise); cursor: default; }
.kb-knopf[aria-disabled="true"], .kb-knopf.ist-aus { opacity: .45; pointer-events: none; }
.kb-icon { width: 22px; height: 22px; flex: none; }
.kb-icon--klein { width: 17px; height: 17px; }

.kb-textknopf {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--leise);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 13px;
}
.kb-textknopf:hover { color: var(--gedaempft); }
.kb-link { color: var(--blau-hell); text-underline-offset: 3px; }
.kb-meldung { font-size: 13px; color: var(--mint); min-height: 1.4em; }
.kb-meldung.ist-fehler { color: var(--gold); }

/* ---------- Greeting and progress ---------- */
.kb-begruessung { margin-bottom: 26px; }
.kb-hinweis {
  display: inline-block;
  margin-top: 14px;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.kb-hinweis:hover { text-decoration: underline; text-underline-offset: 4px; }
.kb-mintbox {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  margin-top: 12px !important;
  padding: 7px 14px 7px 10px;
  padding-inline: 10px 14px;
  border: 1px solid rgba(110, 240, 196, .38);
  border-radius: 12px;
  background: rgba(110, 240, 196, .05);
  font-size: 13.5px;
  font-weight: 600;
}
.kb-mintbox--stand { border-color: rgba(255, 196, 77, .45); background: rgba(255, 196, 77, .05); }
.kb-begruessung .kb-karte--klein {
  width: min(100%, 300px);
  margin-top: 22px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  box-shadow: none;
  background: rgba(21, 20, 58, .6);
}
.kb-fortschritt__zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kb-fortschritt__zahl { color: var(--gedaempft); font-size: 13px; }
.kb-fortschritt__prozent strong { font-size: 25px; font-weight: 800; }
.kb-fortschritt__prozent small { color: var(--gedaempft); font-size: 13px; }
.kb-balken {
  height: 6px;
  margin-top: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}
.kb-balken > span, .kb-fs-zeile__balken > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(to left, var(--blau-hell), #6b7bff);
  transition: width .4s ease;
}

/* ---------- Course grid ---------- */
/* The player column sets the row height; the lesson list stretches to it and scrolls inside,
   so no empty band opens under the player (desktop only, see the 900px query). */
.kb-raster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--liste);
  gap: 20px;
  align-items: stretch;
}
.kb-haupt { display: grid; gap: 16px; min-width: 0; }
.kb-spieler-karte { overflow: hidden; }

.kb-spieler {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #07071a;
  overflow: hidden;
  container-type: inline-size;
}
.kb-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.kb-spieler__plakat { position: absolute; inset: 0; }
.kb-plakat-bild { width: 100%; height: 100%; object-fit: cover; }
/* Still image of a lesson whose video is not there yet: dimmed, with "coming soon" on top */
.kb-standbild { position: absolute; inset: 0; }
.kb-standbild .kb-plakat-bild { filter: brightness(.5) saturate(.75); }
.kb-standbild__bald {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  padding-inline: 12px 18px;
  border-radius: 999px;
  background: rgba(7, 7, 26, .8);
  box-shadow: inset 0 0 0 1px rgba(255, 196, 77, .45), 0 14px 40px -12px rgba(0, 0, 0, .8);
  font-size: clamp(13px, 2.1cqi, 17px);
  font-weight: 700;
  white-space: nowrap;
}
.kb-standbild__bald .kb-pille { font-size: clamp(12px, 1.9cqi, 15px); }
.kb-spieler.laeuft .kb-spieler__plakat, .kb-spieler.laeuft .kb-play { display: none; }

.kb-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, var(--gold), #ff9a3d);
  color: #2b1306;
  box-shadow: 0 0 0 10px rgba(255, 196, 77, .14), 0 18px 40px -8px rgba(255, 125, 63, .7);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.kb-spieler:has(.kb-plakat) .kb-play { inset-inline-start: auto; left: 25%; }
.kb-play:hover { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 14px rgba(255, 196, 77, .16), 0 18px 46px -6px rgba(255, 125, 63, .8); }
.kb-play:focus-visible { outline: 3px solid var(--blau-hell); outline-offset: 6px; border-radius: 50%; }
.kb-play__dreieck { width: 30px; height: 30px; margin-inline-end: -4px; }
[dir="rtl"] .kb-play__dreieck { margin-inline-end: 0; margin-inline-start: -4px; }

/* Designed poster (used when a lesson has no poster image) */
.kb-plakat {
  position: absolute;
  inset: 0;
  padding: 7cqi 7.5cqi;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6cqi;
  overflow: hidden;
  background:
    radial-gradient(45% 60% at 25% 65%, rgba(255, 140, 60, .18), transparent 70%),
    radial-gradient(60% 80% at 80% 15%, rgba(126, 87, 255, .5), transparent 70%),
    linear-gradient(160deg, #1d1656 0%, #120f3a 55%, #0c0a2a 100%);
}
.kb-plakat__marke {
  position: absolute;
  top: 5cqi;
  inset-inline-end: 5cqi;
  display: inline-flex;
  align-items: center;
  gap: 1cqi;
  font-size: clamp(9px, 1.6cqi, 14px);
  font-weight: 700;
  color: rgba(255, 247, 234, .8);
}
.kb-plakat__punkt { width: 1.6cqi; height: 1.6cqi; min-width: 8px; min-height: 8px; border-radius: 3px; background: var(--akzent); }
.kb-plakat__vorzeile {
  display: flex;
  align-items: center;
  gap: 1cqi;
  font-size: clamp(10px, 1.75cqi, 15px);
  font-weight: 700;
  color: var(--gold);
}
.kb-plakat__vorzeile span:last-child { color: var(--gedaempft); }
.kb-plakat__pkt { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.kb-plakat__titel {
  max-width: 56%;
  font-size: clamp(17px, 4.9cqi, 46px);
  font-weight: 800;
  line-height: 1.22;
  text-wrap: balance;
}
.kb-plakat__bald { display: flex; align-items: center; gap: 1.4cqi; margin-top: 1cqi; color: var(--gedaempft); font-size: clamp(11px, 1.8cqi, 15px); }
.kb-plakat__linie {
  position: absolute;
  inset: auto 7.5cqi 5cqi;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to left, var(--orange) 0 6%, rgba(205, 195, 255, .18) 6%);
}
/* Ghost circle where the play button sits once the video exists */
.kb-plakat--bald::after {
  content: "";
  position: absolute;
  left: 25%;
  top: 50%;
  width: 15cqi;
  height: 15cqi;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed rgba(255, 196, 77, .35);
  background: radial-gradient(closest-side, rgba(255, 196, 77, .08), transparent);
}
.kb-plakat__q {
  position: absolute;
  width: 2.2cqi;
  height: 2.2cqi;
  border-radius: 3px;
  background: rgba(150, 120, 255, .28);
  transform: rotate(18deg);
}
.kb-plakat__q--1 { top: 12%; left: 14%; }
.kb-plakat__q--2 { top: 70%; left: 9%; width: 1.4cqi; height: 1.4cqi; background: rgba(255, 140, 60, .25); }
.kb-plakat__q--3 { top: 22%; left: 46%; width: 1.2cqi; height: 1.2cqi; }
.kb-plakat__q--4 { top: 82%; left: 38%; background: rgba(73, 191, 255, .18); }
.kb-plakat__q--5 { top: 40%; left: 24%; width: 3cqi; height: 3cqi; background: rgba(150, 120, 255, .16); }
.kb-plakat__q--6 { top: 58%; left: 55%; width: 1.3cqi; height: 1.3cqi; background: rgba(255, 196, 77, .2); }
.kb-plakat__q--7 { top: 8%; left: 64%; width: 1.6cqi; height: 1.6cqi; background: rgba(110, 240, 196, .16); }

.kb-spieler__fehler {
  position: absolute;
  inset: auto 16px 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(7, 7, 26, .85);
  color: #ffe7b8;
  box-shadow: inset 0 0 0 1px rgba(255, 196, 77, .45);
  font-size: 14px;
}

/* Lesson info under the player */
.kb-lektion { padding: 18px 22px 4px; }
.kb-lektion__titel { font-size: clamp(20px, 2.3vw, 25px); font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kb-lektion__satz { color: var(--gedaempft); margin-top: 6px; }
.kb-stichwoerter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kb-stichwoerter li {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d4f4ff;
  background: rgba(73, 191, 255, .09);
  box-shadow: inset 0 0 0 1px rgba(168, 236, 255, .3);
}

/* Toolbar */
.kb-leiste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
}
.kb-leiste__gruppe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kb-leiste .kb-knopf { min-height: 38px; padding: 7px 14px; font-size: 13.5px; }
.kb-feld { display: inline-flex; align-items: center; gap: 8px; }
.kb-feld__name { color: var(--leise); font-size: 12.5px; font-weight: 600; }
.kb-auswahl {
  appearance: none;
  -webkit-appearance: none;
  min-height: 38px;
  min-width: 104px;
  padding: 6px 12px;
  padding-inline: 12px 32px;
  border-radius: var(--r-knopf);
  border: 1px solid var(--linie-stark);
  background: var(--glas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b3aecb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat left 12px center / 11px 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.kb-auswahl--schmal { min-width: 78px; }
.kb-auswahl:hover { background-color: var(--glas-hover); }
.kb-auswahl option { background: var(--flaeche); color: var(--text); }
.kb-auswahl:disabled { opacity: .45; cursor: default; }
.kb-knopf:disabled { opacity: .45; cursor: default; }
.kb-knopf--erledigt .kb-knopf__haken { display: none; }
.kb-knopf--erledigt[aria-pressed="true"] {
  background: rgba(110, 240, 196, .12);
  border-color: rgba(110, 240, 196, .5);
  color: var(--mint);
}
.kb-knopf--erledigt[aria-pressed="true"] .kb-knopf__haken { display: inline-flex; }
.kb-knopf[aria-expanded="true"] { background: var(--flaeche-hell); border-color: rgba(168, 236, 255, .45); }

/* Transcript */
.kb-transkript { padding: 18px 22px 20px; box-shadow: none; }
.kb-transkript__kopf { font-size: 16px; font-weight: 800; }
.kb-transkript__tipp { color: var(--leise); font-size: 12.5px; margin-top: 4px !important; }
.kb-transkript__leer { color: var(--gedaempft); margin-top: 8px !important; }
.kb-transkript__zeilen { position: relative; display: grid; gap: 2px; margin-top: 12px; max-height: 360px; overflow-y: auto; padding-inline-end: 6px; scrollbar-width: thin; scrollbar-color: var(--linie-stark) transparent; }
.kb-transkript__titel { font-size: 14px; color: var(--gold); margin: 10px 0 4px; }
.kb-zeile {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: start;
  color: var(--gedaempft);
  line-height: 1.7;
  cursor: pointer;
}
.kb-zeile:hover { background: var(--glas); color: var(--text); }
.kb-zeile.ist-jetzt { background: rgba(255, 196, 77, .08); color: var(--text); box-shadow: inset -2px 0 0 var(--gold); }
.kb-zeile--still { display: block; cursor: default; }
.kb-zeile--still:hover { background: none; color: var(--gedaempft); }
.kb-zeile__zeit { direction: ltr; unicode-bidi: isolate; text-align: start; color: var(--gold); font-weight: 700; font-size: 13px; padding-top: 2px; font-variant-numeric: tabular-nums; }

/* Lesson list */
.kb-liste { position: relative; min-height: 420px; padding: 16px 10px 10px; }
.kb-liste__kopf { padding: 0 10px 10px; font-size: 12.5px; font-weight: 700; color: var(--leise); }
.kb-liste__eintraege {
  position: absolute;
  inset: 46px 10px 10px;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  padding-inline-end: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--linie-stark) transparent;
}
/* Status circle sits on the thumbnail corner, so the title gets the whole text column */
.kb-eintrag {
  position: relative;
  display: grid;
  grid-template-columns: var(--daumen) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.kb-eintrag:hover { background: var(--glas); }
.kb-eintrag.ist-aktiv {
  background: rgba(255, 196, 77, .07);
  border-color: rgba(255, 196, 77, .55);
  box-shadow: 0 0 0 1px rgba(255, 196, 77, .08), 0 10px 26px -14px rgba(255, 160, 60, .6);
}
.kb-eintrag--test { border-style: dashed; border-color: rgba(110, 240, 196, .35); }
.kb-eintrag--test.ist-aktiv { border-color: rgba(110, 240, 196, .7); background: rgba(110, 240, 196, .06); }
.kb-eintrag__text { display: grid; gap: 2px; min-width: 0; }
.kb-eintrag__titel { font-size: 13.5px; font-weight: 700; line-height: 1.5; text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-eintrag__meta { font-size: 11.5px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kb-daumen {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  background: #120f3a;
  box-shadow: inset 0 0 0 1px var(--linie);
}
.kb-daumen img { width: 100%; height: 100%; object-fit: cover; }
.kb-daumen__muster {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 5px 6px;
  background:
    radial-gradient(70% 90% at 80% 10%, rgba(126, 87, 255, .55), transparent 70%),
    radial-gradient(50% 60% at 20% 80%, rgba(255, 140, 60, .25), transparent 70%),
    linear-gradient(160deg, #221a63, #0f0c30);
}
.kb-daumen__titel { font-size: 10px; font-weight: 700; color: rgba(255, 247, 234, .75); }
.kb-daumen__nr {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(7, 7, 26, .8);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
}

.kb-status {
  position: absolute;
  top: 50%;
  margin-top: -26px; /* top corner of the vertically centred thumbnail, opposite the number */
  inset-inline-start: calc(8px + var(--daumen) - 28px);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--linie-stark);
  background: rgba(7, 7, 26, .82);
  color: var(--gedaempft);
}
.kb-status .kb-play__dreieck { width: 10px; height: 10px; }
.kb-status__haken { display: none; }
.kb-status.ist-fertig { border-color: rgba(110, 240, 196, .7); background: #0f3a33; color: var(--mint); }
.kb-status.ist-fertig .kb-status__haken { display: grid; }
.kb-status.ist-fertig .kb-status__play { display: none; }
.kb-status__play, .kb-status__haken { display: grid; place-items: center; }
.kb-status.ist-fertig .kb-status__haken { display: grid; }
.kb-status:not(.ist-fertig) .kb-status__haken { display: none; }
.kb-eintrag.ist-aktiv .kb-status:not(.ist-fertig) { border-color: rgba(255, 196, 77, .6); color: var(--gold); }
/* Lesson without video: quiet clock instead of a play symbol, never highlighted. */
.kb-status--bald, .kb-eintrag.ist-aktiv .kb-status--bald { border-style: dashed; border-color: var(--linie-stark); color: var(--leise); }
.kb-status--bald .kb-icon { width: 14px; height: 14px; }

/* ---------- Progress tab ---------- */
.kb-fs-oben { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-top: 24px; }
.kb-fs-gesamt, .kb-fs-weiter { padding: 20px 22px; }
.kb-fs-gesamt .kb-fortschritt { margin-top: 10px; }
.kb-fs-gesamt .kb-fortschritt__prozent strong { font-size: 40px; }
.kb-fs-weiter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; }
.kb-fs-weiter .kb-klein { grid-column: 1 / -1; }
.kb-weiter { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; text-decoration: none; }
.kb-weiter__text { display: grid; gap: 3px; }
.kb-weiter__titel { font-weight: 800; font-size: 16px; line-height: 1.45; }
.kb-weiter__meta { color: var(--leise); font-size: 12.5px; }
.kb-weiter:hover .kb-weiter__titel { text-decoration: underline; text-underline-offset: 4px; }

.kb-fs-liste { margin-top: 16px; padding: 8px 10px; }
.kb-fs-kopf, .kb-fs-zeile {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 90px 160px 120px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
}
.kb-fs-kopf { color: var(--leise); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--linie); }
.kb-fs-zeile + .kb-fs-zeile { border-top: 1px solid var(--linie); }
.kb-fs-zeile__nr { color: var(--leise); font-weight: 800; font-size: 13px; }
.kb-fs-zeile__titel { font-weight: 700; font-size: 14px; text-decoration: none; }
.kb-fs-zeile__titel:hover { text-decoration: underline; text-underline-offset: 3px; }
.kb-fs-zeile__gruppe { color: var(--gedaempft); font-size: 12.5px; }
.kb-fs-zeile__balken { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.kb-fs-zeile__status { font-size: 12.5px; font-weight: 700; color: var(--leise); }
.kb-fs-zeile.ist-fertig .kb-fs-zeile__status { color: var(--mint); }
.kb-fs-zeile.ist-fertig .kb-fs-zeile__balken > span { background: var(--mint); }
.kb-fs-zeile.ist-begonnen .kb-fs-zeile__status { color: var(--gold); }
.kb-fs-zeile.ist-bald .kb-fs-zeile__titel, .kb-fs-zeile.ist-bald .kb-fs-zeile__nr { color: var(--gedaempft); }
.kb-fs-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px !important; }

/* ---------- Files tab ---------- */
.kb-material-kopf { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: end; margin-bottom: 30px; }
.kb-material-kopf__text { color: var(--gedaempft); font-size: 16px; line-height: 1.8; max-width: 44ch; }
.kb-dateien { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kb-datei {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--r-karte-klein);
  border-color: var(--linie);
  box-shadow: none;
  background: linear-gradient(180deg, rgba(30, 27, 76, .9), rgba(21, 19, 56, .9));
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.kb-datei:hover { border-color: var(--linie-stark); }
.kb-datei:focus-visible, .kb-datei.ist-markiert { border-color: rgba(255, 196, 77, .7); box-shadow: 0 0 0 3px rgba(255, 196, 77, .15); }
.kb-datei--gross {
  grid-column: span 2;
  grid-row: span 2;
  border-color: rgba(110, 240, 196, .5);
  box-shadow: 0 0 0 1px rgba(110, 240, 196, .08), 0 24px 60px -30px rgba(110, 240, 196, .35);
}
.kb-datei__kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kb-datei__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(73, 191, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(168, 236, 255, .22);
  color: #7fdcff;
}
.kb-datei__titel { font-size: 16.5px; font-weight: 800; margin-top: 4px; }
.kb-datei--gross .kb-datei__titel { font-size: 21px; }
.kb-datei__satz { color: var(--gedaempft); font-size: 13.5px; line-height: 1.75; }
.kb-datei__fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.kb-datei__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-datei .kb-knopf { min-height: 38px; padding: 7px 14px; font-size: 13.5px; }
.kb-prompt {
  margin: 4px 0 0;
  padding: 14px 16px;
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  background: rgba(7, 7, 26, .55);
  border: 1px solid var(--linie);
  color: #e9e4f7;
  font-family: var(--schrift);
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  /* Arabic note and English prompt in one text: each line takes its own direction */
  unicode-bidi: plaintext;
  text-align: start;
  scrollbar-width: thin;
  scrollbar-color: var(--linie-stark) transparent;
}
.kb-prompt--leer { color: var(--leise); }

/* ---------- Account tab ---------- */
.kb-konto { margin-top: 24px; max-width: 820px; padding: 6px 22px; }
.kb-konto__zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 18px 0; }
.kb-konto__zeile + .kb-konto__zeile { border-top: 1px solid var(--linie); }
.kb-konto__zeile > div:first-child { flex: 1 1 300px; }
.kb-konto__wert { font-size: 17px; font-weight: 700; margin-top: 2px !important; direction: ltr; text-align: end; unicode-bidi: plaintext; }
[dir="rtl"] .kb-konto__wert { text-align: right; }
.kb-konto__text { color: var(--gedaempft); margin-top: 2px !important; }
.kb-konto__aktion { display: grid; justify-items: start; gap: 6px; }

/* ---------- Login and notices ---------- */
body.kb--mitte::before { content: ""; }
.kb-mitte {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}
.kb-einzelkarte {
  width: min(100%, 460px);
  padding: 30px 28px 28px;
  background: linear-gradient(180deg, rgba(28, 27, 68, .86), rgba(21, 20, 58, .86));
  backdrop-filter: blur(8px);
}
.kb-einzelkarte .kb-marke { margin-bottom: 26px; }
.kb-einzelkarte__titel { font-size: clamp(24px, 6vw, 32px); font-weight: 800; line-height: 1.25; }
.kb-einzelkarte__titel em {
  font-style: normal;
  background: var(--akzent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.kb-einzelkarte__text { color: var(--gedaempft); margin: 10px 0 22px !important; }
.kb-formular { display: grid; gap: 12px; }
[data-hinweise] .kb-antwort { margin: 0 0 18px !important; }
.kb-formular label { font-size: 13px; font-weight: 700; color: var(--gedaempft); }
.kb-eingabe {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--r-knopf);
  border: 1px solid var(--linie-stark);
  background: rgba(7, 7, 26, .5);
  font-size: 16px;
  direction: ltr;
  text-align: left;
}
.kb-eingabe::placeholder { color: var(--leise); }
.kb-eingabe:focus-visible { outline: 2px solid var(--blau-hell); outline-offset: 1px; border-color: transparent; }
.kb-formular .kb-knopf { min-height: 48px; font-size: 15px; width: 100%; }
.kb-formular .kb-knopf:disabled { opacity: .6; cursor: progress; }
.kb-antwort {
  margin-top: 16px !important;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
  background: rgba(110, 240, 196, .07);
  box-shadow: inset 0 0 0 1px rgba(110, 240, 196, .35);
  color: #d8fff0;
}
.kb-antwort.ist-fehler { background: rgba(255, 196, 77, .07); box-shadow: inset 0 0 0 1px rgba(255, 196, 77, .45); color: #ffe7b8; }
.kb-einzelkarte__fuss { margin-top: 22px !important; padding-top: 16px; border-top: 1px solid var(--linie); color: var(--leise); font-size: 13.5px; }

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  :root { --liste: 330px; --daumen: 100px; }
  .kb-eintrag { gap: 10px; }
  .kb-fs-kopf, .kb-fs-zeile { grid-template-columns: 34px minmax(0, 1fr) 120px 100px; }
  .kb-fs-zeile__gruppe, .kb-fs-kopf span:nth-child(3) { display: none; }
}

@media (max-width: 900px) {
  :root { --rand: 16px; }
  .kb-kopf__innen { flex-wrap: wrap; gap: 6px 12px; padding-block: 10px 0; min-height: 0; }
  .kb-konto-pille { order: 2; max-width: 52vw; }
  .kb-reiter {
    order: 3;
    flex: 1 0 100%;
    margin: 4px calc(var(--rand) * -1) 0;
    padding: 0 var(--rand) 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .kb-reiter::-webkit-scrollbar { display: none; }
  .kb-reiter__link { scroll-snap-align: start; padding: 8px 16px; }
  .kb-raster { grid-template-columns: minmax(0, 1fr); }
  .kb-liste { min-height: 0; }
  .kb-liste__eintraege { position: static; overflow: visible; }
  .kb-fs-oben { grid-template-columns: minmax(0, 1fr); }
  .kb-material-kopf { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kb-dateien { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-datei--gross { grid-row: auto; }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  body.kb { font-size: 14.5px; }
  .kb-inhalt { padding-top: 20px; }
  .kb-marke { font-size: 15px; }
  .kb-zeichen { width: 26px; height: 26px; }
  .kb-konto-pille { padding: 3px; padding-inline: 3px 9px; font-size: 12px; }
  .kb-avatar { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
  .kb-begruessung { margin-bottom: 18px; }
  .kb-mintbox--stand { border-color: rgba(255, 196, 77, .45); background: rgba(255, 196, 77, .05); }
.kb-begruessung .kb-karte--klein { width: 100%; margin-top: 14px; padding: 10px 14px 12px; }
  .kb-begruessung .kb-fortschritt__prozent strong { font-size: 20px; }
  .kb-unterzeile { margin-top: 6px; }
  .kb-hinweis { margin-top: 8px; }
  .kb-mintbox { display: none !important; }
  .kb-mintbox.kb-mintbox--stand { display: flex !important; align-items: flex-start; font-size: 13px; }
  .kb-spieler-karte { margin-inline: calc(var(--rand) * -1); border-radius: 0; border-inline: 0; }
  .kb-lektion { padding: 16px 16px 4px; }
  .kb-leiste { padding: 14px 16px 18px; gap: 10px; }
  .kb-leiste__gruppe { width: 100%; }
  .kb-leiste__gruppe:first-child .kb-knopf { flex: 1; }
  .kb-leiste__werkzeuge { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .kb-leiste__werkzeuge > * { width: 100%; }
  .kb-feld { justify-content: space-between; }
  .kb-feld .kb-auswahl { flex: 1; min-width: 0; }
  .kb-feld__name { min-width: 3.6em; }
  .kb-transkript { padding: 16px; }
  .kb-zeile { grid-template-columns: 46px 1fr; gap: 8px; padding: 8px 6px; }
  .kb-play { width: 62px; height: 62px; }
  .kb-play__dreieck { width: 24px; height: 24px; }
  .kb-eintrag { gap: 10px; padding: 7px 8px; }
  .kb-fs-kopf { display: none; }
  .kb-fs-zeile { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 6px; }
  .kb-fs-zeile__balken { grid-column: 2 / 4; grid-row: 2; }
  .kb-fs-zeile__status { grid-column: 3; grid-row: 1; }
  .kb-fs-weiter { grid-template-columns: minmax(0, 1fr); }
  .kb-weiter { grid-template-columns: 104px minmax(0, 1fr); }
  .kb-fs-weiter .kb-knopf { width: 100%; }
  .kb-dateien { grid-template-columns: minmax(0, 1fr); }
  .kb-datei--gross { grid-column: auto; }
  .kb-konto { padding: 4px 16px; }
  .kb-konto__aktion, .kb-konto__aktion .kb-knopf { width: 100%; }
  .kb-einzelkarte { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .kb *, .kb *::before, .kb *::after { transition: none !important; scroll-behavior: auto !important; }
}
