/* Gearlog · Stylesheet – Graphit und Röhrenglühen */
:root {
  --bg: #f2f1ee; --surface: #ffffff; --surface-2: #f7f6f3; --surface-3: #ebe9e4;
  --text: #1b1d20; --muted: #62656b; --faint: #93969c;
  --border: #e0ded8; --border-strong: #c9c6bf;
  --accent: #b9650f; --accent-strong: #934f0a; --accent-soft: #f7e7d3; --accent-ink: #ffffff;
  --good: #2e7a4e; --good-soft: #e2f1e8; --warn: #9a6400; --warn-soft: #fbefd6; --bad: #b3372c; --bad-soft: #f8e3e0;
  --ki: #5b45b8; --ki-soft: #ece8fa; --ki-line: #b9aceb;
  --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 4px 16px rgba(20, 22, 26, .05);
  --radius: 10px; --radius-sm: 7px; --field-h: 40px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315; --surface: #1b1d20; --surface-2: #212327; --surface-3: #2a2d32;
    --text: #ecebe8; --muted: #a3a5aa; --faint: #74777d; --border: #2f3237; --border-strong: #43464c;
    --accent: #f0a04b; --accent-strong: #f6b971; --accent-soft: #3a2a17; --accent-ink: #1a1208;
    --good: #5cb482; --good-soft: #1b3125; --warn: #e3a944; --warn-soft: #382c15; --bad: #e57368; --bad-soft: #3b2220;
    --ki: #ad9bf2; --ki-soft: #262040; --ki-line: #4d4280;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --surface: #1b1d20; --surface-2: #212327; --surface-3: #2a2d32;
  --text: #ecebe8; --muted: #a3a5aa; --faint: #74777d; --border: #2f3237; --border-strong: #43464c;
  --accent: #f0a04b; --accent-strong: #f6b971; --accent-soft: #3a2a17; --accent-ink: #1a1208;
  --good: #5cb482; --good-soft: #1b3125; --warn: #e3a944; --warn-soft: #382c15; --bad: #e57368; --bad-soft: #3b2220;
    --ki: #ad9bf2; --ki-soft: #262040; --ki-line: #4d4280;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.08rem; }
p { margin: 0 0 .75em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .05em .35em; border-radius: 4px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .right { text-align: right; }
.hidden { display: none !important; } .pad { padding: 16px 4px; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- Rahmen */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.08rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand.big { font-size: 1.5rem; justify-content: center; margin-bottom: 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex: none; background: url("icon.svg") center/cover no-repeat; }
.brand.big .brand-mark { width: 44px; height: 44px; border-radius: 11px; }
.nav { display: flex; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 120px; }

/* ---------------------------------------------------------------- Bausteine */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-head p { margin: 0; max-width: 70ch; }
.back { display: inline-block; margin-bottom: 6px; font-size: .9rem; text-decoration: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.empty { text-align: center; padding: 40px 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--field-h); padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); }
.btn.small { height: 32px; padding: 0 12px; font-size: .9rem; }
.btn.icon { width: 36px; padding: 0; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: default; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.tag.soft { background: transparent; border: 1px solid var(--border-strong); }
.tag.good { background: var(--good-soft); color: var(--good); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.kat-pedal, .tag.kat-multieffekt, .tag.kat-switcher { background: var(--accent-soft); color: var(--accent-strong); }
.msg { padding: 10px 14px; border-radius: var(--radius-sm); }
.msg.bad { background: var(--bad-soft); color: var(--bad); } .msg.warn { background: var(--warn-soft); color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- Formulare */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
input, select { height: var(--field-h); padding: 0 10px; width: 100%; min-width: 0; }
textarea { width: 100%; padding: 10px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 600; color: var(--muted); }
label > input, label > select, label > textarea, label > .unit { font-weight: 400; }
.form .grid, .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: .88rem; }
.checks { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.unit { display: flex; align-items: center; position: relative; }
.unit input { padding-right: 42px; }
.unit span { position: absolute; right: 10px; color: var(--faint); font-size: .88rem; pointer-events: none; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.actions.sticky { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }
.actions .danger { margin-left: auto; }
.wert-row { display: grid; grid-template-columns: 130px 140px 160px 1fr 36px; gap: 8px; margin-bottom: 8px; }
.ort-row { display: grid; grid-template-columns: 1fr 36px 36px 36px; gap: 6px; margin-bottom: 6px; max-width: 520px; }
.file input { padding: 8px; height: auto; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { font: inherit; border: 0; background: var(--surface); color: var(--text); padding: 8px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* ---------------------------------------------------------------- Filter und Listen */
.filters { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.f-such { display: flex; gap: 8px; min-width: 0; }
.f-such input { flex: 1; min-width: 0; }
.seg.ansicht { flex: none; }
.seg.ansicht button { padding: 0 10px; display: inline-flex; align-items: center; color: var(--muted); }
.seg.ansicht button svg { width: 18px; height: 18px; }
/* Kachel-Ansicht im Bestand (ab 0.4.5): nur Titelbild und Name */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kachel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.kachel:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.kachel img, .kachel .k-leer { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-3); }
.kachel .k-leer { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: .8rem; padding: 8px; text-align: center; background: var(--surface-2); }
.k-name { display: flex; flex-direction: column; padding: 8px 10px 10px; min-width: 0; line-height: 1.25; }
.k-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-her { font-size: .78rem; color: var(--muted); }
.k-name strong { font-size: .92rem; }
.k-gruppe { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 8px; }
.table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tr { display: grid; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.tr.th { border-top: 0; background: var(--surface-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding-top: 8px; padding-bottom: 8px; }
a.tr:hover, label.tr:hover { background: var(--surface-2); }
.tr.dim { opacity: .6; }
.items .tr { grid-template-columns: 150px minmax(0, 2.4fr) 90px minmax(0, 1.2fr) minmax(0, 1fr) 120px; }
.imp .tr { grid-template-columns: 28px 44px 170px minmax(0, 2fr) 80px minmax(0, 1fr) 110px; font-size: .92rem; }
label.tr { font-weight: 400; color: var(--text); font-size: .92rem; cursor: pointer; }
.c-wert { font-variant-numeric: tabular-nums; white-space: nowrap; }
.items .c-art { min-width: 0; }
.items .c-art .tag { display: block; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat.warn strong { color: var(--warn); }

/* ---------------------------------------------------------------- Fotos und Dokumente */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.inline select { width: auto; height: 32px; }
.medien { position: relative; }
.m-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.m-empty { margin: 4px 0 0; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 10px; }
.m-tile { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-3); overflow: hidden; cursor: pointer; }
.m-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-tile:hover { border-color: var(--border-strong); }
.m-tags { position: absolute; left: 5px; top: 5px; right: 5px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.m-tags .tag { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); font-size: .72rem; }
.m-tags .tag.star { color: var(--accent-strong); }
.m-tags .tag.warn { background: var(--warn-soft); color: var(--warn); }
.m-docs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.m-doc { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.m-doc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 500; color: var(--text); }
.m-doc-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-pdf { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 46px; border-radius: 5px; background: var(--bad-soft); color: var(--bad); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.m-pdf.big { width: 80px; height: 100px; font-size: 1.1rem; }
.m-drop { display: none; position: absolute; inset: 0; border: 2px dashed var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent-soft) 85%, transparent);
  align-items: center; justify-content: center; font-weight: 700; color: var(--accent-strong); pointer-events: none; }
.medien.drag .m-drop { display: flex; }
.m-netz { border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 12px; }
.m-netz-form { display: flex; gap: 8px; margin-bottom: 6px; }
.m-netz-form input { flex: 1; }
.m-grid.pick .m-tile { border-width: 2px; }
.m-tile.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.m-tile.pick.on::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.m-tile.loading { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; cursor: default; }
@keyframes shimmer { to { background-position: -200% 0; } }
.m-size { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; background: color-mix(in srgb, var(--surface) 85%, transparent); text-align: left; }
.m-doc.pick { cursor: pointer; font-weight: 400; }
.netz-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.netz-hint select { width: auto; height: 32px; }
.m-doc.pick select { width: auto; height: 32px; }

/* Großansicht */
.noscroll { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(10, 11, 13, .94); display: flex; flex-direction: column; color: #ecebe8; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-pdf { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb-nav, .lb-close { position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; }
.lb-nav:hover, .lb-close:hover { background: rgba(255,255,255,.2); }
.lb-nav.prev { left: 12px; top: 50%; transform: translateY(-50%); } .lb-nav.next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 12px; top: max(12px, env(safe-area-inset-top)); }
.lb-bar { background: var(--surface); color: var(--text); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; }
.lb-fields { display: grid; grid-template-columns: 160px 1fr; gap: 8px; }
.lb-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lb-info { grid-column: 1 / -1; margin: 0; }

/* Vorschaubild in der Liste */
.c-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb { flex: none; width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--surface-3); }
.thumb.none { background: var(--surface-2); border: 1px dashed var(--border); }

/* ---------------------------------------------------------------- Anmeldung */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.card.login h1 { text-align: center; }

/* ---------------------------------------------------------------- Handy */
/* ---------------------------------------------------------------- KI */
.ki-badge { display: inline-flex; align-items: center; justify-content: center; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--ki); color: var(--surface);
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; flex: none; }
h2 .ki-badge { margin-right: 4px; }
.tag.ki { background: var(--ki-soft); color: var(--ki); }
.btn .count { background: var(--ki); color: var(--surface); border-radius: 99px; padding: 0 7px; font-size: .78rem; line-height: 1.5; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ki-card { border-color: var(--ki-line); }
.ki-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.ki-head h2 { margin-bottom: 4px; }
.ki-head > .head-btns { flex: none; }
.ki-head p { margin: 0; }
.ki-hinweis { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--ki-line); background: var(--ki-soft); border-radius: 0 6px 6px 0; }
.ki-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ki-sum > span { margin-right: auto; }
label.ki-has > input, label.ki-has > select, label.ki-has > .unit input { border-color: var(--ki-line); box-shadow: 0 0 0 2px var(--ki-soft); }
.ki-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: 7px; background: var(--ki-soft);
  color: var(--text); font-weight: 400; font-size: .86rem; }
.ki-sug.diff { background: var(--warn-soft); }
.ki-sug .ki-txt { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.ki-sug .ki-btns { display: flex; gap: 4px; }
.ki-sug .btn.small { height: 28px; padding: 0 10px; font-size: .84rem; }
#ki-neupreis .ki-sug { margin: 0 0 10px; }
/* KI-Zeile im Gerät (ab 0.4.4): eine Zeile, Einzelheiten nur aufgeklappt */
.ki-card { padding-top: 10px; padding-bottom: 10px; }
.ki-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 32px; }
.ki-z-txt { flex: 1 1 160px; min-width: 0; font-size: .9rem; }
.ki-auf { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ki-auf > p { margin: 0 0 8px; }
.ki-liste { display: flex; flex-direction: column; gap: 6px; }
.ki-liste .ki-feld { flex: 0 0 150px; color: var(--muted); font-weight: 600; font-size: .84rem; }
.ki-auf .ki-sum { margin-top: 10px; padding-top: 0; border-top: 0; }
.ki-sum .grow { flex: 1; }
.lbl-kopf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ki-dot { width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ki-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ki); box-shadow: 0 0 0 3px var(--ki-soft); }
.ki-dot.diff::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.ki-dot.an::before { box-shadow: 0 0 0 3px var(--ki-line); }
h2 .ki-dot { margin-left: 6px; vertical-align: 1px; }
.ki-ok { font-size: .68rem; font-weight: 700; color: var(--ki); opacity: .75; text-decoration: none; letter-spacing: .02em; }
.ki-ok:hover { opacity: 1; text-decoration: underline; }
label.ki-has > .ki-sug { margin-top: 2px; }
/* Erklärung per ⓘ */
.info { position: relative; display: inline-flex; vertical-align: 1px; margin-left: 4px; }
.info-btn { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--faint); background: none; color: var(--muted); font: italic 700 .7rem/1 Georgia, serif;
  padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.info-btn:hover, .info-btn:focus-visible { color: var(--text); border-color: var(--muted); }
.info-pop { position: absolute; top: calc(100% + 6px); left: -8px; z-index: 40; width: max-content; max-width: min(320px, 78vw); padding: 8px 11px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  font-size: .84rem; font-weight: 400; line-height: 1.4; letter-spacing: 0; text-transform: none; white-space: normal; }
.info-pop.hidden { display: none; }
.kp-quellen { margin: 8px 0 0; }
.kp-quellen summary { cursor: pointer; width: fit-content; }
.kp-quellen[open] summary { margin-bottom: 4px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin: 6px 0 10px; }
.bar span { display: block; height: 100%; background: var(--ki); transition: width .4s; }
.ki-log { margin: 10px 0 0; padding-left: 18px; font-size: .86rem; color: var(--muted); }
.ki-log li.bad { color: var(--bad); }
.ki-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; position: sticky; top: 58px; z-index: 5; padding: 10px 14px; }
.ki-tools .grow { flex: 1; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ki-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 8px; }
.ki-item-head a { color: var(--text); text-decoration: none; }
.ki-item-head .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ki-rows { display: flex; flex-direction: column; }
label.ki-row { display: grid; grid-template-columns: 22px minmax(120px, 1fr) minmax(140px, 1.4fr) minmax(120px, 1fr); align-items: baseline; gap: 4px 12px;
  padding: 8px 4px; border-top: 1px solid var(--border); font-weight: 400; color: var(--text); font-size: .92rem; cursor: pointer; }
label.ki-row:first-child { border-top: 0; }
label.ki-row.diff .k-wert strong { color: var(--warn); }
.ki-row .k-feld { color: var(--muted); }
.ki-row .k-hin { display: block; }
.ki-row .k-q { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Werkstatt, Boards, Vergleich (0.4) */
.grid .span2 { grid-column: span 2; }
.grow { flex: 1; }
h2.mt { margin-top: 18px; }
p.good, .good { color: var(--good); }
p.warn { color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.mod { background: var(--warn-soft); color: var(--warn); }
.tag.ws-umbau { background: var(--warn-soft); color: var(--warn); }
.tag.ws-reparatur { background: var(--bad-soft); color: var(--bad); }
.tag.ws-service { background: var(--good-soft); color: var(--good); }
.ws-form { margin: 10px 0 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.ws-entry { padding: 12px 0; border-top: 1px solid var(--border); }
.ws-entry:first-child { border-top: 0; }
.ws-entry.off { opacity: .65; }
.ws-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ws-text { margin: 6px 0 4px; white-space: pre-line; }
.ws-fotos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ws-thumb { width: 64px; height: 64px; padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; cursor: pointer; background: var(--surface-3); }
.ws-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.b-card { display: block; color: var(--text); text-decoration: none; margin: 0; }
.b-card:hover { border-color: var(--border-strong); }
.b-chain { color: var(--muted); margin: 0; }
.b-end { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 2px; }
.b-end.soft { color: var(--faint); }
.b-list { border-left: 3px solid var(--accent-soft); margin-left: 8px; padding-left: 10px; }
.b-slot { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(150px, 220px) auto; align-items: center; gap: 8px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.b-slot:first-child { border-top: 0; }
.b-nr { font-weight: 700; color: var(--accent); text-align: center; }
.b-name { display: flex; flex-direction: column; min-width: 0; }
.b-name a { color: var(--text); text-decoration: none; }
.b-slot select { height: 34px; }
.b-btns { display: flex; }
.b-sels { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.b-sels select { width: 100%; }
/* Loop-Switcher: eigener Kasten in der Kette, Loops als Unterabschnitte */
.b-sw { margin: 6px 0 6px 8px; padding: 6px 12px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.b-sw > .b-list { border-left: 0; margin-left: 0; padding-left: 0; }
.b-slot-sw .b-nr { color: var(--text); }
.b-sw-grp { margin-top: 6px; }
.b-sw-h { font-size: .78rem; font-weight: 700; color: var(--accent-strong); text-transform: uppercase; letter-spacing: .05em; padding: 4px 0 0 2px; }
.b-sw-frei { margin: 8px 0 0 2px; }
.b-sw-aus { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.b-sw-aus label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.b-btns .btn.icon { width: 32px; height: 32px; }
.b-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.b-add select { max-width: 360px; }
.b-warn { margin: 0 0 12px; padding-left: 18px; }
.b-warn li.bad { color: var(--bad); font-weight: 600; }
.b-warn li.warn { color: var(--warn); }
.b-outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.b-out { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.b-out.leer { opacity: .7; }
.b-out p { margin: 0; }
.bar.over span { background: var(--bad); }
.b-aus-head, .b-aus-row { display: grid; grid-template-columns: 80px 110px 130px 34px minmax(120px, 1fr) 36px; gap: 8px; align-items: center; }
.b-aus-row input[type=checkbox] { width: 20px; height: 20px; justify-self: center; }
.b-nz { padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.b-nz-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.b-nz-info:empty { display: none; }
.b-nz-view { margin-top: 12px; }
.b-nz-view h3 { font-size: .95rem; margin: 0 0 2px; }
.b-aus-row { margin-bottom: 6px; }
.v-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: .9rem; }
.v-pick select { width: auto; max-width: 100%; }
.v-ki { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.v-ki p { margin: 0; flex: 1 1 260px; }
.v-scroll { overflow-x: auto; margin-top: 10px; }
.v-table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .92rem; }
.v-table th, .v-table td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.v-table thead th { position: sticky; top: 0; background: var(--surface); }
.v-table thead a { color: var(--text); text-decoration: none; }
.v-table thead .thumb { display: block; margin-bottom: 6px; }
.v-table tbody th { color: var(--muted); font-weight: 600; width: 160px; }
.v-table tr.diff td { background: var(--accent-soft); }
.v-table tr.v-group td { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding-top: 14px; border-bottom: 0; }
.v-ki-text ul { margin: 0 0 .75em; padding-left: 20px; }
.v-dop { padding: 10px 0; border-top: 1px solid var(--border); }
.v-dop:first-of-type { border-top: 0; }
.v-dop p { margin: 4px 0 8px; }
.kp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 3px 0; font-size: .92rem; }
.kp-eigen { margin-top: 12px; }

@media (max-width: 760px) {
  .grid .span2 { grid-column: auto; }
  .b-slot { grid-template-columns: 24px minmax(0, 1fr); }
  .b-slot select, .b-slot .b-btns, .b-slot .b-sels { grid-column: 2; }
  .b-sw { margin-left: 0; padding: 6px 10px 10px; }
  .b-aus-head { display: none; }
  .b-aus-row { grid-template-columns: 60px 1fr 1fr 30px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  .b-aus-row [name=a_notiz] { grid-column: 1 / 4; }
  .kp-row { grid-template-columns: 1fr; gap: 0; }
  .ki-head { flex-direction: column; }
  .ki-liste .ki-feld { flex-basis: 100%; }
  label.ki-row { grid-template-columns: 22px 1fr; }
  label.ki-row .k-wert, label.ki-row .k-q { grid-column: 2; }
  .ki-tools { position: static; }
  .topbar { gap: 10px; backdrop-filter: none; background: var(--surface); }   /* backdrop-filter würde die feste Leiste unten einfangen */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; justify-content: space-around; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); z-index: 30; }
  .nav a { flex-direction: column; gap: 2px; font-size: .72rem; padding: 6px 4px; flex: 1; }
  .topbar { justify-content: center; }
  .brand span:last-child { display: inline; }
  .main { padding: 16px 12px 110px; }
  .page-head { flex-wrap: wrap; }
  .filters { grid-template-columns: 1fr 1fr; }
  .f-such { grid-column: 1 / -1; }
  .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .k-name { padding: 6px 7px 8px; } .k-her { font-size: .7rem; } .k-name strong { font-size: .8rem; }
  .tr.th { display: none; }
  .items .tr { grid-template-columns: 1fr auto; grid-template-areas: "name wert" "art sn" "bj ort"; gap: 3px 10px; padding: 12px 14px; }
  .items .c-name { grid-area: name; } .items .c-wert { grid-area: wert; } .items .c-art { grid-area: art; }
  .items .c-sn { grid-area: sn; text-align: right; font-size: .85rem; } .items .c-bj { grid-area: bj; font-size: .85rem; color: var(--muted); }
  .items .c-ort { grid-area: ort; text-align: right; font-size: .85rem; color: var(--muted); }
  .imp .tr { grid-template-columns: 28px 1fr auto; gap: 3px 10px; }
  .imp .tr > span:nth-child(2) { display: none; }
  .imp .tr > span:nth-child(3) { grid-column: 2; grid-row: 2; }
  .imp .tr > span:nth-child(4) { grid-column: 2; grid-row: 1; }
  .imp .tr > span:nth-child(5), .imp .tr > span:nth-child(6) { display: none; }
  .imp .tr > span:nth-child(7) { grid-column: 3; grid-row: 1; }
  .wert-row { grid-template-columns: 1fr 1fr 36px; }
  .wert-row [name="w_datum"] { grid-column: 1; } .wert-row [name="w_quelle"] { grid-column: 2; }
  .wert-row [data-del-wert] { grid-column: 3; grid-row: 1; }
  .actions.sticky { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .m-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .lb-bar { grid-template-columns: 1fr; }
  .lb-fields { grid-template-columns: 1fr; }
  .lb-actions { justify-content: flex-start; }
  .lb-nav { display: none; }
  .m-netz-form { flex-wrap: wrap; } .m-netz-form input { flex-basis: 100%; }
  .items .tr { grid-template-columns: 1fr auto; }
  .thumb { width: 34px; height: 34px; }
}
