/* =============================================================================
   SynergyScope — Feld-Ansicht fürs Telefon (E30, 24.10.2026)
   -----------------------------------------------------------------------------
   Eigenes Blatt mit Präfix `fd-`, die Seite läuft OHNE die Anwendungsschale
   (wie die Prüfseite, css/pruefung-ag.css). Alle Werte aus den Markentoken.

   Für den Daumen gebaut: Knöpfe mindestens 48 px hoch, eine Spalte, große
   Schrift für OZ und Hinweis. ⚠️ GOLD IST NIE FLIESSTEXT (BRAND.md § 3).
   ============================================================================= */

.fd-seite {
  background: var(--s360-flaeche);
  color: var(--s360-text);
  min-height: 100vh;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}
.fd-versteckt { display: none !important; }

/* --- Kopf ---------------------------------------------------------------- */
.fd-kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--s360-navy-900);
  color: var(--s360-weiss);
  border-bottom: var(--s360-leiste-kante-dicke) solid var(--s360-leiste-kante);
}
.fd-kopf-text { flex: 1; min-width: 0; }
.fd-wortmarke { font-weight: var(--s360-fett-voll); font-size: 0.8rem; color: var(--s360-navy-200); }
.fd-wortmarke > span { color: var(--s360-gold-500); }
.fd-kopf-titel {
  font-weight: var(--s360-fett-halb); font-size: 1.05rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fd-zurueck {
  background: transparent; border: 0; color: inherit; padding: 6px;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.fd-warteschlange {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; padding: 6px 10px; border-radius: 999px;
  background: var(--s360-navy-100); color: var(--s360-navy-900); cursor: default;
}
.fd-warteschlange-fehler { background: var(--s360-warnung-grund); color: var(--s360-text); cursor: pointer; }

/* --- Inhalt -------------------------------------------------------------- */
.fd-inhalt {
  max-width: 640px; margin: 0 auto;
  padding: 14px 12px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.fd-h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--s360-text-leise); margin: 6px 2px 0; }
.fd-karte {
  background: var(--s360-flaeche-karte);
  border: 1px solid var(--s360-linie);
  border-radius: var(--s360-radius-md);
  padding: 14px;
  color: var(--s360-text);
}
.fd-hinweis { color: var(--s360-text-leise); }
.fd-fehler { border-color: var(--s360-fehler); background: var(--s360-fehler-grund); color: var(--s360-text); }
.fd-text { margin: 0 0 10px; color: var(--s360-text-leise); }
.fd-fehlertext { color: var(--s360-fehler); margin: 8px 0 0; }

.fd-wahl { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; min-height: 56px; }
.fd-wahl-titel { font-weight: var(--s360-fett-halb); font-size: 1rem; }
.fd-wahl-unter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; color: var(--s360-text-leise); font-size: 0.85rem; }

.fd-marke {
  display: inline-block; font-size: 0.78rem; padding: 2px 8px; border-radius: 999px;
  background: var(--s360-flaeche-tief); color: var(--s360-text-leise);
  border: 1px solid var(--s360-linie);
}
.fd-marke-belegen { background: var(--s360-warnung-grund); color: var(--s360-text); border-color: var(--s360-warnung); }
.fd-marke-pruefen { background: var(--s360-akzent-leise); color: var(--s360-text); border-color: var(--s360-akzent); }

/* --- Reiter -------------------------------------------------------------- */
.fd-reiter { display: flex; gap: 6px; position: sticky; top: 64px; z-index: 4; padding: 4px 0; background: var(--s360-flaeche); }
.fd-reiter-knopf {
  flex: 1; min-height: 44px; font: inherit; font-size: 0.9rem; cursor: pointer;
  border: 1px solid var(--s360-linie); border-radius: var(--s360-radius-md);
  background: var(--s360-flaeche-karte); color: var(--s360-text);
}
.fd-reiter-knopf.aktiv { background: var(--s360-navy-900); color: var(--s360-weiss); border-color: var(--s360-navy-900); }

