/* Pictag.ai AI Tools v1.5.43 */
/* Integrated workspace: same app-space behavior as the Bulk Image Tagger. */
body.upscaler-focus .main{margin-left:0!important;transition:none!important}
body.upscaler-focus .sidebar{z-index:220;pointer-events:auto}
body.upscaler-focus .sidebar.show{transform:translateX(0)!important;box-shadow:16px 0 42px rgba(0,0,0,.28)}
body.upscaler-focus .sidebar-overlay{display:block;z-index:210;opacity:0;pointer-events:none}
body.upscaler-focus .sidebar-overlay.show{opacity:1;pointer-events:all}
body.upscaler-focus .header-sidebar-toggle{display:flex}
body.upscaler-focus .input-area{display:none}
body.upscaler-focus .chat-container{overflow-y:auto;scroll-behavior:auto}
#upscalerWorkspaceHost{display:none;width:100%;min-width:0}
#upscalerWorkspaceHost.is-active{display:block}
#upscaler-msg{padding:12px 0 28px}
#upscaler-msg>.message-content{max-width:none;width:100%;padding:0 24px}
#upscaler-msg .message-body{width:100%}
#upscaler-msg .message-text{white-space:normal}

.upscaler-workspace{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:14px;align-items:start;margin-top:14px}
.upscaler-main{min-width:0}
.upscaler-settings-sidebar{position:sticky;top:12px;max-height:calc(100vh - 96px);overflow:auto;padding:14px;border:1px solid var(--border-color);border-radius:var(--radius-md);background:var(--bg-secondary)}
.upscaler-settings-section{padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid var(--border-color)}
.upscaler-settings-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.upscaler-settings-title{font-size:12px;font-weight:600;color:var(--text-primary);margin-bottom:9px}
.upscaler-hint{font-size:10.5px;line-height:1.45;color:var(--text-secondary);margin-top:7px}
.upscaler-dropzone{border:1px dashed var(--border-color);border-radius:var(--radius-md);background:var(--bg-secondary);color:var(--text-secondary);padding:26px 18px;text-align:center;cursor:pointer;transition:.15s ease}
.upscaler-dropzone:hover,.upscaler-dropzone.drag{border-color:var(--accent-color);background:var(--bg-hover);color:var(--text-primary)}
.upscaler-drop-icon{opacity:.6;margin-bottom:7px}
.upscaler-drop-title{font-size:14px;font-weight:600;color:var(--text-primary)}
.upscaler-drop-copy{font-size:11px;margin-top:5px}
.upscaler-toolbar{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0 8px;font-size:11px;color:var(--text-secondary)}
.upscaler-thumb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,160px));gap:10px;align-items:start;max-width:100%}
.upscaler-thumb{width:160px;min-width:0;overflow:hidden;padding:0;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;text-align:left}
.upscaler-thumb:hover,.upscaler-thumb.is-selected{border-color:var(--accent-color)}
.upscaler-thumb.is-selected{box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-color) 22%,transparent)}
.upscaler-thumb.is-processing{border-color:var(--accent-color)}
.upscaler-thumb.is-done{border-color:var(--success-text)}
.upscaler-thumb.is-failed{border-color:var(--error-text)}
.upscaler-thumb-media{position:relative;display:block;width:100%;height:106px;overflow:hidden;background:var(--bg-primary)}
.upscaler-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.upscaler-thumb-index{position:absolute;left:6px;top:6px;min-width:22px;height:20px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px;border-radius:999px;background:rgba(0,0,0,.72);color:#fff;font-size:10px;font-weight:700;z-index:5}
.upscaler-thumb-remove{position:absolute;top:0;right:0;width:42px;height:42px;display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:#fff;cursor:pointer;z-index:4;border-radius:999px}
.upscaler-thumb-remove-circle{width:30px;height:30px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.72);color:#fff;transition:background .12s,transform .12s}
.upscaler-thumb-remove:hover .upscaler-thumb-remove-circle,.upscaler-thumb-remove:focus-visible .upscaler-thumb-remove-circle{background:rgba(0,0,0,.86);transform:scale(1.04)}
.upscaler-thumb-remove:focus-visible{outline:2px solid #fff;outline-offset:-4px}
.upscaler-thumb-remove svg{width:16px;height:16px;pointer-events:none}
.upscaler-thumb-status{position:absolute;left:5px;right:5px;bottom:5px;padding:3px 5px;border-radius:6px;background:rgba(0,0,0,.72);color:#fff;font-size:8.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upscaler-thumb-name{display:block;padding:7px 8px 4px;font-size:10px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upscaler-thumb-controls{display:grid;grid-template-columns:auto 1fr;gap:6px;align-items:center;padding:0 8px 6px}
.upscaler-thumb-target{width:100%;min-width:0;border:1px solid var(--border-color);background:var(--bg-primary);color:var(--text-primary);border-radius:8px;padding:5px 7px;font:inherit;font-size:10px}
.upscaler-thumb-target-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800;letter-spacing:.03em;border:1px solid var(--border-color);white-space:nowrap}
.upscaler-thumb-target-badge.is-global{color:var(--text-secondary);background:var(--bg-primary)}
.upscaler-thumb-target-badge.is-custom{color:var(--accent-color);border-color:color-mix(in srgb,var(--accent-color) 40%, var(--border-color));background:color-mix(in srgb,var(--accent-color) 8%, transparent)}
.upscaler-thumb-plan{display:block;padding:0 8px 8px;font-size:9px;line-height:1.35;color:var(--text-secondary)}
.upscaler-thumb-check{position:absolute;left:34px;top:6px;z-index:5;width:22px;height:20px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.upscaler-thumb-check input{position:absolute;opacity:0;pointer-events:none}
.upscaler-thumb-check-box{width:18px;height:18px;border-radius:999px;border:1px solid rgba(255,255,255,.88);background:rgba(0,0,0,.56);box-shadow:0 0 0 1px rgba(0,0,0,.08) inset}
.upscaler-thumb-check input:checked + .upscaler-thumb-check-box{background:var(--accent-color);border-color:var(--accent-color);position:relative}
.upscaler-thumb-check input:checked + .upscaler-thumb-check-box::after{content:"";position:absolute;left:5px;top:2px;width:5px;height:9px;border:2px solid #fff;border-left:0;border-top:0;transform:rotate(45deg)}
.upscaler-thumb.is-checked{box-shadow:0 0 0 1px color-mix(in srgb,var(--accent-color) 12%, transparent)}
.upscaler-scale-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.upscaler-scale-btn{border:1px solid var(--border-color);border-radius:8px;padding:8px;background:var(--bg-primary);color:var(--text-secondary);cursor:pointer;font:inherit;font-size:12px;font-weight:700}
.upscaler-scale-btn.active{border-color:var(--accent-color);color:var(--accent-color);background:color-mix(in srgb,var(--accent-color) 7%,var(--bg-primary))}
.upscaler-batch-count{font-size:11px;color:var(--text-secondary);margin-bottom:9px;line-height:1.45}
.upscaler-processing-card{padding:10px;border:1px solid var(--border-color);border-radius:var(--radius-sm);background:var(--bg-primary);margin-bottom:14px}
.upscaler-progress-head{display:flex;justify-content:space-between;gap:8px;font-size:11px;margin-bottom:7px}
.upscaler-processing-file{margin-top:7px;font-size:10.5px;line-height:1.4;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis}
.upscaler-actions{display:none}
.upscaler-actions.show{display:block}
.upscaler-actions .settings-btn{display:block;width:100%;border:1px solid var(--border-color);padding:8px 10px;margin-top:7px}
.upscaler-actions .settings-btn:disabled{opacity:.45;cursor:not-allowed}

.upscaler-compare-card{margin-top:14px;border:1px solid var(--border-color);border-radius:var(--radius-md);overflow:hidden;background:var(--bg-secondary)}
.upscaler-compare-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:9px 11px;border-bottom:1px solid var(--border-color);font-size:11px;color:var(--text-secondary)}
.upscaler-compare-head strong{color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upscaler-compare{position:relative;width:100%;height:min(62vh,620px);min-height:340px;background:#0c0c0e;overflow:hidden;--split:50%}
.upscaler-compare img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center center;user-select:none;pointer-events:none}
.upscaler-after{z-index:2;clip-path:inset(0 50% 0 0)}
.upscaler-before{z-index:1}
.upscaler-slider-line{position:absolute;z-index:4;top:0;bottom:0;left:50%;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.35);pointer-events:none}.upscaler-slider-handle{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:28px;height:28px;border-radius:999px;border:2px solid #fff;background:rgba(0,0,0,.68);box-shadow:0 10px 26px rgba(0,0,0,.35)}
.upscaler-compare input[type=range]{position:absolute;z-index:6;inset:0;width:100%;height:100%;opacity:0;cursor:ew-resize;-webkit-appearance:none;appearance:none;background:transparent}.upscaler-compare input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:1px;height:1px;opacity:0}.upscaler-compare input[type=range]::-moz-range-thumb{width:1px;height:1px;opacity:0;border:0}.upscaler-compare input[type=range]::-webkit-slider-runnable-track{background:transparent}.upscaler-compare input[type=range]::-moz-range-track{background:transparent;border:0}
.upscaler-preview-label{position:absolute;top:10px;z-index:5;padding:4px 7px;border-radius:6px;background:rgba(0,0,0,.65);color:#fff;font-size:9px;font-weight:800;letter-spacing:.05em}
.upscaler-preview-label.before{left:10px}.upscaler-preview-label.after{right:10px}


@media(max-width:900px){
  .upscaler-workspace{grid-template-columns:1fr}
  .upscaler-settings-sidebar{position:static;max-height:none}
}
@media(max-width:760px){
  #upscaler-msg>.message-content{padding:0 12px}
  .upscaler-thumb-grid{grid-template-columns:repeat(auto-fill,minmax(136px,136px))}
  .upscaler-thumb{width:136px}.upscaler-thumb-media{height:90px}
  .upscaler-compare{min-height:300px;height:52vh}
}

.upscaler-target-preview{margin-top:7px;padding:8px 10px;border:1px solid var(--border-color);border-radius:10px;background:var(--bg-primary);font-size:11px;line-height:1.45;color:var(--text-primary)}

#pictagUpscaleThumbs{overflow-x:hidden}.pictag-upscaler-card-icon{width:22px;height:22px;display:block;color:var(--text-secondary);background:none!important;border:0!important;box-shadow:none!important}

[data-pictag-upscaler-card] .feature-icon{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--text-secondary)!important}
[data-pictag-upscaler-card] .feature-icon svg{fill:none!important;stroke:currentColor!important}

.upscaler-select-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}.upscaler-select-row .settings-btn{border:1px solid var(--border-color);padding:8px 10px;width:100%}

/* v1.5.6 range selection */
.upscaler-thumb:focus-visible{outline:2px solid var(--accent-color);outline-offset:2px}

/* v1.5.6-r2 selection placement hardening */
.upscaler-thumb-index{left:6px!important;top:6px!important}.upscaler-thumb-check{left:34px!important;top:6px!important}.upscaler-thumb-remove{right:0!important;top:0!important}


/* v1.5.7 usability + accessibility sizing pass */
.upscaler-settings-sidebar{
    width:auto;
    padding:18px;
    font-size:14px;
}
.upscaler-settings-section{
    padding-bottom:16px;
    margin-bottom:16px;
}
.upscaler-settings-title{
    font-size:14px;
    line-height:1.35;
    font-weight:700;
    margin-bottom:10px;
}
.upscaler-settings-sidebar .form-input,
.upscaler-settings-sidebar select,
.upscaler-settings-sidebar button.settings-btn,
.upscaler-settings-sidebar .switch-banner-btn{
    min-height:42px;
    font-size:14px;
    line-height:1.25;
}
.upscaler-settings-sidebar .form-input,
.upscaler-settings-sidebar select{
    padding:9px 12px;
}
.upscaler-settings-sidebar button.settings-btn,
.upscaler-settings-sidebar .switch-banner-btn{
    padding:10px 12px !important;
}
.upscaler-hint{
    font-size:13px;
    line-height:1.4;
}
.upscaler-batch-count{
    font-size:13px;
    line-height:1.4;
    margin-bottom:10px;
}
.upscaler-processing-card{
    padding:13px;
}
.upscaler-progress-head{
    font-size:13px;
    margin-bottom:9px;
}
.upscaler-processing-file{
    font-size:12px;
    line-height:1.45;
    margin-top:8px;
}
.upscaler-toolbar{
    font-size:13px;
    line-height:1.4;
    margin:14px 0 10px;
}
.upscaler-dropzone{
    padding:30px 20px;
}
.upscaler-drop-title{
    font-size:16px;
    line-height:1.35;
}
.upscaler-drop-copy{
    font-size:13px;
    line-height:1.4;
    margin-top:6px;
}
.upscaler-thumb-grid{
    grid-template-columns:repeat(auto-fill,minmax(176px,176px));
    gap:11px;
}
.upscaler-thumb{
    width:176px;
}
.upscaler-thumb-media{
    height:118px;
}
.upscaler-thumb-index{
    min-width:24px;
    height:22px;
    font-size:11px;
}
.upscaler-thumb-check{
    left:38px !important;
    width:26px;
    height:22px;
}
.upscaler-thumb-check-box{
    width:20px;
    height:20px;
}
.upscaler-thumb-check input:checked + .upscaler-thumb-check-box::after{
    left:6px;
    top:3px;
}
.upscaler-thumb-status{
    font-size:10.5px;
    padding:4px 6px;
}
.upscaler-thumb-name{
    padding:8px 9px 5px;
    font-size:12px;
    line-height:1.35;
}
.upscaler-thumb-controls{
    padding:0 9px 7px;
    gap:7px;
}
.upscaler-thumb-target{
    min-height:36px;
    font-size:12px;
    padding:7px 8px;
}
.upscaler-thumb-target-badge{
    font-size:10.5px;
    padding:5px 8px;
}
.upscaler-thumb-plan{
    padding:0 9px 9px;
    font-size:11px;
    line-height:1.4;
}
.upscaler-compare-head{
    font-size:13px;
    padding:11px 13px;
}
.upscaler-preview-label{
    font-size:10.5px;
    padding:5px 8px;
}
    min-height:38px;
    font-size:13px;
}
    font-size:11px;
}
.upscaler-target-preview{
    display:none !important;
}
@media(max-width:760px){
    .upscaler-thumb-grid{grid-template-columns:repeat(auto-fill,minmax(148px,148px))}
    .upscaler-thumb{width:148px}
    .upscaler-thumb-media{height:104px}
}


/* v1.5.8 selected-only processing + Pictag fuchsia action state */
.upscaler-run-btn{
    background:#d70053 !important;
    border-color:#d70053 !important;
    color:#fff !important;
    opacity:1 !important;
    font-weight:700 !important;
}
.upscaler-run-btn:hover:not(:disabled){
    background:#ed0a65 !important;
    border-color:#ed0a65 !important;
}
.upscaler-run-btn:active:not(:disabled){
    background:#a90041 !important;
    border-color:#a90041 !important;
    transform:translateY(1px);
}
.upscaler-run-btn.is-processing,
.upscaler-run-btn.is-processing:disabled{
    background:#a90041 !important;
    border-color:#a90041 !important;
    color:#fff !important;
    opacity:1 !important;
    cursor:wait !important;
}
.upscaler-thumb.is-processing{
    border-color:#d70053 !important;
    box-shadow:0 0 0 2px rgba(215,0,83,.28) !important;
}


.upscaler-actions{display:block !important}





/* v1.5.12: fuchsia border tracks actual selection state */
.upscaler-thumb,
.upscaler-thumb.is-selected,
.upscaler-thumb.is-done,
.upscaler-thumb.is-failed{
    border-color:var(--border-color) !important;
    box-shadow:none !important;
}
.upscaler-thumb:hover,
.upscaler-thumb.is-checked{
    border-color:#d70053 !important;
}
.upscaler-thumb.is-checked{
    box-shadow:0 0 0 2px rgba(215,0,83,.28) !important;
}
.upscaler-thumb.is-processing{
    border-color:#d70053 !important;
    box-shadow:0 0 0 2px rgba(215,0,83,.28) !important;
}


/* v1.5.13 compact fixed-control sidebar + per-image progress */
.upscaler-settings-sidebar{
    position:sticky !important;
    top:54px !important;
    align-self:start !important;
    max-height:none !important;
    overflow:visible !important;
    padding:15px !important;
}
.upscaler-settings-section{
    padding-bottom:13px !important;
    margin-bottom:13px !important;
}
.upscaler-select-toggle{
    width:100% !important;
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    text-align:center !important;
}
.upscaler-select-row{display:none !important;}

.upscaler-actions .settings-btn:not(:disabled){
    border:1px solid #d70053 !important;
    color:#d70053 !important;
    background:transparent !important;
}
.upscaler-actions .settings-btn:not(:disabled):hover,
.upscaler-actions .settings-btn:not(:disabled):focus,
.upscaler-actions .settings-btn:not(:disabled):focus-visible{
    background:#d70053 !important;
    border-color:#d70053 !important;
    color:#fff !important;
}
.upscaler-actions .settings-btn:not(:disabled):active{
    background:#a90041 !important;
    border-color:#a90041 !important;
    color:#fff !important;
}
.upscaler-actions .settings-btn:disabled{
    border:1px solid color-mix(in srgb,#d70053 35%,var(--border-color)) !important;
    color:var(--text-secondary) !important;
    background:transparent !important;
    opacity:.48 !important;
}

.upscaler-thumb-status{display:none !important;}
.upscaler-thumb-progress{
    padding:7px 9px 0;
}
.upscaler-thumb-progress-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    min-height:16px;
    color:var(--text-secondary);
    font-size:10.5px;
    line-height:1.2;
    font-weight:700;
}
.upscaler-thumb-progress-track{
    position:relative;
    width:100%;
    height:5px;
    margin-top:5px;
    overflow:hidden;
    border-radius:999px;
    background:color-mix(in srgb,var(--text-secondary) 22%,transparent);
}
.upscaler-thumb-progress-track > span{
    position:absolute;
    inset:0 auto 0 0;
    width:0;
    border-radius:inherit;
    background:#d70053;
    transition:width .18s ease;
}
.upscaler-thumb-progress.is-error .upscaler-thumb-progress-row{
    color:#f59e0b;
}
.upscaler-thumb-progress.is-error .upscaler-thumb-progress-track > span{
    background:#f59e0b !important;
}
.upscaler-thumb-progress.is-complete .upscaler-thumb-progress-track > span,
.upscaler-thumb-progress.is-processing .upscaler-thumb-progress-track > span{
    background:#d70053 !important;
}

/* Failure is indicated by the orange progress bar, not an orange card outline. */
.upscaler-thumb.is-failed{
    border-color:var(--border-color) !important;
    box-shadow:none !important;
}
.upscaler-thumb.is-failed:hover,
.upscaler-thumb.is-failed.is-checked{
    border-color:#d70053 !important;
}
.upscaler-thumb.is-failed.is-checked{
    box-shadow:0 0 0 2px rgba(215,0,83,.28) !important;
}

/* Keep controls visible on desktop; mobile returns to normal document flow. */
@media(min-width:901px){
    .upscaler-settings-sidebar{
        top:58px !important;
        max-height:calc(100vh - 70px) !important;
        overflow:visible !important;
    }
}
@media(max-width:900px){
    .upscaler-settings-sidebar{
        position:static !important;
        max-height:none !important;
        overflow:visible !important;
    }
}


/* v1.5.14 sidebar polish */
.upscaler-select-toggle,
.upscaler-select-toggle.settings-btn{
    width:100% !important;
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    text-align:center !important;
    border:1px solid #d70053 !important;
    color:#d70053 !important;
    background:transparent !important;
}
.upscaler-select-toggle:hover,
.upscaler-select-toggle:focus,
.upscaler-select-toggle:focus-visible{
    background:#d70053 !important;
    color:#fff !important;
    border-color:#d70053 !important;
}
.upscaler-select-toggle:active{
    background:#a90041 !important;
    color:#fff !important;
    border-color:#a90041 !important;
}
.upscaler-settings-sidebar .settings-btn{
    border-radius:10px !important;
}
.upscaler-settings-sidebar .settings-btn:disabled{
    opacity:.52 !important;
}


/* v1.5.15 exact compact sidebar layout */
.upscaler-settings-sidebar{
    padding:16px !important;
}
.upscaler-settings-section{
    border-bottom:0 !important;
    padding-bottom:0 !important;
    margin-bottom:26px !important;
}
.upscaler-settings-section:last-child{
    margin-bottom:0 !important;
}
.upscaler-settings-title{
    margin-bottom:10px !important;
}

/* Keep every standard sidebar action centered. */
.upscaler-settings-sidebar button.settings-btn,
.upscaler-settings-sidebar .switch-banner-btn{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;
}
.upscaler-select-toggle,
.upscaler-select-toggle.settings-btn{
    width:100% !important;
    border:1px solid #d70053 !important;
    color:#d70053 !important;
    background:transparent !important;
}
.upscaler-select-toggle:hover,
.upscaler-select-toggle:focus,
.upscaler-select-toggle:focus-visible{
    background:#d70053 !important;
    border-color:#d70053 !important;
    color:#fff !important;
}
.upscaler-select-toggle:active{
    background:#a90041 !important;
    border-color:#a90041 !important;
    color:#fff !important;
}

/* Move dropdown chevrons slightly left from the edge. */
.upscaler-settings-sidebar select.form-input,
.upscaler-settings-sidebar select{
    -webkit-appearance:none !important;
    appearance:none !important;
    padding-right:42px !important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c7c7cf' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat:no-repeat !important;
    background-position:right 16px center !important;
    background-size:14px 14px !important;
}

/* The three batch-assignment controls use the same centered geometry. */
#pictagUpscaleApplySelected,
#pictagUpscaleResetSelected,
#pictagUpscaleClear{
    justify-content:center !important;
    text-align:center !important;
}



