:root {
  --navy: #12263a; --navy2: #1d3a56; --accent: #f08a24; --accent-d: #d97412;
  --bg: #f3f5f8; --card: #fff; --ink: #14202b; --muted: #5d6b79; --line: #dfe4ea;
  --green: #1c8f4d; --green-bg: #e3f5ea; --red: #c93636; --red-bg: #fde8e8;
  --amber: #a86400; --amber-bg: #fff1d6; --grey-bg: #e9edf1;
  --r: 14px; --shadow: 0 1px 2px rgba(18, 38, 58, .06), 0 4px 14px rgba(18, 38, 58, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.15rem; margin: 22px 2px 10px; }
h2 small { color: var(--muted); font-weight: 500; }
h3 { font-size: 1.02rem; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); font-size: .92rem; }
.badtext { color: var(--red) !important; }

/* Rahmen */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.top h1 { flex: 1; font-size: 1.08rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .logo { width: 30px; height: 30px; border-radius: 8px; }
.iconbtn { display: grid; place-items: center; width: 40px; height: 40px; margin: -4px 0 -4px -8px; border-radius: 10px; }
.sync { font-size: .78rem; padding: 4px 10px; border-radius: 99px; white-space: nowrap; font-weight: 600; }
.sync.ok { background: rgba(255, 255, 255, .13); }
.sync.ok::before { content: "● "; color: #5fdc93; }
.sync.warn { background: var(--accent); color: #1b1203; }
.sync.off { background: #fff; color: var(--navy); }
.main { max-width: 820px; margin: 0 auto; padding: 14px 14px 110px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; font-size: .74rem; font-weight: 600; color: var(--muted); position: relative; }
.nav a.on { color: var(--navy); }
.nav a.on .ic { stroke: var(--accent-d); }
.nav i { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #1b1203; font: 700 .7rem/18px system-ui; text-align: center; }
@media (min-width: 900px) {
  .nav { top: 0; bottom: 0; right: auto; width: 210px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 76px 12px 12px; border-top: 0; border-right: 1px solid var(--line); z-index: 4; }
  .nav a { flex: none; flex-direction: row; gap: 12px; padding: 12px 14px; font-size: .95rem; border-radius: 10px; }
  .nav a.on { background: var(--bg); }
  .nav i { position: static; margin-left: auto; }
  .main { margin-left: max(210px, calc(50% - 410px + 105px)); padding-bottom: 40px; }
  .sticky { position: static !important; }
}

/* Bausteine */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 4px; }
.cardhead { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.cardhead p { color: var(--muted); font-size: .93rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2, .grid3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1.4fr .8fr 1fr; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: inherit; width: 100%; min-height: 48px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
textarea { min-height: 0; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(29, 58, 86, .15); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font: inherit; font-weight: 650; cursor: pointer; text-align: center; }
.btn:hover { border-color: #c3ccd6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1b1203; }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.big { min-height: 56px; font-size: 1.05rem; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .88rem; white-space: nowrap; }
.btn.danger { color: var(--red); border-color: transparent; background: transparent; }
.btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px; font: inherit; font-size: .88rem; color: var(--navy2); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.actions .btn { flex: 1 1 180px; }
.actions .big { flex-basis: 100%; }
.sticky { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 3; padding: 10px 0 2px; background: linear-gradient(transparent, var(--bg) 22%); }
.linkrow { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.card > .btn + .btn { margin-top: 8px; }
.card > .btn { width: 100%; }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.toolbar input { flex: 1; }
.chips { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.hint { font-size: .86rem; color: var(--muted); }
.more { display: block; padding: 12px 4px; font-weight: 650; color: var(--navy2); }

/* Listen */
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list.flat { box-shadow: none; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; }
.row:last-child { border-bottom: 0; }
a.row:hover, button.row:hover { background: #f8fafb; }
button.row { cursor: pointer; }
.row > div { flex: 1; min-width: 0; }
.row b { display: block; overflow-wrap: break-word; hyphens: auto; }
.row small { display: block; color: var(--muted); font-size: .84rem; }
.row > .ic { color: #a9b3be; width: 18px; }
.nr { flex: none; min-width: 38px; height: 38px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: var(--grey-bg); font-weight: 700; font-size: .9rem; }
.badge { flex: none; padding: 4px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; background: var(--grey-bg); color: #3c4855; }
.b-na { background: var(--grey-bg); color: #3c4855; }
.b-ok { background: var(--green-bg); color: #116236; }
.b-faellig { background: var(--amber-bg); color: var(--amber); }
.b-ueberfaellig, .b-gesperrt { background: var(--red-bg); color: #9d2222; }
.pick .box { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid #b8c2cd; display: grid; place-items: center; color: transparent; }
.pick.on { background: #fff8ee; }
.pick.on .box { background: var(--accent); border-color: var(--accent); color: #1b1203; }
.pick .box .ic { width: 18px; height: 18px; stroke-width: 3; }

/* Start */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 2px 12px; }
.hero p { font-size: 1.25rem; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--navy); color: #fff; border-radius: var(--r); padding: 14px 12px; display: flex; flex-direction: column; }
.tile b { font-size: 1.9rem; line-height: 1.1; }
.tile span { font-size: .82rem; opacity: .85; }
.tile.alert { background: var(--accent); color: #1b1203; }
.notice { display: block; padding: 12px 14px; border-radius: 12px; background: #e8eef5; margin-bottom: 14px; font-size: .93rem; }
.notice.good { background: var(--green-bg); color: #0e4f2b; }
.notice.bad { background: var(--red-bg); color: #7e1b1b; }
.notice.warn { background: var(--amber-bg); color: #6b4100; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice code { display: block; margin: 8px 0; padding: 8px; background: #fff; border-radius: 8px; font-size: .8rem; word-break: break-all; }
.empty { text-align: center; padding: 34px 18px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 14px; }
.empty p { color: var(--muted); margin: 6px auto 16px; max-width: 420px; }

/* Prüfung */
.progress { height: 10px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; margin-bottom: 8px; }
.progress div { height: 100%; background: var(--green); border-radius: 99px; transition: width .2s; }
.checks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.check { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; border-left: 6px solid #c5ced8; }
.check.ok { border-left-color: var(--green); }
.check.mangel { border-left-color: var(--red); }
.check.nz { border-left-color: #7c8894; }
.check p { font-weight: 600; margin-bottom: 10px; }
.check textarea { margin-top: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.seg.two { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.seg button { min-height: 50px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 650; font-size: .92rem; cursor: pointer; color: var(--ink); }
.seg .ok.on { background: var(--green); border-color: var(--green); color: #fff; }
.seg .mangel.on { background: var(--red); border-color: var(--red); color: #fff; }
.seg .nz.on { background: #55616d; border-color: #55616d; color: #fff; }
.inline { display: flex; gap: 8px; flex: 1 1 100%; }
.inline input { flex: 1; }
.sigwrap { position: relative; }
.sig { display: block; width: 100%; height: 170px; border: 2px dashed #aab5c1; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.sigwrap .link { position: absolute; right: 8px; top: 6px; }
.done { text-align: center; }
.bigcheck { width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.bigcheck .ic { width: 34px; height: 34px; stroke-width: 3; }
.logorow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logorow img { max-height: 56px; max-width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: linear-gradient(160deg, var(--navy), #0b1826); }
.authcard { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 26px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.authlogo { width: 54px; height: 54px; border-radius: 14px; }
.brand { font-weight: 700; color: var(--muted); margin: 6px 0 14px; letter-spacing: .02em; }
.authcard h1 { font-size: 1.5rem; margin-bottom: 10px; }
.lead { color: var(--muted); margin-bottom: 14px; }
.authcard .hint { margin-top: 14px; }
.authcard .notice { margin-bottom: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.toast.good { background: #14713c; }
.toast.bad { background: #a72626; }

/* QR, Scannen, Messwerte */
.qrrow { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.qr { width: 132px; flex: none; }
.qr svg { width: 100%; height: auto; display: block; }
.qrrow .stack { flex: 1 1 200px; }
.coderow { display: flex; align-items: center; gap: 8px; }
.coderow code, .notice code { font-size: .8rem; word-break: break-all; }
.coderow code { flex: 1; background: var(--grey-bg); padding: 8px; border-radius: 8px; }
.scanbox { background: #0b1826; border-radius: var(--r); overflow: hidden; margin-bottom: 12px; text-align: center; }
.scanbox video { width: 100%; max-height: 60vh; display: block; }
.scanbox p { color: #cfd8e2; padding: 10px; }
.mess { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mess span { font-size: .84rem; font-weight: 600; color: var(--muted); }
.mess input { max-width: 150px; }

.gone { margin-top: 18px; }
.gone summary { cursor: pointer; font-weight: 650; padding: 10px 2px; color: var(--muted); }
.row.due-ueberfaellig { background: var(--red-bg); }
.row.due-ueberfaellig:hover { background: #fbdcdc; }
.row.due-faellig { background: #fff8e8; }
.row small strong { color: var(--ink); }
.row.split { padding: 0; align-items: stretch; gap: 0; }
.rowmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rowmain:hover { background: #f8fafb; }
.rowmain > div { flex: 1; min-width: 0; }
.rowedit { flex: none; width: 52px; display: grid; place-items: center; color: var(--muted); border-left: 1px solid var(--line); }
.rowedit:hover { background: #f8fafb; color: var(--navy); }
a.link { display: inline-block; }
.rowmain .badge { display: inline-block; margin-top: 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; margin: 10px 0 12px; }
.facts div { min-width: 0; }
.facts dt { font-size: .76rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
