.zd-exam-header,
.zd-exam-footer {
  border-color: rgba(23, 33, 29, 0.1) !important;
  background: rgba(251, 248, 241, 0.94) !important;
  box-shadow: 0 8px 24px rgba(52, 43, 25, 0.07) !important;
  backdrop-filter: blur(14px);
}

.zd-exam-header {
  height: 4.5rem !important;
  min-height: 4.5rem !important;
  padding-bottom: 0 !important;
}

.zd-exam-header > div,
.zd-exam-footer > div {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
}

.zd-exam-header #brand-logo {
  width: auto;
  height: 3.5rem;
  object-fit: contain;
}

.zd-exam-header #back-btn,
.zd-exam-header #return-btn,
.zd-exam-header #settings-btn {
  width: 2.75rem !important;
  height: 2.75rem !important;
  min-width: 2.75rem;
  border-color: rgba(84, 72, 45, 0.18) !important;
  background: #fff !important;
  color: #26312b !important;
}

.zd-exam-header #part-cards-wrap {
  scrollbar-width: thin;
}

.zd-exam-header #part-cards {
  flex-wrap: nowrap !important;
  justify-content: center !important;
}

.zd-exam-header #part-cards button {
  min-height: 2.65rem;
  flex: 0 0 auto;
  border-radius: 0.9rem;
}

.zd-exam-footer {
  height: 4.25rem !important;
  min-height: 4.25rem !important;
  padding: 0 !important;
}

.zd-exam-footer button,
.zd-exam-footer a {
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shreiben-page .shreiben-writing-block {
  min-height: 32rem;
  height: auto !important;
}

.shreiben-page .shreiben-editor {
  min-height: 24rem !important;
}

.shreiben-page.shreiben-single-task .shreiben-main {
  padding-inline: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-workspace,
.shreiben-page.shreiben-single-task .shreiben-task-card,
.shreiben-page.shreiben-single-task .shreiben-info-block,
.shreiben-page.shreiben-single-task .shreiben-writing-block,
.shreiben-page.shreiben-single-task .shreiben-editor {
  border-radius: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-workspace {
  padding: 0 !important;
  box-shadow: none !important;
}

.shreiben-page.shreiben-single-task .shreiben-writing-block {
  padding: 0 !important;
  gap: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-writing-header,
.shreiben-page.shreiben-single-task .shreiben-answer-meta,
.shreiben-page.shreiben-single-task .shreiben-answer-actions,
.shreiben-page.shreiben-single-task .shreiben-answer-toolbar {
  padding: 1rem 1.5rem;
}

.shreiben-page.shreiben-single-task .shreiben-answer-actions {
  padding-top: 0;
}

.shreiben-page.shreiben-single-task .shreiben-answer-toolbar {
  margin-top: auto !important;
}

.shreiben-page.shreiben-single-task .shreiben-editor {
  border-right: 0 !important;
  border-left: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-workspace-heading,
.shreiben-page.shreiben-single-task .shreiben-task-heading {
  padding: 1rem 1.5rem;
}

.shreiben-page.shreiben-single-task .shreiben-content,
.shreiben-page.shreiben-single-task .shreiben-task-layout {
  margin: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-task-card {
  padding: 0 !important;
  border-inline: 0 !important;
  box-shadow: none !important;
}

.shreiben-page.shreiben-single-task .shreiben-task-card > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-task-heading {
  border-top: 1px solid rgba(84, 72, 45, 0.14);
}

.shreiben-page.shreiben-single-task .shreiben-info-block {
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
}

.shreiben-page.shreiben-single-task .shreiben-task-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.shreiben-page.shreiben-single-task .shreiben-task-columns > * {
  min-width: 0;
}

@media (min-width: 1024px) {
  .shreiben-page.shreiben-single-task .shreiben-main {
    position: fixed;
    top: 4.5rem;
    bottom: 4.25rem;
    left: 0;
    z-index: 20;
    width: 50vw;
    height: auto;
    padding-block: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .shreiben-page.shreiben-single-task .shreiben-workspace {
    min-height: 100%;
    border: 0 !important;
  }

  .shreiben-page.shreiben-single-task .shreiben-workspace-heading {
    position: sticky;
    top: 0;
    z-index: 4;
    border-bottom: 1px solid rgba(84, 72, 45, 0.14);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
  }

  .shreiben-page.shreiben-single-task .shreiben-task-layout {
    display: block !important;
  }

  .shreiben-page.shreiben-single-task .shreiben-task-columns {
    height: auto !important;
    padding-right: 0 !important;
    overflow: visible !important;
  }

  .shreiben-page.shreiben-single-task .shreiben-answer-column {
    position: fixed;
    top: 4.5rem;
    right: 0;
    bottom: 4.25rem;
    z-index: 20;
    width: 50vw;
    height: auto;
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .shreiben-page.shreiben-single-task .shreiben-answer-column > .shreiben-writing-block {
    min-height: 0;
    height: 100% !important;
    overflow: hidden;
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
  }

  .shreiben-page.shreiben-single-task .shreiben-answer-column .shreiben-editor {
    min-height: 0 !important;
    height: auto !important;
    flex: 1 1 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

}

@media (max-width: 900px) {
  .zd-exam-header {
    height: auto !important;
    min-height: 7.45rem !important;
  }

  .zd-exam-header > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left actions"
      "parts parts";
    align-items: center;
    height: auto !important;
    padding: 0.6rem 0.75rem 0.75rem !important;
    gap: 0.6rem !important;
  }

  .zd-exam-header #header-left {
    grid-area: left;
    min-width: 0;
  }

  .zd-exam-header #header-actions {
    grid-area: actions;
  }

  .zd-exam-header #part-cards-wrap {
    grid-area: parts;
    width: 100%;
    display: block !important;
  }

  .zd-exam-header #brand-logo {
    height: 2.4rem;
  }

  .zd-exam-header #return-label,
  .zd-exam-header #header-divider {
    display: none;
  }

  .zd-exam-header #header-left,
  .zd-exam-header #header-actions {
    gap: 0.45rem !important;
  }

  .zd-exam-header #theme-title {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .zd-exam-header #part-cards-wrap {
    justify-content: flex-start !important;
  }

  .zd-exam-header #part-cards {
    width: 100% !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .zd-exam-header #part-cards button {
    min-height: 2.35rem;
    padding-inline: 0.7rem;
    font-size: 0.58rem;
  }

  .zd-exam-footer > div {
    min-height: 4.25rem;
    flex-wrap: nowrap !important;
  }

  .zd-exam-footer img {
    height: 1.5rem !important;
  }

  .zd-exam-footer button,
  .zd-exam-footer a {
    min-width: auto !important;
    padding: 0.55rem 0.8rem !important;
    font-size: 0.58rem !important;
    flex: 0 0 auto !important;
  }

  body:not(.lesen-page) main {
    padding-top: 9rem !important;
  }

  .shreiben-page .zd-exam-header:has(#part-cards-wrap.hidden) {
    min-height: 4.5rem !important;
  }

  .shreiben-page .zd-exam-header:has(#part-cards-wrap.hidden) > div {
    grid-template-areas: "left actions";
    padding-block: 0.55rem !important;
  }

  .shreiben-page:has(#part-cards-wrap.hidden) main {
    padding-top: 5.75rem !important;
  }
}

