/*
  Eselsohr web app. One stylesheet:
  1. Tokens, skin "Einfach" (default)
  2. Base and shared structure (uses tokens; values follow docs/mockups/Einfach-*.dc.html)
  3. Skin "Bauklotz": tokens + motif rules (values follow docs/mockups/Bauklotz-*.dc.html)
  No animations, gradients or shadows.
*/

/* ===== 1. Tokens: Einfach ===== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --bg: #F4F4F6;
  --ink: #2B2B2E;
  --muted: #6B6B70;
  --surface: #FFFFFF;
  --line: #E2E2E6;
  --field-border: #D6D6DB;
  --track: #D6D6DB;
  --chip: #E6E6EA;
  --segment-bg: #E4E4E8;
  --link: #0A5FC2;
  --link-hover: #084A97;
  --accent: #E8730C;
  --accent-ink: #A34C00;
  --pill-ink: #8A3F00;
  --pill-bg: #FDE7D2;
  --play-soft: #E3ECF8;
  --danger: #C8102E;
  --blue: #0A5FC2;
  --red: #DA291C;
  --yellow: #FFCD00;

  /* The mockups include a 44 px iOS status bar. In the installed app
     (status bar style "default") the status bar sits outside the page. */
  --status-gap: 44px;
  --safe-top: calc(var(--status-gap) + env(safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (display-mode: standalone) {
  :root { --status-gap: 0px; }
}

/* ===== 2. Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.6; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, p { margin: 0; }

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

#audio { display: none; }

#app { max-width: 480px; margin: 0 auto; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--safe-top) + 8px)
    calc(16px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

.status-line { font-size: 15px; line-height: 1.4; color: var(--muted); padding: 0 4px; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }

.icon-link {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-top { height: 44px; display: flex; align-items: center; flex-shrink: 0; }
.back-link { margin-left: -6px; }

.screen-title {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ----- Anmelden ----- */
.login-screen {
  justify-content: center;
  gap: 48px;
  padding:
    calc(var(--safe-top) + 12px)
    calc(24px + var(--safe-right))
    calc(140px + var(--safe-bottom))
    calc(24px + var(--safe-left));
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-icon { display: flex; color: var(--accent); }
.login-title { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.login-form { margin: 0; display: flex; flex-direction: column; gap: 12px; }

.text-field {
  height: 52px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 16px;
  font-size: 17px;
  width: 100%;
}
.code-field { text-transform: uppercase; letter-spacing: 0.08em; }
.code-field::placeholder { text-transform: none; letter-spacing: 0; color: var(--muted); }

.primary-button {
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--link);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-error { font-size: 14px; line-height: 1.4; color: var(--danger); text-align: center; }
.login-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 4px; }

/* ----- Folgen ----- */
.folgen-screen { gap: 20px; }
.folgen-header { display: flex; justify-content: space-between; align-items: center; padding-left: 4px; }
.folgen-content { display: flex; flex-direction: column; gap: 20px; }

.current-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}
.current-card:hover { color: var(--ink); }
.cover-small { display: block; flex-shrink: 0; }
.current-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.current-title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.current-sub { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.episode-list {
  background: var(--surface);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.episode-row {
  padding: 12px 16px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink);
}
.episode-row:hover { color: var(--ink); }
.episode-row + .episode-row {
  margin-left: 16px;
  padding-left: 0;
  border-top: 1px solid var(--line);
}
.episode-title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.episode-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge-marks { color: var(--accent-ink); font-weight: 600; }
.badge-marks-flag { display: none; }
.badge-new { color: var(--link); font-weight: 600; }

/* ----- Player and Folie ----- */
.player-screen {
  padding:
    calc(var(--safe-top) + 8px)
    calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
}
.player-loading { padding-top: 60px; }
.player-stage { display: flex; flex-direction: column; flex-shrink: 0; }
.player-top { height: 44px; display: flex; align-items: center; justify-content: space-between; }
.down-link { margin-left: -10px; color: var(--muted); }
.down-link:hover { color: var(--ink); }
.hero-fold { display: none; }

.cover-large {
  display: block;
  flex-shrink: 0;
  align-self: center;
  margin-top: 8px;
  width: clamp(160px, calc(100dvh - 544px), 300px);
  height: auto;
  aspect-ratio: 1;
}
.cover-word { font-family: var(--font); }

.player-body { display: flex; flex-direction: column; }
.player-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 26px; }
.player-title { font-size: 22px; line-height: 1.2; font-weight: 700; }
.player-date { font-size: 14px; color: var(--muted); }

.scrubber {
  position: relative;
  display: block;
  height: 18px;
  margin-top: 22px;
  touch-action: none;
  cursor: pointer;
}
.scrubber::before {
  /* larger touch area than the drawn bar */
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: -13px;
  bottom: -13px;
}
.scrubber-track,
.scrubber-fill {
  position: absolute;
  left: 0;
  top: 7px;
  height: 4px;
  border-radius: 2px;
}
.scrubber-track { right: 0; background: var(--track); }
.scrubber-fill { width: 0; background: var(--ink); }
.scrubber-ticks { position: absolute; inset: 0; pointer-events: none; }
.scrubber-tick {
  position: absolute;
  top: 2px;
  width: 4px;
  height: 14px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
}
.scrubber-knob { display: none; }

.scrub-times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  margin-top: 18px;
}
.speed-button {
  min-width: 58px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: var(--chip);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}
.skip-button {
  width: 52px;
  height: 52px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.skip-icon { width: 36px; height: 36px; display: block; }
.skip-label { font-family: var(--font); }
.play-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--ink);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-icon { width: 30px; height: 30px; display: block; }
.pause-icon { width: 28px; height: 28px; display: block; }

.mark-button {
  position: relative;
  flex-shrink: 0;
  height: 60px;
  margin-top: 22px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.mark-icon { display: flex; }
.mark-fold { display: none; }

.player-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 8px;
}
.marks-link,
.info-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
}

