/* ============================================================
   KI-Import (js/aiimport.js) — 10 Upload-Slots, Retro-Karten.
   Nur Farb-Tokens, harte Kanten, Hard-Shadows, keine Gradients.
   ============================================================ */

.page.aii-page { max-width: 1180px; }
.aii-headbtns { display: flex; gap: 8px; align-items: center; }
.aii-model {
  font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--muted);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aii-small { font-size: .78rem; color: var(--muted); margin: 6px 0 0; }
.aii-lblnote { font-weight: 400; font-family: var(--font); font-size: .75rem; color: var(--muted); }

/* ---- Einrichtungs-Karte ---- */
.aii-setupcard { display: flex; gap: 14px; align-items: flex-start; border-color: var(--accent); }
.aii-setupcard p { margin: 6px 0 10px; font-size: .9rem; }
.aii-setup-emoji { font-size: 2.2rem; line-height: 1; }

/* ---- Kopf-Karte: Ziel + Aktionen ---- */
.aii-intro { margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.aii-intro b { color: var(--text); }
.aii-target { margin-bottom: 10px; }
.aii-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.aii-actions .btn { font-size: .66rem; }
.aii-actions .btn:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.aii-spread { cursor: pointer; margin: 0; color: var(--text); display: inline-flex; align-items: center; }
.aii-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 12px;
}
.aii-st { font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--muted); }
.aii-st.run { color: var(--accent); }
.aii-st.ok { color: var(--ok); }
.aii-st.err { color: var(--danger); }

/* ---- Zeilen (je ein Gegenstand): Fotos | Stichworte/Status | Aktionen ---- */
.aii-list { display: flex; flex-direction: column; gap: 14px; }
.aii-slot {
  position: relative;
  display: grid; grid-template-columns: 230px minmax(0, 1fr) 190px; gap: 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow-c);
  padding: 12px;
}
.aii-c { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.aii-c-act { justify-content: flex-start; }
.aii-c-act .btn { width: 100%; font-size: .64rem; padding: 9px 10px; }
.aii-slot .btn:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.aii-c-act .aii-x { width: auto; align-self: flex-end; margin-top: auto; }
.aii-slot[data-state="empty"] { border-style: dashed; box-shadow: none; background: var(--bg); }
.aii-slot[data-state="running"] { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent-soft); }
.aii-slot[data-state="ready"] { border-color: var(--ok); }
.aii-slot[data-state="error"], .aii-slot[data-state="stale"] { border-color: var(--danger); }
.aii-slot.aii-over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.aii-slot.aii-pop { animation: aii-pop .5s steps(5, end); }
@keyframes aii-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.015) rotate(-.3deg); }
  70% { transform: scale(.998) rotate(.2deg); }
  100% { transform: scale(1); }
}
.aii-addrow {
  width: 100%; margin-top: 14px; padding: 14px;
  border-style: dashed; background: var(--bg); color: var(--muted);
}
.aii-addrow:hover { color: var(--accent); border-color: var(--accent); }
.aii-keyhint { text-align: center; }

.aii-no {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 4px;
  font-family: var(--px); font-size: .62rem; font-weight: 700;
  background: var(--surface-2); border: 2px solid var(--line); color: var(--text);
}
.aii-slot[data-state="ready"] .aii-no { background: var(--ok); color: var(--bg); }
.aii-slot[data-state="running"] .aii-no { background: var(--accent); color: var(--bg); }
.aii-head { display: flex; align-items: center; gap: 8px; }
.aii-label {
  flex: 1; min-width: 0;
  font-family: var(--px); font-size: .6rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase;
}
.aii-slot[data-state="ready"] .aii-label { color: var(--ok); }
.aii-slot[data-state="running"] .aii-label { color: var(--accent); }
.aii-slot[data-state="error"] .aii-label, .aii-slot[data-state="stale"] .aii-label { color: var(--danger); }
.aii-x { cursor: pointer; font-size: .9rem; color: var(--muted); }
.aii-where {
  font-size: .78rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* leer: Dropzone in der Fotospalte */
.aii-drop {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; cursor: pointer; text-align: center;
  border: 2px dashed var(--border); min-height: 118px;
}
.aii-drop:hover { border-color: var(--accent); }
.aii-plus {
  font-family: var(--px); font-size: 1.6rem; font-weight: 700; line-height: 1;
  color: var(--muted);
}
.aii-drop:hover .aii-plus { color: var(--accent); }
.aii-droptext { font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--muted); line-height: 1.6; }
.aii-droptext small { font-family: var(--font); font-weight: 400; font-size: .72rem; }
.aii-upbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.aii-upbtns .btn { font-size: .62rem; padding: 7px 10px; cursor: pointer; margin: 0; color: var(--text); }
.aii-upbtns.big .btn { font-size: .66rem; padding: 10px 12px; }

