/* v2.9.3: composed History filters and modal-owned action layers. */
#historyBackdrop{z-index:12000!important}
#pdfReadyBackdrop{z-index:12500!important}
#pdfFileViewer{z-index:13000!important}
#busyBackdrop{z-index:15000!important}
#toast{z-index:16000!important}
body.tdr-modal-open .mobile-actionbar,body.tdr-modal-open .desktop-actions,
body.tdr-history-open .mobile-actionbar,body.tdr-history-open .desktop-actions,
body.tdr-pdf-viewer-open .mobile-actionbar,body.tdr-pdf-viewer-open .desktop-actions{display:none!important;pointer-events:none!important}
body.tdr-modal-open .ios-tabbar{visibility:hidden!important;pointer-events:none!important}
#historyBackdrop .modal{max-height:calc(100dvh - 32px);overflow:hidden;display:flex;flex-direction:column}
#historyBackdrop .modal-body{min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#historyBackdrop .modal-head{flex-shrink:0}
.history-filters{--hf-rail:#e9e9ee;--hf-active:#fff;--hf-text:#191a1e;--hf-muted:#646771;--hf-border:#dcdde4;padding:0 0 14px;color:var(--hf-text)}
.history-segments{position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:4px;border-radius:13px;background:var(--hf-rail)}
.history-segments::before{content:'';position:absolute;z-index:-1;left:4px;top:4px;bottom:4px;width:calc((100% - 8px)/3);border-radius:10px;background:var(--hf-active);box-shadow:0 2px 7px #00000012;transform:translateX(calc(var(--segment,0)*100%));transition:transform .22s cubic-bezier(.22,1,.36,1)}
.history-segments button{appearance:none;min-height:42px;border:0;border-radius:10px;padding:8px 5px;background:transparent;color:var(--hf-muted);font:550 13px/1.4 var(--font-en);cursor:pointer}
.history-segments button[aria-checked=true]{color:var(--hf-text);font-weight:650}
.history-segments button:focus-visible,.history-clear:focus-visible{outline:2px solid #8b72da;outline-offset:2px}
.history-date-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.history-date-row label{display:grid;gap:6px;min-width:0;font:500 12px/1.5 var(--font-en);color:var(--hf-muted)}
.history-date-row input{box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:45px;background:var(--hf-active);color:var(--hf-text);border:1px solid var(--hf-border);border-radius:11px;padding:9px 10px;font:400 14px/1.4 var(--font-en);color-scheme:light}
.history-date-row input[aria-invalid=true]{border-color:#c05d54}
.history-filter-hint{margin:8px 0 0;font:400 11.5px/1.55 var(--font-en);color:var(--hf-muted)}
.history-filter-summary{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:10px;font:500 12px/1.5 var(--font-en);color:var(--hf-muted)}
.history-clear{border:0;background:transparent;border-radius:8px;color:var(--hf-text);padding:8px 0 8px 12px;font:600 12px/1.4 var(--font-en);cursor:pointer;min-height:36px}
.history-clear:disabled{opacity:.4;cursor:default}
.history-filter-error{margin:8px 0 0;color:#b8423e;font-size:12px;line-height:1.5}
.history-filter-error[hidden],#pdfFileViewer [hidden]{display:none!important}
.history-actions.has-pdf{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.history-actions.has-pdf .history-share{grid-column:1/-1}
.history-actions .btn{min-height:40px;justify-content:center}
html[data-theme=dark] .history-filters{--hf-rail:#24252a;--hf-active:#3a3b41;--hf-text:#f3f3f5;--hf-muted:#b0b2bc;--hf-border:#414249}
html[data-theme=dark] .history-date-row input{background:#222329;color-scheme:dark}
html[data-theme=dark] .history-filter-error{color:#efaea8}
.pdf-file-backdrop{align-items:center!important;padding:16px!important;background:rgba(0,0,0,.56)}
.pdf-file-panel{display:flex;flex-direction:column;width:min(1120px,100%);max-width:1120px!important;height:calc(100dvh - 32px);max-height:none!important;overflow:hidden;border-radius:24px!important;padding:0!important;background:var(--app-bg,#f5f5f7)!important;color:var(--app-text,#1d1d1f)}
.pdf-file-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:20px 22px 12px;flex-shrink:0}
.pdf-file-head>div{min-width:0}
.pdf-file-head h2{margin:0 0 5px;font-size:19px;line-height:1.45;font-weight:650}
.pdf-file-name{font-size:12px;line-height:1.45;overflow-wrap:anywhere;color:var(--app-secondary,#707078)}
.pdf-file-close{flex-shrink:0;background:var(--app-surface,#e7e7ee);color:inherit;border:1px solid #88888825;border-radius:12px;padding:10px 15px;min-height:44px;font:600 13px/1.4 var(--font-en);cursor:pointer}
.pdf-file-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:0 22px 12px;flex-shrink:0}
.pdf-file-toolbar .btn{min-height:43px;padding:10px 16px;font:600 13px/1.5 var(--font-en)}
.pdf-file-status{display:flex;align-items:center;gap:10px;padding:11px 22px;min-height:48px;border-block:1px solid #88888820;flex-shrink:0}
.pdf-file-status strong{display:block;font-size:13px;font-weight:600;line-height:1.4}
.pdf-file-status #pdfFileMeta{display:block;font-size:11.5px;color:var(--app-secondary,#777781);line-height:1.5}
#pdfFileElapsed{margin-left:auto;color:var(--app-secondary,#777781);font-variant-numeric:tabular-nums;font-size:11px}
.pdf-file-status .history-loading-spinner{flex:0 0 auto;width:18px;height:18px}
.pdf-file-message{margin:0;padding:9px 22px;font-size:12px;line-height:1.55;flex-shrink:0;color:var(--app-secondary,#62646e)}
.pdf-file-message.is-error{color:#b74944}
#pdfFileRetry{margin:0 22px 12px;align-self:flex-start}
.pdf-file-preview{min-height:120px;flex:1;overflow:auto;background:#d8d9df;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.pdf-file-preview:empty{background:linear-gradient(110deg,#e6e7ed 20%,#f1f2f5 50%,#e6e7ed 80%)}
.pdf-file-preview iframe{display:block;width:100%;height:100%;min-height:100%;border:0;background:#fff;color-scheme:light}
.pdf-file-help{margin:0;padding:9px 22px max(12px,env(safe-area-inset-bottom));font-size:11px;line-height:1.5;color:var(--app-secondary,#72727a);flex-shrink:0}
html[data-theme=dark] .pdf-file-panel{color:#f2f2f6!important}
html[data-theme=dark] .pdf-file-close{background:#2c2d33}
html[data-theme=dark] .pdf-file-preview{background:#292a30}
html[data-theme=dark] .pdf-file-preview:empty{background:linear-gradient(110deg,#25262c 20%,#32333a 50%,#25262c 80%)}
html[data-theme=dark] .pdf-file-message.is-error{color:#f1a29b}
@media(max-width:640px){
 #historyBackdrop{padding:0!important;align-items:stretch!important}
 #historyBackdrop .modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0!important}
 #historyBackdrop .modal-head{padding-top:max(14px,env(safe-area-inset-top))}
 #historyBackdrop .modal-body{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
 .history-segments button{font-size:12px}
 .history-date-row{gap:10px}.history-date-row input{font-size:16px;padding-inline:8px}
 .pdf-file-backdrop{padding:0!important}
 .pdf-file-panel{height:100dvh;width:100%;border-radius:0!important}
 .pdf-file-head{padding:max(14px,env(safe-area-inset-top)) 15px 12px}
 .pdf-file-toolbar{padding:0 15px 12px;display:grid;grid-template-columns:1fr 1fr}
 .pdf-file-toolbar .btn{font-size:12px;padding:10px 8px}
 .pdf-file-status{padding:10px 15px}.pdf-file-message{padding:9px 15px}.pdf-file-help{padding-inline:15px}
 .pdf-file-head h2{font-size:17px}
}
@media(prefers-reduced-motion:reduce){.history-segments::before{transition:none}}
html[data-motion=off] .history-segments::before{transition:none}
@media print{.pdf-file-backdrop{display:none!important}}