/* --- Position ------------------------------------------------------------ */
.fd-position { display: flex; flex-direction: column; gap: 8px; }
.fd-position.fd-beleg-zu_belegen { border-left: 4px solid var(--s360-warnung); }
.fd-position.fd-beleg-zu_pruefen { border-left: 4px solid var(--s360-akzent); }
.fd-pos-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fd-pos-oz { font-weight: var(--s360-fett-voll); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.fd-pos-text { font-size: 1rem; }
.fd-pos-meta { font-size: 0.85rem; color: var(--s360-text-leise); }
.fd-pos-hinweis {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--s360-warnung-grund); border-radius: var(--s360-radius-md);
  padding: 8px 10px; font-weight: var(--s360-fett-halb);
}
.fd-pos-wartend:empty { display: none; }
.fd-pos-wartend { font-size: 0.85rem; color: var(--s360-akzent); }
.fd-anlagen { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-anlage {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  font: inherit; font-size: 0.85rem; cursor: pointer;
  border: 1px solid var(--s360-linie); border-radius: var(--s360-radius-md);
  background: var(--s360-flaeche-tief); color: var(--s360-text); padding: 4px 10px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fd-pos-aktionen { display: flex; gap: 8px; }
.fd-pos-aktionen .fd-knopf.gross { flex: 1; }

/* --- Bedienelemente ------------------------------------------------------ */
.fd-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; font: inherit; font-weight: var(--s360-fett-halb);
  border-radius: var(--s360-radius-md); cursor: pointer; text-decoration: none;
  border: 1px solid var(--s360-linie); background: var(--s360-flaeche-karte); color: var(--s360-text);
}
.fd-knopf.primaer { background: var(--s360-gold-500); border-color: var(--s360-gold-500); color: var(--s360-text-auf-gold); }
.fd-knopf.klein { min-height: 36px; padding: 0 10px; font-size: 0.85rem; }
.fd-knopf.gefahr { color: var(--s360-fehler); }
.fd-knopf[disabled] { cursor: default; background: var(--s360-gesperrt-grund); color: var(--s360-gesperrt-text); border-style: dashed; }
.fd-sym { display: inline-flex; }
.fd-eingabe {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px;   /* 16 px: iOS zoomt sonst */
  padding: 10px 12px; border-radius: var(--s360-radius-md);
  border: 1px solid var(--s360-linie); background: var(--s360-flaeche); color: var(--s360-text);
}
.fd-eingabe:focus { outline: 2px solid var(--s360-fokus); outline-offset: 1px; }
.fd-notiz { resize: vertical; min-height: 44px; }
.fd-anmeldung { display: flex; flex-direction: column; gap: 10px; }

/* --- Betrachter ---------------------------------------------------------- */
.fd-betrachter {
  position: fixed; inset: 0; z-index: 20; background: rgba(3, 12, 30, 0.92);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.fd-betrachter-zu {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px;
  width: 48px; height: 48px; font-size: 28px; line-height: 1;
  background: transparent; color: var(--s360-weiss); border: 0; cursor: pointer;
}
.fd-betrachter-inhalt { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fd-betrachter-inhalt .fd-text { color: var(--s360-navy-200); text-align: center; }
.fd-betrachter-bild { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.fd-fehler-zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--s360-linie); }
.fd-fehler-zeile > div { flex: 1 1 100%; font-size: 0.9rem; }

/* --- E32: Foto mit Nummer ---------------------------------------------- */
.fd-nummer-karte { display: flex; flex-direction: column; gap: 8px; }
.fd-nummer-dialog { width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px; }
.fd-nummer-vorschau { max-width: 100%; max-height: 40vh; object-fit: contain; border-radius: 6px; align-self: center; }
.fd-nummer-eingabe { font-size: 1.15rem; font-weight: var(--s360-fett-halb); letter-spacing: 0.02em; }
.fd-meldung {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30;
  max-width: 616px; margin: 0 auto;
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px; border-radius: var(--s360-radius-md);
  background: var(--s360-navy-900); color: var(--s360-weiss);
  box-shadow: 0 6px 20px rgba(3, 12, 30, 0.35);
}
.fd-meldung-gut { border-left: 4px solid var(--s360-gold-500); }

/* E40b: Raum und Typenschild im Nummerndialog, „Noch offen“ je Position. */
.fd-raum-eingabe { margin-top: 8px; }
.fd-typenschild-wahl { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 1rem; }
.fd-typenschild-wahl input { width: 22px; height: 22px; }
.fd-offen-punkte { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.fd-offen-punkt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fd-offen-grund { flex: 1 1 140px; font-size: 0.9rem; color: var(--s360-text-leise); }

/* =============================================================================
   FEINZEICHNUNG — Feld-Ansicht (12.11.2026, Schicht wie scope.css TEIL E)
   Draußen geht Lesbarkeit vor Feinheit: hier wird NICHT dünner gezeichnet,
   sondern nachgeschärft. Navy-Kopf und gefüllter aktiver Reiter bleiben.
   Abschalten: <html class="grob">.
   ============================================================================= */
html:where(:not(.grob)) .fd-seite {
  /* Grautext ≥ 7:1 (AAA) auf allen Feldflächen, bei Sonne zählt jeder Schritt:
     #455266 → 7,92 Weiß · 7,31 Grund #f4f6f9 · 7,04 tief #eef2f7.
     Vorher #5f6e82: 5,20 · 4,80 · 4,62. */
  --s360-text-leise: #455266;
  --s360-text-zart:  #455266;
  /* Die Schicht stellt 600/700 global auf 500 (scope.css E1). Auf dem
     Telefon im Freien bleiben OZ, Titel und Knöpfe kräftig wie bisher. */
  --s360-fett-halb: 600;
  --s360-fett-voll: 700;
}

/* Tippflächen ≥ 44 px (vorher 36 px) */
html:where(:not(.grob)) .fd-knopf.klein { min-height: 44px; }
html:where(:not(.grob)) .fd-anlage { min-height: 44px; }
html:where(:not(.grob)) .fd-anlagen { gap: 8px; }
html:where(:not(.grob)) .fd-typenschild-wahl { min-height: 44px; }   /* die ganze Zeile ist <label> */
html:where(:not(.grob)) .fd-warteschlange-fehler { min-height: 44px; }  /* anklickbar, wenn Fehler */

/* Reiter klebte fest bei 64 px. Mit Notch wächst der Kopf um die safe-area
   (bis ~47 px) und der Reiter rutschte darunter. 54 + max(10, safe) ist ohne
   Notch genau der alte Wert (64 px) und wächst mit dem Kopf mit. */
html:where(:not(.grob)) .fd-reiter { top: calc(54px + max(10px, env(safe-area-inset-top))); }

/* Gold nie als Schrift (BRAND § 3): #DEA51C hatte 2,21:1 */
html:where(:not(.grob)) .fd-pos-wartend { color: var(--fz-akzent); }

/* Eingabefeld: Rand ≥ 3:1 ringsum (WCAG 1.4.11) — 3,65 auf der weißen Karte,
   3,37 gegen die eigene Füllung #f4f6f9. Vorher #e2e8f0 = 1,23:1. */
html:where(:not(.grob)) .fd-eingabe { border-color: var(--fz-feldkante); }

/* Meldung: Navy-Fläche bleibt, Schatten entfällt */
html:where(:not(.grob)) .fd-meldung { box-shadow: none; }

/* E43 Diktat (19.11.2026): leise, aufnehmend rot umrandet */
.fd-knopf.fd-diktat { align-self: flex-start; margin: 4px 0 8px; }
.fd-knopf.fd-diktat.laeuft { border-color: var(--s360-fehler); color: var(--s360-fehler); }

/* E44 Baustelle (19.11.2026) */
.fd-baustelle { margin: 4px 0 12px; display: grid; grid-template-columns: 1fr 1fr; }
/* Vier Knöpfe (Welle 5): zwei Spalten, damit auf 360 px nichts überlappt. */
.fd-baustelle .fd-knopf { min-width: 0; white-space: normal; text-align: center; }
.fd-plan-zeile .fd-pos-aktionen { flex-wrap: wrap; }
.fd-feld-titel { font-size: .8rem; color: var(--s360-text-leise); margin: 10px 0 4px; }
.fd-mangel.fd-ueberfaellig { border-left: 2px solid var(--s360-fehler); }
.fd-offline { background: var(--s360-warnung-grund, #fff7e6); color: var(--s360-text); border-bottom: 1px solid var(--s360-warnung, #b45309);
  padding: 6px 14px; font-size: .8rem; }
.fd-zeile { padding: 8px 0; border-bottom: 1px solid var(--s360-linie, #e5e7eb); font-size: .9rem; }
.fd-zeile:last-of-type { border-bottom: 0; }
.fd-wartend { color: var(--s360-text-leise, #6b7280); font-style: italic; }
.fd-feld-fehler { color: var(--s360-fehler, #b91c1c); font-size: .85rem; min-height: 1em; margin: 4px 0; }
/* E49 Pläne */
.fd-plan-zeile { padding: 10px 0; border-bottom: 1px solid var(--s360-linie, #e5e7eb); }
.fd-plan-zeile:last-child { border-bottom: 0; }
.fd-plan-name { font-weight: 500; word-break: break-word; }
.fd-plan-info { color: var(--s360-text-leise, #6b7280); font-size: .8rem; margin: 2px 0 6px; }
.fd-plan-leiste { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; position: sticky; top: 0; background: var(--s360-grund, #fff); padding: 6px 0; z-index: 1; }
.fd-plan-flaeche { overflow: auto; -webkit-overflow-scrolling: touch; max-height: 75vh; border: 1px solid var(--s360-linie, #e5e7eb); touch-action: pan-x pan-y pinch-zoom; }
.fd-plan-bild { display: block; }
/* E52 Markierungen im Plan */
.fd-plan-leiste .fd-knopf.klein:not(.fd-an) { opacity: .55; }
.fd-plan-detail { font-size: .85rem; padding: 8px 10px; background: var(--s360-grund, #fff); color: var(--s360-text, #1c2233); border-bottom: 1px solid var(--s360-linie, #e5e7eb); }
