.legacy-history-head{padding:12px 14px;margin-bottom:10px}
.legacy-history-title{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.legacy-history-title h2{font-size:17px;margin:0}
.legacy-history-title .hint{margin:0}
.legacy-history-filters{display:grid;grid-template-columns:140px minmax(200px,2fr) minmax(150px,1fr) 140px 140px auto;gap:8px;align-items:end}
.legacy-history-filters label{margin-top:8px}
.legacy-history-filters input,.legacy-history-filters select{min-width:0}
.legacy-history-query-actions,.legacy-history-summary,.legacy-history-pages{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.legacy-history-summary{margin-top:10px;font-size:13px;color:var(--ink)}
.legacy-history-summary label{display:flex;align-items:center;gap:6px;margin:0}
.legacy-history-summary input{width:auto}
.legacy-history-list{padding:0 10px;min-height:0}
.legacy-history-table th{position:sticky;top:0;background:var(--table-head,#e8edf3);z-index:1}
.legacy-history-table td{vertical-align:middle}
.legacy-history-table .legacy-history-product{min-width:180px;max-width:300px;white-space:normal;overflow-wrap:anywhere}
.legacy-history-product small{display:block;color:var(--muted)}
.legacy-history-photo img,.legacy-history-photo .image-placeholder{display:block;width:44px;height:44px;object-fit:contain;margin:auto;border:1px solid var(--line);border-radius:6px}
.legacy-history-photo img{cursor:zoom-in;background:white}
.legacy-history-photo .image-placeholder{display:grid;place-items:center;background:var(--bg);font-size:12px}
.legacy-history-photos{display:flex;gap:4px;justify-content:center}
.legacy-history-pages{justify-content:center;padding-top:8px;font-size:13px;flex-shrink:0}
.legacy-history-pages .btn:disabled{opacity:.55;cursor:default}
.legacy-history-filters :focus-visible,.legacy-history-pages :focus-visible{outline:2px solid var(--brand);outline-offset:2px}
@media(max-width:1100px){.legacy-history-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
  .legacy-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .legacy-history-keyword{grid-column:1/-1}
  .legacy-history-head{padding:10px}
  .legacy-history-query-actions .btn,.legacy-history-pages .btn{min-height:44px}
  .legacy-history-list{overflow-y:auto;overflow-x:hidden;padding:0 10px}
  .legacy-history-table,.legacy-history-table tbody{display:block;min-width:0!important;width:100%}
  .legacy-history-table thead{display:none}
  .legacy-history-table tr{display:block;padding:10px 0;border-bottom:1px solid var(--line)}
  .legacy-history-table td{display:grid;grid-template-columns:86px minmax(0,1fr);gap:8px;padding:4px 0;border:0;white-space:normal;text-align:left;min-width:0;max-width:none;overflow-wrap:anywhere}
  .legacy-history-table td:before{content:attr(data-label);color:var(--muted);font-size:12px;text-align:left}
  .legacy-history-table .legacy-history-product{min-width:0;max-width:none;display:block;padding-left:94px;position:relative}
  .legacy-history-product:before{position:absolute;left:0;top:4px}
  .legacy-history-photo img,.legacy-history-photo .image-placeholder{margin:0}
  .legacy-history-photos{justify-content:flex-start;flex-wrap:wrap}
  .legacy-history-table .empty{display:block;padding:20px 0}
  .legacy-history-table .empty:before{display:none}
}
