/* forcont-Look (Farben aus forcont.de). Inoffizielle Demo – nur intern verwenden. */
:root {
  --fc-orange: #ec6500;        /* Akzent: Linien, Icons, Markierungsrand */
  --fc-orange-text: #c45300;   /* Orange für Text und Buttons mit weißer Schrift (Kontrast ≥ 4,5:1) */
  --fc-petrol: #485859;
  --fc-petrol-tief: #354243;
  --fc-grau-hell: #e9ebeb;
  --fc-grau-bg: #f8f8f8;
  --fc-weiss: #ffffff;
  --fc-markierung: rgba(236, 101, 0, .15);

  --text: var(--fc-petrol-tief);
  --text-leise: #5d6b6c;
  --flaeche: var(--fc-weiss);
  --seite-bg: var(--fc-grau-bg);
  --linie: var(--fc-grau-hell);
  --blase-nutzer: var(--fc-petrol);
  --blase-nutzer-text: #fff;
  --blatt: #fff;
  --fokus: 0 0 0 3px #fff, 0 0 0 5px var(--fc-orange-text);
  --radius-gross: 28px;
  --radius: 14px;
  --radius-klein: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6eaea;
    --text-leise: #a9b5b6;
    --flaeche: #263031;
    --seite-bg: #1b2223;
    --linie: #3a4748;
    --blase-nutzer: #5c6f70;
    --blatt: #f7f5f1;
    --fc-orange-text: #ff8a33;
    --fokus: 0 0 0 3px #1b2223, 0 0 0 5px #ff8a33;
    color-scheme: dark;
  }
  .knopf-haupt, .knopf-senden { color: #1b2223 !important; }
  .knopf-haupt:hover { background: #ffa25c; }
  .telefon { border-color: #0b0f10; }
  .logo-forcont, .logo-produkt { filter: brightness(0) invert(1); }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--seite-bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--text-leise); }
[hidden] { display: none !important; }

/* Demo-Streifen – überall sichtbar */
.demo-streifen {
  position: sticky; top: 0; z-index: 30;
  background: var(--fc-petrol); color: #fff;
  font-size: 13px; font-weight: 500; text-align: center;
  padding: 4px 16px;
}

/* Bühne (Desktop-Präsentation um das Smartphone herum) */
.buehne { max-width: 1120px; margin: 0 auto; padding: 20px 24px 32px; }
.buehne-kopf { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.logo-forcont { height: 26px; width: auto; }
.buehne-titel { font-size: 15px; font-weight: 500; flex: 1; min-width: 200px; }
.buehne-titel .leise { font-weight: 400; }

.schalter { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter-bahn { width: 40px; height: 22px; border-radius: 11px; background: #b9c2c3; position: relative; transition: background .2s; flex: none; }
.schalter-bahn::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.schalter input:checked + .schalter-bahn { background: var(--fc-orange-text); }
.schalter input:checked + .schalter-bahn::after { transform: translateX(18px); }
.schalter input:focus-visible + .schalter-bahn { box-shadow: var(--fokus); }

.buehne-inhalt { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 32px; align-items: start; }

/* Smartphone-Rahmen */
.telefon {
  width: 100%; max-width: 420px; height: min(860px, calc(100vh - 120px)); min-height: 600px;
  background: var(--flaeche);
  border-radius: var(--radius-gross);
  border: 10px solid #222b2c;
  box-shadow: 0 24px 60px -24px rgba(53, 66, 67, .45);
  display: flex; flex-direction: column; overflow: hidden;
  position: sticky; top: 44px;
}

.app-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px 12px; border-bottom: 1px solid var(--linie); }
.app-marke { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.logo-produkt { height: 22px; width: auto; align-self: flex-start; }
.app-name { font-size: 13px; color: var(--text-leise); font-weight: 500; }
.app-kopf-rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badge-demo { font-size: 11px; line-height: 1.2; padding: 3px 7px; border-radius: 999px; background: var(--fc-markierung); color: var(--fc-orange-text); font-weight: 500; white-space: nowrap; }
.sprachwahl {
  border: 1px solid var(--linie); background: var(--flaeche); border-radius: 999px;
  padding: 4px 26px 4px 10px; font-size: 14px; font-weight: 500; cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 9px) 55%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
[dir="rtl"] .sprachwahl { padding: 4px 10px 4px 26px; background-position: 13px 55%, 9px 55%; }

.app-status { font-size: 12px; padding: 4px 16px; background: #fff4ea; color: #8a3b00; border-bottom: 1px solid #f6dcc6; }

/* Verlauf */
.verlauf { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.hallo { font-size: 30px; line-height: 1.15; font-weight: 700; margin: 4px 0 4px; letter-spacing: -.01em; }
.unterzeile { margin: 0 0 18px; color: var(--text-leise); }

.hinweis {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px;
  background: var(--fc-petrol); color: #fff; border-radius: var(--radius); padding: 14px 14px 14px 12px; margin-bottom: 16px;
}
.hinweis-icon { width: 28px; height: 28px; color: #ffb27a; }
.hinweis-titel { font-size: 15px; font-weight: 700; margin: 2px 0 2px; }
.hinweis-text { margin: 0 0 10px; font-size: 14px; }
.hinweis .knopf-zweit { background: #fff; color: var(--fc-petrol-tief); border-color: #fff; }

.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kachel {
  text-align: start; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 84px;
  transition: border-color .15s;
}
.kachel:first-child { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; }
.kachel:hover { border-color: var(--fc-orange); }
.kachel-icon { width: 24px; height: 24px; color: var(--fc-orange); flex: none; }
.kachel-titel { font-weight: 500; font-size: 15px; line-height: 1.3; }

/* Blasen */
.nachricht { display: flex; flex-direction: column; gap: 8px; max-width: 92%; }
.nachricht-nutzer { align-self: flex-end; }
.nachricht-assistent { align-self: flex-start; }
.blase { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nachricht-nutzer .blase { background: var(--blase-nutzer); color: var(--blase-nutzer-text); border-end-end-radius: 6px; }
.nachricht-assistent .blase { background: var(--fc-grau-bg); border: 1px solid var(--linie); border-end-start-radius: 6px; }
@media (prefers-color-scheme: dark) { .nachricht-assistent .blase { background: #2f3b3c; } }
.nachricht[dir="rtl"] .blase { text-align: right; }

.tippt { display: inline-flex; gap: 8px; align-items: center; color: var(--text-leise); font-size: 14px; }
.tippt i { width: 6px; height: 6px; border-radius: 50%; background: var(--fc-orange); animation: puls 1s infinite ease-in-out; }
.tippt i:nth-child(2) { animation-delay: .15s; } .tippt i:nth-child(3) { animation-delay: .3s; }
@keyframes puls { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.zeile-aktionen { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--fc-orange); color: var(--fc-orange-text);
  background: var(--flaeche); border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip svg { width: 14px; height: 14px; flex: none; }
.chip:hover, .chip[aria-current="true"] { background: var(--fc-markierung); }
.knopf-text { border: 0; background: none; color: var(--text-leise); font-size: 13px; padding: 4px 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
.knopf-text svg { width: 16px; height: 16px; }
.knopf-text:hover { color: var(--text); }
.badge-offline { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px dashed var(--text-leise); color: var(--text-leise); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 9px 16px; font-weight: 500; font-size: 15px; cursor: pointer; border: 1.5px solid transparent;
}
.knopf-haupt { background: var(--fc-orange-text); color: #fff; }
.knopf-haupt:hover { background: #a94700; }
.knopf-zweit { background: var(--flaeche); border-color: var(--fc-petrol); color: var(--text); }
.knopf:disabled { opacity: .55; cursor: default; }

/* Anliegen-Karte */
.anliegen { border: 1px solid var(--linie); border-top: 3px solid var(--fc-orange); border-radius: var(--radius); background: var(--flaeche); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.anliegen-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.anliegen-titel { margin: 0; font-size: 16px; font-weight: 700; }
.anliegen-entwurf { font-size: 12px; color: var(--text-leise); }
.felder { display: grid; gap: 10px; margin: 0; }
.feld { display: grid; gap: 3px; }
.feld label { font-size: 12px; color: var(--text-leise); display: flex; gap: 6px; align-items: center; }
.feld-zeile { display: flex; gap: 6px; align-items: center; }
.feld textarea {
  flex: 1; min-width: 0; resize: none; field-sizing: content; line-height: 1.35; border: 1px solid var(--linie); border-radius: var(--radius-klein); padding: 7px 10px; background: var(--flaeche);
}
.feld textarea:focus-visible { border-color: var(--fc-orange-text); box-shadow: 0 0 0 2px var(--fc-markierung); border-radius: var(--radius-klein); }
.feld.aus-akte textarea { background: linear-gradient(90deg, var(--fc-markierung), transparent 70%); }
.feld textarea[readonly] { border-style: dashed; }
.quelle-marker {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--fc-orange); background: var(--flaeche);
  color: var(--fc-orange-text); font-size: 12px; font-weight: 700; cursor: pointer; display: grid; place-items: center;
}
.quelle-marker:hover { background: var(--fc-markierung); }

.status-leiste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; counter-reset: s; }
.status-leiste li { font-size: 12px; padding-top: 10px; border-top: 4px solid var(--linie); color: var(--text-leise); transition: border-color .4s, color .4s; }
.status-leiste li.erreicht { border-color: var(--fc-orange); color: var(--text); font-weight: 500; }
.status-leiste li.aktuell::after { content: " …"; }
.status-leiste li.erreicht.fertig { border-color: #2f7d4f; }
.anliegen-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }

.kontakt-karte { border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; background: var(--flaeche); }

/* Eingabe */
.eingabe { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--linie); background: var(--flaeche); }
.eingabe textarea {
  flex: 1; resize: none; border: 1px solid var(--linie); border-radius: 20px; padding: 9px 14px; max-height: 120px; line-height: 1.35; overflow-y: hidden;
  background: var(--seite-bg);
}
.eingabe textarea:focus-visible { border-color: var(--fc-orange-text); box-shadow: 0 0 0 2px var(--fc-markierung); border-radius: 20px; }
.knopf-rund { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie); background: var(--flaeche); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.knopf-rund svg { width: 20px; height: 20px; }
.knopf-senden { background: var(--fc-orange-text); border-color: var(--fc-orange-text); color: #fff; }
[dir="rtl"] .knopf-senden svg { transform: scaleX(-1); }
.knopf-rund.aktiv { background: var(--fc-markierung); border-color: var(--fc-orange); color: var(--fc-orange-text); }

.app-fuss { padding: 8px 14px 10px; font-size: 11.5px; line-height: 1.4; color: var(--text-leise); border-top: 1px solid var(--linie); }
.app-fuss p { margin: 0; }
.fuss-demo { font-weight: 700; margin-top: 2px !important; }

/* Rechte Seite */
.seite { position: sticky; top: 44px; height: min(860px, calc(100vh - 120px)); min-height: 600px; display: flex; flex-direction: column; }
.seite-leer { border: 1.5px dashed #c5cdcd; border-radius: var(--radius); padding: 28px; color: var(--text-leise); max-width: 46ch; }
.seite-leer-titel { font-weight: 700; color: var(--text); font-size: 18px; margin-top: 0; }

.dokument { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dokument-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.dokument-meta { margin: 0; font-size: 13px; color: var(--text-leise); }
.dokument-titel { margin: 0; font-size: 22px; line-height: 1.2; }
.knopf-schliessen { background: var(--flaeche); }

/* Das Aktenblatt: das eine auffällige Element */
.blatt {
  background: var(--blatt); color: #2b3536;
  border-radius: 4px; padding: 36px 40px 40px;
  box-shadow: 0 1px 0 var(--linie), 0 18px 40px -22px rgba(53, 66, 67, .5);
  overflow-y: auto; flex: 1; min-height: 0;
  font-size: 15px; line-height: 1.6;
  border-inline-start: 6px solid var(--fc-petrol);
}
.blatt h1 { font-size: 20px; margin: 0 0 18px; }
.blatt h2 { font-size: 15px; margin: 22px 0 6px; font-weight: 700; }
.blatt p { margin: 0 0 10px; max-width: 68ch; position: relative; padding: 2px 8px; margin-inline-start: -8px; border-radius: 4px; transition: background .4s; }
.blatt .absatz-id { font-size: 11px; color: #7b8788; margin-inline-end: 6px; }
.blatt p.markiert {
  background: rgba(255, 214, 0, .45); /* gelb markierte Fundstelle */
  box-shadow: inset 4px 0 0 var(--fc-orange);
}
.blatt p.markiert::before {
  content: "Fundstelle"; position: absolute; inset-inline-end: 6px; top: -10px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--fc-orange-text); border-radius: 4px; padding: 0 6px; line-height: 18px;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Personal-Ansicht */
.personal { overflow-y: auto; }
.personal-kopf h2 { margin: 0 0 4px; font-size: 22px; }
.personal-kopf p { margin: 0 0 16px; max-width: 60ch; }
.vorgang { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.vorgang-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.vorgang h3 { margin: 0; font-size: 17px; }
.vorgang-status { font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--fc-grau-hell); color: var(--fc-petrol-tief); }
.vorgang-status.frei { background: #dcefe3; color: #1f5c39; }
.vorgang table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.vorgang th { text-align: start; font-weight: 400; color: var(--text-leise); padding: 4px 8px 4px 0; width: 38%; vertical-align: top; }
.vorgang td { padding: 4px 0; vertical-align: top; }
.vorgang td .chip { margin-inline-start: 6px; font-size: 12px; padding: 1px 8px; }
.personal-leer { color: var(--text-leise); }

/* Mobil: Smartphone füllt den Bildschirm, Dokument als Sheet */
@media (max-width: 959px) {
  body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  .buehne { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; }
  .buehne-inhalt { flex: 1; min-height: 0; }
  .buehne-kopf { padding: 10px 16px; margin: 0; background: var(--flaeche); border-bottom: 1px solid var(--linie); gap: 10px; }
  .buehne-titel { display: none; }
  .logo-forcont { height: 20px; }
  .schalter { margin-inline-start: auto; font-size: 13px; }
  .buehne-inhalt { display: block; }
  .telefon { max-width: 420px; margin: 0 auto; border: 0; border-radius: 0; box-shadow: none; height: 100%; min-height: 0; position: static; }
  .seite {
    position: fixed; inset: auto 0 0 0; z-index: 40; height: auto; max-height: 85dvh; min-height: 0;
    background: var(--seite-bg); border-radius: 20px 20px 0 0; padding: 16px; box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
    transform: translateY(105%); transition: transform .28s ease;
  }
  .seite.offen { transform: none; }
  .seite-leer { display: none; }
  .blatt { padding: 22px 20px 26px; }
  .sheet-schleier { position: fixed; inset: 0; background: rgba(30, 38, 39, .45); z-index: 35; }
}
@media (min-width: 960px) { .sheet-schleier { display: none !important; } }
@media (max-width: 380px) {
  .badge-demo { display: none; }
  .kacheln { grid-template-columns: 1fr; }
  .kachel:first-child { grid-column: auto; }
}