/* v1.5.36 sidebar geometry */
@media(min-width:901px){
    .upscaler-settings-sidebar{
        position:fixed !important;
        top:122px !important;
        right:22px !important;
        width:290px !important;
        max-height:none !important;
        overflow:visible !important;
        z-index:90 !important;
        align-self:auto !important;
    }
}

/* One consistent button radius across the entire sidebar. */
.upscaler-settings-sidebar button.settings-btn,
.upscaler-settings-sidebar .switch-banner-btn,
.upscaler-settings-sidebar .upscaler-run-btn{
    border-radius:6px !important;
}

/* Restored batch target action. */
#pictagUpscaleApplySelected{
    display:flex !important;
    visibility:visible !important;
    width:100% !important;
    height:auto !important;
    min-height:42px !important;
    margin-top:7px !important;
    padding:10px 12px !important;
    border:1px solid var(--border-color) !important;
    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;
    overflow:visible !important;
}

#pictagUpscaleSelectAll,
#pictagUpscaleResetSelected,
#pictagUpscaleClear{
    justify-content:center !important;
    text-align:center !important;
}

@media(max-width:900px){
    .upscaler-settings-sidebar{
        position:static !important;
        top:auto !important;
        right:auto !important;
        width:auto !important;
    }
}

/* v1.5.36 sidebar alignment: top aligned with the left upload panel */


