/* Design „Farbfächer“ (einziges Design): gilt über <html data-design="faecher">, überschreibt die Grundstile in style.css.
   Nutzt CSS-Nesting (Chrome 112+, Safari 16.5+, Firefox 117+). */

:root[data-design="faecher"] {
  --bg: #f6f3ec; --ink: #141414; --card: #fffefa; --muted: #6a665c;
  --pink: #ff4b2b; --cyan: #ff4b2b; --yellow: #ece6d6; --lime: #e1ecdf; --violet: #2b59ff;
  --linie: #d9d4c6; --linie-fein: #d9d4c6; --schatten: none;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --akzent-hell: color-mix(in srgb, var(--pink) 14%, transparent);
  --ok: #0f6b3f; --warn: #855500; --nein: #c4321d;
}
:root[data-design="faecher"][data-theme="dark"] {
  --bg: #121210; --ink: #f4f1ea; --card: #1b1a17; --muted: #a29d90;
  --pink: #ff6a4d; --cyan: #ff6a4d; --yellow: #2b2820; --lime: #1d2a20; --violet: #7d9bff;
  --linie: #2c2b27; --ok: #4fd18b; --warn: #f0b04a; --nein: #ff7a62;
}
@media (prefers-color-scheme: dark) {
  :root[data-design="faecher"]:not([data-theme="light"]) {
    --bg: #121210; --ink: #f4f1ea; --card: #1b1a17; --muted: #a29d90;
    --pink: #ff6a4d; --cyan: #ff6a4d; --yellow: #2b2820; --lime: #1d2a20; --violet: #7d9bff;
    --linie: #2c2b27; --ok: #4fd18b; --warn: #f0b04a; --nein: #ff7a62;
  }
}