@media (max-width: 640px) {
  .zd-exam-header #brand-logo {
    display: none;
  }

  .zd-exam-header #header-title {
    display: none;
  }

  .zd-exam-header #timer-display {
    padding-inline: 0.55rem;
  }

  .zd-exam-header #hide-aussage-shortcut span {
    display: none;
  }

  .zd-exam-footer > div > div:first-child span {
    display: none;
  }

  .shreiben-page .shreiben-writing-block {
    min-height: 0;
  }

  .shreiben-page .shreiben-editor {
    min-height: 55svh !important;
  }
}

/* Shared ZDeutsch navigation -------------------------------------------------
   The visible site navigation is intentionally owned by the React shell. The
   legacy header controls below it remain available for exercise state, parts,
   timers and settings, without duplicating the old library/back navigation. */
:root {
  --zd-exam-header-height: 8rem;
  --zd-exam-footer-height: 4.25rem;
  --zd-page-gutter: clamp(1rem, 2.4vw, 2.5rem);
  --zd-ui-bg: #f8faf8;
  --zd-ui-surface: #ffffff;
  --zd-ui-soft: #f2f6f3;
  --zd-ui-line: #e4eae5;
  --zd-ui-text: #26332c;
  --zd-ui-muted: #738078;
  --zd-ui-green: #3b8066;
  --zd-ui-green-soft: #edf6f1;
}

.lesen-page,
.shreiben-page,
body:has(.zd-exam-header[data-exam-module="horen"]),
.mundlich-page {
  background: var(--zd-ui-bg) !important;
  color: var(--zd-ui-text) !important;
  font-size: 17px;
}

body.theme-body .zd-exam-header {
  position: fixed !important;
  inset: 0 0 auto !important;
  z-index: 70 !important;
  display: block !important;
  height: var(--zd-exam-header-height) !important;
  min-height: var(--zd-exam-header-height) !important;
  overflow: visible !important;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 1px 0 var(--zd-ui-line), 0 8px 24px rgba(28, 45, 36, 0.04) !important;
  backdrop-filter: blur(18px);
}

body.theme-body .zd-exam-header > div {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
}

body.theme-body .zd-global-header__main {
  display: grid !important;
  grid-template-columns: minmax(8.5rem, auto) minmax(28rem, 1fr) auto !important;
  align-items: center !important;
  gap: clamp(1rem, 2.5vw, 2.75rem) !important;
  height: 4.5rem !important;
  padding: 0 var(--zd-page-gutter) !important;
  border-bottom: 1px solid var(--zd-ui-line);
}

.zd-global-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 0.75rem;
  color: var(--zd-ui-text);
  text-decoration: none;
}

.zd-global-brand-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.zd-mobile-menu-toggle,
.zd-mobile-menu-backdrop,
.zd-mobile-menu {
  display: none;
}

.zd-global-brand:focus-visible,
.zd-global-modules a:focus-visible,
.zd-global-levels a:focus-visible {
  outline: 3px solid rgba(38, 114, 87, 0.22);
  outline-offset: 3px;
}

.zd-global-brand img {
  display: block;
  width: auto;
  height: 3.25rem;
  object-fit: contain;
}

.zd-global-modules {
  min-width: 0;
  display: flex;
  align-items: stretch;
  align-self: stretch;
  justify-content: center;
  gap: 0.35rem;
  font-family: "Manrope", sans-serif;
}