/* v1.5.36 mobile layout: controls first */
@media(max-width:900px){
    .upscaler-workspace{
        display:flex !important;
        flex-direction:column !important;
        grid-template-columns:none !important;
        gap:12px !important;
    }

    .upscaler-settings-sidebar{
        order:-1 !important;
        position:static !important;
        top:auto !important;
        right:auto !important;
        width:100% !important;
        max-width:none !important;
        max-height:none !important;
        overflow:visible !important;
        margin:0 0 4px 0 !important;
        box-sizing:border-box !important;
    }

    .upscaler-main{
        order:1 !important;
        width:100% !important;
        min-width:0 !important;
    }
}

@media(max-width:600px){
    .upscaler-settings-sidebar{
        padding:12px !important;
    }

    .upscaler-settings-sidebar .form-input,
    .upscaler-settings-sidebar select,
    .upscaler-settings-sidebar button.settings-btn,
    .upscaler-settings-sidebar .switch-banner-btn{
        width:100% !important;
        min-height:44px !important;
    }

    .upscaler-thumb-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:8px !important;
    }

    .upscaler-thumb{
        width:100% !important;
    }

    .upscaler-thumb-media{
        width:100% !important;
        height:auto !important;
        aspect-ratio:1 / 1 !important;
    }
}


/* v1.5.36 mobile-only: hide top explanatory intro copy */
@media(max-width:900px){
  #upscaler-msg .message-text > p:first-of-type{display:none !important;}
}


