/* Design 2b „Linie“ (17.10.2026): Zinktöne, Tannengrün als Akzent, feine Rahmen statt Schatten, leicht runde Ecken, Schrift Geist.
   Die alten Variablennamen bleiben (--green ist jetzt der grüne Akzent, --green-ink das Graphit für dunkle Flächen). */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/geist-latin.woff2) format("woff2"); }
:root {
  --bg: #F4F4F5; --bg-2: #EDEDF0; --card: #FFFFFF; --card-2: #FAFAFA;
  --ink: #18181B; --ink-2: #3F3F46; --ink-3: #71717A; --line: #E4E4E7; --line-2: #D4D4D8;
  --green: #12764A; --green-2: #0E5F3B; --green-ink: #18181B; --mint: #E3F1EA; --mint-2: #C3E3D2;
  --amber: #9A5B0A; --sand: #FDF1DF; --rose: #FBE8EB; --bad: #B4233C; --ok: #12764A;
  --sh: none;
  --r: 10px; --r-s: 8px; --r-chip: 6px;
  --f-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-d: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --focus: 0 0 0 3px rgba(18,118,74,.25);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-ui); }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--f-d); letter-spacing: -.01em; }
h1 { font-size: 30px; margin: 18px 0 4px; line-height: 1.1; }
h2 { font-size: 20px; margin: 26px 0 8px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.logo { font-family: var(--f-d); font-weight: 700; font-size: 19px; }
.logo b { color: var(--mint-2); }

#side { position: fixed; top: 0; bottom: 0; left: 0; width: 248px; background: var(--green-ink); color: #D7E6DB; display: flex; flex-direction: column; z-index: 30; transition: transform .2s; }
#side .brand { padding: 18px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; }
#side .brand small { display: block; font-size: 12px; color: #A9C4B4; font-family: var(--f-ui); }
#side nav { padding: 8px; overflow-y: auto; flex: 1; }
#side nav a, #side .soon { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; color: #D7E6DB; text-decoration: none; border-radius: var(--r-s); font-weight: 500; }
#side nav a:hover { background: rgba(255,255,255,.08); }
#side nav a.on { background: var(--green); color: #fff; }
#side .soon { opacity: .5; min-height: 38px; }
#side .i { width: 22px; text-align: center; }
#side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; padding: 14px 12px 4px; opacity: .65; }
#side .me { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; }
#side .me a { color: #fff; font-weight: 600; }
#side .me .m { color: #A9C4B4; }
#side .me form { margin-top: 8px; }
#top { display: none; position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--green-ink); color: #fff; align-items: center; gap: 10px; padding: 0 8px; z-index: 20; }
#top button { background: none; color: #fff; font-size: 24px; width: 48px; height: 48px; border: 0; cursor: pointer; }
#shade { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 25; }
main { margin-left: 248px; padding: 0 32px 70px; max-width: 2000px; }
body.bare main { margin: 0 auto; max-width: 440px; padding: 40px 16px; }
.demo { background: var(--sand); color: var(--amber); font-size: 13px; padding: 6px 12px; text-align: center; margin: 0 -28px; }
body.bare .demo { margin: 0 0 20px; border-radius: 3px; }
@media (max-width: 820px) {
  #top { display: flex; }
  #side { transform: translateX(-100%); }
  body.open #side { transform: none; }
  body.open #shade { display: block; }
  main { margin-left: 0; padding: 70px 16px 70px; }
  .demo { margin: 0 -16px; }
  .two { grid-template-columns: 1fr !important; }
  h1 { font-size: 26px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 18px 20px; margin-bottom: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 18px; }
.stat .big { font-family: var(--f-d); font-size: 34px; font-weight: 700; color: var(--green); line-height: 1.1; }
.sub, .m { color: var(--ink-3); }
.sub { margin: 0 0 12px; }
.m { font-size: 14px; }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 3px; background: rgba(26,34,51,.07); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--mint-2); color: var(--green-ink); }
.chip.warn { background: #E5D5B5; color: var(--amber); }
.chip.bad { background: var(--rose); color: var(--bad); }

input, select, textarea, button, .btn { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--card); margin: 3px 0 10px; }
input[type=checkbox], input[type=radio] { width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--green); flex: none; }
textarea { min-height: 100px; resize: vertical; }
label { font-size: 13px; color: var(--ink-3); font-weight: 600; }
label.inline { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink); font-weight: 500; min-height: 46px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 3px; padding: 0 20px; min-height: 46px; background: var(--green); color: #fff; font-weight: 650; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--green-2); }
.btn.sec, button.sec { background: rgba(26,34,51,.09); color: var(--ink); }
.btn.danger, button.danger { background: var(--bad); color: #fff; }
.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
.bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.bar input { margin: 0; max-width: 360px; }
.bar form { display: contents; }
.flex { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; margin: 0; min-width: 120px; }

.flash { border-radius: var(--r-s); padding: 12px 16px; margin: 14px 0 0; background: var(--mint); color: var(--green-ink); font-weight: 500; }
.flash.err { background: var(--rose); color: var(--bad); }
.flash.warn { background: var(--sand); color: var(--amber); }
.flash.secret { background: #fff; border: 2px dashed var(--green); font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.rule { background: var(--sand); border-radius: var(--r-s); padding: 10px 14px; font-size: 14px; margin-bottom: 12px; color: var(--amber); }
.rule.bad { background: var(--rose); color: var(--bad); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 16px 0; overflow-x: auto; }
.tabs a { padding: 12px 16px; color: var(--ink-3); border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none; font-weight: 600; }
.tabs a.on { color: var(--green); border-color: var(--green); }
.note { border-left: 4px solid var(--mint-2); background: var(--card-2); border-radius: 0 var(--r-s) var(--r-s) 0; padding: 10px 14px; margin: 0 0 10px; }
.note p { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.empty { color: var(--ink-3); padding: 10px 0; }
.wrap { white-space: pre-wrap; word-break: break-word; }
.login-card { margin-top: 24px; }

/* Etappe 2: Filter, Sortierung, Karten am Handy, Einstellungen, Druck */
details.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 0 20px; margin-bottom: 12px; }
details.filters > summary { cursor: pointer; font-weight: 650; min-height: 48px; display: flex; align-items: center; gap: 10px; }
details.filters[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
details.filters form { padding-bottom: 14px; }
.resultbar { margin: 4px 0 10px; }
a.sortlink { color: var(--ink-3); text-decoration: none; }
a.sortlink:hover { color: var(--green); }
th[aria-sort] a.sortlink { color: var(--green); }
tr.notetr td { border-bottom: 1px solid var(--line); padding-top: 0; }
.chk { display: inline-flex; margin-right: 8px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 10px; }
.pad { padding: 12px 0; }
h2.first { margin-top: 0; }
.off { opacity: .6; }
.settings { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.snav { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 8px; position: sticky; top: 12px; }
.snav a { display: block; padding: 10px 12px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-weight: 550; }
.snav a:hover { background: var(--card-2); }
.snav a.on { background: var(--green); color: #fff; }
.sgrp { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 12px 12px 4px; }
.entry { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sub-entry { margin-left: 28px; }
.entry .inline-form input[name=label] { min-width: 180px; }
@media (max-width: 820px) {
  .settings { grid-template-columns: 1fr; }
  .snav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .sgrp { width: 100%; }
}
@media (max-width: 640px) {
  table.cards, table.cards tbody { display: block; }
  table.cards tr:first-child:has(th) { display: none; }
  table.cards tr { display: block; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 8px 12px; margin-bottom: 10px; background: var(--card); }
  table.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 0; text-align: right; }
  table.cards td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: none; padding-top: 3px; }
  table.cards td.main { font-size: 17px; }
  table.cards td:not([data-label]) { justify-content: flex-start; }
  table.cards td:not([data-label]):empty { display: none; }
  table.cards tr.notetr { border: 0; padding: 0 12px; margin-top: -6px; }
  table.cards tr.notetr td { display: block; text-align: left; }
  .tw { overflow-x: visible; }
  .card.tw { background: transparent; border: 0; box-shadow: none; padding: 0; }
  details.filters { padding: 0 14px; }
  .snav a { padding: 12px; }
}
@media print {
  body.print main { margin: 0; max-width: none; padding: 0; }
  .noprint, .demo { display: none; }
  .printtable th, .printtable td { border: 1px solid #999; padding: 4px 6px; font-size: 11px; }
}
.printtable { border-collapse: collapse; }

/* Etappe 3: Personen, Verlauf */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.chips a.chip { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; padding: 0 12px; }
.lastcontact { background: var(--mint); border-color: var(--mint-2); color: var(--green-ink); padding: 12px 20px; }
.note.tl-anruf { border-left-color: var(--green-2); }
.note.tl-notiz { border-left-color: #C9A24A; }
.note.tl-email { border-left-color: #5C7FA3; }
.note.tl-rechnung { border-left-color: var(--bad); }
.note.tl-dokument { border-left-color: var(--ink-3); }

/* Etappe 4: Angebote */
.logo-prev { max-height: 64px; max-width: 280px; width: auto; height: auto; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px; }
.addrpreview { background: var(--card-2); border-radius: var(--r-s); padding: 10px 14px; margin: 4px 0 12px; }
.oitem { border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 8px 12px 2px; margin-bottom: 10px; background: var(--card-2); }
.oitem[hidden] { display: none; }
.oitem-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.oitem-head label.inline { min-height: 32px; font-size: 14px; }
.oitem-grid { display: grid; grid-template-columns: 4fr 1fr 1.5fr 1.8fr 1.3fr; gap: 0 10px; }
.oitem-grid .c-desc { grid-column: 1 / -1; }
@media (max-width: 820px) { .oitem-grid { grid-template-columns: 1fr 1fr; } .oitem-grid .c-title { grid-column: 1 / -1; } }
.sumbox { max-width: 420px; margin: 12px 0 0 auto; }
.sumbox .total { border-top: 2px solid var(--green); padding-top: 6px; font-size: 18px; color: var(--green); }
.tl-angebot, .note.tl-angebot { border-left-color: var(--green); }
button[hidden], .btn[hidden] { display: none; }
@media (max-width: 640px) { .grid .stat .big { font-size: 24px; } }

/* Feedback 1: Zurück-Link, Filter eingeklappt mit Chips, Status-Dropdown, feste Aktionsleiste, kompakte Eingabemasken */
.backlink { margin: 10px 0 0; font-size: 14px; }
.backlink a { text-decoration: none; font-weight: 600; }
.backlink a:hover { text-decoration: underline; }
a.fl { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
a.fl:hover { color: var(--green); border-bottom-color: var(--green); }
a.chip.fl { border-bottom: 0; }
details.filters > summary { min-height: 40px; }
.chips.activef { margin: -2px 0 8px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 6px; }
.fchip a.fx { color: var(--green-ink); text-decoration: none; font-size: 16px; line-height: 1; padding: 0 2px; }
.fchip a.fx:hover { color: var(--bad); }
a.fclear { font-size: 13px; color: var(--ink-3); }
.stmenu { display: inline-block; position: relative; }
.stmenu > summary { list-style: none; cursor: pointer; }
.stmenu > summary::-webkit-details-marker { display: none; }
.stmenu > summary .car { font-size: 10px; opacity: .7; }
.stpanel { position: fixed; z-index: 40; min-width: 190px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--sh); padding: 6px; }
.stpanel form { display: block; }
.stopt { display: flex; width: 100%; justify-content: flex-start; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; background: transparent; color: var(--ink); font-weight: 500; text-decoration: none; cursor: pointer; border: 0; text-align: left; }
.stopt:hover { background: var(--card-2); }
.stopt.cur { background: var(--mint); color: var(--green-ink); font-weight: 650; }
.stopt.flt { color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.stopt.sub { padding-left: 28px; }
details.substep > summary { list-style: none; cursor: pointer; }
details.substep > summary::-webkit-details-marker { display: none; }
.actionbar { position: sticky; top: 0; z-index: 12; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.actionbar .grow { flex: 1; }
.actionbar h1 { font-size: 20px; margin: 0 8px 0 0; }
@media (max-width: 820px) { .actionbar { top: 56px; } }
.compact h3 { font-size: 15px; margin-bottom: 4px; }
.compact .card { padding: 10px 14px; margin-bottom: 8px; }
.compact input, .compact select, .compact textarea { min-height: 38px; padding: 6px 10px; margin: 2px 0 6px; }
.compact textarea { min-height: 64px; }
.compact label { font-size: 12px; }
.compact .oitem { padding: 4px 10px 0; margin-bottom: 6px; }
.compact .oitem-head label.inline { min-height: 26px; }
.compact .rule { padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
details.minor { margin: 0 0 14px; }
details.minor > summary { cursor: pointer; color: var(--ink-3); font-size: 14px; padding: 6px 2px; }
details.minor[open] > summary { color: var(--ink); font-weight: 600; }
details.minor > .card { margin-top: 6px; }
.picklist a.pick { display: flex; justify-content: space-between; gap: 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; min-height: 46px; align-items: center; }
.picklist a.pick:hover { background: var(--card-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 12px 16px; }
.kpi .v { font-family: var(--f-d); font-size: 22px; font-weight: 700; color: var(--green); line-height: 1.2; }
.kpi .l { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tagchip { font-size: 11px; padding: 1px 8px; margin: 2px 4px 0 0; }
.feedbox { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.feedbox textarea { min-height: 70px; }
.mainperson { color: var(--green-ink); }

/* Schema 6: Baustein hinzufügen im Angebotsformular, Leistungskatalog */
.baustein { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 8px; padding: 6px 10px; background: var(--card-2); border: 1px dashed var(--line-2); border-radius: var(--r-s); }
.baustein label { flex-basis: 100%; margin: 0; }
.baustein select { flex: 1 1 260px; min-width: 0; }
details.entry > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
details.entry[open] { padding-bottom: 10px; }

/* Angebotsformular: Positionsblock per Knopf löschen (Haken bleibt unsichtbar als Rückfall ohne Skript) */
.posdel { position: relative; display: inline-block; cursor: pointer; margin: 0; }
.posdel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.posdel span { display: inline-block; padding: 6px 14px; border-radius: 10px; background: #FFFEFB; color: #9B3326; border: 1px solid rgba(155, 51, 38, .35); font-weight: 600; font-size: 14px; box-shadow: 0 1px 2px rgba(19, 38, 31, .08), 0 4px 10px rgba(19, 38, 31, .12); transition: box-shadow .15s, transform .1s; }
.posdel:hover span { box-shadow: 0 2px 4px rgba(19, 38, 31, .1), 0 8px 16px rgba(19, 38, 31, .16); }
.posdel:active span { transform: translateY(1px); box-shadow: 0 1px 2px rgba(19, 38, 31, .1); }
.posdel input:focus-visible + span { outline: 2px solid #23395B; outline-offset: 2px; }
.posdel input:checked + span { background: #F6DAD5; }

/* Schema 7: Kalender, Interessenten, Pipeline, Schnellsuche */
.gsearch { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; }
.gsearch input { margin: 0; min-height: 40px; max-width: 460px; }
.gsearch button { min-height: 40px; }
.calnav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.calnav .caltitle { font-family: var(--f-d); font-size: 20px; margin: 0 8px; }
.calnav .calviews { margin: 0 0 0 auto; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 4px 0; }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px; min-height: 110px; min-width: 0; }
.cal-week .cal-day { min-height: 220px; }
.cal-day.we { background: var(--card-2); }
.cal-day.out { opacity: .5; }
.cal-day.today { border: 2px solid var(--green); }
.cal-dh { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-weight: 650; font-size: 13px; margin-bottom: 4px; }
.cal-dh a { text-decoration: none; color: var(--ink-2); }
.cal-dh .dm { display: none; }
.cal-add { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 3px; background: rgba(26,34,51,.07); color: var(--green) !important; font-weight: 700; }
.cal-add:hover { background: var(--mint-2); }
.cal-more { font-size: 12px; }
.ce { border-left: 4px solid var(--green-2); background: var(--card-2); border-radius: 0 8px 8px 0; padding: 3px 6px; margin-bottom: 4px; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.ce-t { display: block; font-size: 11px; color: var(--ink-3); font-weight: 650; }
.ce-l { color: var(--ink); font-weight: 600; text-decoration: none; }
.ce-l:hover { text-decoration: underline; color: var(--green); }
.ce-s { font-size: 12px; }
.ce-c { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ce-rueckruf { border-left-color: #C9A24A; background: var(--sand); }
.ce-rechnung, .ce-angebot { border-left-color: var(--ink-3); background: rgba(26,34,51,.05); }
.ce.done .ce-l, .ce.cancelled .ce-l { text-decoration: line-through; opacity: .7; }
.ce.done, .ce.cancelled { opacity: .75; }
.ce.conflict { border-left-color: var(--bad); }
.calday-list .ce { font-size: 15px; padding: 8px 12px; }
.calday-list .ce-t { font-size: 13px; }
.tl-termin, .note.tl-termin { border-left-color: var(--green); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.bcol { background: rgba(26,34,51,.05); border-radius: var(--r); padding: 10px; min-width: 0; }
.bcol h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--sh); padding: 10px 12px; margin-bottom: 8px; }
.bcard .m { font-size: 13px; }
@media (max-width: 820px) { .board { grid-auto-flow: row; grid-auto-columns: auto; } }
@media (max-width: 640px) {
  .cal-head { display: none; }
  .cal-grid { display: block; }
  .cal-day { margin-bottom: 8px; min-height: 0; }
  .cal-week .cal-day { min-height: 0; }
  .cal-month .cal-day.empty, .cal-month .cal-day.out { display: none; }
  .cal-dh .dd { display: none; }
  .cal-dh .dm { display: inline; }
  .calnav .calviews { margin: 0; }
  .gsearch input { max-width: none; }
}
@media print { .gsearch, .calnav, .cal-add { display: none; } }

/* Mehr Platz am Desktop, kleinere Abstände am Handy */
@media (max-width: 640px) {
  main > .flex { margin-top: 10px; row-gap: 4px; }
  main > .flex .btn { min-height: 40px; padding: 8px 14px; font-size: 15px; }
  .gsearch { margin-bottom: 4px; }
}

/* Spaltenbreite per Ziehen ändern (nur Tabellen am Bildschirm, nicht als Karten) */
th.hasres { position: relative; }
.colres { position: absolute; top: 0; right: -4px; bottom: 0; width: 10px; cursor: col-resize; user-select: none; touch-action: none; z-index: 2; }
.colres::after { content: ''; position: absolute; left: 4px; top: 22%; bottom: 22%; width: 2px; border-radius: 2px; background: var(--line-2); }
.colres:hover::after, .colres.drag::after { background: var(--green); }
table.resized { table-layout: fixed; }
table.resized th, table.resized td { overflow-wrap: anywhere; }
@media (max-width: 640px) { .colres { display: none; } }
@media print { .colres { display: none; } }

/* Schema 8: Nachträge zu Anrufen, Hauptansprechperson oben, Reiter, Rechnungsstand */
.fu { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--green, #23395B); background: rgba(35,57,91,.07); border-radius: 6px; font-size: 13px; }
.mainperson { margin-bottom: 12px; }
.mainperson .mp-contact { margin-top: 4px; }

/* Schema 9 */
.quickadd { margin: 6px 0 0; }
.calltitle { margin-bottom: 2px; }

/* Schnell-Erfassung */
.schnell h1 { margin-top: 18px; }
.schnell textarea { min-height: 84px; }
.schnell-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.schnell-btns button { flex: 1 1 200px; min-height: 52px; font-size: 16px; }
.schnell-btns .sec { background: rgba(26,34,51,.09); color: var(--ink); }
.schnell-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.schnell-zeile:last-child { border-bottom: 0; }
.schnell-zeile a:first-child { text-decoration: none; color: var(--ink); display: block; }
.schnell-zeile .sub { display: block; font-size: 13px; color: var(--ink-3); }
.topadd { margin-left: auto; margin-right: 8px; background: var(--amber); color: #fff; text-decoration: none; padding: 0 14px; min-height: 40px; display: inline-flex; align-items: center; font-weight: 600; border-radius: 3px; }

/* Menü: ausgeblendete Punkte eingeklappt, Anpassungsseite */
#side nav details.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; min-height: 38px; padding: 8px 12px; color: #A9C4B4; font-size: 14px; border-radius: var(--r-s); }
#side nav details.more summary::-webkit-details-marker { display: none; }
#side nav details.more summary::before { content: "▸"; width: 22px; text-align: center; }
#side nav details.more[open] summary::before { content: "▾"; }
#side nav details.more summary:hover { background: rgba(255,255,255,.08); }
#side nav .menulink { opacity: .7; min-height: 38px; font-size: 14px; }
.menurow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.menurow label { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; font-size: 16px; }
.menurow input[type=checkbox] { width: 22px; min-height: 22px; margin: 0; }
.menumv { display: flex; gap: 6px; }
.menumv button { min-height: 40px; min-width: 44px; padding: 0 12px; }

/* Kundenformular (ohne Menü, für den Kunden) */
body.kunde { background: var(--bg); margin: 0; }
.kunde-kopf { background: var(--green-ink); color: #fff; padding: 14px 20px; }
.kunde-kopf .logo { font-size: 19px; }
.kunde-box { max-width: 560px; margin: 0 auto; padding: 8px 18px 60px; }
.kunde-box input, .kunde-box textarea { font-size: 18px; min-height: 52px; }
.kunde-box button { min-height: 56px; font-size: 18px; width: 100%; }
.kunde-box .row > div { min-width: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Schnellrechnung an der Firma */
.schnellrechnung { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.schnellrechnung .row { display: grid; grid-template-columns: 1fr 80px auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .schnellrechnung .row { grid-template-columns: 1fr 70px; } .schnellrechnung .row > div:last-child { grid-column: 1 / -1; } }

/* Aufsteller: QR-Codes, Druckbogen */
.kpi strong { display: block; font-size: 22px; font-weight: 700; color: var(--green); line-height: 1.2; }
.qrbox { width: 200px; max-width: 100%; margin: 6px 0 10px; background: #fff; }
.qrbox svg { display: block; width: 100%; height: auto; }
.qrsheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 16px; }
.qrcell { text-align: center; border: 1px dashed var(--line-2); padding: 10px; break-inside: avoid; }
.qrcell .qrbox { width: 100%; margin: 0 auto 6px; }
.qrcell strong { font-size: 14px; letter-spacing: .08em; }
@media print { #side, #top, #shade, .flash, .gsearch, .quickadd { display: none !important; } main { margin: 0 !important; padding: 0 !important; } .qrsheet { grid-template-columns: repeat(4, 1fr); } }
.kunde-fuss { max-width: 560px; margin: 0 auto; padding: 0 18px 30px; font-size: 13px; color: var(--ink-3); }
.kunde-fuss a { color: var(--ink-3); }

/* Kundenmodus */
.kioskbox { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.kioskbox summary { cursor: pointer; font-weight: 600; }
.kioskstart label { margin-top: 8px; }
.kioskstart input { max-width: 220px; }
.kiosk-aus { opacity: .5; }
.flash.err { background: #F3DDE3; color: #7A1F3B; }

/* Aufsteller kompakt */
.tagstats { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 4px 0 10px; }
.tagfilter { margin-left: auto; display: inline-flex; gap: 2px; }
.tagfilter a { padding: 2px 10px; border: 1px solid var(--line-2); text-decoration: none; color: var(--ink-2); font-size: 13px; border-radius: var(--r-s); }
.tagfilter a.on { background: var(--green); color: #fff; border-color: var(--green); }
.tag-h { font-size: 15px; margin: 14px 0 6px; }
.tagtable { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.tagtable th, .tagtable td { padding: 5px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tagtable th { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tagtable .r { text-align: right; }
.tagchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 9px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-s); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.tagchip small { font-size: 11px; color: var(--green); font-weight: 700; }
.tagchip:hover { background: var(--mint); }
.tagtools { margin: 18px 0; }
.scanlist { display: grid; gap: 8px; margin: 8px 0; }
.scancard { padding: 10px 14px; margin: 0; }
@media (max-width: 640px) { .tagtable { display: block; overflow-x: auto; } }
.tagziel { word-break: break-all; font-size: 13px; background: var(--card-2); border: 1px solid var(--line); padding: 8px 10px; margin: 4px 0 12px; }

/* Tag-Passwort und App-Links */
.tagpw { display: grid; gap: 10px; margin: 8px 0; }
.tagpw-in { max-width: 420px; display: inline-block; width: calc(100% - 96px); min-height: 40px; font-family: ui-monospace, Consolas, monospace; }
.tagsteps { padding-left: 20px; margin: 8px 0; }
.tagsteps li { margin-bottom: 4px; }
.appbtns { display: flex; flex-wrap: wrap; gap: 6px; }

/* DS-NFC-App: Knöpfe nur in der App sichtbar, Hinweis nur im Browser */
[data-ds-app] { display: none; }
.in-ds-app [data-ds-app] { display: block; }
.in-ds-app [data-ds-browser] { display: none; }
.app-ok { color: var(--ok); font-weight: 600; }
.app-fehler { color: var(--bad); font-weight: 600; }

/* DS-NFC-App: Update-Hinweis und kurze Meldung */
.app-update { background: var(--amber); color: #fff; padding: 10px 16px; font-weight: 600; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.app-update button { background: #fff; color: var(--amber); min-height: 36px; padding: 0 14px; }
.app-toast { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 60; background: var(--green-ink); color: #fff; padding: 12px 16px; border-radius: var(--r); }

/* Großer Reset-Knopf in der DS-NFC-App */
.tagreset { text-align: center; }
.tagreset-btn { width: 100%; min-height: 72px; font-size: 22px; background: var(--amber); }
.tagreset .m { text-align: left; }

/* Logo (dS), App-Seite */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-img { display: block; border-radius: 7px; }
.login-logo { display: block; margin: 0 0 10px; border-radius: 14px; }
.in-ds-app [data-ds-browser-only] { display: none; }
.appinfo-kopf { display: flex; align-items: center; gap: 16px; margin: 18px 0 8px; }
.appinfo-kopf h1 { margin: 0; }
.appinfo-icon { border-radius: 16px; }
.appver { font-size: 18px; }
.appnotes { background: var(--card-2); border-left: 4px solid var(--amber); padding: 10px 14px; margin: 10px 0; }
main > .app-update { margin: 0 -32px 10px; }
@media (max-width: 880px) { main > .app-update { margin: 0 -16px 10px; } }

/* Handy neu: ruhige Kopfzeile, kompakte Listen (Mobile-Redesign 15.10.2026) */
.logo > span { white-space: nowrap; }
@media (max-width: 820px) {
  #top { height: 52px; gap: 6px; padding: 0 6px; }
  #top .logo { font-size: 17px; min-width: 0; overflow: hidden; }
  #top .logo > span { overflow: hidden; text-overflow: ellipsis; }
  #top .logo-img { width: 26px; height: 26px; }
  main { padding-top: 64px; }
  h1 { font-size: 24px; margin-top: 12px; }
  .gsearch input { font-size: 16px; }
}
@media (max-width: 640px) {
  .gsearch button { display: none; }
  table.cards tr { padding: 10px 14px; margin-bottom: 8px; border-color: var(--line); border-radius: 8px; }
  table.cards td { padding: 4px 0; font-size: 15px; }
  table.cards td::before { font-size: 11px; color: var(--ink-3); }
  /* Listen Firmen und Personen: Name groß, darunter nur das Wichtigste, der Rest steht in der Detailseite */
  table.kompakt tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
  table.kompakt td { display: none; }
  table.kompakt td.main, table.kompakt td[data-kurz] { display: block; padding: 0; text-align: left; }
  table.kompakt td.main { flex: 1 0 100%; font-size: 18px; }
  table.kompakt td[data-kurz]::before { display: none; }
  table.kompakt td[data-kurz] { color: var(--ink-2); font-size: 14px; }
}
details.einkl > summary { cursor: pointer; list-style: none; }
details.einkl > summary::-webkit-details-marker { display: none; }
details.einkl > summary h3 { display: inline; margin: 0; }
details.einkl > summary::after { content: "  ▾"; color: var(--ink-3); }
details.einkl[open] > summary { margin-bottom: 8px; }

/* Firmen-Vorschläge (Google Places) */
.places-box { border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--card); margin: -4px 0 8px; box-shadow: 0 6px 18px rgba(26,34,51,.12); }
.places-item { display: block; width: 100%; text-align: left; background: none; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; min-height: 48px; font: inherit; cursor: pointer; }
.places-item:last-child { border-bottom: 0; }
.places-item b { display: block; }
.places-item span { display: block; font-size: 13px; color: var(--ink-3); }
.places-hint { margin: 2px 0 8px; color: var(--ok); }

/* Seitenleiste am Desktop: „Manager“ unter dem Namen statt daneben */
#side .brand .logo { align-items: center; gap: 12px; line-height: 1.15; }
#side .brand .logo b { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--mint-2); }

.places-hint.warn { color: var(--amber); font-weight: 600; }

/* Firmenlogo */
.firmenlogo-klein { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; margin-right: 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.firmenlogo-gross { max-height: 56px; max-width: 160px; object-fit: contain; vertical-align: middle; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.logo-aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.logo-aktionen form { margin: 0; display: flex; gap: 6px; align-items: center; }
.nur-inline { display: inline; }
.umbruch { word-break: break-all; }
.firmenlogo-liste { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin-right: 8px; border-radius: 4px; background: #fff; border: 1px solid var(--line); }

/* Aufsteller für den Außendienst (templates/aufsteller_unterwegs.php): am Handy, wenige große Knöpfe, Schritt für Schritt */
.uw { max-width: 560px; }
.uw h1 { margin-bottom: 12px; }
.uw-kopf { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.uw-code { font: 700 24px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; }
.uw-schritt h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 19px; }
.uw-nr { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; font-size: 15px; flex: none; }
.uw-schritt.fertig .uw-nr { background: var(--ok); }
.uw-big { font-size: 18px; margin: 4px 0 8px; }
.uw-go { width: 100%; min-height: 56px; font-size: 18px; border-radius: 12px; margin: 8px 0 4px; }
.uw-zweit { width: 100%; min-height: 50px; border-radius: 12px; margin: 8px 0 4px; }
.uw-scan::before { content: ""; width: 22px; height: 22px; margin-right: 10px; border: 2.5px solid currentColor; border-radius: 5px; box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 7px currentColor; }
.uw-fakten { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0 10px; font-size: 15px; }
.uw-fakten dt { color: var(--ink-3); }
.uw-fakten dd { margin: 0; overflow-wrap: anywhere; }
.uw-pw { font: 700 20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; background: var(--mint); padding: 2px 10px; border-radius: 6px; }
.uw-warn { color: var(--bad); }
.uw-meldung { margin: 8px 0 0; min-height: 1.5em; }
.uw-meldung:empty { min-height: 0; margin: 0; }
.uw-form { display: grid; gap: 4px; margin-top: 4px; }
.uw-form label { font-size: 15px; color: var(--ink); }
.uw-form textarea, .uw-form input, .uw-row input { width: 100%; font-size: 17px; padding: 12px 14px; border-radius: 12px; margin: 0; }
.uw-form .m { margin: 2px 0 4px; font-size: 14px; }
.uw-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0 6px; }
.uw-row button { border-radius: 12px; min-height: 50px; }
.uw-mehr { margin: 8px 0 0; }
.uw-mehr > summary { cursor: pointer; color: var(--ink-3); font-size: 15px; padding: 8px 0; }
.uw-mehr[open] > summary { color: var(--ink); font-weight: 600; }
.uw-mehr input { margin-top: 4px; }
.uw-unten { margin: 4px 0 18px; }
.uw-unten .m { text-align: center; }
.uw-druck { display: grid; gap: 12px; }
.uw-anzahl { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.uw-anzahl button { min-height: 56px; font-size: 26px; border-radius: 12px; padding: 0; }
.uw-anzahl input { margin: 0; min-height: 56px; text-align: center; font-size: 24px; font-weight: 700; border-radius: 12px; }
.uw-wahl { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.uw-wahl legend { font-size: 13px; color: var(--ink-3); font-weight: 600; padding: 0; margin-bottom: 6px; }
.uw-wahl label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 16px; font-weight: 650; cursor: pointer; text-align: center; }
.uw-wahl label:has(input:checked) { border-color: var(--green); background: var(--mint); }
.uw-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.uw-wahl label:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.uw-papier label { flex-direction: row; justify-content: center; min-height: 52px; padding: 8px; font-size: 15px; }
.uw-muster { width: 54px; height: 80px; border-radius: 6px; border: 1px solid var(--line-2); overflow: hidden; }
.uw-design.weiss .uw-muster { background: linear-gradient(#fff 0 58%, #0B0B0B 58%); }
.uw-design.schwarz .uw-muster { background: linear-gradient(#0B0B0B 0 58%, #fff 58%); }
.uw-codes { display: flex; flex-wrap: wrap; gap: 6px 12px; font: 600 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 6px 0; }
.uw-scanner { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.uw-scanner[hidden] { display: none; }
.uw-scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.uw-rahmen { position: absolute; left: 50%; top: 42%; width: min(68vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.uw-scantext { position: relative; color: #fff; font-size: 17px; font-weight: 600; text-align: center; margin: 0 0 14px; max-width: 420px; }
.uw-scanner button.uw-abbruch { position: relative; width: 100%; max-width: 420px; min-height: 54px; border-radius: 12px; background: #fff; color: var(--ink); font-size: 17px; }
html.uw-scannt, html.uw-scannt body { overflow: hidden; }
/* QR & NFC: Übersicht mit Reitern und Liste, Seite eines Codes */
.uw h1.uw-code { margin: 0; }
.uw-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 0 8px; }
.uw-tabs a { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.uw-tabs a b { font-size: 22px; line-height: 1.2; }
.uw-tabs a.on { background: var(--green); border-color: var(--green); color: #fff; }
.uw-liste { list-style: none; padding: 0; margin: 8px 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.uw-liste li { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.uw-liste li:last-child { border-bottom: 0; }
.uw-liste li.neu { background: var(--mint); }
.uw-liste a { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 52px; padding: 8px 0; color: var(--ink); text-decoration: none; }
.uw-liste .uw-code { font-size: 17px; }
.uw-liste a > .m:last-child { margin-left: auto; font-size: 13px; }
.uw-druckleiste { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 0 0 10px; }
.uw-druckleiste[open] { display: grid; gap: 12px; padding-bottom: 14px; }
.uw-aktionen { margin-bottom: 16px; }
.uw-alle { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); margin: 8px 0 0; }
.uw-liste li { flex-wrap: wrap; }
.uw-liste a.uw-firma { flex: 1 1 100%; min-height: 0; padding: 0 0 10px 34px; color: var(--green); text-decoration: underline; font-size: 15px; }
.inv-sammel .row { align-items: end; }
.inv-hak { width: 34px; }
.uw-qr { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: start; }
.uw-qr .qrbox { width: 132px; }
.uw-qr .qrbox svg { width: 100%; height: auto; display: block; }
.uw-link { overflow-wrap: anywhere; margin: 0 0 6px; }
.uw-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uw-zwei .btn { border-radius: 12px; min-height: 48px; padding: 0 8px; }

/* ===================== Design 2b „Linie“: Komponenten ===================== */
body { -webkit-font-smoothing: antialiased; font-feature-settings: "ss01"; }
h1 { letter-spacing: -.025em; font-weight: 700; }
h2, h3 { letter-spacing: -.015em; font-weight: 650; }
a { color: var(--green); text-underline-offset: 2px; }
.logo b { color: var(--green); }

/* Karten und Flächen: feine Linie, kein Schatten */
.card, .stat, .kpi, details.filters, .snav, .bcard, .uw-liste, .uw-druckleiste, .uw-tabs a { border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.card { padding: 16px 18px; }
.kpi .l, .cal-head span, .sgrp, #side .grp { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.kpi .v, .stat .big, .kpi strong { color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.bcol { background: var(--bg-2); border-radius: var(--r); }

/* Tabellen: ruhige Köpfe ohne Großbuchstaben */
th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-bottom-color: var(--line); }
td { border-bottom-color: var(--line); }
.tagtable { border-radius: var(--r); overflow: hidden; }
.tagtable th { text-transform: none; letter-spacing: 0; }

/* Status-Chips */
.chip { border-radius: var(--r-chip); background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); font-weight: 600; padding: 2px 9px; }
.chip.ok { background: var(--mint); color: var(--green-2); border-color: var(--mint-2); }
.chip.warn { background: var(--sand); color: var(--amber); border-color: #F3DDB8; }
.chip.bad { background: var(--rose); color: var(--bad); border-color: #F3C7CF; }
.tagchip { border-radius: var(--r-chip); }

/* Eingaben */
input, select, textarea { border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--card); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
label { color: var(--ink-2); font-weight: 600; }

/* Knöpfe */
button, .btn { border-radius: var(--r-s); background: var(--green); font-weight: 600; letter-spacing: -.005em; }
button:hover, .btn:hover { background: var(--green-2); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.sec, button.sec, .schnell-btns .sec { background: var(--card); color: var(--ink); border: 1px solid var(--line-2); }
.btn.sec:hover, button.sec:hover { background: var(--bg); }
.btn.danger, button.danger { background: var(--bad); }
.uw-go, .uw-zweit, .uw-row button, .uw-anzahl button, .uw-zwei .btn, .uw-form textarea, .uw-form input, .uw-row input, .uw-anzahl input { border-radius: var(--r-s); }

/* Meldungen und Hinweise */
.flash { border-radius: var(--r-s); border: 1px solid var(--mint-2); background: var(--mint); color: var(--green-2); }
.flash.err { background: var(--rose); color: var(--bad); border-color: #F3C7CF; }
.flash.warn { background: var(--sand); color: var(--amber); border-color: #F3DDB8; }
.rule { border-radius: var(--r-s); border: 1px solid #F3DDB8; }
.rule.bad { border-color: #F3C7CF; }
.note { border-left-color: var(--line-2); background: var(--card); border: 1px solid var(--line); border-left-width: 3px; }
.tabs a.on { color: var(--ink); border-color: var(--green); }

/* Seitenleiste (Desktop und ausklappbar am Handy): hell mit Linie */
#side { background: var(--card); color: var(--ink-2); border-right: 1px solid var(--line); }
#side .brand { border-bottom: 1px solid var(--line); color: var(--ink); }
#side .brand small, #side .me .m { color: var(--ink-3); }
#side .brand .logo b { color: var(--green); }
#side nav a, #side .soon { color: var(--ink-2); border-radius: var(--r-s); min-height: 42px; font-weight: 550; }
#side nav a:hover { background: var(--bg); }
#side nav a.on { background: var(--mint); color: var(--green-2); font-weight: 650; }
#side .i { display: inline-flex; justify-content: center; }
#side .i .ic { width: 20px; height: 20px; }
#side nav details.more summary { color: var(--ink-3); }
#side nav details.more summary:hover { background: var(--bg); }
#side .me { border-top: 1px solid var(--line); }
#side .me a { color: var(--ink); }

/* Kundenformular, App-Hinweise */
.kunde-kopf { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); }
.app-toast { background: var(--ink); border-radius: var(--r-s); }
.app-update { background: var(--ink); }
.app-update button { color: var(--ink); }

/* Schnellsuche mit Lupe */
.gsearch { position: relative; }
.gs-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; display: flex; }
.gs-ic .ic { width: 18px; height: 18px; }
.gsearch input { padding-left: 38px; }

/* Leiste unten: nur am Handy */
#unten { display: none; }

/* ===================== Handy (90 % der Nutzung) ===================== */
@media (max-width: 820px) {
  #top { height: 56px; padding: 0 14px; background: rgba(244,244,245,.92); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px); color: var(--ink); border-bottom: 1px solid var(--line); justify-content: space-between; }
  #top .top-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
  #top .top-logo .logo-img { width: 28px; height: 28px; border-radius: 7px; }
  #top .top-me { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--green-2); font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid var(--mint-2); }
  main { padding: 68px 14px calc(104px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; margin: 10px 0 4px; }
  .gsearch { margin: 4px 0 10px; }
  .gsearch input { min-height: 44px; padding-left: 40px; border-radius: var(--r); }
  .card { padding: 14px; border-radius: var(--r); }
  .actionbar { top: 56px; background: rgba(244,244,245,.95); }
  #side { width: 86vw; max-width: 320px; box-shadow: none; }
  body.open #side { box-shadow: 12px 0 40px -20px rgba(0,0,0,.35); }
  #shade { background: rgba(24,24,27,.35); }

  #unten { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 22; height: 64px; align-items: center; justify-content: space-around;
    background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 28px -16px rgba(24,24,27,.35); padding: 0 4px; }
  #unten a, #unten button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 0; background: none; border: 0; border-radius: 12px;
    color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none; letter-spacing: 0; }
  #unten a:hover, #unten button:hover { background: none; color: var(--ink); }
  #unten .ic { width: 22px; height: 22px; }
  #unten a.on { color: var(--green); }
  #unten a.plus { flex: none; width: 52px; height: 52px; min-height: 0; margin: 0 4px; border-radius: 14px; background: var(--green); color: #fff; }
  #unten a.plus .ic { width: 26px; height: 26px; stroke-width: 2.4; }
  #unten a.plus.on { background: var(--green-2); color: #fff; }
  body.open #unten { visibility: hidden; }
  .app-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  table.cards tr { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
  table.cards td::before { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
  .card.tw { background: transparent; border: 0; }
  table.kompakt tr { gap: 4px 10px; }
  table.kompakt td.main { font-size: 16.5px; font-weight: 650; }
  table.kompakt td.main a { color: var(--ink); text-decoration: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px 14px; }
}
@media print { #unten { display: none !important; } }

/* Firmenliste: Kürzel als Ersatz für das Logo, Farbe fest je Firma */
.ini { display: none; }
.nur-pc { }
@media (max-width: 640px) {
  .nur-pc { display: none !important; }
  table.kompakt td.main::before { display: none; }
  table.kompakt td.main a { display: flex; align-items: center; gap: 12px; }
  .ini { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 9px; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
  .ini-0 { background: #12764A; } .ini-1 { background: #3F3F46; } .ini-2 { background: #9A5B0A; }
  .ini-3 { background: #1D4ED8; } .ini-4 { background: #9D174D; } .ini-5 { background: #0E7490; }
  table.kompakt .firmenlogo-liste { width: 40px; height: 40px; border-radius: 9px; margin: 0; }
  table.kompakt td[data-kurz] { padding-left: 52px; }
  table.kompakt td[data-kurz] + td[data-kurz] { padding-left: 0; }
  .resultbar { margin: 2px 0 8px; }
}
@media (max-width: 640px) {
  table.kompakt tr { position: relative; padding: 12px 14px 12px 66px; min-height: 66px; align-content: center; }
  table.kompakt .ini, table.kompakt .firmenlogo-liste { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
  table.kompakt td[data-kurz], table.kompakt td[data-kurz] + td[data-kurz] { padding-left: 0; font-size: 13.5px; }
  table.kompakt td.main a { display: block; }
}

/* Kopf einer Detailseite am Handy: Aktionen als eine wischbare Reihe, Löschen zurückhaltend */
@media (max-width: 640px) {
  .kopf-aktionen { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; margin: 4px -14px 0; padding: 2px 14px 4px; scrollbar-width: none; width: calc(100% + 28px); }
  .kopf-aktionen::-webkit-scrollbar { display: none; }
  .kopf-aktionen .btn { flex: none; min-height: 40px; padding: 0 14px; font-size: 14.5px; }
  .kopf-loeschen { order: 9; }
  .kopf-loeschen .btn.danger { background: var(--card); color: var(--bad); border: 1px solid #F3C7CF; min-height: 36px; padding: 0 12px; font-size: 14px; }
  main > .flex > div:first-child { min-width: 0; flex: 1 1 100%; }
  main > .flex .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
}
#side .brand .logo b { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }

/* ===================== Runde 2 (17.10.2026) ===================== */
/* Kacheln: klein, anklickbar */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.kachel { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.kachel b { font-size: 22px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kachel span { font-size: 13px; color: var(--ink-3); }
.kachel:hover { border-color: var(--line-2); }
.kachel:active { background: var(--bg); }
.kachel.warn b { color: var(--amber); }
/* Eine Zeile als Karte, ganz anklickbar (Titel links, Inhalt, Pfeil rechts) */
.zeilenkarte { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 12px 14px; }
.zeilenkarte .zk-titel { font-weight: 650; }
.zeilenkarte .zk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.zeilenkarte .zk-pfeil { margin-left: auto; color: var(--ink-3); font-size: 22px; line-height: 1; }
a.zeile-link { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--line); }
a.zeile-link:last-child { border-bottom: 0; }
@media (max-width: 640px) { .kacheln { grid-template-columns: repeat(3, 1fr); } .kachel b { font-size: 20px; } .kachel span { font-size: 12px; } }
/* Tastatur offen: Leiste unten ausblenden */
body.tippt #unten { display: none !important; }

/* Firmenseite (Runde 2): ruhiger Kopf, „Mehr“-Menü, Bereiche statt langer Reiterleiste */
.firmenkopf { margin: 6px 0 12px; }
.fk-titel { display: flex; align-items: center; gap: 12px; }
.fk-titel h1 { margin: 6px 0; }
.fk-titel .firmenlogo-klein { width: 40px; height: 40px; margin: 0; border-radius: 9px; }
.fk-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 10px; }
.fk-meta .chip { text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; }
.fk-meta a.chip:hover { border-color: var(--line-2); }
.zustaendig > summary { cursor: pointer; }
.fk-knoepfe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fk-knoepfe .btn { min-height: 42px; }
.aktionsmenue { position: relative; }
.aktionsmenue > summary { list-style: none; cursor: pointer; }
.aktionsmenue > summary::-webkit-details-marker { display: none; }
.aktionsmenue .car, .zustaendig .car { font-size: 10px; opacity: .7; margin-left: 4px; }
.am-panel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 14px 30px -16px rgba(24,24,27,.35); padding: 6px; display: grid; }
.am-panel a, .am-panel button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; font-weight: 550; background: none; border: 0; justify-content: flex-start; width: 100%; font-size: 15px; }
.am-panel a:hover, .am-panel button:hover { background: var(--bg); }
.am-panel form { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.am-panel .am-loeschen { color: var(--bad); }
.tabs.bereiche small { color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.firmendaten .flex { padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: nowrap; align-items: baseline; }
.firmendaten .flex > strong { text-align: right; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.unterblock { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.unterblock > summary { color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.unterblock[open] > summary { margin-bottom: 4px; }
.unterblock .flex:last-of-type { border-bottom: 0; }
@media (max-width: 640px) {
  .tabs.bereiche { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border: 0; margin: 4px 0 12px; overflow: visible; }
  .tabs.bereiche a { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 9px 4px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); font-size: 13.5px; color: var(--ink-2); }
  .tabs.bereiche a.on { border-color: var(--green); color: var(--green-2); background: var(--mint); }
  .fk-knoepfe .btn { flex: 1 1 0; }
  .fk-knoepfe .aktionsmenue { flex: 1 1 0; }
  .fk-knoepfe .aktionsmenue > summary { width: 100%; }
  .am-panel { left: auto; right: 0; }
  .kacheln.k4, .firmenkopf + .kacheln { grid-template-columns: 1fr 1fr; }
}

/* Umschalter als Farbknopf: rot = setzen/sperren/entziehen, grün = freigeben */
button.gruen, .btn.gruen { background: var(--green); color: #fff; }
button.gruen:hover, .btn.gruen:hover { background: var(--green-2); }
button.rot, .btn.rot { background: var(--card); color: var(--bad); border: 1px solid #F3C7CF; }
button.rot:hover, .btn.rot:hover { background: var(--rose); }
.umschalter { margin: 8px 0 0; }
.umschalter > button { min-width: 160px; }
.umschalter .unterblock input { margin-top: 4px; }
.sperrzeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sperrzeile .umschalter { margin: 0; }
.sperrzeile .umschalter > button { min-width: 0; }
.umschalter-auf { margin-top: 10px; }
.umschalter-auf > summary { list-style: none; display: inline-flex; cursor: pointer; }
.umschalter-auf > summary::-webkit-details-marker { display: none; }
.umschalter-auf[open] > summary { margin-bottom: 8px; }

/* Leere Zustände schmal (Marvin 17.10.2026) */
.empty { padding: 0; margin: 0; font-size: 14.5px; }
.card:has(> .empty:only-child), .card:has(> .empty:first-child + p.m:last-child) { padding: 10px 14px; }
.card:has(> .empty:first-child + p.m:last-child) { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card:has(> .empty:first-child + p.m:last-child) > p.m { margin: 0; }
h2 + .card:has(> .empty:only-child) { margin-top: -2px; }
@media (max-width: 640px) { h2 { font-size: 18px; margin: 18px 0 6px; } }

/* QR & NFC (Runde 2): schlanke Zeilen, Aktionen nur bei Auswahl */
.qr-kopf { align-items: center; margin-bottom: 6px; }
.qr-kopf h1 { margin: 6px 0; }
.qr-neu-panel { right: 0; left: auto; min-width: 260px; padding: 10px; }
.qr-neu-panel .uw-go { margin-top: 8px; }
.qr-oeffnen { padding: 12px; }
.qr-oeffnen .uw-go { margin: 0 0 8px; min-height: 50px; }
.qr-oeffnen .uw-row { margin: 0; }
.qr-reiter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--bg-2); border-radius: var(--r); margin: 12px 0 8px; }
.qr-reiter a { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 40px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.qr-reiter a b { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; }
.qr-reiter a.on { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.qr-reiter a.on b { color: var(--green); }
.qr-listenkopf { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 6px; }
.qr-listenkopf .uw-alle { margin: 0; font-size: 14px; }
.qr-liste { list-style: none; margin: 0 0 10px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.qr-liste li { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.qr-liste li:last-child { border-bottom: 0; }
.qr-liste li.neu { background: var(--mint); }
.qr-liste li:has(input:checked) { background: #F0F7F3; }
.qr-liste input[type=checkbox] { width: 20px; height: 20px; }
.qr-zeile { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; padding: 10px 0; color: var(--ink); text-decoration: none; align-items: center; }
.qr-code { font: 650 16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }
.qr-wer { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-2); text-align: right; }
.qr-chips { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; }
.qr-chips .chip { font-size: 11.5px; padding: 1px 7px; }
.qr-aktionen { display: none; position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 15; gap: 8px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 28px -16px rgba(24,24,27,.35); margin: 0 0 12px; }
.uw-liste-form:has(input[name="id[]"]:checked) .qr-aktionen { display: flex; }
.qr-aktionen .qr-anzahl { margin-right: auto; font-weight: 600; font-size: 14px; }
.qr-aktionen .am-panel { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; }
.qr-druck-panel { min-width: 280px; padding: 10px; display: grid; gap: 10px; }
@media (min-width: 821px) { .qr-aktionen { bottom: 12px; } }

/* Rechnung (Runde 2): Positionen als schlanke Zeilen */
.posz { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.posz > strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sumbox { max-width: none; }
.sumbox .total { border-top-color: var(--ink); color: var(--ink); }
.fk-knoepfe form.nur-inline { display: inline-flex; margin: 0; }
.fk-knoepfe form.nur-inline button { min-height: 42px; }
.datum-aendern { margin-top: 8px; }
.datum-aendern input { width: auto; margin: 0; }
details.einkl.card > summary h3 { display: inline; }
@media (max-width: 640px) { .fk-knoepfe form.nur-inline { flex: 1 1 0; } .fk-knoepfe form.nur-inline button { width: 100%; } }
.pruef-ok { margin: 0 0 10px; }
.qr-liste li { flex-wrap: wrap; }
.qr-liste a.uw-firma { flex: 1 1 100%; padding: 0 0 10px 30px; margin-top: -6px; font-size: 14px; color: var(--green); text-decoration: none; font-weight: 550; }
.leiste-wahl label.inline { min-height: 40px; }
.leiste-wahl .i { display: inline-flex; width: 22px; justify-content: center; }
.leiste-wahl .ic { width: 18px; height: 18px; }

/* Einstellungen (Runde 2): Übersicht in Gruppen, Liste zum Antippen */
.einst-gruppen { display: grid; gap: 4px; max-width: 820px; }
.einst-gruppe h2 { margin: 16px 0 6px; font-size: 15px; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.einst-liste { padding: 0; overflow: hidden; }
.einst-liste a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 56px; }
.einst-liste a:last-child { border-bottom: 0; }
.einst-liste a:hover { background: var(--bg); }
.einst-liste strong { display: block; font-weight: 600; }
.einst-liste small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.einst-liste .zk-pfeil { color: var(--ink-3); font-size: 22px; }
.einst-zurueck { display: none; }
.snav a.on { background: var(--mint); color: var(--green-2); }
.snav .sgrp { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
@media (max-width: 820px) {
  .einst-zurueck { display: block; }
  .settings .snav { display: none; }
  .settings { display: block; }
}

/* Menü und Leiste: Ziehen zum Sortieren */
.sortier { list-style: none; margin: 8px 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.sortier li { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 4px; border-bottom: 1px solid var(--line); background: var(--card); }
.sortier li:last-child { border-bottom: 0; }
.sortier li.zieht { background: var(--mint); box-shadow: 0 8px 20px -10px rgba(24,24,27,.4); position: relative; z-index: 2; }
.sortier label.inline { flex: 1; min-height: 46px; font-size: 15.5px; }
.sortier .i { display: inline-flex; width: 22px; justify-content: center; }
.sortier .ic { width: 18px; height: 18px; }
.griff { width: 36px; min-height: 46px; display: grid; place-items: center; color: var(--ink-3); font-size: 18px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.griff:active { cursor: grabbing; }
.sortier-karte.geaendert .schnell-btns button:first-child { box-shadow: var(--focus); }

/* Formulare in den Firmen-Reitern: zu, als Knopf aufklappbar */
details.aufklapp { padding: 0; }
details.aufklapp > summary { padding: 12px 16px; display: flex; align-items: center; gap: 8px; }
details.aufklapp > summary h3 { font-size: 15px; color: var(--green); }
details.aufklapp > summary::after { content: "+"; margin-left: auto; color: var(--green); font-size: 20px; font-weight: 600; }
details.aufklapp[open] > summary::after { content: "–"; }
details.aufklapp[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 0; }
details.aufklapp > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.aufklapp > form:last-child, details.aufklapp > :last-child:not(summary) { margin-bottom: 14px; }
details.aufklapp > form:first-of-type { margin-top: 12px; }

/* Einstellungen (Runde 3): Unterseiten einspaltig wie „Menü und Leiste“ */
.einst-zurueck { display: block; }
.einst-seite { max-width: 820px; }
.einst-seite > h1 { margin-top: 4px; }
.katalog-liste { padding: 0; overflow: hidden; }
.katalog-liste details.entry { padding: 0; border-bottom: 1px solid var(--line); }
.katalog-liste details.entry:last-of-type { border-bottom: 0; }
.katalog-liste details.entry > summary { padding: 12px 16px; flex-wrap: nowrap; justify-content: space-between; list-style: none; min-height: 56px; }
.katalog-liste details.entry > summary::-webkit-details-marker { display: none; }
.katalog-liste details.entry > summary:hover { background: var(--bg); }
.katalog-liste details.entry.off .kl-name strong { color: var(--ink-3); }
.kl-name { min-width: 0; }
.kl-name strong { display: block; font-weight: 600; }
.kl-name small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.kl-preis { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 14px; }
.katalog-liste details.entry > form { padding: 4px 16px 14px; }
@media (max-width: 820px) { .kl-preis { font-size: 13px; } }
.katalog-liste details.entry > summary .zk-pfeil { color: var(--ink-3); font-size: 22px; transition: transform .15s; }
.katalog-liste details.entry[open] > summary .zk-pfeil { transform: rotate(90deg); }
.katalog-liste details.entry > form.inline-form { padding: 4px 16px 14px; }
.katalog-liste .sub-entry { margin-left: 0; padding-left: 20px; border-bottom: 1px solid var(--line); }
.katalog-liste .sub-entry details.entry { border-bottom: 0; }
.katalog-liste form.sub-entry { padding: 8px 16px 8px 36px; }

/* Rechnungsliste am Handy (Runde 3): Nummer und Status, darunter Firma, rechts der Betrag; Antippen öffnet die Rechnung */
.rl-zahl { display: none; }
@media (max-width: 640px) {
  table.rliste tr { padding: 12px 14px; min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  table.rliste tr:first-child { display: none; }
  table.rliste td.main { grid-column: 1; font-size: 15.5px; }
  table.rliste td.main a { display: inline; }
  table.rliste td.main a::after { content: ""; position: absolute; inset: 0; }
  table.rliste td.main .chip { font-size: 11.5px; padding: 1px 7px; vertical-align: 2px; }
  table.rliste td.main .chip:not(.rl-zahl) { display: none; }
  table.rliste .rl-zahl { display: inline-block; }
  table.rliste td.rl-firma { grid-column: 1; grid-row: 2; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.rliste td.rl-firma a { color: inherit; text-decoration: none; }
  table.rliste td.rl-betrag { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-weight: 650; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
  table.rliste td.inv-hak { display: none; }
  table.rliste tr.notetr { display: none; }
}

/* Runde 3: kein „Mehr“ in der Leiste, das Logo oben öffnet das Menü */
#top button.top-logo { background: none; border: 0; padding: 4px 6px 4px 0; min-height: 44px; cursor: pointer; font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); }
#top button.top-logo:hover { background: none; }
#top .top-pfeil { color: var(--ink-3); font-size: 13px; margin-left: -4px; }

/* Einkauf (Runde 3) */
.ek-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.ek-filter select { width: auto; min-width: 0; flex: 1 1 150px; margin: 0; }
.ek-filter button { flex: 0 0 auto; }
.ekliste th.r, .ekliste td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ek-summe { margin: 10px 4px 0; color: var(--ink-2); font-size: 14px; text-align: right; }
a.kachel { text-decoration: none; color: inherit; }
@media (max-width: 640px) {
  table.ekliste tr { padding: 12px 14px; min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  table.ekliste tr:first-child { display: none; }
  table.ekliste td.main { grid-column: 1; font-size: 15.5px; }
  table.ekliste td.main a::after { content: ""; position: absolute; inset: 0; }
  table.ekliste td.ek-wer { grid-column: 1; grid-row: 2; color: var(--ink-3); font-size: 13.5px; }
  table.ekliste td.ek-datum { display: none; }
  table.ekliste td.ek-betrag { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 650; color: var(--ink); font-size: 15px; }
  table.ekliste .chip { font-size: 11.5px; padding: 1px 7px; }
  .ek-summe { text-align: left; }
}
#top button.top-logo { white-space: nowrap; width: auto; flex: 0 0 auto; gap: 8px; }
#top button.top-logo span { white-space: nowrap; }
@media (max-width: 640px) { form.inv-sammel { display: none; } }
