/* ==========================================================================
   Ida – zentrale Gestaltung. Farben und Schriften nur hier ändern.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Farben */
  --aubergine: #5B3A8A;
  --aubergine-dunkel: #43296a;
  --aubergine-hell: #ece4f5;
  --creme: #faf6ee;
  --creme-dunkel: #f1eadc;
  --gruenspan: #2e8b84;          /* Akzent, dunkel genug für Text */
  --gruenspan-hell: #dcefed;
  --weiss: #ffffff;
  --text: #2a2233;
  --text-leise: #6b6275;
  --linie: #e3dccd;
  --warnung: #a35a00;
  --leucht: #B48CFF;             /* Leuchtfarbe: Roboter, feine Linien */
  --leucht-linie: rgba(180, 140, 255, .42);
  --leucht-glow: rgba(180, 140, 255, .28);
  --markierung: #ffdb26;         /* Gelb wie im markierten PDF */
  --markierung-hell: #fff6c7;
  --markierung-dezent: #9ed9cc;  /* zweite Farbe im PDF: helles Grünspan */
  --warnung-hell: #fbefdc;
  --led-an: #e8433a;             /* Sieben-Segment: rote LED */
  --led-aus: rgba(232, 67, 58, 0.09);
  --led-grund: #1f1a24;

  /* Schriften */
  --schrift-titel: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --schrift-text: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --schrift-zahl: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Form */
  --radius: 14px;
  --radius-klein: 8px;
  --schatten: 0 1px 2px rgba(42, 34, 51, .06), 0 4px 16px rgba(42, 34, 51, .06);
  --breite: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--text);
  font: 16px/1.55 var(--schrift-text);
}
a { color: var(--aubergine); }
a:hover { color: var(--aubergine-dunkel); }
h1, h2, h3 { font-family: var(--schrift-titel); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
.mono, .nr { font-family: var(--schrift-zahl); font-variant-numeric: tabular-nums; }
.leise { color: var(--text-leise); }
.klein { font-size: .875rem; }

main { max-width: var(--breite); margin: 0 auto; padding: 28px 20px 48px; }

/* Kopfzeile ------------------------------------------------------------- */
.kopf { background: var(--aubergine); color: #fff; }
.kopf-innen { max-width: var(--breite); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-family: var(--schrift-titel); font-size: 1.1rem; }
.marke:hover { color: #fff; }
.marke strong { font-weight: 800; }
.logo-platzhalter {
  width: 40px; height: 40px; border-radius: 10px; border: 1.5px dashed rgba(255,255,255,.6);
  display: grid; place-items: center; font: 600 .8rem var(--schrift-zahl); color: rgba(255,255,255,.85);
}
.marke .logo {
  height: 40px; width: auto; max-width: 160px; object-fit: contain;
  background: #fff; border-radius: 8px; padding: 4px 6px; box-sizing: border-box;
}
.kopf nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kopf nav a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 999px; opacity: .85; }
.kopf nav a:hover, .kopf nav a.aktiv { background: rgba(255,255,255,.14); opacity: 1; }
.kopf .wer { opacity: .7; padding: 0 8px 0 16px; font-size: .9rem; }

footer { text-align: center; color: var(--text-leise); font-size: .85rem; padding: 24px 20px 40px; }

/* Bausteine ------------------------------------------------------------- */
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 22px; }
.knopf {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--aubergine); color: #fff; font: 600 1rem var(--schrift-text);
  padding: 11px 20px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.knopf:hover { background: var(--aubergine-dunkel); color: #fff; }
.knopf:disabled { opacity: .55; cursor: wait; }
.knopf.zweit { background: transparent; color: var(--aubergine); border: 1.5px solid var(--aubergine); }
.knopf.zweit:hover { background: var(--aubergine-hell); }
.knopf.akzent { background: var(--gruenspan); }
input[type=text], input[type=password], input[type=search], select, textarea {
  font: inherit; color: var(--text); background: var(--weiss);
  border: 1.5px solid var(--linie); border-radius: var(--radius-klein); padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--aubergine); box-shadow: 0 0 0 3px var(--aubergine-hell); }
:focus-visible { outline: 3px solid var(--gruenspan); outline-offset: 2px; }
label { font-size: .85rem; color: var(--text-leise); display: block; margin-bottom: 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; line-height: 1.3;
  padding: 3px 10px; border-radius: 999px; background: var(--creme-dunkel); color: var(--text); white-space: nowrap;
}
.chip.stichwort { background: var(--aubergine-hell); color: var(--aubergine-dunkel); }
.chip.inhalt { background: var(--gruenspan-hell); color: #1d5d58; }
.chip.typ { background: #2a2233; color: #fff; }
.chip.filter { background: var(--creme-dunkel); color: var(--text-leise); }
.hinweis { background: var(--warnung-hell); color: var(--warnung); border-radius: var(--radius-klein); padding: 10px 14px; font-size: .92rem; }

/* Suche: Umschalter Angebote / Rechnungen ------------------------------- */
.suche-titel { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.umschalter { display: inline-flex; border: 1px solid var(--linie); border-radius: 999px; padding: 3px; background: var(--weiss); }
.umschalter a { padding: 6px 16px; border-radius: 999px; text-decoration: none; color: var(--text-leise); font-size: .95rem; }
.umschalter a:hover { color: var(--aubergine); }
.umschalter a.aktiv { background: var(--aubergine); color: #fff; }
.vorbereitet { color: var(--text-leise); margin-top: 20px; }

/* Login ----------------------------------------------------------------- */
.login { max-width: 420px; margin: 40px auto; }
.login-logo { display: block; max-height: 64px; max-width: 220px; width: auto; height: auto; object-fit: contain; margin: 0 auto 20px; }
.login form { display: grid; gap: 14px; margin-top: 16px; }
.login .fehler { color: #b3261e; font-size: .92rem; }

/* Frag Ida -------------------------------------------------------------- */
.frag { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; padding: 28px; }
.avatar { width: 96px; height: 96px; }
.frag h1 { margin-bottom: .2em; }
.frag-form { display: flex; gap: 10px; margin-top: 14px; }
.frag-form textarea { resize: none; min-height: 52px; height: 52px; font-size: 1.05rem; padding: 13px 16px; border-radius: 26px; }
.beispiele { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.beispiele button {
  font: inherit; font-size: .85rem; cursor: pointer; border: 1px solid var(--linie);
  background: var(--creme); color: var(--text); padding: 5px 12px; border-radius: 999px;
}
.beispiele button:hover { border-color: var(--aubergine); color: var(--aubergine); }
.antwort { margin-top: 20px; display: none; }
.antwort.sichtbar { display: block; }
.blase {
  background: var(--creme); border: 1px solid var(--linie); border-radius: 4px var(--radius) var(--radius) var(--radius);
  padding: 16px 18px; font-size: 1.02rem; white-space: normal;
}
.blase ul { margin: .3em 0; padding-left: 1.2em; }
.blase p { margin: 0 0 .5em; }
.blase p:last-child { margin-bottom: 0; }
.blase a.quelle {
  font-family: var(--schrift-zahl); font-size: .88em; text-decoration: none; white-space: nowrap;
  background: var(--aubergine-hell); padding: 1px 6px; border-radius: 6px;
}
.blase a.quelle:hover { background: var(--aubergine); color: #fff; }
.status { display: flex; align-items: center; gap: 10px; color: var(--text-leise); font-size: .92rem; margin: 10px 0; }
.punkte span { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 50%; background: var(--gruenspan); animation: puls 1.2s infinite ease-in-out; }
.punkte span:nth-child(2) { animation-delay: .15s; }
.punkte span:nth-child(3) { animation-delay: .3s; }
@keyframes puls { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.verstanden { font-size: .85rem; color: var(--text-leise); margin: 8px 0; }
.quellen { margin-top: 16px; }
.quellen h3 { font-size: .95rem; color: var(--text-leise); font-family: var(--schrift-text); font-weight: 600; }

/* Trefferliste ---------------------------------------------------------- */
.treffer { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.treffer li {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius-klein);
  padding: 12px 16px; display: grid; grid-template-columns: 110px 1fr auto; gap: 4px 16px; align-items: baseline;
}
.treffer li:hover { border-color: var(--aubergine); }
.treffer .nr { font-weight: 600; font-size: 1.02rem; }
.treffer .nr a { text-decoration: none; }
.treffer .titel { font-weight: 600; }
.treffer .titel a { color: var(--text); text-decoration: none; }
.treffer .titel a:hover { color: var(--aubergine); }
.treffer .artikelnr {
  font-family: var(--schrift-zahl); font-size: .88rem; font-weight: 500; background: var(--creme-dunkel);
  padding: 1px 8px; border-radius: 6px; margin-left: 6px; white-space: nowrap;
}
.treffer .wege a.zum-angebot { font-weight: 600; color: var(--aubergine); text-decoration: none; }
.treffer .wege a.zum-angebot:hover { text-decoration: underline; }
.treffer .marke-angebot {
  font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; background: var(--aubergine-hell);
  color: var(--aubergine-dunkel); padding: 1px 7px; border-radius: 6px;
}
.treffer .artikelnr.leer { background: transparent; color: var(--text-leise); font-style: italic; }
.treffer .preis { font-family: var(--schrift-zahl); text-align: right; white-space: nowrap; }
.treffer .preis-zusatz { font-family: var(--schrift-text); font-size: .78rem; color: var(--text-leise); }
.treffer .meta { grid-column: 2 / 4; color: var(--text-leise); font-size: .9rem; }
.treffer .gruende { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.treffer .datum { font-family: var(--schrift-zahl); font-size: .85rem; color: var(--text-leise); }

/* Suche ----------------------------------------------------------------- */
.suchleiste { display: flex; gap: 10px; }
.suchleiste input { font-size: 1.1rem; padding: 12px 16px; border-radius: 999px; }
.filterfelder { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.suche-kopf { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 12px; gap: 12px; flex-wrap: wrap; }

/* Detail ---------------------------------------------------------------- */
.detail-kopf { display: flex; justify-content: space-between; gap: 20px; align-items: start; flex-wrap: wrap; }
.detail-kopf h1 .nr { color: var(--aubergine); }
.eckdaten { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; margin: 18px 0 0; }
.eckdaten dt { font-size: .8rem; color: var(--text-leise); }
.eckdaten dd { margin: 0; font-weight: 500; }
.position { margin-top: 18px; }
.position-kopf { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.position-kopf .typ { font-family: var(--schrift-zahl); font-size: .92rem; background: var(--creme-dunkel); padding: 2px 8px; border-radius: 6px; }
table.technik { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .94rem; }
table.technik th, table.technik td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--linie); vertical-align: top; }
table.technik th { font-weight: 500; color: var(--text-leise); width: 26%; }
table.technik td.wert { font-weight: 600; width: 30%; }
table.technik td.fund { color: var(--text-leise); font-style: italic; }
.standardwert { font-style: normal; }
.marke-erschlossen { font-style: normal; font-size: .75rem; color: var(--gruenspan); margin-left: 6px; }
/* Quellen: passende Position und Werte, die zum Treffer geführt haben */
.position.passend { border-left: 5px solid var(--gruenspan); background: linear-gradient(90deg, var(--gruenspan-hell), var(--weiss) 40%); position: relative; }
.passend-marke { float: right; margin-left: 12px; font-size: .75rem; font-weight: 600; color: var(--gruenspan); background: var(--weiss); border: 1px solid var(--gruenspan); border-radius: 999px; padding: 1px 9px; }
table.technik tr.fund-gelb th, table.technik tr.fund-gelb td { background: var(--markierung-hell); }
table.technik tr.fund-gelb td.wert { box-shadow: inset 4px 0 0 var(--markierung); }
.im-pdf { display: inline-flex; vertical-align: -3px; margin-left: 6px; color: var(--aubergine); border-radius: 4px; padding: 1px; }
.im-pdf svg { width: 16px; height: 16px; }
.im-pdf:hover, .im-pdf:focus-visible { background: var(--aubergine-hell); }
.im-pdf.aus { font-style: normal; font-size: .72rem; color: var(--text-leise); vertical-align: baseline; }
.markier-legende { margin: 18px 0 -6px; color: var(--text-leise); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fleck { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: 8px; }
.fleck.gelb { background: var(--markierung); }
.fleck.dezent { background: var(--markierung-dezent); }
.marke-pruefen { font-style: normal; font-size: .75rem; color: var(--warnung); margin-left: 6px; }
details.volltext { margin-top: 18px; }
details.volltext pre { white-space: pre-wrap; font: .85rem/1.5 var(--schrift-zahl); background: var(--creme); padding: 16px; border-radius: var(--radius-klein); max-height: 480px; overflow: auto; }

/* Dashboard ------------------------------------------------------------- */
.dashboard { margin-top: 28px; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.led {
  background: var(--led-grund); border-radius: var(--radius); padding: 16px 18px 14px;
  color: #cfc8d8; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), var(--schatten);
}
.led .wert { height: 46px; display: flex; align-items: center; gap: 10px; }
.led .bis { color: var(--led-an); font: 700 1.3rem var(--schrift-zahl); opacity: .8; }
.led .titel { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-top: 8px; }
svg.sieben { height: 100%; width: auto; filter: drop-shadow(0 0 3px rgba(232, 67, 58, .55)); }
svg.sieben .an { fill: var(--led-an); }
svg.sieben .aus { fill: var(--led-aus); }
.tafeln { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.balken { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.balken li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-decoration: none; color: var(--text); font-size: .92rem; }
.balken li a:hover .name { color: var(--aubergine); }
.balken .zahl { font-family: var(--schrift-zahl); color: var(--text-leise); }
.balken .spur { grid-column: 1 / 3; height: 6px; background: var(--creme-dunkel); border-radius: 3px; overflow: hidden; }
.balken .spur i { display: block; height: 100%; background: var(--gruenspan); border-radius: 3px; }
.karte.breit { grid-column: 1 / -1; }
.jahre { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.jahre a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: var(--text-leise); font: .7rem var(--schrift-zahl); }
.jahre a i { width: 100%; max-width: 28px; background: var(--aubergine); border-radius: 4px 4px 0 0; min-height: 2px; }
.jahre a:hover i { background: var(--gruenspan); }
.quelle-info { margin-top: 12px; font-size: .82rem; color: var(--text-leise); }

/* Ida-Roboter (nach vorlage/mahnwesen-demo.html) ------------------------ */
.bot { overflow: visible; }
.bot-float { animation: bot-schweben 4s ease-in-out infinite; transform-origin: 70px 120px; }
.bot-eyes { animation: bot-blinzeln 5s infinite; transform-origin: 70px 50px; transform-box: view-box; }
.bot-ant { animation: bot-leuchten 1.6s infinite; }
.bot.talk .bot-mouth { animation: bot-sprechen .22s ease-in-out infinite alternate; transform-origin: 70px 63.5px; transform-box: view-box; }
@keyframes bot-schweben { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes bot-blinzeln { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
@keyframes bot-leuchten { 50% { opacity: .35; } }
@keyframes bot-sprechen { from { transform: scaleY(1); } to { transform: scaleY(3); } }

/* Technische Linien: fein, leicht leuchtend in Lila ---------------------- */
.kopf { position: relative; box-shadow: 0 1px 0 var(--leucht-linie), 0 2px 14px var(--leucht-glow); }
.kopf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--leucht) 20%, var(--leucht) 80%, transparent);
  box-shadow: 0 0 8px var(--leucht);
}
.karte { border-color: var(--leucht-linie); box-shadow: 0 0 0 1px rgba(180, 140, 255, .06), 0 0 16px rgba(180, 140, 255, .10), var(--schatten); }
.frag { border-color: rgba(180, 140, 255, .6); box-shadow: 0 0 0 1px rgba(180, 140, 255, .12), 0 0 26px var(--leucht-glow), var(--schatten); }
.frag-form textarea { border-color: var(--leucht-linie); }
.frag-form textarea:focus { border-color: var(--leucht); box-shadow: 0 0 0 3px var(--aubergine-hell), 0 0 14px var(--leucht-glow); }
.antwort.sichtbar { border-top: 1px solid transparent; border-image: linear-gradient(90deg, var(--leucht), rgba(180, 140, 255, 0)) 1; padding-top: 16px; }
.blase { border-color: var(--leucht-linie); box-shadow: 0 0 14px rgba(180, 140, 255, .14); }
.treffer li { border-color: rgba(180, 140, 255, .30); }
.treffer li:hover { border-color: var(--leucht); box-shadow: 0 0 12px var(--leucht-glow); }
.dashboard > h2, .karte h3 { position: relative; padding-bottom: 8px; }
.dashboard > h2::after, .karte h3::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; max-width: 260px; height: 1px;
  background: linear-gradient(90deg, var(--leucht), rgba(180, 140, 255, 0)); box-shadow: 0 0 6px var(--leucht-glow);
}
.quellen h3::after { max-width: 180px; }

@media (prefers-reduced-motion: reduce) {
  .bot-float, .bot-eyes, .bot-ant, .bot.talk .bot-mouth { animation: none; }
}

/* Schmale Bildschirme --------------------------------------------------- */
@media (max-width: 720px) {
  .frag { grid-template-columns: 1fr; padding: 20px; }
  .avatar { width: 64px; height: 64px; }
  .frag-form, .suchleiste { flex-direction: column; }
  .treffer li { grid-template-columns: 1fr; }
  .treffer .meta, .treffer .gruende { grid-column: 1; }
  .treffer .preis { text-align: left; }
  .kopf nav { margin-left: 0; }
}

.erfolg { background: var(--aubergine-hell); color: var(--aubergine-dunkel); border-radius: var(--radius-klein); padding: 10px 14px; font-size: .92rem; margin-top: 14px; }
