/* Felder & Hof: Felder importieren (11.11.2026, js/hw-felder-import.js). Flach, Design-Thema 09.11.: Felder grün, Orange nur als Akzent. */

/* Wahl unter „Neues Feld“ */
.hwi-wahl { position: fixed; z-index: 9200; width: 300px; max-width: calc(100vw - 32px); padding: 6px; display: grid; gap: 2px;
  background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius, 12px); box-shadow: 0 10px 28px rgba(15, 23, 42, .14); }
.hwi-wahl button { display: grid; gap: 2px; padding: 10px 12px; border: none; border-radius: var(--radius-sm, 8px); background: none; font: inherit;
  text-align: left; cursor: pointer; color: var(--text); }
.hwi-wahl button:hover, .hwi-wahl button:focus-visible { background: var(--app-bg, #eef1f5); outline: none; }
.hwi-wahl b { font-size: 15px; font-weight: 600; }
.hwi-wahl span { font-size: 13px; color: var(--text-muted); }

/* Fenster */
.modal-overlay.hwi-huelle { z-index: 9100; }
.hwi-fenster { width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.hwi-fenster.hwi-breit { width: 960px; }
.hwi-rumpf { padding: 18px 24px; display: flex; flex-direction: column; gap: 16px; min-height: 0; flex: 1 1 auto; overflow: auto; }
.hwi-fenster .modal-footer { display: flex; gap: 10px; justify-content: flex-end; }
.hwi-fenster .hwi-links { margin-right: auto; }

.hwi-ablage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; padding: 20px;
  border: 2px dashed var(--border); border-radius: var(--radius, 12px); background: var(--app-bg, #eef1f5); cursor: pointer; text-align: center; }
.hwi-ablage b { font-size: 16px; font-weight: 600; color: var(--text); }
.hwi-ablage span { font-size: 14px; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.hwi-ablage:hover, .hwi-ablage.hwi-drueber { border-color: var(--text-muted); }
.hwi-fehler { padding: 10px 14px; border-radius: var(--radius-sm, 8px); border-left: 3px solid var(--danger, #c0392b); background: var(--surface, #fff);
  color: var(--danger, #c0392b); font-size: 14px; }
.hwi-weg b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.hwi-weg ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--text-muted); }

/* Ergebnis: links Karte, rechts drei Gruppen */
.hwi-ergebnis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; min-height: 0; }
.hwi-karte { min-height: 380px; border-radius: var(--radius-sm, 8px); overflow: hidden; background: var(--app-bg, #eef1f5); border: 1px solid var(--border); }
.hwi-listen { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hwi-gruppe h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.hwi-gruppe h4 i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.hwi-gruppe h4 span { margin-left: auto; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hwi-neu h4 i { background: #3f9a5a; }
.hwi-bleibt h4 i { background: #fff; box-shadow: inset 0 0 0 2px #94a3b8; }
.hwi-weg h4 i { background: #E0913A; }
.hwi-liste { border-top: 1px solid var(--border); }
.hwi-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hwi-kopf { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0; font-size: 14px; color: var(--text); }
.hwi-kopf input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.hwi-kopf b { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hwi-ha { font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.hwi-zeile select, .hwi-bis input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  background: var(--surface, #fff); color: var(--text); }
.hwi-bis { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.hwi-leer { margin: 0; font-size: 14px; color: var(--text-muted); }

/* Formen auf der Karte */
.hwi-form { stroke: #2f6d42; fill: #3f9a5a; fill-opacity: .3; }
.hwi-form-bleibt { stroke: #56687c; fill: #ffffff; fill-opacity: .55; }
.hwi-form-weg { stroke: #B86E22; fill: #E0913A; fill-opacity: .3; stroke-dasharray: 6 5; }

html.dark .hwi-wahl, html.dark .hwi-zeile select, html.dark .hwi-bis input { background: var(--surface, #1e2530); }

@media (max-width: 760px) {
  .hwi-ergebnis { grid-template-columns: minmax(0, 1fr); }
  .hwi-karte { min-height: 220px; }
  .hwi-rumpf { padding: 14px 16px; }
}

/* Fenster „Neues Feld“ mit Karte (js/hw-felder-neu.js) */
.modal-overlay.hwn-huelle { z-index: 9100; }
.hwn-fenster { width: 1040px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.hwn-fenster .modal-footer { display: flex; gap: 10px; justify-content: flex-end; }
.hwn-rumpf { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 20px; padding: 4px 24px 8px; min-height: 0; flex: 1 1 auto; overflow: auto; }
.hwn-links { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hwn-karte { position: relative; height: 440px; border-radius: var(--radius-sm, 8px); overflow: hidden; border: 1px solid var(--border); background: var(--app-bg, #eef1f5); cursor: crosshair; }
.hwn-karte.leaflet-container { cursor: crosshair; }
.hwn-art { position: absolute; z-index: 1000; left: 10px; bottom: 10px; display: flex; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); overflow: hidden; }
.hwn-art button { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: none; background: none; color: var(--text-muted); cursor: pointer; }
.hwn-art button.aktiv { background: var(--text, #2b2f33); color: #fff; }
.hwn-leiste { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hwn-stand { flex: 1 1 200px; font-size: 14px; color: var(--text); }
.hwn-stand--gps::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #E0913A; margin-right: 8px; vertical-align: 1px; }
.hwn-rechts { align-content: start; }
.hwn-rechts select, .hwn-rechts input[type=date] { font: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  background: var(--surface, #fff); color: var(--text); width: 100%; box-sizing: border-box; }
.hwn-flaeche { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.hwn-flaeche b { font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.hwn-form { stroke: #ffffff; fill: #3f9a5a; fill-opacity: .4; }
.hwn-ecke { stroke: #ffffff; fill: #2b2f33; fill-opacity: 1; }
.hwn-da { stroke: #ffffff; fill: #94a3b8; fill-opacity: .35; }
html.dark .hwn-rechts select, html.dark .hwn-rechts input[type=date] { background: var(--surface, #1e2530); }
@media (max-width: 760px) {
  .hwn-rumpf { grid-template-columns: minmax(0, 1fr); padding: 4px 16px 8px; }
  .hwn-karte { height: 300px; }
}
/* Am Mac: QR-Code fürs Handy über der Karte */
.hwn-qr { position: absolute; z-index: 1100; inset: 0; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 24px;
  background: var(--surface, #fff); cursor: default; }
.hwn-qr-bild { flex: 0 0 auto; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); max-width: 190px; word-break: break-all; font-size: 12px; }
.hwn-qr-bild img, .hwn-qr-bild canvas { display: block; }
.hwn-qr-text { max-width: 300px; font-size: 14px; color: var(--text); }
.hwn-qr-text b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.hwn-qr-text ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.hwn-qr-text span { color: var(--text-muted); }
/* Am Handy: Vollbild, große Karte, Ablaufen als Hauptknopf */
@media (max-width: 760px) {
  .hwn-huelle { padding: 0 !important; align-items: stretch; }
  .hwn-fenster.hwn-handy { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .hwn-handy .hwn-karte { height: 52vh; }
  .hwn-handy [data-gps] { order: -1; flex: 1 1 100%; padding: 14px; font-size: 16px; }
  .hwn-handy .hwn-stand { flex-basis: 100%; }
  .hwn-handy .hwn-art { left: auto; right: 10px; bottom: auto; top: 10px; }
}
