/* Gemeinsamer Grund von Betriebsseite und Cockpit, „Klarer Arbeitsplatz“ (docs/specs/2026-11-17-oberflaeche-arbeitsplatz.md):
   Farben, Zustände und Maße, Grundstil, Fokus, Symbole und die Instagram-Vorschau. */

:root {
  --bg: #F7F8F7;
  --surface: #FFFFFF;
  --soft: #EEF1EF;
  --ink: #15201C;
  --muted: #5B6762;
  --line: #E3E7E4;
  --field-line: #838D88;
  --accent: #1F5A46;
  --accent-hover: #184A39;
  --accent-on: #FFFFFF;
  --accent-soft: #E8F0EC;
  --r-s: 6px;
  --r-m: 8px;
  --r-l: 12px;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ig-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Zustände: Schrift, Fläche, Punkt */
  --z-vorschlag-schrift: #3B5470;
  --z-vorschlag-flaeche: #E3EAF1;
  --z-vorschlag-punkt: #5E7A96;
  --z-winzer-schrift: #7A4E0E;
  --z-winzer-flaeche: #FBF0DC;
  --z-winzer-punkt: #C98A1B;
  --z-geplant-schrift: #1E5A3A;
  --z-geplant-flaeche: #E3F1E8;
  --z-geplant-punkt: #2F8A57;
  --z-ruhig-schrift: #3A4641;
  --z-ruhig-flaeche: #EEF1EF;
  --z-ruhig-punkt: #8A958F;
  --z-fehler-schrift: #A3291C;
  --z-fehler-flaeche: #FBE7E5;
  --z-fehler-punkt: #D0473A;
  --z-hinweis-schrift: #7A4E0E;
  --z-hinweis-flaeche: #FBF0DC;

  /* Hauptfarbe des Weinguts (Avatar der Vorschau); die Betriebsseite setzt sie, sonst gilt der Akzent. */
  --w1: var(--accent);
  --w1-on: var(--accent-on);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Schrift schon auf body: nichts soll auf die Serifen-Standardschrift des Browsers zurückfallen. */
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); line-height: 1.5; overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.sym { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; flex: none; }

/* ---------- Zustände: Pille, Punkt, Ziffern ---------- */
.z-vorschlag { --zs: var(--z-vorschlag-schrift); --zf: var(--z-vorschlag-flaeche); --zp: var(--z-vorschlag-punkt); }
.z-winzer { --zs: var(--z-winzer-schrift); --zf: var(--z-winzer-flaeche); --zp: var(--z-winzer-punkt); }
.z-geplant { --zs: var(--z-geplant-schrift); --zf: var(--z-geplant-flaeche); --zp: var(--z-geplant-punkt); }
.z-ruhig { --zs: var(--z-ruhig-schrift); --zf: var(--z-ruhig-flaeche); --zp: var(--z-ruhig-punkt); }
.z-fehler { --zs: var(--z-fehler-schrift); --zf: var(--z-fehler-flaeche); --zp: var(--z-fehler-punkt); }
.z-hinweis { --zs: var(--z-hinweis-schrift); --zf: var(--z-hinweis-flaeche); --zp: var(--z-hinweis-schrift); }
.pille {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 500; line-height: 1; color: var(--zs); background: var(--zf);
}
.pille-punkt { width: 6px; height: 6px; border-radius: 50%; background: var(--zp); flex: none; }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--zp); flex: none; }
.ziffern { font-variant-numeric: tabular-nums; }

/* ---------- Wortmarke und Meldungszeile (wortmarke() und zeigeMeldung() aus /lib/symbole.js) ---------- */
/* Zeichen in einer Kachel der Akzentfarbe, daneben „Wengertspost“; die Schriftgröße setzt die jeweilige Seite. */
.wortmarke { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.wortmarke-zeichen {
  width: 32px; height: 32px; border-radius: var(--r-m); flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-on);
}
.wortmarke-zeichen .sym { stroke-width: 2; }
/* Ruhige Zeile mit Symbol: Erfolg in Geplant-Grün, Fehler in Rot; ohne Text unsichtbar. */
.meldung { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--z-geplant-schrift); overflow-wrap: anywhere; }
.meldung:empty { display: none; }
.meldung.is-fehler { color: var(--z-fehler-schrift); }
/* Etwas läuft noch („Wird gespeichert …“): ruhig, ohne Symbol – grün mit Häkchen hieße „erledigt“. */
.meldung.is-laeuft { color: var(--z-ruhig-schrift); }
.meldung .sym { margin-top: calc((1lh - 20px) / 2); }

/* ---------- Instagram-Vorschau (im Look von Instagram, nicht von Wengertspost) ---------- */
.ig { background: #FFFFFF; color: #0F1419; font-family: var(--ig-font); border: 1px solid #E3E5E8; border-radius: 16px; overflow: hidden; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-av {
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--w1); color: var(--w1-on); font-weight: 600; font-size: 15px;
}
.ig-av img { width: 100%; height: 100%; object-fit: cover; background: #FFFFFF; }
.ig-user { font-size: 15px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ig-buehne { position: relative; }
.ig-media {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #DDDDDD; overscroll-behavior-x: contain;
}
.ig-media.sv-45 { aspect-ratio: 4 / 5; }
.ig-media.sv-11 { aspect-ratio: 1 / 1; }
.ig-media::-webkit-scrollbar { display: none; }
.ig-media:focus-visible { outline-offset: -3px; }
.ig-slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.ig-slide img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.ig-fehlt { background: #E6E8EA; }
.ig-fehlt img { visibility: hidden; }
.ig-count {
  position: absolute; top: 10px; right: 10px; background: rgba(15, 20, 25, .72); color: #FFFFFF;
  font-size: 13px; padding: 3px 9px; border-radius: 12px; pointer-events: none;
}
.ig-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #0F1419;
  box-shadow: 0 1px 4px rgba(15, 20, 25, .25);
}
.ig-nav .sym { stroke-width: 2.4; }
.ig-zurueck { left: 8px; }
.ig-weiter { right: 8px; }
.ig-nav:disabled { display: none; }
.ig-bar { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 12px 4px; }
.ig-sym { width: 24px; height: 24px; fill: none; stroke: #0F1419; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ig-save { margin-left: auto; }
.ig-dots { display: flex; gap: 4px; position: absolute; left: 50%; transform: translateX(-50%); }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #C4C8CE; }
.ig-dots i.on { background: #0095F6; }
.ig-cap { padding: 4px 12px 12px; font-size: 16px; line-height: 1.45; }
.ig-cap-t { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ig-cap-t:focus { outline: none; }
.ig-lang .ig-cap-t { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ig.open .ig-cap-t { display: block; }
.ig-cap b { font-weight: 600; }
.ig-tag { color: #00376B; }
.ig-more { border: 0; background: none; color: #59606B; padding: 0; min-height: 44px; font-size: 16px; font-family: var(--ig-font); }
.ig.open .ig-more { display: none; }

/* Gewählter Ausschnitt: das ganze Bild wird so groß und so verschoben, dass die Fläche genau den Ausschnitt zeigt.
   --iw, --ih, --il, --it setzt /lib/vorschau.js über das CSSOM. */
.ig-crop { overflow: hidden; }
.ig-crop img { position: absolute; max-width: none; width: var(--iw); height: var(--ih); left: var(--il); top: var(--it); object-fit: fill; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
