/* DeutschWeg — Exam Ready shared styles (all levels).
 * Colours come from the --dw-* tokens in deutschweg-theme.css.
 * Mobile first; desktop layout from 1024px.
 *
 * Fixed navigation rule (Phase 1 spec): content always keeps
 * nav height + safe area + 24px free at the bottom, so the bottom bar never
 * covers content. While an input has focus (on-screen keyboard), the bar is
 * hidden via .er-keyboard.
 */
:root {
  --er-nav-h: 72px;
}

.er-skip {
  position: absolute; left: 8px; top: -48px; z-index: 50;
  background: var(--dw-midnight); color: #fff; padding: 10px 14px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.er-skip:focus { top: 8px; }

.er-app { min-height: 100vh; background: var(--dw-soft-white); color: var(--dw-midnight); }
.er-app a { color: var(--dw-deep); }
.er-app a:focus-visible, .er-app button:focus-visible { outline: 2px solid var(--dw-royal); outline-offset: 2px; }

.er-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 16px 12px 20px; background: #fff; border-bottom: 1px solid var(--dw-line);
}
.er-brand { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.er-level {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border-radius: 999px; background: var(--dw-soft-green); color: var(--dw-midnight);
  font-size: 13px; font-weight: 700;
}

.er-body { display: block; }
.er-main {
  padding: 24px 20px calc(var(--er-nav-h) + env(safe-area-inset-bottom, 0px) + 24px);
  max-width: 720px; margin: 0 auto; outline: none;
}
.er-app.er-nonav .er-main { padding-bottom: 32px; }

.er-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--er-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff; border-top: 1px solid var(--dw-line);
}
.er-nav ul { list-style: none; margin: 0; padding: 0; height: var(--er-nav-h); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.er-nav a {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; color: var(--dw-text-muted); text-decoration: none;
}
.er-nav a[aria-current="page"] { color: var(--dw-midnight); font-weight: 700; box-shadow: inset 0 3px 0 var(--dw-midnight); }
.er-app.er-keyboard .er-nav { display: none; }
.er-app.er-keyboard .er-main { padding-bottom: 32px; }

.er-h1 { font-size: 24px; font-weight: 700; line-height: 1.25; margin: 0 0 6px; }
.er-lead { font-size: 14.5px; color: var(--dw-text-muted); line-height: 1.55; margin: 0 0 20px; }

.er-preview {
  display: inline-block; margin: 0 0 16px; padding: 4px 10px; border-radius: 999px;
  background: var(--dw-tint); color: var(--dw-deep); font-size: 12.5px; font-weight: 700;
}
.er-card {
  background: #fff; border: 1px solid var(--dw-line); border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.er-card h2 { font-size: 18px; font-weight: 700; margin: 0; }
.er-card p { font-size: 14.5px; line-height: 1.55; margin: 0; }
.er-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 10px; border: 0; background: var(--dw-midnight); color: #fff !important;
  font: 700 15px 'Plus Jakarta Sans', system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.er-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; }

/* Loading: placeholders shaped like the content, no spinner. */
.er-skel { display: flex; flex-direction: column; gap: 14px; }
.er-skel span { display: block; border-radius: 16px; background: var(--dw-on-dark-muted); }
.er-skel .s1 { height: 28px; width: 60%; border-radius: 8px; }
.er-skel .s2 { height: 180px; }
.er-skel .s3 { height: 76px; background: #EEF1F5; }
.er-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .er-skel span { animation: er-pulse 1.4s ease-in-out infinite; }
  @keyframes er-pulse { 50% { opacity: 0.55; } }
}

@media (min-width: 1024px) {
  .er-body { display: flex; align-items: flex-start; }
  .er-nav {
    position: sticky; top: 0; width: 240px; flex: 0 0 240px; height: auto; min-height: calc(100vh - 61px);
    padding: 24px 16px; border-top: 0; border-right: 1px solid var(--dw-line);
  }
  .er-nav ul { height: auto; display: flex; flex-direction: column; gap: 4px; }
  .er-nav a { justify-content: flex-start; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
  .er-nav a[aria-current="page"] { background: var(--dw-tint); box-shadow: none; }
  .er-main { flex: 1 1 auto; padding: 40px 40px 56px; max-width: 1040px; margin: 0; }
  .er-app.er-keyboard .er-nav { display: block; }
}

/* ── Dashboard (Phase 3) ─────────────────────────────────────────────── */
.er-stack { display: flex; flex-direction: column; gap: 20px; }
.er-next {
  background: var(--dw-midnight); color: #fff; border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.er-next .er-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dw-soft-green); }
.er-next h2 { font-size: 21px; font-weight: 700; line-height: 1.3; margin: 0; color: #fff; }
.er-next p { font-size: 14px; line-height: 1.55; margin: 0; color: var(--dw-on-dark-muted); }
.er-next .er-go {
  display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 4px;
  border-radius: 10px; background: var(--dw-soft-green); color: var(--dw-midnight) !important;
  font-size: 16px; font-weight: 700; text-decoration: none;
}
.er-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px;
  background: #fff; border: 1px solid var(--dw-line); border-radius: 14px; padding: 12px 16px;
  color: var(--dw-midnight) !important; text-decoration: none;
}
.er-row.is-locked { background: var(--dw-soft-white); }
.er-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.er-row-title { font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.er-row-sub { font-size: 13px; color: var(--dw-text-muted); line-height: 1.45; }
.er-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.er-h2 { font-size: 17px; font-weight: 700; margin: 0 0 10px; }
.er-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.er-tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 84px; background: #fff;
  border: 1px solid var(--dw-line); border-radius: 16px; padding: 14px;
  color: var(--dw-midnight) !important; text-decoration: none;
}
.er-tile-name { font-size: 15px; font-weight: 600; }
.er-tile-meta { font-size: 12.5px; color: var(--dw-text-muted); }
.er-chip { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.er-chip.st-sicher { background: var(--dw-soft-green); color: var(--dw-midnight); }
.er-chip.st-faellig { background: #fff; color: var(--dw-deep); border-color: var(--dw-deep); }
.er-chip.st-ueben { background: var(--dw-amber-tint); color: var(--dw-amber-ink); }
.er-chip.st-angefangen { background: var(--dw-tint); color: var(--dw-deep); }
.er-chip.st-neu { background: var(--dw-neutral-tint); color: var(--dw-text-muted); }
.er-chip.st-free { background: var(--dw-soft-green); color: var(--dw-midnight); }
.er-chip.st-locked { background: #fff; color: var(--dw-text-muted); border-color: var(--dw-input-line); }
.er-bar { height: 8px; border-radius: 999px; background: var(--dw-bar-track); overflow: hidden; }
.er-bar > span { display: block; height: 8px; border-radius: 999px; background: var(--dw-royal); }
.er-progress { display: flex; flex-direction: column; gap: 6px; }
.er-progress-line { font-size: 14px; }
.er-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.er-form label { flex: 1 1 100%; font-size: 15px; font-weight: 700; }
.er-form input[type="date"] {
  height: 44px; border: 1px solid var(--dw-input-line); border-radius: 8px; padding: 0 12px;
  font: 500 15px 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--dw-midnight); background: #fff;
}
.er-btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--dw-input-line); background: #fff; color: var(--dw-deep);
  font: 600 14px 'Plus Jakarta Sans', system-ui, sans-serif; cursor: pointer;
}
.er-app a.er-on-dark { color: #fff; }
.er-note { font-size: 13px; color: var(--dw-text-muted); line-height: 1.5; margin: 0; }
@media (min-width: 1024px) {
  .er-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