.zd-global-modules a {
  position: relative;
  min-width: 6.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border-radius: 0;
  color: var(--zd-ui-muted);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.zd-global-modules a::after {
  position: absolute;
  right: 1rem;
  bottom: -1px;
  left: 1rem;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.zd-global-modules a:hover {
  background: #f7f9f6;
  color: var(--zd-ui-text);
}

.zd-global-modules a.is-active {
  color: var(--zd-ui-green);
  font-weight: 600;
}

.zd-global-modules a.is-active::after {
  background: var(--zd-ui-green);
}

.zd-global-header__end,
.zd-global-user-slot {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.zd-pwa-install {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid rgba(59, 128, 102, 0.22);
  border-radius: 999px;
  background: var(--zd-ui-green-soft);
  padding: 0.45rem 0.75rem;
  color: var(--zd-ui-green);
  font-family: "Manrope", sans-serif;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.zd-pwa-install:hover,
.zd-pwa-install:focus-visible {
  border-color: rgba(59, 128, 102, 0.48);
  background: #e5f3eb;
  transform: translateY(-1px);
}

.zd-pwa-install:focus-visible {
  outline: 3px solid rgba(38, 114, 87, 0.2);
  outline-offset: 2px;
}

.zd-pwa-install svg,
.zd-pwa-help__icon svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zd-pwa-install.is-menu {
  width: 100%;
  min-height: 2.9rem;
  justify-content: flex-start;
  border-radius: 0.7rem;
  padding-inline: 0.8rem;
  font-size: 0.86rem;
}

.zd-pwa-help {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.zd-pwa-help__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(19, 30, 24, 0.48);
  backdrop-filter: blur(5px);
}

.zd-pwa-help__card {
  position: relative;
  width: min(100%, 25rem);
  border: 1px solid var(--zd-ui-line);
  border-radius: 1.25rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 28px 70px rgba(20, 35, 27, 0.2);
  text-align: start;
}

.zd-pwa-help__icon {
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  background: var(--zd-ui-green-soft);
  color: var(--zd-ui-green);
}

.zd-pwa-help__card h2 {
  margin: 1rem 0 0;
  color: var(--zd-ui-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.zd-pwa-help__card p {
  margin: 0.6rem 0 1.2rem;
  color: var(--zd-ui-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.zd-pwa-help__card > button:last-child {
  width: 100%;
  min-height: 2.8rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--zd-ui-green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.zd-global-levels {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid var(--zd-ui-line);
  border-radius: 999px;
  background: var(--zd-ui-soft);
  padding: 0.25rem;
  font-family: "Manrope", sans-serif;
}

.zd-global-levels__label {
  padding: 0 0.5rem 0 0.65rem;
  color: var(--zd-ui-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.zd-global-levels a {
  min-width: 2.65rem;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--zd-ui-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.zd-global-levels a:hover {
  color: var(--zd-ui-text);
}

.zd-global-levels a.is-active {
  background: var(--zd-ui-surface);
  box-shadow: 0 1px 5px rgba(28, 45, 36, 0.09);
  color: var(--zd-ui-green);
}

.zd-global-levels a.is-unavailable:not(.is-active) {
  color: #9aa39e;
}

.zd-exam-context {
  display: block !important;
  height: 3.5rem !important;
  border-bottom: 1px solid var(--zd-ui-line);
  background: rgba(248, 250, 247, 0.96);
}

.zd-exam-context:not(.zd-speaking-context) > div {
  width: 100%;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(9rem, auto) minmax(0, 1fr) auto !important;
  grid-template-areas: "context-title context-parts context-actions" !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 0 var(--zd-page-gutter) !important;
}

.zd-exam-context #header-left {
  grid-area: context-title;
  min-width: 0;
  display: flex !important;
}

.zd-exam-context #header-left > :not(#header-title) {
  display: none !important;
}

.zd-exam-context #header-title {
  min-width: 0;
  display: block !important;
}

.zd-exam-context #header-title > div {
  display: block !important;
}

.zd-exam-context #theme-title {
  max-width: 18rem !important;
  overflow: hidden;
  color: var(--zd-ui-text) !important;
  font-size: 0.95rem !important;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zd-exam-context #level-pill {
  display: none !important;
}

.zd-exam-context #part-cards-wrap {
  grid-area: context-parts;
  min-width: 0;
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  overflow-x: auto;
  scrollbar-width: none;
}

.zd-exam-context #part-cards-wrap::-webkit-scrollbar,
.zd-exam-context #part-cards::-webkit-scrollbar {
  display: none;
}

.zd-exam-context #part-cards {
  width: auto !important;
  min-width: 0;
  justify-content: center !important;
  gap: 0.4rem !important;
  overflow: visible;
}

.zd-exam-context #part-cards button {
  min-height: 2.25rem !important;
  border-color: var(--zd-ui-line) !important;
  border-radius: 999px !important;
  background: var(--zd-ui-surface);
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  box-shadow: none !important;
}

.zd-exam-context #header-actions {
  grid-area: context-actions;
  display: flex !important;
}

.zd-exam-context #settings-btn,
.zd-exam-context #hide-aussage-shortcut {
  min-height: 2.35rem !important;
  border-color: var(--zd-ui-line) !important;
  border-radius: 999px !important;
  background: var(--zd-ui-surface) !important;
  box-shadow: none !important;
}

.zd-exam-context #settings-btn {
  width: 2.35rem !important;
  height: 2.35rem !important;
  min-width: 2.35rem;
}

.zd-speaking-context {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--zd-page-gutter);
}

.zd-speaking-context__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--zd-ui-muted);
  font: 500 0.9rem/1 "Manrope", sans-serif;
}

.zd-speaking-context__title strong {
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  border-radius: 999px;
  background: var(--zd-ui-green-soft);
  padding: 0 0.65rem;
  color: var(--zd-ui-green);
  font-size: 0.7rem;
}

.zd-speaking-context .oral-header-actions {
  gap: 0.4rem;
}

.zd-speaking-context .oral-timer-button,
.zd-speaking-context .oral-icon-button {
  min-height: 2.35rem;
  border-color: var(--zd-ui-line);
  border-radius: 999px;
  background: var(--zd-ui-surface);
  box-shadow: none;
}

.zd-speaking-context .oral-timer-button {
  min-width: 5rem;
}

.zd-speaking-context .oral-icon-button {
  width: 2.35rem;
}

.zd-exam-header .zd-session-user {
  border-color: var(--zd-ui-line);
  background: var(--zd-ui-surface);
  box-shadow: none;
}

.zd-exam-header .zd-session-name {
  font-size: 0.75rem;
}

.zd-exam-header .zd-session-meta {
  font-size: 0.62rem;
}

.zd-guest-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Manrope", sans-serif;
}

