/* Dokumente an Einträgen (Job 255) – zu `dokumente.js`. Die Dialoge tragen `.dlg` aus app.css;
   hier steht nur, was dazukommt. Farben aus den Variablen der App, kein Rot (kata-Regel 12). */

.dok-name { margin: 0; overflow-wrap: anywhere; }
.dok-name .dok-zst { vertical-align: -3px; }
.dok-hinweis { overflow-wrap: anywhere; }

/* Der Zustand als Zeichen (Jogi 23.10.): Gerät · Gerät mit Pfeil · Gerät und Wolke · Wolke. */
.dok-zst { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 1px; color: var(--leise); }
.dok-zst svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7;
               stroke-linecap: round; stroke-linejoin: round; }
.dok-zst.wartet { color: var(--akzent-hell); }
.dok-zst.beides, .dok-zst.server { color: #7fa7d9; }

/* Ein Bildchen: das Vorschaubild, sonst ein Kästchen mit „PDF“ bzw. der Endung (Jogi 23.10.). */
.dok-bild { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: .25rem; overflow: hidden;
            display: inline-flex; align-items: center; justify-content: center;
            background: var(--werktag); color: var(--text); font-size: .55rem; font-weight: 600;
            letter-spacing: .02em; line-height: 1; }
.dok-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dok-bild svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.7;
                stroke-linecap: round; stroke-linejoin: round; }

/* Das Kürzel statt des Bildchens (Jogi 23.10.: „die inneren Ränder des Kästchens kannst du voll
   ausnützen“): zwei Zeilen à 4 Zeichen, Schrift wie „PDF“ – auch im Blatt in DIESER Grösse, dort steht
   es neben dem Bild. ⚠️ Kante und Schrift stehen auch in `dokumente.js` (KURZ_KANTE, KURZ_SCHRIFT):
   dort wird ein zu breites Kürzel kleiner gerechnet (inline `font-size`). */
/* ⚠️ `.dok-bild.dok-bild--kurz`: sonst stäche `.dok-zeile .dok-bild` (2,4 rem) im Blatt es aus. */
.dok-bild--kurz, .dok-zeile .dok-bild.dok-bild--kurz { width: 1.9rem; height: 1.9rem; font-size: .55rem; }
.dok-bild--kurz { flex-direction: column; gap: .1rem; padding: 0 1px; letter-spacing: 0; white-space: nowrap; }
.dok-bild--kurz span { display: block; max-width: 100%; overflow: hidden; }
.dok-kurz-platz { flex: 0 0 1.9rem; height: 1.9rem; }

/* Das Notiz-Zeichen (Jogi 23.10.): VOLL mit Notiz, sonst nur der RAHMEN – die Sprechblase der Notiz am
   Punkt. Kleines Zeichen, grosse Trefferfläche (Regel 4); der negative Rand hält die Zeile flach. */
.dok-notiz-z { flex: 0 0 auto; width: 2rem; height: 2.2rem; margin: -.3rem -.3rem; padding: 0;
               display: inline-flex; align-items: center; justify-content: center;
               border: 0; border-radius: .35rem; background: none; color: var(--leise); cursor: pointer; }
