/* MG Kühmatt – Gestaltung nach dem Design-Entwurf: Gelb/Rot als Akzente, ruhige Flächen. */
:root {
  --yellow: #FFE600;
  --red: #C4161C;
  --black: #141414;
  --bg: #F5F5F3;
  --card: #FFFFFF;
  --line: #DCDCD6;
  --line-soft: #ECECE8;
  --muted: #55554F;
  --field: #8A8A84;
  --ok-bg: #E3F2E7; --ok-fg: #14532D; --ok-line: #1E7A3A;
  --warn-bg: #FFF3A3; --warn-fg: #4A3B00; --warn-line: #B89B00;
  --font: 'Barlow', system-ui, sans-serif;
  --font-cond: 'Barlow Condensed', 'Barlow', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--black); font-family: var(--font); font-size: 16px; line-height: 1.4; }
a { color: var(--black); }
a:hover { color: var(--red); }
h1, h2 { font-family: var(--font-cond); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin: 0; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 20px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.yellow { color: var(--yellow); }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.appheader { background: var(--yellow); border-bottom: 3px solid var(--black); position: sticky; top: 0; z-index: 10; }
.appheader-inner { display: flex; align-items: center; gap: 12px 24px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); max-width: 1440px; margin: 0 auto; }
.mobile-brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.title { font-family: var(--font-cond); font-weight: 700; font-size: 24px; line-height: 1; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title.brand { font-size: 26px; letter-spacing: .5px; }
.sub { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wappen { width: 48px; height: 48px; border: 2px solid var(--black); object-fit: cover; flex-shrink: 0; background: var(--yellow); }
.wappen-lg { width: 72px; height: 72px; }
.iconbtn { width: 44px; height: 44px; border: 2px solid var(--black); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--black); }
.desk-brand, .topnav, .pagehead { display: none; }

/* ---------- Inhalt ---------- */
.main { padding: 16px; padding-bottom: 96px; max-width: 640px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card.nopad { padding: 0; gap: 0; }
.pad { padding: 14px 16px; }
.card-dark { background: var(--black); color: #fff; border-color: var(--black); }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cardhead.pad { flex-direction: column; align-items: flex-start; }
.dateprefix li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; align-items: center; }
@media (max-width: 560px) { .dateprefix li { grid-template-columns: 1fr; gap: 2px; } }
/* Statistik Absenzen */
.statkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.statkpis > div { display: flex; flex-direction: column; background: var(--line-soft, #f2f2ee); padding: 8px 10px; }
.statkpis strong { font-size: 24px; }
@media (max-width: 560px) { .statkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.statlist li { gap: 10px; }
.statrow { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.statbar { display: inline-block; width: 110px; height: 10px; background: var(--line-soft, #e6e6e0); vertical-align: middle; }
.statbar-fill { display: block; height: 100%; }
.statbar-good { background: #2E7D32; }
.statbar-mid { background: #E0A800; }
.statbar-low { background: var(--red, #C4161C); }
.statpct { font-weight: 600; min-width: 3.2em; text-align: right; font-size: 14px; }
.statcell { white-space: nowrap; }
.passthumb { display: block; max-width: 220px; max-height: 160px; border: 1px solid var(--line, #DDD); margin-bottom: 4px; }
.foldcard { align-self: start; }
.foldcard > summary { list-style: none; align-items: center; }
.foldcard > summary::-webkit-details-marker { display: none; }
.foldcard > summary h2 { margin: 0; flex: 1; }
.foldcard > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 4px 4px 4px; transition: transform .15s; }
.foldcard[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.foldcard[open] > summary { margin-bottom: 10px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; min-height: 72px; text-align: center; }
.tile span { font-size: 12px; font-weight: 600; line-height: 1.15; }
.tile:hover { border-color: var(--black); color: var(--black); }

.kassabuch { flex-direction: row; gap: 14px; align-items: stretch; }
.kassabuch-img { width: 96px; min-height: 96px; flex-shrink: 0; background: #E9E1C8; color: #3D3420; display: flex; align-items: center; justify-content: center; }
.kassabuch h2 { font-size: 18px; }
.kassabuch p { font-size: 15px; line-height: 1.35; }

.empty { align-items: center; text-align: center; padding: 32px 16px; gap: 12px; }
.empty svg { color: var(--muted); }

.plainlist { list-style: none; margin: 0; padding: 0; }
.plainlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.plainlist li:last-child { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }

.badge { font-size: 13px; font-weight: 700; padding: 2px 8px; border: 1px solid; white-space: nowrap; }
.badge-B { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.badge-L { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.badge-off { background: var(--red); color: #fff; border-color: var(--red); }

.notice { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn-line); padding: 10px 12px; font-size: 15px; }
.notice-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.notice-error { background: #FDE8E8; color: #7F1014; border-color: var(--red); }

/* ---------- Formulare ---------- */
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.form label small { font-weight: 400; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--black); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select { min-height: 44px; border: 1px solid var(--field); padding: 0 10px; background: #fff; width: 100%; border-radius: 0; }
input:disabled { background: var(--line-soft); color: var(--muted); }
input[type=color] { width: 100%; height: 44px; border: 1px solid var(--field); padding: 2px; background: #fff; }
input[type=file] { font-size: 14px; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 500 !important; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--black); flex-shrink: 0; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wappenrow { display: flex; gap: 14px; align-items: center; }
fieldset.roles { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.roles legend { font-family: var(--font-cond); font-weight: 700; font-size: 18px; text-transform: uppercase; padding: 0; margin-bottom: 4px; }
.rolerow { border: 1px solid var(--line); padding: 4px 10px 10px; }
.rolerow .dates { margin-left: 32px; }
.rolerow .dates label { font-weight: 500; }
.formlink { font-weight: 600; font-size: 15px; align-self: center; }
.copybox { display: flex; gap: 8px; }

.btn { min-height: 44px; padding: 0 16px; background: #fff; color: var(--black); border: 2px solid var(--black); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--black); color: #fff; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; font-family: var(--font-cond); font-size: 19px; text-transform: uppercase; letter-spacing: .5px; min-height: 52px; }
.btn-primary:hover { background: var(--black); border-color: var(--black); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; font-size: 14px; padding: 0 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table thead th { font-family: var(--font-cond); text-transform: uppercase; font-size: 15px; letter-spacing: .4px; background: var(--black); color: #fff; border-bottom: 0; }
.matrix th[scope=row] { font-weight: 500; min-width: 220px; position: sticky; left: 0; background: #fff; z-index: 1; }
.matrix thead th:first-child { position: sticky; left: 0; z-index: 2; }
.matrix td { text-align: center; padding: 6px; }
.matrix select { width: 56px; min-height: 40px; padding: 0 4px; text-align: center; font-weight: 700; }
.matrix select.lv-B { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.matrix select.lv-L { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-fg); }
.matrix .adminrow th, .matrix .adminrow td { background: #FAFAF7; border-top: 2px solid var(--black); }
.matrix .adminrow input { width: 22px; height: 22px; accent-color: var(--black); }
.matrix thead th.rotate { text-align: center; white-space: nowrap; font-size: 14px; }
.roleedit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }

.linkcard { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; }
.linkcard > span { display: flex; flex-direction: column; gap: 2px; }
.linkcard strong { font-size: 17px; }
.linkcard:hover { border-color: var(--black); color: var(--black); }
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }

/* ---------- Etappe 2: Listen, Filter, Personen ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.narrow { max-width: 640px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px; border: 2px solid var(--black); background: #fff; color: var(--black); font-family: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip[aria-current=true] { background: var(--black); color: #fff; }
.chip-view { border-style: dashed; }
.chip-warn { border-color: var(--red); color: #7F1014; }
.searchrow { display: flex; gap: 8px; align-items: flex-end; flex-direction: row; flex-wrap: wrap; }
.searchrow .grow { flex: 1; min-width: 160px; }
.filtergrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.filterform details summary { margin-top: 4px; }

.personlist { display: flex; flex-direction: column; }
.personrow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name badges" "name city"; gap: 2px 10px; padding: 10px 16px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--black); min-height: 52px; align-items: center; }
.personrow:hover { background: #FAFAF7; color: var(--black); }
.pr-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; }
.pr-sub { font-size: 14px; }
.pr-city { grid-area: city; font-size: 14px; text-align: right; }
.pr-badges { grid-area: badges; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.badge-grey { background: var(--line-soft); color: var(--muted); border-color: var(--line); }
.badge-honor { background: #fff; color: var(--black); border-color: var(--black); }
.badge-warn { background: #FDE8E8; color: #7F1014; border-color: var(--red); }

.plainfs { border: 0; padding: 0; margin: 0; min-width: 0; }
.parentbox { border: 1px solid var(--line); padding: 6px 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.parentbox legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.text-red { color: #7F1014; }
.seasonlist { columns: 2; column-gap: 16px; }
.seasonlist li { break-inside: avoid; }
@media (min-width: 900px) { .seasonlist { columns: 3; } }
.donation { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.donation:first-of-type { border-top: 0; padding-top: 0; }
[hidden] { display: none !important; }
.checkgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.rowfn { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: end; }
.rowhonor { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: end; }
.repeat { display: flex; flex-direction: column; gap: 8px; }
.rowdel { font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; }
.form textarea { border: 1px solid var(--field); padding: 8px 10px; width: 100%; resize: vertical; line-height: 1.4; }
.zip { grid-template-columns: 1fr 2fr !important; }
.dangerzone { margin-top: 24px; }
.btn-danger { border-color: var(--red); color: #7F1014; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

.listedit { display: flex; flex-direction: column; gap: 6px; }
.listrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.listedit.with-cat .listrow { grid-template-columns: 1fr 1fr auto; }
.grouprow { grid-template-columns: 1fr auto auto; }
.newrow input { border-style: dashed !important; }
.fieldtable input:not([type=checkbox]), .fieldtable select { min-width: 120px; }
.fieldtable .short { width: 70px; min-width: 70px; }

.letterhead { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--red); font-family: var(--font-cond); font-weight: 700; font-size: 22px; }
.letterhead img { width: 56px; height: 56px; object-fit: cover; }
.letterpreview pre { font-family: var(--font); font-size: 15px; white-space: pre-wrap; margin: 0; }
.letterpreview .addr { border: 1px dashed var(--line); padding: 8px 10px; align-self: flex-end; min-width: 200px; }

@media (min-width: 900px) {
  .filtergrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chips { flex-wrap: wrap; }
  .personrow { grid-template-columns: minmax(0, 2fr) 1fr auto; grid-template-areas: "name city badges"; }
  .pr-city { text-align: left; }
}

/* ---------- Etappe 3: Ablage und Archiv ---------- */
.crumbs { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.crumbs a { color: var(--black); }
.folderlist, .doclist { display: flex; flex-direction: column; }
.folderrow, .docrow { display: grid; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--black); min-height: 52px; }
.folderrow { grid-template-columns: auto 1fr auto; font-weight: 600; }
.folderrow svg { color: var(--black); }
.docrow { grid-template-columns: 1fr auto; grid-template-areas: "title date" "title size"; gap: 2px 12px; }
.folderrow:hover, .docrow:hover { background: #FAFAF7; color: var(--black); }
.folderrow.droptarget { background: var(--yellow); outline: 2px solid var(--black); }
.dr-title { grid-area: title; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.dr-date { grid-area: date; text-align: right; font-size: 14px; white-space: nowrap; }
.dr-size { grid-area: size; text-align: right; }
.docrow[draggable=true], .folderrow[draggable=true] { cursor: grab; }
.snip { color: var(--muted); margin-top: 2px; }
.snip mark { background: var(--yellow); color: var(--black); padding: 0 1px; }

.dropzone { border: 2px dashed var(--field); background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.dropzone.dragging { border-color: var(--black); background: #FFFBD1; }
.dropzone .btn input[hidden] { display: none; }
.uploadlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.uploadlist li { display: grid; grid-template-columns: 1fr 90px 90px; gap: 8px; align-items: center; font-size: 14px; }
.uploadlist .ul-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploadlist progress { width: 100%; accent-color: var(--black); }
.uploadlist .ul-error .ul-state { color: #7F1014; font-weight: 700; }
.docimage { max-width: 100%; height: auto; border: 1px solid var(--line); display: block; }
.doctext { white-space: pre-wrap; font-family: var(--font); font-size: 14px; max-height: 420px; overflow: auto; margin: 0; }

.pagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.pagethumb { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--black); }
.pagethumb img, .thumbph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--line); background: #E9E1C8; display: flex; align-items: center; justify-content: center; }
img.kassabuch-img { object-fit: cover; height: 120px; }
.story { white-space: pre-wrap; }
.traktandum { border: 1px solid var(--line); padding: 8px 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.traktandum legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.foldertable select { min-width: 220px; }

@media (min-width: 900px) {
  .docrow { grid-template-columns: 1fr 120px 90px; grid-template-areas: "title date size"; }
}

/* ---------- Etappe 4: Kalender, Absenzen, Noten ---------- */
.eventlist { display: flex; flex-direction: column; }
.eventrow { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--black); }
.eventrow:hover { background: #FAFAF7; color: var(--black); }
.ev-main { display: flex; flex-direction: column; min-width: 0; }
.ev-pieces { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-side { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.datebox { width: 52px; flex-shrink: 0; text-align: center; border: 2px solid var(--black); background: #fff; }
.db-wd { font-size: 11px; font-weight: 700; background: var(--black); color: #fff; }
.db-day { font-size: 17px; font-weight: 700; padding: 1px 0; }
.datebox-free { border-color: #E3B5B5; }
.datebox-free .db-wd { background: #B44; }
.kind-konzert .ev-main strong, .kind-auftritt .ev-main strong, .kind-gv .ev-main strong { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .3px; font-size: 17px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.piecepick { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.pp-row { display: grid; grid-template-columns: 1fr 64px; gap: 8px; align-items: center; }
.pp-row .short { width: 64px; }
.importtable input:not([type=checkbox]), .importtable select { min-width: 140px; }
.bigcheck { width: 24px; height: 24px; accent-color: var(--black); }
.pdfwrap { display: flex; flex-direction: column; gap: 10px; }
.pdfbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: 78px; background: var(--bg); padding: 6px 0; z-index: 4; }
.pdfbar input { min-height: 40px !important; }
.pdfbar .pg { width: 64px !important; text-align: center; }
.pdfbar .find { flex: 1; min-width: 140px; }
/* vergrössert: links bündig und seitlich scrollbar (zentriert würde der linke Rand abgeschnitten) */
.pdfview { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; overflow-x: auto; overscroll-behavior-x: contain; }
.pdfview canvas { background: #fff; border: 1px solid var(--line); max-width: none; scroll-margin-top: 140px; margin-inline: auto; flex-shrink: 0; }
.pdfview.dragging { cursor: grabbing; user-select: none; }
@media (pointer: fine) { .pdfview { cursor: grab; } }
.pdfview canvas.hit { outline: 4px solid var(--yellow); }
.voicebar { align-items: center; flex-wrap: wrap; }
.voicebar .chip { min-height: 36px; font-size: 14px; }
@media (min-width: 900px) { .pdfbar { top: 0; } .pdfview canvas { scroll-margin-top: 70px; } }
.partgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 16px 16px; }
.partbtn { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 10px; border: 2px solid var(--black); background: #fff; color: var(--black); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.partbtn:hover { background: var(--black); color: #fff; }
.partbtn-score { grid-column: 1 / -1; background: var(--yellow); }
@media (min-width: 900px) { .partgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .hide-sm { display: none; } }
.programbar { position: sticky; bottom: 76px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px 16px; background: var(--yellow); border-top: 3px solid var(--black); }
.programbar label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; flex: 1; min-width: 200px; }
@media (min-width: 900px) { .programbar { bottom: 0; } }
.importtable tr.muted td { opacity: .65; }

.abs-counts { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: 78px; background: var(--bg); padding: 8px 0; z-index: 5; }
.abs-group { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.abs-group h2 { font-size: 16px; color: var(--muted); }
.abs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.abs-btn { min-height: 52px; padding: 8px 10px; font-family: inherit; display: grid; grid-template-columns: 1fr auto; gap: 0 6px; align-items: center; text-align: left; cursor: pointer; border: 2px solid; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.abs-name { font-weight: 600; font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.abs-label { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.abs-note { grid-column: 1 / -1; font-weight: 400; }
.abs-note:empty { display: none; }
.abs-da { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.abs-ent { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.abs-unent { background: var(--red); color: #fff; border-color: var(--red); }
.abs-save { position: sticky; bottom: 76px; background: var(--bg); padding: 10px 0; margin-top: 12px; }
@media (min-width: 900px) {
  .abs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .abs-counts { top: 0; }
  .abs-save { bottom: 0; }
}

/* ---------- Navigation unten (Handy) ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: grid; padding: 6px 8px; padding-bottom: max(14px, env(safe-area-inset-bottom)); z-index: 10; }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; padding: 6px 0; font-size: 12px; font-weight: 500; color: var(--muted); border-top: 3px solid transparent; }
.bottomnav a[aria-current=page] { color: var(--black); font-weight: 700; border-top-color: var(--red); }

/* ---------- Seiten ohne Login ---------- */
.plainheader { background: var(--yellow); border-bottom: 3px solid var(--black); display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px 16px; }
.plainmain { padding: 24px 16px; max-width: 440px; margin: 0 auto; }
.plainmain .card { gap: 14px; padding: 20px; }

@media (max-width: 359px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row2 { grid-template-columns: 1fr; }
}

/* ---------- PC ---------- */
@media (min-width: 900px) {
  .appheader { position: static; }
  .appheader-inner { padding: 12px 24px; flex-wrap: wrap; }
  .mobile-brand { display: none; }
  .desk-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--font-cond); font-weight: 700; font-size: 24px; letter-spacing: .5px; }
  .desk-brand .wappen { width: 40px; height: 40px; }
  .topnav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
  .topnav a { padding: 10px 12px; font-weight: 600; text-decoration: none; }
  .topnav a[aria-current=page] { background: var(--black); color: #fff; font-weight: 700; }
  .bottomnav { display: none; }
  .main { padding: 24px; max-width: 960px; }
  .main-wide { max-width: 1440px; }
  .pagehead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
  .backlink { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); text-decoration: none; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Checklisten (Anlässe) */
.inline { display: inline; }
.prewrap { white-space: pre-wrap; }
.linkbtn { background: none; border: 0; padding: 4px 8px; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--red); }
.clprogress { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.clbar { display: inline-block; width: 72px; height: 8px; background: var(--line-soft); border: 1px solid var(--line); }
.clbar span { display: block; height: 100%; background: var(--ok-line); }
.cllist { list-style: none; margin: 0; padding: 0; }
.cllist li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.cltext { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cldue { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.clcheck { flex: none; width: 36px; height: 36px; border: 2px solid var(--black); background: #fff; color: #fff; font-size: 22px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.clcheck.is-done { background: var(--ok-line); border-color: var(--ok-line); }
span.clcheck { cursor: default; }
li.is-done .clwhat, tr.is-done .clwhat { text-decoration: line-through; color: var(--muted); }
.cltable td { vertical-align: middle; }
.clactual input { width: 100%; min-width: 64px; max-width: 140px; min-height: 36px; }
@media (max-width: 599px) { .cltable th, .cltable td { padding-left: 6px; padding-right: 6px; } }
@media (max-width: 599px) {
  .cllist li { flex-wrap: wrap; padding: 10px 12px; }
  .cldue { width: 100%; padding-left: 48px; }
}

/* Inventar */
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip-radio:has(input:checked) { background: var(--black); color: #fff; }
.chip-radio:focus-within { outline: 3px solid var(--yellow); outline-offset: 1px; }
.stack-xs { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.invphoto { display: block; width: 100%; max-height: 320px; object-fit: contain; background: var(--line-soft); margin-bottom: 10px; }
[data-invitem] .toolbar { flex-wrap: nowrap; }

/* Handlisten */
.handfotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.handfotos figure { margin: 0; }
.handfotos img { width: 100%; height: 180px; object-fit: cover; border: 1px solid var(--line); display: block; }
.handfoto-gross { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: var(--line-soft); border: 1px solid var(--line); }

/* Lotto */
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lottoactions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.lottoreturn { display: flex; gap: 4px; align-items: center; }
.lottoreturn input { width: 86px; min-height: 36px; }
@media (max-width: 599px) {
  .lottoactions { width: 100%; justify-content: flex-start; }
}

/* Anlassplanung */
.clshop { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; max-width: 55%; }
.clstatus { display: flex; gap: 4px; }
.chip-small { min-height: 32px; padding: 0 8px; font-size: 13px; }
.clexp { color: var(--muted); font-style: italic; }
.clactual input { max-width: 96px; }
.offers { margin-top: 6px; }
tr.is-chosen td { background: var(--ok-bg); }
.resedit[open] { flex-basis: 100%; }
.resedit summary { list-style: none; cursor: pointer; }
@media (max-width: 599px) {
  .clshop { max-width: none; width: 100%; justify-content: flex-start; }
}

/* Zuständigkeit und Schnelleingabe */
.clwhoarea { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.clwho { font-size: 13px; font-weight: 600; }
.clwhoform select { min-height: 32px; font-size: 13px; padding: 2px 6px; max-width: 260px; }
.clwhoform select.is-missing { border-color: var(--red); color: #7F1014; }
.clquick { display: flex; gap: 6px; padding: 8px 16px 12px; border-top: 1px dashed var(--line); }
.clquick input[name="text"] { flex: 1; min-height: 36px; }

/* Anhänge bei Checklisten */
.pdftile a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 180px; border: 1px solid var(--line); background: var(--bg); text-decoration: none; color: var(--black); padding: 8px; text-align: center; overflow: hidden; }
.pdficon { display: inline-block; padding: 6px 10px; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; }
.clfilesarea { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.clfiles { display: flex; flex-wrap: wrap; gap: 8px; }
.clattach { display: inline-flex; gap: 2px; align-items: center; }
.clattach label { cursor: pointer; text-decoration: none; }

/* Buchhaltung Teil 2: Debitoren, Bankimport, Jahresrechnung */
.neg { color: var(--red, #C4161C); }
.numinput { width: 8.5rem; text-align: right; }
.table tr.subhead th { background: transparent; color: inherit; text-transform: uppercase; font-size: .8rem; letter-spacing: .04em; padding-top: 1rem; }
.table tr.total td { font-weight: 700; border-top: 1px solid currentColor; }
.table tr.grand td { background: var(--yellow, #FFE600); color: #141414; }
.bankactions { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin-top: .4rem; }
.bankactions .searchrow { gap: .4rem; }
.bankactions select { max-width: 16rem; }
/* Etappe 7: Postfach und Chronik */
.mailtext { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.mailist li.unread .clwhat { font-weight: 700; }
.mailist li.unread { border-left: 4px solid var(--yellow, #FFE600); }
.mailatt { flex-wrap: wrap; gap: .4rem .6rem; }
.mailatt form { display: inline-flex; gap: .4rem; }
.mailatt select { max-width: 18rem; }
.pushbox { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pushbox p { flex: 1 1 16rem; margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-year { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid var(--black, #141414); padding-bottom: 4px; }
.tl-year h2 { margin: 0; }
.tl-item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; color: inherit; text-decoration: none; }
.tl-item:hover { outline: 2px solid var(--yellow, #FFE600); }
.tl-photo { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--line, #e5e5e0); }
.tl-nophoto { display: grid; place-items: center; color: var(--red, #C4161C); }
.tl-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; max-height: 340px; overflow: auto; }
/* Anlassplanung: Uniform und Infrastruktur */
.infra-rows { display: flex; flex-direction: column; gap: 6px; }
.infra-row { display: grid; grid-template-columns: 9rem 1fr 10.5rem auto; gap: 8px; align-items: center; }
.infra-na { white-space: nowrap; }
.infra-row.done .infra-text { text-decoration: line-through; color: var(--muted, #55554F); }
.infra-rubrik { min-width: 0; }
@media (max-width: 560px) { .infra-row { grid-template-columns: 1fr auto auto; } .infra-row .infra-text { grid-column: 1 / -1; grid-row: 2; } }