/* Dokki Webapp – Ergänzungen zur Vorlage für echte Daten.
   basis.css, web.css und gespraech.css sind unverändert aus design/vorlage übernommen;
   hier steht nur, was es dort nicht gibt: Wartezustände, das echte Original auf dem Lichtpult, Hochladen. */

/* ---------- Wartezeichen ---------- */
.dreh { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: dreh .8s linear infinite; vertical-align: -1px; }
.dreh.gross { width: 22px; height: 22px; border-width: 2.5px; color: var(--tinte); margin-top: 2px; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dreh { animation-duration: 3s; } }
.wartebild { display: grid; justify-items: center; align-content: center; gap: 12px; padding: 90px 20px; }
.leerstand .knopf { margin-top: 6px; }

/* ---------- Original auf dem Lichtpult: das echte Seitenbild ---------- */
.blatt.echt { padding: 0; overflow: hidden; }
.blatt.echt img { display: block; width: 100%; height: auto; }
.blatt.echt .b-innen { position: relative; }
.lichtpult.klein .blatt.echt { max-height: 260px; overflow: auto; scrollbar-width: thin; }
.blatt.echt .markiert { position: absolute; mix-blend-mode: multiply; pointer-events: none; border-radius: 2px; }
.blatt.echt.wartet { min-height: 320px; display: grid; place-items: center; padding: 40px 20px; text-align: center; }
.lichtpult .blatt.echt { max-width: 760px; }
.belegstelle { margin-bottom: 12px; padding: 10px 14px; border-radius: var(--r-m); background: var(--flaeche); border: 1px solid var(--linie); scroll-margin: 100px; }
.belegstelle small { display: block; margin-top: 4px; }
@media (min-width: 1101px) {
  /* Die Seite bleibt neben dem Gelesenen stehen und lässt sich für sich blättern */
  .dokansicht .lichtpult { max-height: calc(100vh - 160px); overflow: auto; }
}
.gelesen small { color: var(--text-3); font-size: 12px; }
.gelesen .etikett { margin-left: 4px; }
.gelesen b { overflow-wrap: anywhere; }
.eckdaten + .knopf { justify-self: start; }
.eckdaten dd { overflow-wrap: anywhere; }

