/* Brotfinder – Systemschriften, nichts wird von außen nachgeladen */
:root {
  color-scheme: light dark;
  --bg: #faf7f2; --card: #ffffff; --fg: #2b2118; --muted: #6b5b4b; --line: #e4dbcf;
  --accent: #8a5a1f; --accent-fg: #ffffff; --chip: #f1e8da; --warn: #fdf1d6; --warn-line: #e6c574;
  --vegan: #1a7f2e; --sa: #8a5a1f; --sb: #2e6b34; --sc: #7fbf6a; --sc-fg: #1d2b14; --sc-text: #4a9a2e; --focus: #1a5fb4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1814; --card: #27201a; --fg: #f3ece3; --muted: #b8a997; --line: #3d3329;
    --accent: #e0a85a; --accent-fg: #1d1814; --chip: #3a2f24; --warn: #3a3020; --warn-line: #8a6d2a;
    --vegan: #6fdc7f; --sa: #c98a3e; --sb: #4f9a57; --sc: #9fd88a; --sc-fg: #1d2b14; --sc-text: #9fd88a; --focus: #8ab4f8;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main, .top, .note { max-width: 46rem; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: .5rem; z-index: 10; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top { padding-top: 1.25rem; }
.top h1 { margin: 0; font-size: 1.9rem; }
.sub { margin: .1rem 0 1rem; color: var(--muted); }

.field input {
  width: 100%; font: inherit; font-size: 1.1rem; padding: .7rem .9rem;
  border: 2px solid var(--line); border-radius: .6rem; background: var(--card); color: var(--fg);
}
.field input:focus { border-color: var(--accent); outline: none; }

.section-title { font-size: 1.35rem; margin: 1.2rem 0 .3rem; }
.scope { border: 0; padding: 0; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.scope-note { flex-basis: 100%; margin: .2rem 0 0; font-size: .8rem; color: var(--muted); }
.scope legend { font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.scope label { position: relative; }
.scope input { position: absolute; opacity: 0; }
.scope span {
  display: inline-block; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); cursor: pointer; font-size: .95rem;
}
.scope .s-a span { border-color: var(--sa); }
.scope .s-b span { border-color: var(--sb); }
.scope .s-c span { border-color: var(--sc); }
.scope .s-a input:checked + span { background: var(--sa); color: #fff; }
.scope .s-b input:checked + span { background: var(--sb); color: #fff; }
.scope .s-c input:checked + span { background: var(--sc); color: var(--sc-fg); }
.scope input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.filters { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } }
.filter { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: .3rem .6rem; }
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.filter h3 { font-size: .95rem; margin: 0; font-weight: 600; }
.filter .chips:not(:empty) { margin: .3rem 0 .2rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.chips:not(:empty) { margin-bottom: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; background: var(--chip);
  border-radius: 999px; padding: .2rem .25rem .2rem .7rem; font-size: .95rem;
}
.chip button {
  border: 0; background: transparent; color: var(--fg); font-size: 1.1rem; line-height: 1;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; cursor: pointer;
}
.chip button:hover { background: var(--line); }
.add, .reset, .more {
  font: inherit; font-size: .95rem; border: 1px dashed var(--accent); color: var(--accent);
  background: transparent; border-radius: 999px; padding: .35rem .8rem; cursor: pointer; min-height: 2.2rem;
}
.reset { margin-top: .7rem; border-style: solid; }
.more { display: block; margin: 1rem auto 2rem; border-style: solid; }

.count { font-weight: 600; margin: 2.4rem 0 .5rem; }  /* mindestens eine Leerzeile über der Trefferzahl */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; }
/* Eine Zeile pro Artikel: Kästchen · Name und Nummer · rechtsbündig Merkmale und Anmerkungen.
   Wird es zu eng (Handy), rutschen die Merkmale rechtsbündig in eine zweite Zeile. */
.item summary {
  list-style: none; cursor: pointer; padding: .55rem .8rem; display: flex; flex-wrap: wrap;
  align-items: center; gap: .35rem .7rem;
}
.item summary::-webkit-details-marker { display: none; }
.item[open] summary { border-bottom: 1px solid var(--line); }
.label {
  flex: none; font-weight: 700; width: 2rem; height: 2rem; border-radius: .4rem;
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
}
/* Kennzeichnung in der Trefferliste: Name vorne, farbiger Buchstabe ganz rechts hinter den Merkmalen
   (Franks Wahl, 12.10.2026). Frühere Fassungen (Kästchen vorne, Buchstabe vorne): Stand 55375e2, ?kasten / Grundform. */
.label { background: none; width: 1.4rem; height: auto; font-size: 1.3rem; order: 4; text-align: right; }
.label.A { color: var(--sa); } .label.B { color: var(--sb); } .label.C { color: var(--sc-text); }
.item summary .name { order: 1; }
.item summary .price { order: 2; }
.item summary .meta { order: 3; }
.item summary .meta:empty ~ .label { margin-left: auto; }

/* „Suchen in“: Buchstabe farbig, solange nicht gewählt */
.scope .s-a span strong { color: var(--sa); } .scope .s-b span strong { color: var(--sb); }
.scope .s-c span strong { color: var(--sc-text); }
.scope input:checked + span strong { color: inherit; }
.name { font-weight: 600; overflow-wrap: break-word; min-width: 0; flex: 1 1 12rem; }
.nr { display: inline-block; }
.nr { color: var(--muted); font-weight: 400; font-size: .9rem; }
.nr.dls { margin-left: 1em; }            /* Abstand Name – Nummer (etwa ein Geviert) */
.weight { margin-right: .5em; }          /* zusammen mit dem Spaltenabstand etwa ein Geviert */
.tag.vegan { color: var(--vegan); font-weight: 700; }
.price { font-weight: 600; white-space: nowrap; padding-left: .8rem; }
.note2023 { font-size: .85rem; color: var(--muted); }
.meta {
  margin-left: auto; font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap;
  justify-content: flex-end; align-items: center; gap: .3rem .5rem;
}
.meta:empty { display: none; }
.tag { background: var(--chip); border-radius: .3rem; padding: 0 .4rem; color: var(--fg); }
.review { color: var(--muted); font-style: italic; }
.flag { background: var(--warn); border: 1px solid var(--warn-line); border-radius: .3rem; padding: 0 .4rem; color: var(--fg); }

.detail { padding: .7rem .8rem .9rem; font-size: .95rem; }
.detail h3 { font-size: .9rem; margin: .8rem 0 .2rem; color: var(--muted); }
.detail h3:first-child { margin-top: 0; }
.detail p { margin: 0; }
.allergen-list { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.allergen-list li { border: 1px solid var(--line); border-radius: .3rem; padding: 0 .45rem; }
.nutrition { border-collapse: collapse; width: 100%; max-width: 24rem; }
.nutrition td { padding: .1rem 0; border-bottom: 1px solid var(--line); }
.nutrition td:last-child { text-align: right; }
.source { color: var(--muted); font-size: .85rem; margin-top: .8rem !important; }
.source-top { color: var(--muted); font-size: .85rem; margin-bottom: .3rem !important; }
.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.detail-head a { font-size: .85rem; white-space: nowrap; }

.note { color: var(--muted); font-size: .88rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--line); margin-top: 1rem; }

dialog {
  border: 0; border-radius: .8rem; padding: 0; width: min(32rem, calc(100vw - 32px));
  max-height: calc(100vh - 64px); background: var(--card); color: var(--fg);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
.picker { display: flex; flex-direction: column; max-height: calc(100vh - 64px); }
.picker header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem .4rem; }
.picker h2 { margin: 0; font-size: 1.1rem; }
.picker .close { border: 0; background: transparent; color: var(--fg); font-size: 1.6rem; width: 2.6rem; height: 2.6rem; cursor: pointer; }
.picker .field { padding: 0 1rem .6rem; }
.picker-list { list-style: none; margin: 0; padding: 0 .5rem .8rem; overflow-y: auto; }
.picker-list button {
  display: block; width: 100%; text-align: left; font: inherit; padding: .55rem .6rem; border: 0;
  background: transparent; color: var(--fg); border-radius: .4rem; cursor: pointer;
}
.picker-list button:hover, .picker-list button:focus-visible { background: var(--chip); }
.picker-list .letter { font-weight: 700; color: var(--muted); padding: .5rem .6rem .1rem; font-size: .85rem; }
.picker-list .empty { padding: .6rem; color: var(--muted); }