.zd-guest-actions a {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--zd-ui-line);
  border-radius: 999px;
  background: var(--zd-ui-surface);
  padding: 0 0.85rem;
  color: var(--zd-ui-text);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
}

.zd-guest-actions a.is-primary {
  border-color: var(--zd-ui-green);
  background: var(--zd-ui-green);
  color: #fff;
}

.lesen-page #settings-panel,
.shreiben-page #settings-panel,
body:has(.zd-exam-header[data-exam-module="horen"]) #settings-panel {
  top: calc(var(--zd-exam-header-height) + 0.75rem) !important;
}

.lesen-page #exam-view {
  padding: calc(var(--zd-exam-header-height) + 1rem) var(--zd-page-gutter) calc(var(--zd-exam-footer-height) + 1rem) !important;
}

.lesen-page #exam-grid {
  height: calc(100vh - var(--zd-exam-header-height) - var(--zd-exam-footer-height) - 2rem) !important;
}

.lesen-page .exam-panel {
  border-color: var(--zd-ui-line) !important;
  border-radius: 1rem !important;
  background: var(--zd-ui-surface) !important;
  box-shadow: 0 10px 30px rgba(28, 45, 36, 0.055) !important;
}

.lesen-page #left-panel,
.lesen-page #right-panel {
  font-size: 1.06rem;
  line-height: 1.75;
}

.zd-exam-header[data-exam-module="horen"] ~ main {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: calc(var(--zd-exam-header-height) + 1.25rem) var(--zd-page-gutter) calc(var(--zd-exam-footer-height) + 2rem) !important;
  font-size: 1.05rem;
}

body:has(.zd-exam-header[data-exam-module="horen"]) .horen-callout,
body:has(.zd-exam-header[data-exam-module="horen"]) #horen-source-panel,
body:has(.zd-exam-header[data-exam-module="horen"]) #search-bar-container {
  max-width: none;
}

.shreiben-page .shreiben-main {
  padding-top: calc(var(--zd-exam-header-height) + 1rem) !important;
}

.shreiben-page .shreiben-workspace {
  width: 100%;
  max-width: none;
  border-color: var(--zd-ui-line) !important;
  background: var(--zd-ui-surface) !important;
}

.shreiben-page .shreiben-content,
.shreiben-page .shreiben-editor {
  font-size: 1.05rem;
}

.mundlich-page .oral-main {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: calc(var(--zd-exam-header-height) + 1.5rem) var(--zd-page-gutter) 5rem !important;
}

.correction-page .home-view {
  width: 100% !important;
  max-width: none !important;
  padding-top: calc(var(--zd-exam-header-height) + 1.2rem) !important;
}

.mundlich-page .oral-hero,
.mundlich-page .oral-workspace {
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(28, 45, 36, 0.07);
}

.zd-exam-footer > div {
  width: 100%;
  max-width: none !important;
  padding-inline: var(--zd-page-gutter) !important;
}

@media (min-width: 1024px) {
  .shreiben-page.shreiben-single-task .shreiben-main,
  .shreiben-page.shreiben-single-task .shreiben-answer-column {
    top: var(--zd-exam-header-height) !important;
  }

  .shreiben-page.shreiben-single-task .shreiben-answer-column .shreiben-editor {
    min-height: calc(100vh - var(--zd-exam-header-height) - var(--zd-exam-footer-height) - 15rem) !important;
  }
}

