:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-soft: #eef2f8;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ec;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --shadow: 0 16px 40px rgba(15, 23, 42, .08);
  --radius: 18px;
}

[data-theme="dark"] {
  --bg: #0d111b;
  --panel: #151b28;
  --panel-soft: #1e2635;
  --text: #e5edf8;
  --muted: #93a4ba;
  --line: #2b3548;
  --primary: #60a5fa;
  --primary-soft: #1e3a5f;
  --danger: #f87171;
  --shadow: 0 20px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #2563eb, #7c3aed); font-weight: 800; }
.brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav a { padding: 11px 12px; border-radius: 12px; color: var(--text); }
.nav a:hover { background: var(--panel-soft); }
.muted-link { color: var(--muted) !important; }
.main { padding: 28px; max-width: 1640px; width: 100%; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.top-actions, .button-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-chip { padding: 9px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.ghost { background: transparent; }
.btn.full { width: 100%; }
.card, .metric, .tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 22px; }
.card-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { padding: 18px; }
.metric span { color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; }
.metric.danger strong { color: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); padding: 10px 12px; font: inherit; }
textarea { min-height: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label span { display: block; font-weight: 700; margin-bottom: 7px; }
.full-span { grid-column: 1 / -1; }
.check-row { display: flex; gap: 10px; align-items: center; }
.check-row input { width: auto; }
.field-error { color: var(--danger); display: block; margin-top: 6px; }
.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.message { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.message.success { background: #dcfce7; color: #14532d; border-color: #86efac; }
.message.error { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.status { padding: 6px 9px; border-radius: 999px; background: var(--panel-soft); color: var(--text); font-size: 13px; font-weight: 750; display: inline-flex; }
.status.entwurf, .status.archiviert { background: #e5e7eb; color: #374151; }
.status.daten_pruefen { background: #fef3c7; color: #92400e; }
.status.bereit_fuer_foto { background: #dbeafe; color: #1d4ed8; }
.status.foto_erledigt { background: #ccfbf1; color: #0f766e; }
.status.bereit_fuer_lager { background: #ede9fe; color: #6d28d9; }
.status.eingelagert, .status.bereit_fuer_verkauf, .status.erledigt { background: #dcfce7; color: #166534; }
.status.gesperrt, .status.fehlgeschlagen { background: #fee2e2; color: #991b1b; }
.status.laeuft { background: #dbeafe; color: #1d4ed8; }
.detail-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr) 360px; gap: 18px; }
.hero-card { align-self: start; }
.image-placeholder { height: 220px; border-radius: 16px; background: var(--panel-soft); display: grid; place-items: center; color: var(--muted); margin-bottom: 16px; }
.data-list { display: grid; grid-template-columns: 150px 1fr; gap: 10px 18px; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 16px; }
.tile { padding: 20px; color: var(--text); display: grid; gap: 8px; }
.tile span { color: var(--muted); }
.tile.muted { opacity: .65; }
.top-gap { margin-top: 16px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 20% 20%, var(--primary-soft), transparent 35%), var(--bg); }
.login-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 28px; }
.login-head { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.login-head h1 { margin: 0; }
.login-head p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .metric-grid, .detail-grid, .tile-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .main { padding: 18px; }
  .topbar, .toolbar { flex-direction: column; align-items: stretch; }
  .metric-grid, .detail-grid, .tile-grid, .form-grid { grid-template-columns: 1fr; }
}

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tab-button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 12px 16px; font-weight: 800; cursor: pointer; }
.tab-button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.sub-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.sub-card-head h2 { margin: 0; }
.sub-card-head p { color: var(--muted); margin: 4px 0 0; }
.formset-list { display: grid; gap: 14px; }
.formset-row { display: grid; grid-template-columns: 1.25fr 1.25fr 1.25fr .55fr .5fr .5fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.feature-row { grid-template-columns: 1.15fr 1.7fr .45fr .35fr .45fr; align-items: end; }
.formset-row label span, .image-form-card label span { display: block; font-weight: 700; margin-bottom: 7px; }
.delete-row { color: var(--danger); }
.image-formset-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 16px; }
.image-form-card { border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); padding: 14px; display: grid; gap: 12px; }
.thumb-wrap, .thumb-placeholder, .detail-image { border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.thumb-wrap, .thumb-placeholder { height: 170px; color: var(--muted); }
.thumb-wrap img, .detail-image img, .gallery-card img { width: 100%; height: 100%; object-fit: contain; display: block; }
.detail-image { height: 220px; margin-bottom: 16px; }
.image-gallery { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
.gallery-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); padding: 10px; display: grid; gap: 8px; }
.gallery-card img { height: 150px; background: var(--panel); border-radius: 10px; }
.gallery-card span, .muted-text { color: var(--muted); font-size: 13px; }
@media (max-width: 1180px) {
  .formset-row { grid-template-columns: 1fr 1fr; }
  .image-gallery { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .tabs { overflow-x: auto; }
  .formset-row, .image-formset-grid, .image-gallery { grid-template-columns: 1fr; }
}


.checkboxselectmultiple, .form-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.form-grid li label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-grid li input[type="checkbox"] { width: auto; }

/* V0.3.7 - einfache Bildverwaltung */
.btn.small { padding: 7px 10px; border-radius: 10px; font-size: 13px; }
.btn.danger { border-color: rgba(220, 38, 38, .28); color: var(--danger); background: transparent; }
.btn.danger:hover { background: rgba(220, 38, 38, .08); }
.image-manager { display: grid; gap: 14px; }
.image-list { display: grid; gap: 10px; }
.image-row { display: grid; grid-template-columns: 46px 132px minmax(220px, 1.2fr) minmax(220px, 1fr) 150px 220px; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.image-row.is-deleted, .feature-assignment-edit-row.is-deleted { display: none; }
.image-order-badge { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 850; }
.image-preview { height: 88px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 13px; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-upload span, .image-note span { display: block; font-weight: 700; margin-bottom: 6px; }
.image-main { justify-content: flex-start; }
.image-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.empty-list-hint { padding: 18px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); background: var(--panel-soft); }
@media (max-width: 1320px) {
  .image-row { grid-template-columns: 44px 120px 1fr 1fr; }
  .image-main, .image-actions { grid-column: span 2; }
}
@media (max-width: 760px) {
  .image-row { grid-template-columns: 1fr; }
  .image-main, .image-actions { grid-column: auto; }
  .image-actions { justify-content: flex-start; }
}

/* V0.3.8 - Spalteneditor Artikelübersicht */
.column-editor { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 16px; padding: 14px; margin-bottom: 16px; }
.column-editor-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 12px; }
.column-editor-head h3 { margin: 0 0 4px; }
.column-editor-head p { margin: 0; color: var(--muted); }
.column-editor-grid { display: flex; flex-direction: column; gap: 8px; }
.column-editor-row { display: grid; grid-template-columns: 34px auto minmax(160px, 1fr) 92px auto 78px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: grab; }
.column-editor-row.is-dragging { opacity: .55; cursor: grabbing; }
.column-editor-row.is-drag-over { outline: 2px solid var(--primary); }
.column-editor-row input[type="checkbox"] { width: auto; }
.column-editor-row input[type="number"] { padding: 7px 8px; border-radius: 9px; }
.column-editor-label { font-weight: 700; }
.column-drag-handle, .column-order-btn { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 9px; min-height: 32px; cursor: pointer; font-weight: 800; }
.column-drag-handle { cursor: grab; }
.column-order-actions { display: flex; gap: 4px; justify-content: flex-end; }
.column-order-btn:disabled { opacity: .35; cursor: not-allowed; }
.column-editor-row small, .column-editor-status { color: var(--muted); font-size: 13px; }
.column-editor-status { margin-top: 10px; min-height: 18px; }
.table-scroll { overflow-x: auto; }
.resizable-table { table-layout: fixed; min-width: max-content; }
.resizable-table th { position: relative; user-select: none; white-space: nowrap; }
.resizable-table td { overflow: hidden; text-overflow: ellipsis; }
.column-resizer { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; border: 0; padding: 0; background: transparent; cursor: col-resize; z-index: 2; }
.column-resizer:hover, .column-resizer:focus { background: rgba(37, 99, 235, .18); outline: none; }
.cell-truncate { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) {
}
@media (max-width: 760px) {
  .column-editor-row { grid-template-columns: 34px auto 1fr; }
  .column-editor-row input[type="number"], .column-editor-row small, .column-order-actions { grid-column: 3; }
  .column-editor-row input[type="checkbox"] { justify-self: start; }
}

/* V0.4.0 - gemeinsame Produktgruppen-/Merkmal-/Werte-Verwaltung */
.feature-manager-grid { display: grid; grid-template-columns: minmax(240px, .85fr) minmax(430px, 1.45fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.feature-manager-column { min-height: 520px; display: flex; flex-direction: column; gap: 14px; }
.feature-manager-column.wide { min-width: 0; }
.sub-card-head.compact { margin-bottom: 4px; }
.inline-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.inline-create-form select { min-width: 0; }
.manager-list { display: grid; gap: 8px; }
.manager-list.compact-list { gap: 7px; }
.manager-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); color: var(--text); }
.manager-list-item.active { border-color: rgba(37, 99, 235, .55); background: var(--primary-soft); }
.manager-list-item span { color: var(--muted); font-size: 13px; }
.manager-subsection { display: grid; gap: 8px; }
.manager-table-head { display: grid; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 800; padding: 0 12px; }
.feature-assignment-head, .assignment-row { grid-template-columns: minmax(160px, 1fr) 110px 126px; }
.assignment-row { display: grid; align-items: center; }
.assignment-row a { color: var(--text); }
.no-margin { margin: 0; }
.value-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 1280px) {
  .feature-manager-grid { grid-template-columns: 1fr; }
  .feature-manager-column { min-height: auto; }
}
@media (max-width: 760px) {
  .inline-create-form, .feature-assignment-head, .assignment-row, .value-row { grid-template-columns: 1fr; }
}

.settings-section-title {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
}
.settings-section-title:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.settings-section-title h2 {
  margin: 0;
  font-size: 18px;
}
.section-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* V0.4.4 - Kategorieauswahl und HTML-Editor */
.field-label { display: block; font-weight: 700; margin-bottom: 7px; }
.category-picker-field { display: block; }
.category-picker-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.modal-backdrop[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .55); display: grid; place-items: start center; padding: 8vh 20px 20px; }
.category-modal { width: min(680px, 100%); max-height: 78vh; overflow: hidden; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 18px 20px 20px; }
.category-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-modal-head h2 { margin: 0; font-size: 20px; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.category-search { width: 100%; }
.category-tree { overflow: auto; padding-right: 6px; display: grid; gap: 2px; }
.category-node { margin-left: calc(var(--category-level, 0) * 18px); }
.category-node summary { list-style: disclosure-closed; cursor: pointer; min-height: 28px; display: flex; align-items: center; }
.category-node[open] > summary { list-style: disclosure-open; }
.category-select-button { border: 0; background: transparent; color: var(--text); padding: 5px 8px; border-radius: 8px; text-align: left; cursor: pointer; font: inherit; width: 100%; }
.category-select-button:hover, .category-select-button:focus { background: var(--primary-soft); color: var(--primary); outline: none; }
.rich-editor-wrap textarea[data-rich-source][hidden] { display: none; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--panel-soft); }
.rich-toolbar button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 9px; min-height: 34px; padding: 6px 10px; cursor: pointer; font-weight: 750; }
.rich-toolbar button:hover, .rich-toolbar button:focus { border-color: var(--primary); color: var(--primary); outline: none; }
.rich-editor, .rich-source-view { min-height: 320px; width: 100%; border: 1px solid var(--line); border-radius: 0 0 14px 14px; background: var(--panel); color: var(--text); padding: 14px; overflow: auto; }
.rich-editor:focus, .rich-source-view:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.rich-editor h2, .rich-editor h3 { margin-top: .65em; }
.rich-editor p { margin: 0 0 .8em; }
.rich-source-view { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; resize: vertical; }
@media (max-width: 760px) {
  .category-picker-line { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 20px 10px; }
}

/* V0.4.5 - Artikelmerkmale tabellarisch und HTML-Editor als Popup */
.html-description-wrap textarea[data-description-source] {
  min-height: 180px;
  font-family: inherit;
}
.section-with-action.compact { margin-bottom: 8px; }
.html-editor-modal {
  width: min(1040px, 100%);
  max-height: 86vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.html-editor-modal .category-modal-head { margin-bottom: 12px; }
.html-editor-modal .category-modal-head p { margin: 4px 0 0; color: var(--muted); }
.html-editor-modal .rich-editor,
.html-editor-modal .rich-source-view {
  min-height: 420px;
  border-radius: 0 0 14px 14px;
}
.feature-picker {
  display: grid;
  grid-template-columns: minmax(220px, .85fr) minmax(260px, 1fr) minmax(520px, 1.65fr);
  gap: 14px;
  align-items: start;
}
.feature-picker-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 14px;
  min-width: 0;
}
.feature-picker-panel h3 { margin: 0 0 10px; font-size: 16px; }
.feature-picker-list {
  display: grid;
  gap: 4px;
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 10px;
}
.feature-picker-list button {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
}
.feature-picker-list button:hover,
.feature-picker-list button.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.feature-assignment-table { display: grid; gap: 6px; }
.feature-assignment-header,
.feature-assignment-edit-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) 86px 64px;
  gap: 8px;
  align-items: center;
}
.feature-assignment-header {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  padding: 0 6px;
}
.feature-assignment-edit-row {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 8px;
}
.feature-assignment-edit-row input[type="checkbox"] { width: auto; }
.feature-assignment-edit-row input,
.feature-assignment-edit-row select { min-height: 38px; padding: 7px 9px; }

.feature-picker-list button:disabled,
.feature-picker-list button.disabled {
  cursor: not-allowed;
  opacity: .45;
  text-decoration: line-through;
}
.icon-danger {
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(220, 38, 38, .35);
  background: rgba(220, 38, 38, .08);
  color: var(--danger);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
}
.icon-danger:hover { background: rgba(220, 38, 38, .18); }

.category-assignment-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 12px;
}
.category-assignment-box h3 { margin: 0 0 4px; }
.category-assignment-box p { margin: 0 0 10px; color: var(--muted); }
@media (max-width: 1320px) {
  .feature-picker { grid-template-columns: 1fr; }
  .feature-assignment-header,
  .feature-assignment-edit-row { grid-template-columns: 1fr; }
}

/* V0.4.7: Merkmale/Bilder aufgeraeumt */
.feature-picker-jtl {
  grid-template-columns: minmax(240px, .8fr) minmax(260px, .9fr) minmax(560px, 1.5fr);
}
.feature-add-inline {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
  align-items: center;
}
.feature-add-inline .btn { min-height: 42px; }
.feature-assignment-table > [data-feature-assignment-rows] {
  display: grid;
  gap: 6px;
}
.feature-assignment-header,
.feature-assignment-edit-row {
  grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.35fr) 46px;
}
.feature-assignment-edit-row select,
.feature-assignment-edit-row input[name$="-merkmalwert_text"] {
  width: 100%;
}

.image-dropzone {
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 22px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.image-dropzone strong { color: var(--text); }
.image-dropzone.is-drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(1.005);
}
.image-pick-button {
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.image-row {
  grid-template-columns: 34px 46px 160px minmax(180px, 1fr) 46px;
  cursor: grab;
}
.image-row:active { cursor: grabbing; }
.image-row.is-dragging {
  opacity: .5;
  outline: 2px dashed var(--primary);
}
.image-row.is-main-image .image-order-badge::after {
  content: "★";
  margin-left: 2px;
  font-size: 11px;
}
.image-drag-handle {
  width: 28px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  user-select: none;
}
.image-preview {
  width: 132px;
  height: 96px;
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--panel);
}
.image-upload-modern {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--muted);
}
.image-upload-modern span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
  padding: 0 12px;
  white-space: nowrap;
}
.image-upload-modern input[type="file"],
.image-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.image-remove-icon {
  justify-self: end;
}
@media (max-width: 1320px) {
  .image-row { grid-template-columns: 34px 46px 140px 1fr 46px; }
}
@media (max-width: 760px) {
  .image-row { grid-template-columns: 1fr; }
  .image-drag-handle,
  .image-order-badge,
  .image-remove-icon { justify-self: start; }
}