:root[data-design="faecher"] {
  & body { background-image: none; }

  /* ---------- Kopf / Hero ---------- */
  & .band-top { display: flex; height: 10px; }
  & .band-top i { flex: 1; background: var(--c); }
  & .kopf { padding: 14px 16px 0; border-bottom: 2px solid var(--ink); }
  & .kopf-inner { align-items: center; flex-wrap: wrap; padding-bottom: 18px; min-height: 150px; padding-top: 42px; }
  & .spule, & .schicht { display: none; }
  & h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); font-weight: 900; letter-spacing: -.05em; line-height: .9; text-transform: uppercase; flex-direction: column; gap: 0; }
  & h1 span, & h1 .h1-zwei { background: none; -webkit-text-stroke: 0; color: var(--ink); -webkit-text-fill-color: currentColor; }
  & h1 .h1-zwei { color: var(--pink); }
  & .unterzeile { font-weight: 500; max-width: 460px; margin-top: 10px; font-size: .95rem; }
  & .unterzeile b { color: var(--ink); }
  & .kopf-knoepfe { position: absolute; top: 10px; right: 16px; }
  & .kopf { position: relative; }
  & .thema { border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); box-shadow: none; padding: 5px 14px; font-weight: 800; }
  & .thema { width: auto; height: auto; font-size: 1.05rem; padding: 4px 12px; }
  & .thema:hover { background: var(--ink); color: var(--bg); }

  & .fan { display: block; position: relative; flex: 1 1 240px; height: 165px; min-width: 200px; margin-left: auto; max-width: 300px; }
  & .fan i { position: absolute; left: 50%; bottom: 6px; width: 46px; height: 148px; margin-left: -23px; background: var(--c); border: 2px solid var(--bg); outline: 1px solid var(--linie);
    transform-origin: 50% 94%; transform: rotate(var(--r)); transition: transform .45s cubic-bezier(.2, .9, .25, 1.2); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45); }
  & .fan i::after { content: ""; position: absolute; left: 50%; bottom: 8px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
  & .fan:hover i { transform: rotate(calc(var(--r) * 1.35)); }
  & .fan u { position: absolute; left: 50%; bottom: 0; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--ink); z-index: 3; }

  & .zahlen { display: flex; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
  & .zahlen div { flex: 1; padding: 8px 4px; text-align: center; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie); }
  & .zahlen div:last-child { border-right: 0; }
  & .zahlen b { display: block; font-size: 1.5rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
  & .zahlen span { font-size: .72rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }

  /* ---------- Tabs, Leisten ---------- */
  & .tabs { gap: 4px 22px; margin-top: 16px; border-bottom: 1px solid var(--linie); padding-bottom: 0; }
  & .tab { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; box-shadow: none; padding: 6px 0; color: var(--muted); font-weight: 800; transform: none; }
  & .tab:hover { color: var(--ink); }
  & .tab[aria-pressed="true"] { background: none; color: var(--ink); border-bottom-color: var(--pink); transform: none; }
  & .druckerleiste { margin-top: 18px; }
  & .gruppe-t, & .feld > span { font-size: .7rem; letter-spacing: .12em; }

  /* ---------- Flächen, Eingaben, Knöpfe ---------- */
  & .karte { border: 1px solid var(--linie); border-radius: 0; box-shadow: none; background: var(--card); }
  & h2 { font-weight: 900; letter-spacing: -.02em; }
  & input[type=search], & input[type=text] { border: 1px solid var(--ink); border-radius: 0; background: var(--bg); }
  & input[type=color] { border: 1px solid var(--ink); border-radius: 0; }
  & .chip { border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 800; transition: background .15s, color .15s, transform .15s; }
  & .chip:hover { background: var(--ink); color: var(--bg); transform: translateY(-1px); box-shadow: none; }
  & .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
  & .druckerleiste .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  & .chip .pkt { border: 1px solid var(--linie); }
  & .chip small { opacity: .65; }
  & .knopf { border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); box-shadow: none; }
  & .knopf:hover { background: var(--ink); color: var(--bg); }
  & .knopf:active { transform: none; }
  & .ref-info { border: 1px dashed var(--ink); border-radius: 0; }
  & .schalter input { accent-color: var(--pink); }
  & .schalter.sort select { border: 1px solid var(--ink); border-radius: 0; background: var(--card); }

  & .farbband-gruppe { display: grid; grid-template-columns: minmax(0, 1fr); }
  & .farbband { display: flex; height: 36px; border: 2px solid var(--ink); cursor: pointer; }
  & .farbband i { flex: 1 1 0; min-width: 0; background: var(--c); transition: flex .18s; }
  & .farbband i:hover, & .farbband i.aktiv { flex: 6; }

  /* ---------- Katalog-Karten als Farbmuster ---------- */
  & .raster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; }
  & .fil { border: 0; border-radius: 0; box-shadow: 0 0 0 1px var(--linie); background: var(--card); padding: 8px 8px 12px; gap: 6px; transition: transform .22s cubic-bezier(.2, .9, .25, 1.2), box-shadow .2s; }
  & .fil:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 0 0 1px var(--ink), 0 18px 24px -16px rgba(0, 0, 0, .55); }
  & .fil.im-korb { outline: 3px solid var(--violet); outline-offset: 2px; }
  & .fil.ist-ref { outline: 3px solid var(--pink); outline-offset: 2px; }
  & .fil > * { margin-inline: 4px; }
  & .fil > .farbe { margin: 0 0 4px; width: 100%; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 0; aspect-ratio: 1 / .5; margin-inline: 0; background-image: none; }
  & .farbe::after { display: none; }
  & .fil-name { font-size: 1rem; letter-spacing: -.02em; }
  & .fil-meta { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
  & .pille { border: 1px solid var(--ink); background: transparent; color: var(--ink); font-weight: 800; }
  & .pille.fam { display: none; }
  & .pille.hs { background: var(--ink); color: var(--bg); }
  & .hex { font-size: .72rem; color: var(--muted); }
  & .de { top: 6px; right: 6px; border: 0; border-radius: 0; background: var(--ink); color: var(--bg); box-shadow: none; transform: none; }
  & .de.gut { background: var(--ok); color: #fff; }
  & .eign { border: 0; padding: 0; background: none; font-size: .75rem; color: var(--ok); display: inline-flex; gap: 5px; align-items: center; }
  & .eign.bedingt { color: var(--warn); }
  & .eign.nein { color: var(--nein); }
  & .chip .eign { font-size: .72rem; }
  & .preis-wert { border-bottom: 2px solid var(--pink); font-family: ui-monospace, Menlo, monospace; letter-spacing: -.03em; }
  & .preis-wert:hover { background: var(--pink); color: #fff; }
  & .fil { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  & .aktionen { flex-wrap: wrap; }
  & .aktion { flex: 1 1 auto; white-space: nowrap; }
  & .aktion { border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); }
  & .aktion:hover { background: var(--ink); color: var(--bg); }
  & .aktion[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
  & .leer { border: 1px dashed var(--ink); border-radius: 0; }

  /* ---------- Vergleichsleiste (Korb) ---------- */
  & .korb { left: 0; right: 0; bottom: 0; max-width: none; border: 0; border-top: 2px solid var(--ink); border-radius: 0; box-shadow: none; background: var(--ink); color: var(--bg); padding: 10px 16px 12px; }
  & .korb .knopf { border-color: var(--bg); color: var(--bg); }
  & .korb .knopf:hover { background: var(--bg); color: var(--ink); }
  & .slot { border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent); border-radius: 0; background: transparent; }
  & .slot .balken { border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent); border-radius: 0; }
  & .slot small { color: color-mix(in srgb, var(--bg) 62%, transparent); }
  & .slot .weg { border: 1px solid var(--bg); background: var(--ink); color: var(--bg); }
  & .slot .dewert { background: var(--pink); border: 0; color: #fff; }

  /* ---------- Bambu Lab ↔ Sunlu ---------- */
  & .paar { border: 1px solid var(--linie); border-radius: 0; box-shadow: none; }
  & .mini { border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 0; width: 42px; height: 42px; background-image: none; }
  & .mini::after { display: none; }
  & .treffer-zeile { border: 0; border-bottom: 1px solid var(--linie); border-radius: 0; }
  & .treffer-zeile:first-child { background: var(--akzent-hell); }
  & .dewert { border: 0; border-radius: 0; background: var(--ink); color: var(--bg); }

  /* ---------- Tabellen ---------- */
  & td button { border: 1px solid var(--ink); border-radius: 0; background: var(--lime); color: var(--ink); }
  & td button.null { background: transparent; color: var(--muted); border-style: dashed; }
  & table.spec { border: 1px solid var(--ink); border-radius: 0; }
  & table.spec th, & table.spec td { border-bottom: 1px solid var(--linie); }
  & table.spec thead th { background: var(--ink); color: var(--bg); }
  & table.spec tbody th { background: transparent; }
  & table.spec .aktiv-d { background: var(--akzent-hell); }
  & .hinweis-karte { border: 1px solid var(--linie); border-radius: 0; }
  & .hinweis-zeile { border-top: 1px solid var(--linie); }
  & .hinweis-wer { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
  & .hinweis-wer.alle { background: var(--ink); color: var(--bg); }

  /* ---------- Materialien ---------- */
  & .material-karte { border: 1px solid var(--linie); border-radius: 0; box-shadow: none; }
  & .punkte i { border: 1px solid var(--ink); }
  & .begriffe dt { font-weight: 900; }

  & .fuss { border-top: 2px solid var(--ink); padding-top: 14px; }
}

@media (max-width: 700px) {
  :root[data-design="faecher"] {
    & .kopf-knoepfe { position: static; order: -1; width: 100%; justify-content: flex-end; }
    & .kopf-inner { min-height: 0; padding-top: 0; padding-bottom: 16px; }
    & .fan { height: 120px; flex-basis: 100%; max-width: none; margin-inline: 0; }
    & .fan i { width: 34px; height: 108px; margin-left: -17px; }
    & .zahlen b { font-size: 1.25rem; }
    & .tab { font-size: .92rem; }
  }
}