@media (max-width: 1050px) {
  body.theme-body .zd-exam-header > .zd-global-header__main {
    height: 4.5rem !important;
    display: grid !important;
    grid-template-columns: auto minmax(24rem, 1fr) auto !important;
    grid-template-areas: none !important;
    gap: 0.75rem !important;
    padding: 0 var(--zd-page-gutter) !important;
  }

  body.theme-body .zd-exam-header > .zd-exam-context {
    height: 3.5rem !important;
    display: block !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  body.theme-body .zd-exam-header > .zd-speaking-context {
    display: flex !important;
    padding: 0 var(--zd-page-gutter) !important;
  }

  .zd-global-brand img {
    height: 2.8rem;
  }

  .zd-global-modules a {
    min-width: 5.25rem;
    padding-inline: 0.65rem;
    font-size: 0.92rem;
  }

  .zd-global-levels__label,
  .zd-exam-header .zd-session-copy {
    display: none;
  }

  .zd-pwa-install:not(.is-menu) span {
    display: none;
  }

  .zd-pwa-install:not(.is-menu) {
    width: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --zd-exam-header-height: 7.85rem;
    --zd-page-gutter: 0.75rem;
  }

  body.theme-body .zd-exam-header {
    height: var(--zd-exam-header-height) !important;
    min-height: var(--zd-exam-header-height) !important;
  }

  body.theme-body .zd-exam-header > .zd-global-header__main {
    height: 4.5rem !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: 4.5rem !important;
    grid-template-areas: "brand end" !important;
    gap: 0.55rem !important;
    padding: 0 var(--zd-page-gutter) !important;
  }

  body.theme-body .zd-exam-header > .zd-exam-context {
    height: 3.35rem !important;
    display: block !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .zd-global-brand-group {
    grid-area: brand;
  }

  .zd-mobile-menu-toggle {
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 2.45rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px solid var(--zd-ui-line);
    border-radius: 0.7rem;
    background: var(--zd-ui-surface);
    color: var(--zd-ui-text);
    cursor: pointer;
  }

  .zd-mobile-menu-toggle span {
    width: 1rem;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
  }

  .zd-global-brand img {
    height: 2.65rem;
  }

  .zd-global-modules {
    display: none !important;
  }

  .zd-global-modules a {
    min-width: 0;
    padding-inline: 0.25rem;
    font-size: 0.83rem;
  }

  .zd-global-modules a::after {
    right: 0.4rem;
    left: 0.4rem;
  }

  .zd-global-header__end {
    grid-area: end;
    gap: 0.4rem;
  }

  .zd-global-levels {
    display: none;
  }

  .zd-global-levels a {
    min-width: 2.25rem;
    min-height: 2rem;
    font-size: 0.74rem;
  }

  .zd-global-user-slot .zd-session-user {
    gap: 0.05rem;
    padding: 0.15rem;
  }

  .zd-global-user-slot > .zd-guest-actions {
    display: none;
  }

  .zd-global-user-slot .zd-session-avatar {
    width: 1.9rem;
    height: 1.9rem;
    flex-basis: 1.9rem;
  }

  .zd-global-user-slot .zd-session-logout {
    min-width: 1.9rem;
    min-height: 1.9rem;
    padding-inline: 0.35rem;
  }

  body.zd-mobile-menu-open {
    overflow: hidden;
  }

  .zd-mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    border: 0;
    background: rgba(20, 29, 24, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .zd-mobile-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .zd-mobile-menu {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 91;
    width: min(86vw, 22rem);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--zd-ui-line);
    background: #fbfcfa;
    box-shadow: 1.5rem 0 3.5rem rgba(20, 29, 24, 0.16);
    padding: 1rem;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 200ms ease, visibility 200ms step-end;
  }

  .zd-mobile-menu.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 200ms ease, visibility 0ms step-start;
  }

  .zd-mobile-menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--zd-ui-line);
    padding-bottom: 1rem;
  }

  .zd-mobile-menu__top a,
  .zd-mobile-menu__top img {
    display: block;
  }

  .zd-mobile-menu__top img {
    width: auto;
    height: 3rem;
  }

  .zd-mobile-menu__top button {
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--zd-ui-line);
    border-radius: 50%;
    background: white;
    color: var(--zd-ui-text);
    font: 300 1.7rem/1 sans-serif;
    cursor: pointer;
  }

  .zd-mobile-menu__modules {
    display: grid;
    margin-top: 0.75rem;
  }

  .zd-mobile-menu__modules a {
    min-height: 3.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--zd-ui-line);
    padding: 0 0.8rem;
    color: var(--zd-ui-text);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
  }

  .zd-mobile-menu__modules a.is-active {
    border-radius: 0.7rem;
    background: var(--zd-ui-green-soft);
    color: var(--zd-ui-green);
  }

  .zd-mobile-menu__modules small {
    color: var(--zd-ui-muted);
    font-size: 0.7rem;
  }

  .zd-mobile-menu__levels {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.25rem;
  }

  .zd-mobile-menu__levels > span {
    color: var(--zd-ui-muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .zd-mobile-menu__levels > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .zd-mobile-menu__levels a {
    min-height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--zd-ui-line);
    border-radius: 0.7rem;
    background: white;
    color: var(--zd-ui-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
  }

  .zd-mobile-menu__levels a.is-active {
    border-color: var(--zd-ui-green);
    background: var(--zd-ui-green-soft);
    color: var(--zd-ui-green);
  }

  .zd-mobile-menu__levels a.is-unavailable:not(.is-active) {
    color: #9aa39e;
  }

  .zd-mobile-menu__account {
    display: grid;
    gap: 0.4rem;
    margin-top: auto;
    border-top: 1px solid var(--zd-ui-line);
    padding-top: 1rem;
  }

  .zd-mobile-menu__account a {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    border-radius: 0.65rem;
    padding: 0 0.8rem;
    color: var(--zd-ui-text);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
  }

  .zd-mobile-menu__account a:hover,
  .zd-mobile-menu__account a:focus-visible {
    background: var(--zd-ui-soft);
  }

  .zd-mobile-menu__account .zd-guest-actions.is-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
  }

  .zd-mobile-menu__account .zd-guest-actions.is-mobile a {
    justify-content: center;
    border: 1px solid var(--zd-ui-line);
    border-radius: 999px;
    padding: 0 0.65rem;
  }

  .zd-mobile-menu__account .zd-guest-actions.is-mobile a.is-primary {
    background: var(--zd-ui-green);
    color: #fff;
  }

  .zd-exam-context:not(.zd-speaking-context) > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "context-parts context-actions" !important;
    gap: 0.5rem !important;
    padding: 0 var(--zd-page-gutter) !important;
  }

  .zd-exam-context #header-left {
    display: none !important;
  }

  .zd-exam-context #part-cards-wrap,
  .zd-exam-context #part-cards {
    justify-content: flex-start !important;
  }

  .zd-exam-context #part-cards button {
    min-height: 2.15rem !important;
    padding-inline: 0.7rem;
    font-size: 0.66rem;
  }

  body.theme-body .zd-exam-header > .zd-speaking-context {
    height: 3.35rem !important;
    display: flex !important;
    gap: 0.5rem !important;
    padding: 0 var(--zd-page-gutter) !important;
  }

  .zd-speaking-context__title span {
    font-size: 0.82rem;
  }

  .lesen-page #aside-toggle {
    top: calc(var(--zd-exam-header-height) - 0.65rem) !important;
  }

  .lesen-page #exam-view {
    padding-top: calc(var(--zd-exam-header-height) + 0.75rem) !important;
  }

  .lesen-page #exam-grid {
    height: calc(100vh - var(--zd-exam-header-height) - var(--zd-exam-footer-height) - 1.5rem) !important;
  }

  .zd-exam-header[data-exam-module="horen"] ~ main {
    padding-top: calc(var(--zd-exam-header-height) + 1rem) !important;
  }

  .shreiben-page .shreiben-main,
  .shreiben-page:has(#part-cards-wrap.hidden) main {
    padding-top: calc(var(--zd-exam-header-height) + 0.75rem) !important;
  }

  .mundlich-page .oral-main {
    padding-top: calc(var(--zd-exam-header-height) + 0.75rem) !important;
    padding-bottom: calc(var(--zd-exam-footer-height) + env(safe-area-inset-bottom) + 3.5rem) !important;
  }

  .lesen-page #left-panel,
  .lesen-page #right-panel {
    scroll-padding-bottom: calc(var(--zd-exam-footer-height) + env(safe-area-inset-bottom) + 2rem);
    padding-bottom: calc(var(--zd-exam-footer-height) + env(safe-area-inset-bottom) + 2rem) !important;
  }

  .zd-catalog-main,
  .zd-account-main,
  .zd-admin-main {
    padding-bottom: calc(var(--zd-exam-footer-height) + env(safe-area-inset-bottom) + 2.5rem) !important;
  }
}

