/* Building blocks from the Lehrgangsmanagement redesign (F1 App-Shell, F2 Musterkatalog), taken over from jev-demo
   and built only on the EMRAGIS design system tokens in colors_and_type.css. */

html, body { background: var(--em-surface-alt); margin: 0; }
body { font-family: var(--em-font-sans); color: var(--em-ink); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
a { border-bottom: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Shell (F1, 3b frame) ---------- */
.topbar { height: 56px; background: var(--em-surface); border-bottom: 1px solid var(--em-border); display: flex; align-items: center; gap: 28px; padding: 0 28px; position: sticky; top: 0; z-index: 10; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--em-gray-900); }
.logo i { width: 26px; height: 26px; border-radius: var(--em-radius-md); background: var(--em-yellow); display: grid; place-items: center; font: 800 14px var(--em-font-sans); color: var(--em-gray-900); font-style: normal; }
.logo span { font: 700 15px/1.1 var(--em-font-sans); letter-spacing: var(--em-tracking-snug); }
.logo small { font: 500 12px var(--em-font-sans); color: var(--em-fg-3); letter-spacing: 0; margin-left: 4px; }
nav.top { display: flex; align-items: center; gap: 22px; font: 500 13.5px var(--em-font-sans); }
nav.top a { color: var(--em-gray); padding: 4px 0; white-space: nowrap; }
nav.top a:hover { color: var(--em-gray-900); border-bottom: none; }
nav.top a.on { color: var(--em-gray-900); font-weight: var(--em-fw-semibold); box-shadow: inset 0 -2px 0 var(--em-yellow); padding-bottom: 7px; }
.spacer { flex: 1; }
.pill { flex: none; white-space: nowrap; display: flex; align-items: center; gap: 7px; background: var(--em-yellow-050); border: 1px solid var(--em-yellow); border-radius: var(--em-radius-pill); padding: 3px 5px 3px 12px; }
.pill .k { font: 400 12px var(--em-font-sans); color: var(--em-gray); }
.pill .r { font: 600 12.5px var(--em-font-sans); color: var(--em-gray-900); }
.pill select { border: none; background: var(--em-yellow); border-radius: var(--em-radius-pill); font: 600 12px var(--em-font-mono); padding: 3px 6px; color: var(--em-gray-900); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--em-ok); } .dot.err { background: var(--em-danger); }
.status { display: flex; align-items: center; gap: 7px; font: 400 12px var(--em-font-sans); color: var(--em-fg-3); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.phead { background: var(--em-surface); padding: 16px 0 14px; }
.back { color: var(--em-fg-3); font-size: var(--em-fs-xs); font-weight: var(--em-fw-semibold); text-transform: uppercase; letter-spacing: var(--em-tracking-caps); margin-bottom: 6px; display: inline-block; }
.back:hover { color: var(--em-gray-900); border-bottom: none; }
.titlerow { display: flex; align-items: center; gap: 14px; }
.titlerow h1 { font: 700 24px/1.2 var(--em-font-sans); letter-spacing: var(--em-tracking-snug); margin: 0; }
.titlerow .code { font: 700 12px var(--em-font-mono); background: var(--em-gray-900); color: #fff; border-radius: var(--em-radius-sm); padding: 3px 8px; }
.lead { font: 400 14px/1.55 var(--em-font-sans); color: var(--em-fg-2); max-width: 900px; margin: 8px 0 0; }

/* KPI band between two 1px rules */
.band { background: var(--em-gray-100); border-top: 1px solid var(--em-border); border-bottom: 1px solid var(--em-border); }
.band .wrap { display: flex; flex-wrap: wrap; }
.band .kpi { padding: 9px 22px 9px 0; margin-right: 22px; border-right: 1px solid var(--em-border); }
.band .kpi:last-child { border-right: none; }
.band .kl { font: 600 9.5px var(--em-font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--panel-header-fg); }
.band .kv { font-family: var(--em-font-mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; color: var(--em-ink); margin-top: 2px; }

.body { padding: 22px 0 40px; }
.section { margin: 26px 0 12px; display: flex; align-items: baseline; gap: 12px; }
.section h2 { font: 700 18px var(--em-font-sans); margin: 0; letter-spacing: var(--em-tracking-snug); }
.section p { margin: 0; font-size: 13px; color: var(--em-fg-3); }
.section::after { content: ""; flex: 1; height: 1px; background: var(--em-border); align-self: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.cols { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) { .cols { grid-template-columns: 1fr; } }

/* ---------- Card (6a) ---------- */
.c { background: var(--em-surface); border: 1px solid var(--em-border); border-radius: var(--em-radius-md); overflow: hidden; }
.chd { background: var(--panel-header-bg); padding: 9px 16px; border-bottom: 1px solid var(--em-border); display: flex; align-items: center; gap: 10px; }
.chd .ct { font: 600 11px var(--em-font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--panel-header-fg); flex: 1; }
.chd .kn { font: 700 10.5px var(--em-font-mono); padding: 2px 7px; border-radius: 4px; background: var(--em-gray-900); color: #fff; }
.chd-w { background: var(--em-surface); padding: 12px 16px; border-bottom: 1px solid var(--em-border); display: flex; align-items: center; gap: 10px; }
.ctitle { font: 600 14px var(--em-font-sans); color: var(--em-ink); flex: 1; }
.herk { padding: 8px 16px; border-bottom: 1px solid var(--row-divider); font: 400 11px var(--em-font-sans); color: var(--em-fg-4); }
.cb { padding: 12px 16px; }
.cf { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--row-divider); }
.say { font: 400 13px/1.55 var(--em-font-sans); color: var(--em-fg-2); margin: 0; }
.say b { color: var(--em-ink); font-weight: 600; }
.meta { font: 400 12px var(--em-font-sans); color: var(--em-fg-3); }
.mono, .num { font-family: var(--em-font-mono); font-variant-numeric: tabular-nums; }
.num { font-size: 12.5px; color: var(--em-ink); }
code { font-size: 11.5px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--row-divider); }
.fact:last-child { border-bottom: none; }

/* ---------- Table (1a) ---------- */
.t { width: 100%; border-collapse: collapse; font: 400 13px var(--em-font-sans); }
.t th { font: 600 11px var(--em-font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--panel-header-fg); text-align: left; padding: 9px 14px; white-space: nowrap; background: var(--panel-header-bg); border-bottom: 1px solid var(--em-border); }
.t td { padding: 9px 14px; color: var(--em-fg-2); vertical-align: top; border-top: 1px solid var(--row-divider); }
.t td.s { color: var(--em-ink); font-weight: 500; }
.t td.r, .t th.r { text-align: right; }
.t td.w { max-width: 380px; }
.t tr:hover td { background: var(--em-yellow-050); }

/* ---------- Chips (4c-2): five tones, the sixth difference is a form ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--em-radius-pill); font: 700 11.5px var(--em-font-sans); white-space: nowrap; }
.k-ok { background: var(--em-tone-ok-bg); color: var(--em-tone-ok-fg); }
.k-warn { background: var(--em-tone-warn-bg); color: var(--em-tone-warn-fg); }
.k-err { background: var(--em-tone-danger-bg); color: var(--em-tone-danger-fg); }
.k-info { background: var(--em-tone-info-bg); color: var(--em-tone-info-fg); }
.k-neu { background: var(--em-tone-neutral-bg); color: var(--em-tone-neutral-fg); }
.k-open { background: transparent; color: var(--em-gray-700); border: 1px dashed var(--em-border-strong); padding: 2px 9px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--em-surface); border: 1px solid var(--em-border); border-radius: var(--em-radius-sm); padding: 8px 13px; font: 500 12.5px var(--em-font-sans); color: var(--em-gray-800); white-space: nowrap; }
.btn:hover { border-color: var(--em-border-strong); color: var(--em-gray-900); }
.btn-p { background: var(--em-yellow); border-color: var(--em-yellow); color: var(--em-fg-on-yellow); font-weight: 600; }
.btn-p:hover { background: var(--em-yellow-600); border-color: var(--em-yellow-600); }
.btn-q { background: none; border-color: transparent; color: var(--em-fg-3); }
.btn-s { padding: 5px 9px; font-size: 11.5px; }
.btn[disabled] { color: var(--em-gray-300); border-color: #ECEBEB; background: #FBFBFB; cursor: default; }
form.inline { display: inline; margin: 0; }

/* ---------- Tabs as filter ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--em-border); background: var(--em-surface); }
.tabs a { font: 500 12px var(--em-font-sans); color: var(--em-fg-2); padding: 4px 10px; border-radius: var(--em-radius-pill); border: 1px solid var(--em-border); }
.tabs a.on { background: var(--em-gray-900); color: #fff; border-color: var(--em-gray-900); }

/* ---------- Messages (9c) and states ---------- */
.kasten { border-radius: var(--em-radius-sm); padding: 10px 13px; display: flex; gap: 9px; align-items: flex-start; font: 400 13px/1.5 var(--em-font-sans); }
.ka-info { background: var(--em-blue-100); border-left: 3px solid var(--em-blue-700); color: #0a5f85; }
.ka-warn { background: var(--em-yellow-100); border-left: 3px solid var(--em-yellow-700); color: #6b4d05; }
.ka-err { background: var(--em-tone-danger-bg); border-left: 3px solid var(--em-danger); color: #8F1E18; }
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 26px 18px; }
.state .ic { width: 34px; height: 34px; border-radius: var(--em-radius-pill); display: flex; align-items: center; justify-content: center; background: var(--em-gray-100); color: var(--em-fg-3); }
.state .h { font: 600 13px var(--em-font-sans); color: var(--em-ink); }
.state .p { font: 400 12px/1.5 var(--em-font-sans); color: var(--em-fg-3); max-width: 340px; margin: 0; }
.strip { padding: 8px 16px; display: flex; align-items: center; gap: 10px; font: 400 12px var(--em-font-sans); background: var(--em-blue-100); color: var(--em-blue-700); border-bottom: 1px solid var(--em-border); }
.progress { flex: 1; height: 6px; background: #fff; border-radius: var(--em-radius-pill); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--em-blue-700); }
.sk { background: linear-gradient(90deg, #ECEBEB 0%, #F5F4F4 50%, #ECEBEB 100%); border-radius: var(--em-radius-xs); height: 11px; }

/* ---------- Forms (2a+) ---------- */
.lbl { display: block; font: 600 12px var(--em-font-sans); color: var(--em-fg-2); margin: 12px 0 5px; }
.inp { width: 100%; background: var(--em-surface); border: 1px solid var(--em-border); border-radius: var(--em-radius-sm); padding: 8px 10px; font: 400 13px var(--em-font-sans); color: var(--em-ink); }
.inp:focus { outline: none; box-shadow: var(--em-shadow-focus); border-color: var(--em-yellow); }
textarea.inp { resize: vertical; line-height: 1.5; }
.hint { font: 400 11.5px var(--em-font-sans); color: var(--em-fg-4); margin-top: 5px; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font: 400 13px var(--em-font-sans); }
.checks label { display: inline-flex; align-items: center; gap: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
details.raw { margin-top: 10px; }
details.raw summary { font: 500 12px var(--em-font-sans); color: var(--em-fg-3); cursor: pointer; }
details.raw pre { font: 400 11px/1.45 var(--em-font-mono); background: var(--em-gray-100); padding: 10px; border-radius: var(--em-radius-sm); overflow: auto; max-height: 280px; }
.examples { display: flex; gap: 6px; flex-wrap: wrap; }
.examples a { font: 500 12px var(--em-font-sans); padding: 4px 10px; border: 1px solid var(--em-border); border-radius: var(--em-radius-pill); color: var(--em-fg-2); background: var(--em-surface); }
.examples a.on { border-color: var(--em-yellow); background: var(--em-yellow-050); color: var(--em-gray-900); font-weight: 600; }


/* ---------- Statement to judge: one record, one question, one answer, three keys ---------- */
.judge { max-width: 780px; margin: 0 auto; }
.facts { display: grid; grid-template-columns: minmax(120px, 28%) 1fr; gap: 7px 14px; margin: 0; }
.facts dt { font: 600 12px/1.5 var(--em-font-sans); color: var(--em-fg-3); }
.facts dd { margin: 0; font: 400 14px/1.5 var(--em-font-sans); color: var(--em-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.asked { font: 500 13px/1.5 var(--em-font-sans); color: var(--em-fg-2); margin: 0 0 10px; }
.claim { font: 600 18px/1.45 var(--em-font-sans); color: var(--em-ink); background: var(--em-yellow-050); border: 1px solid var(--em-yellow); border-radius: var(--em-radius-md); padding: 14px 16px; margin: 0; }
.verdicts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--row-divider); }
.verdicts .btn, .choices .btn { justify-content: center; min-height: 52px; font-size: 15px; }
.btn kbd { font: 700 11px var(--em-font-mono); border: 1px solid currentColor; border-radius: 4px; padding: 1px 5px; opacity: .65; }
.btn-yes { background: var(--em-tone-ok-bg); border-color: var(--em-tone-ok-bg); color: var(--em-tone-ok-fg); font-weight: 600; }
.btn-no { background: var(--em-tone-danger-bg); border-color: var(--em-tone-danger-bg); color: var(--em-tone-danger-fg); font-weight: 600; }
.btn-yes:hover, .btn-no:hover { filter: brightness(.97); color: inherit; }
.choices { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.choices .btn { justify-content: flex-start; text-align: left; white-space: normal; min-height: 44px; }
.progress-line { display: flex; gap: 14px; justify-content: center; margin-top: 12px; }
.rate { white-space: nowrap; }
.rate small { color: var(--em-fg-4); font-size: 11px; margin-left: 3px; }
.link-box { font: 400 13px var(--em-font-mono); background: var(--em-gray-100); border-radius: var(--em-radius-sm); padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 720px) {
  .topbar { gap: 14px; padding: 0 14px; overflow-x: auto; }
  .logo small, .topbar .who { display: none; }
  .wrap { padding: 0 14px; }
  .verdicts { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 6px; }
}

/* ---------- Swipe: a stack of cards, right for "stimmt", left for "stimmt nicht" ---------- */
.swipe { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 14px 18px; height: calc(100dvh - 56px); overflow: hidden; }
.swipe-stack { position: relative; width: 100%; max-width: 460px; flex: 1; min-height: 0; max-height: 680px; }
.swipe-card { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--em-surface); border: 1px solid var(--em-border); border-radius: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, .10); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .26s ease, opacity .26s ease; }
.swipe-card:nth-child(1) { z-index: 3; }
.swipe-card:nth-child(2) { z-index: 2; transform: scale(.95) translateY(12px); }
.swipe-card:nth-child(n+3) { z-index: 1; opacity: 0; }
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card .chd { flex: none; }
.swipe-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; }
.swipe-claim { flex: none; padding: 14px 16px 16px; border-top: 1px solid var(--row-divider); }
.swipe-claim .claim { font-size: 17px; }
.swipe-empty { justify-content: center; }
.stamp { position: absolute; top: 58px; z-index: 2; font: 800 20px var(--em-font-sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; border: 3px solid currentColor; border-radius: 8px; background: rgba(255, 255, 255, .85); opacity: 0; pointer-events: none; }
.stamp-yes { left: 16px; color: var(--em-tone-ok-fg); transform: rotate(-12deg); }
.stamp-no { right: 16px; color: var(--em-tone-danger-fg); transform: rotate(12deg); }
.swipe-actions { flex: none; display: flex; gap: 26px; align-items: center; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--em-border); background: var(--em-surface); font: 700 26px/1 var(--em-font-sans); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.round:active { transform: scale(.94); }
.round.no { color: var(--em-tone-danger-fg); border-color: var(--em-tone-danger-bg); }
.round.yes { color: var(--em-tone-ok-fg); border-color: var(--em-tone-ok-bg); }
.round.maybe { width: 48px; height: 48px; font-size: 20px; color: var(--em-fg-3); }
.swipe-meta { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; align-items: center; font: 400 12px var(--em-font-sans); color: var(--em-fg-3); }
.swipe-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 70dvh; overflow-y: auto; background: var(--em-surface); border-top: 1px solid var(--em-border); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .12); padding: 16px 16px 20px; }
.swipe-sheet .choices { padding: 0; max-width: 560px; margin: 0 auto; }
.swipe-sheet .asked { max-width: 560px; margin: 0 auto 10px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .swipe-card { transition: none; } }
@media (max-width: 720px) { .swipe-meta .hint { display: none; } }
