  /* ---------- Books view ---------- */
  .table-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
    gap:16px;
    flex-wrap:wrap;
  }
  .table-toolbar input{
    background:var(--surface);
    border:2px solid var(--border-strong);
    color:var(--text);
    padding:12px 16px;
    border-radius:var(--radius-md);
    font-size:var(--text-17);
    min-width:280px;
  }
  .table-toolbar input:focus{
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-bg);
  }
  #book-count{ font-size:var(--text-sm); color:var(--text-muted); font-weight:700; }

  .search-field{
    position:relative;
    display:flex;
    align-items:center;
    flex:1 1 280px;
    min-width:280px;
  }
  .search-field-icon{
    position:absolute;
    left:14px;
    width:18px;
    height:18px;
    color:var(--text-muted);
    pointer-events:none;
  }
  .search-field input{
    width:100%;
    padding-left:42px;
    padding-right:42px;
  }
  .search-field input::-webkit-search-cancel-button{
    display:none;
  }
  .search-field-clear{
    position:absolute;
    right:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    width:28px;
    height:28px;
    padding:0;
    border:none;
    background:none;
    border-radius:50%;
    color:var(--text-muted);
    cursor:pointer;
  }
  .search-field-clear .icon{ width:14px; height:14px; }
  .search-field-clear:hover{
    background:var(--surface-2);
    color:var(--text);
  }
  .search-field-clear[hidden]{ display:none; }

  .books-list{
    display:grid;
    gap:10px;
  }
  .books-load-more{
    display:block;
    min-width:280px;
    margin:26px auto 0;
  }
  .book-card{
    display:grid;
    grid-template-columns:auto minmax(210px, 1.25fr) minmax(440px, 2.4fr);
    gap:14px;
    align-items:center;
    padding:12px 14px;
    border:2px solid var(--border);
    border-radius:var(--radius-lg);
    background:var(--surface);
    box-shadow:var(--shadow-sm);
    cursor:pointer;
  }
  .book-card.with-actions{
    grid-template-columns:auto minmax(210px, 1.25fr) minmax(400px, 2.2fr) auto;
  }
  .book-card:hover{ border-color:var(--accent); background:var(--surface-2); }
  .book-card-prices-wrap{
    display:flex;
    flex-direction:column;
    gap:8px;
  }
  .book-card-prices{
    display:grid;
    grid-template-columns:repeat(5, minmax(90px, 1fr));
    gap:7px;
  }
  .book-offer{
    position:relative;
    min-width:0;
    padding:7px 8px;
    border:2px solid var(--border);
    border-radius:var(--radius-sm);
    background:var(--surface-2);
  }
  .book-offer.best-offer{
    border-color:var(--accent);
    background:var(--accent-bg);
    box-shadow:inset 4px 0 0 var(--accent);
  }
  .book-offer-best-label{
    display:inline-block;
    margin-bottom:3px;
    padding:1px 6px;
    border-radius:999px;
    background:var(--accent);
    color:var(--surface) !important;
    font-size:var(--text-2xs);
    line-height:1.4;
    font-weight:700;
    text-transform:uppercase;
  }
  .book-offer-name{
    display:block;
    margin-bottom:3px;
    color:var(--text-muted);
    font-size:var(--text-13);
    font-weight:700;
  }
  .book-card-actions{
    display:flex;
    flex-direction:column;
    gap:8px;
    padding-left:12px;
    border-left:2px solid var(--border);
  }
  .detail-row{
    margin-top:-10px;
    padding:24px;
    border:2px solid var(--border);
    border-top:0;
    border-radius:0 0 var(--radius-lg) var(--radius-lg);
    background:var(--surface-2);
  }
  @media (max-width:1100px){
    .book-card,.book-card.with-actions{ grid-template-columns:auto 1fr auto; }
    .book-card-prices-wrap{ grid-column:2 / -1; }
    .book-card-actions{ grid-column:2 / -1; flex-direction:row; }
  }
  @media (max-width:650px){
    .book-card,.book-card.with-actions{ grid-template-columns:auto 1fr; }
    .book-card-actions,.book-card-prices-wrap{ grid-column:1 / -1; }
    .book-card-prices{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
    .book-offer{ padding:5px 7px; }
    .book-offer-name{ font-size:var(--text-2xs); }
    .book-card .pill{ font-size:var(--text-2xs); }
  }

  .table-wrap{
    overflow-x:auto;
    border:2px solid var(--border);
    border-radius:var(--radius-lg);
    background:var(--surface);
  }
  .cover-thumb-sm{
    width:44px; height:62px;
    object-fit:cover;
    border-radius:var(--radius-sm);
    background:var(--surface-2);
    display:block;
  }
  .cover-placeholder-sm{
    width:44px; height:62px;
    border-radius:var(--radius-sm);
    background:var(--surface-2);
    border:1px solid var(--border);
  }
  .book-card .cover-thumb-sm,
  .book-card .cover-placeholder-sm{
    width:58px;
    height:82px;
    border-radius:var(--radius-sm);
  }
  .book-title{ font-weight:700; }
  .book-authors{ font-size:var(--text-sm); color:var(--text-muted); margin-top:3px; }
  td.price-cell{ font-family:var(--font-mono); font-size:var(--text-sm); font-weight:700; white-space:nowrap; }
  .pill{
    display:inline-block;
    padding:3px 7px;
    border-radius:999px;
    font-size:var(--text-13);
    font-weight:700;
  }
  .pill.offer{ background:var(--green-bg); color:var(--green); }
  /* "kein Ankauf" ist ein normaler, häufiger Zustand - kein Fehler. --red
     bleibt für echte Fehler/destruktive Aktionen reserviert (siehe
     DESIGN.md), sonst verliert die Farbe ihre Warnwirkung dort, wo sie
     wirklich zählt (z.B. .book-delete-btn im Buch-Detail). */
  .pill.no_offer{ background:var(--surface-2); color:var(--text-muted); }
  .pill.dash{ color:var(--text-muted); background:none; }
  .pill.disabled{ color:var(--text-muted); background:var(--surface-2); opacity:0.7; }
  .book-card .pill{
    padding:3px 7px;
    font-size:var(--text-13);
  }
  .best-price{ font-family:var(--font-mono); font-weight:700; color:var(--accent-dark); font-size:var(--text-18); }
  .sale-pill{
    display:inline-block;
    margin:5px 5px 0 0;
    font-size:var(--text-13);
    font-weight:700;
    color:var(--green);
    background:var(--green-bg);
    padding:4px 8px;
    border:1px solid currentColor;
    border-radius:999px;
  }
  .row-actions button{
    background:var(--surface);
    border:2px solid var(--border-strong);
    color:var(--text);
    font-size:var(--text-xs);
    font-weight:700;
    padding:7px 10px;
    border-radius:var(--radius);
    cursor:pointer;
  }
  .row-actions button:hover{ border-color:var(--accent); color:var(--accent); }

  .detail-grid{
    display:grid;
    grid-template-columns:1fr 1.5fr;
    gap:28px;
  }
  @media (max-width:800px){ .detail-grid{ grid-template-columns:1fr; } }
  .detail-meta{ font-size:var(--text-sm); line-height:1.9; }
  .detail-meta .book-delete-btn{
    margin-top:var(--space-4);
  }
  .detail-meta .k{
    color:var(--text-muted);
    font-size:var(--text-13);
    text-transform:uppercase;
    letter-spacing:0.04em;
    font-weight:700;
  }
  .detail-book-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:18px;
    box-shadow:var(--shadow-sm);
  }
  .detail-card-header{
    display:flex;
    flex-direction:column;
    gap:3px;
    padding-bottom:12px;
    margin-bottom:14px;
    border-bottom:1px solid var(--border);
    line-height:1.25;
  }
  .detail-card-header strong{
    font-size:var(--text-md);
    color:var(--text);
  }
  .detail-facts{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:10px;
  }
  @media (max-width:560px){ .detail-facts{ grid-template-columns:1fr; } }
  .detail-fact{
    background:var(--surface-2);
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    padding:9px 10px;
    min-width:0;
    line-height:1.3;
  }
  .detail-fact-label{
    display:block;
    color:var(--text-muted);
    font-size:var(--text-2xs);
    text-transform:uppercase;
    font-weight:700;
  }
  .detail-fact-value{
    display:block;
    margin-top:2px;
    font-weight:700;
    overflow-wrap:anywhere;
  }
  .detail-section{
    margin-top:16px;
  }
  .detail-section h3{
    margin:0 0 8px;
    color:var(--accent-dark);
    font-size:var(--text-sm);
  }
  .detail-subjects{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
  }
  .detail-subject{
    background:var(--accent-bg);
    color:var(--accent-dark);
    border:1px solid var(--border);
    border-radius:999px;
    padding:4px 9px;
    font-size:var(--text-13);
    font-weight:700;
    line-height:1.2;
  }
  .detail-description{
    margin:0;
    max-height:210px;
    overflow:auto;
    background:var(--surface-2);
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    padding:10px 12px;
    color:var(--text);
    font-size:var(--text-15);
    line-height:1.55;
    white-space:pre-wrap;
  }
  .detail-empty-note{
    color:var(--text-muted);
    font-size:var(--text-15);
    line-height:1.5;
  }
  .history-chart{ width:100%; height:190px; }
  .history-point{ cursor:help; stroke:var(--surface); stroke-width:2; }
  .history-point:hover,
  .history-point:focus{ r:9px; stroke:var(--text); }
  .chart-legend{ margin-top:10px; font-size:var(--text-sm); }
  .chart-legend span{ margin-right:18px; font-weight:700; }

  .history-list{
    max-height:260px;
    overflow-y:auto;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface);
  }
  .history-list-row{
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:16px;
    align-items:center;
    min-height:62px;
    padding:16px 18px;
    font-size:var(--text-18);
    line-height:1.5;
    border-bottom:1px solid var(--border);
  }
  .history-list-row:last-child{ border-bottom:none; }
  .history-list-row:nth-child(even){ background:var(--surface-2); }
  .hl-date{ color:var(--text-muted); font-family:var(--font-mono); font-size:var(--text-sm); }
  .hl-source{ font-weight:700; text-transform:capitalize; }
  .hl-value{ font-family:var(--font-mono); text-align:right; }
