/* AgentFox-Cockpit – Aussehen angelehnt an Walters Vorlage (Rot-Schwarz, Gold-Akzente, Radius 6 px). */
:root {
  --bg: #f7f2ef; --flaeche: #ffffff; --flaeche-2: #f1e7e3; --text: #241315; --leise: #6e5a57;
  --rot: #c62f23; --rot-2: #e23b2e; --gold: #a87a1c; --gruen: #2e7d4f; --gelb: #9a6a00;
  --rand: #e3d3ce; --schatten: 0 1px 2px rgba(60, 20, 20, .08), 0 4px 16px rgba(60, 20, 20, .06);
  --radius: 6px; --abstand: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #140a0c; --flaeche: #1f0f12; --flaeche-2: #2e0e12; --text: #f0dcd8; --leise: #9c7b78;
    --rot: #e23b2e; --rot-2: #ff6a4d; --gold: #d9a441; --gruen: #5ec48a; --gelb: #e6b84a;
    --rand: #3a1216; --schatten: 0 0 20px rgba(226, 59, 46, .08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #140a0c; --flaeche: #1f0f12; --flaeche-2: #2e0e12; --text: #f0dcd8; --leise: #9c7b78;
  --rot: #e23b2e; --rot-2: #ff6a4d; --gold: #d9a441; --gruen: #5ec48a; --gelb: #e6b84a;
  --rand: #3a1216; --schatten: 0 0 20px rgba(226, 59, 46, .08);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 2rem 0 .8rem; color: var(--leise); text-transform: uppercase; letter-spacing: .08em; }
main { max-width: 1100px; margin: 0 auto; padding: var(--abstand); outline: none; }
.laden, .leer { color: var(--leise); }

.kopf {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--abstand) 10px; background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.1rem; }
.marke img { border-radius: var(--radius); }
.marke b { color: var(--rot); margin-left: 4px; }
.kopf-rechts { display: flex; gap: 8px; }

