/* ==========================================================================
   Design v2 – ruhig, kompakt, dunkel zuerst (folgt dem Betriebssystem).
   Variablennamen bleiben kompatibel zu den JS-Dateien (--card, --ink, --mute, --soft, --brand …).
   Button-System:  .primary = Hauptaktion (eine je Bereich, am Ende der Reihe)
                   button / .btn = Sekundär   .ghost = Nebenweg   .danger = löschend, abgesetzt
   ========================================================================== */
:root {
  --bg:#0e1118; --card:#171b25; --soft:#1c212d; --side:#12151d;
  --ink:#f1f3f8; --mute:#9aa3b5; --line:#262c3a; --line2:#343c4e;
  --brand:#ff7a3d; --brand-ink:#0e1118; --brand-soft:rgba(255,122,61,.14);
  --good:#3ecf8e; --bad:#ff6b6b; --warn:#f5b83d; --blue:#5aa9ff;
  --scrim:rgba(5,7,11,.62); --radius:14px; --shadow:none;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:#eef0f4; --card:#ffffff; --soft:#f1f3f8; --side:#ffffff;
    --ink:#12151c; --mute:#55607a; --line:#dde1ea; --line2:#c3c9d6;
    --brand:#c2410c; --brand-ink:#ffffff; --brand-soft:#fdeee6;
    --good:#13804f; --bad:#c92a2a; --warn:#a86400; --blue:#1c64c8; --scrim:rgba(20,24,35,.45);
  }
}
:root[data-theme="light"] {
  --bg:#eef0f4; --card:#ffffff; --soft:#f1f3f8; --side:#ffffff;
  --ink:#12151c; --mute:#55607a; --line:#dde1ea; --line2:#c3c9d6;
  --brand:#c2410c; --brand-ink:#ffffff; --brand-soft:#fdeee6;
  --good:#13804f; --bad:#c92a2a; --warn:#a86400; --blue:#1c64c8; --scrim:rgba(20,24,35,.45);
}
* { box-sizing: border-box; }
html { color-scheme: dark light; }
:root[data-theme="light"] { color-scheme: light; } :root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 .35rem; }
h2 { font-size: 1.1rem; letter-spacing: -.01em; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
.muted { color: var(--mute); } .small { font-size: .85rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout Mitarbeiter-Seite ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 40px; }
.wrap.home { max-width: 1040px; }
.wrap.wide { max-width: 1180px; }
.topbar { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.topbar .in { max-width: 1040px; margin: 0 auto; padding: 6px max(16px, env(safe-area-inset-left)); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.topbar a { color: var(--mute); text-decoration: none; padding: 8px 6px; border-radius: 8px; font-size: .85rem; white-space: nowrap; }
.topbar a:hover { color: var(--ink); }
.topbar .brand, .brand { font-weight: 700; color: var(--ink); letter-spacing: .02em; font-size: 1rem; text-decoration: none; padding-left: 0; }
.brand b { color: var(--brand); }
.ico-sm { display: inline-flex; } .ico-sm svg { width: 18px; height: 18px; } .ico-sm.ok { color: var(--good); }
.themebtn { gap: 6px; padding: 0 8px; } .themebtn svg { width: 16px; height: 16px; } .topbar .themebtn { color: var(--mute); } .topbar .themebtn:hover { color: var(--ink); }
.themebtn.wide { width: 100%; justify-content: flex-start; padding: 0 12px; min-height: 38px; } .mtop > .themebtn { margin-left: auto; margin-right: 4px; }
@media (max-width: 640px) { .topbar .themebtn .tl, .mtop .themebtn .tl { display: none; } }
.topbar .sp { flex: 1; }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .72rem; font-weight: 700; text-align: center; }
.hero { padding: 14px 0 12px; }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.25rem); margin-bottom: 4px; }
.hero p { margin: 0; }

