/* Peer-Feedback – schlicht, gut lesbar, mobil bedienbar. Keine externen Schriften. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5a6472;
  --border: #d4d9e0;
  --accent: #00508c;
  --accent-text: #ffffff;
  --accent-soft: #e6f0f8;
  --ok: #1d6b3a;
  --ok-soft: #e5f3ea;
  --warn: #8a5300;
  --warn-soft: #fff4dc;
  --error: #b00020;
  --error-soft: #fdecee;
  --focus: #ffbf47;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --surface: #1d232b;
    --text: #e8ecf1;
    --muted: #a7b0bc;
    --border: #3a4350;
    --accent: #6cb4ee;
    --accent-text: #0b1520;
    --accent-soft: #1d3346;
    --ok: #7fd49c;
    --ok-soft: #173225;
    --warn: #f3c56b;
    --warn-soft: #3a2f16;
    --error: #ff8a9a;
    --error-soft: #3d1c22;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 96px; }
main.admin { max-width: 1100px; }
main.wide { max-width: 1400px; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header.site { background: var(--accent); color: var(--accent-text); }
header.site .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 52px; gap: 16px; }
header.site .brand { font-weight: 600; }
header.site nav { display: flex; gap: 16px; align-items: center; }
header.site a, header.site button.link { color: var(--accent-text); }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 1.3rem; margin: 32px 0 8px; }
h3 { font-size: 1.1rem; margin: 20px 0 8px; }
h1 small, h3 small { font-weight: normal; color: var(--muted); }
.subtitle { color: var(--muted); margin: 0 0 16px; }
.hint, small { color: var(--muted); }
.hint { font-size: 0.92rem; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

.meta { display: grid; gap: 2px; margin: 0 0 20px; }
.meta div { display: flex; gap: 8px; flex-wrap: wrap; }
.meta dt { font-weight: 600; }
.meta dd { margin: 0; }

/* Hinweisboxen */
.notice { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; }
.notice.success { background: var(--ok-soft); border-color: var(--ok); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn); }
.notice.small { padding: 6px 12px; font-size: 0.92rem; }
.notice p:first-child { margin-top: 0; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.error-summary { border: 3px solid var(--error); background: var(--error-soft); padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; }
.error-summary h2 { margin-top: 0; font-size: 1.15rem; }
.error-summary a { color: var(--error); font-weight: 600; }
.field-error { color: var(--error); font-weight: 600; margin: 4px 0; }
.has-error { border-left: 4px solid var(--error); padding-left: 12px; }

/* Fragebogen */
.part { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 20px 20px; margin: 24px 0; }
.part > h2 { margin-top: 20px; }
.usage { font-style: italic; color: var(--muted); }
.usage-inline { font-weight: normal; color: var(--muted); font-size: 0.92rem; }
.scale { background: var(--accent-soft); border-radius: var(--radius); padding: 8px 16px; }
.scale ul { list-style: none; padding: 0; margin: 0 0 8px; }
.scale li { margin: 4px 0; }
.scale .num { display: inline-block; min-width: 1.6em; font-weight: 700; }
.reason-info { margin-top: 20px; }
.reason-info h3 { margin-bottom: 0; }
/* Je Teammitglied ein deutlich abgesetzter Block; der Name bleibt beim Scrollen oben sichtbar */
.part { --part-pad: 20px; }
.person-card { border-top: 5px solid var(--accent); margin-top: 40px; padding-top: 0; }
.person-card > h3.person {
  position: sticky; top: 0; z-index: 2;
  margin: 0 calc(-1 * var(--part-pad)) 14px; padding: 10px var(--part-pad);
  background: var(--accent); color: var(--accent-text); font-size: 1.3rem; line-height: 1.3;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
}
.person-label { font-size: 0.85rem; font-weight: normal; opacity: 0.9; }
.person-count { margin-left: auto; font-size: 0.85rem; font-weight: normal; opacity: 0.9; }
.person-card fieldset.rating + fieldset.rating { border-top: 1px solid var(--border); padding-top: 14px; }
.crit-no { font-weight: 700; }

fieldset.rating { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
fieldset.rating.has-error { padding-left: 12px; }
fieldset.rating legend { padding: 0; margin-bottom: 8px; }
.scale-buttons { display: grid; grid-template-columns: repeat(5, minmax(44px, 64px)); gap: 8px; }
.scale-option { position: relative; display: block; }
.scale-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale-option span:first-of-type {
  display: flex; align-items: center; justify-content: center;
  height: 48px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-weight: 700; font-size: 1.1rem;
}
.scale-option input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.scale-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.scale-option:hover span:first-of-type { border-color: var(--accent); }

.reason, .question { margin: 10px 0 16px; }
.reason label, .question label { display: block; margin-bottom: 4px; }
.reason.is-hidden { display: none; }
textarea, input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="datetime-local"], input:not([type]), select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
textarea { resize: vertical; min-height: 3.2em; }
input[type="file"] { font: inherit; }

.team-sum { background: var(--accent-soft); padding: 8px 12px; border-radius: var(--radius); }
.points-list { display: grid; gap: 8px; margin: 12px 0; }
.points-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border); }
.points-row > label { font-weight: 600; flex: 1 1 160px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input.points { width: 4.2em; text-align: center; font-size: 1.15rem; font-weight: 700; padding: 8px 4px; }
.stepper .step { width: 44px; height: 44px; font-size: 1.4rem; line-height: 1; padding: 0; }
.unit { color: var(--muted); }
.sum-box { background: var(--surface); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 10px 14px; font-size: 1.1rem; margin: 12px 0; }
.sum-box output { font-weight: 700; }
.sum-box.sum-ok { border-color: var(--ok); }
.sum-box.sum-bad { border-color: var(--error); }
.sum-status { display: block; font-size: 0.95rem; }
.sum-ok .sum-status { color: var(--ok); }
.sum-bad .sum-status { color: var(--error); }

/* Buttons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border-radius: 6px; padding: 10px 18px; min-height: 44px;
  border: 2px solid var(--accent); cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); }
button.secondary, .button.secondary, .step { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
button.danger { background: var(--error); border-color: var(--error); color: #fff; }
button.small, .button.small, a.small { min-height: 34px; padding: 4px 10px; font-size: 0.9rem; }
button.link { background: none; border: 0; padding: 0; min-height: 0; text-decoration: underline; font-weight: normal; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.sticky-actions { position: sticky; bottom: 0; z-index: 3; background: var(--bg); padding: 12px 0; margin: 0;
  border-top: 1px solid var(--border); }
.sticky-actions .hint { flex-basis: 100%; margin: 0; }
.thanks { text-align: center; font-weight: 600; margin-top: 32px; }
form.inline { display: inline; }

/* Admin */
.narrow { max-width: 420px; }
.stack { display: grid; gap: 8px; max-width: 640px; }
.grid-form { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: center; max-width: 640px; }
.small-form { margin: 8px 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 20px 16px; margin: 24px 0; }
.panel > h2:first-child { margin-top: 16px; }
.actions-panel { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 20px; }
.actions-panel p { margin: 0; flex-basis: 100%; }
.danger-zone { border-color: var(--error); }
.breadcrumb { color: var(--muted); font-size: 0.92rem; margin: 0 0 8px; }
.pager { display: flex; justify-content: space-between; font-size: 0.95rem; }
.team-block { margin: 24px 0 32px; }
.team-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.team-head h2 { margin: 0; }
.team-head select { width: auto; }
.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.95rem; }
table.data th, table.data td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
table.data thead th { background: var(--accent-soft); font-weight: 600; }
table.results select { width: auto; padding: 4px; }
table.results input { padding: 4px 6px; }
table.results input[name^="bonus_"] { width: 3.5em; }
table.results td.manual { min-width: 220px; }
table.results td.manual input { margin-top: 4px; }
tr.muted td { color: var(--muted); }
td.extreme { font-weight: 700; color: var(--warn); }
td.reasons p { margin: 0 0 4px; }
td.effect.e1 { color: var(--ok); font-weight: 700; }
td.effect.e-1, td.effect.e-3 { color: var(--error); font-weight: 700; }
td.flags { min-width: 220px; }
.flag { display: block; font-size: 0.85rem; margin-bottom: 3px; }
.flag.strong { color: var(--error); font-weight: 700; }
.flag.hint { color: var(--muted); }
.nowrap { white-space: nowrap; }
.badge { display: inline-block; font-size: 0.8rem; padding: 1px 8px; border-radius: 99px; background: var(--border); color: var(--text); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.open { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
details.edit summary { cursor: pointer; color: var(--accent); }
details summary h2.inline-h { display: inline; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.kpis div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.kpis span { display: block; color: var(--muted); font-size: 0.85rem; }
.kpis strong { font-size: 1.2rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.verbatim { padding-left: 18px; }
.verbatim li { margin-bottom: 8px; }
.verbatim .who { font-weight: 600; }
dl.answers dt { font-weight: 600; margin-top: 8px; }
dl.answers dd { margin: 2px 0 0; }
dd.highlight { background: var(--warn-soft); padding: 6px 10px; border-radius: 6px; }
.check { display: flex; gap: 8px; align-items: center; }
.links li { margin: 6px 0; }
.preview .feedback { border: 1px dashed var(--border); padding: 12px 16px; border-radius: var(--radius); }

/* Rückmeldung */
.feedback section { margin-bottom: 8px; }
.fb-table { border-collapse: collapse; width: 100%; max-width: 560px; }
.fb-table th, .fb-table td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; }
.fb-table td { text-align: center; width: 7em; }
.fb-table tfoot th, .fb-table tfoot td { font-weight: 700; border-bottom: 0; }
.summary { white-space: pre-line; }
.final-grade { font-size: 1.25rem; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .part { padding: 4px 14px 16px; --part-pad: 14px; }
  .scale-buttons { grid-template-columns: repeat(5, 1fr); }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form > span:empty { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .sticky-actions button { flex: 1 1 auto; }
  header.site nav { gap: 10px; font-size: 0.9rem; }
  header.site .who { display: none; }
}

@media print {
  header.site, .no-print, .skip { display: none; }
  body { background: #fff; color: #000; }
  main.wrap { padding: 0; }
}

/* ---------------------------------------------------------------- Mehrere Veranstaltungen (v2) */
header.site .brand { color: var(--accent-text); text-decoration: none; white-space: nowrap; }
header.site .who { opacity: 0.85; font-size: 0.92rem; }
.devbar { background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; text-align: center; padding: 4px 16px; }
.devbar a { color: inherit; }
ul.plain { list-style: none; padding-left: 0; }
ul.plain li { margin: 6px 0; }
.small { font-size: 0.9rem; }
.label { font-weight: 600; align-self: start; padding-top: 6px; }
code.break { word-break: break-all; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--border); margin: 12px 0 20px; }
.tabs a { padding: 8px 14px; text-decoration: none; border-radius: 6px 6px 0 0; color: var(--text); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.tabs a:hover:not([aria-current]) { background: var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.filters a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 99px; text-decoration: none; font-size: 0.9rem; }
.filters a[aria-current="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.card p { margin: 6px 0; }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.card-todo { border-left: 4px solid var(--warn); }
.kpis .warn { border-color: var(--warn); background: var(--warn-soft); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 12px 0; }
.team-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.team-box h3 { margin: 4px 0; font-size: 1rem; }
.team-box.warn { border-color: var(--warn); background: var(--warn-soft); }
.inline-actions, .inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form input:not([type="hidden"]) { width: auto; }
.inline-form label { display: flex; gap: 6px; align-items: center; }
.choice-list { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.disabled { opacity: 0.6; cursor: not-allowed; }
.choice input { margin-top: 4px; }
.choice .hint { display: block; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
img.qr { background: #fff; padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); }
details.mail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; }
details.mail summary { cursor: pointer; }
pre.mailbody { white-space: pre-wrap; font: inherit; font-size: 0.95rem; margin: 8px 0 0; }
tr.current td { background: var(--accent-soft); }
.group-panel h2 { margin-top: 12px; }

/* Hörsaal-Folie */
body.slide { background: #fff; color: #000; }
body.slide main { max-width: 900px; margin: 0 auto; padding: 32px 16px; text-align: center; }
body.slide h1 { font-size: 2.6rem; }
body.slide .slide-course { font-size: 1.6rem; margin: 0 0 16px; }
body.slide img { width: min(70vh, 90vw); height: auto; }
body.slide .slide-url { font-family: ui-monospace, monospace; font-size: 1.2rem; word-break: break-all; }
body.slide ol { display: inline-block; text-align: left; font-size: 1.4rem; }

/* Suchbox „Studierende hinzufügen“ */
.add-btn { margin-top: 6px; }
dialog.add-dialog { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; background: var(--surface); color: var(--text); }
dialog.add-dialog::backdrop { background: rgba(20, 24, 29, 0.45); }
dialog.add-dialog h2 { margin-top: 0; font-size: 1.15rem; }
.combo { position: relative; }
.combo-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); max-height: 280px; overflow-y: auto; }
.combo-list li { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--border); }
.combo-list li:last-child { border-bottom: 0; }
.combo-list li.active, .combo-list li:hover { background: var(--accent-soft); }
.combo-list li .hint { display: inline; }
.group-qr { margin-top: 12px; }

.team-block .team-head h3 { margin: 0; }
.summary-field { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.demo-hint table { margin: 8px 0; font-size: 0.9rem; } .demo-hint code { word-break: break-all; }

/* ---------------------------------------------------------------- Fragebogen v1.3: knapper, Schieberegler */
.lead { font-size: 1.05rem; }
.intro p { margin: 0 0 10px; }
.points-row { display: block; padding: 14px 0; }
.points-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; }
.points-head label { font-weight: 600; white-space: nowrap; }
.points-head .points-readout { margin-left: auto; }
.points-readout { white-space: nowrap; display: inline-flex; align-items: baseline; gap: 8px; }
.points-level { font-weight: 600; color: var(--text); }
.points-row:not(.off-center) .points-level { color: var(--accent); }
.auto-hint { margin-top: 0; }
/* Regler: deutliche Mitte, „deutlich“-Zonen (Begründung nötig) leicht getönt */
.slider-wrap { margin-top: 6px; position: relative; }
.slider-wrap::before {   /* Mittellinie, ragt über die Spur hinaus */
  content: ""; position: absolute; left: calc(50% - 2px); top: 4px; width: 4px; height: 36px;
  background: var(--accent); border-radius: 2px; opacity: 0.85; pointer-events: none;
}
input.points-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0;
  cursor: pointer; position: relative;
}
input.points-slider::-webkit-slider-runnable-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right,
    var(--zone) 0, var(--zone) calc(15px + (100% - 30px) * 0.275),
    var(--border) calc(15px + (100% - 30px) * 0.275), var(--border) calc(15px + (100% - 30px) * 0.725),
    var(--zone) calc(15px + (100% - 30px) * 0.725), var(--zone) 100%);
}
input.points-slider::-moz-range-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right,
    var(--zone) 0, var(--zone) calc(16px + (100% - 32px) * 0.275),
    var(--border) calc(16px + (100% - 32px) * 0.275), var(--border) calc(16px + (100% - 32px) * 0.725),
    var(--zone) calc(16px + (100% - 32px) * 0.725), var(--zone) 100%);
}
.points-slider { --zone: color-mix(in srgb, var(--border) 55%, var(--muted)); }
input.points-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent), 0 1px 3px rgba(0,0,0,.25);
}
input.points-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
input.points-slider:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.slider-scale { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-top: -2px; }
.slider-scale .mid { font-weight: 700; color: var(--accent); }
.sum-box { font-size: 0.9rem; border-width: 1px; }
/* Teil D: Endpunkte der Skala */
.scale-ends { display: flex; justify-content: space-between; max-width: calc(5 * 64px + 4 * 8px); font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) { .scale-ends { max-width: none; } }
/* Bereichsüberschrift nicht in der Trennlinie: Legende als normale Zeile */
fieldset.rating > legend { float: left; width: 100%; }
fieldset.rating > legend + * { clear: both; }
.scale-ends span { max-width: 48%; }
.scale-ends span:last-child { text-align: right; }

/* Auswertung: Zahlfeld Mitarbeit */
table.results input.count { width: 4.2em; }