/* v1.5.36 dashboard branding placement */
.pictag-sidebar-brand-row{
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
    flex-wrap:nowrap !important;
}
[data-pictag-center-brand-hidden="1"]{
    display:none !important;
}


/* v1.5.36 BETA badge retirement */
.pictag-sidebar-beta,
[data-pictag-sidebar-beta],
[data-beta-badge],
[class~="beta-badge"],
[class~="badge-beta"],
[class~="release-beta"]{
    display:none !important;
}


/* v1.5.36 dashboard feature carousel safeguard */
#featureCarousel{
    display:flex !important;
}
#featureCarousel[data-pictag-center-brand-hidden="1"]{
    display:flex !important;
}


/* v1.5.36 dashboard carousel simplification */
[data-pictag-dashboard-subtitle-hidden="1"]{
    display:none !important;
}

/* Remove all feature icons from the dashboard carousel. */
#featureCarousel .feature-icon{
    display:none !important;
}

/* Pull the card content upward now that icons are gone. */
#featureCarousel .feature-card{
    padding-top:16px !important;
}
#featureCarousel .feature-card h4{
    margin-top:0 !important;
    margin-bottom:8px !important;
}
#featureCarousel .feature-card p{
    margin-top:0 !important;
}


/* v1.5.36 AI Narrator prompt control */
#pictagNarratorToggle .pictag-narrator-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1em;
    height:1em;
    pointer-events:none;
}
#pictagNarratorToggle .pictag-narrator-icon svg{
    display:block;
    width:100%;
    height:100%;
    color:inherit;
}