/* ---------- Karten, Raster ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 0 0 16px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .sp { flex: 1; }
.row { display: flex; gap: 14px; align-items: flex-start; } .row > .grow { flex: 1; min-width: 0; }
.sec { display: flex; align-items: center; gap: 12px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); margin: 0 0 10px; }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Startseite: Feedback-Kacheln + Nachschauen-Zone ---------- */
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grp { font-size: .78rem; color: var(--mute); margin: 0 0 0 2px; }
.tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.tile:hover, .tile:focus-visible { border-color: var(--brand); outline: none; }
.tile:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.tile .ico, .look .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.tile .ico svg, .look .ico svg { width: 20px; height: 20px; }
.tile .t { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; }
.tile h2 { margin: 0; font-size: 1rem; } .tile p { margin: 2px 0 0; color: var(--mute); font-size: .84rem; line-height: 1.35; }
.chev { display: grid; color: var(--mute); } .chev svg { width: 16px; height: 16px; }
.mark-anon, .mark-name { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; }
.mark-anon { color: var(--brand); } .mark-name { color: var(--mute); font-weight: 500; }
.mark-anon svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.hero > a.small { color: var(--mute); font-weight: 600; text-decoration: none; display: inline-block; min-height: 28px; } .hero > a.small:hover { color: var(--ink); }
.gap { height: 26px; display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: .74rem; letter-spacing: .04em; }
.zone { background: var(--side); border: 1px dashed var(--line2); border-radius: 20px; padding: 14px 16px 16px; }
.look { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; min-width: 0; }
a.look:hover { border-color: var(--brand); }
.look h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1rem; }
.look h2 .ico { width: 30px; height: 30px; border-radius: 8px; } .look h2 .ico svg { width: 17px; height: 17px; }
.look h2 .chev { margin-left: auto; }
.nums { display: flex; gap: 20px; margin-top: auto; }
.nums div { display: flex; align-items: baseline; gap: 6px; font-size: .72rem; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.nums b { font-size: 1.6rem; line-height: 1; letter-spacing: -.03em; color: var(--ink); text-transform: none; font-variant-numeric: tabular-nums; }
.nums div:nth-child(1) b { color: var(--brand); } .nums div:nth-child(2) b { color: var(--warn); } .nums div:nth-child(3) b { color: var(--good); }
.stack { display: flex; height: 5px; border-radius: 99px; overflow: hidden; gap: 3px; } .stack i { display: block; border-radius: 99px; }
.look .help { margin: 0; }
.codebox { display: flex; gap: 8px; margin-top: auto; }
.codebox input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.codebox input::placeholder { font-family: inherit; letter-spacing: 0; text-transform: none; }
.foot { display: flex; gap: 8px 16px; justify-content: space-between; flex-wrap: wrap; margin: 12px 2px 0; font-size: .78rem; color: var(--mute); }
.foot span { display: flex; gap: 6px; align-items: center; } .foot svg { width: 14px; height: 14px; flex: none; }
.foot a, .sitefoot a { color: var(--mute); text-decoration: none; } .foot a:hover, .sitefoot a:hover { color: var(--ink); }
.sitefoot { display: flex; gap: 8px 12px; justify-content: center; font-size: .78rem; color: var(--mute); padding-top: 4px; padding-bottom: 16px; }
.l-m { display: none; }

/* ---------- Buttons ---------- */
button, .btn { font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); padding: 0 16px; min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: border-color .15s, background .15s; }
button:hover, .btn:hover { border-color: var(--brand); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.danger, .btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; color: var(--mute); padding: 0 10px; }
button.ghost:hover, .btn.ghost:hover { color: var(--ink); background: var(--soft); border-color: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; } button:disabled:hover { border-color: var(--line2); }
button.primary:disabled:hover { border-color: var(--brand); }
button svg, .btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.sm, button.sm { min-height: 34px; padding: 0 12px; font-size: .84rem; }
/* Hauptaktion steht in jeder Reihe zuletzt (rechts) */
.flex > button.primary, .flex > .btn.primary { order: 90; }