/* Folie variant (Einfach): a 16:9 slide in a white card, count above it */
.slide-frame {
  flex-shrink: 0;
  margin-top: 8px;
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.slide-count { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.slide-count-top { display: none; }
.slide-open {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: transparent;
}
.slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.player-screen[data-variant="folie"] .player-meta { gap: 2px; margin-top: 20px; }
.player-screen[data-variant="folie"] .player-title {
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-screen[data-variant="folie"] .player-date { font-size: 13px; }
.player-screen[data-variant="folie"] .scrubber { margin-top: 16px; }
.player-screen[data-variant="folie"] .controls { margin-top: 10px; }
.player-screen[data-variant="folie"] .speed-button { min-width: 54px; font-size: 14px; }
.player-screen[data-variant="folie"] .skip-button { width: 48px; height: 48px; }
.player-screen[data-variant="folie"] .skip-icon { width: 32px; height: 32px; }
.player-screen[data-variant="folie"] .play-button { width: 58px; height: 58px; }
.player-screen[data-variant="folie"] .play-icon { width: 26px; height: 26px; }
.player-screen[data-variant="folie"] .pause-icon { width: 24px; height: 24px; }
.player-screen[data-variant="folie"] .mark-button { margin-top: 16px; }
.player-screen[data-variant="folie"] .player-links { margin-top: 6px; }

/* ----- Eselsohren ----- */
.eselsohren-screen { gap: 14px; position: relative; }
.corner-motif { display: none; }
.title-block { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; margin-bottom: 8px; }
.screen-subtitle { font-size: 14px; color: var(--muted); }
.mark-list { display: flex; flex-direction: column; gap: 14px; }

.mark-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 12px 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, max-content) auto minmax(0, 1fr) 44px;
  grid-template-areas:
    "term time . play"
    "text text text play";
  column-gap: 8px;
  row-gap: 6px;
  align-items: center;
}
.mark-card.has-quote {
  grid-template-areas:
    "term time . play"
    "text text text play"
    "quote quote quote play";
}
.mark-card.is-pending { grid-template-areas: "term time . play"; }
.mark-card.is-failed { grid-template-areas: "term . time play"; }
.mark-card.is-failed .mark-time { justify-self: end; color: var(--muted); background: transparent; padding: 0; }
.mark-term { grid-area: term; font-size: 17px; line-height: 1.25; font-weight: 700; }
.mark-time {
  grid-area: time;
  justify-self: start;
  font-size: 13px;
  font-weight: 600;
  color: var(--pill-ink);
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}
.mark-text { grid-area: text; font-size: 15px; line-height: 1.4; }
.mark-quote { grid-area: quote; font-size: 14px; line-height: 1.4; color: var(--muted); }
.mark-play {
  grid-area: play;
  margin-left: 4px;
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--play-soft);
  color: var(--link);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mark-card.is-pending .mark-term { color: var(--muted); font-weight: 600; }
.mark-card.is-failed .mark-term { color: var(--muted); font-weight: 600; }

/* ----- Einstellungen ----- */
.settings-screen { gap: 22px; }
.settings-screen > .screen-title { margin-top: -16px; padding: 0 4px; }
.setting-group { display: flex; flex-direction: column; gap: 8px; }
.setting-label { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 16px; }

.skin-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skin-tile {
  border: 2px solid var(--surface);
  border-radius: 14px;
  background: var(--surface);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: var(--ink);
}
.skin-tile.is-selected { border-color: var(--link); }
.skin-preview { display: block; }
.skin-art {
  height: 80px;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skin-art svg { display: block; }
.skin-art-einfach { background: #F4F4F6; }
.skin-art-bauklotz { background: #F5F2EA; }
.art-card { background: #FFFFFF; border-radius: 6px; padding: 6px; display: flex; align-items: center; gap: 6px; }
.art-lines { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.art-line { display: block; height: 4px; border-radius: 2px; }
.art-line-dark { background: #2B2B2E; width: 80%; }
.art-line-light { background: #C4C4CA; width: 50%; }
.art-bar { display: block; height: 14px; border-radius: 5px; background: #E8730C; }
.skin-art-bauklotz .art-bar {
  border-radius: 0;
  background: #DA291C;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.skin-caption { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 2px; min-height: 18px; }
.skin-name { font-size: 15px; font-weight: 600; }
.skin-check { display: flex; color: var(--link); }

.segmented {
  display: grid;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--segment-bg);
}
.segmented-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.segment {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.segment.is-on { background: var(--surface); font-weight: 600; }

.profile-field {
  height: 72px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  width: 100%;
}
.profile-field::placeholder { color: var(--muted); }

.setting-row {
  min-height: 48px;
  background: var(--surface);
  border-radius: 14px;
  padding: 0 10px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.setting-row-label { font-size: 16px; }

.switch {
  position: relative;
  width: 55px;
  height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
}
.switch::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6.5px;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--segment-bg);
}
.switch-knob {
  position: absolute;
  left: 4px;
  top: 8.5px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--field-border);
}
.switch.is-on::before { background: var(--link); }
.switch.is-on .switch-knob { left: 24px; border-color: #FFFFFF; }

.account-card { background: var(--surface); border-radius: 14px; display: flex; flex-direction: column; }
.account-name { min-height: 48px; padding: 0 16px; display: flex; align-items: center; font-size: 16px; }
.account-logout {
  min-height: 48px;
  margin-left: 16px;
  padding: 0 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  font-size: 16px;
  color: var(--link);
  text-align: left;
}
.settings-error { font-size: 14px; color: var(--danger); padding: 0 16px; }

/* ===== 3. Skin: Bauklotz (tokens + motif) ===== */
[data-skin="bauklotz"] {
  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --bg: #F5F2EA;
  --muted: #53565A;
  --line: #D7D2CB;
  --field-border: #2B2B2E;
  --track: #D7D2CB;
  --link: #003DA5;
  --link-hover: #002A73;
  --accent: #DA291C;
  --danger: #DA291C;
  --blue: #003DA5;
}

[data-skin="bauklotz"] .screen {
  padding:
    var(--safe-top)
    calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
}
[data-skin="bauklotz"] .icon-link { color: var(--ink); }
[data-skin="bauklotz"] .back-link { margin-left: -10px; }
[data-skin="bauklotz"] .screen-title { line-height: 1; letter-spacing: -0.02em; }
[data-skin="bauklotz"] .icon-knock { fill: var(--bg); }

/* Anmelden: blue block with red fold */
[data-skin="bauklotz"] .login-screen { justify-content: flex-start; gap: 0; padding: 0 0 calc(24px + var(--safe-bottom)); }
[data-skin="bauklotz"] .login-hero {
  position: relative;
  flex-shrink: 0;
  height: calc(416px + var(--safe-top));
}
[data-skin="bauklotz"] .login-hero::before,
[data-skin="bauklotz"] [data-variant="folie"] .player-stage::before,
[data-skin="bauklotz"] .cover-large::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--blue);
}
[data-skin="bauklotz"] .login-hero::before {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 90px), calc(100% - 90px) 100%, 0 100%);
}
[data-skin="bauklotz"] .hero-fold {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 90px;
  height: 90px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
[data-skin="bauklotz"] .login-title {
  position: absolute;
  left: calc(24px + var(--safe-left));
  bottom: 28px;
  font-size: 60px;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}
[data-skin="bauklotz"] .login-form { padding: 40px calc(24px + var(--safe-right)) 0 calc(24px + var(--safe-left)); }
[data-skin="bauklotz"] .text-field { height: 56px; border: 2px solid var(--ink); border-radius: 0; font-size: 18px; }
[data-skin="bauklotz"] .text-field:focus-visible { outline-color: var(--link); }
[data-skin="bauklotz"] .primary-button { height: 56px; border-radius: 0; background: var(--ink); font-size: 18px; font-weight: 700; }
[data-skin="bauklotz"] .login-error { text-align: left; }
[data-skin="bauklotz"] .login-hint { font-size: 14px; text-align: left; }

/* Folgen: rules instead of cards */
[data-skin="bauklotz"] .folgen-screen { gap: 0; padding-top: calc(var(--safe-top) + 4px); padding-bottom: calc(28px + var(--safe-bottom)); }
[data-skin="bauklotz"] .folgen-header { height: 52px; padding-left: 0; }
[data-skin="bauklotz"] .settings-link { margin-right: -10px; }
[data-skin="bauklotz"] .folgen-content { gap: 0; }
[data-skin="bauklotz"] .current-card {
  background: transparent;
  border-radius: 0;
  margin-top: 20px;
  padding: 16px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  gap: 16px;
}
[data-skin="bauklotz"] .current-text { gap: 6px; }
[data-skin="bauklotz"] .current-title { font-size: 18px; line-height: 1.2; font-weight: 700; }
[data-skin="bauklotz"] .episode-list { background: transparent; border-radius: 0; margin-top: 8px; overflow: visible; }
[data-skin="bauklotz"] .episode-row,
[data-skin="bauklotz"] .episode-row + .episode-row {
  margin-left: 0;
  padding: 14px 0;
  gap: 4px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
[data-skin="bauklotz"] .episode-title { font-size: 17px; }
[data-skin="bauklotz"] .episode-meta { font-size: 14px; }
[data-skin="bauklotz"] .badge-marks { color: var(--muted); font-weight: 400; display: inline-flex; align-items: center; gap: 5px; vertical-align: -1px; }
[data-skin="bauklotz"] .badge-marks-flag {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
[data-skin="bauklotz"] .badge-new { background: var(--yellow); color: var(--ink); font-size: 13px; font-weight: 700; padding: 1px 7px; }

/* Player */
[data-skin="bauklotz"] .player-screen { padding-top: var(--safe-top); }
[data-skin="bauklotz"] .down-link { color: var(--ink); }
[data-skin="bauklotz"] .cover-large {
  position: relative;
  align-self: stretch;
  width: auto;
  aspect-ratio: auto;
  height: clamp(140px, calc(100dvh - 544px), 300px);
}
[data-skin="bauklotz"] .cover-large::before {
  clip-path: polygon(0 0, calc(100% - 80px) 0, 100% 80px, 100% 100%, 0 100%);
}
[data-skin="bauklotz"] .cover-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
[data-skin="bauklotz"] .player-meta { gap: 6px; margin-top: 20px; }
[data-skin="bauklotz"] .player-title { font-size: 25px; line-height: 1.12; letter-spacing: -0.01em; }
[data-skin="bauklotz"] .scrubber { height: 24px; margin-top: 18px; }
[data-skin="bauklotz"] .scrubber-track,
[data-skin="bauklotz"] .scrubber-fill { top: 14px; height: 6px; border-radius: 0; }
[data-skin="bauklotz"] .scrubber-tick {
  top: 0;
  width: 12px;
  height: 12px;
  margin-left: -1px;
  border-radius: 0;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
[data-skin="bauklotz"] .scrubber-knob {
  display: block;
  position: absolute;
  top: 10px;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--blue);
}
[data-skin="bauklotz"] .scrub-times { align-items: baseline; margin-top: 6px; }
[data-skin="bauklotz"] .time-pos { font-size: 32px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
[data-skin="bauklotz"] .time-rest { font-size: 15px; }
[data-skin="bauklotz"] .controls { display: flex; justify-content: space-between; margin-top: 14px; }
[data-skin="bauklotz"] .controls-spacer { display: none; }
[data-skin="bauklotz"] .speed-button {
  min-width: 64px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
}
[data-skin="bauklotz"] .skip-button { width: 56px; height: 56px; }
[data-skin="bauklotz"] .play-button { width: 76px; height: 76px; background: var(--blue); }
[data-skin="bauklotz"] .play-icon { width: 30px; height: 30px; }
[data-skin="bauklotz"] .pause-icon { width: 28px; height: 28px; }
[data-skin="bauklotz"] .mark-button {
  height: 72px;
  margin-top: 18px;
  border-radius: 0;
  background: var(--red);
  padding: 0 22px;
  justify-content: flex-start;
  text-align: left;
  font-size: 24px;
  letter-spacing: -0.01em;
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 0 100%);
}
[data-skin="bauklotz"] .mark-icon { display: none; }
[data-skin="bauklotz"] .mark-fold {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
[data-skin="bauklotz"] .player-links { justify-content: flex-start; margin-top: 6px; }

/* Folie (Bauklotz): the slide sits in the blue block */
[data-skin="bauklotz"] .player-screen[data-variant="folie"] { padding: 0 0 calc(24px + var(--safe-bottom)); }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-stage {
  position: relative;
  /* as tall as the 16:9 slide needs, plus room for the fold below it */
  height: auto;
  padding: var(--safe-top) calc(24px + var(--safe-right)) 0 calc(24px + var(--safe-left));
  color: #FFFFFF;
}
[data-skin="bauklotz"] [data-variant="folie"] .player-stage::before {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 80px), calc(100% - 80px) 100%, 0 100%);
}
[data-skin="bauklotz"] .player-stage .hero-fold { width: 80px; height: 80px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-top { position: relative; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .down-link { color: #FFFFFF; }
[data-skin="bauklotz"] .slide-count-top { display: inline; font-size: 14px; color: #FFFFFF; }
[data-skin="bauklotz"] .slide-count-inner { display: none; }
[data-skin="bauklotz"] .slide-frame {
  position: relative;
  flex: none;
  height: auto;
  margin: 16px 0 88px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
[data-skin="bauklotz"] .slide-image { object-position: left top; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-body {
  padding: 18px calc(24px + var(--safe-right)) 0 calc(24px + var(--safe-left));
}
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-meta { gap: 4px; margin-top: 0; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-title { font-size: 18px; line-height: 1.2; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-date { font-size: 14px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .scrubber { margin-top: 12px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .scrub-times { margin-top: 4px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .time-pos { font-size: 24px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .time-rest { font-size: 14px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .controls { margin-top: 10px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .speed-button { min-width: 60px; font-size: 15px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .skip-button { width: 48px; height: 48px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .skip-icon { width: 32px; height: 32px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .play-button { width: 60px; height: 60px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .play-icon { width: 24px; height: 24px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .pause-icon { width: 22px; height: 22px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .mark-button {
  height: 64px;
  margin-top: 14px;
  padding: 0 20px;
  font-size: 22px;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
}
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .mark-fold { width: 28px; height: 28px; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .player-links { margin-top: 4px; }

/* Eselsohren: ruled list, corner motif */
[data-skin="bauklotz"] .eselsohren-screen,
[data-skin="bauklotz"] .info-screen { gap: 0; }
[data-skin="bauklotz"] .corner-motif {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 96px;
  height: 96px;
}
[data-skin="bauklotz"] .corner-motif::before,
[data-skin="bauklotz"] .corner-motif::after {
  content: "";
  position: absolute;
  inset: 0;
}
[data-skin="bauklotz"] .corner-motif::before { background: var(--line); clip-path: polygon(0 0, 100% 0, 100% 100%); }
[data-skin="bauklotz"] .corner-motif::after { background: var(--red); clip-path: polygon(0 0, 100% 100%, 0 100%); }
[data-skin="bauklotz"] .title-block { gap: 8px; padding: 0; margin: 40px 0 0; }
[data-skin="bauklotz"] .eselsohren-screen .screen-title,
[data-skin="bauklotz"] .info-screen .screen-title { font-size: 42px; letter-spacing: -0.03em; }
[data-skin="bauklotz"] .mark-list { gap: 0; margin-top: 36px; border-bottom: 2px solid var(--ink); }
[data-skin="bauklotz"] .mark-list > .status-line { padding: 16px 0; border-top: 2px solid var(--ink); }
[data-skin="bauklotz"] .mark-card {
  background: transparent;
  border-radius: 0;
  border-top: 2px solid var(--ink);
  padding: 16px 0 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "term time"
    "text play";
  column-gap: 16px;
  row-gap: 8px;
}
[data-skin="bauklotz"] .mark-card.has-quote {
  grid-template-areas:
    "term time"
    "text play"
    "quote quote";
}
[data-skin="bauklotz"] .mark-card.is-pending { grid-template-areas: "term time" ". play"; }
[data-skin="bauklotz"] .mark-card.is-failed { grid-template-areas: "term time" ". play"; }
[data-skin="bauklotz"] .mark-card.is-failed .mark-time { font-size: 14px; font-weight: 600; color: var(--muted); }
[data-skin="bauklotz"] .mark-term { font-size: 22px; line-height: 1.15; letter-spacing: -0.01em; align-self: baseline; }
[data-skin="bauklotz"] .mark-time {
  justify-self: end;
  align-self: baseline;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border-radius: 0;
  padding: 0;
}
[data-skin="bauklotz"] .mark-text { font-size: 16px; }
[data-skin="bauklotz"] .mark-play { margin-left: 0; background: var(--blue); color: #FFFFFF; }

/* Einstellungen */
[data-skin="bauklotz"] .settings-screen { gap: 0; }
[data-skin="bauklotz"] .settings-screen > .screen-title { margin-top: 8px; padding: 0; }
[data-skin="bauklotz"] .setting-group { gap: 0; }
[data-skin="bauklotz"] .setting-label {
  margin: 24px 0 8px;
  padding: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[data-skin="bauklotz"] .screen-title + .setting-group .setting-label { margin-top: 28px; }
[data-skin="bauklotz"] .skin-tile { border: 0; border-radius: 0; background: transparent; padding: 0; gap: 8px; }
[data-skin="bauklotz"] .skin-art {
  position: relative;
  height: 92px;
  border-radius: 0;
  border: 1px solid #D7D2CB;
  padding: 12px;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}
[data-skin="bauklotz"] .skin-tile.is-selected .skin-art { border: 3px solid var(--ink); padding: 10px; }
[data-skin="bauklotz"] .skin-art svg { flex-shrink: 0; }
[data-skin="bauklotz"] .art-square { display: block; width: 40px; height: 40px; border-radius: 8px; background: #0A5FC2; flex-shrink: 0; }
[data-skin="bauklotz"] .art-lines { gap: 6px; padding-top: 4px; }
[data-skin="bauklotz"] .art-line { height: 6px; border-radius: 3px; }
[data-skin="bauklotz"] .skin-art-einfach .art-line-dark { background: #6B6B70; width: 80%; }
[data-skin="bauklotz"] .skin-art-einfach .art-line-light { background: #C9CACF; width: 55%; }
[data-skin="bauklotz"] .skin-art-bauklotz .art-line { border-radius: 0; }
[data-skin="bauklotz"] .skin-art-bauklotz .art-line-dark { background: #2B2B2E; width: 80%; }
[data-skin="bauklotz"] .skin-art-bauklotz .art-line-light { background: #D7D2CB; width: 55%; }
[data-skin="bauklotz"] .skin-art-bauklotz .art-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 16px;
  clip-path: none;
}
[data-skin="bauklotz"] .skin-caption { justify-content: flex-start; gap: 6px; padding: 0; }
[data-skin="bauklotz"] .skin-name { font-size: 16px; font-weight: 500; }
[data-skin="bauklotz"] .skin-tile.is-selected .skin-name { font-weight: 700; }
[data-skin="bauklotz"] .skin-check { color: var(--ink); }
[data-skin="bauklotz"] .segmented { gap: 0; padding: 0; border-radius: 0; background: transparent; border: 2px solid var(--ink); }
[data-skin="bauklotz"] .segment { height: 44px; border-radius: 0; font-size: 16px; font-weight: 600; }
[data-skin="bauklotz"] .segment.is-on { background: var(--ink); color: #FFFFFF; }
[data-skin="bauklotz"] .setting-row {
  margin-top: 24px;
  min-height: 52px;
  border-radius: 0;
  padding: 0 0 0 16px;
}
[data-skin="bauklotz"] .setting-row-label { font-size: 17px; }
[data-skin="bauklotz"] .tempo-cycle {
  min-width: 64px;
  height: 52px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  padding: 0 16px;
  font-variant-numeric: tabular-nums;
}
[data-skin="bauklotz"] .profile-field { height: 76px; border-radius: 0; padding: 14px 16px; font-size: 17px; line-height: 1.35; }
[data-skin="bauklotz"] .switch { width: 72px; height: 52px; }
[data-skin="bauklotz"] .switch::before {
  left: 8px;
  top: 12px;
  width: 48px;
  height: 28px;
  border-radius: 0;
  background: #FFFFFF;
  border: 2px solid var(--ink);
}
[data-skin="bauklotz"] .switch-knob { left: 13px; top: 17px; width: 18px; height: 18px; border-radius: 0; border: 0; background: var(--ink); }
[data-skin="bauklotz"] .switch.is-on::before { background: var(--blue); border-color: var(--blue); }
[data-skin="bauklotz"] .switch.is-on .switch-knob { left: 33px; background: #FFFFFF; }
[data-skin="bauklotz"] .account-card { border-radius: 0; }
[data-skin="bauklotz"] .account-name { font-size: 17px; color: var(--muted); border-bottom: 1px solid var(--line); }
[data-skin="bauklotz"] .account-logout {
  margin-left: 0;
  padding: 0 16px;
  border-top: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--red);
}
[data-skin="bauklotz"] .settings-error { padding: 12px 0 0; }

/* Real artwork (cover_url, or the first slide when there are slides): a thin frame in
   the skin colour, the fold sits on the frame corner. The image's own corner is cut
   (--notch) exactly where the fold is, so the fold never lies on the image. The large
   cover follows the artwork's aspect ratio (--ar, set by motifs.js fitCover). */
.cover-photo {
  --frame: 10px;
  --fold: 34px;
  --notch: calc(var(--fold) - var(--frame));
  --frame-color: var(--blue);
  --fold-color: var(--accent);
  position: relative;
  display: block;
  flex-shrink: 0;
  padding: var(--frame);
  border: 0;
  border-radius: 14px;
  background: var(--frame-color);
  color: inherit;
  clip-path: polygon(0 0, calc(100% - var(--fold)) 0, 100% var(--fold), 100% 100%, 0 100%);
}
button.cover-photo { cursor: pointer; }
.cover-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch), 100% 100%, 0 100%);
}
.cover-photo .cover-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--fold);
  height: var(--fold);
  background: var(--fold-color);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.cover-large.cover-photo {
  --cover-max-h: clamp(140px, calc(100dvh - 544px), 300px);
  align-self: center;
  margin-top: 8px;
  width: min(100%, calc(var(--cover-max-h) * var(--ar, 1) + 2 * var(--frame)));
  height: auto;
  aspect-ratio: auto;
}
.cover-large.cover-photo img { max-height: var(--cover-max-h); object-fit: contain; }
span.cover-small.cover-photo { --frame: 3px; --fold: 14px; width: 56px; height: 56px; border-radius: 10px; }
span.cover-small.cover-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
[data-skin="bauklotz"] .cover-photo { --frame: 12px; --fold: 44px; --fold-color: var(--red); border-radius: 0; }
[data-skin="bauklotz"] .cover-photo img { border-radius: 0; }
[data-skin="bauklotz"] .cover-large.cover-photo::before { content: none; }
[data-skin="bauklotz"] .cover-large.cover-photo {
  align-self: center;
  height: auto;
  width: min(100%, calc(var(--cover-max-h) * var(--ar, 1) + 2 * var(--frame)));
}
[data-skin="bauklotz"] .cover-photo .cover-fold { width: var(--fold); height: var(--fold); background: var(--fold-color); }
[data-skin="bauklotz"] span.cover-small.cover-photo { --frame: 4px; --fold: 20px; width: 72px; height: 72px; border-radius: 0; }
[data-skin="bauklotz"] span.cover-small.cover-photo img { border-radius: 0; }

/* Expanded stage (tap on the slide, or on a cover without slides): full display width,
   no frame, controls stay below. */
.player-screen[data-expanded="1"] .cover-large.cover-photo,
.player-screen[data-expanded="1"] .slide-frame {
  align-self: stretch;
  width: auto;
  margin-left: calc(-24px - var(--safe-left));
  margin-right: calc(-24px - var(--safe-right));
}
.player-screen[data-expanded="1"] .cover-photo { --frame: 0px; padding: 0; border-radius: 0; clip-path: none; }
.player-screen[data-expanded="1"] .cover-photo img { clip-path: none; border-radius: 0; max-height: none; }
.player-screen[data-expanded="1"] .cover-photo .cover-fold { display: none; }
html:not([data-skin="bauklotz"]) .player-screen[data-expanded="1"] .slide-frame {
  padding: 0;
  gap: 8px;
  border-radius: 0;
  background: transparent;
}
html:not([data-skin="bauklotz"]) .player-screen[data-expanded="1"] .slide-count-inner { padding: 0 24px; }
.slide-open { cursor: pointer; }

/* ===== v1.1: Folie/Cover switch, "Über die Folge" ===== */
.player-top-end { display: flex; align-items: center; gap: 10px; }
.view-switch {
  display: flex;
  padding: 2px;
  border-radius: 16px;
  background: var(--segment-bg);
}
.view-option {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.view-option.is-on { background: var(--surface); color: var(--ink); }

.info-link { color: var(--muted); }
.info-link:hover { color: var(--ink); }

.info-screen { gap: 14px; position: relative; }
.info-body { display: flex; flex-direction: column; gap: 22px; }
.info-summary { font-size: 16px; line-height: 1.5; white-space: pre-line; padding: 0 4px; }
.info-section { display: flex; flex-direction: column; gap: 8px; }
.info-heading { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 16px; }
.source-list,
.info-actions {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}
.source-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 11px 16px;
  color: var(--ink);
}
.source-row + .source-row,
.info-action + .info-action { border-top: 1px solid var(--line); }
.source-title { font-size: 16px; line-height: 1.3; color: var(--link); overflow-wrap: anywhere; }
.source-host { font-size: 13px; color: var(--muted); }
.info-action {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

[data-skin="bauklotz"] .view-switch { padding: 0; border-radius: 0; background: transparent; border: 2px solid var(--ink); }
[data-skin="bauklotz"] .view-option { height: 28px; border-radius: 0; color: var(--ink); font-weight: 700; }
[data-skin="bauklotz"] .view-option.is-on { background: var(--ink); color: #FFFFFF; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .view-switch { border-color: #FFFFFF; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .view-option { color: #FFFFFF; }
[data-skin="bauklotz"] .player-screen[data-variant="folie"] .view-option.is-on { background: #FFFFFF; color: var(--blue); }
[data-skin="bauklotz"] .player-top-end { gap: 14px; }
[data-skin="bauklotz"] .info-link { color: var(--ink); }
[data-skin="bauklotz"] .info-body { gap: 28px; margin-top: 28px; }
[data-skin="bauklotz"] .info-summary { font-size: 17px; padding: 0; }
[data-skin="bauklotz"] .info-section { gap: 0; }
[data-skin="bauklotz"] .info-heading { padding: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
[data-skin="bauklotz"] .source-list,
[data-skin="bauklotz"] .info-actions {
  background: transparent;
  border-radius: 0;
  border-bottom: 2px solid var(--ink);
}
[data-skin="bauklotz"] .source-row,
[data-skin="bauklotz"] .info-action { padding-left: 0; padding-right: 0; border-top: 2px solid var(--ink); }
[data-skin="bauklotz"] .source-row + .source-row,
[data-skin="bauklotz"] .info-action + .info-action { border-top: 2px solid var(--ink); }
[data-skin="bauklotz"] .source-title { color: var(--blue); font-weight: 600; }
[data-skin="bauklotz"] .info-action { color: var(--blue); font-weight: 700; }
