/* Customer history: files first, with actions beside each result. */
#view-history{scroll-margin-top:110px}
#view-history .history-hero{align-items:center!important;gap:20px;margin-bottom:20px}
#view-history .history-hero h2{font-size:32px;color:#392c43;letter-spacing:-1px}
#view-history .history-hero p{color:#8c7799;font-size:12px;line-height:1.7}
#view-history .history-hero>.button{min-height:44px;flex-shrink:0;padding:12px 16px;border-radius:12px;font-size:11px}
.history-retention{display:flex;align-items:center;gap:9px;margin-bottom:25px;padding:12px 14px;border:1px solid #e5dce9;border-radius:12px;background:#ffffff8c;color:#8b7499;font-size:10px;line-height:1.7}
.history-retention svg{width:17px;height:17px;flex-shrink:0;color:#a77cb7}.history-retention strong{color:#796186;font-weight:650}
.history-controls{padding:17px;border:1px solid #e6deeb;border-radius:18px;background:#ffffffa8}
.history-search-row{display:flex;align-items:center;gap:10px}
.history-search{position:relative;display:flex;align-items:center;flex:1;min-width:0;margin:0;gap:10px}
.history-search>svg{position:absolute;left:13px;width:18px;height:18px;color:#b29bc0;pointer-events:none}
.history-search input{width:100%;min-width:0;min-height:44px;margin:0;padding:12px 12px 12px 41px;border:1px solid #e4d9eb;border-radius:11px;background:#fff;color:#50375e;font-size:12px;font-weight:500}
.history-search input::placeholder{color:#ae98b9}
.history-select{margin:0;flex-shrink:0}
.history-select select,.history-sort select{max-width:100%;min-height:44px;padding:10px 27px 10px 12px;border:1px solid #e6dceb;border-radius:10px;background-color:#fff;color:#82638f;font-size:11px;cursor:pointer}
#view-history .history-refresh{display:flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;min-height:44px;padding:10px 12px;border:1px solid #e6dceb;border-radius:10px;background:#fff;color:#866590;font-size:10px}
#view-history .history-refresh:hover{background:#f8f1fc;border-color:#d2b8df}
#view-history .history-refresh>span{font-size:18px;line-height:1}
#view-history .history-refresh>svg{width:18px;height:18px;flex-shrink:0}
.history-filter-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}
#view-history .history-filters{display:flex;align-items:center;flex-wrap:wrap;gap:5px;padding:0;border:0;background:none;border-radius:0}
#view-history .history-filters button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:9px 10px;border:1px solid transparent;border-radius:9px;background:transparent;color:#9a82a7;font-size:10px;font-weight:650;white-space:nowrap;box-shadow:none}
#view-history .history-filters button>span{padding:2px 5px;border-radius:5px;background:#f0e9f5;color:#a38caf;font-size:9px;line-height:1.2;font-variant-numeric:tabular-nums}
#view-history .history-filters button.active{border-color:#decee7;background:#f2e9f8;color:#7c4d94;box-shadow:0 2px 8px #73408905}
#view-history .history-filters button.active>span{background:#dfcbe9;color:#7b4b92}
#view-history .history-filters button:hover{color:#7c4d94;background:#f8f0fc}
.history-sort{margin:0;flex-shrink:0}.history-sort select{min-height:36px;padding:8px 24px 8px 10px;border-color:transparent;background-color:transparent;font-size:10px;color:#a18bab}
.history-results-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:4px 2px}
.history-results-heading>p{margin:0;color:#a38aaf;font-size:10px}
.history-results-heading>button{padding:8px 0;border:0;background:none;color:#a64773;font-size:10px;font-weight:650}
.history-update-info{padding:12px 15px;border:1px solid #e9d7b5;border-radius:10px;background:#fff9ec;color:#957436;font-size:11px;line-height:1.6}
#view-history .history-list{gap:15px}
#view-history .history-row{--history-accent:#bd3c60;--history-tint:#fbecf2;--history-line:#edd5df;display:block;min-width:0;padding:21px;border:1px solid #e6dce9;border-left:1px solid #e6dce9;border-radius:18px;background:#fff;box-shadow:0 5px 20px #36213d04;transform:none;transition:border-color .18s,box-shadow .18s}
#view-history .history-row.decoder-sourceguardian{--history-accent:#2675ba;--history-tint:#edf5ff;--history-line:#d6e6f6;border-left-color:#e6dce9}
#view-history .history-row:hover{border-color:var(--history-line);box-shadow:0 8px 27px #34213e08;transform:none}
.history-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
#view-history .history-file{align-items:center;gap:12px;min-width:0;flex:1}
#view-history .history-file-icon{display:grid;place-items:center;flex:0 0 43px;width:43px;height:49px;border:1px solid var(--history-line);border-radius:10px;background:linear-gradient(140deg,#fff,var(--history-tint));color:var(--history-accent);font-size:9px;font-weight:800;letter-spacing:.4px;box-shadow:0 3px 8px #4d2f5505}
#view-history .history-file>div{display:block;min-width:0}
#view-history .history-file b{display:block;overflow:visible;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;color:#50375e;font-size:14px;line-height:1.5;font-weight:700;letter-spacing:-.15px}
.history-file-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px}
#view-history .decoder-badge{padding:3px 6px;border-radius:5px;background:var(--history-tint);color:var(--history-accent);font-size:8px;font-weight:650;line-height:1.4}
.history-meta-dot{color:#c7b6d0;font-size:9px}
#view-history .history-date{font-size:9px;color:#ad96b8;line-height:1.5}
#view-history .history-card-top>.status{flex-shrink:0;padding:6px 8px;border-radius:7px;font-size:9px;font-weight:650;white-space:nowrap;align-self:flex-start;background:#f2eef5;color:#a28cad}
#view-history .status.complete{background:#eaf6ee;color:#548b67}
#view-history .status.queued,#view-history .status.decoding,#view-history .status.submitting{background:#f3edfc;color:#9470b8}
#view-history .status.partial{background:#fff4de;color:#b08a39}
#view-history .status.failed{background:#fceef1;color:#c06d85}
#view-history .status.expired{background:#f2f0f4;color:#a094a9}
#view-history .history-outcome{margin:14px 0 0;color:#a38aac;font-size:10px;line-height:1.7}
.history-pending{display:flex;align-items:flex-start;gap:10px;margin-top:16px;padding:13px;border:1px solid #e9def4;border-radius:11px;background:#faf7fd}
.history-pending-dot{width:7px;height:7px;flex:0 0 7px;margin-top:5px;border-radius:50%;background:#ba9bd4;box-shadow:0 0 0 4px #bb9dd81b;animation:history-pulse 2s ease-in-out infinite}
.history-pending b{display:block;color:#9b78b2;font-size:10px;font-weight:650;line-height:1.7}
.history-pending p{margin:3px 0 0;color:#ae94bd;font-size:10px;line-height:1.7}
#view-history .queue-progress{margin-top:13px}
#view-history .history-delivery{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:0;margin-top:17px;padding-top:15px;border-top:1px solid #f0e9f3}
#view-history .history-delivery:empty{display:none}
#view-history .deletion-time{display:block;min-width:0;color:#b199bb;font-size:9px;line-height:1.8}
#view-history .deletion-time time{display:block;color:#9e7dad;font-weight:600}
#view-history .deletion-time.expired{color:#b3a2bc}
#view-history .history-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-left:auto;flex-shrink:0}
#view-history .history-actions .button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:10px 13px;border:1px solid #e7ddea;border-radius:10px;font-size:10px;line-height:1.5;font-weight:650}
#view-history .history-actions svg{width:15px;height:15px;flex-shrink:0}
#view-history .history-actions .preview-action{background:#fff;color:#9b7da9;box-shadow:none}
#view-history .history-actions .download{border-color:var(--history-accent);background:var(--history-accent);color:#fff;box-shadow:0 3px 8px #5024400b}
#view-history .history-actions .download:hover{filter:brightness(.95)}
#view-history .job-files{margin-top:16px;border:1px solid #eee5f3;border-radius:11px;background:#faf8fc}
#view-history .job-files>summary{padding:12px;gap:10px}
#view-history .job-files-title{font-size:10px;color:#a183b0}
#view-history .job-files-title>b{font-size:9px;color:#ab8fba;background:#eee5f5}
#view-history .job-file-counts{gap:5px}
#view-history .file-count{font-size:8px;font-weight:600}
#view-history .job-file-group{border-color:#eae0f1;border-radius:8px}
#view-history .job-file-group>summary{font-size:11px;padding:11px 12px}
#view-history .job-file-group li b{font-size:11px;line-height:1.7}
#view-history .job-key-warning{margin-top:14px;padding:13px;border-radius:11px}
.history-job-error{margin-top:14px;border:1px solid #f0e1e7;border-radius:10px;overflow:hidden;font-size:11px}
.history-job-error summary{padding:10px 12px;cursor:pointer;color:#b16a85;font-size:10px}
.history-job-error p{margin:0;padding:0 12px 12px;color:#ae899c;line-height:1.7;overflow-wrap:anywhere}
#view-history .history-empty{padding:48px 23px;border:1px dashed #ddd0e7;border-radius:18px;background:#ffffffc7}
#view-history .history-empty>span{width:52px;height:52px;border-radius:16px;background:#f3eaf9;color:#b58ac9;font-size:25px}
#view-history .history-empty b{color:#8d699f;font-size:17px;letter-spacing:-.4px}
#view-history .history-empty p{max-width:310px;margin:9px auto 20px;color:#b59cc1;font-size:11px;line-height:1.8}
.history-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes history-pulse{50%{opacity:.5}}
@media(max-width:1100px) and (min-width:901px){
 .history-controls{padding:13px}.history-search-row{flex-wrap:wrap}.history-search{flex-basis:100%}.history-select{flex:1}.history-select select{width:100%}
 .history-filter-row{flex-wrap:wrap}.history-sort{margin-left:auto}
 #view-history .history-row{padding:17px}
 #view-history .history-delivery{align-items:flex-start;flex-direction:column}
 #view-history .history-actions{width:100%;margin-left:0}.history-actions .download{flex:1}
}
@media(max-width:600px){
 #view-history .history-hero{align-items:flex-start!important;gap:14px}#view-history .history-hero h2{font-size:29px}
 #view-history .history-hero>.button{width:auto;font-size:11px;padding:11px 14px}
 .history-retention{align-items:flex-start;font-size:10px;margin-bottom:20px}
 .history-controls{padding:13px}.history-search-row{flex-wrap:wrap;gap:9px}.history-search{flex-basis:100%}
 .history-select{flex:1;min-width:0}.history-select select{width:100%;min-height:44px;font-size:12px}
 #view-history .history-refresh{font-size:10px;min-height:44px}
 .history-filter-row{flex-wrap:wrap;gap:5px}#view-history .history-filters{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 #view-history .history-filters button{min-height:40px;justify-content:space-between;font-size:10px;padding:10px}
 .history-sort{margin-left:auto}.history-sort select{font-size:11px}
 #view-history .history-row{padding:17px;border-radius:16px}.history-card-top{flex-wrap:wrap;gap:10px}
 #view-history .history-file{flex-basis:100%;gap:11px}#view-history .history-file b{font-size:13px;line-height:1.7}
 #view-history .history-file-icon{width:39px;height:46px;flex-basis:39px}
 #view-history .history-card-top>.status{margin-left:50px;font-size:9px}
 #view-history .history-file-meta{column-gap:6px;row-gap:4px}#view-history .history-date{font-size:9px}
 #view-history .history-outcome{margin-top:10px;font-size:10px}
 #view-history .history-delivery{align-items:stretch;flex-direction:column;gap:12px}
 #view-history .deletion-time time{display:inline;margin-left:4px}
 #view-history .history-actions{display:flex;margin-left:0;width:100%}
 #view-history .history-actions .button{min-height:44px;padding-inline:11px}
 #view-history .history-actions .download{flex:1;min-width:0}
 #view-history .job-files>summary{align-items:flex-start;flex-direction:column;gap:8px}
}
@media(prefers-reduced-motion:reduce){.history-pending-dot{animation:none}#view-history .history-row{transition:none}}

#view-history .history-refresh svg{width:18px;height:18px}
#view-history .history-file-meta .history-date{font-size:10px;color:#9a82a6}
#view-history .history-outcome{font-size:11px;color:#9a7ca6}
#view-history .deletion-time{font-size:10px;color:#9f81ac}
#view-history .history-actions .button{font-size:11px}
.history-results-heading>p{font-size:11px;color:#9d83aa}
#view-history .history-file b{color:#51345f}

.history-search-row .history-sort{margin:0;flex-shrink:0}
.history-search-row .history-sort select{min-height:44px;padding:10px 23px 10px 10px;border:1px solid #e6dceb;border-radius:10px;background:#fff;font-size:11px;color:#92739f}
@media(max-width:900px){#view-history{scroll-margin-top:162px}}
@media(max-width:600px){
 .history-search-row .history-sort{width:109px;max-width:35%}
 .history-search-row .history-sort select{width:100%;font-size:10px;padding-inline:8px}
 .history-filter-row{margin-top:9px}
}

#view-history .history-date,#view-history .deletion-time{color:#92789f}
#view-history .history-hero>.button{gap:9px}
@media(max-width:600px){
 #view-history .history-hero{flex-direction:row;align-items:center!important;gap:10px}
 #view-history .history-hero>div{min-width:0}
 #view-history .history-hero .eyebrow{font-size:9px}
 #view-history .history-hero h2{font-size:27px;margin-bottom:0}
 #view-history .history-hero p{display:none}
 #view-history .history-hero>.button{min-height:44px;padding:10px;gap:5px;font-size:10px}
 #view-history .history-retention{padding:11px;font-size:10px}
}