/* ---------- Formulare ---------- */
label.f, div.f { display: block; margin: 0 0 16px; }
label.f > .q, .q { font-weight: 600; font-size: .88rem; display: block; margin-bottom: 2px; } .req { color: var(--brand); }
.help { color: var(--mute); font-size: .84rem; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; min-height: 42px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: var(--mute); }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
/* Einzelne Ja/Nein-Haken werden zu Schaltern (Optionskarten .opt haben ihr eigenes Aussehen) */
input[type=checkbox]:not(.opt input) { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; min-height: 0; border-radius: 99px; background: var(--line2); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; vertical-align: middle; }
input[type=checkbox]:not(.opt input)::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
input[type=checkbox]:not(.opt input):checked { background: var(--brand); } input[type=checkbox]:not(.opt input):checked::after { transform: translateX(16px); }
label.flex > input[type=checkbox] { margin-right: 2px; }
.opts { display: grid; gap: 8px; } .opts.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; cursor: pointer; background: var(--card); font-weight: 500; }
.opt > span { min-width: 0; overflow-wrap: anywhere; }
.opt:hover { border-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border: 2px solid var(--line2); border-radius: 50%; background: transparent; display: grid; place-content: center; cursor: pointer; }
.opt input[type=checkbox] { border-radius: 6px; }
.opt input:checked { border-color: var(--brand); }
.opt input[type=radio]:checked::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.opt input[type=checkbox]:checked { background: var(--brand); }
.opt input[type=checkbox]:checked::before { content: ""; width: 10px; height: 6px; border: solid var(--brand-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.opts.inline { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale .opt { justify-content: center; font-weight: 700; font-size: 1.05rem; min-height: 56px; padding: 0; position: relative; }
.scale .opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale-l { display: flex; justify-content: space-between; color: var(--mute); font-size: .8rem; margin-top: 6px; }
.notice { display: block; border-left: 3px solid var(--blue); background: var(--soft); padding: 11px 14px; border-radius: 10px; font-size: .9rem; margin: 0 0 16px; }
.notice.warn { border-color: var(--warn); } .notice.bad { border-color: var(--bad); }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; }
.code { font: 700 1.7rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; background: var(--soft); border: 2px dashed var(--brand); padding: 12px 20px; border-radius: 14px; display: inline-block; user-select: all; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--soft); color: var(--mute); white-space: nowrap; }
.pill.neu { background: var(--brand-soft); color: var(--brand); } .pill.in_pruefung { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.pill.geplant { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); } .pill.erledigt { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.abgelehnt { background: var(--soft); color: var(--mute); } .pill.flag { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.steps { display: flex; gap: 6px; margin: 14px 0; } .steps div { flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--soft); font-size: .8rem; font-weight: 600; color: var(--mute); }
.steps div.on { background: var(--brand); color: var(--brand-ink); } .steps div.past { color: var(--good); }
.steps div.past::before { content: "✓ "; }
.thread { display: grid; gap: 8px; } .msg { padding: 10px 14px; border-radius: 12px; max-width: 88%; background: var(--soft); font-size: .92rem; } .msg.staff { background: var(--brand-soft); justify-self: end; } .msg .meta { font-size: .74rem; color: var(--mute); }

/* ---------- Umschalter (Segmente) ---------- */
.tabs, .seg3 { display: inline-flex; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; }
.seg3 { margin: 0; overflow: hidden; }
.tabs button, .seg3 button { border: 0; background: transparent; color: var(--mute); min-height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: .86rem; }
.tabs button:hover, .seg3 button:hover { color: var(--ink); background: transparent; }
.tabs button.on, .seg3 button.on { background: var(--brand); color: var(--brand-ink); }
.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 56px; min-height: 64px; padding: 6px; }
.vote.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } .vote b { font-size: 1.05rem; }

