/* Instrument Sans (lokal ausgeliefert, kein Aufruf bei Google) */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/InstrumentSans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/InstrumentSans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

.fbr {
  --bg: #f4f1ea; --fg: #1d1d1b; --ac: #1d1d1b; --acfg: #fff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --line: color-mix(in srgb, var(--fg) 28%, transparent);
  --soft: color-mix(in srgb, var(--fg) 8%, transparent);
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column;
  background-color: var(--bg); background-size: cover; background-position: center;
  color: var(--fg); font-family: var(--font); line-height: 1.35; overflow: hidden;
}
.fbr-stage { flex: 1; overflow: auto; display: flex; padding: 40px 28px 110px; }
.fbr-q { margin: auto; width: 100%; max-width: 700px; }

.fbr-in { animation: fbr-up .38s cubic-bezier(.2,.7,.2,1) both; }
.fbr-in-back { animation: fbr-down .38s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fbr-up { from { opacity: 0; transform: translateY(44px); } to { opacity: 1; transform: none; } }
@keyframes fbr-down { from { opacity: 0; transform: translateY(-44px); } to { opacity: 1; transform: none; } }

.fbr-title { margin: 0; font-size: clamp(24px, 4.2vw, 32px); font-weight: 500; letter-spacing: -.01em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .35em; }
.fbr-num { font-size: .75em; display: inline-flex; gap: 2px; opacity: .75; }
.fbr-num b { font-weight: 400; }
.fbr-star { opacity: .6; }
.fbr-t { outline: none; min-width: 2ch; }
.fbr-t[contenteditable], .fbr-desc[contenteditable] { border-radius: 4px; cursor: text; transition: background .15s; }
.fbr-t[contenteditable]:hover, .fbr-desc[contenteditable]:hover { background: var(--soft); }
.fbr-t[contenteditable]:focus, .fbr-desc[contenteditable]:focus { background: var(--soft); }
[contenteditable]:empty::before { content: attr(data-ph); opacity: .4; }
.fbr-desc { margin: 10px 0 0; font-size: clamp(16px, 2.6vw, 20px); opacity: .72; outline: none; white-space: pre-wrap; }
.fbr-desc.big { margin-top: 16px; }
.fbr-in-wrap { margin-top: 28px; }
.fbr-in-wrap:empty { margin: 0; }

.fbr-field {
  width: 100%; background: transparent; border: 0; border-bottom: 2px solid var(--line); border-radius: 0;
  color: inherit; font: inherit; font-size: clamp(22px, 4vw, 30px); padding: 6px 0 10px; outline: none; transition: border-color .2s;
}
.fbr-field:focus { border-color: var(--fg); }
.fbr-field::placeholder { color: color-mix(in srgb, var(--fg) 34%, transparent); }
textarea.fbr-field { resize: none; min-height: 3.8em; font-size: clamp(18px, 3vw, 24px); line-height: 1.4; }
input[type=date].fbr-field { color-scheme: light dark; max-width: 320px; }

.fbr-dur { display: flex; align-items: flex-start; gap: 10px; }
.fbr-dur b { font-size: 28px; font-weight: 400; opacity: .4; padding-top: 6px; }
.fbr-dur label { display: flex; flex-direction: column; gap: 4px; }
.fbr-dur input { width: 4ch; text-align: center; }
.fbr-dur label:first-child input { width: 5ch; }
.fbr-dur span { font-size: 13px; opacity: .6; text-align: center; }

.fbr-choices { display: flex; flex-direction: column; gap: 8px; max-width: 440px; }
.fbr-choice {
  display: flex; align-items: center; gap: 12px; text-align: left; background: var(--soft); border: 1px solid var(--line);
  color: inherit; font: inherit; font-size: 18px; padding: 10px 14px; border-radius: 8px; cursor: pointer; transition: background .15s, border-color .15s;
}
.fbr-choice kbd { flex: none; box-sizing: border-box; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font: 600 12px var(--font); border: 1px solid var(--line); border-radius: 4px; padding: 0; background: var(--bg); }
.fbr-choice:hover { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.fbr-choice.on { border-color: var(--ac); box-shadow: inset 0 0 0 1px var(--ac); background: color-mix(in srgb, var(--ac) 18%, transparent); }
.fbr-choice.on kbd { background: var(--ac); color: var(--acfg); border-color: var(--ac); }
.fbr-note { margin-top: 10px; font-size: 14px; opacity: .6; }

.fbr-rating { display: flex; flex-wrap: wrap; gap: 8px; }
.fbr-rate {
  width: 52px; height: 52px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line);
  color: inherit; font: inherit; font-size: 20px; cursor: pointer; transition: .15s;
}
.fbr-rate:hover { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.fbr-rate.on { background: var(--ac); color: var(--acfg); border-color: var(--ac); }

.fbr-drop { display: block; cursor: pointer; }
.fbr-drop input { display: none; }
.fbr-drop-in {
  border: 2px dashed var(--line); border-radius: 12px; padding: 28px 20px; text-align: center; display: flex; flex-direction: column;
  gap: 6px; align-items: center; transition: .15s;
}
.fbr-drop:hover .fbr-drop-in, .fbr-drop.over .fbr-drop-in { border-color: var(--fg); background: var(--soft); }
.fbr-drop-in b { font-size: 18px; font-weight: 600; }
.fbr-drop-in span { font-size: 14px; opacity: .65; }
.fbr-drop-in img { max-height: 180px; max-width: 100%; border-radius: 8px; }

.fbr-err { min-height: 0; margin-top: 14px; display: none; padding: 8px 12px; border-radius: 6px; font-size: 15px; background: #c0392b; color: #fff; width: fit-content; max-width: 100%; }
.fbr-err.on { display: block; }

.fbr-actions { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.fbr-ok {
  background: var(--ac); color: var(--acfg); border: 0; border-radius: 8px; font: inherit; font-size: 20px; font-weight: 600;
  padding: 10px 20px; cursor: pointer; transition: transform .1s, opacity .15s;
}
.fbr-ok:hover { opacity: .88; }
.fbr-ok:active { transform: scale(.97); }
.fbr-ok:disabled { opacity: .55; cursor: default; }
.fbr-hint { font-size: 13px; opacity: .6; }
.fbr-hint b { font-weight: 500; }
.fbr.is-end .fbr-actions { display: none; }

.fbr-demo { margin-top: 22px; padding: 12px 14px; border-radius: 8px; background: var(--soft); font-size: 14px; word-break: break-all; }
.fbr-demo a { color: inherit; font-weight: 600; }

.fbr-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.fbr-prog { width: 240px; max-width: 55%; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.fbr-prog i { display: block; height: 100%; width: 0; background: var(--ac); transition: width .4s ease; }
.fbr-nav { display: flex; pointer-events: auto; }
.fbr-nav button {
  width: 38px; height: 34px; background: var(--ac); color: var(--acfg); border: 0; font: inherit; font-size: 17px; cursor: pointer;
}
.fbr-nav button:first-child { border-radius: 6px 0 0 6px; border-right: 1px solid color-mix(in srgb, var(--acfg) 25%, transparent); }
.fbr-nav button:last-child { border-radius: 0 6px 6px 0; }
.fbr-nav button:disabled { opacity: .35; cursor: default; }
.fbr.preview .fbr-nav { display: none; }

@media (max-width: 560px) {
  .fbr-stage { padding: 28px 18px 100px; }
  .fbr-ok { font-size: 18px; }
  .fbr-hint { display: none; }
}

/* Logo: klein, oben links, auf Desktop und Handy */
.fbr-logo { position: absolute; top: 20px; left: 28px; height: 30px; width: auto; aspect-ratio: 1502 / 652; z-index: 3; pointer-events: none; }
.fbr.no-logo .fbr-logo { display: none; }
.fbr-stage { padding-top: 76px; }
@media (max-width: 560px) {
  .fbr-logo { top: 16px; left: 18px; height: 26px; }
  .fbr-stage { padding-top: 64px; }
}

/* Fortschritt wie bei Typeform: "x von y beantwortet" + Balken */
.fbr-progwrap { display: flex; flex-direction: column; gap: 6px; }
.fbr-ptxt { font-size: 13px; opacity: .8; min-height: 16px; }
.fbr-progwrap .fbr-prog { width: 220px; }

/* ---- Theme-Variablen (Gewicht, Größe, Ecken) ---- */
.fbr-title { font-size: var(--hsz, clamp(24px, 4.2vw, 32px)); font-weight: var(--hw, 500); }
.fbr-desc { font-size: var(--tsz, clamp(16px, 2.6vw, 20px)); font-weight: var(--tw, 400); }
.fbr-field { font-size: var(--fsz, clamp(22px, 4vw, 30px)); font-weight: var(--tw, 400); }
textarea.fbr-field { font-size: calc(var(--fsz, 30px) * .8); }
.fbr-choice { font-size: var(--csz, 18px); font-weight: var(--tw, 400); border-radius: min(var(--br, 8px), 12px); }
.fbr-rate { border-radius: min(var(--br, 8px), 12px); font-weight: var(--tw, 400); }
.fbr-ok { font-size: var(--bsz, 20px); font-weight: var(--bw, 600); border-radius: var(--br, 8px); }
.fbr-nav button:first-child { border-radius: var(--br, 8px) 0 0 var(--br, 8px); }
.fbr-nav button:last-child { border-radius: 0 var(--br, 8px) var(--br, 8px) 0; }

/* ---- Ausrichtung ---- */
.fbr-stage[data-align="center"] .fbr-q { text-align: center; }
.fbr-stage[data-align="center"] .fbr-title { justify-content: center; }
.fbr-stage[data-align="center"] .fbr-choices { margin-left: auto; margin-right: auto; text-align: left; }
.fbr-stage[data-align="center"] .fbr-field { text-align: center; }
.fbr-stage[data-align="center"] .fbr-actions, .fbr-stage[data-align="center"] .fbr-rating, .fbr-stage[data-align="center"] .fbr-dur { justify-content: center; }

/* ---- Bilder zu Fragen: oben, links, rechts, Hintergrund ---- */
.fbr-media img { display: block; max-width: 100%; border-radius: 10px; }
.fbr-q.lay-above .fbr-media { margin-bottom: 26px; }
.fbr-q.lay-above .fbr-media img { max-height: 240px; width: auto; }
.fbr-q.lay-left, .fbr-q.lay-right { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: center; max-width: 1040px; }
.fbr-q.lay-right .fbr-media { order: 2; }
.fbr-q.lay-left .fbr-media img, .fbr-q.lay-right .fbr-media img { width: 100%; max-height: 62vh; object-fit: cover; }
.fbr.has-wall .fbr-stage { background-size: cover; background-position: center; }
.fbr.has-wall .fbr-body { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); padding: 28px; border-radius: 14px; }
@media (max-width: 760px) {
  .fbr-q.lay-left, .fbr-q.lay-right { grid-template-columns: 1fr; gap: 22px; }
  .fbr-q.lay-right .fbr-media { order: 0; }
  .fbr-q.lay-left .fbr-media img, .fbr-q.lay-right .fbr-media img { max-height: 220px; }
}

/* ---- Kontrollkästchen und Dropdown ---- */
.fbr-check { display: flex; align-items: flex-start; gap: 14px; text-align: left; width: 100%; max-width: 560px; background: var(--soft); border: 1px solid var(--line); color: inherit; font: inherit; font-size: var(--csz, 18px); font-weight: var(--tw, 400); padding: 14px 16px; border-radius: min(var(--br, 8px), 12px); cursor: pointer; transition: background .15s, border-color .15s; }
.fbr-checks { display: flex; flex-direction: column; gap: 10px; }
.fbr-check:hover { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.fbr-check .fbr-box { flex: none; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; font-size: 15px; margin-top: 1px; transition: .15s; }
.fbr-check.on { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 18%, transparent); }
.fbr-check.on .fbr-box { background: var(--ac); border-color: var(--ac); color: var(--acfg); }
.fbr-stage[data-align="center"] .fbr-check { margin-left: auto; margin-right: auto; }
select.fbr-select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; cursor: pointer; }
select.fbr-select option { color: #111; }

.fbr-chip { display: inline-block; padding: 0 9px; margin: 0 1px; border-radius: 999px; font-size: .8em; font-weight: 500; line-height: 1.5; vertical-align: baseline; color: var(--ac, #2563eb); background: color-mix(in srgb, var(--ac, #2563eb) 16%, transparent); user-select: none; }
.fbr-chip.bad { color: #c0392b; background: rgba(192, 57, 43, .14); }
.fbr-at { position: fixed; z-index: 50; background: #fff; color: #111; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; font-family: system-ui, sans-serif; }
.fbr-at button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; background: #f3f4f6; border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: 14px; color: inherit; }
.fbr-at button small { font-size: 12px; opacity: .6; }

/* Links: Standard = Textfarbe, unterstrichen (immer lesbar); Farbe im Design wählbar */
.fbr a, .fbr-desc a, .fbr-check a { color: var(--lc, inherit); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.fbr-choice > span:last-child { flex: 1; min-width: 0; }

/* Formatierungsleiste (fett, kursiv, Link) im Editor */
.fbr-fmt { position: fixed; z-index: 60; display: flex; align-items: center; gap: 2px; background: #1d1d1b; color: #fff; border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-family: system-ui, sans-serif; }
.fbr-fmt button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; min-width: 32px; height: 30px; padding: 0 9px; border-radius: 7px; cursor: pointer; }
.fbr-fmt button:hover { background: rgba(255,255,255,.14); }
.fbr-fmt button.on { background: rgba(255,255,255,.26); }
.fbr-fmt input { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 7px; height: 30px; padding: 0 10px; width: 220px; font: inherit; font-size: 14px; outline: none; }
.fbr-fmt input::placeholder { color: rgba(255,255,255,.5); }
.fbr-desc strong, .fbr-t strong { font-weight: 700; }

.fbr-choice.locked { opacity: .45; cursor: not-allowed; }
.fbr-choice .fbr-lock { margin-left: auto; font-style: normal; font-size: .78em; opacity: .85; white-space: nowrap; padding-left: 12px; }
.fbr-choice > span { flex: 1; min-width: 0; }
