/* =====================================================================
   Einheitliches Dropdown — Trigger wie ein Eingabefeld, eigenes Popover
   (ersetzt natives <select>/<datalist> in fSelect/fCombo/appendFieldRows)
   ===================================================================== */
.dd-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 46px; padding: 7px 14px; box-sizing: border-box;
  border: 1.5px solid var(--line); border-radius: var(--r-btn);
  background: var(--surface-1); color: var(--ink); cursor: pointer;
  font: inherit; transition: border-color .12s, box-shadow .12s; text-align: left;
}
.dd-trigger:hover { border-color: var(--muted); }
.dd-trigger:active { border-color: var(--brand); }
.dd-trigger.mono .dd-val { font-family: var(--font-mono); }
.dd-val { font-size: 14.5px; font-weight: 600; overflow: hidden; white-space: normal; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dd-val.ph { color: var(--placeholder); font-weight: 500; }
.dd-caret { color: var(--disabled); font-size: 11px; flex: none; }

/* Zentriertes Auswahl-Sheet statt Anker-Popover: hat IMMER volle Höhe und Platz,
   egal wie weit unten der Trigger sitzt (iPad: Popover am Screen-Ende war abgeschnitten). */
.dd-layer { position: fixed; left: 0; top: 0; width: 100vw; height: var(--vvh, 100vh); box-sizing: border-box; z-index: 1000; background: rgba(22, 24, 28, .32); display: flex; align-items: center; justify-content: center; padding: 24px; }
.dd-pop {
  position: relative; box-sizing: border-box;
  width: min(560px, 100%); max-height: min(66vh, 640px, calc(var(--vvh, 100vh) - 48px));   /* Tastatur offen → Sheet bleibt komplett sichtbar */
  background: var(--surface-1); border: 1.5px solid var(--line);
  border-radius: 18px; box-shadow: var(--sh-pop);
  overflow: hidden; display: flex; flex-direction: column;
  animation: dd-in .14s ease;
}
@keyframes dd-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.dd-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px 11px; border-bottom: 1px solid var(--line-light); }
.dd-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; }
.dd-x { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-light); background: var(--surface-1); color: var(--muted); font-size: 14px; cursor: pointer; flex: none; }
.dd-search {
  flex: none; height: 46px; border: 0; border-bottom: 1px solid var(--line);
  padding: 0 16px; font: inherit; font-size: 14.5px; outline: none;
  background: var(--surface-1); color: var(--ink);
}
.dd-list { overflow-y: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.dd-opt {
  min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--txt2);
  cursor: pointer; line-height: 1.3;
}
.dd-opt:hover { background: var(--surface-4); }
.dd-opt.sel { background: var(--brand); color: var(--on-accent); font-weight: 700; }
.dd-opt.sel::after { content: '✓'; margin-left: auto; }
.dd-empty { padding: 14px 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---- In-App-Text-Tastatur (Laser-HID unterdrückt die iPad-Bildschirmtastatur) ---- */
.tpk { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 1200;
  background: var(--surface-1); border: 1px solid var(--line, var(--line)); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28); padding: 12px; width: min(700px, 96vw); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px; }
.tpk-row { display: flex; gap: 7px; justify-content: center; }
.tpk-key { flex: 1; min-width: 0; height: 48px; border-radius: 10px; border: 1px solid var(--line, var(--line));
  background: var(--surface-3); font: inherit; font-size: 18px; font-weight: 600; color: var(--ink, var(--ink));
  cursor: pointer; touch-action: manipulation; }
.tpk-key:active { background: var(--line); }
.tpk-key.tpk-fn { flex: 1.4; background: var(--line-light); }
.tpk-key.tpk-fn.on { background: var(--brand, var(--brand)); color: var(--on-accent); }
.tpk-key.tpk-space { flex: 4; font-size: 14px; color: var(--muted, var(--txt2)); }
.tpk-key.tpk-done { flex: 1.8; background: var(--brand, var(--brand)); border-color: var(--brand, var(--brand)); color: var(--on-accent); }
.tpk-btn { flex: none; width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line, var(--line));
  background: var(--surface-1); color: var(--muted, var(--txt2)); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dd-search-row { display: flex; gap: 8px; align-items: center; }
.dd-search-row .dd-search { flex: 1; min-width: 0; }

/* Raumauswahl als Kacheln (User 20.10.2026) — große Trefferflächen statt Liste */
.dd-pop.raum-pop { width: min(760px, 100%); max-height: calc(var(--vvh, 100vh) - 48px); }   /* mehr Räume (30.10.2026): ganze Bildschirmhöhe, alles ohne Scrollen */
.raum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; overflow-y: auto; }
.raum-tile { min-height: 70px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-1); color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 6px 8px; }
.raum-tile small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.raum-tile:active { background: var(--surface-4); }
.raum-tile.active { background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
.raum-tile.active small { color: inherit; opacity: .85; }
.raum-frei { display: flex; gap: 10px; padding: 0 16px 16px; }
.raum-frei[hidden] { display: none; }
.raum-in { flex: 1; min-width: 0; height: 52px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; background: var(--surface-1); color: var(--ink); outline: none; }
.raum-in:focus { border-color: var(--brand); }
.raum-ok { flex: none; width: 160px; height: 52px; border-radius: 12px; border: none; background: var(--brand); color: var(--on-accent); font-size: 15px; font-weight: 700; cursor: pointer; }

/* Raum & Stockwerk (User 22.10.2026, Variante A): Stockwerk oben, „wie Vorposition", Räume in Gruppen */
.raum-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.raum-sub { font-size: 11px; font-weight: 700; letter-spacing: .07em; color: var(--muted); margin-top: 4px; }
.raum-etg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.raum-art { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }   /* Neue Position: Fenster | Haustür | Textposition (später + Lofttür) */
.raum-e, .raum-r { font: inherit; font-weight: 700; font-size: 16px; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-1); color: var(--ink); cursor: pointer; }
.raum-e.on, .raum-r.on { background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
.raum-wie { width: 100%; font: inherit; font-size: 15px; font-weight: 600; min-height: 48px; border-radius: 12px; border: 1.5px dashed var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface-1)); color: var(--brand); cursor: pointer; text-align: left; padding: 0 16px; margin-top: 4px; }
.raum-wie-box:empty { display: none; }
.raum-grp { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; padding: 3px 0; }
.raum-grp > span { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--txt2); text-transform: uppercase; }
.raum-rs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.raum-r { font-weight: 600; font-size: 15px; min-height: 50px; }
.raum-frei { padding: 6px 0 0; }
.raum-pop.frei-modus .raum-gruppen, .raum-pop.frei-modus .raum-wie-box, .raum-pop.frei-modus .raum-art-sub, .raum-pop.frei-modus .raum-art { display: none; }   /* Sonstiges: nur noch das Textfeld */
.raum-zurueck { align-self: flex-start; font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 4px; border: none; background: none; color: var(--brand); cursor: pointer; }
.raum-zurueck[hidden] { display: none; }