/* ---------- Backend: Tabellen, Kennzahlen, Balken ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
thead th, tr:first-child > th { border-top: 0; }
tbody tr:first-child td { border-top: 0; }
th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); white-space: nowrap; border-bottom: 1px solid var(--line); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--soft); }
tr.flagged td:first-child { box-shadow: inset 3px 0 var(--bad); }
.split { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; gap: 16px; align-items: start; } @media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column-reverse; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { font-size: 2.1rem; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--mute); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.bars { display: grid; gap: 10px; } .bar { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 44px; gap: 10px; align-items: center; font-size: .88rem; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bar .track { background: var(--soft); border-radius: 99px; height: 10px; overflow: hidden; } .bar .fill { height: 100%; background: var(--blue); border-radius: 99px; } .bar .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar.brand .fill { background: var(--brand); } .bar.good .fill { background: var(--good); } .bar.bad .fill { background: var(--bad); }
.qrow { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); margin-bottom: 8px; } .qrow.off { opacity: .55; }
.qrow .grow { flex: 1; min-width: 0; } .tag { font-size: .72rem; font-weight: 600; background: var(--soft); border-radius: 99px; padding: 1px 9px; color: var(--mute); }
.ans { margin: 0 0 12px; } .ans .l { font-size: .8rem; color: var(--mute); font-weight: 600; } .ans .v { white-space: pre-wrap; }
.dots { display: inline-flex; gap: 2px; vertical-align: middle; } .dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--line2); } .dots i.on { background: var(--brand); }
.note { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; background: var(--soft); } .note .meta { font-size: .78rem; color: var(--mute); display: flex; gap: 8px; }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; z-index: 80; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* ---------- Overlays: als Seitenfenster rechts, auf dem Handy bildschirmfüllend ---------- */
dialog { border: 0; border-left: 1px solid var(--line2); background: var(--bg); color: var(--ink); margin: 0 0 0 auto; width: min(560px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; padding: 20px; overflow: auto; box-shadow: -20px 0 50px rgba(0,0,0,.35); }
dialog.overlay { width: min(720px, 100%); }
dialog::backdrop { background: var(--scrim); }
/* Rückfrage-Dialog (ask() in common.js): mittig statt als Seitenfenster */
dialog.askbox { margin: auto; height: auto; max-height: 90dvh; width: min(440px, calc(100% - 32px)); border: 1px solid var(--line2); border-radius: 16px; animation: none; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: var(--card); }
dialog[open] { animation: sheetin .2s ease-out; } @keyframes sheetin { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Assistent ---------- */
.progress { height: 5px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 6px 0 12px; } .progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .25s; }
.step { animation: stepin .18s ease-out; padding: 20px; } @keyframes stepin { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.step-title { font-size: 1.4rem; line-height: 1.25; letter-spacing: -.02em; outline: none; margin-bottom: .3rem; } .step-nav { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.sum { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 0; } .sum .grow { flex: 1; min-width: 0; }
.joblist { display: grid; gap: 8px; margin-top: 10px; max-height: 52vh; overflow: auto; }
.jobopt { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; width: 100%; padding: 12px 14px; white-space: normal; font-weight: 500; border-radius: 12px; } .jobopt.on { border-color: var(--brand); background: var(--brand-soft); }
.facts { display: grid; gap: 10px; margin: 0; } .facts dt { font-size: .8rem; color: var(--mute); font-weight: 600; } .facts dd { margin: 0; white-space: pre-wrap; }
.chip { border-radius: 99px; min-height: 38px; padding: 0 14px; } .chip.on, .vote-wide.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.vote-wide { font-weight: 600; }
mark { background: color-mix(in srgb, var(--brand) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.md h2 { font-size: 1.1rem; margin: 1.4em 0 .4em; } .md h3 { margin: 1.1em 0 .3em; } .md p { margin: .5em 0; line-height: 1.6; } .md ul { margin: .4em 0; padding-left: 1.3em; } .md li { margin: .25em 0; }

/* ---------- Backend: Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; padding-bottom: 12px; align-items: start; }   /* Spalten nutzen die Breite; wenn es eng wird, umbrechen statt seitlich zu scrollen */
.kcard, .kcol { min-width: 0; overflow-wrap: anywhere; }
.kcol { background: var(--side); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; scroll-snap-align: start; } .kcol.over { border-color: var(--brand); background: var(--brand-soft); }
.kcol h3 { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 10px; font-size: .88rem; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: grab; transition: border-color .15s; } .kcard:hover { border-color: var(--brand); } .kcard:active { cursor: grabbing; } .kcard.dragging { opacity: .4; } .kcard.flagged { border-left: 3px solid var(--bad); }
.kcard:focus-visible { outline-offset: 0; }
.kcard select { min-height: 34px; padding: 4px 8px; font-size: .8rem; margin-top: 8px; }
.mini { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: .78rem; color: var(--mute); }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line2); color: var(--ink); font-size: .66rem; font-weight: 700; }
.prio { display: inline-block; padding: 0 8px; border-radius: 99px; font-weight: 700; font-size: .74rem; background: var(--soft); color: var(--mute); border: 1px solid var(--line); }
.urgent-box { border-left: 3px solid var(--bad); } .urgent-box summary { cursor: pointer; font-weight: 700; font-size: 1rem; }
.urgent-row:hover { background: var(--soft); }
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; } @media (max-width: 800px) { .help-layout { grid-template-columns: 1fr; } }
.toc { position: sticky; top: 16px; display: grid; gap: 2px; } .toc a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--mute); font-weight: 500; font-size: .9rem; } .toc a:hover { background: var(--soft); color: var(--ink); }
.manual h2 { margin-top: 28px; } .manual h3 { margin-top: 18px; } .manual kbd { background: var(--soft); border: 1px solid var(--line2); border-radius: 5px; padding: 0 5px; font-size: .85em; } .manual li { margin: 4px 0; line-height: 1.6; } .manual p { line-height: 1.6; }