@media (max-width: 390px) {
  .zd-global-brand img {
    height: 2.35rem;
  }

  .zd-global-levels a {
    min-width: 2rem;
  }

  .zd-global-user-slot .zd-session-avatar {
    display: inline-flex;
  }
}

/* Mobile exam polish ------------------------------------------------------ */
.zd-result-part {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--zd-ui-line);
  border-radius: 1rem;
  background: var(--zd-ui-surface);
  padding: 1rem;
}

.zd-result-part-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.zd-result-review-toggle,
.zd-result-revisit {
  min-height: 2.35rem;
  border: 1px solid var(--zd-ui-line);
  border-radius: 999px;
  background: var(--zd-ui-soft);
  padding: 0 0.9rem;
  color: var(--zd-ui-text);
  font: 600 0.72rem/1 "Manrope", sans-serif;
  cursor: pointer;
}

.zd-result-revisit {
  border-color: #b9d7ca;
  background: var(--zd-ui-green-soft);
  color: var(--zd-ui-green);
}

.zd-result-answer-list {
  display: grid;
  gap: 0.5rem;
}

.zd-result-answer-list.hidden {
  display: none;
}

.zd-result-answer {
  display: grid;
  gap: 0.2rem;
  border-inline-start: 3px solid #d4a29d;
  background: #fff8f7;
  padding: 0.7rem 0.8rem;
  color: var(--zd-ui-muted);
  font-size: 0.76rem;
}

.zd-result-answer strong {
  color: var(--zd-ui-text);
}

.zd-result-answer.is-correct {
  border-inline-start-color: #77ad94;
  background: #f2faf5;
}

.shreiben-mobile-editor-toggle {
  display: none;
}

@media (max-width: 760px) {
  body.theme-body .zd-exam-header > .zd-exam-context.zd-library-context {
    height: auto !important;
    min-height: 3.35rem;
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    overflow: hidden;
    padding: 0.55rem var(--zd-page-gutter) !important;
  }

  .shreiben-page .zd-exam-context:has(#part-cards-wrap.hidden) > div {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "context-title context-actions" !important;
  }

  .shreiben-page .zd-exam-context:has(#part-cards-wrap.hidden) #header-left {
    display: flex !important;
  }

  .shreiben-page .zd-exam-context:has(#part-cards-wrap.hidden) #part-cards-wrap {
    display: none !important;
  }

  .zd-library-context > span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .zd-library-context > p {
    display: none;
  }

  .lesen-page #aside-toggle {
    top: calc(var(--zd-exam-header-height) + 0.55rem) !important;
    right: max(0.75rem, env(safe-area-inset-right)) !important;
    z-index: 39 !important;
  }

  .lesen-page #exam-view {
    padding-top: calc(var(--zd-exam-header-height) + 3.65rem) !important;
  }

  .lesen-page #result-view {
    height: auto !important;
    min-height: 100svh;
    overflow: visible !important;
    padding: calc(var(--zd-exam-header-height) + 1rem) 0.75rem 2rem !important;
  }

  .lesen-page #result-view > div > div {
    border-radius: 1rem !important;
    padding: 1.25rem !important;
  }

  .lesen-page #result-summary > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .lesen-page #result-summary > div > div {
    padding: 0.8rem !important;
  }

  .lesen-page #result-summary .text-2xl {
    font-size: 1.1rem !important;
  }

}

.shreiben-page.shreiben-single-task .shreiben-answer-column > .shreiben-writing-block.is-fullscreen {
  min-height: 0;
  height: auto !important;
}

.shreiben-page.shreiben-single-task .shreiben-writing-block.is-fullscreen .shreiben-editor {
  min-height: 0 !important;
  height: auto !important;
  flex: 1 1 0;
  overflow-y: auto !important;
}

@media (max-width: 1023px) {
  .shreiben-page.shreiben-single-task:not(.shreiben-mobile-task-open) {
    overflow: hidden;
  }

  .shreiben-page.shreiben-single-task .shreiben-answer-column {
    position: fixed !important;
    top: var(--zd-exam-header-height) !important;
    right: 0 !important;
    bottom: var(--zd-exam-footer-height) !important;
    left: 0 !important;
    z-index: 30 !important;
    width: 100% !important;
    min-height: 0;
    margin: 0 !important;
    overflow: hidden;
    background: #fff;
  }

  .shreiben-page.shreiben-single-task .shreiben-answer-column > .shreiben-writing-block {
    min-height: 0;
    height: 100% !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .shreiben-page.shreiben-single-task .shreiben-editor {
    min-height: 0 !important;
    height: auto !important;
    flex: 1 1 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .shreiben-page.shreiben-single-task.shreiben-mobile-task-open .shreiben-answer-column {
    visibility: hidden;
    pointer-events: none;
  }

  .shreiben-page.shreiben-single-task.shreiben-mobile-task-open .shreiben-mobile-editor-toggle {
    position: fixed;
    left: max(1rem, env(safe-area-inset-left));
    bottom: calc(var(--zd-exam-footer-height) + max(1rem, env(safe-area-inset-bottom)));
    z-index: 35;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .shreiben-writing-header,
  .shreiben-answer-meta,
  .shreiben-answer-actions,
  .shreiben-answer-toolbar {
    flex: 0 0 auto;
  }
}

/* The fullscreen editor is attached directly to body, above app chrome and
   below correction dialogs (240) and TELC rule dialogs. */
.shreiben-page .shreiben-writing-block.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 120 !important;
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  height: 100svh !important;
  height: 100dvh !important;
  max-height: none !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left)) !important;
  overflow: hidden !important;
  box-sizing: border-box;
  box-shadow: none;
}

