.batch-steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.batch-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

.batch-drop:hover,
.batch-drop:focus-within {
  border-color: var(--accent);
}

.batch-drop .material-symbols-outlined {
  font-size: 2.6rem;
  color: var(--accent);
}

.batch-drop strong {
  overflow-wrap: anywhere;
}

.batch-drop small {
  color: var(--muted);
}

.batch-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.batch-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.batch-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.batch-list a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.batch-list small {
  grid-column: 2;
  color: var(--muted);
}

.batch-status {
  grid-row: span 2;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--surface-soft);
}

.batch-status-fertig {
  color: #0b5d1e;
  background: #d8f8de;
}

.batch-status-fehler {
  color: #8a0000;
  background: #ffe0e0;
}

.batch-status-läuft,
.batch-status-wartend {
  color: #6b4b00;
  background: #fff1c7;
}

.batch-filename {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.batch-progress {
  display: flex;
  gap: 14px;
  align-items: center;
}

.batch-progress > div {
  display: grid;
  flex: 1;
  gap: 6px;
}

.batch-progress small {
  color: var(--muted);
}

.batch-progress progress {
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
}

.batch-spin {
  font-size: 2.4rem;
  color: var(--accent);
  animation: batch-spin 1.2s linear infinite;
}

@keyframes batch-spin {
  to {
    transform: rotate(360deg);
  }
}

.batch-summary {
  display: grid;
  gap: 12px;
}

.batch-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-counts span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.batch-count-ok {
  background: #d8f8de !important;
}

.batch-count-warn,
.batch-count-manual {
  background: #fff1c7 !important;
}

.batch-count-done {
  background: #dcecff !important;
}

.batch-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.batch-group {
  border-left: 5px solid var(--line);
  scroll-margin-top: 90px;
}

.batch-group-bereit {
  border-left-color: #2fb84a;
}

.batch-group-warnung,
.batch-group-manuell {
  border-left-color: #f0b400;
}

.batch-group-erstellt {
  border-left-color: #2f7fe0;
}

.batch-group-übersprungen,
.batch-group-ignored {
  opacity: 0.7;
}

.batch-group-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.batch-group-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.batch-group-head small {
  color: var(--muted);
}

.batch-badge {
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 999px;
  background: var(--surface-soft);
}

.batch-badge-bereit {
  color: #0b5d1e;
  background: #d8f8de;
}

.batch-badge-warnung,
.batch-badge-manuell,
.batch-badge-liest {
  color: #6b4b00;
  background: #fff1c7;
}

.batch-badge-erstellt {
  color: #0c3f7a;
  background: #dcecff;
}

.batch-created {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 10px;
  font-weight: 700;
}

.batch-created .material-symbols-outlined {
  color: #2f7fe0;
}

.batch-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 16px;
  margin: 0 0 12px;
}