/* Knoepfe: gross und gut zu treffen (mind. 48 px) */
button, .knopf {
  font: inherit; min-height: 52px; padding: 12px 20px; border-radius: var(--radius); border: 1px solid var(--rand);
  background: var(--flaeche-2); color: var(--text); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, box-shadow .25s;
}
button:hover, .knopf:hover { transform: translateY(-1px); box-shadow: var(--schatten); }
button:focus-visible, .knopf:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: wait; }
.haupt { background: var(--rot); border-color: var(--rot); color: #fff; font-weight: 600; }
.ja { background: var(--gruen); border-color: var(--gruen); color: #fff; font-weight: 600; }
.nein { background: var(--rot); border-color: var(--rot); color: #fff; font-weight: 600; }
.knopf-klein { min-height: 44px; min-width: 44px; padding: 8px 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius); border: 1px solid var(--rand); background: var(--flaeche-2); font-size: 1.1rem; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.knopf-reihe > * { flex: 1 1 140px; }
.breit { width: 100%; }

/* Kacheln */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.kachel {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 120px; padding: 16px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); text-decoration: none;
  box-shadow: var(--schatten); transition: transform .25s, border-color .25s;
}
.kachel:hover { transform: translateY(-2px); border-color: var(--rot); }
.kachel .symbol { font-size: 1.7rem; line-height: 1; }
.kachel .name { font-weight: 650; }
.kachel .info { font-size: .85rem; color: var(--leise); }
.kachel.bald { opacity: .78; }
.kachel .marke-phase { position: absolute; top: 10px; right: 10px; font-size: .72rem; padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--rand); color: var(--leise); }
.kachel.aktiv .marke-phase { border-color: var(--gruen); color: var(--gruen); }
.zaehler { position: absolute; top: 10px; right: 10px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px;
  background: var(--rot); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gross-kachel {
  display: flex; align-items: center; gap: 16px; padding: 22px; margin-bottom: 14px; min-height: 96px;
  background: var(--rot); color: #fff; border-radius: var(--radius); text-decoration: none; box-shadow: var(--schatten);
  font-size: 1.3rem; font-weight: 700; transition: transform .25s;
}
.gross-kachel:hover { transform: translateY(-2px); }
.gross-kachel .symbol { font-size: 2.2rem; }
.gross-kachel small { display: block; font-weight: 400; font-size: .9rem; opacity: .9; }
.leiste { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.leiste .stat { flex: 1 1 140px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; }
.stat .wert { font-size: 1.6rem; font-weight: 700; color: var(--gold); }
.stat .was { font-size: .85rem; color: var(--leise); }

/* Karten */
.karten { display: grid; gap: 12px; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-left: 4px solid var(--rand); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--schatten); }
.karte.s-fertig { border-left-color: var(--gruen); }
.karte.s-rueckfrage { border-left-color: var(--gold); }
.karte.s-blockiert { border-left-color: var(--rot); }
.karte.s-in_arbeit, .karte.s-neu { border-left-color: var(--leise); }
.karte h3 { margin: 0 0 6px; font-size: 1.05rem; }
.karte .meta { font-size: .85rem; color: var(--leise); display: flex; gap: 10px; flex-wrap: wrap; }
.karte p { margin: .5rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.karte a.mehr { display: inline-block; margin-top: 10px; color: var(--rot); font-weight: 600; text-decoration: none; min-height: 44px; line-height: 44px; }
.chip { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 99px; background: var(--flaeche-2); }
.frage { background: var(--flaeche-2); border-radius: var(--radius); padding: 12px; margin-top: 10px; }

/* Formulare */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
textarea, input[type=text], input[type=password], input[inputmode] {
  width: 100%; font: inherit; padding: 14px; border-radius: var(--radius); border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text);
}
textarea { min-height: 160px; resize: vertical; }
.code-feld { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.schalter { display: flex; align-items: center; gap: 10px; font-weight: 400; min-height: 44px; }
.schalter input { width: 24px; height: 24px; }
.hinweis { background: var(--flaeche-2); border-radius: var(--radius); padding: 12px 14px; color: var(--text); }
.fehler { background: color-mix(in srgb, var(--rot) 15%, var(--flaeche)); border: 1px solid var(--rot); border-radius: var(--radius); padding: 12px 14px; }
.ok { background: color-mix(in srgb, var(--gruen) 15%, var(--flaeche)); border: 1px solid var(--gruen); border-radius: var(--radius); padding: 12px 14px; }
.mitte { max-width: 460px; margin: 6vh auto 0; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius); width: 264px; max-width: 100%; display: block; margin: 8px auto; }
.geheim { font-family: ui-monospace, monospace; word-break: break-all; font-size: .95rem; }
.zurueck { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--leise); margin-bottom: 6px; }
.dateien { list-style: none; padding: 0; margin: 10px 0 0; }
.dateien a { display: block; padding: 10px 0; color: var(--rot); min-height: 44px; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter a { min-height: 44px; padding: 10px 14px; border-radius: 99px; border: 1px solid var(--rand); text-decoration: none; }
.filter a.an { background: var(--rot); color: #fff; border-color: var(--rot); }
ol.schritte li { margin-bottom: 8px; }

@media (max-width: 420px) {
  .raster { grid-template-columns: 1fr 1fr; }
  .kachel { min-height: 110px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
select { font: inherit; min-height: 52px; width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text); margin-top: 6px; }
.auswahl { margin-bottom: 14px; }

/* Jarvis */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.blase { max-width: 88%; padding: 12px 14px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--rand); white-space: pre-wrap; overflow-wrap: anywhere; }
.blase.du { align-self: flex-end; background: var(--flaeche-2); border-bottom-right-radius: 4px; }
.blase.kira { align-self: flex-start; border-left: 3px solid var(--rot); border-bottom-left-radius: 4px; }
.blase .wer { font-size: .78rem; color: var(--leise); margin-bottom: 4px; }
.blase audio { display: block; width: 100%; margin-top: 8px; }
.jarvis-eingabe textarea { min-height: 96px; }
.mikro { font-size: 1.15rem; font-weight: 600; }
.mikro.an { background: var(--rot); border-color: var(--rot); color: #fff; animation: puls 1.2s infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--rot) 25%, transparent); } }
.kosten { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
.kosten.warnung { border-color: var(--gelb); }
.kosten-text { font-size: .9rem; }
.balken { height: 8px; background: var(--flaeche-2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.balken span { display: block; height: 100%; background: var(--gruen); }
.kosten.warnung .balken span { background: var(--gelb); }
.hinweis.warn { border: 1px solid var(--gelb); }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.update-hinweis { position: sticky; top: 0; z-index: 10; width: 100%; border-radius: 0; border: 0; min-height: 56px;
  background: var(--gold); color: #1a0a0c; font-weight: 700; padding-top: calc(10px + env(safe-area-inset-top)); }
.mikro-status .aufnahme { color: var(--rot); font-weight: 600; }

/* Phase 6: Abteilungen */
.entwurf, .angebot-text { white-space: pre-wrap; font: inherit; background: var(--flaeche-2); border-radius: var(--radius); padding: 12px; margin: 8px 0; overflow-wrap: anywhere; }
.agent-box { border-left-color: var(--gold); }
.lernen { margin-top: 12px; }
.lernen summary { min-height: 44px; display: flex; align-items: center; color: var(--leise); cursor: pointer; }
.lernen input, .lernen textarea { margin-top: 8px; }
.karte.lead { text-decoration: none; display: block; }
.stufe h2 { margin-top: 1.4rem; }
.modul { font-weight: 400; }
.modul small, .meilenstein small { color: var(--leise); }
.meilensteine { display: grid; gap: 4px; }
.meilenstein { align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--rand); }
.meilenstein input { margin-top: 3px; flex: 0 0 auto; }
.tabelle { display: grid; gap: 4px; margin: 8px 0; }
.tabelle .zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; padding: 8px 10px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); font-size: .9rem; overflow-wrap: anywhere; }
.tabelle .zeile.warn { border-color: var(--gelb); }
.wasserzeichen { color: var(--rot); font-weight: 700; letter-spacing: .1em; }
@media print {
  .kopf, .nicht-drucken, .update-hinweis { display: none !important; }
  body { background: #fff; color: #000; }
  .angebot-text { background: none; padding: 0; font-size: 11pt; }
}