/* V0.4.8 - Artikeldaten in fachliche Kategorien-Kacheln aufteilen */
.article-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
.article-data-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}
.article-data-card.article-card-wide {
  grid-column: 1 / -1;
}
.article-data-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.article-data-card-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.article-data-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.article-form-grid {
  gap: 14px;
}
.article-form-grid.single {
  grid-template-columns: 1fr;
}
.article-inline-pair {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
}
.article-active-row {
  align-self: end;
  min-height: 42px;
  justify-content: flex-start;
}
.article-active-row span {
  margin-bottom: 0 !important;
}
.article-data-card textarea {
  min-height: 130px;
}
.article-data-card.html-description-wrap textarea[data-description-source] {
  min-height: 210px;
}
@media (max-width: 1180px) {
  .article-section-grid {
    grid-template-columns: 1fr;
  }
  .article-data-card.article-card-wide {
    grid-column: auto;
  }
}
@media (max-width: 760px) {
  .article-data-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .article-inline-pair {
    grid-template-columns: 1fr;
  }
}

/* V0.4.9 - kompaktere Artikeldaten-Maske */
.article-section-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
}
.article-data-card {
  padding: 12px 14px;
  border-radius: 16px;
}
.article-data-card.article-card-span-2 {
  grid-column: span 2;
}
.article-data-card.article-card-wide {
  grid-column: 1 / -1;
}
.article-data-card-head {
  margin-bottom: 10px;
  padding-bottom: 8px;
}
.article-data-card-head h2 {
  font-size: 16px;
}
.article-data-card-head p {
  font-size: 12px;
  margin-top: 2px;
}
.article-form-grid {
  gap: 10px 12px;
}
.article-form-grid label > span,
.field-label {
  margin-bottom: 5px;
}
.article-data-card input,
.article-data-card select,
.article-data-card textarea {
  min-height: 36px;
}
.article-data-card textarea {
  min-height: 74px;
}
.article-data-card.html-description-wrap textarea[data-description-source] {
  min-height: 110px;
}
.compact-notes-card textarea {
  min-height: 78px;
}
.notes-grid {
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.6fr) minmax(220px, 1.2fr);
}
.field-label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.field-label-line small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.title-counter-field input {
  padding-right: 90px;
}
@media (max-width: 1420px) {
  .article-section-grid {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }
  .article-data-card.article-card-span-2 {
    grid-column: 1 / -1;
  }
  .notes-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .notes-grid label:nth-child(3) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .article-section-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }
  .article-data-card.article-card-span-2,
  .notes-grid label:nth-child(3) {
    grid-column: auto;
  }
}