/* ---------- Backend: Seitenleiste, Seitenkopf ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.side .brand { padding: 6px 12px 12px; } .side .brand small { display: block; font-weight: 500; font-size: .7rem; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.ng { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); padding: 14px 12px 6px; }
.navi { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--mute); font-weight: 500; text-decoration: none; }
.navi:hover { background: var(--soft); color: var(--ink); }
.navi.on { background: var(--brand-soft); color: var(--ink); font-weight: 600; } .navi.on svg { color: var(--brand); }
.navi svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navi .badge, .navi .chev { margin-left: auto; }
.me { border-top: 1px solid var(--line); padding: 12px 4px 0; display: flex; align-items: center; gap: 10px; font-size: .88rem; } .me span { color: var(--mute); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.main { padding: 24px clamp(16px, 3vw, 32px) 16px; max-width: none; width: 100%; min-width: 0; flex: 1; }   /* volle Browserbreite nutzen */
.mainwrap > footer { padding: 0 clamp(16px, 3vw, 32px) 24px; }
.mtop, .tabbar { display: none; }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 16px; }
.ph h1 { margin: 0; } .ph p { margin: 2px 0 0; color: var(--mute); font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions input[type=date] { width: auto; min-height: 40px; } .actions > .primary { order: 90; }
.morefilters summary { cursor: pointer; color: var(--mute); font-weight: 600; font-size: .86rem; min-height: 34px; display: flex; align-items: center; } .morefilters summary:hover { color: var(--ink); }
.main > h1:first-child { margin-top: 0; }
.is-login .side, .is-login .mtop, .is-login .tabbar { display: none; } .is-login .app { display: block; }
.moregrp { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); margin: 18px 0 6px; }
.morelist { display: grid; gap: 8px; max-width: 640px; } .morelist .navi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 56px; padding: 0 16px; }

