:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --soft: #faf9f6;
  --line: #ebe8e1;
  --ink: #1d2433;
  --muted: #6b7385;
  --faint: #9aa0ad;
  --blue: #2f6fed;  --blue-s: #e8efff;
  --green: #16a36a; --green-s: #e2f6ec;
  --amber: #d98200; --amber-s: #fff1d9;
  --red: #e5484d;   --red-s: #fde8e8;
  --violet: #7c5cff; --violet-s: #efeaff;
  --gray-s: #f0efeb;
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.muted { color: var(--muted); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: rgba(247, 246, 242, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: #e3f3ff; flex: none; }
.brand-title { font-weight: 800; font-size: 20px; letter-spacing: -.03em; line-height: 1.1; }
.brand-title .accent { color: var(--blue); }
.brand-sub { color: var(--muted); font-size: 12.5px; }
.top-actions { display: flex; gap: 8px; }
.top-actions .btn { white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  padding: 8px 14px; border-radius: 12px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: #d6d2c8; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: #2b3448; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.spin .ico { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { position: sticky; top: 65px; z-index: 19; height: 28px; background: var(--blue-s); display: flex; align-items: center; overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; background: rgba(47, 111, 237, .16); transition: width .4s; }
.progress-text { position: relative; padding: 0 24px; font-size: 12.5px; color: var(--blue); font-weight: 600; }

.container { max-width: 1160px; margin: 0 auto; padding: 22px 24px 60px; }
.banner { background: var(--amber-s); color: #8a5500; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; }

/* Filters & toolbar */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button {
  border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 99px; cursor: pointer; font-weight: 600; color: var(--muted);
}
.filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters .count { opacity: .7; font-weight: 500; margin-left: 2px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar input[type=search] { flex: 1; min-width: 220px; }
input[type=search], input[type=text], select, textarea {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-s); }
.toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; user-select: none; }

/* List */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 250px; gap: 18px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.row:hover { border-color: #d6d2c8; box-shadow: 0 6px 20px rgba(29, 36, 51, .06); }
.row.dim { opacity: .6; }
.row-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.row-title { font-weight: 700; font-size: 15px; line-height: 1.35; letter-spacing: -.005em; }
.row-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.row-fazit { font-size: 13px; margin-top: 6px; color: #3d4556; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-dl { font-size: 13px; }
.row-dl b { display: block; font-size: 14px; }
.row-dl .urgent { color: var(--red); }
.row-dl .small { color: var(--muted); font-size: 12px; }
.row-ctrl { display: flex; flex-direction: column; gap: 6px; }
.row-ctrl select { width: 100%; font-size: 13px; padding: 7px 10px; font-weight: 600; cursor: pointer; }

select.st-neu { background: #fff; }
select.st-in_bearbeitung { background: var(--violet-s); color: var(--violet); border-color: #d9cfff; }
select.st-beworben { background: var(--green-s); color: var(--green); border-color: #bfe8d3; }
select.st-nicht_interessant { background: var(--gray-s); color: var(--muted); }
select.need { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-s); }

.fit { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.fit .dots { display: inline-flex; gap: 3px; }
.fit i { width: 8px; height: 8px; border-radius: 50%; background: #e2dfd7; display: inline-block; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--gray-s); color: var(--muted); white-space: nowrap; }
.pill.amber { background: var(--amber-s); color: var(--amber); }
.pill.blue { background: var(--blue-s); color: var(--blue); }
.pill.violet { background: var(--violet-s); color: var(--violet); }
.pill.green { background: var(--green-s); color: var(--green); }
.pill.red { background: var(--red-s); color: var(--red); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.footnote { color: var(--muted); font-size: 12.5px; margin-top: 22px; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(29, 36, 51, .28); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(740px, 100vw); z-index: 31; background: var(--bg);
  transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,.12);
}
.drawer.open { transform: none; }
.d-head { background: #fff; padding: 22px 26px 18px; border-bottom: 1px solid var(--line); position: relative; }
.d-close { position: absolute; top: 14px; right: 14px; border: 0; background: var(--gray-s); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--muted); }
.d-title { font-size: 21px; font-weight: 800; letter-spacing: -.015em; margin: 8px 40px 4px 0; line-height: 1.3; }
.d-orig { color: var(--muted); font-size: 12.5px; font-style: italic; }
.d-sub { color: var(--muted); margin-top: 2px; }
.d-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.d-body { padding: 18px 26px 48px; display: flex; flex-direction: column; gap: 14px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.panel p { margin: 0 0 8px; }
.lead { font-size: 15.5px; font-weight: 500; line-height: 1.55; }
.work { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.work label { font-size: 12px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 3px; }
.work select, .work textarea { width: 100%; }
.work .full { grid-column: 1 / -1; }
.work textarea { resize: vertical; min-height: 42px; }
.saved { font-size: 12px; color: var(--faint); margin-top: 6px; min-height: 18px; }

.procon { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.procon > div { border-radius: 14px; padding: 12px 14px; }
.procon ul { margin: 4px 0 0; padding-left: 18px; }
.procon li { margin-bottom: 3px; }
.callout { margin-top: 12px; background: var(--amber-s); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.facts > div { background: var(--soft); border-radius: 12px; padding: 9px 12px; }
.facts small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.facts b { font-weight: 600; word-break: break-word; }
.crit { margin-bottom: 12px; }
.crit-row { display: flex; justify-content: space-between; gap: 10px; }
.crit-name { font-weight: 700; }
.crit-w { color: var(--faint); font-size: 12px; font-weight: 500; }
.bar { height: 7px; background: var(--gray-s); border-radius: 6px; margin: 5px 0; overflow: hidden; }
.bar > div { height: 100%; border-radius: 6px; background: var(--blue); }
.why { color: var(--muted); font-size: 13px; }
blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--blue); background: var(--soft); border-radius: 0 8px 8px 0; font-size: 13.5px; }
.sub-h { font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.sub-h:first-child { margin-top: 0; }
ul.plain { margin: 0; padding-left: 18px; }
.taglist { display: flex; gap: 6px; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; }
pre.raw { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: var(--muted); margin: 10px 0 0; max-height: 360px; overflow: auto; }
.fb { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fb .btn.on { border-color: var(--blue); background: var(--blue-s); color: var(--blue); }

/* Team dialog */
.dlg { border: 0; border-radius: 20px; padding: 22px 24px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.dlg::backdrop { background: rgba(29, 36, 51, .3); }
.dlg h3 { margin: 0 0 4px; }
.team-list { list-style: none; padding: 0; margin: 14px 0; }
.team-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--soft); border-radius: 10px; margin-bottom: 6px; font-weight: 600; }
.team-list button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.team-form { display: flex; gap: 8px; }
.team-form input { flex: 1; }

@media (max-width: 860px) {
  .topbar { padding: 10px 16px; }
  .brand-sub { display: none; }
  .top-actions .lbl { display: none; }
  .container { padding: 16px 16px 48px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .row-ctrl { flex-direction: row; }
  .row-ctrl select { flex: 1; min-width: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .procon, .work { grid-template-columns: 1fr; }
  .d-head, .d-body { padding-left: 16px; padding-right: 16px; }
  .toolbar select { flex: 1; }
}

/* Login and invite pages */
input[type=email], input[type=password] {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; outline: none;
}
.auth-body { background: var(--bg); }
.auth {
  min-height: 100vh; min-height: 100dvh; box-sizing: border-box; padding: 48px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.auth-brand { font-weight: 800; font-size: 20px; letter-spacing: -.03em; margin-bottom: 28px; }
.auth-brand .accent { color: var(--blue); }
.auth-brand-sep { color: var(--faint); font-weight: 500; margin: 0 8px; }
.auth-brand-org { color: var(--muted); font-weight: 600; letter-spacing: -.01em; }
.auth-card {
  width: 100%; max-width: 380px; box-sizing: border-box; padding: 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(29, 36, 51, .04), 0 8px 24px rgba(29, 36, 51, .06);
}
.auth-card h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-card .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.auth-card label { font-weight: 600; font-size: 13px; }
.auth-card input {
  width: 100%; box-sizing: border-box; height: 42px; padding: 0 12px; font-size: 14.5px;
  border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.auth-card input::placeholder { color: var(--faint); }
.auth-card input[readonly] { background: var(--soft); color: var(--muted); }
.field-hint { color: var(--faint); font-size: 12px; }
.auth-card .btn { width: 100%; height: 42px; justify-content: center; margin-top: 8px; border-radius: 10px; font-size: 14.5px; }
.auth-error {
  display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 16px; padding: 10px 12px; border-radius: 10px;
  background: var(--red-s); color: #b4232a; border: 1px solid #f6c9cb; font-weight: 600; font-size: 13.5px; line-height: 1.45;
}
.auth-error::before { content: "⚠"; flex: none; }
.auth-invalid:not(:has(> .auth-error:not([hidden]))) { display: none; }
.auth-invalid .auth-error { margin-bottom: 0; }
.auth-hint { max-width: 380px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.6; margin: 20px 0 0; }

/* Access dialog (admins) */
#accessDlg { width: min(560px, calc(100vw - 32px)); }
.access-list li { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; font-weight: 500; }
.access-list .who { flex: 1 1 220px; min-width: 0; }
.access-list .who strong { display: block; font-weight: 700; overflow-wrap: anywhere; }
.access-list .who small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.access-list .tag { display: inline-block; vertical-align: 1px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--blue-s); color: var(--blue); font-size: 11px; font-weight: 700; }
.access-list .acts { display: flex; gap: 6px; flex: none; margin-left: auto; white-space: nowrap; }
/* .team-list button strips borders for the ✕ in the team dialog, so restore the button look here */
.access-list .acts .btn { border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; }
.access-list .acts .btn:hover { border-color: #d6d2c8; }
.access-list .acts .btn-danger { color: var(--red); border-color: #f6c9cb; }
.access-list .acts .btn-danger:hover { background: var(--red-s); border-color: var(--red); }
.invite-link { background: var(--blue-s); border-radius: 12px; padding: 12px; margin-top: 12px; font-size: 13px; }
.invite-link .team-form { margin-top: 8px; }
.invite-link input { font-size: 12px; min-width: 0; }

@media (max-width: 480px) {
  .auth { justify-content: flex-start; padding-top: 12vh; }
  .auth-card { padding: 24px 20px; }
  .auth-card input { font-size: 16px; } /* verhindert das automatische Zoomen auf dem iPhone */
  .dlg { padding: 18px 16px; }
  .team-form { flex-wrap: wrap; }
  .team-form input { flex: 1 1 100%; }
  .team-form .btn { flex: 1; justify-content: center; }
}

/* Zuschläge */
.filters button.tab-awards { margin-left: auto; }
.toolbar.awards .t-only, .toolbar:not(.awards) .a-only { display: none; }
.row.award-row { grid-template-columns: minmax(0, 1fr) 260px; }
.row.award-row.ext { cursor: alias; }
.winner { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.winner b { font-weight: 700; }
.winner .amt { color: var(--muted); white-space: nowrap; }
.winner .fw-note { color: var(--muted); }
.award-side { font-size: 13px; }
.award-side b { display: block; font-size: 14px; }
.award-side .small { color: var(--muted); font-size: 12px; }
.winner b.rival { color: var(--red); }
/* Mitbewerber-Übersicht */
.btn.on { border-color: var(--blue); background: var(--blue-s); color: var(--blue); }
.toolbar.rivals #q, .toolbar.rivals #awardSort, .toolbar.rivals #rival, .toolbar.rivals label.toggle { display: none; }
.rival-intro { margin: 0 0 12px; font-size: 13px; }
.rival-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.rival-card.none { opacity: .6; }
.rival-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rival-head h3 { margin: 0; font-size: 16px; }
.rival-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 4px; }
.rival-kpis b { display: block; font-size: 17px; }
.rival-kpis span { color: var(--muted); font-size: 12px; }
.rival-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
.rival-lists ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.rival-lists li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.rival-lists li span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .rival-kpis, .rival-lists { grid-template-columns: minmax(0, 1fr); } }
.panel.won { border-color: #bfe8d3; background: var(--green-s); }
.panel.won h3 { color: var(--green); }
.won-item + .won-item { border-top: 1px solid #bfe8d3; margin-top: 10px; padding-top: 10px; }
.won-lot { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.won-vendor { font-size: 16px; font-weight: 700; }
.won-meta { font-size: 13px; color: #3d4556; margin-top: 2px; }
@media (max-width: 760px) {
  .filters button.tab-awards { margin-left: 0; }
  .row.award-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
.award-row .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.award-row .row-meta span, .winner span { min-width: 0; overflow-wrap: anywhere; }

/* Prüfrunde: page for the customer (/pruefung) */
.pr { max-width: 860px; }
.pr-intro h1 { font-size: 21px; letter-spacing: -.015em; margin: 0 0 8px; line-height: 1.3; }
.pr-intro p { margin: 0 0 6px; }
.pr-progress { padding: 7px 13px; border-radius: 99px; background: var(--blue-s); color: var(--blue); font-weight: 700; font-size: 13px; white-space: nowrap; }
.pr-progress.done { background: var(--green-s); color: var(--green); }
.pr-note { margin: -4px 0 14px; font-size: 13px; }
.pr .list { gap: 14px; }
.pr-card { display: flex; flex-direction: column; gap: 8px; }
.pr-card .row-top { margin: 0; }
.pr-nr { font-weight: 800; color: var(--faint); font-size: 13px; min-width: 18px; }
.pr-title { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.01em; }
.pr-sum { margin: 2px 0 0; font-size: 14px; color: #3d4556; }
.pr-what small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.pr-won { background: var(--green-s); border: 1px solid #bfe8d3; border-radius: 12px; padding: 8px 12px; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.pr-won-item { display: flex; gap: 8px; }
.pr-won b.rival { color: var(--red); }
.pr-link { font-size: 13px; font-weight: 600; text-decoration: none; align-self: flex-start; }
.pr-q { font-weight: 700; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pr-answer { display: flex; flex-direction: column; gap: 8px; }
.pr-judge { display: flex; gap: 8px; flex-wrap: wrap; }
.pr-j { flex: 1 1 140px; justify-content: center; }
.pr-j-ja.on { background: var(--green-s); border-color: var(--green); color: var(--green); }
.pr-j-teilweise.on { background: var(--amber-s); border-color: var(--amber); color: var(--amber); }
.pr-j-nein.on { background: var(--gray-s); border-color: var(--muted); color: var(--ink); }
.pr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-chip { border: 1px dashed #d6d2c8; background: #fff; border-radius: 99px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.pr-chip:hover { border-color: var(--blue); color: var(--blue); }
.pr-why { width: 100%; resize: vertical; min-height: 42px; }
.pr-voice { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pr-audio { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pr-audio audio { height: 34px; max-width: 100%; }
.pr-rec.on { background: var(--red-s); border-color: var(--red); color: var(--red); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(229, 72, 77, .12); } }
.pr-transcript { font-size: 13px; color: #3d4556; font-style: italic; }
.pr .saved { margin: 0; }
.pr-general { margin-top: 18px; }
.pr-general .muted { font-size: 13px; }
.pr-row { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.pr-row summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; color: var(--ink); font-weight: 500; }
.pr-row summary::-webkit-details-marker { display: none; }
.pr-row[open] summary { border-bottom: 1px solid var(--line); }
.pr-row-main { flex: 1; min-width: 0; }
.pr-row-main b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.pr-row-main small { color: var(--muted); font-size: 12px; }
.pr-row-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.pr-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #d6d2c8; flex: none; }
.pr-dot.on { background: var(--green); border-color: var(--green); }
.pr-row-body { padding: 12px 14px 14px; }
.pr-card.inline { gap: 8px; }
@media (max-width: 560px) {
  .pr-row summary { flex-wrap: wrap; }
  .pr-row-tags { justify-content: flex-start; padding-left: 20px; }
  .pr-why { font-size: 16px; }
}

/* Prüfrunden: admin page (/pruefrunden) */
.pa { max-width: 900px; display: flex; flex-direction: column; gap: 14px; }
.pa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.pa-rounds { display: flex; flex-direction: column; gap: 10px; }
.pa-round { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--soft); }
.pa-round.next { background: #fff; border-style: dashed; }
.pa-round-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.pa-round p { margin: 4px 0 10px; }
.pa-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.pa-kpis span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pa-kpis small { color: var(--muted); display: block; }
@media (max-width: 680px) { .pa-kpis { grid-template-columns: 1fr 1fr; } }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .topbar { gap: 8px; }
  .brand { flex: 1 1 auto; overflow: hidden; }
  .brand-title { font-size: 18px; white-space: nowrap; }
  .top-actions { gap: 6px; flex: none; }
  .top-actions .btn { padding: 0; width: 40px; height: 40px; justify-content: center; }
  .top-actions select { height: 40px; }
  .top-actions .pr-progress { padding: 7px 11px; }
  /* Filter in einer Zeile zum Wischen statt drei Zeilen Knöpfe */
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; scroll-padding: 0 16px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; white-space: nowrap; padding: 9px 14px; }
  .filters button.tab-awards { margin-left: 0; }
  /* Detailansicht: Schliessen bleibt beim Scrollen sichtbar */
  .drawer.open .d-close { position: fixed; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
}
@media (max-width: 560px) {
  /* iPhone zoomt bei Feldern unter 16 px ungefragt hinein */
  input, select, textarea { font-size: 16px; }
  .toolbar { gap: 6px; }
  .toolbar label.toggle { padding: 4px 0; }
  .row { padding: 14px; border-radius: 16px; }
  .row-ctrl select { padding: 9px 10px; }
  .panel { padding: 16px; }
  .d-actions .btn { flex: 1 1 auto; justify-content: center; }
  /* Prüfrunde: drei Antworten nebeneinander, gut zu treffen */
  .pr-intro h1 { font-size: 19px; }
  .pr-judge { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pr-j { flex: none; min-height: 52px; padding: 8px 4px; font-size: 13px; line-height: 1.2; text-align: center; white-space: normal; }
  .pr-chip { padding: 8px 13px; font-size: 13.5px; }
  .pr-rec, .pr-audio .btn { min-height: 40px; }
  .pr-title { font-size: 16px; }
  .pr-row summary { padding: 12px; }
  .pa-round .d-actions .btn { width: 100%; }
}
/* lange Stichworte umbrechen statt die Seite zu verbreitern */
.pr-what .pill, .pr-row-tags .pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.pr-card, .pr-row { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Handy, Runde 2 (nach Test mit Screenshots) ---------- */
.m-only { display: none; }
.btn.on { border-color: var(--blue); background: var(--blue-s); color: var(--blue); }
/* gewählte Antwort "Nicht interessant" muss klar erkennbar sein */
.pr-j-nein.on { background: var(--red-s); border-color: var(--red); color: #b4232a; }
/* Prüfrunde: lange Texte gekürzt, ein Tipp zeigt alles */
.pr-sum.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pr-more { align-self: flex-start; border: 0; background: none; color: var(--blue); font-weight: 600; padding: 4px 0; cursor: pointer; font-size: 13.5px; }
.pr-what:not(.all) .pill.extra { display: none; }
.pr-more-pill { border: 1px dashed #d6d2c8; background: #fff; color: var(--blue); cursor: pointer; }
.pr-link { padding: 6px 0; }

@media (max-width: 560px) {
  /* Liste: Suche + Filter-Knopf; die Auswahlfelder erst nach Tipp auf "Filter" */
  .m-only { display: inline-flex; }
  .toolbar { flex-wrap: wrap; }
  .toolbar #q { flex: 1 1 0; min-width: 0; }
  #filterBtn { flex: none; min-height: 44px; }
  .toolbar:not(.open) > select, .toolbar:not(.open) > label.toggle { display: none !important; }
  .toolbar.open > select { flex: 1 1 calc(50% - 6px); min-height: 44px; }
  .toolbar #rivalView { flex: 1 1 100%; justify-content: center; min-height: 44px; }
  .toggle input { width: 20px; height: 20px; }
  .toggle { min-height: 44px; }
  /* Karten: Status und Person untereinander, nichts abgeschnitten, kein iPhone-Zoom */
  .row-ctrl { flex-direction: column; gap: 6px; }
  .row-ctrl select { width: 100%; min-height: 44px; font-size: 16px; }
  /* Detailansicht */
  .drawer.open .d-close { background: #fff; border: 1px solid var(--line); width: 44px; height: 44px; font-size: 22px; color: var(--ink); box-shadow: 0 4px 14px rgba(29, 36, 51, .16); }
  .d-head { padding-right: 64px; }
  .d-actions .btn, .fb .btn { min-height: 44px; }
  .fb .btn { padding: 0 18px; }
  .work select, .work textarea { min-height: 44px; }
  /* Dialoge */
  #teamList button { width: 40px; height: 40px; display: grid; place-items: center; }
  .access-list .acts .btn, .dlg .btn { min-height: 42px; }
  /* Mitbewerber-Übersicht: Kennzahlen nebeneinander */
  .rival-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rival-kpis b { font-size: 15px; }
  .rival-head .btn { min-height: 40px; }
  /* Prüfrunde */
  .pr-intro p { font-size: 14px; }
  .pr-row summary { flex-wrap: wrap; }
  .pr-row-main { flex: 1 1 calc(100% - 24px); }
  .pr-row-tags { flex: 1 1 100%; justify-content: flex-start; padding-left: 20px; }
  .pr-what .pill { font-size: 12px; }
  .pa-round .btn, .pa .btn { min-height: 44px; }
}
@media (max-width: 560px) {
  .pr-more, .pr-link { padding: 10px 0; }
  .pr-more-pill { padding: 9px 12px; }
  .panel details > summary { padding: 10px 0; }
}
@media (max-width: 560px) {
  /* Suche behält ihre Zeile, die Auswahlfelder kommen darunter */
  .toolbar #q { flex: 1 1 calc(100% - 110px); }
  .toolbar.rivals #filterBtn { display: none; }
  /* Zugänge: Knöpfe unter die Adresse statt rechts abgeschnitten */
  .access-list .acts { flex: 1 1 100%; justify-content: flex-end; margin-left: 0; }
}

/* Menü oben: auf dem Computer eine Knopfreihe wie bisher, auf dem Handy hinter ☰ */
.top-menu { display: contents; }
.m-menu { display: none; }
#teamBtn { order: 1; } #accessBtn { order: 2; } #pruefBtn { order: 3; } #runBtn { order: 4; } #logoutBtn { order: 5; }
@media (max-width: 860px) {
  .top-actions { position: relative; }
  #runBtn { order: 0; }
  .m-menu { display: inline-flex; order: 1; font-size: 18px; }
  .top-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; flex-direction: column; gap: 2px;
    min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(29, 36, 51, .16); }
  .top-actions.open .top-menu { display: flex; }
  .top-actions.open .m-menu { background: var(--gray-s); }
  .top-actions .top-menu .btn { width: 100%; height: 46px; padding: 0 12px; justify-content: flex-start; gap: 10px; border: 0; border-radius: 10px; font-size: 15px; }
  .top-actions .top-menu .btn:hover, .top-actions .top-menu .btn:active { background: var(--soft); }
  .top-actions .top-menu .lbl { display: inline; }
  .brand-title { font-size: 19px; }
}
@media (max-width: 860px) {
  /* Unterlängen (g, j) nicht abschneiden: kein Beschneiden mehr nötig, seit die Knöpfe im Menü sind */
  .brand { overflow: visible; }
  .brand-title { line-height: 1.35; padding-bottom: 1px; }
}