/* Fotos */
.aii-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.aii-thumb { position: relative; display: inline-block; }
.aii-thumb img {
  width: 58px; height: 58px; object-fit: cover; display: block; cursor: zoom-in;
  border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow-c);
  background: var(--surface-2);
}
.aii-thumb.aii-off img { opacity: .4; }
.aii-thumb button {
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; padding: 0;
  border: 2px solid var(--line); background: var(--surface); color: var(--danger);
  font-size: .6rem; font-weight: 700; cursor: pointer;
}
.aii-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border: 2px dashed var(--border);
  font-family: var(--px); font-size: .6rem; color: var(--muted);
}
.aii-uploading { font-family: var(--px); font-size: .58rem; font-weight: 700; color: var(--accent); }

.aii-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.aii-btns .btn { flex: 1 1 auto; font-size: .64rem; padding: 8px 10px; }
.aii-btns .btn.on { background: var(--accent-soft); border-color: var(--accent); }
.aii-btns .btn:disabled { opacity: .45; cursor: default; }
.aii-go { font-size: .72rem !important; padding: 11px 12px !important; }

/* Warteschlange */
.aii-wait { font-family: var(--px); font-size: .58rem; font-weight: 700; color: var(--muted); }
.aii-hour { display: inline-block; animation: aii-flip 1.2s steps(2, end) infinite; }
@keyframes aii-flip { 50% { transform: rotate(180deg); } }

/* läuft: Pixel-Lauflicht + Phase + Sekunden */
.aii-run {
  border: 2px solid var(--border); background: var(--surface-2);
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.aii-pix { display: flex; gap: 4px; }
.aii-pix i {
  display: block; width: 10px; height: 10px; background: var(--accent-soft);
  border: 1px solid var(--line);
  animation: aii-chase 1.2s steps(1, end) infinite;
}
.aii-pix i:nth-child(2) { animation-delay: .15s; }
.aii-pix i:nth-child(3) { animation-delay: .3s; }
.aii-pix i:nth-child(4) { animation-delay: .45s; }
.aii-pix i:nth-child(5) { animation-delay: .6s; }
.aii-pix i:nth-child(6) { animation-delay: .75s; }
.aii-pix i:nth-child(7) { animation-delay: .9s; }
.aii-pix i:nth-child(8) { animation-delay: 1.05s; }
@keyframes aii-chase {
  0% { background: var(--accent); }
  15% { background: var(--accent-soft); }
}
@keyframes aii-blink { 50% { opacity: .35; } }
.aii-phase { font-size: .88rem; font-weight: 600; color: var(--text); min-height: 1.3em; }
.aii-meta {
  display: flex; justify-content: space-between;
  font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--accent);
}
.aii-tools { list-style: none; margin: 0; padding: 0; font-size: .75rem; color: var(--muted); }
.aii-tools:empty { display: none; }
.aii-tools li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aii-tools li::before { content: '✓ '; color: var(--ok); }
.aii-tools li.aii-warnli { color: var(--danger); white-space: normal; }
.aii-tools li.aii-warnli::before { content: '⚠️ '; }

/* ⛓️ Ablauf (Einzellauf | Kette | automatisch) + 🔍 Kacheln — Kopf-Karte */
.aii-flowmode { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin-bottom: 4px; }
.aii-flowmode .aii-fm { flex: 1 1 220px; margin-bottom: 0; }
.aii-flowmode .aii-tilesl {
  display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin: 0;
  border: 2px solid var(--line); background: var(--surface); padding: 8px 10px;
  font-family: var(--font); font-size: .85rem; font-weight: 600; color: var(--text);
}
.aii-flowmode .aii-tilesl input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.aii-flowmode .aii-tilesl:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ⏯ Zwischenstand einer abgebrochenen Kette */
.aii-resume {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 8px 0 0;
  font-size: .78rem; color: var(--accent); border: 2px dashed var(--accent); padding: 6px 8px;
}
.aii-resume .btn { padding: 2px 8px; font-size: .75rem; }

.aii-msg { margin: 0; font-size: .85rem; }
.aii-err { color: var(--danger); word-break: break-word; }