/* v1.5.36 narrator visibility guard */
#pictagNarratorToggle{
    display:inline-flex !important;
    visibility:visible !important;
    opacity:1 !important;
    flex:0 0 auto !important;
}


/* v1.5.36 guaranteed prompt-bar placement */
#pictagNarratorToggle{
    display:inline-flex !important;
    visibility:visible !important;
    opacity:1 !important;
    align-items:center !important;
    justify-content:center !important;
    flex:0 0 auto !important;
    cursor:pointer !important;
}

/* Only used if the existing prompt control cannot be cloned. */
#pictagNarratorToggle:not([class]){
    width:34px !important;
    height:34px !important;
    padding:0 !important;
    border:0 !important;
    border-radius:50% !important;
    background:transparent !important;
    color:var(--text-secondary,#8f8f9c) !important;
}
#pictagNarratorToggle:not([class]):hover{
    background:rgba(255,255,255,.06) !important;
    color:var(--text-primary,#f4f4f5) !important;
}


/* v1.5.36 per-response Read aloud */
[data-pictag-read-aloud="active"]{
    opacity:1 !important;
}


/* v1.5.36 Read aloud speaker icon */
[data-pictag-read-aloud]{
    display:inline-flex !important;
    align-items:center !important;
    gap:5px !important;
}

