:root {
  --navy: #0f2c4e;
  --steel: #5c87a8;
  --steel-light: #a9c4d6;
  --ink: #141414;
  --muted: #5b6672;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #d9e1e9;
  --good: #2f8f5b;
  --good-bg: #e4f4ea;
  --ok: #b9831a;
  --ok-bg: #fbf0d6;
  --bad: #c0463f;
  --bad-bg: #fbe5e3;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.hidden { display: none !important; }

.top {
  background: var(--navy); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.top img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; }
.top .t1 { font-weight: 700; font-size: 18px; }
.top .t2 { color: var(--steel-light); font-size: 14px; }
.top .grow { flex: 1; min-width: 0; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 980px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 44, 78, .08), 0 6px 20px rgba(15, 44, 78, .06);
}
#app { display: flex; flex-direction: column; gap: 14px; }
#app > div:empty { display: none; }
#app > .mt { margin-top: 0; }
#app > * { min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 16px 30px; }

/* Knoepfe */
.btn {
  border: 0; border-radius: 14px; padding: 14px 20px; font-weight: 650; min-height: 50px;
  background: var(--navy); color: #fff;
}
a { color: var(--navy); }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { background: #163a66; }
.btn.secondary { background: #fff; color: var(--navy); border: 2px solid #b9c8d6; }
.btn.secondary:hover { background: #eaf1f7; }
.btn.danger { background: var(--bad-bg); color: #9c322b; border: 2px solid #e3a9a4; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }

/* Formular */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 0; }
.progress > i { display: block; height: 100%; background: var(--steel); width: 0; transition: width .25s; }
.qnum { color: var(--steel); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.question { font-size: 23px; font-weight: 700; margin: 6px 0 4px; }
.help { color: var(--muted); margin: 0 0 14px; }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.rate {
  border: 2px solid #c5d2de; background: #fff; border-radius: 16px; padding: 16px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 650; min-height: 104px;
}
.rate .emo { font-size: 34px; line-height: 1; }
.rate[aria-pressed="true"].r3 { border-color: var(--good); background: var(--good-bg); }
.rate[aria-pressed="true"].r2 { border-color: var(--ok); background: var(--ok-bg); }
.rate[aria-pressed="true"].r1 { border-color: var(--bad); background: var(--bad-bg); }
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choice {
  text-align: left; border: 2px solid #c5d2de; background: #fff; border-radius: 14px; padding: 14px 16px; font-weight: 600;
}
.choice[aria-pressed="true"] { border-color: var(--steel); background: #e6eef5; }
textarea, input[type=text], input[type=password], select {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
textarea:focus, input:focus, select:focus, button:focus-visible { outline: 3px solid var(--steel-light); outline-offset: 1px; }
label.field { display: block; font-weight: 650; margin-bottom: 6px; }
.comment { margin-top: 16px; }
.nav { display: flex; gap: 10px; margin-top: 20px; }
.nav .btn { flex: 1; }
.nav .btn.secondary { flex: 0 0 auto; }
.thanks { text-align: center; padding: 30px 10px; }
.thanks .big { font-size: 64px; }
.err { color: var(--bad); background: var(--bad-bg); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.ok-msg { color: var(--good); background: var(--good-bg); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Schalter */
.switch {
  width: 52px; height: 30px; border-radius: 99px; border: 0; background: #c3ced9; position: relative; flex: none; padding: 0;
  transition: background .15s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"] .knob { transform: translateX(22px); }

/* Verwaltung */
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; border: 1px solid transparent; }
.chip.draft { background: #eef1f4; color: #4a5560; border-color: #c3ccd5; }
.chip.open { background: var(--good-bg); color: #1d6a40; border-color: #9fd3b3; }
.chip.closed { background: var(--ok-bg); color: #7a5608; border-color: #e4c77e; }
/* Jede Umfrage ist eine eigene Kachel: Rahmen, leicht getoenter Grund, Pfeil rechts. */
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border: 2px solid #c5d2de; border-radius: 16px; background: #f4f8fb;
  color: inherit; text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
}
.list-item + .list-item { margin-top: 10px; }
.list-item:hover { background: #fff; border-color: var(--steel); }
.list-item:active { transform: scale(.99); }
.list-item .go { color: var(--steel); font-size: 22px; line-height: 1; margin-left: 4px; }
.list-item .end { display: flex; align-items: center; gap: 6px; flex: none; }
.tabs { display: flex; gap: 6px; margin: 0; background: #d6e1eb; border: 1px solid #b9c8d6; padding: 5px; border-radius: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 10px; font-weight: 650; color: var(--navy); }
.tabs button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 3px rgba(15, 44, 78, .25); color: var(--navy); }
.qedit { border: 2px solid #c5d2de; border-radius: 16px; padding: 14px; background: #fff; }
.qedit + .qedit { margin-top: 12px; }
.qedit .head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.qedit .head .grow { flex: 1; }
.iconbtn { border: 2px solid #b9c8d6; background: #fff; color: var(--navy); width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.iconbtn[disabled] { opacity: .35; cursor: default; }
.sw-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; }
.qr { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; border: 1px solid var(--line); }
.qr svg { display: block; width: 200px; height: 200px; }

/* Auswertung */
.res-q { padding: 18px 0; border-top: 1px solid var(--line); }
.res-q:first-child { border-top: 0; padding-top: 4px; }
.res-q h3 { font-size: 18px; }
.bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin: 12px 0 6px; background: var(--line); }
.bar > span { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; min-width: 0; }
.bar .good { background: var(--good); }
.bar .ok { background: var(--ok); }
.bar .bad { background: var(--bad); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.prev { font-size: 14px; color: var(--muted); margin-top: 6px; }
.optrow { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 6.5rem; gap: 10px; align-items: center; margin: 6px 0; font-size: 15px; }
.optbar { height: 14px; border-radius: 7px; background: #dbe4ec; border: 1px solid #c3cfdb; overflow: hidden; }
.optbar > i { display: block; height: 100%; background: var(--steel); }
.comments { margin-top: 12px; display: grid; gap: 8px; }
.cm { border: 1px solid #d3dde7; border-left: 5px solid #9fb2c4; background: #eef3f8; padding: 9px 12px; border-radius: 0 12px 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm.r3 { border-color: var(--good); }
.cm.r2 { border-color: var(--ok); }
.cm.r1 { border-color: var(--bad); }
.cm .meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.cm .vis { display: flex; align-items: center; gap: 8px; }
.fazit { white-space: pre-wrap; background: #e6eef5; border-radius: 14px; padding: 14px 16px; margin: 14px 0 0; }
.stat { font-size: 15px; color: var(--muted); }

@media (max-width: 420px) {
  .rate { min-height: 94px; padding: 12px 4px; font-size: 15px; }
  .question { font-size: 21px; }
}
@media print {
  body { background: #fff; }
  .top, .noprint, .tabs, .foot .noprint { display: none !important; }
  .card { box-shadow: none; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .res-q { break-inside: avoid; }
}

.mt { margin-top: 14px; }
