/* Dokumentenraum - ELEMENT-CI. Handy zuerst. Spaeter Tokens aus packages/ui uebernehmen. */
:root {
  /* Tokens aus packages/ui/element.css (--el-*), Rueckfallwerte = ELEMENT-CI */
  --teal: var(--el-teal, #2E7A80); --teal-dunkel: var(--el-teal-dunkel, #245F64); --teal-hell: var(--el-teal-hell, #E6F0F1);
  --text: var(--el-text, #1C2526); --text-2: var(--el-text-2, #5B6869); --linie: var(--el-linie, #DCE3E4);
  --grund: var(--el-hinter, #F4F7F7); --karte: var(--el-flaeche, #FFFFFF);
  --gruen: var(--el-ok, #2F8F5B); --gruen-hell: color-mix(in srgb, var(--gruen) 12%, var(--karte));
  --rot: var(--el-fehler, #B83A3A); --rot-hell: color-mix(in srgb, var(--rot) 12%, var(--karte));
  --gelb: var(--el-warn, #C98A1B); --gelb-hell: color-mix(in srgb, var(--gelb) 14%, var(--karte));
  --radius: 14px; --schatten: var(--el-schatten, 0 1px 2px rgba(20,40,42,.06), 0 4px 16px rgba(20,40,42,.06));
  --schrift: var(--el-schrift, Poppins, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--schrift); color: var(--text); background: var(--grund); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 2px; }

.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.kopf-innen { max-width: 960px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marke { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.marke-wort { font-weight: 600; letter-spacing: .22em; font-size: 17px; color: var(--teal); }
.marke-zusatz { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.kunde { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.inhalt { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 16px 32px; }
.fuss { text-align: center; font-size: 11px; color: var(--text-2); padding: 16px; border-top: 1px solid var(--linie); background: var(--karte); }
.lade { color: var(--text-2); padding: 40px 0; text-align: center; }

h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.unter { color: var(--text-2); margin: 0 0 20px; font-size: 14px; }

.filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.chip-knopf { border: 1px solid var(--linie); background: var(--karte); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 36px; }
.chip-knopf[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }

.liste { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .liste { grid-template-columns: 1fr 1fr; } }
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); border: 1px solid var(--linie); }
a.dok { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.dok:hover { border-color: color-mix(in srgb, var(--teal) 40%, var(--linie)); }
a.dok:active { transform: scale(.995); }
.symbol { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-hell); color: var(--teal); display: grid; place-items: center; }
.symbol svg { width: 22px; height: 22px; }
.dok-oben { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.dok-art { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; overflow-wrap: anywhere; min-width: 0; }
.dok-titel { font-weight: 500; margin: 2px 0 6px; overflow-wrap: anywhere; }
.dok-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.dok-meta b { color: var(--text); font-weight: 500; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-neu { background: var(--teal-hell); color: var(--teal-dunkel); }
.s-gelesen { background: #eef0f1; color: var(--text-2); }
.s-angenommen, .s-bezahlt { background: var(--gruen-hell); color: var(--gruen); }
.s-abgelehnt { background: var(--rot-hell); color: var(--rot); }
.s-abgelaufen { background: var(--gelb-hell); color: var(--gelb); }
.s-zurueckgezogen { background: var(--gelb-hell); color: var(--gelb); }

.zurueck { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; margin-bottom: 14px; min-height: 36px; }
.detail { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .detail { grid-template-columns: 1fr 320px; align-items: start; } .seite { position: sticky; top: 76px; } }
.ansicht { overflow: hidden; }
.ansicht iframe { width: 100%; height: 72vh; min-height: 420px; border: 0; display: block; background: #e9eded; }
.ansicht-mobil { padding: 28px 20px; text-align: center; }
.ansicht-mobil p { color: var(--text-2); margin: 8px 0 16px; font-size: 14px; }
.seite { padding: 18px; display: grid; gap: 14px; }
.zeile { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--linie); padding-bottom: 10px; }
.zeile:last-of-type { border-bottom: 0; }
.zeile span:first-child { color: var(--text-2); }
.zeile span:last-child { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.betrag { font-size: 26px; font-weight: 600; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 500; cursor: pointer; text-decoration: none; width: 100%; transition: background .15s, opacity .15s; }
.knopf-haupt { background: var(--teal); color: #fff; }
.knopf-haupt:hover { background: var(--teal-dunkel); }
.knopf-zweit { background: var(--karte); color: var(--teal); border-color: var(--teal); }
.knopf-leise { background: transparent; color: var(--text-2); border-color: var(--linie); }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }
.knoepfe { display: grid; gap: 10px; }

.formular { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 640px; }
.formular > *, label.feld > * { min-width: 0; }
label.feld { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
input[type=text] { min-height: 48px; border: 1px solid var(--linie); border-radius: 12px; padding: 0 14px; background: var(--karte); font-size: 16px; }
input[type=text]:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-hell); }
.haken { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: 14px; cursor: pointer; }
.haken input { width: 22px; height: 22px; accent-color: var(--teal); margin: 1px 0 0; }
.unterschrift-rahmen { border: 1.5px dashed color-mix(in srgb, var(--teal) 55%, var(--linie)); border-radius: 12px; background: #fff; position: relative; touch-action: none; }
.unterschrift-rahmen canvas { display: block; width: 100%; max-width: 100%; height: 180px; border-radius: 12px; cursor: crosshair; }
.unterschrift-hinweis { position: absolute; inset: auto 0 14px 0; text-align: center; color: #9aa6a7; font-size: 13px; pointer-events: none; }
.unterschrift-linie { position: absolute; left: 18px; right: 18px; bottom: 40px; border-bottom: 1px solid var(--linie); pointer-events: none; }
.leiste { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }
.text-knopf { background: none; border: 0; color: var(--teal); cursor: pointer; padding: 6px 0; font-weight: 500; }
.hinweis { font-size: 12px; color: var(--text-2); margin: 0; }
.meldung { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.meldung-fehler { background: var(--rot-hell); color: var(--rot); }
.meldung-ok { background: var(--gruen-hell); color: var(--gruen); }

.bezahlen { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .bezahlen { grid-template-columns: 260px 1fr; align-items: start; } }
.qr { padding: 18px; text-align: center; }
.qr img { width: 100%; max-width: 220px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto 10px; }
.kopierzeile { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--linie); padding: 10px 0; }
.kopierzeile:last-child { border-bottom: 0; }
.kopierzeile small { display: block; color: var(--text-2); font-size: 12px; }
.kopierzeile span { font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kopier { border: 1px solid var(--linie); background: var(--karte); border-radius: 10px; padding: 0 12px; min-height: 36px; cursor: pointer; font-size: 13px; color: var(--teal); }

.leer, .fehlerseite { text-align: center; padding: 48px 20px; }
.leer svg, .fehlerseite svg { width: 48px; height: 48px; color: var(--teal); margin-bottom: 8px; }
.erfolg { text-align: center; padding: 32px 20px; display: grid; gap: 12px; justify-items: center; }
.erfolg .kreis { width: 64px; height: 64px; border-radius: 50%; background: var(--gruen-hell); color: var(--gruen); display: grid; place-items: center; }
.erfolg .kreis svg { width: 32px; height: 32px; }
@media (prefers-reduced-motion: no-preference) { .erfolg .kreis { animation: auf .35s ease-out; } @keyframes auf { from { transform: scale(.6); opacity: 0; } } }
.pdf-seiten { background: #e9eded; padding: 10px; display: grid; gap: 10px; max-height: 78vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) { .pdf-seiten { max-height: none; padding: 6px; gap: 6px; } }
.pdf-seite { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); width: 100%; }
.pdf-seite canvas { width: 100%; height: 100%; display: block; }
.pdf-seiten iframe { width: 100%; height: 72vh; min-height: 420px; border: 0; display: block; }
/* Arbeitsschein getrennt (Daniel 03.11.2026): zweiter Viewer im gleichen Stil, nur ergaenzt */
.ansichten { display: grid; gap: 8px; min-width: 0; }
.ansicht-titel { margin: 8px 0 0; font-size: 17px; }
.ansichten .ansicht-titel:first-child { margin-top: 0; }
.befund { border-top: 1px solid var(--linie, #E1E7E8); padding-top: 12px; display: grid; gap: 6px; }
.befund .hinweis { margin: 0; }
.qr #online { margin-top: 14px; }

/* Annahme auf Papier */
.s-eingereicht { background: var(--gelb-hell); color: var(--gelb); }
.papier-option { margin-top: 16px; padding: 18px 20px; display: grid; gap: 12px; max-width: 640px; }
.papier-option .knopf { justify-self: start; width: auto; }
.schritte { display: grid; gap: 16px; max-width: 760px; margin-bottom: 16px; }
.schritt { padding: 20px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; }
.schritt h2 { margin: 4px 0 8px; font-size: 17px; }
.schritt .nr { width: 32px; height: 32px; border-radius: 50%; background: var(--teal-hell); color: var(--teal-dunkel); display: grid; place-items: center; font-weight: 600; }
.schritt .knopf { margin-top: 12px; }
.formular-eng { display: grid; gap: 14px; margin-top: 8px; }
.formular-eng input[type=file] { font: inherit; max-width: 100%; }
.oder { margin-top: 16px; }
.meldung-info { background: var(--gelb-hell); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 0 0 8px; }
@media (min-width: 900px) { .schritte { grid-template-columns: 1fr 1fr; max-width: none; } .papier-option { grid-template-columns: 1fr auto; align-items: center; } }
.dateiwahl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; cursor: pointer; }
.dateiwahl input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dateiwahl .knopf { width: auto; min-height: 42px; }
.dateiwahl input:focus-visible + .knopf { outline: 2px solid var(--teal); outline-offset: 2px; }
.dateiname { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
div.feld { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }

/* Vertrag Anlage 2: beauftragungsberechtigte Personen + PIN */
fieldset.beauftragung { border: 1px solid var(--linie, #dfe6e7); border-radius: 12px; padding: 14px; margin: 0; display: grid; gap: 10px; min-width: 0; }
fieldset.beauftragung legend { font-weight: 600; padding: 0 6px; }
.bt-tabelle { display: grid; gap: 8px; }
.bt-zeile { display: grid; grid-template-columns: 24px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; align-items: center; }
.bt-zeile input, .bt-pin input { min-width: 0; width: 100%; font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--linie, #cfd8da); border-radius: 8px; min-height: 44px; box-sizing: border-box; }
.bt-nr { font-weight: 600; color: var(--grau, #5b6b70); text-align: center; }
.bt-pin input { max-width: 160px; letter-spacing: 4px; }
.bt-sperre:empty { display: none; }
.bt-sperre { color: var(--rot, #b3261e); margin: 0; }
@media (max-width: 640px) {
  .bt-zeile { grid-template-columns: 24px minmax(0, 1fr); padding-bottom: 6px; border-bottom: 1px solid var(--linie, #e3e9ea); }
  .bt-zeile input { grid-column: 2; }
  .bt-nr { grid-row: 1 / span 3; align-self: start; padding-top: 12px; }
}

.dauerhaft { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 8px; }
.dauerhaft input { width: 18px; height: 18px; margin: 0; }
/* Angebot mit Pflicht-Auswahl (ANWEISUNG_RAUM_AUSWAHL) */
fieldset.auswahl label.wahl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--linie, #dfe6e7); border-radius: 10px; cursor: pointer; line-height: 1.4; }
fieldset.auswahl label.wahl input { margin-top: 3px; accent-color: #2E7A80; width: 18px; height: 18px; flex: none; }
fieldset.auswahl label.wahl:has(input:checked) { border-color: #2E7A80; background: rgba(46, 122, 128, .07); }
#annahmeinfo .zeile span:last-child { text-align: right; }
.agb-frage { display: grid; gap: 6px; } .agb-frage[hidden] { display: none; }