/* V0.5.1 - Bildvorschau immer vollstaendig anzeigen */
.image-preview {
  width: 132px;
  height: 96px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-preview img,
.image-row .image-preview img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block;
}

/* V0.5.2 - Loeschen, Bild-Lightbox und moderne Tabellen-Scrollbar */
.table-scroll {
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, .65) rgba(15, 23, 42, .18);
  padding-bottom: 4px;
}
.table-scroll.has-overflow {
  overflow-x: auto;
}
.table-scroll::-webkit-scrollbar {
  height: 10px;
}
.table-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, .16);
  border-radius: 999px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(96, 165, 250, .9), rgba(37, 99, 235, .75));
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, .16);
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(147, 197, 253, .95), rgba(59, 130, 246, .9));
}
.table-delete-icon {
  width: 34px;
  min-height: 34px;
  border-radius: 10px;
}
.image-preview[data-image-full],
.image-lightbox-link {
  cursor: zoom-in;
}
.image-lightbox-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 6, 23, .88);
  backdrop-filter: blur(8px);
}
.image-lightbox.is-open {
  display: flex;
}
.image-lightbox img {
  max-width: min(96vw, 1800px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
  background: rgba(15, 23, 42, .8);
}
.image-lightbox-close {
  position: fixed;
  top: 22px;
  right: 24px;
  width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  background: rgba(15, 23, 42, .78);
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.image-lightbox-close:hover {
  background: rgba(37, 99, 235, .85);
}

/* V0.6.0 - Beschaffung / Gebrauchtwareneinkauf */
.procurement-card .card-head p {
  margin: 4px 0 0;
}
.procurement-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
}
.procurement-table th,
.procurement-table td {
  white-space: nowrap;
  vertical-align: middle;
}
.procurement-table td:first-child,
.procurement-table td:nth-child(2) {
  white-space: normal;
  min-width: 190px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .18);
  border: 1px solid rgba(148, 163, 184, .24);
  font-weight: 700;
  font-size: 13px;
}
.status-offen { color: #93c5fd; background: rgba(37, 99, 235, .14); border-color: rgba(96, 165, 250, .28); }
.status-angebot_erstellt,
.status-erinnerung { color: #facc15; background: rgba(250, 204, 21, .12); border-color: rgba(250, 204, 21, .26); }
.status-termin,
.status-kunde_meldet_sich { color: #c4b5fd; background: rgba(139, 92, 246, .13); border-color: rgba(167, 139, 250, .28); }
.status-zuschlag_ja { color: #86efac; background: rgba(34, 197, 94, .12); border-color: rgba(74, 222, 128, .28); }
.status-zuschlag_nein { color: #fca5a5; background: rgba(239, 68, 68, .12); border-color: rgba(248, 113, 113, .28); }
.status-archiviert { color: #cbd5e1; }
.procurement-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.procurement-span-2 {
  grid-column: 1 / -1;
}
.procurement-detail .hero-card {
  align-items: flex-start;
}
.procurement-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(96, 165, 250, .3);
  color: #93c5fd;
  font-size: 22px;
  font-weight: 900;
}
.procurement-text-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.procurement-text-grid h3 {
  margin-top: 0;
}
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn.tiny {
  padding: 6px 10px;
  min-height: 30px;
  font-size: 13px;
}
@media (max-width: 1100px) {
  .procurement-form,
  .procurement-text-grid,
  .procurement-toolbar {
    grid-template-columns: 1fr;
  }
}

/* V0.6.2 - Beschaffung: Buchhaltungsbilder und abgeschlossene Einkäufe */
.procurement-row-done {
  background: linear-gradient(90deg, rgba(34, 197, 94, .12), rgba(34, 197, 94, .035));
}
.procurement-row-done td {
  border-color: rgba(74, 222, 128, .24);
}
.procurement-row-done td:first-child {
  box-shadow: inset 4px 0 0 rgba(34, 197, 94, .9);
}
.status-in_bearbeitung {
  color: #facc15;
  background: rgba(250, 204, 21, .12);
  border-color: rgba(250, 204, 21, .26);
}
.status-abgeschlossen {
  color: #86efac;
  background: rgba(34, 197, 94, .16);
  border-color: rgba(74, 222, 128, .32);
}
.procurement-upload-label {
  cursor: pointer;
  user-select: none;
}
.procurement-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.procurement-image-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, .22);
  text-decoration: none;
}
.procurement-image-thumb:hover {
  border-color: rgba(96, 165, 250, .7);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .16);
}
.procurement-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.no-gap {
  margin: 0;
}

/* V0.6.3 - Beschaffung: Uploadstatus, Popup-Lightbox, Bild loeschen */
.procurement-upload-zone {
  margin-top: 12px;
  min-height: 104px;
  border: 1px dashed rgba(96, 165, 250, .34);
  border-radius: 18px;
  background: rgba(15, 23, 42, .20);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.procurement-upload-zone strong {
  color: var(--text);
}
.procurement-upload-zone.is-dragover {
  border-color: rgba(96, 165, 250, .95);
  background: rgba(37, 99, 235, .15);
  box-shadow: 0 18px 40px rgba(37, 99, 235, .12);
}
.procurement-upload-status {
  width: min(760px, calc(100% - 28px));
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .36);
  border: 1px solid rgba(148, 163, 184, .16);
}
.procurement-upload-status-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.procurement-upload-bar {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .18);
}
.procurement-upload-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width .18s ease;
}
.procurement-upload-status.is-uploading .procurement-upload-bar span {
  animation: procurement-upload-pulse 1.2s ease-in-out infinite;
}
@keyframes procurement-upload-pulse {
  0% { transform: translateX(-100%); width: 48%; }
  55% { transform: translateX(120%); width: 62%; }
  100% { transform: translateX(220%); width: 48%; }
}
.procurement-upload-file-list {
  margin: 10px 0 0;
  padding-left: 18px;
  max-height: 86px;
  overflow: auto;
  font-size: 13px;
  color: var(--muted);
}
.procurement-image-grid-actions {
  align-items: stretch;
}
.procurement-image-tile {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.procurement-image-tile .procurement-image-thumb {
  width: 100%;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.procurement-image-thumb.procurement-open-image {
  padding: 0;
  border: 1px solid var(--border);
  color: inherit;
  appearance: none;
}
.procurement-image-delete-form {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}
.procurement-image-delete {
  width: 36px;
  min-height: 36px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  background: rgba(127, 29, 29, .78);
  border-color: rgba(248, 113, 113, .46);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
}
.procurement-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 6, 23, .88);
  backdrop-filter: blur(8px);
}
.procurement-image-lightbox.is-open {
  display: flex;
}
.procurement-image-lightbox img {
  max-width: min(96vw, 1800px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(15, 23, 42, .80);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}
.procurement-lightbox-close {
  position: fixed;
  top: 22px;
  right: 24px;
  width: 46px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  background: rgba(15, 23, 42, .78);
  color: white;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.procurement-lightbox-close:hover {
  background: rgba(37, 99, 235, .85);
}
@media (max-width: 760px) {
  .procurement-upload-status-top {
    flex-direction: column;
  }
}

/* V0.7.0 - Verkauf / Aufträge */
.status-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--panel-soft); color: var(--text); border: 1px solid var(--line); }
.status-geprueft { background: rgba(59, 130, 246, .15); border-color: rgba(59, 130, 246, .45); }
.status-abgeschlossen { background: rgba(22, 163, 74, .18); border-color: rgba(22, 163, 74, .45); color: #86efac; }
.success-row { background: rgba(22, 163, 74, .06); }
.sales-order-form .form-card { margin-bottom: 12px; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sales-lines { display: grid; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sales-line { display: grid; grid-template-columns: minmax(210px, 1.2fr) minmax(220px, 1.4fr) 90px 130px 110px 70px; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); min-width: 840px; }
.package-line { grid-template-columns: minmax(140px, 1fr) 130px 150px 170px 110px minmax(180px, 1fr) 70px; min-width: 980px; }
.sales-line-head { background: transparent; border: 0; color: var(--muted); font-size: 13px; font-weight: 800; padding: 0 8px; }
.sales-line select, .sales-line input { min-width: 0; padding: 9px 10px; border-radius: 10px; }
.delete-checkbox { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--danger); font-weight: 800; }
.delete-checkbox input { width: auto; min-height: auto; }
.number-range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.detail-grid div { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 12px; padding: 12px; }
.detail-grid span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.detail-grid strong { font-size: 16px; }
@media (max-width: 1120px) { .three-col, .detail-grid, .number-range-grid { grid-template-columns: 1fr; } }

/* V0.7.2 - Nummernkreise tabellarisch */
.number-range-card { margin-bottom: 18px; }
.settings-subtitle { margin: 14px 0 10px; font-size: 18px; }
.settings-table.number-range-table { width: 100%; min-width: 920px; }
.settings-table.number-range-table th,
.settings-table.number-range-table td { vertical-align: middle; }
.editable-number-range-table input[type="text"],
.editable-number-range-table input[type="number"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
}
.editable-number-range-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}
.center-cell { text-align: center; }
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.form-error-row td { color: var(--danger); font-weight: 700; }

