/* TN-Liste – BKJ design. One stylesheet, no build step.
   BKJ colours: Grünspan #38B6C0 (buttons), Chilirot #E84029 (brand/accents), Weißer Rauch #F7F6F3 (backgrounds).
   Contrast: white on Grünspan is only ~2.4:1, so buttons use dark text; links/text use a darkened Grünspan (≥4.5:1). */
@font-face { font-family: "Graphik"; src: url("../fonts/Graphik-Regular-Web.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Graphik"; src: url("../fonts/Graphik-RegularItalic-Web.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Graphik"; src: url("../fonts/Graphik-Medium-Web.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  --gruenspan: #38B6C0; --gruenspan-hover: #2ca3ad; --gruenspan-ink: #0b2f33; --gruenspan-dark: #17707a; --gruenspan-soft: #e4f4f5;
  --chili: #E84029; --chili-dark: #c4351f; --chili-soft: #fdebe7;
  --rauch: #F7F6F3; --card: #fff; --text: #1f2a2b; --muted: #687271; --faint: #8e9695;
  --line: #e7e4dd; --line-strong: #d4d0c7;
  --ok: #1f7a46; --ok-soft: #e4f3ea; --warn: #8a5a00; --warn-soft: #fff3d6; --danger: var(--chili-dark); --danger-soft: var(--chili-soft);
  --accent: var(--gruenspan-dark); --accent-soft: var(--gruenspan-soft);
  --radius: 10px; --shadow: 0 1px 2px rgba(31, 42, 43, .04);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Graphik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--rauch); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--gruenspan-ink); }
:focus-visible { outline: 3px solid var(--chili); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
strong, b { font-weight: 500; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .nowrap { white-space: nowrap; } .pre { white-space: pre-line; } .center { text-align: center; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .nomargin { margin: 0 !important; } .grow { flex: 1; } .w-small { width: 110px !important; }
.eyebrow { margin: 0 0 6px; color: var(--faint); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── app shell: slim top bar + content ─────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 40px; background: rgba(251, 250, 248, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand img { width: 38px; height: 38px; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 1.05rem; }
.brand-copy small { color: var(--faint); font-size: .72rem; margin-top: 3px; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { border-color: var(--line-strong); background: #fff; }
.user-name { font-size: .9rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 16px 40px rgba(31, 42, 43, .16); }
.user-menu-panel a, .user-menu-panel button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; width: 100%; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--gruenspan-soft); }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--chili-soft); color: var(--chili-dark); font-weight: 500; font-size: .85rem; }
.page-content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 30px 40px 40px; }
footer.footer { max-width: 1240px; margin: 0 auto; padding: 14px 40px 22px; color: var(--faint); font-size: .8rem; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 24px 20px; }
.narrow { max-width: 600px; }

/* ── page structure ─────────────────────────────── */
.crumbs { margin: 0 0 10px; font-size: .85rem; } .crumbs a { text-decoration: none; color: var(--muted); } .crumbs a:hover { color: var(--accent); }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.count { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 99px; background: #f1efea; color: var(--muted); font-size: .78rem; text-align: center; vertical-align: middle; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; }
.grid2 .grid2, form .grid2 { gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fcfbf9; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
details.card > summary::before { content: "▸"; color: var(--faint); }
details.card[open] > summary::before { content: "▾"; }
details.card[open] > summary { margin-bottom: 12px; }
.inline-h { display: inline; margin: 0; }
ul.plain { list-style: none; padding: 0; } ul.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); }

/* stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { position: relative; min-height: 118px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.stat-card.featured { background: var(--gruenspan-soft); border-color: #c9e9ec; }
.stat-card .stat-meta { color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.stat-card > strong { display: block; margin-top: 12px; font-size: 2rem; line-height: 1; font-weight: 500; }
.stat-card .stat-foot { margin-top: 10px; color: var(--muted); font-size: .8rem; }
.stat-icon { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #f3f1ec; }
.stat-card.featured .stat-icon { background: #c9e9ec; }
.stat-card.alert-card .stat-icon { background: var(--chili-soft); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0 0 20px; }
.steps li { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.steps li.done { border-color: #bfe3cc; background: #fbfefc; }
.step { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #f1efea; color: var(--muted); font-weight: 500; font-size: .85rem; margin-right: 6px; }
.steps li.done .step { background: var(--ok); color: #fff; }
.steps .step { margin-right: 0; }

/* ── forms ─────────────────────────────── */
label, .label { display: block; font-weight: 500; margin: 14px 0 6px; font-size: .9rem; color: #46504f; }
label.inline { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 18px 6px 0; color: var(--text); }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=time], input[type=number], input[type=file], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gruenspan); box-shadow: 0 0 0 3px rgba(56, 182, 192, .25); }
input[type=file] { padding: 8px; background: #fcfbf9; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--gruenspan-dark); }
textarea { min-height: 84px; }
.hint { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px 16px; margin: 18px 0; }
legend { font-weight: 500; padding: 0 6px; }
.narrow-form { max-width: 820px; }
.choice { margin: 10px 0; } .choice-label { display: block; font-weight: 500; margin-bottom: 4px; }

/* ── buttons ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 7px; border: 1px solid var(--gruenspan);
  background: var(--gruenspan); color: #fff; font: inherit; font-weight: 500; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .14s, border-color .14s, transform .14s; }
.btn:hover { background: var(--gruenspan-hover); border-color: var(--gruenspan-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--gruenspan-ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: #fbfaf8; border-color: var(--gruenspan); }
.btn.danger { background: var(--chili-dark); border-color: var(--chili-dark); color: #fff; }
.btn.danger:hover { background: #a82c19; }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: .84rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.big { width: 100%; min-height: 52px; font-size: 1.05rem; border-radius: 9px; background: var(--gruenspan-dark); border-color: var(--gruenspan-dark); color: #fff; }
.btn.big:hover { background: var(--gruenspan-ink); border-color: var(--gruenspan-ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.danger-text { color: var(--danger); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
form.inline { display: inline; }

/* ── feedback ─────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; border: 1px solid; border-left-width: 4px; }
.alert.ok { background: var(--ok-soft); border-color: var(--ok); }
.alert.error { background: var(--danger-soft); border-color: var(--chili); }
.alert.warn { background: var(--warn-soft); border-color: #d9a43d; }
.alert ul { margin: 0; padding-left: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 5px; font-size: .76rem; font-weight: 500; background: #f1efea; color: #4f5857; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge.ok { background: var(--ok-soft); color: #175c35; } .badge.warn { background: var(--warn-soft); color: #6b4600; }
.star-btn { background: none; border: 0; padding: 2px; line-height: 0; cursor: pointer; border-radius: 4px; }
.star-btn .icon { fill: #fff; stroke: #b3ada0; }
.star-btn:hover .icon { stroke: #d99a00; }
.star-btn[aria-pressed="true"] .icon { fill: #f5b800; stroke: #d99a00; }
th.star, td.star { width: 1%; padding-right: 0; }
.badge.paper { background: #fff0cc; color: #6b4600; } .badge.red { background: var(--chili-soft); color: #9c2a17; }
.progress-row { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 14px; }
.progress { display: grid; gap: 5px; min-width: 160px; }
a.progress { text-decoration: none; color: inherit; }
.bar { display: block; height: 6px; border-radius: 99px; background: #ebe8e1; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gruenspan); border-radius: 99px; }
.bar.big { height: 10px; }

/* ── tables ─────────────────────────────── */
.table-scroll { overflow-x: auto; position: relative; } /* keeps absolutely positioned .sr-only cells inside the scroller */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #efece6; vertical-align: top; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 500; background: #fbfaf8; }
tbody tr:hover { background: #fcfbf9; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
td.actions > * + * { margin-left: 8px; }
.approve { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.downloads { padding-left: 20px; }
.event-list a.title { font-weight: 500; text-decoration: none; color: var(--text); }
.event-list a.title:hover { color: var(--accent); }
.mini-progress { display: inline-block; width: 60px; height: 5px; border-radius: 9px; background: #ebe8e1; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.mini-progress > span { display: block; height: 100%; background: var(--gruenspan); }

dialog { max-width: 560px; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: 0 25px 80px rgba(31, 42, 43, .22); }
dialog::backdrop { background: rgba(31, 42, 43, .42); backdrop-filter: blur(2px); }

/* ── public pages (participants, tablet) ─────────────────────────────── */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 16px 16px 20px;
  background: radial-gradient(ellipse at top left, rgba(56, 182, 192, .14), transparent 40%), radial-gradient(ellipse at bottom right, rgba(232, 64, 41, .07), transparent 45%), var(--rauch); }
.public-shell > * { width: min(100%, 600px); }
.public-shell.wide > * { width: min(100%, 980px); }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 14px; }
.public-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.public-brand img { width: 44px; height: 44px; }
.public-brand span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; line-height: 1.25; } /* title and place/time on one line, wraps only on narrow phones */
.public-brand strong { font-size: 1.05rem; }
.public-brand small { color: var(--muted); font-size: .8rem; }
.lang { display: flex; gap: 6px; flex-wrap: wrap; font-size: .85rem; }
.lang a { padding: 4px 11px; border-radius: 99px; text-decoration: none; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.lang a[aria-current] { background: var(--gruenspan); border-color: var(--gruenspan); color: var(--gruenspan-ink); font-weight: 500; }
.flow { display: flex; justify-content: flex-start; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.flow li { display: flex; align-items: center; gap: 6px; }
.flow li + li::before { content: ""; width: 18px; height: 1px; background: var(--line-strong); }
.flow .step { width: 22px; height: 22px; font-size: .72rem; margin: 0; }
.flow li.active { color: var(--text); font-weight: 500; }
.flow li.active .step { background: var(--gruenspan); color: var(--gruenspan-ink); }
.public-shell .card { padding: 26px; box-shadow: 0 16px 55px rgba(31, 42, 43, .06); }
.event-summary { display: grid; gap: 3px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf8; }
.event-summary strong { font-size: 1rem; }
.event-summary small { color: var(--muted); }
.result-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.public-footer { margin-top: 16px; color: var(--faint); font-size: .8rem; text-align: center; }

/* read-only participant data with an explicit "change" step */
.data-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 6px 0 12px; }
.data-view div { min-width: 0; display: grid; gap: 2px; }
.data-view dt { color: var(--faint); font-size: .72rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.data-view dd { margin: 0; overflow-wrap: anywhere; }
details.edit-data > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; font-weight: 500; font-size: .9rem; }
details.edit-data > summary::-webkit-details-marker { display: none; }
details.edit-data[open] > summary { margin-bottom: 6px; background: var(--gruenspan-soft); border-color: var(--gruenspan); }
@media (max-width: 520px) { .data-view { grid-template-columns: 1fr; } }

/* signature pad */
.sigpad { transition: width .3s ease, margin-left .3s ease; position: relative; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; touch-action: none; aspect-ratio: 3 / 1; width: 100%; }
.sigpad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.sigpad::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 22%; border-bottom: 1px solid #cfcac0; pointer-events: none; }
.rotate-hint { display: none; }
/* grows sideways to the full screen width when drawing starts (signature.js); the ratio is kept, so nothing is distorted */
.sigpad.expanded { width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; border-left: 0; border-right: 0; aspect-ratio: auto; overflow-anchor: none; } /* height is fixed in px by signature.js */
@media (orientation: portrait) and (max-width: 600px) { .rotate-hint { display: block; } }
@media (orientation: landscape) and (max-height: 500px) { .sigpad { aspect-ratio: auto; height: 60vh; } }

/* tablet (kiosk) */
.kiosk-code { display: inline-block; padding: 6px 14px; border-radius: 8px; background: #fbfaf8; border: 1px dashed var(--line-strong); font: 500 1.6rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .25em; }
.code-input { font: 500 1.8rem/1.2 ui-monospace, Consolas, monospace !important; letter-spacing: .35em; text-align: center; text-transform: uppercase; }
.kiosk-search { position: sticky; top: 0; z-index: 2; padding: 10px; border-radius: 9px; background: var(--rauch); margin-bottom: 16px; }
.kiosk-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.kiosk-list a, .kiosk-list .done { display: grid; gap: 2px; min-height: 64px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-decoration: none; color: var(--text); }
.kiosk-list a:hover { border-color: var(--gruenspan); box-shadow: 0 0 0 3px rgba(56, 182, 192, .18); }
.kiosk-list a strong { font-size: 1.05rem; }
/* long organisation names stay on one line and fade out instead of wrapping */
.kiosk-list a, .kiosk-list .done { min-width: 0; }
.kiosk-list .org { position: relative; display: block; overflow: hidden; white-space: nowrap; }
.kiosk-list .org::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 2.4em; background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.kiosk-list .done { opacity: .6; background: #fbfaf8; }

/* ── review: change cards ─────────────────────────────── */
.review-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.change-card { border: 1px solid var(--line); border-left: 4px solid var(--chili); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; background: #fffdfb; }
.change-card header { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.change-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 200px auto; gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.change-field { font-weight: 500; }
.change-values { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.change-values .v-old, .change-values .v-new { padding: 3px 8px; border-radius: 6px; }
.change-values .v-old { background: #fdecea; color: #6d1914; }
.change-values .v-new { background: #e3f4e8; color: #0d4f22; }
.change-values del { background: #f6b8b3; text-decoration: line-through; text-decoration-thickness: 2px; }
.change-values ins { background: #9fd9b0; text-decoration: none; font-weight: 500; }
.change-values .arrow { color: var(--muted); }
.change-row.is-old .v-old, .change-row.is-new .v-new { outline: 2px solid currentColor; }
.change-row.is-manual .change-state { color: var(--warn); }
.change-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 800px) { .change-row { grid-template-columns: 1fr; } .change-actions { justify-content: flex-start; } }
details.others { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.others > summary, details.other > summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
details.other { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 8px 0; background: #fbfaf8; }
details.other[open] { background: #fff; }

/* ── attendance (mobile first) ─────────────────────────────── */
.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.day-tabs a { flex: none; display: grid; gap: 2px; min-width: 92px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); text-align: center; }
.day-tabs a span { font-size: .85rem; color: var(--muted); }
.day-tabs a.complete { border-color: #bfe3cc; background: var(--ok-soft); }
.day-tabs a[aria-current] { border: 2px solid var(--gruenspan); box-shadow: 0 0 0 3px rgba(56, 182, 192, .2); }
.att-summary { display: grid; gap: 12px; }
.chip { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-strong); text-decoration: none; background: #fff; font-size: .9rem; color: var(--text); }
.chip.active { background: var(--gruenspan); border-color: var(--gruenspan); color: var(--gruenspan-ink); font-weight: 500; }
.att-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.att { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: 9px; padding: 12px 14px; scroll-margin-top: 80px; }
.att.is-signed, .att.is-present { border-left-color: var(--ok); }
.att.is-paper { border-left-color: #d9a43d; }
.att.is-no_show { border-left-color: var(--faint); opacity: .75; }
.att.is-open { border-left-color: var(--chili); background: #fffdfb; }
.att-who { display: grid; }
.att-status { font-weight: 500; font-size: .9rem; white-space: nowrap; }
.att-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.att-actions form { flex: 1; }
.att-actions .btn { width: 100%; min-height: 44px; } /* touch target */
@media (min-width: 900px) { .att { grid-template-columns: 1fr 140px auto; } .att-actions { grid-column: auto; } .att-actions form { flex: none; } }

/* ── template editor ─────────────────────────────── */
.editor { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.editor aside { position: sticky; top: 12px; }
.stage-wrap { overflow: auto; }
.stage { position: relative; display: inline-block; border: 1px solid var(--line); background: #fff; user-select: none; }
.stage canvas { display: block; }
.overlay { position: absolute; inset: 0; cursor: crosshair; }
.box { position: absolute; border: 1.5px solid var(--gruenspan-dark); background: rgba(56, 182, 192, .16); font-size: 11px; color: var(--gruenspan-ink); overflow: hidden; white-space: nowrap; cursor: move; }
.box.page { border-color: var(--chili); background: rgba(232, 64, 41, .1); color: #7a2213; }
.box.sel { outline: 2px solid #f0a500; }
.box.ghost { border-style: dashed; opacity: .5; pointer-events: none; }
.box.white { background: rgba(255, 255, 255, .88); }
.box .handle { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: var(--gruenspan-dark); cursor: nwse-resize; }

/* ── QR print ─────────────────────────────── */
.qr-page { text-align: center; page-break-after: always; padding: 24px; }
.qr-page .qr-logo { width: 54px; height: 54px; }
.qr-page .date { font-size: 1.3rem; }
.qr-page img.qr { width: 70mm; height: 70mm; }
.qr-page .langs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; text-align: left; max-width: 170mm; margin: 16px auto 0; font-size: .95rem; }

/* ── responsive ─────────────────────────────── */
@media (max-width: 1080px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .page-content { padding: 28px 26px 36px; } }
@media (max-width: 760px) {
  .topbar { padding: 8px 14px; }
  .brand-copy, .user-name, .admin-only { display: none; } /* no admin work on phones */
  .page-content { padding: 18px 14px 28px; }
  footer.footer { padding: 10px 14px 18px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 16px; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 100px; padding: 12px; } .stat-card > strong { font-size: 1.6rem; } .stat-icon { display: none; }
}
@media print {
  .topbar, footer, .no-print { display: none !important; }
  body { background: #fff; }
  .page-content { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; box-shadow: none; }
}

/* ── icons, tooltips, required ─────────────────────────────── */
.icon { flex: none; vertical-align: -3px; }
.btn .icon, .nav-item .icon, .meta .icon, .hamburger-menu .icon { vertical-align: middle; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.info { position: relative; display: inline-flex; align-items: center; margin-left: 4px; color: var(--faint); cursor: help; vertical-align: middle; border-radius: 50%; }
.info:hover, .info:focus-visible { color: var(--gruenspan-dark); }
.info .tip { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 30; width: max-content; max-width: min(320px, 80vw); transform: translateX(-50%);
  padding: 9px 12px; border-radius: 7px; background: var(--text); color: #fff; font-size: .82rem; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none;
  box-shadow: 0 8px 24px rgba(31, 42, 43, .2); opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; white-space: normal; text-align: left; }
.info .tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--text); }
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { opacity: 1; visibility: visible; }
.req::after, .req-mark { content: " *"; color: var(--chili-dark); font-weight: 500; }
.req-mark::after { content: none; }

/* ── modal dialogs ─────────────────────────────── */
dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: 88vh; overflow: auto; padding: 22px 24px 24px; }
dialog.modal.wide { width: min(1000px, calc(100vw - 24px)); }
dialog.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
dialog.modal > header h2 { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #f3f1ec; color: var(--text); }
.or { margin: 14px 0 0; color: var(--faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }

/* ── event page: action bar, clickable steps, hamburger ─────────────────────────────── */
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.dot-on { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.steps li { padding: 0; }
.steps li > a, .steps li > button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 14px 16px; border: 0; background: none; font: inherit; color: inherit; text-align: left; text-decoration: none; cursor: pointer; border-radius: var(--radius); }
.steps li > a:hover, .steps li > button:hover { background: #fbfaf8; }
.steps li:hover { border-color: var(--gruenspan); }
.hamburger { display: none; position: relative; }
.hamburger > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; }
.hamburger > summary::-webkit-details-marker { display: none; }
.hamburger-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 16px 40px rgba(31, 42, 43, .16); }
.hamburger-menu a, .hamburger-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.hamburger-menu a:hover, .hamburger-menu button:hover { background: var(--gruenspan-soft); }
.mobile-primary { display: none; }
.event-head { align-items: flex-start; flex-wrap: nowrap; }

/* ── letter filter ─────────────────────────────── */
.letters { display: flex; flex-wrap: wrap; gap: 4px; }
.letters a, .letters span { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 7px; font-weight: 500; font-size: .92rem; text-decoration: none; }
.letters a { border: 1px solid var(--line-strong); background: #fff; color: var(--text); }
.letters a:hover { border-color: var(--gruenspan); }
.letters a[aria-current] { background: var(--gruenspan); border-color: var(--gruenspan); color: var(--gruenspan-ink); }
.letters span { color: #c9c5bc; }

/* ── misc ─────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; }
.tabs a[aria-current] { border-bottom-color: var(--chili); color: var(--text); }
.result-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--gruenspan-soft); color: var(--gruenspan-dark); font-size: 1rem; }
.result-icon.is-check { background: var(--ok-soft); color: var(--ok); }
.result-icon.is-alert, .result-icon.is-clock { background: var(--warn-soft); color: var(--warn); }
.badge .icon { margin-right: -2px; }
.badge:has(.icon)::before { content: none; }

@media (max-width: 760px) {
  .action-bar { display: none; }
  .hamburger { display: block; }
  .steps { grid-template-columns: 1fr 1fr; gap: 8px; }
  .steps li > a, .steps li > button { padding: 12px; gap: 10px; }
  /* the one action that matters on site, always within thumb reach */
  .mobile-primary { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 15; min-height: 52px; font-size: 1.05rem; box-shadow: 0 10px 30px rgba(31, 42, 43, .25); }
  .page-content:has(.mobile-primary) { padding-bottom: 90px; }
  .letters a, .letters span { min-width: 40px; height: 40px; }
}

/* flex children default to min-width:auto, so a wide table would stretch the page on phones */
.page-content { min-width: 0; }
.info .tip { display: none; }
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { display: block; }
@media (max-width: 760px) {
  .info .tip { position: fixed; left: 16px; right: 16px; bottom: 16px; top: auto; width: auto; max-width: none; transform: none; z-index: 40; }
  .info .tip::after { content: none; }
}

/* "Mehr" dropdown in the desktop action bar */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu .hamburger-menu { left: 0; right: auto; }
.action-bar { align-items: center; }
@media (max-width: 760px) { .user-menu-panel .admin-only { display: none; } } /* no admin work on phones */

/* Tooltips: only on hover or keyboard focus – not when a dialog moves focus programmatically. */
.info:focus .tip, .info:focus-within .tip { display: none; }
.info:hover .tip, .info:focus-visible .tip { display: block; }
/* Inside dialogs (overflow: auto) open downwards and start at the icon, so the box never clips them. */
dialog .info .tip { top: calc(100% + 8px); bottom: auto; left: -8px; transform: none; }
dialog .info .tip::after { top: auto; bottom: 100%; left: 14px; margin-left: 0; border-top-color: transparent; border-bottom-color: var(--text); }
@media (max-width: 760px) {
  dialog .info .tip { top: auto; bottom: 16px; left: 16px; }
  dialog .info .tip::after { content: none; }
}
/* Short dialogs don't need to scroll – let tooltips extend past their edge. Only the long protocol scrolls. */
dialog.modal:not(.wide) { overflow: visible; max-height: none; }
.day-times { display: grid; gap: 8px; margin: 8px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf8; }
.day-time-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 10px; align-items: center; }
@media (max-width: 520px) { .day-time-row { grid-template-columns: 1fr 1fr; } .day-time-row span { grid-column: 1 / -1; } }
.download-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0; } .downloads { list-style: none; padding: 0; }

/* input with a leading icon (e.g. redirect URL) */
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > input { padding-left: 40px; }

/* radio options one per line (e.g. QR validity) */
fieldset.stacked label.inline { display: flex; margin: 8px 0; }

/* `hidden` must win over display rules like `.day-times { display: grid }` */
[hidden] { display: none !important; }
input:disabled, select:disabled, textarea:disabled { background: #f3f1ec; color: var(--faint); border-color: var(--line); cursor: not-allowed; }
.day-time-head span { color: var(--faint); font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 520px) { .day-time-head { display: none; } }
.footer .sep, .public-footer .sep { margin: 0 6px; color: var(--line-strong); }
@font-face { font-family: "Kalam"; src: url("../vendor/pdf-lib/Kalam-Regular.ttf") format("truetype"); font-display: swap; }
.typed-preview { font-family: "Kalam", "Segoe Print", cursive; font-size: 1.6rem; line-height: 1.3; min-height: 1.3em; margin: 10px 0 0; padding: 4px 10px; border-bottom: 1px solid var(--line-strong); color: var(--text); overflow-wrap: anywhere; }
.back-row { margin: 0 0 10px; } .back-row:not(:has(a:not([hidden]))) { display: none; }
#step-data > fieldset:first-child, #step-sign > fieldset:first-child { margin-top: 0; }
.kiosk-legal summary { cursor: pointer; text-decoration: underline; list-style: none; }
.kiosk-legal summary::-webkit-details-marker { display: none; }
.legal-qr { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
.legal-qr figure { margin: 0; text-align: center; color: var(--text); }
.legal-qr img { background: #fff; padding: 6px; border-radius: 6px; }
code.break { overflow-wrap: anywhere; word-break: break-all; }
.webhooks li p { margin: 4px 0; }
.template-editor { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.template-editor textarea.mono { width: 100%; font: .85rem/1.45 ui-monospace, Consolas, monospace; }
.placeholder-list ul { max-height: 260px; overflow: auto; margin: 0; }
.placeholder-list li { padding: 4px 0; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.placeholder-list code { font-size: .8rem; }
.webhook { padding: 12px 0; border-bottom: 1px solid var(--line); }
.webhook p { margin: 4px 0; }
.webhook-new { margin-top: 14px; }
.webhook-new > summary, .webhook details > summary { cursor: pointer; }
@media (max-width: 760px) { .template-editor { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .sigpad { transition: none; } }
