  /* ---------- Kisten neu scannen ---------- */
  .box-detail-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:14px;
  }
  .box-detail-header button{ width:auto; }
  .box-detail-header-actions{ display:flex; gap:8px; flex-wrap:wrap; }
  #box-detail-title{ margin-bottom:6px; }
  #box-detail-status:empty{ display:none; }
  .rescan-panel{ margin-bottom:22px; }
  .rescan-panel-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:10px;
  }
  .rescan-panel-title{ font-weight:700; color:var(--accent-dark); }
  .rescan-panel-hint{
    max-width:760px;
    margin-top:6px;
    color:var(--text-muted);
    font-size:var(--text-18);
    line-height:1.45;
  }
  .rescan-toggle-btn{
    width:auto;
    background:var(--surface);
    border:2px solid var(--border-strong);
    color:var(--text);
    font-size:var(--text-xs);
    font-weight:700;
    padding:7px 12px;
    border-radius:var(--radius);
    cursor:pointer;
  }
  .rescan-toggle-btn:hover{ border-color:var(--accent); color:var(--accent-dark); }
  .rescan-progress-label{
    display:flex;
    justify-content:space-between;
    font-size:var(--text-15);
    font-weight:700;
    color:var(--text-muted);
  }
  .rescan-progress-track{
    height:20px;
    border-radius:var(--radius-md);
    background:var(--track-bg);
    border:2px solid var(--border-strong);
    overflow:hidden;
    margin:10px 0 18px;
  }
  .rescan-progress-fill{
    height:100%;
    background:var(--accent);
    border-radius:var(--radius);
    transition:width 0.25s ease;
  }
  .rescan-summary{
    display:flex;
    gap:28px;
    flex-wrap:wrap;
    margin-bottom:18px;
    padding-bottom:18px;
    border-bottom:1px solid var(--border);
  }
  .rescan-summary .stat b{
    display:block;
    font-size:var(--text-lg);
    font-family:var(--font-mono);
  }
  .rescan-summary .stat span{ font-size:var(--text-13); color:var(--text-muted); }
  .rescan-summary .stat.up b{ color:var(--green); }
  .rescan-summary .stat.down b{ color:var(--red); }
  .rescan-table{ width:100%; border-collapse:collapse; }
  .rescan-table th{
    text-align:left;
    font-size:var(--text-13);
    text-transform:uppercase;
    letter-spacing:.03em;
    color:var(--text-muted);
    padding:6px 10px;
    border-bottom:2px solid var(--border);
  }
  .rescan-table td{
    padding:10px;
    border-bottom:1px solid var(--border);
    vertical-align:middle;
    font-size:var(--text-15);
  }
  .rescan-table .price-old{ color:var(--text-muted); font-family:var(--font-mono); }
  .rescan-table .price-new{ font-family:var(--font-mono); font-weight:700; }
  .rescan-delta-up{ color:var(--green); font-weight:700; font-family:var(--font-mono); }
  .rescan-delta-down{ color:var(--red); font-weight:700; font-family:var(--font-mono); }
  .rescan-delta-none{ color:var(--text-muted); font-family:var(--font-mono); }

  /* ---------- Kisten-Übersicht nach Lager gruppiert ---------- */
  .boxes-toolbar{
    align-items:stretch;
    flex-direction:column;
    gap:7px;
    justify-content:flex-start;
    margin-bottom:12px;
  }
  .boxes-toolbar label{
    flex:0 0 auto;
    color:var(--text);
    font-size:var(--text-md);
    font-weight:700;
  }
  .table-toolbar.boxes-toolbar input{
    flex:0 0 auto;
    width:100%;
    max-width:none;
    min-height:56px;
    padding:12px 16px;
    font-size:var(--text-md);
  }
  .cleanup-workspace{
    margin:0 0 22px;
    border:1px solid var(--border);
    border-left:6px solid var(--accent);
    border-radius:var(--radius);
    background:var(--surface-2);
    overflow:hidden;
  }
  .cleanup-entry{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin:0;
    padding:16px 18px;
  }
  .cleanup-entry-text{
    display:flex;
    flex-direction:column;
    gap:3px;
  }
  .cleanup-entry-text strong{
    color:var(--accent-dark);
    font-size:var(--text-md);
  }
  .cleanup-entry-text span{
    color:var(--text-muted);
    font-size:var(--text-18);
  }
  .cleanup-entry button{
    flex:0 0 auto;
    width:auto;
    min-height:56px;
  }
  .cleanup-panel{
    padding:18px;
    border-top:1px solid var(--border);
    background:var(--surface);
  }
  .cleanup-panel[hidden]{ display:none; }
  .cleanup-panel-intro p{
    max-width:780px;
    margin:0 0 16px;
    color:var(--text-muted);
  }
  .cleanup-form{
    display:grid;
    grid-template-columns:repeat(3, minmax(180px, 1fr));
    gap:16px;
    align-items:end;
  }
  .cleanup-form label{
    display:flex;
    flex-direction:column;
    gap:7px;
    color:var(--text-muted);
    font-weight:700;
  }
  .cleanup-form input,
  .cleanup-form select{
    width:100%;
    height:56px;
    min-height:56px;
    padding:10px 12px;
    border:2px solid var(--border-strong);
    border-radius:var(--radius);
    background:var(--surface);
    color:var(--text);
    font:inherit;
  }
  .cleanup-price-input{
    display:grid;
    grid-template-columns:auto 1fr;
    align-items:center;
    height:56px;
    min-height:56px;
    border:2px solid var(--border-strong);
    border-radius:var(--radius);
    background:var(--surface);
  }
  .cleanup-price-input > span{ padding-left:12px; color:var(--text); }
  .cleanup-price-input input{
    height:100%;
    min-height:0;
    border:0;
  }
  .cleanup-price-input:focus-within{
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-bg);
  }
  .cleanup-price-input input:focus-visible{
    outline:0;
  }
  .cleanup-form-actions{
    grid-column:1 / -1;
    display:flex;
    gap:12px;
    flex-wrap:wrap;
  }
  .cleanup-form-actions button,
  #cleanup-created-open-btn{ width:auto; }
  .cleanup-preview-summary{
    margin-top:20px;
    padding:18px;
    border:2px solid var(--accent);
    border-left-width:6px;
    border-radius:var(--radius);
    background:var(--accent-bg);
  }
  .cleanup-preview-heading{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:baseline;
    margin:0;
  }
  .cleanup-preview-heading strong{
    color:var(--accent-dark);
    font-size:var(--text-lg);
  }
  .cleanup-preview-heading span{
    color:var(--text-muted);
    font-size:var(--text-18);
  }
  .cleanup-preview-tools{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:12px;
  }
  .cleanup-selection-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
  }
  .cleanup-selection-actions button{
    width:auto;
    min-height:40px;
    padding:7px 12px;
  }
  .cleanup-sort-label{
    display:flex;
    align-items:center;
    flex-direction:row;
    gap:5px;
    min-width:0;
    color:var(--text-muted);
    font-size:var(--text-18);
    font-weight:700;
  }
  .cleanup-sort-label select{
    min-height:40px;
    padding:8px 12px;
    border:2px solid var(--border-strong);
    background:var(--surface);
    color:var(--text);
    font:inherit;
  }
  .cleanup-preview-list{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .cleanup-preview-group{
    margin-top:12px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface);
    overflow:hidden;
  }
  .cleanup-preview-group-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:13px 16px;
    cursor:pointer;
    list-style:none;
  }
  .cleanup-preview-group-heading::-webkit-details-marker{ display:none; }
  .cleanup-preview-group-heading::after{
    content:'▸';
    flex:0 0 auto;
    color:var(--accent-dark);
    font-size:var(--text-lg);
    font-weight:700;
  }
  .cleanup-preview-group[open] .cleanup-preview-group-heading::after{
    content:'▾';
  }
  .cleanup-preview-group-heading > strong{
    font-size:var(--text-lg);
  }
  .cleanup-preview-group-heading span{
    color:var(--text-muted);
    font-size:var(--text-18);
  }
  .cleanup-preview-group-duplicates .cleanup-preview-group-heading{
    box-shadow:inset 5px 0 0 var(--amber);
  }
  .cleanup-preview-group[open] .cleanup-preview-group-heading{
    border-bottom:1px solid var(--border);
  }
  .cleanup-preview-item{
    display:grid;
    grid-template-columns:32px 56px minmax(0, 1fr) minmax(190px, auto);
    gap:14px;
    align-items:start;
    padding:14px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface-2);
    transition:opacity .15s ease, border-color .15s ease, background .15s ease;
  }
  .cleanup-preview-item.is-selected{
    border-color:var(--border-strong);
  }
  .cleanup-preview-item.is-excluded{
    opacity:.62;
    background:var(--surface);
  }
  .cleanup-preview-select{
    display:block;
    align-self:center;
    cursor:pointer;
  }
  .cleanup-preview-select input{
    width:30px;
    height:30px;
    min-height:30px;
    margin:0;
  }
  .cleanup-preview-item img,
  .cleanup-cover-placeholder{
    width:56px;
    height:72px;
    border-radius:var(--radius-sm);
    object-fit:cover;
  }
  .cleanup-cover-placeholder{
    display:grid;
    place-items:center;
    background:var(--surface);
    font-size:var(--text-28);
  }
  .cleanup-preview-book > strong{
    display:block;
    font-size:var(--text-md);
    line-height:1.3;
  }
  .cleanup-preview-item small{
    display:block;
    color:var(--text-muted);
    font-size:var(--text-18);
  }
  .cleanup-preview-item ul{ margin:8px 0 0; padding-left:20px; }
  .cleanup-preview-price{
    display:flex;
    flex-direction:column;
    text-align:right;
  }
  .cleanup-preview-price strong{ font-family:var(--font-mono); font-size:var(--text-md); }
  .cleanup-preview-price span{ color:var(--text-muted); font-size:var(--text-17); }
  .cleanup-preview-reason{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    text-align:right;
  }
  .cleanup-preview-reason strong{
    padding:4px 9px;
    border:1px solid var(--amber);
    border-radius:999px;
    background:var(--amber-bg);
    color:var(--amber-dark);
    font-size:var(--text-sm);
  }
  .cleanup-preview-reason span{
    margin-top:5px;
    color:var(--text-muted);
    font-size:var(--text-sm);
  }
  .cleanup-preview-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-top:28px;
    padding:18px;
    border:2px solid var(--accent);
    border-radius:var(--radius);
    background:var(--accent-bg);
    color:var(--text-muted);
    font-size:var(--text-18);
  }
  .cleanup-preview-footer button{
    flex:0 0 auto;
    width:auto;
    min-height:56px;
  }
  #cleanup-status:empty{ display:none; }
  .cleanup-preview-empty{ margin-top:18px; }
  .cleanup-preview-empty button{
    display:block;
    width:auto;
    margin:16px auto 0;
  }
  .lager-group{
    margin-bottom:22px;
    padding:0;
  }
  .lager-group-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:6px;
    padding:14px 16px;
    border:2px solid var(--accent);
    border-left-width:6px;
    border-bottom-width:3px;
    border-radius:var(--radius) var(--radius) 0 0;
    background:var(--accent-bg);
  }
  .lager-group-heading{
    display:flex;
    flex-direction:column;
    gap:2px;
  }
  .lager-group-title{
    margin:0;
    color:var(--accent-dark);
    font-size:var(--text-lg);
    font-weight:700;
    line-height:1.25;
  }
  .lager-group-count{
    color:var(--text-muted);
    font-size:var(--text-18);
    font-weight:700;
  }
  .lager-rescan-btn{
    margin-left:auto;
    width:auto;
    min-height:44px;
    padding:9px 14px;
    font-size:var(--text-15);
    font-weight:600;
  }
  .box-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    cursor:pointer;
    min-height:58px;
    margin:0 0 6px 18px;
    padding:9px 14px;
    border-width:1px;
    border-radius:var(--radius);
    transition:background .15s ease, border-color .15s ease, transform .15s ease;
  }
  .box-card:hover{
    border-color:var(--accent);
    background:var(--accent-bg);
    transform:translateX(2px);
  }
  .box-card:focus-within{
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-bg);
  }
  .box-card:focus-visible{
    outline:3px solid var(--accent);
    outline-offset:2px;
  }
  .box-card-main{
    display:flex;
    align-items:baseline;
    gap:16px;
    min-width:0;
  }
  .box-card-title{
    color:var(--text);
    font-size:var(--text-lg);
    white-space:nowrap;
  }
  .box-card-meta{
    color:var(--text-muted);
    font-size:var(--text-18);
    font-weight:700;
  }
  .box-card-open-hint{
    margin-left:auto;
    color:var(--accent-dark);
    font-size:var(--text-28);
    font-weight:700;
    line-height:1;
  }
  .box-lager-editor{
    margin:16px 0 18px;
    border:2px solid var(--border);
    border-radius:var(--radius);
    background:var(--accent-bg);
  }
  .box-lager-editor summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:11px 14px;
    cursor:pointer;
    list-style:none;
  }
  .box-lager-editor summary::-webkit-details-marker{ display:none; }
  .box-lager-editor summary:focus-visible{
    outline:3px solid var(--accent);
    outline-offset:2px;
  }
  .box-lager-change{
    color:var(--accent-dark);
    font-weight:700;
  }
  .box-lager-change::before{ content:'▸ '; }
  .box-lager-editor[open] .box-lager-change::before{ content:'▾ '; }
  .box-lager-editor-body{
    padding:0 14px 12px 52px;
  }
  .box-lager-editor .box-setting-value{ display:block; }
  .box-lager-editor .box-setting-edit{
    justify-content:flex-start;
  }
  .box-lager-warning{
    margin:9px 0 0;
    padding:8px 10px;
    border-left:5px solid var(--amber);
    background:var(--amber-bg);
    color:var(--amber-dark);
    font-size:var(--text-xs);
  }
  .box-action-buttons{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
  }
  .box-action-buttons button{
    min-height:50px;
    padding:11px 16px;
  }
  .box-book-actions button{
    min-height:38px;
    padding:7px 10px;
    font-size:var(--text-xs);
  }
  /* Vorher transparent/randlos, dadurch bei 1 Exemplar ein reiner Textlink
     ("Entfernen") statt eines Buttons, während "Verschieben" daneben ganz
     regulär gerahmt ist - siehe DESIGN.md-Audit. Erbt jetzt denselben
     sichtbaren Rahmen wie .box-move-btn (via .row-actions button, books.css). */
  .box-book-row .box-remove-btn:hover,
  .box-book-row .box-remove-btn:focus-visible{
    border-color:var(--red);
    background:var(--red-bg);
    color:var(--red);
  }
  .box-action-buttons .box-move-btn:hover{
    border-color:var(--accent);
    color:var(--accent-dark);
    background:var(--accent-bg);
  }
  .box-move-form{
    margin-top:10px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface-2);
  }
  .box-move-form[hidden]{ display:none; }
  .box-move-form label{
    display:block;
    margin-bottom:8px;
    color:var(--text-muted);
    font-size:var(--text-13);
    font-weight:700;
  }
  .box-move-form input{
    display:block;
    width:100%;
    margin-top:3px;
    padding:8px 10px;
    border:1px solid var(--border-strong);
    border-radius:var(--radius-sm);
    background:var(--surface);
  }
  .box-move-error{
    min-height:20px;
    color:var(--red);
    font-size:var(--text-13);
    font-weight:700;
  }
  .box-move-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
  }
  .box-detail-tools{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
  }
  .box-detail-tools > input{
    flex:1;
    min-width:220px;
    padding:10px 12px;
    border:1px solid var(--border-strong);
    border-radius:var(--radius);
    background:var(--surface);
  }
  .box-detail-sort{
    display:flex;
    gap:8px;
  }
  .box-detail-sort button{ width:auto; }
  .box-detail-sort button.active{
    border-color:var(--accent);
    background:var(--accent-bg);
    color:var(--accent-dark);
  }
  .box-detail-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:20px;
  }
  .box-book-row-empty{
    padding:40px 20px;
  }
  .box-book-row{
    border:2px solid var(--border);
    border-radius:var(--radius-lg);
    background:var(--surface);
    box-shadow:var(--shadow-sm);
    padding:10px 14px;
  }
  .box-book-row-main{
    display:flex;
    align-items:center;
    gap:14px;
  }
  .box-book-cover{ flex:0 0 auto; }
  .box-book-info{
    flex:1 1 auto;
    min-width:0;
  }
  .box-book-row .book-title{
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    line-height:1.35;
  }
  .box-book-qty{
    flex:0 0 auto;
    min-width:32px;
    text-align:right;
    color:var(--text-muted);
    font-weight:700;
    font-variant-numeric:tabular-nums;
  }
  .box-book-actions{
    flex:0 0 auto;
    display:flex;
    gap:8px;
  }
  .box-book-actions button{
    white-space:nowrap;
  }
  .box-book-row .cover-thumb-sm,
  .box-book-row .cover-placeholder-sm{
    width:36px;
    height:50px;
  }
  @media (max-width:760px){
    .boxes-toolbar{
      align-items:stretch;
      flex-direction:column;
    }
    .table-toolbar.boxes-toolbar input{
      flex-basis:auto;
      min-width:0;
    }
    .cleanup-entry{
      align-items:stretch;
      flex-direction:column;
    }
    .cleanup-entry button{ width:100%; }
    .cleanup-preview-heading{ flex-direction:column; }
    .cleanup-preview-tools,
    .cleanup-preview-footer{
      align-items:stretch;
      flex-direction:column;
    }
    .cleanup-sort-label{ min-width:0; }
    .cleanup-selection-actions{
      flex-direction:column;
    }
    .cleanup-selection-actions button,
    .cleanup-preview-footer button{
      width:100%;
    }
    .cleanup-preview-group-heading{ align-items:flex-start; flex-direction:column; }
    .cleanup-form{ grid-template-columns:1fr; }
    .cleanup-preview-item{ grid-template-columns:32px 44px minmax(0, 1fr); }
    .cleanup-preview-select{ grid-column:auto; }
    .cleanup-preview-item img,
    .cleanup-cover-placeholder{ width:44px; height:58px; }
    .cleanup-preview-price{ grid-column:2 / -1; text-align:left; }
    .cleanup-preview-reason{ grid-column:2 / -1; align-items:flex-start; text-align:left; }
    .lager-group-header{ align-items:stretch; }
    .lager-rescan-btn{
      margin-left:0;
      width:100%;
    }
    .box-card{
      align-items:stretch;
      flex-direction:column;
    }
    .box-card-main{
      align-items:flex-start;
      flex-direction:column;
      gap:4px;
    }
    .box-card-title{ white-space:normal; }
    .box-card-open-hint{ align-self:flex-end; }
    .box-book-row-main{
      align-items:flex-start;
      flex-wrap:wrap;
      row-gap:10px;
    }
    .box-book-qty{
      order:2;
      flex-basis:100%;
      text-align:left;
    }
    .box-book-qty::before{ content:'Menge: '; color:var(--text-muted); font-weight:400; }
    .box-book-actions{
      order:3;
      flex-basis:100%;
      flex-direction:row;
      flex-wrap:wrap;
      justify-content:flex-start;
      width:auto;
    }
    .box-book-actions button{ flex:1 1 auto; }
    .box-lager-editor summary{ align-items:flex-start; }
    .box-lager-editor-body{ padding-left:14px; }
    .box-lager-editor .box-setting-edit{
      align-items:stretch;
      flex-direction:column;
    }
    .box-lager-editor .box-setting-edit input,
    .box-lager-editor .box-setting-edit button{ width:100%; }
    .box-detail-tools{ align-items:stretch; flex-direction:column; }
    .box-detail-tools > input{ min-width:0; width:100%; }
    .box-detail-sort{ flex-direction:column; }
    .box-detail-sort button{ width:100%; }
  }
