/* Reuse the workspace palette, model selector, modal card and download controls. */
.upscale-page {width:100%;min-width:0;color:var(--text)}
.upscale-heading,.upscale-section-title,.upscale-results-head,.upscale-task-top,.upscale-task-meta,.upscale-task-actions,.upscale-price {display:flex;align-items:center;justify-content:space-between;gap:12px}
.upscale-heading {margin-bottom:20px}
.upscale-heading h1 {font-size:25px;line-height:1.3;margin:0 0 7px;font-weight:650}
.upscale-heading p {color:var(--muted);margin:0;font-size:14px;line-height:1.7}
.upscale-composer {display:flex;flex-direction:column;gap:20px}
.upscale-panel {min-width:0}
.upscale-section-title {margin-bottom:14px}
.upscale-section-title h2,.upscale-results-head h2 {font-size:17px;font-weight:600;margin:0}
.upscale-section-title>span {font-size:13px;color:var(--muted)}
.upscale-drop {min-height:112px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px dashed var(--border);border-radius:8px;background:var(--field-bg);cursor:pointer;font-size:15px}
.upscale-drop>span:last-child {color:var(--muted);font-size:13px}
.upscale-upload-icon {font-size:24px;line-height:1}
.upscale-drop:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
.upscale-drop[aria-disabled=true] {opacity:.55;cursor:wait}
.upscale-source-actions,.upscale-tools,.upscale-filters {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.upscale-source-actions {margin-top:12px}
.upscale-page button {font-size:14px;min-height:38px}
.upscale-source-actions button:last-child {margin-left:auto}
.upscale-queue {list-style:none;counter-reset:upscale-video;margin:14px 0 0;padding:0;max-height:176px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.upscale-queue:empty {display:none}
.upscale-queue li {display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border);min-width:0}
.upscale-queue li::before {counter-increment:upscale-video;content:counter(upscale-video);flex:none;min-width:18px;text-align:center;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
.upscale-queue li:last-child {border-bottom:0}
.upscale-queue .upscale-queue-cover {width:88px;min-height:0;padding:0;border:1px solid var(--border);background:var(--field-bg);font-size:23px}
.upscale-queue-copy {flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.upscale-queue-copy strong,.upscale-queue-copy>span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upscale-queue-copy strong {font-size:14px;font-weight:550;line-height:1.4}
.upscale-queue-copy>span {font-size:12px;line-height:1.5;color:var(--muted)}
.upscale-queue-origin {font-size:11px;color:var(--muted);background:var(--field-bg);border-radius:4px;padding:3px 6px;white-space:nowrap}
.upscale-queue .upscale-queue-remove {padding:0;min-height:30px;width:30px;flex:none;color:var(--muted);border-color:transparent;background:transparent;font-size:19px}
.upscale-queue .upscale-queue-remove:hover {color:var(--text);background:var(--field-bg)}
@media(max-width:600px) {
  .upscale-queue li {gap:8px}
  .upscale-queue .upscale-queue-cover {width:72px}
  .upscale-queue-origin {display:none}
}
.upscale-settings {display:flex;flex-direction:column}
.upscale-settings>label {display:flex;flex-direction:column;gap:8px;margin-bottom:12px;font-size:14px;font-weight:550;min-width:0}
.upscale-settings select,.upscale-settings .model-series-trigger {width:100%;min-height:42px;font-size:14px}
.upscale-price {font-size:14px;padding:3px 0}
.upscale-price>strong {font-size:18px;font-weight:600}
.upscale-billing {font-size:13px;color:var(--muted);line-height:1.6;margin:8px 0 14px}
.upscale-submit {display:flex;flex-direction:column;gap:12px}.upscale-submit>strong {text-align:center}
.upscale-submit>strong {font-size:13px;font-weight:500;flex:1}
.upscale-submit>.primary {min-height:42px;min-width:126px}
.upscale-settings>[data-up-recover] {margin-top:12px}
.upscale-message {font-size:13px;color:var(--muted);line-height:1.65;margin:10px 0}
.upscale-message:empty {display:none}
.upscale-results {min-width:0}
.upscale-results-toolbar {flex:none;border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:16px}
.upscale-results-head {margin-bottom:12px;flex-wrap:wrap}
.upscale-results-head h2 span {font-size:13px;color:var(--muted);font-weight:400;margin-left:8px}
.upscale-filters {gap:3px}
.upscale-filters button {border-color:transparent;background:transparent;color:var(--muted);padding:7px 12px}
.upscale-filters button[aria-pressed=true] {background:var(--field-bg);color:var(--text)}
.upscale-tools {font-size:13px;color:var(--muted)}
.upscale-tools>label {display:flex;align-items:center;gap:7px}
.upscale-tools>[data-up-download] {margin-left:auto}
.upscale-results-scroll {min-width:0}
.upscale-grid {align-content:start}
.upscale-task {border:1px solid var(--border);border-radius:var(--radius);padding:14px;min-width:0;background:var(--surface)}
.upscale-task-top {font-size:13px;margin-bottom:10px}
.upscale-task-top label {display:flex;align-items:center;gap:6px}
.upscale-task-top>span {color:var(--muted)}
.upscale-task-preview {position:relative;width:100%;height:176px;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:var(--field-bg);border:0;border-radius:7px}
.upscale-task-preview>span {font-size:27px;z-index:1}.upscale-task-preview .task-cover {position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.upscale-task-preview:has(.task-cover[data-cover-loaded="1"])>span {background:#0008;color:#fff;border-radius:50%;width:40px;height:40px;display:grid;place-items:center}.upscale-task-preview:has(.task-cover[data-cover-loaded="1"]) small {display:none}
.upscale-task-preview small {font-size:13px;color:var(--muted)}
.upscale-task-preview:disabled {opacity:1;cursor:default}
.upscale-task h3 {font-size:14px;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:13px 0 8px}
.upscale-task-meta {font-size:13px;color:var(--muted)}
.upscale-task-meta>span:first-child {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upscale-task-meta>span:last-child {white-space:nowrap}
.upscale-task time {font-size:12px;color:var(--muted);display:block;margin:8px 0 12px}
.upscale-task-error {font-size:13px;line-height:1.6;overflow-wrap:anywhere;color:var(--muted)}
.upscale-task-actions button:first-child {flex:1}
.upscale-empty {text-align:center;padding:48px 16px;color:var(--muted);font-size:14px;line-height:1.7}
.upscale-source-dialog {width:min(760px,calc(100vw - 32px));max-height:80dvh;color:var(--text)}
.upscale-source-dialog::backdrop {background:rgba(0,0,0,.48)}
.upscale-source-dialog header {display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}
.upscale-source-dialog h2 {font-size:19px;margin:0}
.upscale-source-dialog header p {font-size:13px;color:var(--muted);margin:8px 0 0;line-height:1.7}
.upscale-source-dialog [data-list] {max-height:48dvh;overflow:auto;overscroll-behavior:contain;font-size:14px}
.upscale-source-row {display:flex;align-items:center;gap:14px;width:100%;text-align:left;margin:8px 0;padding:12px;border:1px solid var(--border);border-radius:8px;background:var(--field-bg);cursor:pointer;font-size:14px;line-height:1.6;min-width:0}
.upscale-source-row.is-selected {border-color:var(--accent)}
.upscale-source-cover {position:relative;display:flex;align-items:center;justify-content:center;flex:none;width:136px;aspect-ratio:16/9;overflow:hidden;border-radius:5px;background:var(--surface);color:var(--muted);font-size:12px}
.upscale-source-cover .task-cover {position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.upscale-source-copy {display:flex;flex-direction:column;flex:1;min-width:0;gap:4px}
.upscale-source-copy strong {font-weight:500;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.upscale-source-copy>span,.upscale-source-copy time {color:var(--muted);font-size:12px}
.upscale-source-check {display:flex;align-items:center;gap:6px;flex:none;font-size:12px;color:var(--muted)}
.upscale-source-dialog footer {display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:16px;margin-top:16px;border-top:1px solid var(--border);font-size:14px}
@media(max-width:500px) {
  .upscale-source-row {gap:10px;padding:10px;flex-wrap:wrap}
  .upscale-source-cover {width:96px}
  .upscale-source-check {margin-left:auto}
}
@media(min-width:901px) {
  .app-shell:has(>#upscalePage:not(.hidden)) {height:100dvh;min-height:0;overflow:hidden}
  #upscalePage:not(.hidden) {display:flex;flex-direction:column;flex:1;min-height:0}
  .upscale-heading {flex:none}
}
@media(max-width:900px) {
  .upscale-heading {align-items:flex-start}
  .upscale-tools>[data-up-download] {margin-left:0}
}
@media(max-width:500px) {
  .upscale-grid {grid-template-columns:1fr;gap:14px}
  .upscale-task {padding:10px}
  .upscale-task-preview {height:auto;aspect-ratio:16/10;min-height:176px}
  .upscale-task-actions,.upscale-task-meta {flex-wrap:wrap;gap:5px}
  .upscale-task-actions button {font-size:13px}
  .upscale-heading p {font-size:13px}
  .upscale-tools {gap:6px}
  .upscale-source-actions button:last-child {margin-left:0}
}
.upscale-queue-play {position:relative;z-index:1;display:flex;align-items:center;gap:4px}
.upscale-queue-play small {font-size:11px}
.upscale-queue-cover:has(.task-cover[data-cover-loaded="1"]) .upscale-queue-play {background:#0009;color:#fff;border-radius:4px;padding:2px 6px}