/* ---------- Tabellen auf dem Handy als Karten (data-label setzt common.js) ---------- */
@media (max-width: 760px) {
  .card:has(> table.rt) { background: transparent; border: 0; padding: 0 !important; overflow: visible !important; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; } table.rt thead { display: none; }
  table.rt tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
  table.rt td { border: 0 !important; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: right; }
  table.rt td::before { content: attr(data-label); font-size: .72rem; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; text-align: left; flex: none; }
  table.rt td:empty { display: none; } table.rt td.rk { display: none; }
  table.rt td.tt { display: block; text-align: left; font-weight: 600; font-size: .95rem; padding-bottom: 6px; } table.rt td.tt::before { display: none; }
  table.rt tr.flagged { border-left: 3px solid var(--bad); } table.rt tr.flagged td:first-child { box-shadow: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .app { display: block; } .side { display: none; }
  .mtop { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 5; background: var(--side); border-bottom: 1px solid var(--line); padding: 6px 16px; }
  .main { padding: 16px 16px 12px; } .mainwrap > footer { padding: 0 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--side); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 10px; font-size: .72rem; font-weight: 600; color: var(--mute); text-decoration: none; }
  .tabbar a.on { color: var(--ink); background: var(--brand-soft); } .tabbar a.on svg { color: var(--brand); }
  .tabbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); font-size: .64rem; padding: 0 6px; }
  .actions { width: 100%; } .actions > button, .actions > .btn { flex: 1; }
  .is-login .tabbar { display: none; }
}
@media (max-width: 640px) {
  .urgent-row { flex-wrap: wrap; } .urgent-row > .grow { flex: 1 1 100% !important; }
  .wrap { padding-bottom: 24px; }
  .hero { padding: 12px 0 10px; } .hero .lead-long { display: none; }
  .cols2 { grid-template-columns: minmax(0, 1fr); gap: 6px; } .col { gap: 6px; } .grp { margin: 2px 0 0 2px; font-size: .72rem; }
  .tile { min-height: 54px; padding: 8px 12px; gap: 12px; border-radius: 12px; } .tile p { display: none; } .tile .ico { width: 32px; height: 32px; }
  .gap { height: 20px; font-size: .7rem; } .zone { padding: 8px; border-radius: 16px; } .zone .sec { display: none; }
  .look { padding: 8px 12px; gap: 6px; border-radius: 12px; } .look h2 { font-size: .95rem; } .look .help, .look h2 .chev { display: none; }
  a.look { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 8px; } a.look .stack { grid-column: 1 / -1; }
  .nums { margin: 0; gap: 10px; } .nums .l { display: none; } .nums b { font-size: 1.3rem; }
  form.look { padding: 6px; } form.look h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .codebox { margin-top: 0; } .l-m { display: inline; } .l-d { display: none; }
  .foot { margin-top: 6px; font-size: .72rem; justify-content: center; } .foot .priv { display: none; }
  .sitefoot { padding-bottom: 8px; }
  .step { padding: 16px; border-radius: 14px; } .step-title { font-size: 1.2rem; }
  .opts.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .opt { padding: 8px 12px; gap: 10px; font-size: .9rem; }
  .step-nav .primary { flex: 1; } .step .flex > label.small { flex: 1 1 130px; }
  .code { font-size: 1.3rem; padding: 10px 14px; }
  .steps div { font-size: .72rem; padding: 8px 2px; }
  .msg { max-width: 94%; }
  dialog { padding: 16px; border-left: 0; }
}
@media (max-width: 900px) { .filters > input[type=text] { flex: 1 1 100%; } .filters > select { flex: 1 1 calc(50% - 8px); min-width: 0; } .actions > input[type=date] { flex: 1; min-width: 0; } }
@media (max-width: 900px) { button, .btn, input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select { min-height: 44px; } .btn.sm, button.sm, .tabs button { min-height: 38px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

[hidden] { display: none !important; }   /* das hidden-Attribut soll immer gewinnen, auch gegen display:flex/grid */

/* Zusammenführen: Ablagefläche unten in der Karte, nur sichtbar, solange eine Wunsch-Karte desselben Bereichs gezogen wird */
.kcard { position: relative; }
.mergezone { display: none; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 34px; align-items: center; justify-content: center; text-align: center; font-size: .78rem; font-weight: 600; border: 2px dashed var(--brand); border-radius: 8px; background: var(--card); color: var(--brand); z-index: 2; }
.kanban[data-drag="equipment"] .kcard[data-mod="equipment"]:not(.dragging) .mergezone, .kanban[data-drag="tool"] .kcard[data-mod="tool"]:not(.dragging) .mergezone { display: flex; }
.mergezone.over { background: var(--brand); color: var(--brand-ink, #fff); }
.mention-pop { position: fixed; z-index: 9999; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 4px; min-width: 180px; max-width: 280px; }
.mention-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; min-height: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.mention-pop button[aria-selected=true], .mention-pop button:hover { background: var(--brand); color: var(--brand-ink); }

.askbox { border: 0; border-radius: 14px; padding: 20px 22px; max-width: min(460px, 92vw); box-shadow: 0 12px 48px rgba(0,0,0,.4); background: var(--card); color: var(--ink, inherit); } .askbox::backdrop { background: rgba(0,0,0,.45); }

/* lange Knopftexte umbrechen, damit nichts seitlich übersteht */
button, .btn { max-width: 100%; white-space: normal; }
.badge { white-space: nowrap; }

/* Administration: Untermenü und Kategorie-Leiste */
.subnav { display: grid; gap: 1px; margin: 0 0 4px 18px; padding-left: 10px; border-left: 2px solid var(--line); }
.navi.sub { min-height: 34px; padding: 0 10px; font-size: .86rem; }
.morelist .navi.sub { margin-left: 22px; min-height: 46px; background: transparent; border-style: dashed; }
.admintabs { margin: 0 0 12px; }

/* Eingeschränktes Feedback (nicht freigegeben): geschwärzt */
.redacted { background: var(--ink, #222); color: transparent; border-radius: 4px; user-select: none; letter-spacing: .1em; }
.kcard.restricted, tr.restricted { opacity: .8; cursor: not-allowed; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(127,127,127,.08) 8px 16px); }
.kcard.restricted { cursor: not-allowed; }

/* Detailansicht im Eingang: einklappbare Bereiche */
.ovsec { border-top: 1px solid var(--line); }
.ovsec > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 2px; font-weight: 700; list-style: none; user-select: none; }
.ovsec > summary::-webkit-details-marker { display: none; }
.ovsec > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 4px 0 2px; }
.ovsec[open] > summary::before { transform: rotate(45deg); }
.ovsec > summary:hover { color: var(--brand); }
.ovsec > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.ovsec .ovt { flex: 1; }
.ovsec > .ovb { padding: 2px 2px 16px; }
.ovsec .pbbox, .ovsec .jobassign { border: 0; background: none; padding: 0; margin: 0; }
.ovsecs { margin-top: 10px; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .ovsec > summary::before { transition: none; } }

.navi .badge { flex: none; padding: 0 7px; font-size: .72rem; white-space: nowrap; }

/* Kundenseite (/k/…) und Kundenfeedback im Backend */
.kwrap { max-width: 640px; }
.kunde .topbar .brand { font-weight: 700; }
.nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.opts.inline:has(.npsb) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.npsb { min-height: 44px; padding: 0; border: 1px solid var(--line2); background: var(--card); color: var(--ink); border-radius: 10px; font-weight: 700; cursor: pointer; }
.npsb:hover { border-color: var(--brand); }
.npsb.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.npsl { display: flex; justify-content: space-between; margin-top: 6px; }
.qnote { margin-top: 8px; }
.knav { justify-content: space-between; margin-top: 16px; }
.knav > button.primary { order: 0; margin-left: auto; }
.pill.draft, .pill.suspended { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.pill.approved, .pill.sent { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.pill.answered { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.expired, .pill.skipped { background: var(--soft); color: var(--mute); }
@media (max-width: 520px) { .nps { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tabs button.on .badge { background: var(--brand-ink); color: var(--brand); }   /* Zähler im aktiven Reiter bleibt lesbar */