/* V0.7.3 Kundenstamm */
.customer-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
.customer-form .span-two { grid-column: span 2; }
.customer-active-row { align-self: end; min-height: 44px; }
.customer-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pre-line { white-space: pre-line; }
@media (max-width: 900px) {
  .customer-form .span-two { grid-column: span 1; }
  .customer-detail-grid { grid-template-columns: 1fr; }
}

/* V0.7.4 - Kundenauswahl im Auftrag */
.topbar p:empty { display: none; }
.sales-order-form .span-three { grid-column: 1 / -1; }
.customer-picker-field > label { display: block; font-weight: 700; margin-bottom: 7px; }
.customer-picker-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.customer-picker-line input[readonly] { background: var(--panel-soft); cursor: default; }
.customer-picker-modal {
  width: min(1050px, 100%);
  max-height: 82vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.customer-picker-search { width: 100%; }
.customer-picker-table-wrap { min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.customer-picker-table { min-width: 760px; }
.customer-picker-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.customer-picker-table tbody tr:hover { background: var(--panel-soft); }
.customer-picker-select {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.customer-picker-select:hover,
.customer-picker-select:focus { text-decoration: underline; outline: none; }
@media (max-width: 760px) {
  .sales-order-form .span-three { grid-column: 1; }
  .customer-picker-line { grid-template-columns: 1fr; }
  .customer-picker-modal { padding: 14px; border-radius: 14px; }
}

/* V0.7.5 - kompakter Auftrag, Stammdaten-Dropdowns und moderne Löschaktionen */
.readonly-number-preview,
.readonly-number-preview:disabled {
  color: var(--muted) !important;
  background: color-mix(in srgb, var(--panel-soft) 82%, transparent) !important;
  border-color: var(--line) !important;
  cursor: not-allowed;
  opacity: .82;
}
.sales-order-overview-card { padding: 14px 16px; }
.sales-order-overview-grid {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(330px, 1.05fr) minmax(390px, 1.25fr);
  gap: 0;
}
.sales-overview-column {
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--line);
}
.sales-overview-column:first-child { padding-left: 0; }
.sales-overview-column:last-child { padding-right: 0; border-right: 0; }
.compact-head { margin-bottom: 10px; padding-bottom: 8px; }
.sales-compact-fields { gap: 8px 10px; }
.sales-compact-fields label,
.sales-address-grid label { margin: 0; }
.sales-order-overview-card input,
.sales-order-overview-card select {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 10px;
}
.sales-address-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.sales-order-form .span-two { grid-column: span 2; }
.five-col { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.compact-picker-line {
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: 8px;
}
.invoice-toggle { margin-top: 10px; width: 100%; }
.invoice-toggle.is-active { border-color: var(--primary); color: var(--primary); }
.invoice-address-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sales-notes-card textarea { min-height: 72px; }
.customer-picker-row { cursor: pointer; transition: background .14s ease, box-shadow .14s ease; }
.customer-picker-row:hover,
.customer-picker-row:focus {
  background: var(--panel-soft);
  box-shadow: inset 3px 0 0 var(--primary);
  outline: none;
}
.customer-picker-row td:first-child { color: var(--primary); }
.sales-delete-cell { display: flex; justify-content: center; align-items: center; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.icon-button:hover { background: color-mix(in srgb, var(--primary) 12%, var(--panel-soft)); }
.icon-button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); }
.icon-button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, var(--panel-soft)); }
.sales-setting-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.sales-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-table-wrap { overflow-x: auto; }
.sales-settings-table { min-width: 640px; }
.sales-setting-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 115px 90px auto;
  gap: 10px;
  align-items: center;
}
.sales-setting-row input[type="text"] { width: 100%; min-height: 38px; }
.sales-setting-new { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.compact-check { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.compact-check input { width: 17px; height: 17px; min-height: 17px; }
.span-four { grid-column: 1 / -1; }
.form-errors { color: var(--danger); font-size: 13px; }

@media (max-width: 1450px) {
  .sales-order-overview-grid { grid-template-columns: minmax(230px, .85fr) minmax(300px, 1fr) minmax(360px, 1.2fr); }
  .sales-overview-column { padding: 0 12px; }
}
@media (max-width: 1120px) {
  .sales-order-overview-grid,
  .sales-settings-grid,
  .five-col { grid-template-columns: 1fr; }
  .sales-overview-column { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sales-overview-column:first-child { padding-top: 0; }
  .sales-overview-column:last-child { padding-bottom: 0; border-bottom: 0; }
  .sales-order-form .span-two { grid-column: span 1; }
}
@media (max-width: 760px) {
  .sales-address-grid,
  .compact-picker-line,
  .sales-setting-row { grid-template-columns: 1fr; }
  .sales-settings-table { min-width: 0; }
}

/* V0.7.6 - Auftrag/Kunde entzerrt, Artikelname-Suche und vereinfachte Pakete */
.sales-order-primary-grid {
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(620px, 1.45fr);
  gap: 20px;
  align-items: start;
}
.sales-overview-panel {
  min-width: 0;
  padding: 0;
}
.sales-overview-panel + .sales-overview-panel {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.sales-delivery-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sales-delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sales-delivery-head .invoice-toggle {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}
.sales-delivery-grid {
  grid-template-columns: minmax(190px, 1fr) minmax(270px, 1.5fr) minmax(95px, .45fr) minmax(170px, .8fr) minmax(145px, .65fr);
  gap: 8px 10px;
}
.sales-line {
  grid-template-columns: minmax(180px, .8fr) minmax(360px, 1.8fr) 90px 130px 110px 70px;
  min-width: 980px;
}
.package-line {
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.45fr) 130px minmax(260px, 1.2fr) 70px;
  min-width: 1050px;
}
.package-line .shipment-number-cell input { width: 100%; }

@media (max-width: 1350px) {
  .sales-order-primary-grid {
    grid-template-columns: minmax(330px, .9fr) minmax(520px, 1.35fr);
  }
  .sales-delivery-grid {
    grid-template-columns: minmax(180px, 1fr) minmax(250px, 1.35fr) 95px minmax(150px, .8fr) minmax(130px, .65fr);
  }
}
@media (max-width: 1050px) {
  .sales-order-primary-grid,
  .sales-delivery-grid {
    grid-template-columns: 1fr;
  }
  .sales-overview-panel + .sales-overview-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }
  .sales-delivery-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* V0.7.7 - dynamische Auftragspositionen, editierbare Versandklasse und Mobile-Layout */
.customer-picker-trigger {
  cursor: pointer !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.customer-picker-trigger:hover,
.customer-picker-trigger:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  outline: none;
}
.package-row input[name$="-versandklasse"] {
  width: 100%;
  cursor: text;
}
.sales-line > [data-label]::before { display: none; }

@media (max-width: 1050px) {
  .sales-order-overview-card { padding: 12px; }
  .sales-order-primary-grid { gap: 14px; }
  .sales-delivery-section { margin-top: 12px; padding-top: 12px; }
}

@media (max-width: 760px) {
  .sales-order-form .form-card {
    padding: 12px;
    border-radius: 14px;
  }
  .sales-order-form .sales-order-primary-grid,
  .sales-order-form .sales-delivery-grid,
  .sales-order-form .five-col,
  .sales-order-form .three-col,
  .sales-order-form .two-col,
  .sales-order-form .sales-compact-fields {
    grid-template-columns: 1fr !important;
  }
  .sales-overview-panel + .sales-overview-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }
  .sales-order-form .span-two { grid-column: auto; }
  .sales-delivery-head {
    align-items: stretch;
    flex-direction: column;
  }
  .sales-delivery-head .invoice-toggle { width: 100%; }
  .customer-picker-line,
  .compact-picker-line {
    grid-template-columns: 1fr 1fr !important;
  }
  .customer-picker-line .customer-picker-trigger {
    grid-column: 1 / -1;
  }
  .customer-picker-line .btn { width: 100%; }

  .sales-lines {
    overflow: visible;
    gap: 10px;
    padding-bottom: 0;
  }
  .sales-line-head { display: none; }
  .sales-line,
  .package-line {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }
  .sales-line > [data-label] {
    display: grid;
    gap: 5px;
    min-width: 0;
  }
  .sales-line > [data-label]::before {
    display: block;
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }
  .sales-line select,
  .sales-line input {
    width: 100%;
    min-width: 0;
  }
  .sales-delete-cell {
    justify-content: flex-end;
  }
  .sales-delete-cell .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 42px;
  }

  .customer-picker-modal {
    width: min(100%, 680px);
    max-height: calc(100vh - 20px);
    padding: 12px;
  }
  .customer-picker-table {
    min-width: 0;
    width: 100%;
    display: block;
  }
  .customer-picker-table thead { display: none; }
  .customer-picker-table tbody { display: grid; gap: 8px; padding: 8px; }
  .customer-picker-table tr {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
  }
  .customer-picker-table td {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 8px;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .customer-picker-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }
}

@media (max-width: 430px) {
  .customer-picker-line,
  .compact-picker-line { grid-template-columns: 1fr !important; }
  .customer-picker-line .customer-picker-trigger { grid-column: auto; }
  .customer-picker-table td { grid-template-columns: 1fr; }
}


/* V0.7.8: komplette Artikel- und Kundenzeilen öffnen */
.clickable-record-row { cursor: pointer; }
.clickable-record-row td { transition: background-color .14s ease, box-shadow .14s ease; }
.clickable-record-row:hover td,
.clickable-record-row:focus-visible td {
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--primary) 28%, transparent),
              inset 0 -1px 0 color-mix(in srgb, var(--primary) 28%, transparent);
}
.clickable-record-row:focus-visible { outline: none; }
.sales-line.is-deleted { display: none !important; }


