:root {
  --bg: #d36743; --card: #fff; --ink: #123347; --text: #6f6f6f; --muted: #a3a3a3;
  --line: #ececec; --ok: #2f7d5b; --warn: #b7791f; --bad: #b4372a; --chip: rgba(255,255,255,.22);
  --radius: 4px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 300 16px/1.55 Roboto, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--ink); }
h1, h2, h3 { color: var(--ink); font-weight: 300; margin: 0 0 8px; line-height: 1.2; }

/* Kopf: Navigation links, Logo mittig, Benutzer rechts */
.top { background: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.top .logo img { height: 72px; width: auto; display: block; }
.top .rechts { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.top .tag { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--bg);
  font-weight: 500; }
.top .wer { font-size: 14px; color: var(--ink); }
.top form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; padding: 8px 4px; }

main { max-width: 1200px; margin: 0 auto; padding: 16px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.chips a { flex: none; color: #fff; text-decoration: none; padding: 8px 14px; border-radius: 999px;
  background: var(--chip); font-weight: 400; font-size: 15px; }
.chips a.on { background: #fff; color: var(--ink); }
.chips .n { opacity: .75; margin-left: 4px; }

.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid { grid-template-columns: 1fr 1fr 1fr; gap: 24px; } }

.card { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex;
  flex-direction: column; text-decoration: none; color: inherit; }
.card .img { aspect-ratio: 16/10; background: #f3efe9; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.card .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h2 { font-size: 24px; }
.card p { margin: 0; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; padding-top: 10px; display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap; font-size: 15px; color: var(--ink); }

.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px;
  border-radius: 999px; background: var(--line); color: var(--ink); }
.badge.bad { background: #fbe4e1; color: var(--bad); }
.badge.warn { background: #fdf0d8; color: var(--warn); }
.badge.ok { background: #e2f3ea; color: var(--ok); }

.empty { background: rgba(255,255,255,.9); border-radius: var(--radius); padding: 24px;
  color: var(--ink); }

.panel { background: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel h3 { font-size: 18px; margin-bottom: 10px; }
.back { color: #fff; text-decoration: none; display: inline-block; margin-bottom: 12px; }
.hero { width: 100%; max-height: 360px; object-fit: contain; background: #f6f3ef;
  border-radius: var(--radius); display: block; }
label { display: block; color: var(--ink); font-weight: 400; font-size: 14px; margin: 14px 0 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid #ddd; border-radius: var(--radius); padding: 10px 12px; background: #fff; }
textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-block; width: 100%; margin-top: 18px; padding: 13px 16px; border: 0;
  border-radius: var(--radius); background: var(--ink); color: #fff; font: inherit;
  font-weight: 400; font-size: 16px; cursor: pointer; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; background: #fff; }
.flash.ok { color: var(--ok); } .flash.err { color: var(--bad); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 15px; }
dt { color: var(--muted); } dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
ul.plain li:last-child { border: 0; }
.muted { color: var(--muted); font-size: 14px; }
.two { display: grid; gap: 16px; }
@media (min-width: 900px) { .two { grid-template-columns: 1.1fr 1fr; align-items: start; } }

.login { max-width: 380px; margin: 12vh auto 0; }
.login .panel { padding: 28px; }
.login img { width: 150px; display: block; margin: 0 auto 18px; }
.ink { color: var(--ink); margin-top: 0; }
.spaced { margin-top: 8px; }
fieldset.merkmal { border: 0; border-top: 1px solid var(--line); margin: 22px 0 0; padding: 14px 0 0; }
fieldset.merkmal legend { color: var(--ink); font-weight: 400; padding: 0 6px 0 0; }
.chips-in { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { margin: 0; display: inline-flex; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { padding: 8px 14px; border-radius: 999px; background: #f2f2f2; color: var(--ink);
  font-size: 15px; cursor: pointer; border: 1px solid transparent; }
.pill input:checked + span { background: var(--ink); color: #fff; }
.pill input:focus-visible + span { border-color: var(--bg); }
.emp { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 40px; align-items: center;
  gap: 10px; padding: 6px 0; }
.chk { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.chk input { width: 20px; height: 20px; accent-color: var(--ink); }
.emp input[type="range"] { width: 100%; padding: 0; border: 0; accent-color: var(--bg); }
.emp output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.kol li { display: block; }
.auto { display: inline-block; width: 20px; text-align: center; color: var(--muted); }
.auto.on { color: var(--ok); font-weight: 500; }
.savebar { position: sticky; bottom: 0; background: #fff; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.mainnav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; font-size: 15px; }
.mainnav a { text-decoration: none; color: var(--ink); white-space: nowrap; }
@media (max-width: 720px) {
  .top { grid-template-columns: 1fr auto; row-gap: 4px; }
  .top .logo { grid-column: 1 / -1; justify-self: center; }
  .top .logo img { height: 56px; }
  .top .tag, .top .wer { display: none; }
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type="text"], .row input:not([type]) { flex: 1; min-width: 120px; }
.small { font-size: 13px; }
.btn.sm { width: auto; margin: 0; padding: 8px 12px; font-size: 14px; }
.btn.ghost { background: #f2f2f2; color: var(--ink); }
.btn.danger { background: #fbe4e1; color: var(--bad); }
.opt { padding: 10px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border: 0; }
.inactive { opacity: .5; }
.list a.item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pagehead { color: #fff; font-size: 26px; margin: 4px 0 6px; }
.lead { color: #fff; opacity: .9; margin: 0 0 16px; }
.chk input { flex: none; }

/* Übersicht: Aktionen */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar form { margin: 0; }
.toolbar .btn { width: auto; margin: 0; padding: 10px 14px; }
.savebar .btn + .btn { margin-top: 8px; }

/* Merkmale: Hinweis "nur Backoffice" klein und ohne Umbruch */
.nurbo { white-space: nowrap; font-size: 12px; color: var(--muted); margin-left: 4px; }

/* Merkmal-Zeilen: Name links in fester Spalte, Regler und Zahl sauber daneben */
.emp { grid-template-columns: minmax(200px, 1fr) 2fr 40px; column-gap: 16px; min-height: 40px; }
.emp .chk { flex-wrap: wrap; row-gap: 2px; line-height: 1.3; }
.nurbo { white-space: nowrap; font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; }
@media (max-width: 520px) { .emp { grid-template-columns: 1fr 1fr 32px; column-gap: 10px; } }

/* Merkmale: Werte als Tabelle mit festen Spalten */
.otab { margin-top: 10px; }
.ohead, .orow { display: grid; align-items: center; gap: 8px;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.4fr) 92px 44px 48px 44px 44px; }
.ohead { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.orow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.orow input:not([type]) { width: 100%; min-width: 0; }
.orow .chk { justify-content: center; }
.orow .btn.sm { width: 44px; padding: 8px 0; text-align: center; }
.orow.neu { grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.4fr) auto; border-bottom: 0; }
.orow.neu .btn.sm { width: auto; padding: 8px 14px; }
.orow.inactive input { opacity: .55; }
@media (max-width: 720px) {
  .ohead { display: none; }
  .orow { grid-template-columns: 1fr 1fr; }
  .orow.neu { grid-template-columns: 1fr 1fr; }
}

/* Händler */
.list a.item.haendler { align-items: center; }
.hlogo { flex: none; width: 56px; height: 36px; display: flex; align-items: center; justify-content: center; }
.hlogo img { max-width: 56px; max-height: 36px; object-fit: contain; }
.hname { flex: 1; }
.hlogo-gross { max-width: 180px; max-height: 90px; object-fit: contain; display: block; margin-bottom: 8px; }
.hwahl { display: flex; align-items: center; gap: 10px; }
.hwahl select { flex: 1; }
.hwahl img { max-width: 64px; max-height: 32px; object-fit: contain; }