/* ---------- Eingang ---------- */
.dokzeile .notiz { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zeilenlink { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; color: inherit; text-decoration: none; }
.zeilenlink > span:not(.rund):not(.rechts) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.zeilenlink:hover b { color: var(--tinte); }
button.zeile { cursor: pointer; }

/* Datei über dem Fenster: Ablegen genügt */
html.zieht::after {
  content: "Hier ablegen – Dokki liest die Unterlage"; position: fixed; inset: 14px; z-index: 200; display: grid; place-items: center; padding: 20px; text-align: center;
  border: 2.5px dashed var(--tinte); border-radius: var(--r-l); background: color-mix(in srgb, var(--grund) 88%, transparent); color: var(--tinte);
  font: 600 22px/1.3 var(--serif); pointer-events: none;
}

/* ---------- Gespräch ---------- */
.blase.denkt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-2); }
.blase.denkt span { font-weight: 600; color: var(--text); }
.blase.denkt small { width: 100%; font-size: 12.5px; }
.g-system.fehler { color: var(--siegel); justify-content: flex-start; text-align: left; }
.g-system a { font-weight: 600; }
.blase a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.blase.dokki a { color: var(--tinte); }
.blase p { overflow-wrap: anywhere; }
a.beleg { text-decoration: none; }
a.beleg:hover { border-style: solid; border-color: var(--tinte); color: var(--tinte); }
.g-zitate + .g-zitate { margin-top: 8px; }
.g-eingabe textarea:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Termine und Vorgang ---------- */
.t-notiz { margin: -2px 0 8px; color: var(--text-2); font-size: 13.5px; }
.karte.block > .dach .etikett { margin-left: 8px; letter-spacing: 0; text-transform: none; vertical-align: 1px; }
.notizform { gap: 10px; padding-top: 14px; border-top: 1px solid var(--linie); justify-items: start; }
.notizform .feld { width: 100%; }
.vorgangskarte p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 860px) {
  .kopfzeile > .knopf { width: 100%; }
}
@media (max-width: 520px) {
  /* Schmale Terminlisten (im Vorgang, an der Unterlage): Beschriftung über den Wert */
  .terminliste.eng .t-zeile { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .gelesen button { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .eckdaten { grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
  .eckdaten dd { margin-bottom: 8px; }
}

/* ---------- Kleine Berichtigungen an Regeln der Vorlage, die erst mit echten Inhalten auffallen ---------- */
/* „.spalte section“ macht das Gespräch zum Raster; bei wenigen Nachrichten dehnen sich Kopf und Vorschläge.
   Gemeint ist die Spalte aus gespraech.css: Verlauf füllt, alles andere behält seine Höhe. */
.spalte section.gespraech { display: flex; gap: 0; }
/* In schmalen Spalten bricht der Vorgangsname um – das Symbol bleibt in seiner Zeile */
.t-zeile > .t-vorgang { flex-wrap: nowrap; align-items: flex-start; }
.t-vorgang svg { flex: none; margin-top: 3px; }

/* ---------- Postausgang ---------- */
#brieftext-edit { min-height: 340px; }
.fallbrief + .fallbrief { padding-top: 14px; border-top: 1px solid var(--linie); }
.fallbrief .knopfreihe { gap: 8px 12px; }
.wahl input:disabled { opacity: 1; }
span.dokchip { cursor: default; }
.standkasten .standknoepfe .knopf.still { background: none; }
.fassungen > div .dach { letter-spacing: .04em; }
.poststand small { overflow-wrap: anywhere; }

/* Drucken: nur das Schreiben, als schlichtes Blatt. Alles andere bleibt auf dem Papier verborgen. */
#druckblatt { display: none; }
@page { margin: 25mm 22mm; }
@media print {
  html.druckt, html.druckt body { background: #fff !important; }
  html.druckt body > *:not(#druckblatt) { display: none !important; }
  html.druckt #druckblatt { display: block; color: #000; font: 12pt/1.5 Georgia, "Times New Roman", serif; }
  #druckblatt p { margin: 0; }
  #druckblatt .d-an { min-height: 34mm; }
  #druckblatt .d-datum { text-align: right; margin-bottom: 12mm; }
  #druckblatt .d-betreff { font-weight: 700; margin-bottom: 8mm; }
  #druckblatt .d-text { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* Termine: Sortierung rechts neben den Arten, auf schmalen Bildschirmen in eigener Zeile */
.reiterleiste .sortierung { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.reiterleiste .sortierung .dach { margin: 0 4px 0 0; }
@media (max-width: 720px) { .reiterleiste .sortierung { margin-left: 0; width: 100%; } }

/* Stammbuch: Vorschläge von Dokki, Aufnahme eines Eintrags, Knöpfe am Blatt */
.blattkopf > .blattknoepfe, .kopfzeile > .blattknoepfe { flex: none; display: flex; flex-wrap: wrap; gap: 6px; align-self: center; }
.vorschlaege { padding: 18px 20px; margin-bottom: 22px; border-color: var(--siegel); display: grid; gap: 4px; }
.vorschlaege > header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 6px; }
.vorschlaege h3 { margin-top: 2px; }
.vorschlaege.aufnahme { gap: 10px; }
.vorschlaege.aufnahme .formular { margin-top: 6px; }
.vorschlag { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 0; }
.vorschlag + .vorschlag, .vorschlaege > header + .vorschlag { border-top: 1px solid var(--linie); }
.v-angabe { flex: 1 1 320px; min-width: 0; display: grid; gap: 3px; }
.v-angabe > b { font-size: 16px; overflow-wrap: anywhere; }
.v-angabe .fakt-meta { grid-column: auto; }
.v-angabe .gegenueber { margin-top: 2px; }
.v-angabe .gegenueber .dach { margin: 0; }
.v-angabe .gegenueber b { overflow-wrap: anywhere; }
.v-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.ankreuz { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.ankreuz input { width: 18px; height: 18px; accent-color: var(--tinte); }
.seite-stammbuch > .hinweis { margin-bottom: 16px; }
.schublade > .zurueck { margin-bottom: 10px; border: 0; background: none; padding: 0; cursor: pointer; }
select.eingabe { appearance: auto; }
@media (max-width: 720px) {
  .stammblatt { padding: 18px 14px 22px; }
  .v-knoepfe { width: 100%; }
}

/* Formular ausfüllen: Einträge über dem Bild der Seite, Felder daneben */
.blatt.echt .b-innen { container-type: inline-size; }
.f-eintrag { position: absolute; transform: translateY(-100%); padding: 0 .15em; line-height: 1; white-space: nowrap; font: normal 500 1.75cqw/1 Arial, Helvetica, sans-serif; color: #14306e; border-radius: 2px; cursor: grab; user-select: none; touch-action: none; }
.f-eintrag:hover, .f-eintrag.gezogen { outline: 1.5px dashed var(--tinte); outline-offset: 1px; background: rgba(255, 255, 255, .55); }
.f-eintrag.gezogen { cursor: grabbing; }
.f-eintrag.kreuz { transform: translate(-50%, -52%); padding: 0; font-weight: 700; font-size: 2.6cqw !important; }
.f-eintrag.unterschrift { display: inline-flex; align-items: center; gap: .3em; font-size: 1.15cqw !important; font-style: normal; color: var(--siegel); opacity: .8; cursor: default; pointer-events: none; }
.f-eintrag.unterschrift svg { width: 1.2em; height: 1.2em; }
.formularansicht .lichtpult .blatt.echt { max-width: 860px; }
.formularfelder { display: grid; gap: 16px; }
.formularfelder .karte { display: grid; gap: 14px; }
.f-feld { display: grid; gap: 4px; }
.f-feld .herkunft, .f-frage { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }
.f-frage { color: var(--honig); font-weight: 600; }
.f-wahl { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.f-wahl legend { padding: 0; margin-bottom: 6px; color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.f-wahl .ankreuz { font-weight: 500; }
.schriftwahl { display: inline-flex; gap: 4px; margin-left: auto; }
.strichliste { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.knopfreihe.mitte { justify-content: center; }
.formularkarte { border-color: var(--siegel); }

@page formular { size: A4; margin: 0; }
@media print {
  html.druckt #druckblatt.formular { font: inherit; }
  #druckblatt .d-seite { page: formular; break-after: page; width: 210mm; height: 296mm; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
  #druckblatt .d-seite:last-child { break-after: auto; }
  #druckblatt .d-seite .b-innen { position: relative; container-type: inline-size; }
  #druckblatt .d-seite img { display: block; width: 100%; height: auto; }
  #druckblatt .f-eintrag { outline: 0; background: none; }
}
.f-vorschlag { justify-self: start; margin-top: 2px; max-width: 100%; white-space: normal; text-align: left; }
@media (min-width: 1100px) {
  .formularansicht > .spalte:first-child { position: sticky; top: 14px; align-self: start; }
  .formularansicht .lichtpult { max-height: calc(100vh - 150px); overflow: auto; }
}