.shreiben-page .shreiben-writing-block.is-fullscreen .shreiben-editor {
  min-height: 0 !important;
  height: auto !important;
  flex: 1 1 0;
  overflow-y: auto !important;
}

/* The private simulation uses the shared header's level slot for exam controls. */
.zd-exam-workspace .zd-global-user-slot { display: none; }
.zd-simulation-header-actions { display: flex; align-items: center; gap: 10px; }
.zd-simulation-header-clock { display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--zd-ui-line); border-radius: 999px; background: var(--zd-ui-soft); color: var(--zd-ui-text); font: 650 15px/1.4 Manrope,system-ui,sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zd-simulation-header-clock.is-urgent { color: #a33535; background: #fff4f4; border-color: #e0b6b6; }
.zd-exam-workspace .zd-simulation-submit { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 18px !important; border: 1px solid var(--zd-ui-green) !important; border-radius: 999px; background: var(--zd-ui-green) !important; color: #fff !important; font: 650 13px/1.4 Manrope,system-ui,sans-serif !important; letter-spacing: 0 !important; white-space: nowrap; cursor: pointer; }
.zd-exam-workspace .zd-simulation-submit:hover { filter: brightness(.93); }
.zd-exam-workspace .zd-simulation-submit:focus-visible { outline: 3px solid #d8aa47; outline-offset: 3px; }
.zd-simulation-submit__short { display: none; }
@media(max-width:760px) {
  .zd-simulation-header-actions { gap: 6px; }
  .zd-simulation-header-clock { min-width: 80px; min-height: 38px; padding: 7px 8px; font-size: 12px; }
  .zd-exam-workspace .zd-simulation-submit { min-height: 38px; padding: 8px 12px !important; font-size: 12px !important; }
  .zd-simulation-submit__full { display: none; }
  .zd-simulation-submit__short { display: inline; }
  .zd-exam-workspace .zd-global-brand img { width: 92px; height: auto; }
}
@media(max-width:360px) {
  .zd-exam-workspace .zd-global-brand img { width: 72px; }
  .zd-exam-workspace .zd-global-brand-group { gap: 6px; }
}
@media(min-width:761px) and (max-width:1050px) {
  .zd-exam-workspace body.theme-body .zd-exam-header > .zd-global-header__main { grid-template-columns: auto minmax(0,1fr) auto !important; gap: .65rem !important; }
}

/* Quit stays at the right edge of the shared exam header. */
.zd-exam-workspace .zd-simulation-quit { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:9px 14px!important;border:1px solid #e4b5b5!important;border-radius:999px;background:#fff3f3!important;color:#aa3030!important;font:650 13px/1.4 Manrope,system-ui,sans-serif!important;letter-spacing:0!important;white-space:nowrap;cursor:pointer; }
.zd-simulation-quit svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.zd-exam-workspace .zd-simulation-quit:hover { background:#ffe4e4!important; }
.zd-exam-workspace .zd-simulation-quit:focus-visible { outline:3px solid #d8aa47;outline-offset:3px; }
@media(max-width:760px) { .zd-exam-workspace .zd-simulation-quit { width:38px;min-width:38px;min-height:38px;padding:8px!important; } .zd-simulation-quit span { display:none; } }
@media(max-width:400px) { .zd-exam-workspace .zd-global-brand img { width:72px; } .zd-simulation-header-clock { min-width:72px; } .zd-exam-workspace .zd-simulation-submit { padding:8px 9px!important; } }

@media(max-width:360px){.zd-exam-workspace .zd-global-brand{width:28px;overflow:hidden;flex-shrink:0}.zd-exam-workspace .zd-global-brand img{width:106px!important;max-width:none!important}.zd-exam-workspace .zd-global-brand-group{gap:6px}.zd-exam-workspace .zd-mobile-menu-toggle{width:32px;min-width:32px}}

.zd-exam-workspace .zd-simulation-fullscreen{display:inline-flex;align-items:center;justify-content:center;width:40px;min-width:40px;height:40px;border:1px solid var(--zd-ui-line);border-radius:50%;background:#fff;color:var(--zd-ui-text);cursor:pointer}.zd-simulation-fullscreen svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.zd-simulation-fullscreen:focus-visible{outline:3px solid #d8aa47;outline-offset:3px}.zd-simulation-fullscreen[aria-pressed=true]{background:#e9f2e6;color:var(--zd-ui-green)}
@media(max-width:760px){.zd-exam-workspace .zd-simulation-fullscreen{width:34px;min-width:34px;height:38px}.zd-simulation-header-actions{gap:4px}}
@media(max-width:400px){.zd-exam-workspace .zd-global-brand{width:28px;overflow:hidden;flex-shrink:0}.zd-exam-workspace .zd-global-brand img{width:106px!important;max-width:none!important}.zd-simulation-header-clock{min-width:66px;padding-inline:5px;font-size:11px}.zd-exam-workspace .zd-simulation-submit{padding-inline:7px!important}.zd-exam-workspace .zd-global-brand-group{gap:4px}}

/* Mobile reading panes already sit above the footer: reserve it once. */
@media (max-width:767px){
  .lesen-page{--lesen-mobile-tools-height:48px;--lesen-mobile-footer-space:calc(var(--zd-exam-footer-height) + env(safe-area-inset-bottom))}
  .lesen-page #exam-view{position:absolute;height:calc(100dvh - var(--zd-exam-header-height) - var(--lesen-mobile-footer-space))!important;top:var(--zd-exam-header-height);right:0;bottom:auto;left:0;min-height:0!important;padding:var(--lesen-mobile-tools-height) 8px 8px!important;overflow:hidden}
  .lesen-page #exam-view>div{height:100%;min-height:0}
  .lesen-page #exam-grid{height:100%!important;min-height:0;grid-template-rows:minmax(0,1fr);gap:8px!important}
  .lesen-page #left-panel{height:100%;overflow-y:auto}
  .lesen-page #left-panel,.lesen-page #right-panel:not(.hidden){display:flex;flex-direction:column;min-height:0;padding:12px 12px 8px!important;scroll-padding-bottom:7rem;border-radius:14px!important}
  .lesen-page #left-panel>*,.lesen-page #right-panel>*{flex-shrink:0}
  .lesen-page #right-panel.mobile-aside-open{top:calc(var(--zd-exam-header-height) + var(--lesen-mobile-tools-height))!important;right:8px;bottom:calc(var(--lesen-mobile-footer-space) + 8px)!important;left:8px;width:auto;max-width:none}
  .lesen-page #aside-toggle{top:calc(var(--zd-exam-header-height) + 2px)!important;right:max(8px,env(safe-area-inset-right))!important;height:44px;min-height:44px;padding:0 12px;gap:6px;box-shadow:0 3px 10px #342b1920}
  .lesen-page .aside-toggle-label{font-size:11px;letter-spacing:.1em}
  .lesen-page.zd-inline-sprach #exam-view{padding-top:8px!important}
  .lesen-page .exam-action-bar{bottom:0;padding-top:8px!important;padding-bottom:4px;margin-top:auto;margin-bottom:0;z-index:2}
  .lesen-page .exam-action-bar button{min-height:44px}
  .lesen-page .zd-reading-item{padding:12px!important}
  .lesen-page .zd-reading-answer{margin-top:12px;padding-top:10px}
  .lesen-page .zd-reading-toolbar{gap:6px;margin-bottom:8px;padding-bottom:8px}
  .lesen-page .zd-reading-action{flex:1 1 0;min-width:0;min-height:44px;padding-inline:8px;font-size:12px}
  .lesen-page #left-panel>.mb-6{margin-bottom:12px;padding:12px}
  .lesen-page #right-panel>h2{font-size:20px;line-height:1.4}
  .lesen-page #right-panel>.mt-4{margin-top:12px}
}


/* Keep backward and forward navigation at the physical edges in every language. */
.zd-exam-footer > .zd-footer-layout {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  direction: ltr;
}
.zd-footer-back, .zd-footer-forward {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zd-footer-back { justify-self: start; grid-column: 1; }
.zd-footer-forward { justify-self: end; grid-column: 3; }
.zd-footer-forward #horen-check-btn { order: -1; }
.zd-footer-brand { grid-column: 2; min-width: 0; overflow: hidden; justify-self: center; }
.zd-footer-brand > div { justify-content: center; }
.zd-exam-footer .zd-footer-back button,
.zd-exam-footer .zd-footer-forward button { gap: 8px; white-space: nowrap; }
/* Pseudo-elements survive the exercise controllers updating button text. */
.zd-footer-back button::before,
.zd-footer-forward #next-btn::after,
.zd-footer-forward #horen-next-btn::after {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5m7 7-7-7 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5m7 7-7-7 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.zd-footer-forward #next-btn::after,
.zd-footer-forward #horen-next-btn::after { transform: rotate(180deg); }
@media (max-width: 767px) {
  .zd-exam-footer > .zd-footer-layout { gap: 8px; }
  .zd-footer-brand span { display: none; }
  .zd-exam-footer .zd-footer-back button,
  .zd-exam-footer .zd-footer-forward button { gap: 6px; min-height: 44px; }
  .zd-footer-back button::before,
  .zd-footer-forward #next-btn::after,
  .zd-footer-forward #horen-next-btn::after { width: 16px; height: 16px; flex-basis: 16px; }
  .zd-exam-footer[data-exam-module="horen"]:has(#horen-check-btn:not(.hidden)) .zd-footer-brand { display: none; }
}

@media (max-width: 520px) {
  .zd-exam-footer[data-exam-module="horen"] > .zd-footer-layout { gap: 6px; }
  .zd-exam-footer[data-exam-module="horen"] button { padding-inline: 0.65rem !important; letter-spacing: 0.08em !important; }
  .zd-exam-footer[data-exam-module="horen"] .zd-footer-forward { gap: 6px; }
}

.zd-exam-exercise-name { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:min(32vw,390px); }
.zd-exam-exercise-parent { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:min(32vw,390px);font-size:11px;color:#68776f;font-weight:400;line-height:1.4; }
@media(max-width:700px){.zd-exam-exercise-name,.zd-exam-exercise-parent{max-width:calc(100vw - 145px);}}

.zd-reading-name{display:none;font-family:"Manrope",sans-serif;}
@media(max-width:760px){.zd-reading-name{display:flex;flex-direction:column;gap:3px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #dce4de;}.zd-reading-exercise-name{font-size:17px;line-height:1.35;color:#192e26;}.zd-reading-exercise-parent{font-size:11px;line-height:1.4;color:#68776f;}.zd-reading-name ~ h2{display:none;}}
.zd-global-header__main.zd-profile-required-header { display: flex; justify-content: space-between; gap: 16px; }
.zd-profile-required-header .zd-session-user { width: auto; flex: none; }
.zd-profile-required-header .zd-session-logout-label { display: inline !important; }
.zd-profile-required-header .zd-session-logout { min-height: 44px; }
@media (max-width: 640px) {
  .zd-profile-required-header .zd-session-copy { display: none; }
  .zd-profile-required-header .zd-session-user { padding: 4px 10px; }
}