/* V0.7.9: zentrale Darstellung und dynamische Löschaktionen */
.sales-delete-row[hidden] { display: none !important; }
.design-settings-card { max-width: 760px; }
.design-settings-card ul { list-style: none; padding: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.design-settings-card li label { display: flex; align-items: center; gap: .55rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
@media (max-width: 900px) {
  .sales-order-form .four-col, .sales-order-form .six-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .sales-order-form .four-col, .sales-order-form .six-col { grid-template-columns: 1fr; }
}
.sales-order-form .four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sales-order-form .six-col { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sales-order-form .sales-delivery-grid { grid-template-columns: minmax(150px,.85fr) minmax(170px,.9fr) minmax(250px,1.35fr) minmax(90px,.42fr) minmax(150px,.72fr) minmax(130px,.62fr); }

/* V0.8.0 - Bestandsreservierung und Auftragsschutz */
.inventory-form-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, .65fr) minmax(110px, .65fr);
  gap: 10px;
  align-items: end;
}
.inventory-readonly-field {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 9px 11px;
  display: grid;
  align-content: center;
  gap: 4px;
}
.inventory-readonly-field span { color: var(--muted); font-size: 12px; font-weight: 800; }
.inventory-readonly-field strong { font-size: 20px; }
.inventory-readonly-field.available strong { color: var(--primary); }
.inventory-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.inventory-status-reserviert { color: #93c5fd; border-color: rgba(59, 130, 246, .45); background: rgba(59, 130, 246, .12); }
.inventory-status-ausgebucht { color: #86efac; border-color: rgba(22, 163, 74, .45); background: rgba(22, 163, 74, .12); }
.inventory-status-nicht-abgeglichen { color: #fca5a5; border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .12); }
.inventory-status-keine-lagerpositionen { color: var(--muted); }
@media (max-width: 760px) {
  .inventory-form-grid { grid-template-columns: 1fr 1fr; }
  .inventory-form-grid > label { grid-column: 1 / -1; }
}

/* V0.9.0 - API-Verbindungen / eBay OAuth */
.security-notice {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.security-notice.warning {
  border-color: color-mix(in srgb, #f59e0b 55%, var(--line));
  background: color-mix(in srgb, #f59e0b 8%, var(--panel));
}
.security-notice span { color: var(--muted); }
.integration-card { overflow: hidden; }
.integration-head p { margin: 4px 0 0; }
.callback-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}
.callback-summary > span { color: var(--muted); font-weight: 750; }
.callback-summary code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.callback-large { margin: 0; grid-template-columns: minmax(0, 1fr) auto; }
.integration-table { min-width: 1160px; }
.integration-log-table { min-width: 980px; }
.integration-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.integration-actions form { margin: 0; }
.integration-status.nicht_konfiguriert,
.integration-status.getrennt,
.integration-status.info { background: var(--panel-soft); color: var(--muted); }
.integration-status.konfiguriert,
.integration-status.warnung { background: #fef3c7; color: #92400e; }
.integration-status.verbunden,
.integration-status.erfolg { background: #dcfce7; color: #166534; }
.integration-status.fehler { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .integration-status.konfiguriert,
[data-theme="dark"] .integration-status.warnung { background: rgba(245, 158, 11, .18); color: #fcd34d; }
[data-theme="dark"] .integration-status.verbunden,
[data-theme="dark"] .integration-status.erfolg { background: rgba(34, 197, 94, .18); color: #86efac; }
[data-theme="dark"] .integration-status.fehler { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.integration-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric-text { font-size: 17px !important; overflow-wrap: anywhere; }
.integration-settings-form { display: grid; gap: 14px; }
.integration-form-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.form-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.form-card-head h2 { margin: 0; font-size: 20px; }
.form-card-head p { margin: 4px 0 0; color: var(--muted); }
.compact-integration-grid { gap: 12px 14px; }
.integration-form-card label > span { display: block; margin-bottom: 7px; font-weight: 750; }
.integration-check { align-self: end; min-height: 42px; }
.secret-saved { display: block; margin-top: 6px; color: #16a34a; }
.integration-save-row { position: sticky; bottom: 10px; z-index: 10; width: fit-content; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); }
.action-panel { padding-top: 4px; }
.integration-error-box { display: grid; gap: 5px; margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--danger) 8%, var(--panel)); }
.integration-error-box span { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  .integration-overview-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
  .callback-summary,
  .callback-large { grid-template-columns: 1fr; }
  .callback-summary .btn { width: 100%; }
  .integration-overview-grid { grid-template-columns: 1fr; }
  .integration-save-row { position: static; width: 100%; }
  .integration-save-row .btn { flex: 1 1 100%; }
  .action-panel { display: grid; grid-template-columns: 1fr; }
  .action-panel form, .action-panel .btn { width: 100%; }
}

/* V0.9.1 - eBay Kontodaten und Geschäftsrichtlinien */
.ebay-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.integration-empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}
.ebay-policy-grid {
  display: grid;
  gap: 14px;
}
.ebay-policy-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}
.ebay-policy-panel > header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.ebay-policy-panel > header > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ebay-policy-panel h3 { margin: 0; font-size: 16px; }
.ebay-policy-panel header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 850;
}
.ebay-policy-scroll { max-width: 100%; }
.ebay-policy-table { min-width: 820px; }
.ebay-policy-table th,
.ebay-policy-table td { vertical-align: top; }
.ebay-policy-table td:first-child { min-width: 220px; }
.ebay-policy-table td:first-child strong,
.ebay-policy-table td:first-child small { display: block; }
.ebay-policy-table td:first-child small { margin-top: 4px; color: var(--muted); }
.ebay-policy-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.ebay-policy-table .remote-unavailable { opacity: .62; }
@media (max-width: 1050px) {
  .ebay-account-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
  .ebay-account-grid { grid-template-columns: 1fr; }
  .ebay-policy-panel { border-radius: 12px; }
}

/* V0.9.2 - eBay-Verkaufsprofil am Artikel */
.tab-button.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
.tab-button.tab-link.disabled {
  cursor: not-allowed;
  opacity: .45;
}
.ebay-listing-shell { display: grid; gap: 16px; }
.ebay-listing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.ebay-listing-header h2 { margin: 3px 0 0; }
.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ebay-listing-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.ebay-listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ebay-listing-card { min-width: 0; }
.ebay-listing-card.span-2 { grid-column: 1 / -1; }
.ebay-listing-fields { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.ebay-listing-form label > span,
.ebay-listing-form .field-label-line > span:first-child {
  display: block;
  margin-bottom: 7px;
  font-weight: 750;
}
.compact-switch {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  font-weight: 750;
}
.compact-switch input { width: auto; }
.compact-switch span { margin: 0 !important; }
.readonly-pair {
  display: grid;
  gap: 6px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
  color: var(--muted);
}
.readonly-pair strong { color: var(--text); overflow-wrap: anywhere; }
.ebay-price-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 92px minmax(130px, 1fr) minmax(110px, .8fr);
  gap: 12px;
}
.ebay-price-grid label > span { display: block; margin-bottom: 7px; font-weight: 750; }
.inventory-inline-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.inventory-inline-summary span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}
.inventory-inline-summary strong { color: var(--text); font-size: 15px; }
.input-readonly { background: var(--panel-soft) !important; color: var(--muted) !important; }
.ebay-aspect-head { align-items: center; }
.ebay-aspect-scroll { max-height: 560px; }
.ebay-aspect-table { min-width: 920px; }
.ebay-aspect-table th:first-child,
.ebay-aspect-table td:first-child { width: 95px; }
.ebay-aspect-table th:nth-child(2),
.ebay-aspect-table td:nth-child(2) { width: 240px; }
.ebay-aspect-table th:nth-child(4),
.ebay-aspect-table td:nth-child(4) { width: 220px; }
.ebay-aspect-table td { vertical-align: middle; }
.ebay-aspect-table tr.required-aspect { background: color-mix(in srgb, #f59e0b 5%, transparent); }
.required-dot {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 15%, var(--panel));
  color: #b45309;
  font-size: 11px;
  font-weight: 850;
}
[data-theme="dark"] .required-dot { color: #fcd34d; }
.aspect-source { display: block; margin-top: 4px; color: var(--muted); }
.aspect-rules { display: flex; flex-wrap: wrap; gap: 5px; }
.aspect-rules span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
}
.retained-aspects {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}
.retained-aspects summary { cursor: pointer; font-weight: 750; }
.retained-aspect-grid { display: grid; gap: 8px; margin-top: 10px; }
.retained-aspect-grid span { display: grid; gap: 2px; color: var(--muted); }
.retained-aspect-grid strong { color: var(--text); }
.ebay-validation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.validation-list { display: grid; gap: 8px; }
.validation-list > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px 11px;
  border-radius: 10px;
}
.validation-list > div > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.validation-list.errors > div {
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
  color: color-mix(in srgb, var(--danger) 80%, var(--text));
}
.validation-list.errors > div > span { background: var(--danger); color: white; }
.validation-list.warnings { margin-top: 10px; }
.validation-list.warnings > div {
  background: color-mix(in srgb, #f59e0b 8%, var(--panel));
  color: var(--text);
}
.validation-list.warnings > div > span { background: #f59e0b; color: #111827; }
.validation-ready {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #22c55e 42%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #22c55e 9%, var(--panel));
  color: #15803d;
  font-weight: 800;
}
[data-theme="dark"] .validation-ready { color: #86efac; }
.payload-preview summary { cursor: pointer; font-weight: 750; }
.payload-preview pre {
  max-height: 430px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ebay-listing-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.integration-status.entwurf,
.integration-status.unvollstaendig { background: #fef3c7; color: #92400e; }
.integration-status.bereit,
.integration-status.bestand_synchronisiert,
.integration-status.angebot_erstellt,
.integration-status.veroeffentlicht { background: #dcfce7; color: #166534; }
.integration-status.beendet { background: var(--panel-soft); color: var(--muted); }
[data-theme="dark"] .integration-status.entwurf,
[data-theme="dark"] .integration-status.unvollstaendig { background: rgba(245, 158, 11, .18); color: #fcd34d; }
[data-theme="dark"] .integration-status.bereit,
[data-theme="dark"] .integration-status.bestand_synchronisiert,
[data-theme="dark"] .integration-status.angebot_erstellt,
[data-theme="dark"] .integration-status.veroeffentlicht { background: rgba(34, 197, 94, .18); color: #86efac; }
.ebay-summary-card .card-head { margin-bottom: 10px; }
@media (max-width: 1050px) {
  .ebay-listing-fields { grid-template-columns: 1fr; }
  .inventory-inline-summary { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
}
@media (max-width: 760px) {
  .ebay-listing-header { align-items: flex-start; flex-direction: column; }
  .ebay-listing-header .button-row { width: 100%; }
  .ebay-listing-header .btn { flex: 1 1 auto; }
  .ebay-listing-grid,
  .ebay-validation-grid { grid-template-columns: 1fr; }
  .ebay-listing-card.span-2 { grid-column: auto; }
  .ebay-price-grid { grid-template-columns: minmax(0, 1fr) 90px; }
  .ebay-price-grid label:nth-child(3),
  .ebay-price-grid label:nth-child(4) { grid-column: auto; }
  .inventory-inline-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ebay-aspect-head { align-items: stretch; flex-direction: column; }
  .ebay-aspect-head .btn { width: 100%; }
  .ebay-listing-actions { position: static; width: 100%; }
  .ebay-listing-actions .btn { flex: 1 1 100%; }
}

/* V0.9.2 - eBay-Kategoriesuche */
.ebay-category-selected {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}
.ebay-category-selected > span,
.ebay-category-selected > small { color: var(--muted); }
.ebay-category-selected > strong { overflow-wrap: anywhere; }
.ebay-category-search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 10px;
}
.ebay-category-feedback { min-height: 20px; margin-top: 7px; }
.ebay-category-results {
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
  margin-top: 9px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}
.ebay-category-results[hidden] { display: none; }
.ebay-category-result {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.ebay-category-result:hover,
.ebay-category-result:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  outline: none;
}
.ebay-category-result span { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) {
  .ebay-category-search-line { grid-template-columns: 1fr; }
  .ebay-category-search-line .btn { width: 100%; }
  .ebay-category-result { grid-template-columns: 1fr; gap: 4px; }
}

/* V0.9.3 - eBay-Lagerorte und kontrollierte Veröffentlichung */
.ebay-price-grid {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
}
.ebay-location-shell,
.ebay-location-form { display: grid; gap: 16px; }
.ebay-location-grid {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(420px, 1.25fr);
  gap: 14px;
}
.ebay-location-contact-card { grid-column: 1 / -1; }
.ebay-location-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
}
.ebay-location-table { min-width: 940px; }
.ebay-location-table td { vertical-align: middle; }
.ebay-location-table td:first-child strong,
.ebay-location-table td:first-child small,
.ebay-location-table td:nth-child(3) small { display: block; }
.ebay-location-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}
.ebay-location-table .row-actions { width: 1%; white-space: nowrap; }
.integration-status.enabled,
.integration-status.erfolg { background: #dcfce7; color: #166534; }
.integration-status.disabled,
.integration-status.unknown,
.integration-status.uebersprungen { background: var(--panel-soft); color: var(--muted); }
.integration-status.error,
.integration-status.fehler { background: #fee2e2; color: #991b1b; }
.integration-status.gestartet { background: #dbeafe; color: #1d4ed8; }
[data-theme="dark"] .integration-status.enabled,
[data-theme="dark"] .integration-status.erfolg { background: rgba(34, 197, 94, .18); color: #86efac; }
[data-theme="dark"] .integration-status.error,
[data-theme="dark"] .integration-status.fehler { background: rgba(239, 68, 68, .18); color: #fca5a5; }
[data-theme="dark"] .integration-status.gestartet { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.location-field-status {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
}
.location-field-status.ready { color: #15803d; }
.location-field-status.pending { color: #b45309; }
[data-theme="dark"] .location-field-status.ready { color: #86efac; }
[data-theme="dark"] .location-field-status.pending { color: #fcd34d; }
.ebay-publish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ebay-remote-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 9px;
}
.ebay-remote-status-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
}
.ebay-remote-status-grid span,
.ebay-remote-status-grid small { color: var(--muted); font-size: 12px; }
.ebay-remote-status-grid strong { overflow-wrap: anywhere; }
.compact-validation-list { max-height: 240px; overflow: auto; }
.ebay-remote-action-stack { display: grid; gap: 8px; margin-top: 14px; }
.ebay-publish-confirmation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.ebay-publish-confirmation label > span { display: block; margin-bottom: 7px; font-weight: 750; }
.ebay-published-box {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #22c55e 40%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #22c55e 9%, var(--panel));
}
.ebay-published-box span { color: #15803d; font-weight: 800; }
[data-theme="dark"] .ebay-published-box span { color: #86efac; }
.ebay-operation-card { margin-top: 14px; }
.ebay-operation-table { min-width: 860px; }
.ebay-operation-table th:first-child,
.ebay-operation-table td:first-child { white-space: nowrap; }
.ebay-operation-table td:last-child { max-width: 420px; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .ebay-location-grid,
  .ebay-publish-grid { grid-template-columns: 1fr; }
  .ebay-location-contact-card { grid-column: auto; }
  .ebay-remote-status-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 760px) {
  .ebay-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ebay-location-list-card .integration-head { align-items: stretch; flex-direction: column; }
  .ebay-location-list-card .integration-head .btn { width: 100%; }
  .ebay-location-switches { align-items: stretch; flex-direction: column; gap: 4px; }
  .ebay-remote-status-grid { grid-template-columns: 1fr; }
  .ebay-publish-confirmation { grid-template-columns: 1fr; }
  .ebay-publish-confirmation .btn { width: 100%; }
}
@media (max-width: 480px) {
  .ebay-price-grid { grid-template-columns: 1fr; }
}
/* V0.9.4 - eBay-Auftragsimport und Versandmeldung */
.shipping-setting-row {
  grid-template-columns: minmax(170px, 1fr) minmax(150px, .8fr) 115px 90px auto;
}
.span-five { grid-column: 1 / -1; }
.ebay-order-sync-form {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.ebay-order-sync-form > label:not(.compact-check) {
  display: grid;
  gap: 5px;
  min-width: 120px;
}
.ebay-order-sync-form > label > span { color: var(--muted); font-size: 12px; }
.ebay-order-sync-form select { min-height: 38px; }
.ebay-order-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.ebay-order-table-wrap { max-height: 460px; }
.ebay-order-table { min-width: 1040px; }
.ebay-order-table td { vertical-align: middle; }
.ebay-order-table .review-row {
  background: color-mix(in srgb, #f59e0b 7%, var(--panel));
}
.ebay-order-note {
  display: block;
  max-width: 360px;
  margin-top: 5px;
  line-height: 1.35;
}
.ebay-order-summary { border-left: 4px solid color-mix(in srgb, var(--primary) 70%, var(--line)); }
.order-package-scroll table { min-width: 760px; }
.order-package-scroll td { vertical-align: middle; }

@media (max-width: 1120px) {
  .shipping-setting-row { grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) 105px 85px auto; }
  .ebay-order-metrics { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
  .shipping-setting-row { grid-template-columns: 1fr; }
  .ebay-order-sync-form { align-items: stretch; justify-content: stretch; }
  .ebay-order-sync-form > label,
  .ebay-order-sync-form .btn { width: 100%; }
  .ebay-order-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .ebay-order-metrics { grid-template-columns: 1fr; }
}

/* V0.9.5 - eBay-Automatisierung und Worker */
.ebay-automation-card { overflow: visible; }
.compact-notice { margin: 0 0 16px; padding: 12px 14px; }
.automation-settings-form { display: grid; gap: 16px; }
.automation-master-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, var(--primary) 8%);
}
.automation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 14px;
}
.automation-job-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft, var(--panel));
}
.automation-job-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.automation-job-card h3 { margin: 0; font-size: 15px; }
.automation-job-card header span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.automation-job-card > label:not(.check-row) { display: grid; gap: 6px; }
.automation-job-card > label > span { color: var(--muted); font-size: 12px; }
.automation-inline-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.automation-manual-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.automation-manual-actions .button-row { margin: 0; }

.worker-toolbar-card { display: grid; gap: 16px; }
.worker-card-head { align-items: flex-start; }
.worker-card-head .button-row { margin: 0; }
.worker-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 360px) auto;
  align-items: end;
  gap: 12px;
}
.worker-filter-grid label { display: grid; gap: 6px; }
.worker-filter-grid label > span { color: var(--muted); font-size: 12px; }
.worker-filter-actions { display: flex; gap: 8px; }
.worker-table { min-width: 1320px; }
.worker-table td { vertical-align: middle; }
.worker-table td strong,
.worker-table td small { display: block; }
.worker-table td small { margin-top: 4px; color: var(--muted); }
.worker-result-cell { min-width: 260px; max-width: 420px; }
.worker-result-cell code { white-space: normal; word-break: break-word; }
.worker-progress {
  width: 100px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 76%, transparent);
}
.worker-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.worker-status.wartet { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b76d00; }
.worker-status.laeuft { background: color-mix(in srgb, #3b82f6 16%, transparent); color: #2563eb; }
.worker-status.erledigt { background: color-mix(in srgb, #22c55e 16%, transparent); color: #16803a; }
.worker-status.uebersprungen { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.worker-status.fehlgeschlagen { background: color-mix(in srgb, #ef4444 16%, transparent); color: #c62828; }

@media (max-width: 1180px) {
  .automation-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
}
@media (max-width: 760px) {
  .automation-grid,
  .worker-filter-grid { grid-template-columns: 1fr; }
  .automation-manual-actions,
  .worker-card-head { align-items: stretch; flex-direction: column; }
  .automation-manual-actions .button-row,
  .worker-card-head .button-row,
  .worker-filter-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .automation-manual-actions form,
  .automation-manual-actions .btn,
  .worker-card-head form,
  .worker-card-head .btn,
  .worker-filter-actions .btn { width: 100%; }
}

/* V0.9.6 - System, Sicherungen und Auditlog */
.operations-layout { display: grid; gap: 16px; }
.operations-layout > .card { min-width: 0; }
.operations-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.operations-head h2 { margin: 0; }
.operations-head p { margin: 5px 0 0; color: var(--muted); }
.operations-overall-status {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 74px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 12px; font-weight: 850; letter-spacing: .05em;
}
.operations-overall-status.status-ok { color: #16a34a; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.operations-overall-status.status-warn { color: #d97706; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
.operations-overall-status.status-error { color: #dc2626; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.operations-health-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 10px; margin-top: 16px; }
.operations-health-item {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft);
}
.operations-health-dot { width: 10px; height: 10px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.operations-health-item.status-ok .operations-health-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.operations-health-item.status-warn .operations-health-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.12); }
.operations-health-item.status-error .operations-health-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.operations-health-item strong, .operations-health-item small { display: block; overflow-wrap: anywhere; }
.operations-health-item small { margin-top: 3px; color: var(--muted); }
.operations-settings-form { display: grid; gap: 14px; margin-top: 16px; }
.operations-form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.operations-form-grid label { display: grid; gap: 6px; }
.operations-form-grid label > span { font-weight: 750; }
.operations-switch-field {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); cursor: pointer;
}
.operations-switch-field input { margin-top: 3px; }
.operations-switch-field strong, .operations-switch-field small { display: block; }
.operations-switch-field small { margin-top: 3px; color: var(--muted); }
.operations-backup-table { min-width: 1080px; }
.operations-audit-table { min-width: 1240px; }
.operations-backup-table td, .operations-audit-table td { vertical-align: middle; }
.operations-backup-table td strong, .operations-backup-table td small,
.operations-audit-table td strong, .operations-audit-table td small { display: block; }
.operations-backup-table td small, .operations-audit-table td small { margin-top: 3px; color: var(--muted); }
.operations-backup-status.status-erfolgreich,
.operations-backup-status.status-verifiziert { color: #16a34a; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.operations-backup-status.status-fehlgeschlagen,
.operations-backup-status.status-pruefung_fehlgeschlagen { color: #dc2626; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.operations-backup-status.status-laeuft,
.operations-backup-status.status-wartet { color: #2563eb; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }
.operations-error-row td { color: #f87171; background: rgba(239,68,68,.06); overflow-wrap: anywhere; }
.security-ok { color: #22c55e; font-weight: 750; }
.security-warn { color: #f59e0b; font-weight: 750; }
.operations-filter-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(220px, 320px) auto; gap: 10px; margin: 16px 0; }
.audit-action-delete, .audit-action-security { color: #dc2626; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.audit-action-create, .audit-action-login, .audit-action-backup { color: #16a34a; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.audit-action-update, .audit-action-worker, .audit-action-api { color: #2563eb; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.modern-scrollbar { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 65%, transparent) transparent; }
.modern-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.modern-scrollbar::-webkit-scrollbar-track { background: transparent; }
.modern-scrollbar::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 65%, transparent); border-radius: 999px; }

@media (max-width: 1180px) {
  .operations-health-grid, .operations-form-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 760px) {
  .operations-head { flex-direction: column; align-items: stretch; }
  .operations-head form, .operations-head .btn { width: 100%; }
  .operations-health-grid, .operations-form-grid, .operations-filter-grid { grid-template-columns: 1fr; }
  .operations-backup-table, .operations-audit-table { min-width: 900px; }
}

.template-field-table { display: grid; gap: 8px; margin-top: 12px; }
.template-field-row { display: grid; grid-template-columns: 1.2fr 1fr 130px 1.4fr 90px 44px; gap: 8px; align-items: center; }
.template-preview { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); max-height: 420px; overflow: auto; }
.template-runtime-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.template-runtime-fields label { display: grid; gap: 6px; }
.template-runtime-fields textarea { min-height: 100px; }
.description-template-modal { max-width: 980px; }
@media (max-width: 900px) {
  .template-field-row { grid-template-columns: 1fr; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
  .template-runtime-fields { grid-template-columns: 1fr; }
}


.ebay-policy-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}
.ebay-policy-create-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  padding: 1rem;
}
.ebay-policy-create-card h3 { margin: 0 0 .9rem; }
.ebay-policy-create-card .form-grid { grid-template-columns: 1fr; }
.ebay-policy-create-card textarea { min-height: 72px; }
@media (max-width: 1100px) {
  .ebay-policy-create-grid { grid-template-columns: 1fr; }
}

/* V0.9.13: diagnostic API protocol */
.api-log-details { min-width: 110px; }
.api-log-details summary {
  cursor: pointer;
  color: var(--accent, #82aaff);
  font-weight: 700;
  white-space: nowrap;
}
.api-log-details[open] {
  min-width: min(680px, 70vw);
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft, rgba(255,255,255,.035));
}
.api-log-endpoint {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  margin: .5rem 0;
  overflow-wrap: anywhere;
}
.api-log-details pre {
  max-height: 420px;
  overflow: auto;
  margin: .5rem 0 0;
  padding: .75rem;
  border-radius: 10px;
  background: rgba(0,0,0,.2);
  color: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .82rem;
  line-height: 1.45;
}


.ebay-remote-verification-card { margin-top: 14px; }
.remote-difference-list { display: grid; gap: 8px; margin-top: 14px; }
.remote-difference-row {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg));
}
.remote-difference-row.error { border-color: color-mix(in srgb, #ef4444 55%, var(--line)); }
.remote-difference-row.warning { border-color: color-mix(in srgb, #f59e0b 45%, var(--line)); }
.remote-difference-row span { display: grid; gap: 2px; overflow-wrap: anywhere; }
.remote-difference-row small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.integration-status.ok { background: #dcfce7; color: #166534; }
.integration-status.abweichung { background: #fef3c7; color: #92400e; }
.integration-status.fehlt,
.integration-status.fehler { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .integration-status.ok { background: rgba(34,197,94,.18); color: #86efac; }
[data-theme="dark"] .integration-status.abweichung { background: rgba(245,158,11,.18); color: #fcd34d; }
[data-theme="dark"] .integration-status.fehlt,
[data-theme="dark"] .integration-status.fehler { background: rgba(239,68,68,.18); color: #fca5a5; }
@media (max-width: 860px) {
  .remote-difference-row { grid-template-columns: 1fr; }
}