/* fertig */
.aii-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 2px solid var(--line); background: var(--surface-2);
  padding: 8px 10px; text-align: left; cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow-c);
}
.aii-result:hover { border-color: var(--accent); }
.aii-result:active { transform: translate(2px, 2px); box-shadow: none; }
.aii-remoji { font-size: 1.9rem; line-height: 1; flex: none; }
.aii-rtext { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aii-rtext b { font-size: .98rem; line-height: 1.25; word-break: break-word; }
.aii-rtext small { font-size: .74rem; color: var(--muted); }
.aii-result .aii-conf { margin-left: auto; flex: none; }
.aii-flag.plain { border-style: dashed; }

/* Konfidenz: 10 Pixel-Segmente */
.aii-conf { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.aii-conf i { display: block; width: 7px; height: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.aii-conf.hi i.on { background: var(--ok); }
.aii-conf.mid i.on { background: var(--accent); }
.aii-conf.lo i.on { background: var(--danger); }
.aii-conf b { margin-left: 6px; font-family: var(--px); font-size: .55rem; color: var(--muted); }
h2 .aii-conf { margin-left: 8px; }

.aii-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.aii-chip {
  font-family: var(--px); font-size: .52rem; font-weight: 700;
  border: 2px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 3px 6px;
}
.aii-chip.new { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.aii-chip i { font-style: normal; color: var(--ok); }
.aii-chip em { font-style: normal; color: var(--accent); }
.aii-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.aii-flag {
  font-family: var(--px); font-size: .5rem; font-weight: 700;
  border: 1px solid var(--border); color: var(--muted); padding: 2px 5px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aii-flag.new { color: var(--accent); border-color: var(--accent); }
.aii-flag.q { color: var(--text); border-color: var(--line); cursor: help; }
.aii-flag.warn { color: var(--danger); border-color: var(--danger); }
.aii-fb { display: flex; flex-direction: column; gap: 6px; }
.aii-fb input { font-size: .9rem; padding: 8px 10px; }

/* ---- Vorlagen-Editor (Modal) ---- */
.modal:has(.aii-ed) { max-width: 640px; }
.aii-ed h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.aii-ed #aie-media { margin-bottom: 12px; }
.aii-addphoto {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; margin: 0;
  border: 2px dashed var(--line); background: var(--surface-2);
  font-size: .8rem; color: var(--muted); cursor: pointer;
}
.aii-addphoto:hover { border-color: var(--accent); color: var(--accent); }
.aii-edtags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.aii-chip.big { font-size: .58rem; padding: 4px 4px 4px 8px; display: inline-flex; align-items: center; gap: 4px; }
.aii-chip.big button {
  border: none; background: transparent; color: var(--danger); cursor: pointer;
  font-size: .7rem; padding: 0 4px;
}
.aii-addtag { width: auto !important; padding: 5px 8px !important; font-size: .8rem; }
.aii-newf { font-style: normal; color: var(--accent); font-size: .5rem; }
.aii-addfield { font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--accent); cursor: pointer; }
.aii-sources { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.aii-sources li {
  display: inline-flex; align-items: center; gap: 2px;
  border: 2px solid var(--border); background: var(--surface-2); padding: 2px 2px 2px 8px; font-size: .82rem;
}
.aii-sources li a { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aii-sources li button { cursor: pointer; color: var(--muted); padding: 2px 6px; }
.aii-questions {
  border: 2px solid var(--line); background: var(--accent-soft);
  padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px;
}
.aii-qhead { font-family: var(--px); font-size: .58rem; font-weight: 700; }
.aii-q {
  text-align: left; border: 2px solid var(--line); background: var(--surface);
  padding: 6px 8px; font-size: .86rem; cursor: pointer;
}
.aii-q:hover { border-color: var(--accent); }
.aii-dup {
  border: 2px solid var(--danger); background: var(--surface-2);
  padding: 10px; margin-bottom: 12px; font-size: .88rem;
}
.aii-dup small { color: var(--muted); }
.aii-dup .aii-btns { margin-top: 8px; }
.aii-edfb {
  border: 2px dashed var(--line); padding: 10px; margin: 4px 0 8px;
}
.aii-edfb label { margin-bottom: 8px; }
.aii-edfb .btn { width: 100%; }
.aii-histline { margin-bottom: 4px; }
.aii-ed .row-btns { flex-wrap: wrap; }

/* Item-Modal (inventory.js): fünf Knöpfe brechen mobil um */
#inv-form .row-btns { flex-wrap: wrap; }

/* ---- Stichwort-Chips (Slot, „für alle", Editor) ---- */
.aii-kwcap { font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--muted); }
.aii-kwcap span { font-family: var(--font); font-weight: 400; font-size: .72rem; }
.aii-kw {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  border: 2px solid var(--line); background: var(--surface-2);
  padding: 4px; min-height: 42px; cursor: text;
}
.aii-kw:focus-within { border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent-soft); }
.aii-kwchips { display: contents; }
.aii-kwin {
  flex: 1 1 140px; min-width: 120px; width: auto !important;
  border: none !important; background: transparent !important; box-shadow: none !important;
  padding: 6px 6px !important; font-size: .92rem; outline: none;
}
.aii-kwchip {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
  padding: 2px 2px 2px 7px; font-size: .84rem; line-height: 1.3; word-break: break-word;
}
.aii-kwchip.kv { border-color: var(--accent); background: var(--accent-soft); }
.aii-kwchip b { font-weight: 700; color: var(--accent); margin-right: 2px; }
.aii-kwchip button {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: .7rem; padding: 2px 5px;
}
.aii-kwchip button:hover { color: var(--danger); }
.aii-kwchip.ro { padding: 1px 7px; font-size: .78rem; }
.aii-kwline { display: flex; flex-wrap: wrap; gap: 4px; }
.aii-kwsug {
  position: absolute; left: -2px; right: -2px; top: 100%; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--surface); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--shadow-c);
  padding: 6px;
}
.aii-kwsug button {
  border: 2px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 4px 8px; font-size: .82rem; cursor: pointer;
}
.aii-kwsug button.key { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.aii-kwsug button:hover { border-color: var(--accent); }
.aii-kwall-l { margin-bottom: 4px; }
#aii-kwall { margin-bottom: 12px; }
.aii-ed .aii-kw { margin-bottom: 10px; }
/* Gegenprüfung: Angaben, die die Vorlage nicht enthält */
.aii-facts {
  border: 2px solid var(--danger); background: var(--surface-2);
  padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px;
}
.aii-fact { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; }
.aii-fact b { color: var(--accent); }
.aii-fact .btn, .aii-facts > .btn { font-size: .58rem; padding: 6px 8px; flex: none; }

/* ---- Sorten (Inhalt einer Tüte/Kiste) ---- */
.aii-parts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .8rem; }
.aii-parts > b { font-family: var(--px); font-size: .55rem; color: var(--accent); margin-right: 2px; }
.aii-part {
  border: 1px solid var(--border); background: var(--surface-2); padding: 1px 6px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aii-part.ex { border-color: var(--ok); }
.aii-part.more { color: var(--muted); border-style: dashed; }
.aii-partsbox {
  border: 2px solid var(--line); background: var(--surface-2);
  padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px;
}
.aii-partsbox > .btn-ghost { align-self: flex-start; font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--accent); cursor: pointer; }
.aii-paddfirst { font-family: var(--px); font-size: .55rem; font-weight: 700; color: var(--accent); cursor: pointer; margin-bottom: 10px; }
.aii-prow { border: 2px solid var(--border); background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.aii-prow.off { opacity: .5; }
.aii-prow.open { border-color: var(--line); }
.aii-pmain { display: flex; align-items: center; gap: 6px; }
.aii-pmain input[type=text], .aii-pmain input[type=number] { padding: 5px 6px; font-size: .88rem; min-width: 0; }
.aii-ptake { margin: 0; flex: none; display: inline-flex; }
.aii-ptake input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.aii-pemoji { width: 2.6em !important; flex: none; text-align: center; }
.aii-pname { flex: 1 1 auto; }
.aii-pqty { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.aii-pqty input { width: 4.6em !important; }
.aii-pqty.est b { font-family: var(--px); font-size: .7rem; color: var(--accent); }
.aii-pqty.est input { border-style: dashed; border-color: var(--accent); }
.aii-punit { width: 4.4em !important; flex: none; }
.aii-pbtn { flex: none; cursor: pointer; font-size: .85rem; color: var(--muted); padding: 4px 6px; }
.aii-pbtn i { font-style: normal; font-size: .7rem; margin-left: 2px; }
.aii-pbtn:hover { color: var(--text); }
.aii-pex {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0;
  font-family: var(--font); font-size: .85rem; font-weight: 600; color: var(--ok); cursor: pointer;
}
.aii-pex input { width: 16px; height: 16px; margin: 0; accent-color: var(--ok); }
.aii-pex small { color: var(--muted); font-weight: 400; }
.aii-pdetail { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 0 24px; }
.aii-pdetail label { margin-bottom: 0; }
.aii-ptags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.aii-ptags .aii-chip { display: inline-flex; align-items: center; gap: 2px; }
.aii-ptags .aii-chip button { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: .7rem; padding: 0 3px; }
.aii-pmode { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.aii-pmode label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); padding: 6px 10px;
  font-family: var(--px); font-size: .55rem; font-weight: 700; box-shadow: 2px 2px 0 var(--shadow-c);
}
.aii-pmode label.on { background: var(--accent); color: #fff; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .25); }
.aii-pmode input { position: absolute; opacity: 0; pointer-events: none; }
.aii-pmode label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) {
  .aii-pmain { flex-wrap: wrap; }
  .aii-pname { flex: 1 1 60%; }
  .aii-pdetail { padding-left: 0; }
}

/* ---- Mobil ---- */
@media (max-width: 820px) {
  .aii-slot { grid-template-columns: 150px minmax(0, 1fr); }
  .aii-c-act { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .aii-c-act .btn { width: auto; flex: 1 1 auto; }
  .aii-c-act .aii-x { flex: none; margin: 0 0 0 auto; align-self: center; }
  .aii-keyhint { display: none; }
}
@media (max-width: 560px) {
  .aii-slot { grid-template-columns: 1fr; gap: 10px; padding: 10px; }
  .aii-drop { flex-direction: row; flex-wrap: wrap; min-height: 0; padding: 8px; justify-content: flex-start; }
  .aii-drop .aii-plus, .aii-drop .aii-droptext small { display: none; }
  .aii-drop .aii-droptext { flex: 1 1 60px; text-align: left; }
  .aii-actions .btn { flex: 1 1 100%; }
  .aii-model { display: none; }
  .aii-kwin { font-size: 1rem; }   /* iOS zoomt sonst beim Fokus */
}
@media (prefers-reduced-motion: reduce) {
  .aii-pix i, .aii-hour, .aii-slot.aii-pop { animation: none; }
}

/* ============================================================
   Inventar-Übersicht: Sortierung (js/inventory.js, AP-C)
   ============================================================ */
.inv-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.inv-toolbar .inv-search { flex: 1 1 260px; width: auto; margin-bottom: 0; }
.inv-sortbox { display: flex; gap: 6px; align-items: stretch; flex: 0 1 auto; }
.inv-sortbox select {
  width: auto; min-width: 0; padding: 8px 10px;
  font-family: var(--px); font-size: .62rem; font-weight: 700;
}
.inv-sortbox .btn { padding: 6px 10px; font-size: .6rem; box-shadow: 2px 2px 0 var(--shadow-c); white-space: nowrap; }
.inv-sortbox .btn:active { transform: translate(2px, 2px); box-shadow: none; }
.inv-boxbtn { opacity: .55; }
.inv-boxbtn.on { opacity: 1; background: var(--accent-soft); border-color: var(--accent); }
.inv-grouphead {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--px); font-size: .62rem; font-weight: 700; color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding: 10px 6px 4px; margin-bottom: 2px;
}
.inv-grouphead:first-child { padding-top: 2px; }
.inv-name small.inv-when { color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  .inv-sortbox { flex: 1 1 100%; }
  .inv-sortbox select { flex: 1; }
}
/* Inventar-Kopf: sechs Knöpfe dürfen umbrechen statt aus der Seite zu ragen */
.bd-treehead:has(#inv-aiimp) { flex-wrap: wrap; }
.bd-treehead:has(#inv-aiimp) > span { flex-wrap: wrap; justify-content: flex-end; }

/* ⧉ Anzahl Exemplare (js/exemplars.js) — Stepper auf der Karte, im Editor und Kopf-Einstellung Suffix */
.aii-copies {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 6px 0 2px; font-size: .78rem; color: var(--muted);
}
.aii-copies .aii-cpl { font-family: var(--px); font-size: .55rem; font-weight: 700; }
.aii-copies .aii-cpstep { display: inline-flex; align-items: center; gap: 2px; }
.aii-copies .aii-cpstep .btn { padding: 2px 9px; min-width: 30px; }
.aii-copies input[type=number] { width: 4.2em; padding: 3px 4px; text-align: center; margin: 0; }
.aii-copies.multi { color: var(--text); }
.aii-copies.multi .aii-cpnote { color: var(--accent); font-family: var(--px); font-size: .6rem; }
.aii-copies.multi input[type=number] { border-color: var(--accent); }
.aii-copies .aii-cpnames { color: var(--muted); }
.aii-copies .aii-cpsug { border: 2px dashed var(--accent); padding: 0 6px; color: var(--accent); cursor: help; }
.aii-copies.ro { color: var(--accent); font-family: var(--px); font-size: .6rem; }
.aii-copies.ro small { font-family: var(--font); color: var(--muted); }
.aii-sfxl { display: flex; align-items: center; gap: 8px; font-size: .8rem; margin: 4px 0; }
.aii-sfxl input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.aie-copies input[type=number] { width: 6em; }