.dok-notiz-z svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.dok-notiz-z.voll { color: var(--akzent-hell); }
.dok-notiz-z.voll svg { fill: currentColor; }
.dok-notiz-z:hover { background: #ffffff14; }
.dok-notiz-feld { width: 100%; box-sizing: border-box; min-height: 7rem; resize: vertical; font: inherit; font-size: 1rem;
                  color: var(--text); background: var(--grund); border: 1px solid var(--gitter); border-radius: .35rem; padding: .4rem .5rem; }
.dok-notiz-feld:focus { outline: none; border-color: var(--akzent); }

/* Die Bildchen am Punkt: am Handy ZWEI und ab dem dritten „+N“ (Jogi 23.10., „erst mal
   probieren“), am breiten Schirm drei und ab dem vierten „+N“. `dokumente.js` baut immer bis zu
   drei samt beiden Zählern; hier allein steht, welche zu sehen sind – eine Grenze: 600 px. */
.dok-leiste { display: inline-flex; align-items: center; gap: .25rem; }
.dok-mehr { font-size: .75rem; color: var(--leise); font-variant-numeric: tabular-nums; padding-left: .1rem; }
.dok-leiste .dritt, .dok-leiste .dok-mehr.breit { display: none; }
@media (min-width: 600px) {
  .dok-leiste .dritt { display: inline-flex; }
  .dok-leiste .dok-mehr.schmal { display: none; }
  .dok-leiste .dok-mehr.breit { display: inline; }
}

/* Das Blatt: eine Zeile je Dokument, ein Tipp öffnet sein Menü. */
.dok-blatt-inhalt { display: flex; flex-direction: column; gap: .15rem; }
/* Breiter als die übrigen Dialoge (Jogi 23.10.: „Die ganze Maske kann ja noch etwas breiter werden“) –
   am Handy ist sie ohnehin schirmbreit. Dieselbe Grenze wie `.dlg` in app.css. */
@media (min-width: 34rem) { .dlg.dok-blatt { max-width: min(34rem, calc(100% - 2rem)); } }
.dok-zeile.frisch { animation: dok-frisch 1.6s ease-out; }
@keyframes dok-frisch { from { background: rgba(180, 104, 47, .45); } }
@media (prefers-reduced-motion: reduce) { .dok-zeile.frisch { animation-duration: .01s; } }
.dok-zeile { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 2.5rem;
             padding: .3rem .4rem; border: 0; border-radius: .4rem; background: none; color: var(--text);
             text-align: left; font-size: .95rem; cursor: pointer; }
.dok-zeile:hover, .dok-zeile:active { background: #ffffff10; }
.dok-zeile .dok-bild { width: 2.4rem; height: 2.4rem; font-size: .62rem; }
.dok-zeile-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dok-zeile-gr { flex: 0 0 auto; color: var(--leise); font-size: .8rem; font-variant-numeric: tabular-nums; }
/* Grösse und Zustand FEST breit – sonst stünden Kürzel und Notiz-Zeichen von Zeile zu Zeile versetzt
   („2 KB“ neben „12,3 MB“, ein Zeichen neben zweien; am Bild gefunden). */
.dok-zeile .dok-zeile-gr { min-width: 3.6rem; text-align: right; }
.dok-zeile .dok-zst { width: 2.3rem; justify-content: flex-end; }
.dok-leer { margin: .2rem 0; font-size: .9rem; }

/* Bearbeiten (Jogi 23.10.: umbenennen und sortieren): der Stift im Kopf schaltet, eingeschaltet
   orange hinterlegt wie der Sortier-Schalter der Checkliste. Im Modus: Bildchen · Namensfeld ·
   feste Endung · Griff ≡ (nur er zieht, an ihm ist das Rollen gesperrt). */
.dok-stift { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; margin: -.25rem 0 0; padding: 0;
             display: flex; align-items: center; justify-content: center;
             border: 1px solid transparent; border-radius: .4rem; background: none; color: var(--leise); cursor: pointer; }
.dok-stift svg, .dok-griff svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
                                 stroke-linecap: round; stroke-linejoin: round; }
.dok-stift:hover { background: #ffffff12; color: var(--text); }
.dok-stift[aria-pressed="true"] { background: rgba(180, 104, 47, .3); border-color: var(--akzent); color: var(--text); }
.dok-zeile--bearbeiten { cursor: default; }
.dok-zeile--bearbeiten:hover, .dok-zeile--bearbeiten:active { background: none; }
.dok-name-feld { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 1rem; color: var(--text);
                 background: var(--grund); border: 1px solid var(--gitter); border-radius: .35rem; padding: .3rem .4rem; }
.dok-name-feld:focus { outline: none; border-color: var(--akzent); }
.dok-endung { flex: 0 0 auto; color: var(--leise); font-size: .85rem; }
.dok-kurz-feld { flex: 0 0 5.2rem; min-width: 0; font: inherit; font-size: 1rem; color: var(--text);
                 background: var(--grund); border: 1px solid var(--gitter); border-radius: .35rem; padding: .3rem .35rem; }
.dok-kurz-feld:focus { outline: none; border-color: var(--akzent); }
.dok-griff { flex: 0 0 auto; width: 2.2rem; height: 2.4rem; padding: 0; display: flex; align-items: center;
             justify-content: center; border: 0; border-radius: .35rem; background: none; color: var(--leise);
             cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.dok-griff:hover { color: var(--text); background: #ffffff10; }
.dok-zeile.zieht { background: #ffffff14; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.dok-zeile.zieht .dok-griff { cursor: grabbing; color: var(--akzent-hell); }
.dok-legende { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: .4rem 0 0; font-size: .75rem; color: var(--leise); }
.dok-legende span { display: inline-flex; align-items: center; gap: .3rem; }

/* Das Menü eines Dokuments: untereinander, gesperrte Punkte mit ihrem Grund darunter. */
.dok-liste { display: flex; flex-direction: column; gap: .35rem; }
.dok-liste button { text-align: left; padding: .55rem .7rem; border: 1px solid var(--linie);
                    border-radius: .4rem; background: var(--grund); color: var(--text); font-size: .95rem; cursor: pointer; }
.dok-liste button:hover:not(:disabled) { border-color: var(--akzent); }
.dok-liste button:disabled { opacity: .45; cursor: default; }
.dok-liste .gefahr { color: #e08a8a; border-color: #6a3b3b; }
.dok-grund { display: block; font-size: .75rem; color: var(--leise); margin-top: .1rem; }
.dok-trenner { margin: .35rem 0 0; font-size: .72rem; color: var(--leise); text-transform: uppercase; letter-spacing: .05em; }

/* Verschieben (Jogi 23.10.): die Ziele untereinander, Unterpunkte eingerückt wie in der Liste
   (`--tiefe` setzt dokumente.js). */
.dok-ziele .dok-liste { max-height: 70vh; overflow-y: auto; }
.dok-liste .dok-ziel { margin-left: calc(var(--tiefe, 0) * 1.1rem); overflow-wrap: anywhere; }
.dok-liste .dok-zurueck { align-self: flex-start; border-color: transparent; background: none; color: var(--akzent-hell); padding-left: .2rem; }

/* Langdruck auf die Fusszeile: die wartenden Dokumente mit Haken. */
.dok-haken label { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; overflow-wrap: anywhere; }
.dok-haken input { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--akzent); }

/* Ansehen in kata: der ganze Schirm, oben Name und ×. Ein eigener Dialog, damit er ÜBER dem Blatt
   und dem Menü liegt (oberste Ebene) und das × dorthin zurückführt. */
.dok-schau { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
             border: 0; background: #000; color: var(--text); }
.dok-schau[open] { display: flex; flex-direction: column; }
.dok-schau::backdrop { background: #000; }
.dok-schau-kopf { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto;
                  padding: calc(.4rem + env(safe-area-inset-top, 0px)) calc(.7rem + env(safe-area-inset-right, 0px)) .4rem calc(.9rem + env(safe-area-inset-left, 0px));
                  background: var(--karte); }
.dok-schau-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.dok-schau-name:focus { outline: none; }   /* nimmt beim Öffnen den Fokus statt des ✕ */
.dok-schau-flaeche { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
                     display: flex; align-items: center; justify-content: center;
                     padding-bottom: env(safe-area-inset-bottom, 0px); }
.dok-schau-flaeche img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dok-schau-flaeche iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Kurze Meldung unten – liegt ein Dialog offen, steht sie in ihm (oberste Ebene). */
.dok-kurz { position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
            bottom: calc(var(--fuss-h, 1.8rem) + env(safe-area-inset-bottom, 0px) + .8rem);
            width: max-content; max-width: calc(100% - 2rem); padding: .5rem .8rem; border-radius: .5rem;
            background: #2c3036; border: 1px solid var(--gitter); color: var(--text); font-size: .85rem;
            box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.dok-kurz[hidden] { display: none; }