.batch-facts dt {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.batch-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.batch-facts small {
  color: var(--muted);
}

.batch-plate {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  font-weight: 800;
  border: 1px solid var(--text);
  border-radius: 4px;
}

.batch-notes {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.batch-notes summary {
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

.batch-positions {
  width: 100%;
  margin-top: 6px;
  font-size: 0.9rem;
  border-collapse: collapse;
}

.batch-positions th,
.batch-positions td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.batch-positions td:nth-child(3),
.batch-positions td:nth-child(4) {
  white-space: nowrap;
}

.batch-warnings {
  margin: 0 0 12px;
  padding: 10px 12px 10px 28px;
  color: #6b4b00;
  border-radius: 10px;
  background: #fff8e1;
}

.batch-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.batch-page {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  scroll-margin-top: 90px;
}

.batch-page-fahrzeugschein {
  border-color: #d60000;
}

.batch-page-lieferschein {
  border-color: #2f7fe0;
}

.batch-page-ignorieren {
  border-style: dashed;
  opacity: 0.6;
}

.batch-page-unsure {
  box-shadow: 0 0 0 3px #f0b400;
}

.batch-page a {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-soft);
}

.batch-page-shot {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  color: #fff;
  background: rgba(17, 24, 39, 0.82);
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.batch-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.batch-page-text {
  display: grid;
  height: 100%;
  place-items: center;
  font-size: 2.4rem;
  color: var(--muted);
}

.batch-page figcaption {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.batch-page select {
  width: 100%;
  min-height: 36px;
  font: inherit;
}

.batch-page-error {
  color: #8a0000;
  font-weight: 700;
}

.batch-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-group-actions form,
.batch-summary form {
  margin: 0;
}

.batch-delete {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

@media (max-width: 640px) {
  .batch-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-group-actions .button,
  .batch-summary .primary-save {
    width: 100%;
  }

  .batch-group-actions form {
    flex: 1 1 100%;
  }
}

.batch-choice {
  position: relative;
  cursor: pointer;
}

.batch-choice input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.batch-page[draggable="true"] {
  cursor: grab;
}

.batch-page.is-dragging {
  opacity: 0.4;
}

.batch-drag-hint {
  font-size: 1rem;
  vertical-align: middle;
  color: var(--muted);
}

.batch-drop-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  color: var(--muted);
  font-weight: 700;
  border: 2px dashed var(--line, #d0d7de);
  background: transparent;
  box-shadow: none;
}

.batch-group.is-drop-target {
  outline: 3px dashed var(--accent);
  outline-offset: 4px;
}

.batch-page figcaption form {
  margin: 0;
}

.photo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.photo-add {
  position: relative;
  justify-content: center;
  min-height: 64px;
  overflow: hidden;
  cursor: pointer;
}

.photo-add input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.photo-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.photo-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.photo-number {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 24px;
  padding: 2px 6px;
  font-weight: 800;
  text-align: center;
  color: #fff;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
}

.photo-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.photo-tool {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  cursor: pointer;
}

.photo-tool-delete {
  color: #fff;
  background: #d60000;
  border-color: #b00000;
}

.photo-progress {
  width: 100%;
  height: 10px;
  margin-bottom: 12px;
  accent-color: var(--accent);
}

.batch-status-sammelt {
  color: #6b4b00;
  background: #fff1c7;
}

[data-photo-submit]:disabled {
  color: #6b6b6b;
  background: #d9d9d9;
  border-color: #d9d9d9;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.batch-add-pages {
  margin-top: 12px;
}

.batch-drop-new {
  flex-wrap: wrap;
}

.batch-drop-new .batch-add-pages {
  margin-top: 0;
  margin-left: 12px;
}

.batch-create-bottom {
  display: flex;
  justify-content: center;
}

.batch-counts > span,
.batch-badge,
.batch-facts dt,
.batch-warnings li,
.batch-legend li,
.batch-group-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.batch-counts .material-symbols-outlined,
.batch-badge .material-symbols-outlined,
.batch-facts dt .material-symbols-outlined,
.batch-warnings li .material-symbols-outlined {
  font-size: 1.15em;
}

.batch-warnings li {
  display: flex;
}

.batch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.batch-legend li {
  padding: 6px 12px;
  color: var(--muted);
  font-weight: 700;
  border-radius: 999px;
  background: var(--surface-soft);
}

.batch-legend .material-symbols-outlined {
  color: var(--accent);
  font-size: 1.2rem;
}

.batch-head-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0;
}

.batch-head-form label {
  display: grid;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 0;
}

.batch-head-form label > span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted, #667085);
}

.batch-head-form label .material-symbols-outlined {
  font-size: 18px;
}

.batch-head-form input {
  width: 100%;
  box-sizing: border-box;
}

.batch-source {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: #e7f6ec;
  color: #1d6b38;
}

.batch-source-manuell {
  background: #fff4d6;
  color: #8a5a00;
}

.batch-head-warn {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.85rem;
  color: #8a5a00;
}