.pictag-read-aloud-icon{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex:0 0 auto !important;
    width:14px !important;
    height:14px !important;
    color:inherit !important;
    opacity:.9;
    pointer-events:none;
}

.pictag-read-aloud-icon svg{
    display:block !important;
    width:100% !important;
    height:100% !important;
    color:inherit !important;
}

[data-pictag-read-aloud]:hover .pictag-read-aloud-icon,
[data-pictag-read-aloud="active"] .pictag-read-aloud-icon{
    opacity:1;
}

.pictag-read-aloud-label{
    color:inherit !important;
    pointer-events:none;
}


/* v1.5.36 Read aloud action pill styling */
[data-pictag-read-aloud]{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:6px !important;
    min-height:28px !important;
    padding:6px 12px !important;
    border:1px solid var(--border-color,#2c2c31) !important;
    border-radius:999px !important;
    background:var(--bg-primary,#0d0d10) !important;
    color:var(--text-primary,#f4f4f5) !important;
    line-height:1 !important;
    text-decoration:none !important;
    transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease !important;
}
[data-pictag-read-aloud]:hover{
    background:color-mix(in srgb,var(--bg-primary,#0d0d10) 80%, white 20%) !important;
    border-color:var(--border-color,#2c2c31) !important;
    color:var(--text-primary,#fff) !important;
}
[data-pictag-read-aloud="active"]{
    background:color-mix(in srgb,var(--bg-primary,#0d0d10) 78%, white 22%) !important;
    border-color:var(--border-color,#2c2c31) !important;
    color:var(--text-primary,#fff) !important;
    box-shadow:none !important;
}
[data-pictag-read-aloud]:focus-visible{
    outline:none !important;
    box-shadow:none !important;
}
.pictag-read-aloud-label{
    font-weight:600 !important;
    line-height:1 !important;
}


/* v1.5.39 carousel new-chat regression fix */
#welcomeScreen .feature-carousel-wrap,
#welcomeScreen #featureCarousel{
    visibility:visible !important;
    opacity:1 !important;
}
#welcomeScreen #featureCarousel{
    display:flex !important;
}


/* v1.5.39 assistant response action pills */
[data-pictag-message-action="1"]{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:6px !important;
    min-height:28px !important;
    padding:6px 12px !important;
    border:1px solid var(--border-color,#2c2c31) !important;
    border-radius:999px !important;
    background:var(--bg-primary,#0d0d10) !important;
    color:var(--text-primary,#f4f4f5) !important;
    line-height:1 !important;
    text-decoration:none !important;
    box-shadow:none !important;
    transition:background .15s ease,border-color .15s ease,color .15s ease !important;
}
[data-pictag-message-action="1"]:hover,
[data-pictag-message-action="1"]:focus,
[data-pictag-message-action="1"]:focus-visible{
    background:color-mix(in srgb,var(--bg-primary,#0d0d10) 80%, white 20%) !important;
    border-color:var(--border-color,#2c2c31) !important;
    color:var(--text-primary,#fff) !important;
    box-shadow:none !important;
    outline:none !important;
}
[data-pictag-message-action="1"]:active{
    background:color-mix(in srgb,var(--bg-primary,#0d0d10) 74%, white 26%) !important;
    border-color:var(--border-color,#2c2c31) !important;
    box-shadow:none !important;
}
[data-pictag-message-actions="1"]{
    gap:10px !important;
}


/* v1.5.39 compact assistant action pills — match Reprompt height */
[data-pictag-message-action="1"],
[data-pictag-read-aloud]{
    box-sizing:border-box !important;
    height:30px !important;
    min-height:30px !important;
    max-height:30px !important;
    padding:0 11px !important;
    border-radius:999px !important;
    line-height:28px !important;
    font-size:12px !important;
    white-space:nowrap !important;
}

[data-pictag-message-action="1"] svg,
[data-pictag-read-aloud] svg{
    width:13px !important;
    height:13px !important;
}

.pictag-read-aloud-icon{
    width:13px !important;
    height:13px !important;
}

.pictag-read-aloud-label{
    line-height:1 !important;
}


/* v1.5.39 prevent nested response-action pills */
[data-pictag-message-action="1"] .pictag-read-aloud-icon,
[data-pictag-message-action="1"] .pictag-read-aloud-label{
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    padding:0 !important;
    min-height:0 !important;
    height:auto !important;
}


/* v1.5.43 popup-menu AI Upscaler item */
[data-pictag-upscaler-tool-menu="1"]{
    cursor:pointer;
}
[data-pictag-upscaler-menu-icon="1"] svg{
    color:inherit !important;
}
