:root{
  --canvas:hsl(220 24% 97%);--ink:hsl(28 23% 14%);--muted:hsl(31 9% 50%);--line:hsl(18 30% 92%);
  --clay:hsl(17 36% 47%);--wb-card:hsl(0 0% 100%);--wb-input:hsl(20 23% 87%);--wb-soft:hsl(22 41% 95%);
  --surface-subtle:var(--wb-card);--surface-hover:hsl(22 30% 98%);--surface-selected:hsl(20 40% 95%);
  --surface-table:var(--wb-soft);--surface-disabled:hsl(20 20% 90%);--ink-disabled:var(--muted);
  --surface-shadow:0 1px 3px hsl(28 23% 14% / .04);
}
body.dark{--canvas:hsl(24 15% 9%);--ink:hsl(27 25% 92%);--muted:hsl(25 13% 68%);--line:hsl(24 15% 23%);--clay:hsl(18 39% 59%);--wb-card:hsl(24 15% 12%);--wb-input:hsl(24 14% 30%);--wb-soft:hsl(24 15% 17%);--surface-subtle:var(--wb-card);--surface-hover:hsl(24 15% 15%);--surface-selected:hsl(22 23% 20%);--surface-table:var(--wb-soft);--surface-disabled:var(--line);--ink-disabled:var(--muted);--surface-shadow:none}
.page-rail{padding-top:28px}
.workspace-heading,.page-heading{margin-bottom:24px}
.workspace-heading h1,.page-heading h1{font-size:26px;font-weight:600;letter-spacing:-.015em}
.app-header{box-shadow:0 1px 0 #ffffff08}
.header-rail{min-height:70px}
.brand-cluster strong{font-weight:500}
.header-rail .nav-item{padding:7px 14px;font-size:16px}
.header-tools .user{color:var(--courier-header-text)}

/* Courier layout: independent input and async task cards on a shared rail. */
.workspace-layout{gap:24px;grid-template-columns:320px minmax(0,1fr);border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;align-items:start}
.workspace-layout .task-form-card{position:sticky;top:24px;border:1px solid var(--line);border-radius:10px;padding:24px;background:var(--wb-card);box-shadow:var(--surface-shadow)}
.workspace-layout .queue-card{border:1px solid var(--line);border-radius:10px;padding:24px;background:var(--wb-card);box-shadow:var(--surface-shadow);overflow:hidden;min-width:0}
.workspace-layout .season-picker:focus-within{z-index:45}
.season-list{overscroll-behavior:contain}
.form-toolbar{border:0;padding:0 0 22px;gap:10px}
.form-toolbar h2,.queue-heading h2,.history-card h2{font-size:18px;font-weight:600;letter-spacing:-.025em}
.text-button,.clear-finished{font-size:14px;color:var(--muted);opacity:1}
.text-button:hover,.clear-finished:hover:not(:disabled){opacity:1;color:var(--clay)}
.form-grid{padding:0;gap:20px}
.field label,.label-row label{font-size:13px;color:var(--muted);font-weight:500;margin-bottom:8px}
.field label b{font-weight:400;opacity:.8}
.field input{height:42px;border-color:var(--wb-input);background:var(--wb-card);border-radius:6px;font-size:15px;box-shadow:none}
.field input::placeholder{color:var(--muted);opacity:1}
.field input:hover:not(:focus){border-color:color-mix(in srgb,var(--wb-input) 70%,var(--muted))}
.style-field{border:0;padding:0;margin-top:24px}
.style-field .label-row label{margin-bottom:0}
.style-editor{margin-top:10px;min-height:48px;padding:6px 9px;border-radius:6px;box-shadow:none}
.style-editor .style-entry input{border:0;background:transparent;height:38px;padding:7px 3px}
.style-editor .chip{background:var(--surface-selected);border-color:transparent;padding:3px 4px 3px 8px;font-weight:500}
.style-editor .chip button:hover{background:var(--wb-card)}
.style-meta{margin-top:11px;font-size:13px}
.style-meta span:last-child{font-size:12px;opacity:1}
.task-form-card .form-footer{border:0;border-radius:0;background:transparent;margin:28px 0 0;padding:0}
.form-footer .primary-button{width:100%;height:42px;border-radius:6px;gap:10px;font-size:15px;box-shadow:none}
.form-footer .primary-button:disabled{box-shadow:none;opacity:1;background:var(--surface-disabled);color:var(--ink-disabled)}

.queue-heading{min-height:27px}
.count-badge{border:1px solid var(--line);border-radius:5px;background:var(--wb-soft);color:var(--ink);font-size:13px;font-weight:600;min-width:25px;height:24px;padding:0 6px}
.task-list-controls{margin:24px 0 2px;gap:18px;align-items:center}
.task-filters{border:0;border-radius:0;background:transparent;gap:17px;flex-wrap:nowrap}
.task-filters button,.task-filters button:first-child,.task-filters button:last-child{border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;padding:8px 0 12px;min-height:39px;font-size:14px;color:var(--muted);gap:6px;line-height:1.5}
.task-filters button.active,.task-filters button.active:hover{background:transparent;color:var(--ink);border-bottom-color:var(--wb-good);font-weight:600}
.task-filters button:hover{background:transparent;color:var(--ink)}
.task-filters button span{background:var(--surface-hover);color:var(--muted);border-radius:4px;font-size:12px;font-weight:400;padding:1px 4px;min-width:18px;text-align:center;opacity:1}
.task-filters button.active span{color:var(--clay);background:var(--surface-selected)}
.task-search-field{width:195px}
.task-search-field .task-search{height:38px;font-size:14px;border-color:var(--wb-input);background:var(--wb-card);border-radius:6px;box-shadow:none}
.task-search-field>svg{top:11px;width:15px;height:15px;opacity:.7}
.selection-toolbar{padding:9px 0 12px;min-height:50px;gap:10px}
.dark .selection-toolbar,.dark .count-badge{background:transparent}
.selection-toolbar label,.selection-toolbar .selection-count{font-size:13px}
.selection-toolbar:has(.selection-clear[hidden]) .selection-count,.selection-toolbar:has(.selection-clear[hidden]) .selection-download{display:none}
.selection-toolbar:has(.selection-clear:not([hidden])){background:var(--surface-selected);padding:8px 10px;border-radius:6px;margin:8px 0 10px}
.selection-toolbar .primary-button,.selection-toolbar .ghost-button{height:33px;font-size:13px}
.file-select,.selection-toolbar input{width:15px;height:15px;cursor:pointer}

.task-queue .table-wrap,.history-card .table-wrap{border:0;border-radius:0;min-height:250px;max-height:calc(100dvh - 340px)}
.task-table{min-width:735px}
.task-table th{font-size:13px;font-weight:600;color:var(--ink);background:var(--surface-table);padding:12px 10px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.task-table td{height:68px;padding:12px 10px;border-color:var(--line)}
.task-table th:first-child,.task-table td:first-child{padding-left:6px;width:30px}
.task-table th:last-child,.task-table td:last-child{padding-right:3px}
.task-table td:nth-child(2){min-width:135px}
.task-table td:nth-child(3){width:72px}
.task-table td:nth-child(4){min-width:100px}
.task-row:hover{background:var(--surface-hover)}
.task-row:is(.searching,.opening,.generating,.waiting,.checking){background:var(--surface-hover)}
.task-row:is(.searching,.opening,.generating,.waiting,.checking) .task-status{color:var(--clay)}
.task-row:has(.file-select:checked){background:var(--surface-selected)}
.style-link{font-size:16px;font-weight:600;letter-spacing:-.015em}
.row-meta{font-size:13px;margin-top:5px;color:var(--muted);opacity:1}
.style-difference{display:block;margin-top:5px;color:var(--wb-warn);font-size:13px;white-space:normal}
.style-difference b{font-weight:600}
.identity-warning{padding:15px 17px;margin-bottom:18px;border:1px solid color-mix(in srgb,var(--wb-warn) 45%,var(--line));border-radius:8px;background:var(--wb-warn-soft);color:var(--wb-warn);font-size:14px}
.identity-warning>strong{display:block;margin-bottom:10px;font-size:15px}
.identity-warning>div{display:flex;justify-content:space-between;gap:16px;margin-top:5px}
.identity-warning b{font-weight:600;overflow-wrap:anywhere}
.season-tag{background:transparent;border:0;padding:0;font-size:15px;font-weight:550;color:var(--ink)}
.task-status{font-size:14px;font-weight:500;padding:0;background:transparent!important;gap:6px}
.task-status.identity-mismatch{color:var(--wb-warn)}
.task-status.success{color:var(--wb-good)}.task-status.failed{color:var(--wb-bad)}
.task-status:not(:has(.status-pulse))::before{width:4px;height:4px;opacity:.8}
.row-checks{gap:6px}
.check-pill,.check-pill.present,.check-pill.not_found,.check-pill.review{background:transparent;color:var(--muted);padding:0;border:0;font-size:13px;line-height:1.5;gap:7px}
.check-pill b{font-size:13px;font-weight:500}
.check-pill::before{content:"";display:inline-block;width:7px;flex:none}
.check-pill.present::before{height:7px;width:4px;border-right:1.5px solid var(--wb-good);border-bottom:1.5px solid var(--wb-good);transform:rotate(45deg);margin:0 2px 3px 1px}
.check-pill.present b{color:var(--wb-good)}
.check-pill.not_found::before{height:1px;background:var(--muted);opacity:.65}
.check-pill.not_found b{color:var(--muted)}
.check-pill.review::before{height:4px;width:4px;border-radius:50%;background:var(--wb-warn);margin-left:1px;margin-right:2px}
.check-pill.review b{color:var(--wb-warn)}
.row-actions{gap:7px}
.row-actions .file-download{width:36px;height:36px;border-radius:6px;background:var(--clay)}
.row-actions .file-download svg{width:19px;height:19px}
.row-more{width:24px;opacity:1;color:var(--muted)}
.row-more:hover{background:transparent;opacity:1}
.row-retry{width:34px;height:34px;color:var(--muted)}
.row-retry:hover{color:var(--clay)}
.list-summary{font-size:13px;opacity:1;padding-top:15px;color:var(--muted)}
.history-card{padding:24px;border-radius:10px;border-color:var(--line);box-shadow:var(--surface-shadow)}
.history-card .task-list-controls{margin-top:22px}
.history-card .table-wrap{max-height:calc(100dvh - 330px)}

.task-details{border-color:var(--line);width:530px;box-shadow:-12px 0 45px #302b2710}
.detail-heading{padding:30px;border-color:var(--line)}
.detail-heading h2{font-size:27px;letter-spacing:-.03em}
.detail-heading span{font-size:13px}
.detail-close{background:transparent;border:1px solid var(--line);border-radius:7px}
.detail-body{padding:28px 30px;max-height:calc(100dvh - 124px)}
.detail-file{border:1px solid var(--line);background:var(--surface-subtle);padding:19px;border-radius:9px}
.detail-file p{font-size:14px;line-height:1.7}
.detail-section{margin-top:31px}
.detail-section h3{font-size:16px;letter-spacing:-.015em}
.detail-section .inspection-row{padding:13px 0;border-color:var(--line)}
.version-list{border-color:var(--line);border-radius:8px}
.version-row{padding:16px}
.detail-bottom{border-color:var(--line);margin-top:33px}
.dark .field input,.dark .style-editor,.dark .season-list{border-color:var(--wb-input)}
.dark .season-list button:hover,.dark .season-list .highlighted,.dark .season-list [aria-selected=true]{background:var(--surface-selected)}
@media(max-width:800px){.workspace-layout .task-form-card{position:static;border-radius:10px}.workspace-layout .queue-card{border-radius:10px}}

@media(max-width:1160px){.workspace-layout{grid-template-columns:280px minmax(0,1fr)}.workspace-layout .task-form-card{padding:24px 21px}.workspace-layout .queue-card{padding:24px 22px 20px}.task-search-field{width:100%}.task-filters{gap:18px}}
@media(max-width:1000px){.workspace-layout{grid-template-columns:260px minmax(0,1fr)}.task-filters{gap:13px}.task-filters button{font-size:14px}.task-queue .table-wrap{max-height:calc(100dvh - 390px)}}
@media(max-width:800px){.workspace-layout{grid-template-columns:1fr}.workspace-layout .task-form-card{position:static;border:1px solid var(--line);padding:23px}.workspace-layout .queue-card{padding:23px}.form-toolbar{padding-bottom:22px}.form-grid{gap:18px}.style-field{margin-top:23px}.task-form-card .form-footer{margin:23px 0 0;padding:0}.form-footer .primary-button{width:100%}.task-queue .table-wrap{max-height:65dvh}.task-list-controls{margin-top:20px}}
@media(max-width:540px){.page-rail{padding-top:27px}.workspace-heading,.page-heading{margin-bottom:21px}.workspace-heading h1,.page-heading h1{font-size:25px}.workspace-layout{border-radius:0;gap:16px}.workspace-layout .task-form-card,.workspace-layout .queue-card{padding:21px 18px}.form-grid{gap:13px}.form-toolbar h2,.queue-heading h2,.history-card h2{font-size:17px}.field label,.label-row label{font-size:13px}.form-toolbar{padding-bottom:21px}.style-editor{min-height:48px}.task-form-card .form-footer{margin:22px 0 0;padding:0}.task-list-controls{gap:12px;margin-top:17px}.task-filters{flex-wrap:wrap;gap:12px;border:0}.task-filters button,.task-filters button:first-child,.task-filters button:last-child{padding:7px 0 10px;min-height:34px;font-size:13px;border:0;border-bottom:2px solid transparent;border-radius:0!important}.task-filters button.active{border-bottom-color:var(--clay)}.task-filters button span{font-size:12px;padding:0 3px}.selection-toolbar{gap:7px}.selection-toolbar .selection-count{font-size:12px}.selection-toolbar .selection-clear,.selection-toolbar .queue-remove-selected{font-size:12px}.history-card{padding:21px 18px}.task-details{width:100%}.detail-heading{padding:23px 21px}.detail-body{padding:23px 21px}.detail-heading h2{font-size:25px}.task-queue .table-wrap{min-height:170px}}

.batch-list{display:flex;gap:9px;overflow-x:auto;padding:2px 0 16px;margin-bottom:4px;scrollbar-width:thin}.batch-card{min-width:215px;max-width:320px;flex-shrink:0;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:var(--wb-card);color:var(--ink);text-align:left;font:inherit;cursor:pointer}.batch-card strong{display:block;font-size:14px;font-weight:600;margin-bottom:6px}.batch-card strong span{font-size:12px;font-weight:400;color:var(--muted);margin-left:8px}.batch-card>span{font-size:13px;color:var(--muted)}.batch-card.active{border-color:var(--clay);background:var(--surface-selected)}.batch-card:focus-visible{outline:2px solid var(--clay);outline-offset:2px}.downloaded-label{display:block;font-size:12px;color:var(--muted);margin-top:5px}.task-table td:last-child{position:sticky;right:0;background:var(--wb-card);border-left:1px solid var(--line)}.task-table th:last-child{position:sticky;right:0;background:var(--wb-soft);z-index:1}.row-retry{min-width:32px;min-height:34px;display:inline-grid;place-items:center}.retry-error{color:var(--wb-bad);font-size:14px}.task-status.retrying{color:var(--wb-warn)}

/* Compact file-finding controls; task rows remain independent of submissions. */
.history-card #historyFilters{width:100%}.history-file-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%;padding:2px 0 10px}.history-file-filters .task-search-field{flex:1;min-width:180px;width:auto}.list-select{height:38px;max-width:100%;padding:0 34px 0 12px;border:1px solid var(--wb-input);border-radius:6px;background-color:var(--wb-card);color:var(--ink);font:inherit;font-size:14px;cursor:pointer}.list-select:focus-visible{outline:2px solid var(--clay);outline-offset:2px}.history-reset{margin-left:auto;white-space:nowrap}.queue-batch-filter{display:flex;align-items:center;gap:10px;margin:18px 0 4px}.queue-batch-filter label{font-size:13px;color:var(--muted);white-space:nowrap}.queue-batch-filter .list-select{flex:1;min-width:0}.queue-batch-filter[hidden]{display:none}@media(max-width:540px){.history-file-filters{gap:8px}.history-file-filters>.list-select{flex:1;min-width:0;width:calc(50% - 4px)}.history-file-filters .task-search-field{flex-basis:calc(100% - 50px);min-width:0}.history-reset{font-size:13px}.queue-batch-filter label{display:none}}

.history-header-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.history-header-actions .ghost-button{white-space:nowrap}

/* Keep the entire header above scrolling rows, including pinned action cells. */
.task-queue .table-wrap,.history-card .table-wrap{position:relative;isolation:isolate;padding:0}
.task-table{border-collapse:separate;border-spacing:0}
.task-table thead{position:sticky;top:0;z-index:3;background:var(--surface-table);box-shadow:0 -1px 0 var(--surface-table),0 1px 0 var(--line)}
.task-table thead th{position:relative;top:auto;z-index:auto;background:var(--surface-table)}
.task-table thead th:last-child{position:sticky;right:0;z-index:1;background:var(--surface-table)}
.task-table tbody td:last-child{z-index:1}

/* Transfer stages distinguish prepared files from downloads handed to the browser. */
.queue-heading #downloadReadyButton{margin-left:auto;height:36px;padding:0 12px;font-size:14px;white-space:nowrap;box-shadow:none}.queue-heading .clear-finished{margin-left:0;font-size:12px}.last-download{display:flex;align-items:center;gap:10px;background:var(--wb-good-soft);border:1px solid color-mix(in srgb,var(--wb-good) 18%,var(--line));border-radius:6px;padding:11px 12px;margin:18px 0 8px;font-size:14px}.last-download[hidden]{display:none}.last-download small{margin-left:8px;font-size:12px;color:var(--muted)}.last-download .text-button{margin-left:auto;flex:none}.receipt-check{color:var(--wb-good);font-weight:600;flex:none}.new-ready-badge{display:inline-block;font-size:11px;font-weight:500;color:var(--wb-good);background:var(--wb-good-soft);border-radius:4px;padding:2px 5px;margin-left:7px;white-space:nowrap}.download-receipts{max-height:calc(100dvh - 390px);min-height:240px;overflow:auto}.download-receipt{border-bottom:1px solid var(--line);padding:0}.download-receipt summary{list-style:none;display:flex;align-items:center;gap:12px;padding:17px 5px;cursor:pointer}.download-receipt summary::-webkit-details-marker{display:none}.receipt-title{display:flex;flex:1;flex-direction:column;min-width:0;gap:4px}.receipt-title strong{font-size:14px;font-weight:500}.receipt-title small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.receipt-toggle{font-size:12px;color:var(--clay);flex:none}.receipt-files{display:flex;flex-wrap:wrap;gap:8px;padding:0 4px 17px 27px}.receipt-files>span{font-size:12px;color:var(--muted);padding:6px 8px;background:var(--wb-soft);border-radius:4px}.receipt-files b{font-weight:500;color:var(--ink);margin-right:6px}.transfer-empty{min-height:230px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;color:var(--muted);font-size:13px}.transfer-empty strong{font-size:15px;font-weight:500}.task-row:has(.new-ready-badge){background:color-mix(in srgb,var(--wb-good-soft) 40%,var(--wb-card))}@media(max-width:540px){.queue-heading{flex-wrap:wrap}.queue-heading #downloadReadyButton{height:36px;font-size:13px}.queue-heading .clear-finished{width:100%;text-align:right}.last-download{flex-wrap:wrap;font-size:13px}.last-download small{display:block;margin:4px 0 0}.last-download .text-button{font-size:12px}.download-receipts{max-height:60dvh}.receipt-title strong{font-size:13px}}

.queue-heading #activeCount{display:none}

/* Only running transfers need a progress track; completed files stay quiet. */
.preparation-result{display:inline-flex;align-items:center;gap:7px;font-size:13px;line-height:1.5;white-space:nowrap;color:var(--muted)}
.preparation-result svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;flex:none}
.preparation-result.ready{color:var(--wb-good)}.preparation-result.failed{color:var(--wb-bad)}
.preparation-progress{width:104px;max-width:100%;min-width:88px;font-size:12px;line-height:1.5;color:var(--muted)}
.preparation-track{position:relative;height:3px;margin-top:7px;overflow:hidden;border-radius:3px;background:var(--line)}
.preparation-track i{position:absolute;inset:0 auto 0 0;width:38%;border-radius:inherit;background:var(--clay);animation:preparationSlide 2s ease-in-out infinite}
.preparation-progress.queued .preparation-track i{width:12%;background:var(--wb-input);animation:none}
@keyframes preparationSlide{0%{transform:translateX(-105%)}100%{transform:translateX(365%)}}
@media(prefers-reduced-motion:reduce){.preparation-track i{animation:none;left:30%}}
